Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

The shared stage with pruned encodings meets its specification in every program beginning with base58

Proved
Light.Sec4.shared_base58

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

apsp-299791apsp-exponentdata-structuresprogram-verification

Let RRR be any list of procedures and lim\mathrm{lim}lim limits satisfying the standing assumptions (an address fits in a word, and 100≤word100\le\mathrm{word}100≤word). In the program base58+ ⁣ ⁣+R\mathtt{base58}\mathbin{+\!\!+}Rbase58++R, the procedure sharedP (number 313131) meets the specification of the shared stage with pruned encodings with the constant c30=12 c5+600c_{30}=12\,c_5+600c30​=12c5​+600:

for all parameters p=(L,m,N)p=(L,m,N)p=(L,m,N) with m≤Lm\le Lm≤L, addresses aX,aY,b0a_X,a_Y,b_0aX​,aY​,b0​, matrices X∈ZN×4mX\in\mathbb Z^{N\times4^m}X∈ZN×4m, Y∈Z4m×NY\in\mathbb Z^{4^m\times N}Y∈Z4m×N, a bound VVV, and every memory μ\muμ satisfying the precondition of the shared stage (the matrices stored at aX,aYa_X,a_YaX​,aY​ with entries of absolute value at most VVV, the block from b0b_0b0​ in memory, and the needed numbers fitting in a word), and every depth ddd with d+L+3≤depthd+L+3\le\mathrm{depth}d+L+3≤depth, the call sharedP(L,m,N,4m,aX,aY,b0)\mathrm{sharedP}(L,m,N,4^m,a_X,a_Y,b_0)sharedP(L,m,N,4m,aX​,aY​,b0​) ends within c30⋅sshared(p)c_{30}\cdot s_{\mathrm{shared}}(p)c30​⋅sshared​(p) steps, leaves behind the shared tables, the directory, and for every band β<nB\beta<n_Bβ<nB​ the encodings of the row band of XXX and the column band of YYY at the leaves whose LLL decimal digits contain at most mmm nines, and changes nothing outside the shared part of the block.

The time shape is

sshared(p)=(L+1)2+(⌊K⌋+1)+(K02+1)(L+1)+(N+1)(L−m+1)+(4m+1)(m+1)+nB(r(L,m)+b(p)),s_{\mathrm{shared}}(p)=(L+1)^2+(\lfloor\sqrt K\rfloor+1)+(K_0^2+1)(L+1)+(N+1)(L-m+1)+(4^m+1)(m+1)+n_B\big(r(L,m)+b(p)\big),sshared​(p)=(L+1)2+(⌊K​⌋+1)+(K02​+1)(L+1)+(N+1)(L−m+1)+(4m+1)(m+1)+nB​(r(L,m)+b(p)),

where K=(Lm)K=\binom LmK=(mL​), K0=⌊K⌋K_0=\lfloor\sqrt K\rfloorK0​=⌊K​⌋, b(p)b(p)b(p) is the cost of laying out one band, and r(L,m)=∑j≤m(Lj)9L−jr(L,m)=\sum_{j\le m}\binom Lj9^{L-j}r(L,m)=∑j≤m​(jL​)9L−j is the number of strings of LLL decimal digits with at most mmm nines. The pruned encoder only visits these strings, which replaces the term 10L10^L10L per band of the unpruned shared stage.

base58 is the list of procedures 000-575757: the program of Section 2 for the thin matrix product, the pruned shared stage (292929-313131), eight unused slots, the routines of Section 4 (404040-535353) and the four routines that know the memory map (545454-575757). It is the common beginning of the programs for Theorem 30, Corollaries 26, 31 and 32 and the pruned all-instances program.

“Procedure ppp meets its specification within TTT steps” means: called at any depth ddd allowed by the hypothesis, with the given argument values and a memory μ\muμ satisfying the precondition, the body of ppp terminates within TTT steps without violating the limits, and the returned value and final memory satisfy the postcondition.

Formalization Note The statement is Sec2.SharedSpecP lim (base58P ++ R) cShared30 (the Section 4 program list is named base58P in the uploaded bundles).

Preamble
/-
Copyright (c) 2026 Anthropic, PBC. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
SPDX-License-Identifier: Apache-2.0
-/
-- Generated by skeleton subtraction from the ThreeSumApsp library at commit 27a2fa4bab32.

import Definitions.Def_APSP299791_Defs5

set_option autoImplicit false
set_option relaxedAutoImplicit false

open Light
open Light.Sec4
open ThreeSumApsp ThreeSumApsp.WordRam
Formal statement
theorem Light.Sec4.shared_base58 (R : Program) (lim : Limits) (std : Std lim) :
    Sec2.SharedSpecP lim (base58P ++ R) cShared30 := by sorry
Source
Developed for the prove2.me APSP exponent campaign (https://prove2.me/campaigns/apsp-exponent) on top of the Lean formalization anthropics/formal-math, folder 3sum-apsp, commit e1a4e65 (https://github.com/anthropics/formal-math/tree/e1a4e6508154ea59f030480661590a9fe3018011/3sum-apsp; Lean v4.33.1, Mathlib v4.33.1). The statement comes from the file 3sum-apsp/ThreeSumApsp/Programs/Sec4/Theorem30/Program.lean of the campaign's modified copy of that library, which is not published; the new and modified definitions it uses are in the platform definition bundles APSP299791_Defs1 to APSP299791_Defs5. It builds on J. Alman and V. Vassilevska Williams, "Truly Subquadratic 3SUM and Truly Subcubic APSP via Triangles in Sparse Lopsided Graphs", arXiv:2610.06783v1 (https://arxiv.org/abs/2610.06783v1), Section 2.4 (the shared stage of Theorem 5) and Theorem 30 (pp. 46-47). This result belongs to an improvement of the paper's bounds developed for this campaign and is not stated in the paper.

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