Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

The (min,+)-product in time O(T(n,36u)log⁡2u)O(T(n,36u)\log^2 u)O(T(n,36u)log2u) from all-edges Exact Triangle in time TTT

Proved
Light.Sec3.mp_solvedIn

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

apsp-299791apsp-exponentfine-grained-complexitymin-plus-product

Let T(n,u)T(n,u)T(n,u) be a time in which All-Edges Exact Triangle is solved (on nnn vertices per part with weights of absolute value at most uuu), with T(n,u)≥n2T(n,u)\ge n^2T(n,u)≥n2 for n≥1n\ge1n≥1. Then there is a constant C≥0C\ge0C≥0 such that the (min⁡,+)(\min,+)(min,+)-product of n×nn\times nn×n integer matrices with entries of absolute value at most uuu is solved in time

C⋅6000  T(n,36u) log⁡+(6u) log⁡+u,log⁡+v=log⁡max⁡(v,2).C\cdot 6000\;T(n,36u)\,\log^{+}(6u)\,\log^{+}u,\qquad \log^{+}v=\log\max(v,2).C⋅6000T(n,36u)log+(6u)log+u,log+v=logmax(v,2).

The problems. All-Edges Exact Triangle: given wAB,wBC,wAC∈Zn×nw_{AB},w_{BC},w_{AC}\in\mathbb Z^{n\times n}wAB​,wBC​,wAC​∈Zn×n, output for every pair (a,b)(a,b)(a,b) 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. The (min⁡,+)(\min,+)(min,+)-product: given A,B∈Zn×nA,B\in\mathbb Z^{n\times n}A,B∈Zn×n stored in memory, write Cij=min⁡k(Aik+Bkj)C_{ij}=\min_k(A_{ik}+B_{kj})Cij​=mink​(Aik​+Bkj​) to the output area, changing no other cell below the free pointer. "Solved in time TTT" refers to programs of the library's light language, which compiles to the word RAM: one program, with a polynomially bounded need, solves every instance with n≥1n\ge1n≥1 and bound 1≤U≤u1\le U\le u1≤U≤u within T(n,u)T(n,u)T(n,u) steps.

The reduction goes through the all-pairs problem: for every pair (i,j)(i,j)(i,j) decide whether some kkk has Aik+Bkj<VijA_{ik}+B_{kj}<V_{ij}Aik​+Bkj​<Vij​ for a threshold matrix VVV. Each such question reduces to all-edges Exact Triangle over the binary prefixes of the weights (with weights scaled by 666), and the (min⁡,+)(\min,+)(min,+)-product follows by binary search on every entry with O(log⁡u)O(\log u)O(logu) all-pairs calls. This is Theorem 21(b) of Alman and Vassilevska Williams with the decision problem replaced by its all-edges version, so that no factor n1/3n^{1/3}n1/3 is lost.

Formalization Note The statement is SolvedIn aeTask T → (∀ n u, 1 ≤ n → (n:ℝ)^2 ≤ T n u) → ∃ C ≥ 0, SolvedIn mpTask (fun n u => C * (6000 * (T n (6 * (6 * u)) * logU (6 * u)) * logU u)), with logU v = log (max v 2).

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 ThreeSumApsp.WordRam
Formal statement
theorem Light.Sec3.mp_solvedIn {T : ℕ → ℝ → ℝ} (hT : SolvedIn aeTask T)
    (hsq : ∀ (n : ℕ) (u : ℝ), 1 ≤ n → (n : ℝ) ^ 2 ≤ T n u) :
    ∃ C : ℝ, 0 ≤ C ∧ SolvedIn mpTask fun n u =>
      C * (6000 * (T n (6 * (6 * u)) * logU (6 * u)) * logU u) := 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/Chain.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), Theorem 21(b) (pp. 35-36) and Theorem 22 (p. 36). 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