Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Moment inequality and crude-guard assembly for κ\kappaκ-improvement networks

Definition
IntMul_KappaFramework

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

complexity-theoryinteger-multiplication

Vocabulary for the community improvements of the exponent saving κ\kappaκ in T(n)=O(n(lg⁡n)1−κ)T(n)=O(n(\lg n)^{1-\kappa})T(n)=O(n(lgn)1−κ), built on the OpenAI manuscript Integer multiplication below nlog⁡nn\log nnlogn and on D. Colkitt's framework.

  1. Child-width histogram. A finite linear interchange network of full width mmm with WWW roles is summarised by a list of pairs (w,nw)(w,n_w)(w,nw​): it makes nwn_wnw​ recursive child calls of width www. Its moment at exponent τ\tauτ is
histMoment(h,m,τ)=∑(w,nw)∈hnw(wm)τ.\mathrm{histMoment}(h,m,\tau)=\sum_{(w,n_w)\in h} n_w\Big(\frac{w}{m}\Big)^{\tau}.histMoment(h,m,τ)=(w,nw​)∈h∑​nw​(mw​)τ.

The network certifies the recursive saving aaa (cost exponent 1−a1-a1−a) when histMoment(h,m,1−a)<W\mathrm{histMoment}(h,m,1-a)<WhistMoment(h,m,1−a)<W. Its rank sum is s=histRankSum(h)=∑w nws=\mathrm{histRankSum}(h)=\sum w\,n_ws=histRankSum(h)=∑wnw​.

  1. Crude-guard assembly. For the bit saving aba_bab​, complex saving aca_cac​ and parameters β,ε,x,C1\beta,\varepsilon,x,C_1β,ε,x,C1​, put τ=1−ab\tau=1-a_bτ=1−ab​, σ=1−ac\sigma=1-a_cσ=1−ac​, χ=τ+(1−β)max⁡(σ−τ,0)\chi=\tau+(1-\beta)\max(\sigma-\tau,0)χ=τ+(1−β)max(σ−τ,0), ℓ=σ+β(1−σ)\ell=\sigma+\beta(1-\sigma)ℓ=σ+β(1−σ), λ=max⁡(τ,σ,χ)+10−16\lambda=\max(\tau,\sigma,\chi)+10^{-16}λ=max(τ,σ,χ)+10−16, λ′=max⁡(λ,ℓ)+10−16\lambda'=\max(\lambda,\ell)+10^{-16}λ′=max(λ,ℓ)+10−16, δ=10−22/x\delta=10^{-22}/xδ=10−22/x and poly=(1+x)δ\mathrm{poly}=(1+x)\deltapoly=(1+x)δ. Then CrudeAssembly(ab,ac,β,ε,x,C1,κ,mc,sc)\mathrm{CrudeAssembly}(a_b,a_c,\beta,\varepsilon,x,C_1,\kappa,m_c,s_c)CrudeAssembly(ab​,ac​,β,ε,x,C1​,κ,mc​,sc​) says that
0<β<1,2+mcln⁡sc≤C1,λ′<1,ε(2−λ′)<1,εC1<1+x,3ε<1+x,0<\beta<1,\quad 2+m_c\ln s_c\le C_1,\quad \lambda'<1,\quad \varepsilon(2-\lambda')<1,\quad \varepsilon C_1<1+x,\quad 3\varepsilon<1+x,0<β<1,2+mc​lnsc​≤C1​,λ′<1,ε(2−λ′)<1,εC1​<1+x,3ε<1+x, 0<ε<1,2ε−1<λ′ε,0<δ<18,0<\varepsilon<1,\quad 2\varepsilon-1<\lambda'\varepsilon,\quad 0<\delta<\tfrac18,0<ε<1,2ε−1<λ′ε,0<δ<81​,

and that κ\kappaκ is strictly below each cost margin

