Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Schönhage–Strassen: multiplication in time O(nlog⁡nlog⁡log⁡n)O(n\log n\log\log n)O(nlognloglogn) on a multitape Turing machine

Proved
IntMul.TM.schonhage_strassen

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

complexity-theoryinteger-multiplicationturing-machines

Schönhage–Strassen. There is a single deterministic multitape Turing machine that, for every n≥1n\ge1n≥1 and all x,y∈{0,1}nx,y\in\{0,1\}^nx,y∈{0,1}n, halts on input x#yx\#yx#y with output bin⁡2n(val⁡x⋅val⁡y)\operatorname{bin}_{2n}(\operatorname{val}x\cdot\operatorname{val}y)bin2n​(valx⋅valy), and whose worst-case running time on nnn-bit inputs is

O(nlog⁡nlog⁡log⁡n).O\big(n\log n\log\log n\big).O(nlognloglogn).

This was the fastest known multiplication algorithm from 1971 until Fürer (2007), and it is the standard fast multiplier underlying the fixed-point arithmetic of later algorithms. In Harvey–van der Hoeven it supplies the crude bound M(n)=O(n1+δ)\mathsf M(n)=O(n^{1+\delta})M(n)=O(n1+δ) with δ<18\delta<\frac18δ<81​ (§2.1).

