Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Compilation of item-language operations to the stack machine is correct

Proved
NLogN.IOp.Step.runs

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

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

Let ooo be an item-language operation on SSS item stacks (add, neg, dup, drop, move, constant, mark, unmark, shift, split, read, write, cat) and suppose ooo steps from item state sss to s′s's′ with cost ccc (o.Step I s s' c). Then its compiled stack-machine statement o.stmt (over S+4S+4S+4 symbol stacks) runs from the encoding encI s to encI s' within cost ccc, for any procedure table and input.

Formalization Note. encI writes each item stack as a symbol stack using the sign–magnitude binary item encoding and adds four scratch stacks. This is the per-operation correctness of the compiler from the item language to the symbol stack machine of IntMul_HvdH_M_Defs1 (it combines the primitive runs for addition, duplication, shifting, splitting, concatenation, reading and writing).

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

open NLogN
open IntMul
variable {S P : ℕ}
variable {I : List Sym} {prog : Fin P → Stmt (S + 4) P}
Formal statement
theorem NLogN.IOp.Step.runs {o : IOp S} {s s' : IState S} {c : ℕ} (h : o.Step I s s' c) :
    Runs I prog (o.stmt : Stmt (S + 4) P) (encI s) (encI s') c := 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.IOp.Step.runs` of the Lean development NLogN/ILang.lean (lines 179–277), 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