The forward pass (round six, `fwd_runs`)
ProvedJ6Seg.Src.fwd_runscomplexity-theoryinteger-multiplicationkappa-improvement
The forward pass.
The following holds (Lean statement, in the scope of module Solutions.J6SegILSrc3):
theorem J6Seg.Src.fwd_runs (s0 : IState HS) (G : Fin HS → List ℤ) {iS iT iL : Fin HS} (fS : Free iS)
(fT : Free iT) (fL : Free iL) {s t lam A : ℕ} {LS LT LL : List ℤ}
(hGS : G iS = (s : ℤ) :: LS) (hGT : G iT = (t : ℤ) :: LT) (hGL : G iL = (lam : ℤ) :: LL)
(h43 : G 43 = []) (hs : 0 < s) (hl : 0 < lam) (hsA : s ≤ 2 ^ A) (htA : t ≤ 2 ^ A)
(hlA : lam ≤ 2 ^ A) (hA : 2 ≤ A) :
Sp (.rep 43 (.reg iS) (fwdB iS iT iL)) (encK s0 (fwS G s t lam 0)) (encK s0 (fwS G s t lam s))
((s + 1) * (401 * uC A DD + uC A DD))
Context. B-line IL, source-table producers, part 3: ljP, the forward pass
ljP iS iT iL iW (inputs s, t, λ, w on the tops of the free stacks iS, iT, iL, iW):
- push the sentinel
0on14; - forward pass
rep 43 s fwdB: at stepkpushstF kon14(stE:kifk = 0,k % λ = 0orrrZ k ≠ rrZ (k-1) + 1, else the previous top); - push
son15(the block endeB),0on31(the count); - backward pass
rep 43 s bwdB(part 4): at stepk(j = s - 1 - k) popstF jfrom14, push it on32, pusheB j - stF jon33, pushjon30and count it on31ifnearB j, update15toeB (j - 1); - pop
15and the sentinel.
Here: the expressions, their values, and fwd_runs.
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_R6_Defs65 set_option autoImplicit false set_option relaxedAutoImplicit false set_option maxHeartbeats 1000000 open J6Seg J6Seg.Src set_option maxRecDepth 20000 open IntMul NLogN NLogN.KIL Function NLogN.RS J6Seg.PreT J6Seg
Formal statement
theorem J6Seg.Src.fwd_runs (s0 : IState HS) (G : Fin HS → List ℤ) {iS iT iL : Fin HS} (fS : Free iS)
(fT : Free iT) (fL : Free iL) {s t lam A : ℕ} {LS LT LL : List ℤ}
(hGS : G iS = (s : ℤ) :: LS) (hGT : G iT = (t : ℤ) :: LT) (hGL : G iL = (lam : ℤ) :: LL)
(h43 : G 43 = []) (hs : 0 < s) (hl : 0 < lam) (hsA : s ≤ 2 ^ A) (htA : t ≤ 2 ^ A)
(hlA : lam ≤ 2 ^ A) (hA : 2 ≤ A) :
Sp (.rep 43 (.reg iS) (fwdB iS iT iL)) (encK s0 (fwS G s t lam 0)) (encK s0 (fwS G s t lam s))
((s + 1) * (401 * uC A DD + uC A DD)) := 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 `J6Seg.Src.fwd_runs`, Solutions/J6SegILSrc3.lean (lines 178–237) of the round-six development.