Deterministic 3SUM in word-RAM steps
ProvedThreeSum1962.threeSum_boundFor every fixed , there exist a finite deterministic word-RAM program , a natural constant , and a step-bound function that work for every input size and every word width . On integers with , the program halts within steps and accepts exactly when there are pairwise distinct indices with .
For the rational exponent , the bound is the foundation definition EndStatement.BigO T r: there is a natural constant such that for every . For nonnegative , this is . Repeated values at distinct positions are allowed; no witness triple is required, and inputs with must be rejected.
Use the foundation mission’s existing definitions without restating them.
The exponent is exactly . The source theorem is Race.bound, proved by ThreeSum.solvedInTime_981_500; the source repository reports completed local proof and axiom checks. The complete proof remains in the cited repository; this proposal includes source links only and does not establish Prove2Me proof acceptance.
import Definitions.Def_TrulySubcubicAPSP_SourceSpecification set_option autoImplicit false set_option relaxedAutoImplicit false
theorem ThreeSum1962.threeSum_bound :
EndStatement.ThreeSum.SolvedInTime 1.962 := by sorryRead-back
What the Lean code literally says, in plain math · gpt-6
For every nonnegative integer , there exist a finite deterministic program , nonnegative integers and , and a function , all chosen independently of the input size, input values, and word width, such that for every integer ; the exponents and come from the exact rational number . These choices must also satisfy the following condition: for every nonnegative integer , every sequence of integers with for every , and every nonnegative integer word width with , where and for , running from program position on the memory specified below must halt within steps with some Boolean verdict and some final memory , with if and only if there exist indices such that , , , and as an equality of the original integers. The indices must be distinct, but the corresponding integer values need not be distinct. Memory has a cell at every integer address, each containing a -bit word, represented by a residue in . Initially cell contains reduced modulo , cell contains reduced modulo for every , and every other cell, including every negative-addressed cell, contains zero. For , a word with residue has signed value when and otherwise; for the only word has residue and signed value zero. The instructions available to are exactly the following: write the word obtained from the integer into a fixed cell; add, subtract, or multiply the words in two fixed cells and write the result, reduced modulo , into a fixed cell; read the signed value of the word in a fixed cell as an address and copy the word at that address into a fixed cell; read the signed value of the word in a fixed cell as an address and copy the word from another fixed cell to that address; jump to a fixed nonnegative program position if the signed value in a fixed cell is negative, and otherwise proceed to the next position; accept; or reject. Every fixed cell address appearing in an instruction is an integer. Every writing instruction proceeds to the next program position after updating only its destination cell. Acceptance returns verdict with the current memory, and rejection returns verdict with the current memory. Program positions are numbered starting at , and attempting a position outside the finite program executes a rejection. Every executed instruction consumes one step, including an accept, reject, or rejection at an out-of-range position; an execution with zero available steps returns no verdict. There is no additional output requirement on the final memory. Correctness and halting are required also for and , although the displayed growth bound constrains only ; for each , the required verdict is . The input bound is vacuous when , and , including when . There are no separate positivity assumptions on or , and the quantification over widths includes whenever it satisfies the stated width inequality.
Confirmed by the mission captain (proposal self-audit).