Round-six lemma `dupK`
ProvedNLogN.KIL.Sp.dupKAn 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.KIL3Ops):
theorem NLogN.KIL.Sp.dupK {X Y Z C : Fin HS} (hXY : X ≠ Y) (hXZ : X ≠ Z) (hYZ : Y ≠ Z) (hXC : X ≠ C)
(hYC : Y ≠ C) (hZC : Z ≠ C) (hX5 : X.val < 56) (hY5 : Y.val < 56) (hZ5 : Z.val < 56)
(hC5 : C.val < 56) (s : IState HS) (f : Fin HS → List ℤ) (L l : List ℤ)
(hfX : f X = L ++ l) (hfC : f C = []) (Bb : ℕ) (hL : Bnd Bb L)
(hn : zsz (L.length : ℤ) ≤ Bb) :
Sp (dupK X Y Z C L.length) (encK s f)
(encK s (Function.update (Function.update (Function.update f X l) Y (L.reverse ++ f Y)) Z
(L.reverse ++ f Z))) (cDup L.length Bb)
Context. KIL3: generic stack operations on managed states
Element-wise loops used by the one-stack network: dupK (copy n integers to two stacks),
dropK (discard n integers), zeroK (push n zeros), zipK (pointwise addition mod 2 of two
stacks). All are stated on managed states encK s 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.KIL open IntMul NLogN.RS AModel
theorem NLogN.KIL.Sp.dupK {X Y Z C : Fin HS} (hXY : X ≠ Y) (hXZ : X ≠ Z) (hYZ : Y ≠ Z) (hXC : X ≠ C)
(hYC : Y ≠ C) (hZC : Z ≠ C) (hX5 : X.val < 56) (hY5 : Y.val < 56) (hZ5 : Z.val < 56)
(hC5 : C.val < 56) (s : IState HS) (f : Fin HS → List ℤ) (L l : List ℤ)
(hfX : f X = L ++ l) (hfC : f C = []) (Bb : ℕ) (hL : Bnd Bb L)
(hn : zsz (L.length : ℤ) ≤ Bb) :
Sp (dupK X Y Z C L.length) (encK s f)
(encK s (Function.update (Function.update (Function.update f X l) Y (L.reverse ++ f Y)) Z
(L.reverse ++ f Z))) (cDup L.length Bb) := by sorry