Round-six lemma `tabGenR_fsp`
ProvedIntMul.Kappa.R6.IL2C.tabGenR_fspAn 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.R6IL2CTab):
theorem IntMul.Kappa.R6.IL2C.tabGenR_fsp {T : Ex HS} {tf : ℤ → ℤ → ℤ} {Bb : ℕ} {Tm Rv : ℤ} (hT : SegTR T tf Bb Tm Rv)
(sgn : ℤ) (hs : sgn = 1 ∨ sgn = -1) {Q d1 d2 n : ℕ} {ru rv rw w0 : ℤ}
(hv : TVal Q d1 d2 ru rv rw w0 Tm n Bb)
(s : IState HS) (F : Fin HS → List ℤ) (hp : TPar (encK s F) Q d1 d2 ru rv rw w0 Rv n)
(P : ℕ) {L1 : List Item} (hP1 : (encK s F).G 1 = .int (P : ℤ) :: L1) (zP : zsz (P : ℤ) ≤ Bb)
(hq : F rq = []) (hc : F IntMul.Kappa.R6.IL2C.rC = []) :
FSp (tabGenR sgn T) (encK s F)
(encK s (Function.update F 14
((List.range P).map (fun p => (tabE sgn tf ru rv rw w0 d1 d2 Q n p : ℤ)) ++ F 14)))
(cTabGenR T Bb n P)
Context. Round six, compact controls (I2C): uniform offset tables and rotations
tabGenR sgn T pushes on stack 14 the table p ↦ (sgn · segSum tf ru rv rw w0 (p/d1) (p/d2) n) mod Q
(p = P-1, …, 0), all parameters on registers:
1: P, 2: Q, 3: d1, 5: d2, 6: ru, 7: rv, 8: rw, 9: w0, 10: n, 11: R (the term T may read R).
rotR pushes the parameters, runs the table generator and the record rotation KFC.rotF
(rotR_runs).
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_R6_Defs21 set_option autoImplicit false set_option relaxedAutoImplicit false set_option maxHeartbeats 1000000 open IntMul IntMul.Kappa IntMul.Kappa.R6 IntMul.Kappa.R6.IL2C open AModel NLogN NLogN.KFL NLogN.KIL NLogN.KFD IntMul NLogN.RS
theorem IntMul.Kappa.R6.IL2C.tabGenR_fsp {T : Ex HS} {tf : ℤ → ℤ → ℤ} {Bb : ℕ} {Tm Rv : ℤ} (hT : SegTR T tf Bb Tm Rv)
(sgn : ℤ) (hs : sgn = 1 ∨ sgn = -1) {Q d1 d2 n : ℕ} {ru rv rw w0 : ℤ}
(hv : TVal Q d1 d2 ru rv rw w0 Tm n Bb)
(s : IState HS) (F : Fin HS → List ℤ) (hp : TPar (encK s F) Q d1 d2 ru rv rw w0 Rv n)
(P : ℕ) {L1 : List Item} (hP1 : (encK s F).G 1 = .int (P : ℤ) :: L1) (zP : zsz (P : ℤ) ≤ Bb)
(hq : F rq = []) (hc : F IntMul.Kappa.R6.IL2C.rC = []) :
FSp (tabGenR sgn T) (encK s F)
(encK s (Function.update F 14
((List.range P).map (fun p => (tabE sgn tf ru rv rw w0 d1 d2 Q n p : ℤ)) ++ F 14)))
(cTabGenR T Bb n P) := by sorry