Round-six lemma `dOut_run`
ProvedNLogN.KFW.dOut_runAn 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.KFWC15):
theorem NLogN.KFW.dOut_run (s : IState HS) (f : Fin HS → List ℤ) (P K D S ρ r p w : ℤ) (rest X : List ℤ)
(h36 : f 36 = P :: K :: D :: S :: ρ :: r :: p :: w :: rest)
(he : ∀ j : Fin HS, j ∈ [(21 : Fin HS), 1, 22, 3, 23, 4, 26, 25] → f j = []) {B : ℕ}
(hB : ∀ x ∈ [P, K, D, S, ρ, r, p, w], zsz x ≤ B) :
IRuns Isym tbl (dOut (Pp := Pp)) (encK s (Function.update (NLogN.KFW.fIn f P K D S ρ r p w rest) 0 X))
(encK s (Function.update f 0 X)) (8 * (2 * moveCost B + 19))
Context. KFW C-layer 15: the entry procedure (descriptor in and out)
p14C jG: move P, K, D, S, ρ, r from the descriptor stack 36 to the registers
21, 1, 22, 3, 23, 4, p to stack 26 and w to register 25 (dIn), run mainC jG (the
remaining descriptor entry Z and stack 26 lie in the background), and move everything back
(dOut). p14Q: the whole run on encK st f.
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.KFW
open IntMul NLogN.KIL NLogN.KFD NLogN.KFB NLogN.KFG NLogN.KFH NLogN.KFN Complex Butterfly
variable {Pp : ℕ}
variable {Isym : List Sym} {tbl : Fin Pp → IStmt HS Pp}
theorem NLogN.KFW.dOut_run (s : IState HS) (f : Fin HS → List ℤ) (P K D S ρ r p w : ℤ) (rest X : List ℤ)
(h36 : f 36 = P :: K :: D :: S :: ρ :: r :: p :: w :: rest)
(he : ∀ j : Fin HS, j ∈ [(21 : Fin HS), 1, 22, 3, 23, 4, 26, 25] → f j = []) {B : ℕ}
(hB : ∀ x ∈ [P, K, D, S, ρ, r, p, w], zsz x ≤ B) :
IRuns Isym tbl (dOut (Pp := Pp)) (encK s (Function.update (NLogN.KFW.fIn f P K D S ρ r p w rest) 0 X))
(encK s (Function.update f 0 X)) (8 * (2 * moveCost B + 19)) := by sorry