Autoformalization
Translating informal mathematics, statements and whole proofs, into checked Lean code with machine learning.
On this page14 sections
Formal libraries only grow as fast as people can write Lean; AI-driven formalization is the route by which large papers and AI-found proofs get machine-checked.
Teaching a computer to turn maths written for people into proofs a computer can check.
- 1Paper proof in plain language
- 2AI drafts Lean statements and steps
- 3Kernel accepts or rejects
- 4People check the statement says the right thing
The task. Autoformalization means turning mathematics written for people into Lean code that the proof checker accepts, using machine learning. A human-written proof skips steps and relies on the reader; Lean needs every definition and step spelled out.
Two layers. Statement formalization maps an informal claim to a Lean statement. It is only checked for type-correctness, so it can compile and still be wrong (a misformalization); typical failures are the wrong quantifier order, a missing hypothesis, natural-number subtraction truncating at zero (in Lean 3 - 5 = 0 for natural numbers, so a statement that writes n - 1 silently changes meaning when n = 0), or a definition that differs in an edge case. Proof formalization maps a given informal proof to a Lean proof of a fixed statement, and the kernel judges it.
Evidence. Wu et al. (2022) showed that a language model prompted with a few examples could turn 25.3% of competition problems into formally correct Isabelle statements, and that training on the translations improved a prover's miniF2F score from 29.6% to 35.2%. Since then work has moved to research-level material. The Formal Conjectures project reports 2,615 formal statements, of which 1,029 are open conjectures and 836 are solved problems used for testing proof formalization. Large agent-built formalizations include the dimension-8 sphere packing proof (completed in February 2026 by a human team, with Math, Inc.'s Gauss model doing the final stages) and a 13-million-line Lean certificate of Fermat's Last Theorem (September 2026).
Failure modes. (1) Library gaps: papers use notions Mathlib lacks, so the agent must build them or silently change the theorem. (2) Fidelity: only people, adversarial proving of the negation, or round-trip translation can check meaning. (3) Scale: generated developments can be much larger than Mathlib and compile far slower. (4) Evaluation: older benchmarks saturate, so credible tests use open problems and new papers.
Why it matters. A checked proof lets one trust an AI result without trusting the AI.
Go deeper
The full technical text.
The task
Autoformalization turns mathematics written for humans into code a proof assistant accepts. It comes in two layers that fail in different ways.
- Statement formalization. Given "every even integer greater than 2 is a sum of two primes", write the Lean statement. The output is checked only for type-correctness, so a wrong but valid statement passes. This is the fidelity problem, and it is the hard part to certify.
- Proof formalization. Given a statement and a paper proof, produce a Lean proof. Here the kernel is the judge, so a result is simply right or wrong.
History in brief
Early evidence that language models could do this at all came from Wu, Jiang, Li and others, Autoformalization with Large Language Models (May 2022): few-shot prompting translated 25.3% of competition problems into formally correct Isabelle/HOL statements, and using those to train a prover raised the miniF2F proof rate from 29.6% to 35.2% in that setup. Since then the field has moved from competition statements to research mathematics:
- Corpora of formal statements. The Formal Conjectures project reports 2,615 formalized statements in Lean 4, of which 1,029 are open conjectures and 836 are solved problems used for proof autoformalization.
- Whole-project formalization with AI. The dimension-8 sphere packing project (Viazovska's theorem) reports that its Lean proof was completed in February 2026, with the final stages done by Math, Inc.'s autoformalization model Gauss alongside a human team (arXiv:2604.23468). In September 2026 Anthropic reported a 13-million-line Lean proof of Fermat's Last Theorem produced by Claude agents working largely autonomously for over eleven days (Anthropic); the Imperial College project that aims at a Mathlib-integrated formalization of the modern proof is separate and continues.
What makes it hard
- Library gaps. Research papers use definitions Mathlib lacks. The agent must either build them (with unclear design standards) or prove the result in a weaker setting, and the second option silently changes the theorem.
- Fidelity. A formalization that compiles can still state the wrong thing. Remedies are human review, round-trip translation, adversarial proving of the negation, and tools such as Comparator that fix the statement in advance.
- Scale and maintenance. A generated proof that is five times the size of Mathlib and compiles far slower than it is hard to merge or maintain, so the next bottleneck is quality of structure, not correctness.
- Evaluation. Benchmarks of statements and proofs are saturating quickly (see the benchmarks entry), so credible evaluation now means open problems and unpublished papers.
Why it matters beyond Lean
Computer-checked proofs let a reader trust an AI-produced argument without trusting the AI. The same translation step is what would let a mathematician state a conjecture once and have it enter every machine's problem list.
Words on this page (7)
- formalization
- Writing mathematics in a strict language a computer can check completely.
- misformalization
- A formal statement that compiles but does not say what the author meant.
- language model
- An AI trained on text to predict and generate the next words.
- Mathlib
- The community library of formalized mathematics for Lean.
- sphere packing
- The problem of packing equal balls as densely as possible.
- benchmark
- A fixed set of tasks used to compare systems.
- Comparator
- A Lean tool that checks a solution file proves exactly the statement in a challenge file.
New to this? Read first (3)
- Autoformalization with Large Language ModelsThe 2022 paper that showed the idea worked at all.
- Anthropic: Formalizing Fermat's Last TheoremA recent account of an agent-built formalization and its caveats.
- Formal ConjecturesA living collection of formal statements of open problems.
Understanding map
map of the whole wiki →What to read before Autoformalization (left), and what builds on it: entries that depend on it and its open problems (right). Every box links to its page.
- Start with
- Lean 4 & MathlibLibrary
- Step 2
- Machine-assisted theorem provingFrontier
- Then
- AutoformalizationYou are here
Open problems & questions
No open problems or questions on this entry.
Progress timeline
- Sep 4, 2026FLT certificate by coordinated agentssource
Anthropic reports about 13 million lines of Lean, about 30,300 machine-checked theorems (29,500 used in the final proof) and roughly six billion output tokens.
- Feb 1, 2026Dimension-8 sphere packing proof verified in Leansource
The project's human formalizers and Math, Inc.'s Gauss complete the formal proof of the dimension-8 theorem (February 2026, month only; the paper describing it was first posted on 25 April 2026).
- May 25, 2022Few-shot autoformalization with language modelssource
Wu et al. report that a large language model translates 25.3% of competition problems into correct Isabelle/HOL statements.