Round-six lemma `zipK`
ProvedNLogN.KFD.FSp.zipKAn 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.zipK {A Z O C : Fin HS} (hAZ : A ≠ Z) (hAO : A ≠ O) (hZO : Z ≠ O) (hAC : A ≠ C)
(hZC : Z ≠ C) (hOC : O ≠ C) (hA5 : A.val < 56) (hZ5 : Z.val < 56) (hO5 : O.val < 56)
(hC5 : C.val < 56) (s : IState HS) (f : Fin HS → List ℤ) (a b la lb : List ℤ)
(hfA : f A = a ++ la) (hfZ : f Z = b ++ lb) (hab : a.length = b.length)
(ha : Bits a) (hb : Bits b) (hfC : f C = []) (Bb : ℕ)
(hn : zsz (a.length : ℤ) ≤ Bb) :
FSp (zipK A Z O C a.length) (encK s f)
(encK s (Function.update (Function.update (Function.update f A la) Z lb) O
((List.zipWith xr a b).reverse ++ f O))) (cLp a.length 200000 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.zipK {A Z O C : Fin HS} (hAZ : A ≠ Z) (hAO : A ≠ O) (hZO : Z ≠ O) (hAC : A ≠ C)
(hZC : Z ≠ C) (hOC : O ≠ C) (hA5 : A.val < 56) (hZ5 : Z.val < 56) (hO5 : O.val < 56)
(hC5 : C.val < 56) (s : IState HS) (f : Fin HS → List ℤ) (a b la lb : List ℤ)
(hfA : f A = a ++ la) (hfZ : f Z = b ++ lb) (hab : a.length = b.length)
(ha : Bits a) (hb : Bits b) (hfC : f C = []) (Bb : ℕ)
(hn : zsz (a.length : ℤ) ≤ Bb) :
FSp (zipK A Z O C a.length) (encK s f)
(encK s (Function.update (Function.update (Function.update f A la) Z lb) O
((List.zipWith xr a b).reverse ++ f O))) (cLp a.length 200000 Bb) := by sorry