Round-six lemma `proU_runs`
ProvedNLogN.KFUU.R6Crt.proU_runsAn 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.R6CrtRev):
theorem NLogN.KFUU.R6Crt.proU_runs {pM : Fin P} (hMul : MulOK I iprog pM MS) {pS : Fin HS} (hpS : LS pS)
(u cz cr : ℕ) (bs : List Bool) (hu : 1 ≤ u) (hcz : cz = 2 * cr) (hcr : 1 ≤ cr)
(Z : ℕ) (hZ3 : 3 ≤ Z) (hVZ : zsz ((vol (shP u bs) * cz : ℕ) : ℤ) ≤ Z)
(zU : zsz ((2 ^ u : ℕ) : ℤ) ≤ Z)
(t : IState HS) {RS LN LZ L2 : List Item}
(hpS0 : t.G pS = ints (zl (shP u bs)) ++ RS) (hN : t.G nR = .int (bs.length : ℤ) :: LN)
(hZ : t.G rCZ = .int (cz : ℤ) :: LZ) (h2 : t.G rU2 = .int ((2 ^ u : ℕ) : ℤ) :: L2) :
IRuns I iprog (proU pM pS) t
(((t.upd rB (.int ((vol (ctB u cz bs) * cr : ℕ) : ℤ) :: t.G rB)).upd
rM (.int (((2 ^ u) ^ bs.length : ℕ) : ℤ) :: t.G rM)).upd
rH (.int ((bs.length / 2 : ℕ) : ℤ) :: t.G rH))
(cPro bs.length Z)
Context. CRT reversal §8: phase 2 by additive swaps (p2E) and the reversal revE = p1U; p2E; p3U
p2E replaces KFUU's p2U (⌊n/2⌋ single-digit swaps, cost n·h^τ) by the nine-phase word of
mainU (three composite swaps of u·⌊n/2⌋-bit digits and six rotation sets). p2E_runs has
the interface of p2U_runs (with SwOKτ τ and 2 ≤ n); revE_runs / revKE the
interface of revU_runs / revK.
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_R6_Defs14
set_option autoImplicit false
set_option relaxedAutoImplicit false
set_option maxHeartbeats 1000000
open NLogN NLogN.KFUU NLogN.KFUU.R6Crt
open IntMul NLogN.KIL NLogN.KFB NLogN.KFC NLogN.KFT NLogN.KFU AModel AModelL12 NLogN.KFUU
variable {P : ℕ} {I : List Sym} {iprog : Fin P → IStmt HS P} {τ : ℝ}
theorem NLogN.KFUU.R6Crt.proU_runs {pM : Fin P} (hMul : MulOK I iprog pM MS) {pS : Fin HS} (hpS : LS pS)
(u cz cr : ℕ) (bs : List Bool) (hu : 1 ≤ u) (hcz : cz = 2 * cr) (hcr : 1 ≤ cr)
(Z : ℕ) (hZ3 : 3 ≤ Z) (hVZ : zsz ((vol (shP u bs) * cz : ℕ) : ℤ) ≤ Z)
(zU : zsz ((2 ^ u : ℕ) : ℤ) ≤ Z)
(t : IState HS) {RS LN LZ L2 : List Item}
(hpS0 : t.G pS = ints (zl (shP u bs)) ++ RS) (hN : t.G nR = .int (bs.length : ℤ) :: LN)
(hZ : t.G rCZ = .int (cz : ℤ) :: LZ) (h2 : t.G rU2 = .int ((2 ^ u : ℕ) : ℤ) :: L2) :
IRuns I iprog (proU pM pS) t
(((t.upd rB (.int ((vol (ctB u cz bs) * cr : ℕ) : ℤ) :: t.G rB)).upd
rM (.int (((2 ^ u) ^ bs.length : ℕ) : ℤ) :: t.G rM)).upd
rH (.int ((bs.length / 2 : ℕ) : ℤ) :: t.G rH))
(cPro bs.length Z) := by sorry