HvdH machine lemma ST.keyPh_spec (The recursive step, part 4: generic helpers and the first phases (name)
ProvedNLogN.ST.keyPh_specThe following holds (Lean statement, in the scope of module NLogN.HSt4):
theorem NLogN.ST.keyPh_spec (M : MulSpec) (K : ℕ) (s : List ℕ) (hs : ∀ x ∈ s, 0 < x) (hlen : s.length = K)
(t : IState HS) (R40 L28 : List Item) (h40 : t.G 40 = ints (CR.recL s 0).flatten ++ R40)
(h28 : t.G 28 = .int (s.prod : ℤ) :: L28) (B : ℕ) (hB : 2 * s.prod + 4 * K + 1 < 2 ^ B) :
Spec M (keyPh K) t (((t.upd 40 R40).upd 3 (natInts (CR.keyL s) ++ t.G 3)).upd 41
(ints (s.map (fun x : ℕ => (x : ℤ))).reverse ++ t.G 41)) (keyCost K s.prod B)
Context. The lemma belongs to the part The recursive step, part 4: generic helpers and the first phases (namespace NLogN.ST).
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 set_option linter.unusedVariables false set_option linter.unreachableTactic false set_option linter.unusedTactic false open NLogN open NLogN.ST open IntMul NLogN IntMul.HvdH IntMul.HvdH.Ref open NLogN.FW (Spec) set_option maxHeartbeats 4000000
theorem NLogN.ST.keyPh_spec (M : MulSpec) (K : ℕ) (s : List ℕ) (hs : ∀ x ∈ s, 0 < x) (hlen : s.length = K)
(t : IState HS) (R40 L28 : List Item) (h40 : t.G 40 = ints (CR.recL s 0).flatten ++ R40)
(h28 : t.G 28 = .int (s.prod : ℤ) :: L28) (B : ℕ) (hB : 2 * s.prod + 4 * K + 1 < 2 ^ B) :
Spec M (keyPh K) t (((t.upd 40 R40).upd 3 (natInts (CR.keyL s) ++ t.G 3)).upd 41
(ints (s.map (fun x : ℕ => (x : ℤ))).reverse ++ t.G 41)) (keyCost K s.prod B) := by sorry