HvdH machine lemma octExpP_ok (`octExp` and `twiddle` as register programs)
ProvedNLogN.octExpP_okThe following holds (Lean statement, in the scope of module NLogN.HNumTw):
theorem NLogN.octExpP_ok (n k a : ℕ) (s : IState HS) (L48 L49 L50 : List Item)
(h48 : s.G 48 = .int n :: L48) (h49 : s.G 49 = .int k :: L49)
(h50 : s.G 50 = .int a :: L50) : octExpP.ok s
Context. The lemma belongs to the part octExp and twiddle as register programs: * octExpP: inputs n on 48, k on 49, a on 50; pushes (octExp n k a).1 on 51
and (octExp n k a).2 on 52. Uses (pushed and popped) registers 3 … 9 and the scratch
registers of piP (0, 1, 2, 40 … 47) and expP (30 … 39).
twiddleP: inputsnon28,kon29,jon53; pushes(twiddle n k j).1on51and(twiddle n k j).2on52. Uses in addition registers10 … 14and48 … 50.
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 2000000
theorem NLogN.octExpP_ok (n k a : ℕ) (s : IState HS) (L48 L49 L50 : List Item)
(h48 : s.G 48 = .int n :: L48) (h49 : s.G 49 = .int k :: L49)
(h50 : s.G 50 = .int a :: L50) : octExpP.ok s := by sorry