the short version
- The result is a build gate, not a write-up: FinalCheck.lean fails unless fermat_last_theorem depends on exactly propext, Classical.choice and Quot.sound, and no module among the 60,475 contains sorry, native_decide or an added axiom.
- Anthropic credits the scaffold rather than more agents: unstructured runs lost track of project state and left only about 7% of the non-boilerplate lines before the team moved to Prove2Me's DAG of theorem statements.
- The kernel checks that the statement follows from the three axioms; the repository states plainly that no tool can check that each intermediate theorem means what its name suggests. That residual gap is where test-suite-driven agent loops fail.
Anthropic published the first complete computer-checked proof of Fermat's Last Theorem on 4 September 2026, written in Lean 4.33.1 against Mathlib v4.33.0. Claude worked largely autonomously for 11 days, wrote 13 million lines of Lean, produced computer-verifiable proofs of 30,300 theorems (29,500 used in the final proof), and consumed about six billion output tokens from a general-purpose internal research model Anthropic describes as roughly comparable to Claude Fable 5.1. The number that decides whether any of this transfers to ordinary engineering is not the line count: it is that the default build target fails unless the proof rests on exactly Lean's three standard axioms, propext, Classical.choice and Quot.sound, with no sorry, no added axiom and no native_decide in any of the repository's 60,475 modules.
The output of the run is therefore not a claim a reviewer has to weigh by taste. It is an artifact a kernel accepts or rejects, and the repository ships three checks. A from-scratch lake build of all 60,475 modules with Mathlib compiled from source; leanprover/comparator v4.33.0 run against verification/comparator/Challenge.lean, which states the theorem using only Mathlib, with the verdict "Your solution is okay!"; and nanoda 0.4.13, an independent Lean kernel written in Rust, which accepted an export of the same environment and reported "Checked 1052234 declarations with no errors".
What the Lean 4 FLT formalization actually verified
The statement in Theorems/Thm_fermat_last_theorem.lean is written with Lean's built-in natural numbers, +, ≤, < and ≠. Its one Mathlib ingredient is ^ on ℕ, which Mathlib defines as Lean's built-in exponentiation. FinalCheck.lean derives Mathlib's own FermatLastTheorem from it, and comparator confirmed that the proved statement and every constant it mentions are identical to the challenge, that no other axiom is used, and that the whole proof, Mathlib included, replays through the Lean kernel.
theorem fermat_last_theorem (n : ℕ) (hn : 3 ≤ n) (a b c : ℕ)
(ha : 0 < a) (hb : 0 < b) (hc : 0 < c) :
a ^ n + b ^ n ≠ c ^ n
/-- info: 'fermat_last_theorem' depends on axioms:
[propext, Classical.choice, Quot.sound] -/
#guard_msgs in
#print axioms fermat_last_theoremThe repository is explicit about the boundary of what this establishes. The checks show that the statement follows from the three axioms, given trust in the Lean kernel (or nanoda) and the checking tools. What no tool can check, in the README's own words, is that each intermediate theorem means what its name suggests; that is left to the reader, with PROOF-PATH.md naming the Lean theorem behind each step. That gap is the one every engineer meets when an agent turns a red test suite green: the machine confirmed a property, not necessarily the property you meant.
Why the first agent runs failed
The baseline matters for reading the 11 days. Wiles's first proof, published in May 1995, ran to 129 pages and required months of painstaking work to verify. Formalization was expected to take years, and the blueprint the mathematical community has been using for just the initial phase of the effort Kevin Buzzard kicked off at Imperial College London in 2024 runs to 86 pages.
A number of Claude's initial attempts failed. Agents had some early success, then quickly lost track of the project's state and stopped collaborating effectively; those runs contributed about 7% of the non-boilerplate lines in the final proof. The effort succeeded after the switch to Prove2Me, an open collaborative platform for formalizing mathematics designed by Tianyi Peng and his collaborators at Columbia University, driven by a Claude Code-based multi-agent harness. Dozens of Claude agents then collaborated to define concepts, prove intermediate theorems, and use those theorems to prove harder statements.
Anthropic names three properties of that platform that did the work, and all three have direct analogues in ordinary software:
- A directed acyclic graph of theorem statements that agents used to decide what proofs to attempt next, which mitigated memory degradation and let multiple agents work in parallel.
- Separation of theorem statements and proofs into different files, with the links between them maintained independently, which sped up Lean compilation and minimized resource consumption.
- A natural-language description of each theorem statement, enabling search and reuse, which resulted in a simpler proof path.
Read that as a shared task graph with typed interfaces, an interface and implementation split so a change to one body does not force a global rebuild, and a searchable index so an agent finds the existing helper instead of writing a fourth copy of it. Mathematical input from Tianyi Peng was limited to occasional high-level instructions such as "Jacobian as a scheme sounds high priority" and "push [the] Mazur [theorem] to be done soon."
The sorry gate and how work was decomposed
Lean's sorry admits a goal without proving it, and the repository treats it as a build-breaking token: no module of the proof contains sorry, and Challenge.lean uses sorry by design and is not part of the package. The sources do not describe how Claude used sorry during the run, how many stubs were open at any point, or whether stubbing was part of the search strategy at all. What they do describe as the decomposition mechanism is Prove2Me's DAG of theorem statements, held in files separate from the proofs, with the links maintained independently.
The engineering analogue is a declared signature plus a test that asserts its contract, not a TODO comment. A TODO is invisible to the compiler; an unimplemented function with a type and a failing test is a node the toolchain can count, and a build gate turns the open set into a work queue with a hard exit condition. Without a gate the toolchain enforces, the most likely output of an agent fleet is code that satisfies the checker without doing the work.
Compiler-in-the-loop rejection sampling and what it costs
Lean returns a binary verdict on every attempt, deterministically, which is what makes brute search over proof attempts viable in a way it is not against a human referee. The sources do not report how many Lean compilations were run, the per-attempt success rate, or the split of the six billion output tokens between generation and repair. What they do report in detail is the cost of checking the finished artifact once.
- The from-scratch build took 5 h 32 min at 96 jobs, needs about 5 GB of memory per parallel job with a few modules needing up to 36 GB, and peaked at 153 GB.
- Mathlib itself compiles from source in about 13 minutes at 96 jobs, since no prebuilt Mathlib matches the 4.33.1 toolchain.
- Disk: about 67 GB under .lake/ plus about 220 GB of C files that can be deleted as the build goes.
- comparator took 14 h 46 min, nearly all of it kernel replay on one core, with a peak of 230 GB and a recommendation to allow 300 GB.
- The nanoda export is 37.8 GB; writing it takes about 90 GB of memory for an hour, and the check itself about 40 GB, roughly 30 minutes at 16 threads.
- Both verification scripts are Linux-only, and the build needs Linux or macOS because some paths are too long for Windows.
Kevin Buzzard compiled the codebase and ran comparator himself, and reports that it checks out. He puts the size at over 13.4 million lines and says it takes nearly 20 times as long to compile as Lean's mathematics library on a 96-core machine, and that Lean is sluggish jumping from file to file on a repository of this size even on the 500 GB machine Anthropic gave him access to. In the comments on his post, David Jao computed that six billion output tokens would be $300,000 at API prices; that is an inference from list pricing, not a figure Anthropic published, and Anthropic reports no dollar cost.
Which parts transfer to type checkers and test suites
Three things transfer cleanly. First, the verifier has to be cheap enough to run per attempt and strict enough that passing means something; the FLT build fails on a single sorry or added axiom, and that is a CI policy anyone can copy. Second, orchestration state belongs outside the agent context, because the Prove2Me DAG exists precisely because agents lost track of the project's state. Third, compile-time economics dominate at scale, which is why separating statements from proofs into different files is listed alongside the DAG as a reason the second attempt worked.
What does not transfer is the completeness of the oracle. A type checker rules out a narrow class of errors and a test suite covers only the behaviours someone wrote down; neither is a kernel replay of every declaration beneath the top-level claim. Buzzard's read on the mathematical content is worth holding onto: he writes that the work "tells us essentially nothing" mathematically, because the formalization faithfully follows the early literature on the proof and adds nothing. The demonstration is about the loop, not about the theorem.
If thousands of pages of the literature can be formalized end-to-end by some kind of AI swarm in an 11 day period now, then in the future we will start to see formalization of modern research being done on the fly.
The scope limit and what is still unknown
The proof follows the Darmon–Diamond–Taylor exposition from 1995 of the Wiles–Taylor–Wiles argument, via the Langlands–Tunnell theorem and Ribet's level-lowering theorem, not the modern route via Khare, Taylor and others that Buzzard has been formalizing. Buzzard reports that the repository develops Fontaine theory, to study flat deformations of Galois representations, and enough of Mazur's work on the Eisenstein ideal to conclude that no Frey curve can have a point of a particular order, and that the resulting argument covers only a restricted set of exponents; the published text of his post drops both the order and the exponent condition, so the specific values are not recoverable from the sources. He notes the remaining cases were already handled, because FLT was formalized for odd regular primes by Best–Birkbeck–Brasca–Rodriguez–van-der-Velde–Yang and the smallest irregular prime is 37, and Anthropic says its proof adapts pieces from the Imperial College London FLT project and the flt-regular project. Buzzard also records that this was the final theorem on Freek Wiedijk's list of 100 formalization challenges, closing a 20-year-old benchmark.
Several things the sources do not report: any per-attempt success rate, the number of Lean compilations, dollar cost beyond the token count, and how the Claude Code-based harness allocated work among agents. The repository is labelled a research artifact, not maintained and not accepting contributions; its 390 MB html/ folder carries a page for each of the 29,511 theorems and each of the 1,450 definition modules, was machine-tested in a Chromium-based browser only, and its English summaries and suggested references are generated automatically while the Lean statement is authoritative. Anthropic offers one smaller data point on scaffolding: three personal Claude Max plans, collaborating entirely through Prove2Me, jointly completed a formalization of Vinogradov's Three Primes Theorem in three days, which Anthropic reads as evidence that collaborative formalization of major results with consumer AI subscriptions is achievable with the right scaffold.
If you want to test the transfer on your own codebase, the cheap first move is the one the FLT repository makes: fail the build on the equivalent of a sorry, and put the task graph somewhere the agents read from rather than somewhere they have to remember.
Questions this raises
did AI actually prove Fermat's Last Theorem
Claude produced a Lean 4 formalization that the Lean kernel accepts, resting on only the three standard axioms with no sorry and no added axioms. Wiles's 1995 proof remains the mathematics; what is new is a complete machine-checked formalization of it. The README notes no tool can check that each intermediate theorem name means what it suggests, which is left to the reader via PROOF-PATH.md.
how long does it take to verify the Lean 4 FLT proof yourself
A from-scratch lake build of all 60,475 modules takes 5 h 32 min at 96 jobs, with Mathlib compiling from source in about 13 minutes. The comparator check adds 14 h 46 min, nearly all of it kernel replay on one core. Plan for about 67 GB under .lake plus roughly 220 GB of deletable C files, and 300 GB of memory headroom.
what made the multi-agent Lean run succeed after earlier failures
Early runs lost track of project state and stopped collaborating, contributing only about 7% of the non-boilerplate lines. The switch to Prove2Me, an open platform from Tianyi Peng and collaborators at Columbia, plus a Claude Code multi-agent harness, supplied a DAG of theorem statements, a split of statements from proofs, and natural-language descriptions for search and reuse.
These daily notes are drafted by a model I run and operate myself - the same kind of pipeline this site is about - from sources published in the previous 24 hours, and every one lists what it read. The longer essays, the talks and the preprint are mine, written by hand.
