Documentation

CslibFrontier.Algorithms.WordRAM.ThreeSum.LowerBound

Native 3SUM input-reading lower bound #

On the negative input [1, -1, 1, …, 1], changing any tail position to zero creates a distinct-position 3SUM witness. Consequently every correct native program must read every tail cell. The proof uses actual flat runs, canonical signed encoding, the Decision.MagnitudeBoundedInput promise domain, and the size-only Decision.width threshold shared with the fast algorithm: width is the same for the two inputs, and every width above the threshold is admitted. Width-reading instructions, arbitrary basis operations and writes are permitted. The low-level decidesInTime_lowerBound theorem retains the conditional Decision.Admissible form for arbitrary integer lists.

This adapts the unread-cell adversary argument in the source module ModelChecks.ThreeSumLowerBound, oddVec through not_solvedInTimeAt_threeSum, in anthropics/formal-math@16a5ce41304fcdaea4e0be7c132e1c361dc26da5. It does not import that source's signed modular RAM or its time predicate. Here a load reads one unsigned memory word, the input is length-prefixed, registers start zero, overflow faults, and the halt is charged.

Main definitions #

Main results #

A negative 3SUM instance with n independently sensitive tail positions.

An odd sum of values in {1, -1} cannot vanish.

theorem Cslib.Algorithms.WordRAM.ThreeSum.hardInput_set_solution (n i : ℕ) (hi : i < n) :
ThreeSum.HasSolution fun (j : Fin ((hardInput n).set (i + 2) 0).length) => ((hardInput n).set (i + 2) 0)[j]

Replacing any tail entry by zero produces the witness at positions 0, 1, i+2.

Every entry of hardInput n satisfies the polynomial magnitude bound for any exponent κ.

theorem Cslib.Algorithms.WordRAM.ThreeSum.hardInput_set_bounded (κ n i : ℕ) (z : ℤ) :
z ∈ (hardInput n).set (i + 2) 0 → |z| ≤ ↑((((hardInput n).set (i + 2) 0).length + 2) ^ κ)

Every entry of the perturbed adversary input satisfies the polynomial magnitude bound for any exponent κ.

The negative adversary input carried into the polynomial-magnitude promise domain.

The perturbed positive adversary input carried into the polynomial-magnitude promise domain.

theorem Cslib.Algorithms.WordRAM.ThreeSum.decidesInTime_lowerBound {B : WordRAM.Basis} {r κ n w : ℕ} {p : WordRAM.Program B r} {time : List ℤ → ℕ → ℕ} (h : p.DecidesInTime (fun (x : ℕ) (input : List ℤ) => List.map WordRAM.Signed.encode input) {input : List ℤ | ThreeSum.HasSolution fun (i : Fin input.length) => input[i]} time (Decision.Admissible κ)) (hw : Decision.width κ 123357 (n + 2) ≤ w) :
n + 1 ≤ time (hardInput n) w

Every deterministic native program deciding the existing admitted 3SUM problem has a linear worst-case input-reading cost. The n tail reads and final halt are all charged. The statement holds over any basis, even one with arbitrary unit-cost arithmetic.

theorem Cslib.Algorithms.WordRAM.ThreeSum.not_uniformDecidableInO_sublinear (B : WordRAM.Basis) (κ : ℕ) {a : ℝ} (ha : a < 1) :
¬WordRAM.UniformDecidableInO B {input : Decision.MagnitudeBoundedInput κ | ThreeSum.HasSolution fun (i : Fin (↑input).length) => (↑input)[i]} (fun (x : ℕ) (input : Decision.MagnitudeBoundedInput κ) => List.map WordRAM.Signed.encode ↑input) (fun (input : Decision.MagnitudeBoundedInput κ) => (↑input).length) (fun (n x : ℕ) => ⌈↑n ^ a⌉₊) fun (input : Decision.MagnitudeBoundedInput κ) (W : ℕ) => Decision.width κ 123357 (↑input).length ≤ W

The established native 3SUM decision notion cannot hold at any exponent below one on the polynomial-magnitude promise domain. The magnitude exponent is arbitrary, including zero. Both adversarial inputs fit the same physical width; no input-dependent width or advice is assumed.