O(n log n) multitape multiplication from any recursive step satisfying StepOK
ProvedNLogN.Top.hv_mulTimeBoundLet st be a recursive step (an RM program) satisfying StepOK st n₀ lin calls: on inputs with it pushes , it costs at most when every recursive multiplication of -bit numbers costs at most , all recursive sizes are , and its procedure calls are the fixed DIF/DIT/bit-length procedures. Let (). Suppose there are constants and such that for all
- (the non-recursive work is ), and
- (the recursive calls leave room for the linear term).
Then integer multiplication is possible on a multitape Turing machine in time : MulTimeBound (fun n => n * log n) holds, in the sense of the platform model Def_IntMul_MultitapeModel.
Formalization Note. The machine is hvMachine n₀ st, compiled from a five-procedure item-language program (main routine, the multiplication procedure mulRM n₀ st which uses schoolbook multiplication below bits and st above, DIF, DIT, bit length). This is the conditional top level of the Harvey–van der Hoeven machine: proving Theorem 1.1 reduces to exhibiting such a step. The machine layer: IState HS is a state with stacks of items (Item = integer or mark), an input position and an output; RM programs (straight-line register code RS, loops rep, conditionals, calls of the multiplication procedure through a MulSpec giving its domain and cost) have a functional semantics p.run s, a definedness predicate p.ok M s and a cost p.cost M s; Spec M p s s' c abbreviates p.ok M s ∧ p.run s = s' ∧ p.cost M s ≤ c. ints L / gints U push an integer list / a list of pairs as items (head = top); zsz z is the bit length of . MulBnd M m Φ says the multiplication procedure accepts all pairs of integers of bit length at cost . Register names (GU, CR, KB, XN, …) are fixed stack indices.
-- Harvey–van der Hoeven multitape-TM development (NLogN), generated by skeleton subtraction. import Definitions.Def_IntMul_HvdH_M_Defs4 set_option autoImplicit false set_option relaxedAutoImplicit false set_option maxHeartbeats 1000000 set_option linter.unusedSimpArgs false open NLogN open NLogN.Top open IntMul NLogN
theorem NLogN.Top.hv_mulTimeBound {n₀ : ℕ} {st : RM} {lin : ℕ → ℕ} {calls : ℕ → List (ℕ × ℕ)}
(hst : StepOK st n₀ lin calls) (K D : ℕ) (hD : 1 ≤ D)
(hL : ∀ N, n₀ ≤ N → topCost n₀ N + lin N + 2 ≤ K * TT' N)
(hR : ∀ N, n₀ ≤ N → D * ((calls N).map fun q => q.1 * TT' q.2).sum + TT' N ≤ D * TT' N) :
MulTimeBound fun n => (n : ℝ) * Real.log n := by sorry