A Cartesian 3SUM grid saturates every small coprime residue filter
ProvedThreeSumFuture.cartesian_grid_saturates_residue_caps3sumalgorithmsnumber-theory
Given k-element operand lists with values qki and qj for indices below k, every target residue modulo m contains at least h distinct true pair sums whenever q and m are positive and coprime and mh is at most k squared. The result exhibits an injection from h indices into the actual represented values of the specified residue. A prime step above k squared therefore saturates every modulus up to k squared divided by h simultaneously, even if a procedure chooses its modulus from the input or separately for each request.
Preamble
import Mathlib.Data.Nat.ModEq import Mathlib.Tactic.Ring set_option autoImplicit false
Formal statement
theorem ThreeSumFuture.cartesian_grid_saturates_residue_caps (k q m z h : ℕ) (hk : 0 < k) (hq : 0 < q) (hm : 0 < m)
(hcop : q.Coprime m) (hspace : m * h ≤ k * k) :
∃ f : Fin h ↪ ℕ, ∀ t,
(∃ i < k, ∃ j < k, f t = q * (k*i) + q*j) ∧ f t ≡ z [MOD m] := by sorrySource
Direct construction for the grouped-moment 3SUM frontier and its verified residue sieve, https://prove2.me/theorems/139795bc-0140-5852-9feb-815ca0e50c65. The proof uses Mathlib's two-modulus Chinese remainder theorem. The positive moment support threshold is https://prove2.me/theorems/f3d02372-09c9-532b-a04d-761eae1d6570.