Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Complete expansion-232 program and runtime bridge

Proved
ThreeSum1960614.costs_solve_3sum

by Yuxuan Xu · Oct 14, 2026 · Mathlib 0df444a (Lean v4.33.1)

3sumalgorithmsentropyword-ram

For every positive rational rrr strictly above all twelve costs of the fixed expansion-232 quartic parameter choice, deterministic integer 3SUM satisfies the campaign's exact shared word-RAM specification in O(nr)O(n^r)O(nr) time. The theorem must construct a finite program for each fixed integer-size exponent, preserve distinct input positions and repetitions, reject sizes below three, and establish correctness for every sufficiently large word width together with instruction, addressing and memory costs. No solver oracle or assumed program-correctness contract is a hypothesis. This is the remaining algorithmic extension sought by this mission: the source package explicitly leaves it unproved.

Preamble
import Definitions.Def_ThreeSum1960614_Analysis
import Definitions.Def_TrulySubcubicAPSP_SourceSpecification

set_option autoImplicit false
set_option relaxedAutoImplicit false
open ThreeSum1960614
Formal statement
theorem ThreeSum1960614.costs_solve_3sum (r : ℚ)
    (hr : 0 < r) (hcost : ∀ z ∈ costs, z < (r : ℝ)) :
    EndStatement.ThreeSum.SolvedInTime r := by sorry
Source
User-supplied 3sum_certificate_1p960614_v3/3sum_certificate_v3/PROOF.md (14 October 2026); Sections 0, 4–6: outstanding algorithmic extension; upstream https://github.com/c0ldzy17/three-sum-lean/tree/2b639655e07421b9ac743de9090459bab473a7c0
Read-back

What the Lean code literally says, in plain math · GPT-6


declaration: ThreeSum1960614.costs_solve_3sum readback_model: GPT-6

For every rational number rrr, assume 0<r0<r0<r and assume that each of the following twelve real numbers is strictly less than the real number represented by rrr. Here e=203889696/1000000000e=203889696/1000000000e=203889696/1000000000, d=62656016/1000000000d=62656016/1000000000d=62656016/1000000000, s=193175570/1000000000s=193175570/1000000000s=193175570/1000000000, and H(t)=(−tln⁡t−(1−t)ln⁡(1−t))/ln⁡2H(t)=\bigl(-t\ln t-(1-t)\ln(1-t)\bigr)/\ln 2H(t)=(−tlnt−(1−t)ln(1−t))/ln2 is the binary entropy in base two; all arguments of HHH appearing below lie strictly between zero and one:

232eH(1/232),1+e(116H(1/232)+d),2−es,2−e(1/2−d−H(40409899/1000000000)),2−e(1/2+d−(464H(1/464)−232H(1/232)−1)−(2790503/10000000)(1+s+2d)),2−e(13/20−1/2+d−(464H(1/464)−232H(1/232)−1)),(8e/5)(116H(1/232)+1/2),2+e(4/5−(232/5)H(1/232)+2d),1+e(1/2+d),2−e(116H(1/232)−d),2−2e(116H(1/232)−d),1.\begin{aligned} &232eH(1/232),\\ &1+e\bigl(116H(1/232)+d\bigr),\\ &2-es,\\ &2-e\bigl(1/2-d-H(40409899/1000000000)\bigr),\\ &2-e\Bigl(1/2+d-\bigl(464H(1/464)-232H(1/232)-1\bigr) -(2790503/10000000)(1+s+2d)\Bigr),\\ &2-e\Bigl(13/20-1/2+d-\bigl(464H(1/464)-232H(1/232)-1\bigr)\Bigr),\\ &(8e/5)\bigl(116H(1/232)+1/2\bigr),\\ &2+e\bigl(4/5-(232/5)H(1/232)+2d\bigr),\\ &1+e(1/2+d),\\ &2-e\bigl(116H(1/232)-d\bigr),\\ &2-2e\bigl(116H(1/232)-d\bigr),\\ &1. \end{aligned}​232eH(1/232),1+e(116H(1/232)+d),2−es,2−e(1/2−d−H(40409899/1000000000)),2−e(1/2+d−(464H(1/464)−232H(1/232)−1)−(2790503/10000000)(1+s+2d)),2−e(13/20−1/2+d−(464H(1/464)−232H(1/232)−1)),(8e/5)(116H(1/232)+1/2),2+e(4/5−(232/5)H(1/232)+2d),1+e(1/2+d),2−e(116H(1/232)−d),2−2e(116H(1/232)−d),1.​

