Uniform Exact Triangle saving
ProvedTrulySubquadratic3SUM.exactTriangleUniform_9261_5000000There exist a real constant 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 vertices in each part has a triangle whose three edge weights sum to zero. For every natural , natural weight bound , and real , its time on instances with absolute edge weights at most is at most , with natural logarithms. This is an open algorithmic target.
import Definitions.Def_APSPSource_RemainingDefinitions import Definitions.Def_APSPSource_ThreeSumApsp_TimeClaims_Sec3_Definitions set_option autoImplicit false set_option relaxedAutoImplicit false
theorem TrulySubquadratic3SUM.exactTriangleUniform_9261_5000000 :
ThreeSumApsp.Claim.ExactTriangleUniform Light.lightModel (9261 / 5000000) 1 := by sorryRead-back
What the Lean code literally says, in plain math · Codex
There exist a real constant , a finite program consisting of a list of procedure bodies, a natural-number procedure index with a body present at position of , a function , and three functions , with the following properties. There exist natural numbers such that, for every , each of is at most . For every with and , and every real , the time bound satisfies , where is the natural logarithm and the power of 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 of additional procedure bodies, every integer word limit , natural-number memory limit and call-depth limit , every starting depth , every , three natural-number base addresses , three integer lists , every memory , and every free pointer , assume , each list has length , every list entry has absolute value at most , and, for every , , , and ; also assume , , , , and . Starting the body at index in the extended program followed by , at depth , with local variables equal to respectively, every other local variable zero, and memory , there exist a final local-variable map, a final memory , and a natural-number step count forming a terminating execution under these limits. The final local variable is if there exist indices with , and is otherwise; these three indices need not be numerically distinct. Moreover, for every natural address . 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 ; 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 ; an arithmetic expression requires its subexpressions to be safe and the absolute value of its result to be at most ; a load requires a safe address expression and an address in ; 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 ; 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 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 , 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 and , so it imposes no execution requirement for those values, while the polynomial bounds on still quantify over them; the time comparison likewise applies only when and , and thus says nothing for . It includes , and all real between and , where the weight-logarithm factor uses . For choices of memory, layout or limits failing any stated premise, no execution is required.
Confirmed by the moderator at approval.