Complete finite Chan–He reduction from ordinary integer 3SUM #
Adapted from Anthropic's FromNumbers.lean, lines 261–299 and 396–468,
at formal-math@16a5ce41304fcdaea4e0be7c132e1c361dc26da5.
The generic distinct-position frontend and array packing are imported rather than duplicated.
The construction uses only finite sets, deterministic prime searches and bounded recursion.
Main definitions #
instances: finite one-array convolution instances of the ordinary 3SUM input.scanPairs: the candidate-prime/element count, explicitly not a RAM running time.
Main results #
instances_correct: equivalence for everyn ≥ 1and every input bounded byU.length_instances_le: at most(2 * labelBits (2U)^2 + 2) * (2 * log₂ n + 2)^5instances.abs_instances_le: every output entry has magnitude at most120U + 40.
No native preprocessing, word-width threshold or charged-time claim follows from this module.
References #
- T. M. Chan and Q. He, Reducing 3SUM to Convolution-3SUM, Theorem 5.1.
Candidate-prime/element pairs scanned by both searches at all nodes.
This is a combinatorial count, not a charged running time. In particular it omits sieving,
sorting/counting residues, search tests, heavy-element extraction, frontend and array writing.
The mathematical coll definition itself enumerates ordered pairs.
Instances For
reduction_correct with one-array instances, read at length 8 * mPar n U ^ 2.
The whole reduction #
Correctness of the whole reduction. Let x consist of n ≥ 1 integers of absolute value
at most U. Then three entries of x at different positions sum to 0 iff one of the instances,
read at length 8 * mPar n (2 * U) ^ 2, has a solution.