Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Uniform Exact Triangle saving 9261/50000009261/50000009261/5000000

Proved
TrulySubquadratic3SUM.exactTriangleUniform_9261_5000000

by marwahaha · Oct 6, 2026 · Mathlib 0df444a (Lean v4.33.1)

3sumalgorithmsfine-grained-complexityword-ram

There exist a real constant K≥1K\ge1K≥1 and a single deterministic program in the Light word-RAM model, with polynomially bounded resource needs, that decides whether an integer-weighted complete tripartite graph with sss vertices in each part has a triangle whose three edge weights sum to zero. For every natural s≥1s\ge1s≥1, natural weight bound U≥1U\ge1U≥1, and real u≥Uu\ge Uu≥U, its time on instances with absolute edge weights at most UUU is at most Ks3−9261/5000000(log⁡s+1)(1+log⁡(max⁡{2,u}))2K s^{3-9261/5000000}(\log s+1)(1+\log(\max\{2,u\}))^2Ks3−9261/5000000(logs+1)(1+log(max{2,u}))2, with natural logarithms. This is an open algorithmic target.

Preamble
import Definitions.Def_APSPSource_RemainingDefinitions
import Definitions.Def_APSPSource_ThreeSumApsp_TimeClaims_Sec3_Definitions

set_option autoImplicit false
set_option relaxedAutoImplicit false
Formal statement
theorem TrulySubquadratic3SUM.exactTriangleUniform_9261_5000000 :
    ThreeSumApsp.Claim.ExactTriangleUniform Light.lightModel (9261 / 5000000) 1 := by sorry
Source
Open parameter-refinement target inspired by Alman and Vassilevska Williams (2026), using the existing Anthropic formal-math source at commit e1a4e6508154ea59f030480661590a9fe3018011. This target is proposed here, not asserted as a proved result of the paper. Generic inner construction: https://github.com/anthropics/formal-math/blob/e1a4e6508154ea59f030480661590a9fe3018011/3sum-apsp/ThreeSumApsp/RunningTimes/Sec4/Corollary31_32.lean. Parameter estimates: https://github.com/anthropics/formal-math/blob/e1a4e6508154ea59f030480661590a9fe3018011/3sum-apsp/ThreeSumApsp/Sec4/Table2.lean.
Read-back

What the Lean code literally says, in plain math · Codex

