Round-six lemma `stageU_sp`
ProvedNLogN.KIL.stageU_spAn 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 pushestbl Q acon stack14, pops the stage stacks.tbl_zeros,tbl_app_congr: the table only depends on the controls; runs of control-0fields collapse to one field of their volume (the "collapsed" stage lists of the uniform shifts have at most2m + 3stages 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*).
-- 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
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