HvdH machine lemma expNegFixP_cost (`expNegFix`, `expNeg`, `expPos` as register programs)
ProvedNLogN.expNegFixP_costThe following holds (Lean statement, in the scope of module NLogN.HNumExp2):
theorem NLogN.expNegFixP_cost (n M : ℕ) (X : ℤ) (s : IState HS) (L10 L11 L12 : List Item)
(h10 : s.G 10 = .int n :: L10) (h11 : s.G 11 = .int M :: L11)
(h12 : s.G 12 = .int X :: L12) :
expNegFixP.cost s ≤ expNegFixCost n M (zsz X) ((-X) / log2Bits M).toNat
Context. The lemma belongs to the part expNegFix, expNeg, expPos as register programs: expNegFixP: inputs n on 10, M on 11, X on 12; result pushed on 13.
Uses (with pushes popped) registers 3 … 9 and the scratch registers of log2P
(0, 1, 2, 40 … 47) and expP (30 … 39).
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.expNegFixP_cost (n M : ℕ) (X : ℤ) (s : IState HS) (L10 L11 L12 : List Item)
(h10 : s.G 10 = .int n :: L10) (h11 : s.G 11 = .int M :: L11)
(h12 : s.G 12 = .int X :: L12) :
expNegFixP.cost s ≤ expNegFixCost n M (zsz X) ((-X) / log2Bits M).toNat := by sorry