1−ε,ε(1−λ′),1−ε−poly,ε,max⁡(ε,1−ε)(1−τ).1-\varepsilon,\qquad \varepsilon(1-\lambda'),\qquad 1-\varepsilon-\mathrm{poly},\qquad \varepsilon,\qquad \max(\varepsilon,1-\varepsilon)(1-\tau).1−ε,ε(1−λ′),1−ε−poly,ε,max(ε,1−ε)(1−τ).

These are the constraints and margins of scripts/certificate_round3.py with the crude depth guard (the complex recursion's dependency depth is bounded using its width mcm_cmc​ and rank sum scs_csc​), which Jain's rounds three to eight use to turn the two network savings into κ\kappaκ.

Formalization Note The λ\lambdaλ gaps 10−1610^{-16}10−16, δ=10−22/x\delta=10^{-22}/xδ=10−22/x and the sub-block parameter y=εy=\varepsilony=ε are fixed exactly as in the script. The Lean checker kappaOK of the source replaces C1C_1C1​ by any value with C1≥2+mc⋅ln⁡‾(sc)C_1\ge 2+m_c\cdot\overline{\ln}(s_c)C1​≥2+mc​⋅ln(sc​); here the real logarithm is used.

Definition code
import Mathlib

/-!
# Exponent bookkeeping of the community κ-improvements (Colkitt framework)

Shared vocabulary for the conditional κ-improvement witnesses built on the OpenAI manuscript
*Integer multiplication below n log n* and D. Colkitt's `integer-mult-bounds`.

* A finite linear network is summarised by its child-width histogram: `n_w` recursive child
  calls of width `w` (out of the full width `m`), on a network with `W` roles.  The recursive
  saving `a` of the network is certified by the moment inequality
  `∑_w n_w (w/m)^(1-a) < W` (`histMoment`).
* `CrudeAssembly` is the assembly of `scripts/certificate_round3.py` of
  S. Jain's `integer-mult-kappa` with the crude depth guard: from the bit saving `a_b`, the
  complex saving `a_c` and the parameters `β, ε, x, C₁`, every strict constraint holds and
  every cost margin exceeds `κ`.
-/

namespace IntMul.Kappa

/-- The moment `∑ n_w (w/m)^τ` of a child-width histogram, given as a list of pairs
`(w, n_w)`. -/
noncomputable def histMoment (h : List (ℕ × ℕ)) (m : ℕ) (τ : ℝ) : ℝ :=
  (h.map fun p => (p.2 : ℝ) * ((p.1 : ℝ) / m) ^ τ).sum

/-- The rank sum `s = ∑ w n_w` of a child-width histogram: the total width of all child
calls. -/
def histRankSum (h : List (ℕ × ℕ)) : ℕ :=
  (h.map fun p => p.1 * p.2).sum

/-- The crude-guard assembly of `certificate_round3.py` (with `y = ε`): with
`τ = 1 - a_b`, `σ = 1 - a_c`, `χ = τ + (1-β) max(σ-τ, 0)`, `leaf = σ + β(1-σ)`,
`λ = max(τ, σ, χ) + 10⁻¹⁶`, `λ' = max(λ, leaf) + 10⁻¹⁶`, `δ = 10⁻²²/x` and
`poly = (1+x)δ`, all constraints of the stack hold and `κ` lies strictly below each of
the cost margins `1-ε`, `ε(1-λ')`, `1-ε-poly`, `ε` and `max(ε,1-ε)(1-τ)`. Here `m_c` and
`s_c` are the width and rank sum of the complex network. -/
def CrudeAssembly (ab ac β ε x C₁ κ : ℝ) (mc sc : ℕ) : Prop :=
  let τ := 1 - ab
  let σ := 1 - ac
  let χ := τ + (1 - β) * max (σ - τ) 0
  let leaf := σ + β * (1 - σ)
  let lam := max (max τ σ) χ + 1 / 10 ^ 16
  let lamp := max lam leaf + 1 / 10 ^ 16
  let δ := 1 / 10 ^ 22 / x
  let poly := (1 + x) * δ
  (0 < β ∧ β < 1) ∧
  2 + (mc : ℝ) * Real.log sc ≤ C₁ ∧
  lamp < 1 ∧
  ε * (2 - lamp) < 1 ∧
  ε * C₁ < 1 + x ∧
  2 * ε + ε < 1 + x ∧
  0 < ε ∧ ε < 1 ∧
  2 * ε - 1 < lamp * ε ∧
  (0 < δ ∧ δ < 1 / 8) ∧
  κ < 1 - ε ∧
  κ < ε * (1 - lamp) ∧
  κ < 1 - ε - poly ∧
  κ < ε ∧
  κ < max ε (1 - ε) * (1 - τ)

end IntMul.Kappa
Source
https://github.com/Swapnil-jain/integer-mult-kappa/tree/5868dc701a9bec375c9dc5391d992ab3b8c35f3f — scripts/certificate_round3.py (function evaluate, guard='crude': constraints `cons`, margins `margins`), lean/Round8.lean (momentOK, kappaOK); framework of D. Colkitt, https://github.com/CrocSwap/integer-mult-bounds/tree/56b66d58297deca1d7dd130247d720e960f77a37

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