Round-six lemma `dgI_runs`
ProvedJ6Seg.KR.dgI_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.J6SegKr3):
theorem J6Seg.KR.dgI_runs {M : MulSpec} {pM : Fin Pp} (hM : MulOK I iprog pM M) (hdom : ∀ x y, M.dom x y)
{φ B : ℕ} (hΦ : ∀ x y : ℤ, zsz x ≤ B → zsz y ≤ B → M.Φ x y ≤ φ)
{X T U Y CN CC N : Fin HS}
(hXT : X ≠ T) (hXU : X ≠ U) (hXY : X ≠ Y) (hXC : X ≠ CN) (hXK : X ≠ CC) (hXN : X ≠ N)
(hTU : T ≠ U) (hTY : T ≠ Y) (hTC : T ≠ CN) (hTK : T ≠ CC) (hTN : T ≠ N)
(hUY : U ≠ Y) (hUC : U ≠ CN) (hUK : U ≠ CC) (hUN : U ≠ N)
(hYC : Y ≠ CN) (hYK : Y ≠ CC) (hYN : Y ≠ N) (hCK : CN ≠ CC) (hCNe : CN ≠ N) (hKN : CC ≠ N)
(hM1 : ∀ j ∈ [X, T, U, Y, CN, CC, N, J6Seg.KR.rP, rP1], j ≠ dM1)
(hM2 : ∀ j ∈ [X, T, U, Y, CN, CC, N, J6Seg.KR.rP, rP1], j ≠ dM2)
(hP1 : ∀ j ∈ [X, T, U, Y, CN, CC, N], j ≠ J6Seg.KR.rP)
(hP2 : ∀ j ∈ [X, T, U, Y, CN, CC, N], j ≠ rP1)
(h5 : ∀ j ∈ [X, T, U, Y, CN, CC, N], j.val < 55)
(P : ℕ) (s : IState HS) (F : Fin HS → List ℤ) (z : List GI) (cs lx lt ln l1 l2 : List ℤ)
(hX : F X = gflat z ++ lx) (hT : F T = cs ++ lt) (hcz : z.length ≤ cs.length)
(hCN : F CN = []) (hCC : F CC = []) (hm1 : F dM1 = []) (hm2 : F dM2 = [])
(hN : F N = (z.length : ℤ) :: ln) (hP : F J6Seg.KR.rP = 2 ^ P :: l1) (hQ : F rP1 = 2 ^ (P + 1) :: l2)
(Bz : ℕ) (hz : GB Bz z) (hc : Bnd Bz cs) (hBz : 2 * Bz + 2 ≤ B) (hPB : P + 3 ≤ B)
(hn : zsz (z.length : ℤ) ≤ B) :
IRuns I iprog (J6Seg.KR.dgI pM X T U Y CN CC N) (encK s F)
(encK s (Function.update (Function.update F X lx) Y (gflat (dgG P cs z).reverse ++ F Y)))
(cDG z.length φ B)
Context. B3 (chunk kernel), part 3: the diagonal stage
dgI pM X T U Y CN CC N: with n on N, the row gflat z ++ lx on X (|z| = n) and the
table c ++ lt on T (n ≤ |c|), it pushes gflat (dgG P c z).reverse onto Y, consumes the
row and leaves the table in place (the used entries go through U and back). Each item costs two
calls of the multiplication procedure (KFM.mulC) and two roundings rs P (rsE).
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_Defs64
set_option autoImplicit false
set_option relaxedAutoImplicit false
set_option maxHeartbeats 1000000
open J6Seg J6Seg.KR
open IntMul NLogN NLogN.KIL NLogN.KFD NLogN.KFB NLogN.KFV
variable {Pp : ℕ} {I : List Sym} {iprog : Fin Pp → IStmt HS Pp}
theorem J6Seg.KR.dgI_runs {M : MulSpec} {pM : Fin Pp} (hM : MulOK I iprog pM M) (hdom : ∀ x y, M.dom x y)
{φ B : ℕ} (hΦ : ∀ x y : ℤ, zsz x ≤ B → zsz y ≤ B → M.Φ x y ≤ φ)
{X T U Y CN CC N : Fin HS}
(hXT : X ≠ T) (hXU : X ≠ U) (hXY : X ≠ Y) (hXC : X ≠ CN) (hXK : X ≠ CC) (hXN : X ≠ N)
(hTU : T ≠ U) (hTY : T ≠ Y) (hTC : T ≠ CN) (hTK : T ≠ CC) (hTN : T ≠ N)
(hUY : U ≠ Y) (hUC : U ≠ CN) (hUK : U ≠ CC) (hUN : U ≠ N)
(hYC : Y ≠ CN) (hYK : Y ≠ CC) (hYN : Y ≠ N) (hCK : CN ≠ CC) (hCNe : CN ≠ N) (hKN : CC ≠ N)
(hM1 : ∀ j ∈ [X, T, U, Y, CN, CC, N, J6Seg.KR.rP, rP1], j ≠ dM1)
(hM2 : ∀ j ∈ [X, T, U, Y, CN, CC, N, J6Seg.KR.rP, rP1], j ≠ dM2)
(hP1 : ∀ j ∈ [X, T, U, Y, CN, CC, N], j ≠ J6Seg.KR.rP)
(hP2 : ∀ j ∈ [X, T, U, Y, CN, CC, N], j ≠ rP1)
(h5 : ∀ j ∈ [X, T, U, Y, CN, CC, N], j.val < 55)
(P : ℕ) (s : IState HS) (F : Fin HS → List ℤ) (z : List GI) (cs lx lt ln l1 l2 : List ℤ)
(hX : F X = gflat z ++ lx) (hT : F T = cs ++ lt) (hcz : z.length ≤ cs.length)
(hCN : F CN = []) (hCC : F CC = []) (hm1 : F dM1 = []) (hm2 : F dM2 = [])
(hN : F N = (z.length : ℤ) :: ln) (hP : F J6Seg.KR.rP = 2 ^ P :: l1) (hQ : F rP1 = 2 ^ (P + 1) :: l2)
(Bz : ℕ) (hz : GB Bz z) (hc : Bnd Bz cs) (hBz : 2 * Bz + 2 ≤ B) (hPB : P + 3 ≤ B)
(hn : zsz (z.length : ℤ) ≤ B) :
IRuns I iprog (J6Seg.KR.dgI pM X T U Y CN CC N) (encK s F)
(encK s (Function.update (Function.update F X lx) Y (gflat (dgG P cs z).reverse ++ F Y)))
(cDG z.length φ B) := by sorry