Worst-case bound on the run time of the all-edges host at the middle dimension after the choice of the prime
ProvedLight.Sec3.MidTime.midRunTime_leLet be an Exact Triangle instance with vertices per part and weight bound satisfying the precondition of the host in a memory with free pointer , let and , and let be any time function of the Lop-AE-SparseTri solver. Write , and . Then the time of the run after the choice of the prime, for the host data with inner dimension , is bounded by an expression that no longer depends on the prime or on the instance data:
where the loop bound is
Here is the largest time of the solver on vertices, inner dimension and at most query pairs, and is the bound on the false positives of the hashing (with and the constant of the hashing lemma).
The bound uses that the prime is at most , that there are at most instances and chunks, that each instance has inner dimension and at most query pairs, and that the scans are at most the false positives plus the pairs (each pair is scanned to success at most once). It is the step from the time of one run to the bound of Theorem 17 at the middle dimension.
Formalization Note The statement is aeRunTime Tn (midHostData x D g) x.U ≤ tDblTable (bitLen x.U) + 3 * tResidues (x.n * x.n) (bitLen x.U) + tClasses x.n (Nat.sqrt D) + tChunks (Nat.sqrt D) (4 * x.n * g) + midLoopBound Tn x.n x.U D g + 80, under x.Pre μ fr and BigCase x.n D g; all quantities are natural numbers.
/-
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.Spec
variable {P₀ R : Program} {ν : Et17Nums} {pAEBrute pAELoop pScanPairsAE pCore pFill : ℕ}
{Tn : List ℕ → ℕ} {need : List ℕ → Need} {Dfun Gfun tD tG wD wG : ℕ → ℕ}
open Light.Sec3.MidTime
variable {x : TriInst} {μ : ℕ → ℤ} {fr D g : ℕ}
theorem Light.Sec3.MidTime.midRunTime_le (hpre : x.Pre μ fr) (hbig : BigCase x.n D g) (Tn : List ℕ → ℕ) :
aeRunTime Tn (midHostData x D g) x.U
≤ tDblTable (bitLen x.U) + 3 * tResidues (x.n * x.n) (bitLen x.U)
+ tClasses x.n (Nat.sqrt D) + tChunks (Nat.sqrt D) (4 * x.n * g)
+ midLoopBound Tn x.n x.U D g + 80 := by sorry