Then, for every natural number κ\kappaκ (including zero), there exist a finite program PPP, a natural number bbb (with no separately imposed positivity condition), and a function T:N→NT:\mathbb N\to\mathbb NT:N→N with the following two properties simultaneously. First, writing the positive rational r=p/qr=p/qr=p/q in lowest terms with positive integer numerator ppp and positive integer denominator qqq, there exists a natural number KKK such that, for every natural number n≥2n\ge2n≥2, T(n)q≤KnpT(n)^q\le K n^pT(n)q≤Knp. Second, for every natural number nnn, every function x:{0,…,n−1}→Zx:\{0,\ldots,n-1\}\to\mathbb Zx:{0,…,n−1}→Z, and every natural word width WWW, if ∣x(i)∣≤nκ|x(i)|\le n^\kappa∣x(i)∣≤nκ for every input position iii and W≥b(⌊log⁡2n⌋+1)W\ge b(\lfloor\log_2 n\rfloor+1)W≥b(⌊log2​n⌋+1), then there exist a Boolean verdict vvv and a final memory mmm assigning a WWW-bit word to every integer address such that running PPP from program position zero on the initial memory specified below halts within T(n)T(n)T(n) steps with precisely verdict vvv and memory mmm, and

v=true⟺∃i,j,k∈{0,…,n−1},i≠j ∧ j≠k ∧ i≠k ∧ x(i)+x(j)+x(k)=0.v=\mathrm{true}\quad\Longleftrightarrow\quad \exists i,j,k\in\{0,\ldots,n-1\},\quad i\ne j\ \land\ j\ne k\ \land\ i\ne k\ \land\ x(i)+x(j)+x(k)=0.v=true⟺∃i,j,k∈{0,…,n−1},i=j ∧ j=k ∧ i=k ∧ x(i)+x(j)+x(k)=0.

The sum and absolute-value bound in this equivalence and its hypothesis are operations on the original, unbounded integers. The witnesses P,b,TP,b,TP,b,T may depend on κ\kappaκ and the fixed rrr but must work simultaneously for all permitted n,x,Wn,x,Wn,x,W; KKK is also chosen before nnn. In the width bound, the natural-number binary logarithm is defined to be zero at n=0n=0n=0, is zero at n=1n=1n=1, and is ⌊log⁡2n⌋\lfloor\log_2 n\rfloor⌊log2​n⌋ for positive nnn. Initial memory contains the integer nnn reduced modulo 2W2^W2W at address zero, x(i)x(i)x(i) reduced modulo 2W2^W2W at address i+1i+1i+1 for 0≤i<n0\le i<n0≤i<n, and the zero word at every other integer address, including all negative addresses. The program is a finite list whose positions are numbered by natural numbers; each instruction is exactly one of the following: write the word for 111 into a specified integer-addressed cell; write into a specified cell the sum, difference, or product of the words in two specified cells, with these word operations performed modulo 2W2^W2W; load into a specified cell the word at the address obtained by reading another specified cell as a signed integer; store the word in a specified source cell at the address obtained by reading another specified cell as a signed integer; branch to a specified natural program position if a specified cell read as a signed integer is negative, otherwise advance to the next position; accept with Boolean verdict true; or reject with Boolean verdict false. Each cell named directly by an instruction may have any integer address, and an indirect signed address may also be negative. For W>0W>0W>0, signed word interpretation uses the interval [−2W−1,2W−1−1][-2^{W-1},2^{W-1}-1][−2W−1,2W−1−1]; for W=0W=0W=0, the sole word and its signed interpretation are zero, so even writing 111 yields zero. Every write updates only its destination cell and advances to the next program position; branches change only the program position; accept and reject return the current memory. Executing at any position beyond the list's end executes reject. Every executed instruction, including accept, reject, and rejection beyond the end, consumes one step; with no steps remaining there is no returned verdict or memory, even if the next instruction would halt. The default output predicate is true: the output function reads, for each natural aaa, the signed word in final-memory cell n+1+an+1+an+1+a, but no condition is imposed on those words or on any other final-memory contents. The strict cost hypotheses include 1<r1<r1<r, and equality with any listed cost does not meet the hypotheses. Correctness is required also at n=0,1,2n=0,1,2n=0,1,2, where there are no three distinct positions and the program must reject; at n=0n=0n=0 the input bound is vacuous, and when κ=0\kappa=0κ=0 the convention n0=1n^0=1n0=1 applies even at n=0n=0n=0. The power bound imposes no inequality at n=0n=0n=0 or n=1n=1n=1, although the halting and correctness requirement still applies there. Width zero is included if the chosen bbb makes its lower bound zero; there is no separate hypothesis requiring positive WWW or requiring exact signed representation of the input words.

Human review
  • Endorsed by Shuze Chen · Oct 14, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Yuxuan Xu · Oct 14, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me