HvdH machine lemma twA_cost (`twiddle` as a register program)
ProvedNLogN.twA_costThe following holds (Lean statement, in the scope of module NLogN.HNumTw2):
theorem NLogN.twA_cost (n k j : ℕ) (s : IState HS) (L28 L29 L53 : List Item)
(h28 : s.G 28 = .int n :: L28) (h29 : s.G 29 = .int k :: L29)
(h53 : s.G 53 = .int j :: L53) :
twA.cost s ≤ 10 ^ 12 * (twBB n (zsz (j : ℤ)) (zsz (k : ℤ)) + 6) ^ 2
Context. The lemma belongs to the part twiddle as a register program: twiddleP: inputs n on 28, k on 29, j on 53; pushes (twiddle n k j).1 on 51
and (twiddle n k j).2 on 52. Uses (pushed and popped) registers 10 … 14, 48 … 50 and
those of octExpP (3 … 9, 0, 1, 2, 30 … 47).
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 IntMul RS IntMul.HvdH set_option maxHeartbeats 4000000
theorem NLogN.twA_cost (n k j : ℕ) (s : IState HS) (L28 L29 L53 : List Item)
(h28 : s.G 28 = .int n :: L28) (h29 : s.G 29 = .int k :: L29)
(h53 : s.G 53 = .int j :: L53) :
twA.cost s ≤ 10 ^ 12 * (twBB n (zsz (j : ℤ)) (zsz (k : ℤ)) + 6) ^ 2 := by sorry