Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Theorem 1.1 — integer multiplication in time O(nlog⁡n)O(n\log n)O(nlogn)

Open
IntMul.HvdH.theorem_1_1

by avi · Oct 8, 2026 · Mathlib 0df444a (Lean v4.33.1)

complexity-theoryinteger-multiplication

Theorem 1.1 of Harvey–van der Hoeven, as stated. There is an integer multiplication algorithm achieving

M(n)=O(nlog⁡n).\mathsf M(n)=O(n\log n).M(n)=O(nlogn).

Here M(n)\mathsf M(n)M(n) is the worst-case number of steps a deterministic multitape Turing machine needs to multiply two nnn-bit integers, and log⁡\loglog is the natural logarithm. Concretely, there is one deterministic multitape Turing machine MMM, with a fixed finite alphabet and a fixed finite number of tapes, with two properties:

  1. For every n≥1n\ge1n≥1 and all x,y∈{0,1}nx,y\in\{0,1\}^nx,y∈{0,1}n, on input x#yx\#yx#y it halts with output bin⁡2n(val⁡(x)val⁡(y))\operatorname{bin}_{2n}(\operatorname{val}(x)\operatorname{val}(y))bin2n​(val(x)val(y)).
  2. There are constants c>0c>0c>0 and n0n_0n0​ such that, for all n≥n0n\ge n_0n≥n0​, it takes at most c nlog⁡nc\,n\log ncnlogn steps on every pair of nnn-bit inputs.

This settles the upper bound in the 1971 conjecture of Schönhage and Strassen that integer multiplication has complexity Θ(nlog⁡n)\Theta(n\log n)Θ(nlogn) in this model.

Formalization Note The bound is nlog⁡nn\log nnlogn with the natural logarithm, as in the paper, and O(⋅)O(\cdot)O(⋅) has the usual meaning of a bound for all sufficiently large nnn, as in the paper's introduction. Since log⁡1=0\log 1=0log1=0, a valid threshold has n0≥2n_0\ge2n0​≥2. The paper does not fix tape conventions or an input and output format, so the machine model is the shared IntMul_MultitapeModel, which uses the kkk-tape conventions of Montanaro's lecture notes with the input x#yx\#yx#y of the OpenAI preprint. The same theorem, stated in the κ\kappaκ-framework of the companion missions, is the milestone KappaBound(0)\mathrm{KappaBound}(0)KappaBound(0).

Preamble
import Mathlib
import Definitions.Def_IntMul_MultitapeModel
Formal statement
namespace IntMul.HvdH

theorem theorem_1_1 : MulTimeBound fun n => (n : ℝ) * Real.log n := by sorry

end IntMul.HvdH
Source
D. Harvey, J. van der Hoeven, Integer multiplication in time O(n log n), Annals of Mathematics 193(2) (2021) 563-617, https://doi.org/10.4007/annals.2021.193.2.4 (preprint https://hal.science/hal-02070778v2), §1, Theorem 1.1, p. 1 (multitape Turing model and O-notation as stated in §1)
Read-back

What the Lean code literally says, in plain math · claude-opus-5-5

Read-back of IntMul.HvdH.theorem_1_1. The theorem has no hypotheses and no free variables. It asserts that MulTimeBound(g)\mathrm{MulTimeBound}(g)MulTimeBound(g) holds for the single fixed function g:N→Rg : \mathbb{N} \to \mathbb{R}g:N→R given by

g(n)  =  n⋅ln⁡n,g(n) \;=\; n \cdot \ln n ,g(n)=n⋅lnn,

where nnn is cast to a real number and ln⁡\lnln is Mathlib's Real.log, the natural logarithm (base eee). Real.log is total on R\mathbb{R}R, with ln⁡x:=ln⁡∣x∣\ln x := \ln|x|lnx:=ln∣x∣ for x≠0x \neq 0x=0 and the junk value ln⁡0:=0\ln 0 := 0ln0:=0. Hence the bound function takes the values

g(0)=0⋅ln⁡0=0,g(1)=1⋅ln⁡1=0,g(2)=2ln⁡2≈1.386,g(3)=3ln⁡3≈3.296,g(4)=4ln⁡4≈5.545,g(0) = 0\cdot\ln 0 = 0,\qquad g(1) = 1\cdot \ln 1 = 0,\qquad g(2) = 2\ln 2 \approx 1.386,\qquad g(3) = 3\ln 3 \approx 3.296,\qquad g(4) = 4\ln 4 \approx 5.545,g(0)=0⋅ln0=0,g(1)=1⋅ln1=0,g(2)=2ln2≈1.386,g(3)=3ln3≈3.296,g(4)=4ln4≈5.545,

