HvdH machine lemma GL.xferP_all (Gaussian list primitives, part 3: moves, transfers, the zip product pr)
ProvedNLogN.GL.xferP_allThe following holds (Lean statement, in the scope of module NLogN.HGl3):
theorem NLogN.GL.xferP_all (M : MulSpec) (i j : Fin HS) (n : Ex HS) (s : IState HS) (l : List ℤ)
(Ri : List Item) (B : ℕ) (hij : i ≠ j) (hiT : i ≠ gZT) (hjT : j ≠ gZT) (hiV : i ≠ gCV)
(hjV : j ≠ gCV) (hi55 : i.val < 55) (hj55 : j.val < 55)
(hi : s.G i = ints l ++ Ri) (hn : n.eval s = l.length) (hnc : n.Clean) (hno : n.ok s)
(hl : n.Lin) (hnB : n.Bnd s B) (hB : ∀ x ∈ l, zsz x ≤ B)
(hnr : ∀ t : IState HS, (∀ x, x ≠ i → x ≠ gZT → t.G x = s.G x) →
n.eval t = n.eval s ∧ n.ok t ∧ n.Bnd t B) :
(xferP i j n).run s = (s.upd i Ri).upd j (ints l ++ s.G j) ∧
(xferP i j n).ok M s ∧
(xferP i j n).cost M s ≤ 2 * ((n.size + 1) * 2000 * (B + 2) +
l.length * (14000 * (B + 2) + 30) + 32)
Context. The lemma belongs to the part Gaussian list primitives, part 3: moves, transfers, the zip product program: * mv_all: mvList as an RM step (run / ok / cost in one statement).
xferP i j n: movenintegers fromitojkeeping their order (viagZT).zipP σ cN:gD := zipWith (gzF σ p) A U(Aconsumed fromgZA),cN ∈ {gPN, gPM}holds the length.
Formalization Note. This is a lemma of the Lean development NLogN, a multitape-Turing-machine implementation of the Harvey–van der Hoeven integer multiplication algorithm, used in the proof of NLogN.FIN.theorem_1_1_nlogn : IntMul.MulTimeBound fun n => n * Real.log n. All names refer to the definition bundles IntMul_HvdH_M_Defs1–IntMul_HvdH_M_Defs8 (namespace NLogN), built on the platform model Def_IntMul_MultitapeModel and the published reference Def_IntMul_HvdH_MachineRef. The machine layer: IState HS is a state of 64 item stacks; RM programs have a semantics p.run s, a definedness predicate p.ok M s and a cost p.cost M s relative to a multiplication spec M : MulSpec; zsz z is the bit length of .
-- Harvey–van der Hoeven multitape-TM development (NLogN), generated by skeleton subtraction. import Definitions.Def_IntMul_HvdH_M_Defs8 set_option autoImplicit false set_option relaxedAutoImplicit false set_option maxHeartbeats 1000000 set_option linter.unusedSimpArgs false open NLogN open NLogN.GL open IntMul NLogN
theorem NLogN.GL.xferP_all (M : MulSpec) (i j : Fin HS) (n : Ex HS) (s : IState HS) (l : List ℤ)
(Ri : List Item) (B : ℕ) (hij : i ≠ j) (hiT : i ≠ gZT) (hjT : j ≠ gZT) (hiV : i ≠ gCV)
(hjV : j ≠ gCV) (hi55 : i.val < 55) (hj55 : j.val < 55)
(hi : s.G i = ints l ++ Ri) (hn : n.eval s = l.length) (hnc : n.Clean) (hno : n.ok s)
(hl : n.Lin) (hnB : n.Bnd s B) (hB : ∀ x ∈ l, zsz x ≤ B)
(hnr : ∀ t : IState HS, (∀ x, x ≠ i → x ≠ gZT → t.G x = s.G x) →
n.eval t = n.eval s ∧ n.ok t ∧ n.Bnd t B) :
(xferP i j n).run s = (s.upd i Ri).upd j (ints l ++ s.G j) ∧
(xferP i j n).ok M s ∧
(xferP i j n).cost M s ≤ 2 * ((n.size + 1) * 2000 * (B + 2) +
l.length * (14000 * (B + 2) + 30) + 32) := by sorry