There exist a real constant K≥1K\ge 1K≥1, a finite program PPP consisting of a list of procedure bodies, a natural-number procedure index ppp with a body present at position ppp of PPP, a function t:N×N→Nt:\mathbb N\times\mathbb N\to\mathbb Nt:N×N→N, and three functions w,h,q:N×N→Nw,h,q:\mathbb N\times\mathbb N\to\mathbb Nw,h,q:N×N→N, with the following properties. There exist natural numbers s,ks,ks,k such that, for every n,U∈Nn,U\in\mathbb Nn,U∈N, each of w(n,U),h(n,U),q(n,U)w(n,U),h(n,U),q(n,U)w(n,U),h(n,U),q(n,U) is at most 2s((n+1)(U+1))k2^s((n+1)(U+1))^k2s((n+1)(U+1))k. For every n,U∈Nn,U\in\mathbb Nn,U∈N with n≥1n\ge1n≥1 and U≥1U\ge1U≥1, and every real u≥Uu\ge Uu≥U, the time bound satisfies t(n,U)≤Kn 3−9261/5000000(log⁡n+1)(1+log⁡(max⁡(u,2)))2t(n,U)\le K n^{\,3-9261/5000000}(\log n+1)(1+\log(\max(u,2)))^2t(n,U)≤Kn3−9261/5000000(logn+1)(1+log(max(u,2)))2, where log⁡\loglog is the natural logarithm and the power of nnn has a real exponent. The same program, index, time function, resource functions and polynomial constants work for all these parameters. Its correctness requirement is as follows: for every finite list RRR of additional procedure bodies, every integer word limit MMM, natural-number memory limit SSS and call-depth limit DDD, every starting depth d∈Nd\in\mathbb Nd∈N, every n,U∈Nn,U\in\mathbb Nn,U∈N, three natural-number base addresses α,β,γ\alpha,\beta,\gammaα,β,γ, three integer lists A,B,CA,B,CA,B,C, every memory μ:N→Z\mu:\mathbb N\to\mathbb Zμ:N→Z, and every free pointer f∈Nf\in\mathbb Nf∈N, assume n,U≥1n,U\ge1n,U≥1, each list has length n2n^2n2, every list entry has absolute value at most UUU, and, for every 0≤j<n20\le j<n^20≤j<n2, μ(α+j)=Aj\mu(\alpha+j)=A_jμ(α+j)=Aj​, μ(β+j)=Bj\mu(\beta+j)=B_jμ(β+j)=Bj​, and μ(γ+j)=Cj\mu(\gamma+j)=C_jμ(γ+j)=Cj​; also assume α+n2,β+n2,γ+n2≤f\alpha+n^2,\beta+n^2,\gamma+n^2\le fα+n2,β+n2,γ+n2≤f, w(n,U)≤Mw(n,U)\le Mw(n,U)≤M, f+h(n,U)≤Sf+h(n,U)\le Sf+h(n,U)≤S, S≤MS\le MS≤M, and d+q(n,U)≤Dd+q(n,U)\le Dd+q(n,U)≤D. Starting the body at index ppp in the extended program PPP followed by RRR, at depth ddd, with local variables 0,1,2,3,4,50,1,2,3,4,50,1,2,3,4,5 equal to n,U,α,β,γ,fn,U,\alpha,\beta,\gamma,fn,U,α,β,γ,f respectively, every other local variable zero, and memory μ\muμ, there exist a final local-variable map, a final memory μ′\mu'μ′, and a natural-number step count c≤t(n,U)c\le t(n,U)c≤t(n,U) forming a terminating execution under these limits. The final local variable 000 is 111 if there exist indices 0≤i,j,ℓ<n0\le i,j,\ell<n0≤i,j,ℓ<n with Ain+j+Bjn+ℓ+Cin+ℓ=0A_{in+j}+B_{jn+\ell}+C_{in+\ell}=0Ain+j​+Bjn+ℓ​+Cin+ℓ​=0, and is 000 otherwise; these three indices need not be numerically distinct. Moreover, μ′(a)=μ(a)\mu'(a)=\mu(a)μ′(a)=μ(a) for every natural address a<fa<fa<f. The language has natural-number constants, numbered integer local variables, integer addition, subtraction and multiplication, and memory-load expressions; its tests compare two expressions using <<< or ===, and its statements are skip, local assignment, memory store, sequencing, conditional, while loop, and a call to a numbered procedure. Expressions are evaluated over the integers. A memory address must lie in [0,S)[0,S)[0,S); its conversion to a natural number therefore preserves it, although the underlying total conversion sends negative integers to zero outside valid executions. A constant expression must be at most MMM; an arithmetic expression requires its subexpressions to be safe and the absolute value of its result to be at most MMM; a load requires a safe address expression and an address in [0,S)[0,S)[0,S); reading a local variable has no separate magnitude condition, and a load imposes no separate magnitude condition on the value read. Assignments require safe expressions, stores require safe address and value expressions and a valid address, and each executed test requires both expressions to be safe. Each constant, variable read, arithmetic operation, and load costs one step in addition to the costs of its subexpressions; a comparison costs the costs of its two expressions plus one. Skip costs zero; assignment adds one to its expression cost; store adds one to the costs of its two expressions; sequencing adds the costs; an executed conditional or loop test adds one to its comparison cost, with the costs of the selected branch or executed loop bodies also charged. A call requires safe arguments, an existing procedure body in the extended program, and current depth less than DDD; it evaluates the arguments, runs that body at depth increased by one with the argument values in consecutive locals starting at zero and all other locals zero, shares memory, then replaces the caller's designated result local by the callee's final local 000 while retaining the other caller locals; its cost is the total argument-expression cost plus two plus the body cost. The initial entry into the selected body is not itself charged as a call. The matrix regions need not be disjoint, but simultaneous storage requirements must hold wherever they overlap. All other initial memory cells are arbitrary, including cells at and above fff, and their values are not globally assumed bounded. The matrix-list lookup has default value zero outside a list, but the stipulated lengths and index ranges keep the tested entries in range. The correctness premise excludes n=0n=0n=0 and U=0U=0U=0, so it imposes no execution requirement for those values, while the polynomial bounds on w,h,qw,h,qw,h,q still quantify over them; the time comparison likewise applies only when n,U≥1n,U\ge1n,U≥1 and u≥Uu\ge Uu≥U, and thus says nothing for u<1u<1u<1. It includes n=1n=1n=1, U=1U=1U=1 and all real uuu between 111 and 222, where the weight-logarithm factor uses log⁡2\log 2log2. For choices of memory, layout or limits failing any stated premise, no execution is required.

Human review
  • Endorsed by marwahaha · Oct 6, 2026

    Confirmed by the moderator at approval.

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 paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me