and g(n)>0g(n) > 0g(n)>0 for every n≥2n \ge 2n≥2. No base-2 logarithm, ceiling, or max⁡(⋅,1)\max(\cdot,1)max(⋅,1) appears in this bound (the bundle's separate function lg(n)=max⁡(⌈log⁡2n⌉,1)\mathrm{lg}(n) = \max(\lceil \log_2 n\rceil, 1)lg(n)=max(⌈log2​n⌉,1) is not used here).

Unfolding MulTimeBound(g)\mathrm{MulTimeBound}(g)MulTimeBound(g). The statement says: there exists a machine MMM (a deterministic multitape Turing machine, described below) such that both of the following hold.

  1. Correctness for every length. For every natural number n≥1n \ge 1n≥1 there exists a real number TTT such that MultipliesAt(M,n,T)\mathrm{MultipliesAt}(M, n, T)MultipliesAt(M,n,T) holds.
  2. Time bound. There exist a real constant c>0c > 0c>0 and a natural number n0n_0n0​ such that for every natural number nnn with n≥n0n \ge n_0n≥n0​ and n≥1n \ge 1n≥1,
MultipliesAt(M, n, c⋅nln⁡n).\mathrm{MultipliesAt}\big(M,\, n,\, c \cdot n \ln n\big).MultipliesAt(M,n,c⋅nlnn).

Here MultipliesAt(M,n,T)\mathrm{MultipliesAt}(M, n, T)MultipliesAt(M,n,T) means: for all finite bit strings x,y∈{0,1}∗x, y \in \{0,1\}^*x,y∈{0,1}∗ with ∣x∣=n|x| = n∣x∣=n and ∣y∣=n|y| = n∣y∣=n, there exists a natural number ttt with t≤Tt \le Tt≤T (compared as reals) such that MMM, started on input x#yx\#yx#y, is after exactly ttt steps in its halting state and its output tape holds exactly bin2n(val(x)⋅val(y))\mathrm{bin}_{2n}(\mathrm{val}(x)\cdot \mathrm{val}(y))bin2n​(val(x)⋅val(y)).

  • val(x)=∑jxj2∣x∣−1−j\mathrm{val}(x) = \sum_{j} x_j 2^{|x|-1-j}val(x)=∑j​xj​2∣x∣−1−j is the natural number whose binary representation is xxx, most significant bit first (leading zeros allowed, val(ε)=0\mathrm{val}(\varepsilon) = 0val(ε)=0).
  • bink(z)\mathrm{bin}_{k}(z)bink​(z) is the length-kkk bit string whose iii-th entry (i=0,…,k−1i = 0,\dots,k-1i=0,…,k−1) is bit number k−1−ik-1-ik−1−i of zzz; i.e. z mod 2kz \bmod 2^kzmod2k written in binary, most significant bit first, left-padded with zeros to length exactly kkk. Since val(x)val(y)<22n\mathrm{val}(x)\mathrm{val}(y) < 2^{2n}val(x)val(y)<22n, the required output is the exact product written with exactly 2n2n2n bits (with leading zeros).

The machine model. A machine MMM consists of:

  • a finite alphabet Σ\SigmaΣ (a finite type) with five designated, pairwise distinct symbols: blank □\square□, start marker ▹\triangleright▹, bit symbols 0,1\mathtt{0}, \mathtt{1}0,1, and separator #\##;
  • a finite set of states KKK with designated states START≠HALT\mathrm{START} \neq \mathrm{HALT}START=HALT;
  • a number of tapes k≥2k \ge 2k≥2 (tape 000 = input tape, tape 111 = output tape, the rest work tapes), each with cells indexed by 0,1,2,…0,1,2,\dots0,1,2,…;
  • a transition function δ:K×Σk→K×(Σ×{←,−,→})k\delta : K \times \Sigma^{k} \to K \times (\Sigma \times \{\leftarrow, -, \rightarrow\})^{k}δ:K×Σk→K×(Σ×{←,−,→})k subject to: (a) on any tape scanning ▹\triangleright▹, δ\deltaδ writes ▹\triangleright▹ back and does not move left; (b) on any tape scanning a symbol other than ▹\triangleright▹, δ\deltaδ does not write ▹\triangleright▹; (c) δ(HALT,a)=(HALT,(ai,−)i)\delta(\mathrm{HALT}, a) = (\mathrm{HALT}, (a_i, -)_i)δ(HALT,a)=(HALT,(ai​,−)i​) for every scanned tuple aaa, so a halted configuration never changes; (d) the symbol written on tape 000 always equals the symbol read there (input tape is read-only).

MMM, Σ\SigmaΣ, KKK, kkk and δ\deltaδ are fixed once and for all; they may not depend on nnn.

A configuration is a state together with, for each tape, its full (infinite) contents and head position. One step reads the scanned symbols aia_iai​, computes δ(q,a)=(q′,(σi,di)i)\delta(q, a) = (q', (\sigma_i, d_i)_i)δ(q,a)=(q′,(σi​,di​)i​), overwrites each scanned cell with σi\sigma_iσi​, moves each head by did_idi​ (a left move from position ppp goes to p−1p-1p−1 in natural-number subtraction, though by (a) and the placement of ▹\triangleright▹ this never happens from cell 000), and enters q′q'q′. The initial configuration on x#yx\#yx#y has state START\mathrm{START}START, all heads on cell 000, the input tape holding ▹ x1⋯xn # y1⋯yn □ □⋯\triangleright\, x_1\cdots x_n\, \#\, y_1 \cdots y_n\, \square\,\square\cdots▹x1​⋯xn​#y1​⋯yn​□□⋯ (bits encoded by 0,1\mathtt 0,\mathtt 10,1), and every other tape (including the output tape) holding ▹ □ □⋯\triangleright\,\square\,\square\cdots▹□□⋯. "Output tape holds www" means the entire output tape equals ▹ w1⋯w∣w∣ □ □⋯\triangleright\, w_1 \cdots w_{|w|}\, \square\,\square\cdots▹w1​⋯w∣w∣​□□⋯ exactly: cell 000 is ▹\triangleright▹, cells 1..2n1..2n1..2n are the output bits, and every later cell is blank. Work tapes and head positions are unconstrained at halting. Because HALT\mathrm{HALT}HALT is absorbing, "halted with the right output at some step t≤Tt \le Tt≤T" is equivalent to halting with that output within at most ⌊T⌋\lfloor T\rfloor⌊T⌋ steps.

Edge cases and what is (not) covered.

  • Inputs: only pairs x,yx, yx,y of the same length n≥1n \ge 1n≥1 are constrained. Nothing is required for n=0n = 0n=0, for inputs of unequal length, or for any tape content not of the form x#yx\#yx#y.
  • Two clauses for different ranges. Clause 1 requires the machine to multiply correctly (with some finite step count) for every n≥1n \ge 1n≥1; clause 2 imposes the quantitative bound c nln⁡nc\, n\ln ncnlnn only for n≥max⁡(n0,1)n \ge \max(n_0, 1)n≥max(n0​,1). The threshold n0n_0n0​ is existentially chosen and may be arbitrarily large; no bound on the running time for 1≤n<n01 \le n < n_01≤n<n0​ is asserted beyond finiteness.
  • Small nnn in clause 2: at n=1n = 1n=1 the bound is c⋅1⋅ln⁡1=0c \cdot 1 \cdot \ln 1 = 0c⋅1⋅ln1=0, which would demand t=0t = 0t=0, i.e. the initial configuration already in state HALT\mathrm{HALT}HALT; this is impossible since START≠HALT\mathrm{START} \neq \mathrm{HALT}START=HALT. So any witness must take n0≥2n_0 \ge 2n0​≥2. The case n=0n = 0n=0 is excluded by the explicit condition n≥1n \ge 1n≥1 (and g(0)=0g(0) = 0g(0)=0 is never used). For n≥2n \ge 2n≥2 the bound c nln⁡nc\,n\ln ncnlnn is positive.
  • Constants: ccc is a positive real, not necessarily an integer; the step count ttt is a natural number compared with the real c nln⁡nc\,n\ln ncnlnn. Because ln⁡n=(ln⁡2)log⁡2n\ln n = (\ln 2)\log_2 nlnn=(ln2)log2​n, the asserted bound is the same up to the constant ccc as one with log⁡2n\log_2 nlog2​n.
  • Worst case: the bound must hold for all x,yx, yx,y of length nnn simultaneously with the single ccc and n0n_0n0​, i.e. it is a worst-case bound for each n≥max⁡(n0,1)n \ge \max(n_0,1)n≥max(n0​,1).

In summary, the theorem asserts: there is one deterministic multitape Turing machine (fixed finite alphabet, fixed finite state set, fixed number k≥2k \ge 2k≥2 of one-way-infinite tapes, read-only input tape, separate output tape) that, for every n≥1n \ge 1n≥1 and all x,y∈{0,1}nx, y \in \{0,1\}^nx,y∈{0,1}n, on input x#yx\#yx#y eventually halts with the output tape containing exactly the 2n2n2n-bit binary representation of val(x)⋅val(y)\mathrm{val}(x)\cdot\mathrm{val}(y)val(x)⋅val(y), and there are c>0c > 0c>0 and n0n_0n0​ such that for all n≥max⁡(n0,1)n \ge \max(n_0, 1)n≥max(n0​,1) this happens within at most c nln⁡nc\, n \ln ncnlnn steps (natural logarithm) on every such input.

Human review
  • Endorsed by wurtle · Oct 8, 2026

    Confirmed by the moderator at approval.

  • Endorsed by avi · Oct 8, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me