Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

All-edges Exact Triangle in time O(κ n3−143/68400log⁡2n)O(\kappa\, n^{3-143/68400}\log^2 n)O(κn3−143/68400log2n) from the pruned Lop detection

Proved
Light.Sec3.claim_aeUniform_mid

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

apsp-299791apsp-exponentexact-trianglefine-grained-complexity

Assume Lop-AE-SparseTri detection has the running time of the thin regime, that is, LopDetectP\mathrm{LopDetectP}LopDetectP holds: for some C≥0C\ge0C≥0 the problem is solved in a time TdT_dTd​ with

Td(n,D,w)≤C(n2log⁡2DD0.07618+w D0.44274log⁡D+nD+w+1)whenever D≥2, D91≤n5.T_d(n,D,w)\le C\Big(\frac{n^2\log^2D}{D^{0.07618}}+w\,D^{0.44274}\log D+nD+w+1\Big)\quad\text{whenever }D\ge2,\ D^{91}\le n^5 .Td​(n,D,w)≤C(D0.07618n2log2D​+wD0.44274logD+nD+w+1)whenever D≥2, D91≤n5.

Then All-Edges Exact Triangle is solved, uniformly in the size and the weights, in time

T(s,u)=K s 3−143/68400 (log⁡s+1)2 (1+log⁡max⁡(u,2))2T(s,u)=K\,s^{\,3-143/68400}\,(\log s+1)^2\,(1+\log\max(u,2))^2T(s,u)=Ks3−143/68400(logs+1)2(1+logmax(u,2))2

for some constant K≥1K\ge1K≥1, where sss is the number of vertices per part and uuu an upper bound on the absolute values of the weights.

Here All-Edges Exact Triangle asks, given integer weight matrices wAB,wBC,wAC∈Zs×sw_{AB},w_{BC},w_{AC}\in\mathbb Z^{s\times s}wAB​,wBC​,wAC​∈Zs×s, for the flag of every pair (a,b)(a,b)(a,b) telling whether some ccc has wAB(a,b)+wBC(b,c)+wAC(a,c)=0w_{AB}(a,b)+w_{BC}(b,c)+w_{AC}(a,c)=0wAB​(a,b)+wBC​(b,c)+wAC​(a,c)=0; Lop-AE-SparseTri is Definition 13 of Alman and Vassilevska Williams. "Solved in time TTT" refers to programs of the library's light language, which compiles to the word RAM: one program solves every instance within the bound, with a polynomially bounded need of memory and word size.

The exponent comes from Theorem 17 for the all-edges host at the middle dimension with D=⌊n13/228⌋D=\lfloor n^{13/228}\rfloorD=⌊n13/228⌋ and g=⌈D11/300⌉g=\lceil D^{11/300}\rceilg=⌈D11/300⌉: the oracle is called at inner dimension about D289/300≈n0.0549D^{289/300}\approx n^{0.0549}D289/300≈n0.0549, inside the regime D91≤n5D^{91}\le n^5D91≤n5, and 14368400=11300⋅13228\tfrac{143}{68400}=\tfrac{11}{300}\cdot\tfrac{13}{228}68400143​=30011​⋅22813​. This bound is what the reduction from APSP to all-edges Exact Triangle consumes.

Formalization Note The statement is Claim.LopDetectP aeModel → Claim.ExactTriangleUniform aeModel (143 / 68400) 2, where ExactTriangleUniform M δ e says M.exactTriangle (uniformTime K δ e) for some K ≥ 1, and aeModel reads "Exact Triangle" as the all-edges task.

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.Sec3
open ThreeSumApsp
Formal statement
theorem Light.Sec3.claim_aeUniform_mid (hlop : Claim.LopDetectP aeModel) :
    Claim.ExactTriangleUniform aeModel (143 / 68400) 2 := 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/AllEdges/Theorem19Mid.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), Theorems 17 and 19 (pp. 33-35). 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