Round-six lemma `setup_of`
ProvedJ6Seg.Src.setup_ofAn 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.J6SegILSrc19):
theorem J6Seg.Src.setup_of {Pp : ℕ} {I : List Sym} {tbl : Fin Pp → IStmt HS Pp} {dA Z Z1 Cm : Fin HS}
(hP : ParkOK dA Z Z1 Cm) (hZ : ZOK Z) {body : IStmt HS Pp} {dn : RS}
{k pre post sv t p α d W : ℕ} (hW : parBig 0 0 0 0 k pre post sv t p α d < 2 ^ W) (hW3 : 3 ≤ W)
(cs : List (ℤ × ℤ)) (n' : ℕ) (K1 K2 : List ℤ) {cB cD : ℕ}
(hbody : ∀ s0 v c, ParV 0 0 0 0 pre post sv t p α d v → BV W v →
(∀ j, j ≠ 0 → j ≠ sZ → j ≠ Z → c j = []) →
IRuns I tbl body (encK s0 (RF v c)) (encK s0 (regOut (RF v c) cs pre post n' K1 K2)) cB)
(hdn : ∀ s0 F, (∀ i, F (ρS i) = []) → F Cm = [] →
Sp dn (encK s0 (regOut F cs pre post n' K1 K2)) (encK s0 F) cD)
(C : ℝ) (hCu : ((frameC W d sv p + cB : ℕ) : ℝ) ≤ C) (hCd : (cD : ℝ) ≤ C) :
SetupS I tbl (upF dA Z Z1 Cm body) dn.code ρS dA (dsc k pre post sv t p α d)
(slabV cs pre post n' K1 K2) C
Context. B-line IL, source-table producers, part 19: SetupS for the four slab passes
setup_of: a body taking RF v c to regOut (RF v c) cs … (for every v with ParV and every
c empty off 0, sZ, Z) and a tear-down taking regOut F cs … back to F give
SetupS … (upF dA Z Z1 Cm body) dn ρS dA desc (slabV cs …) C.
setup1/3/5/7: the four passes (body1/3/5/7, dn0/dn7).
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_Defs70 set_option autoImplicit false set_option relaxedAutoImplicit false set_option maxHeartbeats 1000000 open J6Seg J6Seg.Src open IntMul NLogN NLogN.KIL Function NLogN.RS J6Seg open J6Seg.PreT hiding rg RF RF_in RF_out upd_RF_in upd_RF_out cE InRg open J6Seg.Slab (srcTab flatC ctlB ctlCost) open J6Seg.PJ (rg RF RF_in RF_out ParV BV parBig cPar dsc) open J6Seg.Ax (ρS sZ slabV SetupS)
theorem J6Seg.Src.setup_of {Pp : ℕ} {I : List Sym} {tbl : Fin Pp → IStmt HS Pp} {dA Z Z1 Cm : Fin HS}
(hP : ParkOK dA Z Z1 Cm) (hZ : ZOK Z) {body : IStmt HS Pp} {dn : RS}
{k pre post sv t p α d W : ℕ} (hW : parBig 0 0 0 0 k pre post sv t p α d < 2 ^ W) (hW3 : 3 ≤ W)
(cs : List (ℤ × ℤ)) (n' : ℕ) (K1 K2 : List ℤ) {cB cD : ℕ}
(hbody : ∀ s0 v c, ParV 0 0 0 0 pre post sv t p α d v → BV W v →
(∀ j, j ≠ 0 → j ≠ sZ → j ≠ Z → c j = []) →
IRuns I tbl body (encK s0 (RF v c)) (encK s0 (regOut (RF v c) cs pre post n' K1 K2)) cB)
(hdn : ∀ s0 F, (∀ i, F (ρS i) = []) → F Cm = [] →
Sp dn (encK s0 (regOut F cs pre post n' K1 K2)) (encK s0 F) cD)
(C : ℝ) (hCu : ((frameC W d sv p + cB : ℕ) : ℝ) ≤ C) (hCd : (cD : ℝ) ≤ C) :
SetupS I tbl (upF dA Z Z1 Cm body) dn.code ρS dA (dsc k pre post sv t p α d)
(slabV cs pre post n' K1 K2) C := by sorry