Round-six lemma `swStau_runs`
ProvedNLogN.KFUU.R6Crt.swStau_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.R6CrtSwap):
theorem NLogN.KFUU.R6Crt.swStau_runs {eSw : Fin P} {dS : Fin HS} {K : ℝ} (hK : SwOKτ τ I iprog eSw dS K) (hdS : dS ≠ 0)
{Dsc : Fin HS} (hD : Dsc = 18 ∨ Dsc = 19) (hDd : Dsc ≠ dS)
{u w a m c2 Z : ℕ} (hu : 1 ≤ u) (ha : 1 ≤ a) (hm : 1 ≤ m) (hc : 1 ≤ c2) (hZ3 : 3 ≤ Z)
(zw : zsz (w : ℤ) ≤ Z) (zu : zsz (u : ℤ) ≤ Z) (za : zsz (a : ℤ) ≤ Z) (zm : zsz (m : ℤ) ≤ Z)
(zc : zsz (c2 : ℤ) ≤ Z) (zU : zsz ((2 ^ u : ℕ) : ℤ) ≤ Z)
(t : IState HS) (xs : List ℤ) (R : List Item) (h0 : t.G 0 = ints xs ++ R)
(hlen : xs.length = vol [a, 2 ^ u, m, 2 ^ u, c2] * 2) (hx : Bnd w xs)
{LW LU LA L2 LM LB : List Item}
(hW : t.G rW = .int (w : ℤ) :: LW) (hUu : t.G rU = .int (u : ℤ) :: LU)
(hA : t.G rA = .int (a : ℤ) :: LA) (h2 : t.G rU2 = .int ((2 ^ u : ℕ) : ℤ) :: L2)
(hM : t.G rM = .int (m : ℤ) :: LM) (hB : t.G rB = .int (c2 : ℤ) :: LB) :
∃ c : ℕ, IRuns I iprog (swS eSw dS Dsc) t
(t.upd 0 (ints (pull [a, 2 ^ u, m, 2 ^ u, c2 * 2] [a, 2 ^ u, m, 2 ^ u, c2 * 2] (swapPos 1 3) 0 xs)
++ R)) c ∧
(c : ℝ) ≤ cSwNτ τ K w u [a, 2 ^ u, m, 2 ^ u, c2] + 30 * cU Z + 3
Context. CRT reversal §3: the swap entry with exponent τ
SwOKτ τ is KFUU's SwOKU with the exponent KFS.τS replaced by τ (what IL.SwapNeedτ tab τ
provides inside a merged table); swSτ_runs is KFUU's swS_runs (descriptor
[w, u, 1, 3, 5, a, 2^u, m, 2^u, c₂] built from registers, one call) for it.
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.swStau_runs {eSw : Fin P} {dS : Fin HS} {K : ℝ} (hK : SwOKτ τ I iprog eSw dS K) (hdS : dS ≠ 0)
{Dsc : Fin HS} (hD : Dsc = 18 ∨ Dsc = 19) (hDd : Dsc ≠ dS)
{u w a m c2 Z : ℕ} (hu : 1 ≤ u) (ha : 1 ≤ a) (hm : 1 ≤ m) (hc : 1 ≤ c2) (hZ3 : 3 ≤ Z)
(zw : zsz (w : ℤ) ≤ Z) (zu : zsz (u : ℤ) ≤ Z) (za : zsz (a : ℤ) ≤ Z) (zm : zsz (m : ℤ) ≤ Z)
(zc : zsz (c2 : ℤ) ≤ Z) (zU : zsz ((2 ^ u : ℕ) : ℤ) ≤ Z)
(t : IState HS) (xs : List ℤ) (R : List Item) (h0 : t.G 0 = ints xs ++ R)
(hlen : xs.length = vol [a, 2 ^ u, m, 2 ^ u, c2] * 2) (hx : Bnd w xs)
{LW LU LA L2 LM LB : List Item}
(hW : t.G rW = .int (w : ℤ) :: LW) (hUu : t.G rU = .int (u : ℤ) :: LU)
(hA : t.G rA = .int (a : ℤ) :: LA) (h2 : t.G rU2 = .int ((2 ^ u : ℕ) : ℤ) :: L2)
(hM : t.G rM = .int (m : ℤ) :: LM) (hB : t.G rB = .int (c2 : ℤ) :: LB) :
∃ c : ℕ, IRuns I iprog (swS eSw dS Dsc) t
(t.upd 0 (ints (pull [a, 2 ^ u, m, 2 ^ u, c2 * 2] [a, 2 ^ u, m, 2 ^ u, c2 * 2] (swapPos 1 3) 0 xs)
++ R)) c ∧
(c : ℝ) ≤ cSwNτ τ K w u [a, 2 ^ u, m, 2 ^ u, c2] + 30 * cU Z + 3 := by sorry