Round-six lemma `xorU_runs`
ProvedNLogN.KFX.xorU_runscomplexity-theoryinteger-multiplicationkappa-improvement
An 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.KFX2Rot):
theorem NLogN.KFX.xorU_runs {Pp : ℕ} {I : List Sym} {iprog : Fin Pp → IStmt HS Pp}
{d Q j : ℕ} (hd : 0 < d) (hQ : 0 < Q) {Bb : ℕ} (hB2 : 2 ≤ Bb)
(zd : zsz (d : ℤ) ≤ Bb) (zQ : zsz (Q : ℤ) ≤ Bb) (zr : zsz ((2 : ℤ) ^ j) ≤ Bb)
(P B w : ℕ) (zP : zsz (P : ℤ) ≤ Bb)
(t : IState HS) (xs : List ℤ) (R : List Item) (hlen : xs.length = P * 2 * B) (hbw : Bnd w xs)
(h0 : t.G 0 = ints xs ++ R) {eP eB ed eQ ej : Ex HS}
(hsz : ((xorPl eP eB ed eQ ej).map fun p => p.2.size + 1).sum ≤ 100)
(n1 : NoLow eP) (n2 : NoLow eB) (n3 : NoLow ed) (n4 : NoLow eQ) (n5 : NoLow ej)
(E1 : ESp eP t Bb (P : ℤ)) (E2 : ESp eB t Bb (B : ℤ)) (E3 : ESp ed t Bb (d : ℤ))
(E4 : ESp eQ t Bb (Q : ℤ)) (E5 : ESp ej t Bb ((2 : ℤ) ^ j)) :
IRuns I iprog (xorU eP eB ed eQ ej) t
(t.upd 0 (ints (pull [P, 2, B] [P, 2, B] (KIL.rotAddr 2 (xorA d Q j)) 0 xs) ++ R))
(cXorU P B w Bb)
Context. KFX §2: register-driven table rotations (the lines (22) and the last bit)
pushSt_G_mem,pushOK_of: pushed parameter lists built fromKFL.ESpfacts.tabRot_runs: a genericwithPushI pl (fcode U ; rotF)whereUpushes the rotation table.tabGenU sgn b:KFL.tabGenwith the literalsP, Q, d0, d1, 2^ρ, f-1, 2^Kread from the registers1, 2, 3, 5, 6, 7, 8(tabGenU_sub: the literal instance isRS.sub).rotU_geo: one linerixT g (rot2 Q (amt K ρ f l))with parameters from expressions.xorGenU,xorU_geo: the last-bit steprixT g (XLc K ρ 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*).
Preamble
-- 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.KFX open IntMul NLogN.RS NLogN.KIL NLogN.KFD NLogN.KFE NLogN.KFB NLogN.KFL NLogN.KFW AModel Butterfly
Formal statement
theorem NLogN.KFX.xorU_runs {Pp : ℕ} {I : List Sym} {iprog : Fin Pp → IStmt HS Pp}
{d Q j : ℕ} (hd : 0 < d) (hQ : 0 < Q) {Bb : ℕ} (hB2 : 2 ≤ Bb)
(zd : zsz (d : ℤ) ≤ Bb) (zQ : zsz (Q : ℤ) ≤ Bb) (zr : zsz ((2 : ℤ) ^ j) ≤ Bb)
(P B w : ℕ) (zP : zsz (P : ℤ) ≤ Bb)
(t : IState HS) (xs : List ℤ) (R : List Item) (hlen : xs.length = P * 2 * B) (hbw : Bnd w xs)
(h0 : t.G 0 = ints xs ++ R) {eP eB ed eQ ej : Ex HS}
(hsz : ((xorPl eP eB ed eQ ej).map fun p => p.2.size + 1).sum ≤ 100)
(n1 : NoLow eP) (n2 : NoLow eB) (n3 : NoLow ed) (n4 : NoLow eQ) (n5 : NoLow ej)
(E1 : ESp eP t Bb (P : ℤ)) (E2 : ESp eB t Bb (B : ℤ)) (E3 : ESp ed t Bb (d : ℤ))
(E4 : ESp eQ t Bb (Q : ℤ)) (E5 : ESp ej t Bb ((2 : ℤ) ^ j)) :
IRuns I iprog (xorU eP eB ed eQ ej) t
(t.upd 0 (ints (pull [P, 2, B] [P, 2, B] (KIL.rotAddr 2 (xorA d Q j)) 0 xs) ++ R))
(cXorU P B w Bb) := by sorrySource
S. Jain, round-six networks for the integer-multiplication κ-improvement campaign (https://github.com/Swapnil-jain/integer-mult-kappa, commit 5868dc7) and D. Colkitt, integer-mult-bounds (https://github.com/CrocSwap/integer-mult-bounds); target `IntMul.Kappa.jain_round6_framework`. Lean declaration `NLogN.KFX.xorU_runs`, Solutions/KFX2Rot.lean (lines 386–456) of the round-six development.