Round-six lemma `dupK`
ProvedNLogN.KFD.FSp.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.KFDOps):
theorem NLogN.KFD.FSp.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 = []) (w Bb : ℕ) (hL : Bnd w L)
(hn : zsz (L.length : ℤ) ≤ Bb) :
FSp (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))) (cLp L.length (9000 * (w + 2)) Bb)
Context. KFD: fine element loops
Fine (FSp) versions of the element loops of KIL3Ops (dupK, dropK, zeroK, zipK), of
mvK with a register count, and of the conditional / c-way branch (sel). The per-element
cost depends only on a data bound w (bits: w = 1); the count enters only through the
loop overhead cRep N = O(N + zsz N).
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.KFD open IntMul NLogN.RS open NLogN.KIL
theorem NLogN.KFD.FSp.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 = []) (w Bb : ℕ) (hL : Bnd w L)
(hn : zsz (L.length : ℤ) ≤ Bb) :
FSp (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))) (cLp L.length (9000 * (w + 2)) Bb) := by sorry