Formalization Note The machine model is the shared IntMul_MultitapeModel (Montanaro's kkk-tape conventions: read-only input tape, output tape, ▹\triangleright▹ only in cell 000, START≠HALT\mathrm{START}\ne\mathrm{HALT}START=HALT, frozen halting state). O(⋅)O(\cdot)O(⋅) means a bound c g(n)c\,g(n)cg(n) for all n≥n0n\ge n_0n≥n0​, with c>0c>0c>0 and n0n_0n0​ depending only on the machine; sizes 1≤n<n01\le n<n_01≤n<n0​ need only correctness. The logarithms are natural; since log⁡log⁡n≤0\log\log n\le0loglogn≤0 for n≤2n\le2n≤2, a valid threshold has n0≥3n_0\ge3n0​≥3.

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

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

end IntMul.TM
Source
A. Schönhage, V. Strassen, Schnelle Multiplikation großer Zahlen, Computing 7 (1971), 281–292 (main result: multiplication of n-digit numbers on multitape Turing machines in O(n log n log log n) steps); see also Brent–Zimmermann, Modern Computer Arithmetic (2011), §2.3.
Read-back

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

Theorem IntMul.TM.schonhage_strassen. Write ln⁡\lnln for the natural logarithm, extended to all reals by ln⁡0=0\ln 0 = 0ln0=0 and ln⁡x=ln⁡∣x∣\ln x = \ln|x|lnx=ln∣x∣ for x<0x<0x<0. Let

g(n)=n⋅ln⁡n⋅ln⁡(ln⁡n)(n∈N).g(n) = n \cdot \ln n \cdot \ln(\ln n) \qquad (n \in \mathbb N).g(n)=n⋅lnn⋅ln(lnn)(n∈N).

The theorem asserts that there exists a deterministic multitape Turing machine MMM such that:

  1. (Correctness for every n≥1n \ge 1n≥1.) For every n≥1n \ge 1n≥1 and all bit strings x,y∈{0,1}nx, y \in \{0,1\}^nx,y∈{0,1}n (leading zeros allowed), MMM started on input x#yx\#yx#y halts after finitely many steps with output bin2n(val(x)⋅val(y))\mathrm{bin}_{2n}(\mathrm{val}(x)\cdot \mathrm{val}(y))bin2n​(val(x)⋅val(y)) (no time bound required in this clause).
  2. (Time bound.) There exist a real constant c>0c > 0c>0 and a threshold n0∈Nn_0 \in \mathbb Nn0​∈N (both chosen after MMM, independent of n,x,yn, x, yn,x,y) such that for every nnn with n≥n0n \ge n_0n≥n0​ and n≥1n \ge 1n≥1 and all x,y∈{0,1}nx, y \in \{0,1\}^nx,y∈{0,1}n, MMM on input x#yx\#yx#y reaches the halting state with that output within some t≤c g(n)t \le c\, g(n)t≤cg(n) steps.

Definitions unfolded. val(x)=∑ixi2∣x∣−1−i\mathrm{val}(x) = \sum_{i} x_i 2^{|x|-1-i}val(x)=∑i​xi​2∣x∣−1−i reads xxx as binary with the first (leftmost) bit most significant; val(ε)=0\mathrm{val}(\varepsilon)=0val(ε)=0. bin2n(z)\mathrm{bin}_{2n}(z)bin2n​(z) is the length-2n2n2n list whose iii-th entry (i=0,…,2n−1i = 0,\dots,2n-1i=0,…,2n−1) is bit number 2n−1−i2n-1-i2n−1−i of zzz, i.e. zzz written MSB-first, left-padded with zeros to exactly 2n2n2n bits; since val(x)val(y)<22n\mathrm{val}(x)\mathrm{val}(y) < 2^{2n}val(x)val(y)<22n this is the exact product. "Started on input x#yx\#yx#y" means: state qstartq_{\mathrm{start}}qstart​, tape 000 holds ▹ x # y □□⋯\triangleright\, x\, \#\, y\, \square\square\cdots▹x#y□□⋯ (bits as symbols 0/1\mathtt 0/\mathtt 10/1), every other tape ▹□□⋯\triangleright\square\square\cdots▹□□⋯, all heads at cell 000. "Halts with output www at step ttt" means: after exactly ttt steps the state is qhaltq_{\mathrm{halt}}qhalt​ and the whole output tape (tape 111) is ▹ w □□⋯\triangleright\, w\, \square\square\cdots▹w□□⋯ — no other non-blank cells; work tapes and head positions are unconstrained. Since qhaltq_{\mathrm{halt}}qhalt​ freezes the configuration, "some t≤Tt \le Tt≤T" is the same as halting within TTT steps. The machine model: finite alphabet containing pairwise distinct □,▹,0,1,#\square, \triangleright, \mathtt 0, \mathtt 1, \#□,▹,0,1,# (plus any extra symbols), finite state set with qstart≠qhaltq_{\mathrm{start}} \ne q_{\mathrm{halt}}qstart​=qhalt​, k≥2k \ge 2k≥2 one-way-infinite tapes (tape 000 input, read-only; tape 111 output; the rest work tapes; kkk fixed by MMM), ▹\triangleright▹ only in cell 000 and never moved left from, one step = simultaneous write/move on all tapes.

Edge cases. n=0n = 0n=0 (input "#\##") is not constrained at all. Inputs with ∣x∣≠∣y∣|x| \ne |y|∣x∣=∣y∣, or not of the form x#yx\#yx#y, are not constrained. g(1)=1⋅0⋅ln⁡0=0g(1) = 1\cdot 0 \cdot \ln 0 = 0g(1)=1⋅0⋅ln0=0 and g(2)=2ln⁡2⋅ln⁡(ln⁡2)<0g(2) = 2\ln 2 \cdot \ln(\ln 2) < 0g(2)=2ln2⋅ln(ln2)<0 (since ln⁡2<1\ln 2 < 1ln2<1), so the time clause would be unsatisfiable at n=1,2n=1,2n=1,2; g(n)>0g(n) > 0g(n)>0 for all n≥3n \ge 3n≥3. Because n0n_0n0​ is existentially chosen, these values are avoidable (take n0≥3n_0 \ge 3n0​≥3), and small nnn are covered only by the untimed correctness clause. The statement concerns a single machine for all nnn (uniform), with only a big-OOO (eventual, constant-factor) bound — no explicit constant.

Human review
  • Endorsed by Shuze Chen · Oct 9, 2026

    Confirmed by the moderator at approval.

  • Endorsed by avi · Oct 9, 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