
Claude codes a sentence traveling through a brain in a simulated visual.
Anthropic.com
Anthropic published the first complete computer-checked formalization of Fermat’s Last Theorem on September 4, 2026 — a task the mathematical community had expected to take years of coordinated human effort — after Claude wrote 13 million lines of Lean proof-assistant code in 11 days using a multi-agent platform that solved the fundamental problem of how AI agents share mathematical state across long, complex projects.
The result does not represent new mathematics. Andrew Wiles proved Fermat’s Last Theorem in 1995; the underlying argument remains his. What Claude produced is a formalization — a translation of that 129-page proof into a language a computer can verify line by line, algorithmically and without ambiguity, eliminating any reliance on a human referee’s judgment. Kevin Buzzard, the Imperial College London mathematician who has been leading a multi-year community project to formalize the same theorem, reviewed the result and said it proves the theorem “with no assumptions other than the axioms of mathematics.”
That distinction — verification, not discovery — is important. It is also, for the long-term practice of mathematics, possibly more important than another discovery would have been.
Why Fermat Formalization Mattered Before Claude Changed It
Fermat’s Last Theorem carries one of the most famous origin stories in mathematics. Around 1637, Pierre de Fermat wrote in the margin of his copy of Diophantus’s Arithmetica that no positive integers a, b, and c satisfy aⁿ + bⁿ = cⁿ for any integer n greater than 2, then added that he had “a truly marvelous proof of this, which this margin is too narrow to contain.” The mathematical community now believes that proof, if it ever existed in a rigorous form, was almost certainly wrong. The techniques required to actually prove FLT would not be developed for another three and a half centuries.
Wiles’s 1995 proof ran to 129 pages and drew on algebraic geometry, number theory, harmonic analysis, and commutative algebra. Even after publication, a critical gap was discovered during review; Wiles and his former student Richard Taylor spent a year patching it. The episode became a defining example of why mathematical verification is hard: even the community’s most expert readers, working intensively, can miss errors that compound downstream.
Proof assistants like Lean address this by demanding that every step in an argument be encoded in a formal language a small, trusted kernel can check mechanically. The tradeoff is labor: what a human proof presents in a paragraph, a Lean proof may require pages to make explicit. Lean cannot read between the lines or grant the benefit of the doubt. For a proof as long and technically varied as Wiles’s, that translation work was expected to be immense.
In 2024, Buzzard launched an EPSRC-funded five-year community project at Imperial College London to formalize FLT in Lean, recruiting mathematicians worldwide and publishing an 86-page formalization blueprint for the work. Progress was expected to unfold over years.
What Prove2Me Fixed — and Why the First Attempt Failed
Tianyi Peng, an Anthropic researcher whose group at Columbia University builds tools for AI formalization, set out in early August 2026 to test whether Claude could make progress on the project. The initial attempt, using a standard Claude Code multi-agent harness, failed. Agents made early progress but quickly lost track of the overall project state and stopped collaborating effectively.
The failure reflects a structural problem in long-horizon AI formalization: with 13 million lines of code and thousands of intermediate theorems to track, no single agent’s context window can hold the state of the entire project. When multiple agents work without a shared external state, they duplicate effort, overwrite each other’s progress, and eventually become unable to determine what remains to be done. This is not a model capability failure — it is an architecture failure.
The fix was Prove2Me, an open-source formalization platform built by Peng’s Columbia group. Prove2Me maintains a directed acyclic graph — a DAG — of all theorem statements in the project. Each theorem is a node; each dependency between theorems is a directed edge. The DAG encodes, for any theorem, exactly which prior results its proof requires. When a new agent joins the project, it queries the DAG to learn which theorems have already been proved, which are currently being worked on, and which remain open. No two agents duplicate the same work; no agent loses track of what the collective has accomplished.
Prove2Me also separated theorem statements from their proofs into different files, with the dependency links maintained externally. This matters for compilation efficiency: Lean checks only files that have changed, so keeping statements and proofs in separate files means agents do not force the entire proof to recompile every time they touch a single result. The platform additionally maintained a natural-language description of each theorem node, enabling agents to search for relevant prior results semantically rather than scanning millions of lines of code.
With Prove2Me in place and a Claude Code-based multi-agent harness orchestrating the effort, the run was launched overnight in the early hours of August 7. A team of dozens of Claude agents collaborated to define mathematical concepts, prove intermediate theorems, and assemble those into ever-harder statements — working in parallel, coordinated by the shared DAG rather than by any central agent. Human oversight from Peng was minimal: occasional high-level direction (“Jacobian as a scheme sounds high priority,” “push the Mazur theorem to be done soon”), with the agents otherwise working autonomously. Excerpts of Claude’s own reasoning during the run were published by Anthropic.
The Scale — and What It Cost
At 13 million lines of Lean code, Claude’s proof is more than five times the size of Mathlib, the community-maintained library of formalized mathematics that the proof builds upon. The proof verified 30,300 theorems along the way, of which 29,500 appear in the final argument. The model used was a general-purpose internal research version roughly comparable to Claude Fable 5.1, consuming approximately six billion output tokens — a compute cost placing this firmly in the range of a serious research project rather than a casual experiment.
The failed first attempt contributed about 7% of the non-boilerplate lines in the final proof. The sheer size of the result, and its distance from Mathlib’s concise, community-reviewed style, reflects the machine origin of the work: the proof is likely significantly longer than the minimum necessary to establish the result.
The proof was completed on the night of August 17. Claude’s own reasoning, captured in excerpts published by Anthropic, marked the moment:
“THE FLT root reads Proved on the site. Historic moment (modulo re-check).”
“🏁🏁🏁 The FLT ROOT reads PROVED on prove2me at 02:00:57Z Aug-18. Historic moment for this campaign.”
Lean then confirmed the result. A separate comparator tool verified that the theorem’s statement matches Mathlib’s own canonical statement of Fermat’s Last Theorem, checked against Lean’s three standard axioms.
What Formalization Actually Does — and What It Does Not
For a reader without a formal mathematics background, it helps to be precise about what Lean’s verification guarantees and what it does not. Lean checks that a proof follows, step by step, from its stated definitions, axioms, and prior verified results. It does not guarantee that the definitions are meaningful, that the axioms are philosophically sound, or that the theorem statement was encoded correctly. Trust in Lean’s output is only as strong as trust in Lean’s kernel — the small core program that performs the checking.
That trust is not unconditional. In summer 2026, a kernel soundness bug in Lean briefly allowed a spurious “disproof” of the Collatz conjecture to pass verification before the bug was discovered and fixed. The Lean FRO published a postmortem. The episode underscores that machine-checked proof is a substantial improvement over human review, but it is not an absolute guarantee — it is a guarantee conditional on the correctness of the checker itself, which is itself a software artifact.
Within those limits, Lean’s verification is rigorous in a way human peer review is not. Thomas Hales’s 1998 proof of the Kepler conjecture spent four years in review before a 12-referee panel could agree only on “99% certain” — Hales eventually led a 20-person project, Flyspeck, to formalize it. Grigori Perelman’s proof of the Poincaré conjecture required the community roughly four years and three 300-page expositions to accept. Formalization offers a pathway out of this bottleneck.
As Buzzard told Anthropic after reviewing the proof: “If the automatic formalization of FLT is possible now, then we have taken a big step towards automatic formalization of the modern mathematical literature. Such autoformalization techniques will lead to new tools, rooting out errors in the current mathematical corpus and lightening the load of referees.”
Who Gets Credit for a Proof No One Person Wrote?
The achievement sits on a foundation of community labor that the capability story, taken alone, can obscure. Anthropic’s own GitHub repository for the proof credits 106 upstream files to Buzzard’s Imperial College London FLT project and to Mathlib contributors. Mathlib itself — the library that Claude’s proof is, at 13 million lines, more than five times the size of — was built by hundreds of mathematicians over years of volunteer effort. The Lean FRO, a nonprofit, has maintained and developed the proof assistant infrastructure that makes any of this possible.
The Lean community’s own framing of the FLT formalization attributes the milestone to Buzzard’s project and positions it as the final entry on Freek Wiedijk’s 100-problem challenge list for formalized mathematics — with no mention of Claude. Buzzard’s EPSRC-funded project, which was planned to run through 2029, was working toward this same goal with community labor as its primary resource.
None of this diminishes the genuine engineering achievement of the Anthropic run. Prove2Me’s architecture solved a real coordination problem; the 11-day timeline is real; the Lean verification is real. But research institutions and funding bodies evaluating AI-assisted formalization now face a question the mathematics community has not previously confronted at this scale: when AI achieves a milestone that community infrastructure made possible, what attribution standards should govern who gets the credit — and, more practically, who gets the next research grant?
Anthropic acknowledged the upstream contributions in its research post’s Acknowledgments section, noting that Claude’s proof “adapts pieces from the Imperial College London FLT project led by Kevin Buzzard and the flt-regular project,” and thanking the Lean FRO, Mathlib’s contributors, and Buzzard personally for reviewing the result.
What Comes Next — Including on a Consumer Subscription
Anthropic used the occasion to demonstrate that the technique does not require enterprise-scale compute. In a smaller follow-up experiment, researchers used three personal Claude Max subscriptions to formalize Vinogradov’s Three Primes Theorem — a significant result in additive number theory — in three days, collaborating entirely through Prove2Me. Anthropic concluded that collaborative formalization of major results using consumer AI subscriptions is achievable with the right scaffolding.
The full proof is available at github.com/anthropics/fermats-last-theorem under an Apache 2.0 license, alongside a written walk-through. Anthropic, along with other labs, has recently expanded support for external researchers working on pure math and formalization, offering free and discounted subscriptions, research credits, and dedicated grants for larger scientific projects.
The broader implication for the mathematical profession — still being absorbed — is that AI formalization at scale changes the bottleneck in verifying novel AI-generated mathematics. If AI can produce both the proof and its formalization, the load on human referees shifts from checking every logical step to understanding whether the theorem statement means what it claims to mean. As Anthropic put it: “We expect it will become common to produce a formalized proof alongside any write-up intended for a human reader.”
Frequently Asked QuestionsWhat is proof formalization, and why does it matter?
Proof formalization means translating a mathematical proof written in ordinary mathematical language into a formal programming language — in this case, the Lean proof assistant — that a computer can verify step by step without relying on human judgment. Formalization matters because human peer review of complex proofs is slow, expensive, and fallible: the community’s review of Andrew Wiles’s original 1995 proof took months of intensive expert work and still missed a critical gap. A machine-checked proof removes that fallibility from the chain, at the cost of significant translation labor. Claude’s 11-day run demonstrates that AI can now perform that translation at a scale and speed that humans cannot match.
Did Claude prove Fermat’s Last Theorem — or just verify what Wiles already proved?
Claude verified, not proved, in the sense that the underlying mathematical argument is Wiles’s, following a simplified exposition by Darmon, Diamond, and Taylor. What Claude produced is a machine-checkable encoding of that argument — one that no human could have produced at anything like this speed. The distinction matters: this is not a case of AI discovering new mathematics (that was Anthropic’s earlier Riemann zeta work, which improved a known bound). This is AI demonstrating that it can now translate complex existing mathematics into a trusted, auditable form faster than entire communities of human specialists. For more detail on the full methodology, Anthropic’s research post covers the architecture in depth.
What role did the mathematics community’s prior work play — and who gets credit?
Anthropic’s own GitHub repository for the proof credits 106 upstream files to Kevin Buzzard’s Imperial College London FLT project and to Mathlib contributors. Mathlib, the community-maintained library of formalized mathematics that Claude’s proof builds upon, is itself the product of hundreds of mathematicians’ volunteer labor. Prove2Me, the platform that made the 11-day timeline possible, was built by Peng’s Columbia group — not by Anthropic. The Lean proof assistant itself is maintained by the nonprofit Lean FRO. The capability story is real; so is the dependency on community infrastructure. Research funders are now confronting how to attribute and reward community labor when AI runs achieve milestones on top of it.
Could Lean itself contain errors that invalidate the verification?
Yes, in principle — though the probability is low and actively managed. Lean verification depends on the correctness of Lean’s kernel, a small core program that performs the logical checking. In summer 2026, a kernel soundness bug briefly allowed a spurious disproof of the Collatz conjecture to pass verification before it was caught and corrected; the Lean FRO published a detailed postmortem. The FLT proof also used a separate comparator tool to confirm that its theorem statement matches Mathlib’s own canonical FLT statement. Lean verification is significantly more reliable than human peer review for large proofs — but it is not an unconditional guarantee, and trust in any specific Lean proof is conditional on trust in the version of the Lean kernel that checked it.