Round-six lemma `dupMv_spec`
ProvedJ6Seg.JK.dupMv_specAn 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.J6SegILJKer7):
theorem J6Seg.JK.dupMv_spec {X Y T C : Fin HS} (hXY : X ≠ Y) (hXT : X ≠ T) (hYT : Y ≠ T) (hXC : X ≠ C)
(hYC : Y ≠ C) (hTC : T ≠ C) (hX5 : X.val < 56) (hY5 : Y.val < 56) (hT5 : T.val < 56)
(hC5 : C.val < 56) (hC : G C = []) {L l : List ℤ} (hX : G X = L ++ l) {n : Ex HS}
(hnc : n.Clean) (hno : n.ok (encK s G)) (hnl : n.Lin) {B : ℕ} (hnb : n.Bnd (encK s G) B)
(hn : n.eval (encK s G) = L.length) (hL : Bnd B L) :
Sp (dupMv X Y T C n) (encK s G)
(encK s (update (update (update G Y (L.reverse ++ G Y)) T (L.reverse ++ G T)) X l))
((n.size + 1) * 2000 * (B + 2) + L.length * (20000 * (B + 2)) + 32)
Context. B-line IL, the J kernel (B4), part 7: list moves on managed states
Plain register programs (no products, linear cost) used around the kernel loops:
rdT X: one table entry fromdTJontoX, recorded on the consumed-table stackTT;rdH X: one header entry fromdTJontoX(not recorded);popL X C n: dropnentries ofX;dupMv X Y T C n: copy the topnentries ofX(reversed) ontoYand ontoT, removing them fromX.
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_Defs66
set_option autoImplicit false
set_option relaxedAutoImplicit false
set_option maxHeartbeats 1000000
open J6Seg J6Seg.JK
open IntMul NLogN NLogN.KIL Function Finset
variable {s : IState HS} {G : Fin HS → List ℤ}
theorem J6Seg.JK.dupMv_spec {X Y T C : Fin HS} (hXY : X ≠ Y) (hXT : X ≠ T) (hYT : Y ≠ T) (hXC : X ≠ C)
(hYC : Y ≠ C) (hTC : T ≠ C) (hX5 : X.val < 56) (hY5 : Y.val < 56) (hT5 : T.val < 56)
(hC5 : C.val < 56) (hC : G C = []) {L l : List ℤ} (hX : G X = L ++ l) {n : Ex HS}
(hnc : n.Clean) (hno : n.ok (encK s G)) (hnl : n.Lin) {B : ℕ} (hnb : n.Bnd (encK s G) B)
(hn : n.eval (encK s G) = L.length) (hL : Bnd B L) :
Sp (dupMv X Y T C n) (encK s G)
(encK s (update (update (update G Y (L.reverse ++ G Y)) T (L.reverse ++ G T)) X l))
((n.size + 1) * 2000 * (B + 2) + L.length * (20000 * (B + 2)) + 32) := by sorry