The bit loop (`bits_sp`)
ProvedJ6Seg.bits_spThe bit loop.
The following holds (Lean statement, in the scope of module Solutions.J6SegILSweep2):
theorem J6Seg.bits_sp (s : IState HS) (F : Fin HS → List ℤ) (z sv : List ℤ) (v : Fin 19 → List ℤ)
(bs : List ℤ) (B : ℕ) (hB : 1 ≤ B) (h01 : ∀ b ∈ bs, b = 0 ∨ b = 1)
(hd : v 3 = [(bs.length : ℤ)]) (hdB : zsz (bs.length : ℤ) ≤ B) (hbB : bs.length + 1 ≤ B)
(h4 : v 4 = [0]) (h12 : v 12 = []) (h16 : v 16 = []) :
Sp (.rep (σ 16) (.reg (σ 3)) (bitB σ dS)) (encK s (SS σ dS F z (bs ++ sv) v))
(encK s (SS σ dS F z sv (update (update v 12 bs.reverse) 4 [bs.sum])))
((1 + 1) * 2000 * (B + 2) + bs.length * (20000 * (B + 2) + 8000 * (B + 2) + 30) + 32)
Context. B-line IL, B6 §2: reading the line descriptor
hdrA σ dS (on dS = descLine6 = p :: α :: h :: d :: (bits ++ svals)): pop p, α, h, d into
σ 0..3, move the d bits onto σ 12 while counting the ones in σ 4, move them on to σ 13
(in order), then σ 5 := T = 2^{h d + #ones}, σ 6 := 1 (pre), σ 8 := 0 (k).
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_Defs67
set_option autoImplicit false
set_option relaxedAutoImplicit false
set_option maxHeartbeats 1000000
open J6Seg
open IntMul NLogN NLogN.KIL NLogN.KFB IntMul.Kappa.R6 Function
variable {σ : Fin 19 → Fin HS} {dS dA : Fin HS} (hW : SwOK σ dS dA)
include hW
theorem J6Seg.bits_sp (s : IState HS) (F : Fin HS → List ℤ) (z sv : List ℤ) (v : Fin 19 → List ℤ)
(bs : List ℤ) (B : ℕ) (hB : 1 ≤ B) (h01 : ∀ b ∈ bs, b = 0 ∨ b = 1)
(hd : v 3 = [(bs.length : ℤ)]) (hdB : zsz (bs.length : ℤ) ≤ B) (hbB : bs.length + 1 ≤ B)
(h4 : v 4 = [0]) (h12 : v 12 = []) (h16 : v 16 = []) :
Sp (.rep (σ 16) (.reg (σ 3)) (bitB σ dS)) (encK s (SS σ dS F z (bs ++ sv) v))
(encK s (SS σ dS F z sv (update (update v 12 bs.reverse) 4 [bs.sum])))
((1 + 1) * 2000 * (B + 2) + bs.length * (20000 * (B + 2) + 8000 * (B + 2) + 30) + 32) := by sorry