Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Round-six lemma `stageU_sp`

Proved
NLogN.KIL.stageU_sp

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

complexity-theoryinteger-multiplicationkappa-improvement

An auxiliary lemma of the round-six development, published as a separate node because its proof is long or shared.

The following holds (Lean statement, in the scope of module Solutions.KIL4Tbl):

theorem NLogN.KIL.stageU_sp (t : IState HS) {Q Bb : ℕ} (T : List ℤ) (L : List Item)
    (h14 : t.G 14 = ints T ++ L) (a c : ℕ) (LA LC LM LAM LN : List Item)
    (hSA : t.G sSA = .int a :: LA) (hSC : t.G sSC = .int c :: LC)
    (hSM : t.G sSM = .int T.length :: LM) (hSAM : t.G sSAM = .int ((a * T.length : ℕ) : ℤ) :: LAM)
    (hNQ : t.G sNQ = .int (-(Q : ℤ)) :: LN) (hc : c < Q) (hT : InR Q T)
    (hQ : zsz ((2 * Q : ℕ) : ℤ) ≤ Bb) (hM : zsz (T.length : ℤ) ≤ Bb) (ha : zsz (a : ℤ) ≤ Bb)
    (haM : zsz ((a * T.length : ℕ) : ℤ) ≤ Bb) :
    Sp stageU t (((((t.upd 14 (ints (stg Q a c T) ++ L)).upd sSA LA).upd sSC LC).upd sSM LM).upd
      sSAM LAM) (cStageU a T.length Bb)

Context. KIL4: the offset table generator with run-time stage data

KIL2's genP Q ac has one stage per field of the prefix A of the target, every number (Q, the radix a, the control c, the suffix volume M) a literal. The uniform generator genPU n reads the stages from four stage stacks (34 … 37: a, c, M, a·M, the last stage on top) and -Q from the parameter stack 23; its code depends only on the number n of stages.

  • gStageT, rsim_gStage: the stage as a template; the literal stage simulates it.
  • stagesU_sp, genPU_sp: the generator pushes tbl Q ac on stack 14, pops the stage stacks.
  • tbl_zeros, tbl_app_congr: the table only depends on the controls; runs of control-0 fields collapse to one field of their volume (the "collapsed" stage lists of the uniform shifts have at most 2m + 3 stages whatever the shape).

Formalization Note. Part of the Lean formalization of the round-six κ-improvement (integer-multiplication-kappa campaign, target IntMul.Kappa.jain_round6_framework). The statement is copied verbatim from the Lean development; the platform node carries the same declaration name. Definitions it mentions live in the IntMul_Kappa_R6_Defs* bundles (on top of the published κ bundles IntMul_Kappa_K_Defs*).

Preamble
-- Round-six κ development (integer-multiplication-kappa), generated by skeleton subtraction.

import Definitions.Def_IntMul_Kappa_K_Defs33
import Definitions.Def_IntMul_Kappa_R6_Defs1
import Mathlib
import Definitions.Def_IntMul_HvdH_M_Defs8
import Definitions.Def_IntMul_MultitapeModel

set_option autoImplicit false
set_option relaxedAutoImplicit false
set_option maxHeartbeats 1000000

open NLogN NLogN.KIL
open IntMul NLogN.RS AModel
Formal statement
theorem NLogN.KIL.stageU_sp (t : IState HS) {Q Bb : ℕ} (T : List ℤ) (L : List Item)
    (h14 : t.G 14 = ints T ++ L) (a c : ℕ) (LA LC LM LAM LN : List Item)
    (hSA : t.G sSA = .int a :: LA) (hSC : t.G sSC = .int c :: LC)
    (hSM : t.G sSM = .int T.length :: LM) (hSAM : t.G sSAM = .int ((a * T.length : ℕ) : ℤ) :: LAM)
    (hNQ : t.G sNQ = .int (-(Q : ℤ)) :: LN) (hc : c < Q) (hT : InR Q T)
    (hQ : zsz ((2 * Q : ℕ) : ℤ) ≤ Bb) (hM : zsz (T.length : ℤ) ≤ Bb) (ha : zsz (a : ℤ) ≤ Bb)
    (haM : zsz ((a * T.length : ℕ) : ℤ) ≤ Bb) :
    Sp stageU t (((((t.upd 14 (ints (stg Q a c T) ++ L)).upd sSA LA).upd sSC LC).upd sSM LM).upd
      sSAM LAM) (cStageU a T.length Bb) := by sorry
Source
S. Jain, round-six networks for the integer-multiplication κ-improvement campaign (https://github.com/Swapnil-jain/integer-mult-kappa, commit 5868dc7) and D. Colkitt, integer-mult-bounds (https://github.com/CrocSwap/integer-mult-bounds); target `IntMul.Kappa.jain_round6_framework`. Lean declaration `NLogN.KIL.stageU_sp`, Solutions/KIL4Tbl.lean (lines 117–160) of the round-six development.

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