Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

The parameter-computation program computes mkParams K N

Proved
NLogN.CR.parP_spec

by xuanji · Oct 13, 2026 · Mathlib 0df444a (Lean v4.33.1)

harvey-van-der-hoeven-tminteger-multiplicationturing-machines

Let K,N≥1K, N \ge 1K,N≥1 and N<2nbN < 2^{nb}N<2nb, and let sss be a machine state whose register rN holds NNN and rNb holds nbnbnb on top. Then the straight-line register program parP K is defined on sss and its result is parOut s K N: the state sss with the parameters of q=mkParams(K,N)q=\mathrm{mkParams}(K,N)q=mkParams(K,N) pushed on their registers — bbb, LLL, E=⌈log⁡24L⌉E = \lceil \log_2 4L \rceilE=⌈log2​4L⌉, eee, dhd_hdh​, K−dhK-d_hK−dh​, 2e2^e2e, α\alphaα, ppp, PPP, fnf_nfn​, the list of side lengths s1,…,sKs_1,\dots,s_Ks1​,…,sK​ (as records) and their product SSS.

Formalization Note. RS is straight-line code on the 64 item stacks with run/ok; pushV pushes an integer on a stack. mkParams is from Def_IntMul_HvdH_MachineRef. The machine layer: IState HS is a state with 646464 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 MMM 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 ∣z∣|z|∣z∣. MulBnd M m Φ says the multiplication procedure accepts all pairs of integers of bit length ≤m\le m≤m at cost ≤Φ\le Φ≤Φ. Register names (GU, CR, KB, XN, …) are fixed stack indices.

Preamble
-- 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
set_option linter.unusedVariables false
open NLogN
open NLogN.CR
open IntMul RS IntMul.HvdH IntMul.HvdH.Ref
Formal statement
theorem NLogN.CR.parP_spec (K N nb : ℕ) (hK : 1 ≤ K) (hN : 1 ≤ N) (hnb : N < 2 ^ nb) (s : IState HS)
    (LN LNb : List Item) (hsN : s.G rN = .int N :: LN) (hsNb : s.G rNb = .int nb :: LNb) :
    (parP K).ok s ∧ (parP K).run s = parOut s K N := by sorry
Source
D. Harvey, J. van der Hoeven, Integer multiplication in time O(n log n), Ann. of Math. 193 (2021), 563–617 (Theorem 1.1: multitape Turing machine multiplication in O(n log n)). Lemma `NLogN.CR.parP_spec` of the Lean development NLogN/HCrPar3.lean (lines 657–677), written for the prove2.me integer-multiplication campaign.

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