science 7 min read

Claude Just Verified Fermat's Last Theorem in 11 Days — What Comes Next

Anthropic's Claude produced a complete machine-verified formalization of Fermat's Last Theorem in 11 days — 13 million lines of Lean code, five times larger than Mathlib itself. Human researchers at Imperial College had estimated years for the same task. The implications for software verification, math benchmarks, and AGI credibility are enormous.

  • Anthropic
  • AI Research
  • Formal Methods
  • Mathematics
  • Software Verification

The impossible, in eleven days

Fermat’s Last Theorem is one of the oldest unsolved problems in mathematics. Pierre de Fermat scribbled a conjecture in the margin of a book in the 1600s: no three positive integers a, b, and c satisfy a^n + b^n = c^n for any integer n greater than 2. The problem resisted every attempt for over three centuries until Andrew Wiles published a proof in 1995 — 129 pages of dense argument that took the community months to fully verify.

Now Claude has produced a machine-checkable formalization of that same proof in 11 days.

The numbers are staggering. About 13 million lines of Lean code. Roughly 33,000 individual theorems proved along the way, with about 29,500 deployed in the final output. The proof depends only on Lean’s three standard axioms. There are zero sorry placeholders — the incomplete assertions that normally signal where a formal proof is still relying on human trust rather than mechanical verification.

A team at Imperial College London led by Kevin Buzzard started working on the same formalization project in 2024. Their initial planning document alone was 86 pages. They expected years.

How Claude actually did it

Anthropic researcher Tianyi Peng put Claude to work on the problem, deploying dozens of Claude agents across the project. Each agent handled a different chunk — definitions, intermediate lemmas, eventually climbing toward the harder propositions. The system built proofs bottom-up, like constructing a cathedral one stone at a time.

But coordination was the real challenge. Early attempts failed because each agent lost track of the overall project state. They couldn’t reuse each other’s work. Multi-agent systems don’t automatically scale to multi-year projects.

Peng and the team solved this with Prove2Me, a collaborative platform they built specifically for mathematical formalization. It manages theorem dependencies as a directed acyclic graph, so multiple Claude agents always know which results are available and which theorems still need to be tackled. The platform separates theorem statements from proofs into different files to speed up compilation, and attaches natural-language explanations to each result for easier search and reuse.

The result passed Lean’s standard kernel check. It also passed validation in nanoda, an independently implemented Lean kernel written in Rust, which verified over one million declarations without errors. A comparison tool confirmed the proof targets the same statement about Fermat’s Last Theorem as Mathlib’s existing (incomplete) encoding.

Why this isn’t just a math trick

There is a deep reason why this matters beyond pure mathematics.

Lean, Coq, Isabelle — these theorem provers don’t just check math. They check anything expressible as a formal logical system. The same infrastructure that verifies a number theory proof can verify a microkernel, a distributed protocol, a cryptographic library.

Software verification has been possible in principle for decades. In practice, it has been brutally expensive. The effort required to translate even a modest piece of software into formal logic has grown faster than any organization could afford. That is why the vast majority of critical infrastructure — the TLS libraries, the operating system kernels, the flight control systems — still runs on code that nobody has formally proven correct.

Claude’s Fermat formalization demonstrates something qualitatively different from previous AI-assisted theorem proving. Earlier efforts, including work by Google DeepMind’s Gato and Meta’s LeanCoPT, produced proofs for smaller problems or shorter sequences. The key difference here is scale and completeness. This is not a toy problem. It is one of the deepest results in modern mathematics, and the formalization is complete, self-contained, and independently verified.

The practical consequence: verification becomes tractable

If an AI system can produce a fully verified formalization of a proof that took human mathematicians decades to complete and years to formalize, the same pipeline can be applied to software.

Consider what this means for the Rust ecosystem, where nanoda lives. Rust already has strong memory-safety guarantees, but those guarantees apply to individual programs, not to the entire chain of dependencies. A formalized proof library means you could verify that your cryptographic routine actually implements the algorithm you think it does, down to the bit level.

It also means the bottleneck shifts. The bottleneck is no longer writing the formal proof — it is writing the specification. What are you actually trying to prove? That question is still deeply human. But the mechanical labor of filling in the gaps, connecting lemmas, handling edge cases — that is now delegable.

The benchmark problem

Every major AI lab treats theorem proving as a credibility signal. Passing the Putnam exam, solving IMO problems, producing Lean proofs — these are benchmarks that signal general intelligence in a domain where hallucination is nearly impossible to hide. If the proof doesn’t check, it doesn’t check. There is no plausible way to get lucky.

Claude’s Fermat formalization raises the bar significantly. Previous benchmarks measured progress on smaller, curated problems. This is a complete formalization of a landmark result from first principles, with zero gaps and independent kernel verification. It makes any future benchmark in this space look trivial by comparison — unless it involves something equally deep.

That said, there is a cautionary note. The proof relies heavily on Mathlib, the existing Lean mathematics library. A significant portion of the 13 million lines is likely infrastructure and re-formalization of known results rather than novel mathematical insight. The real question is whether Claude can go further — whether it can produce novel formalizations of results that have no existing encoded representation, rather than extending what is already there.

Who wins, who loses

Anthropic wins the credibility contest. The Fermat result gives them a concrete, indisputable achievement that no one can dismiss as benchmark gaming. It also validates their multi-agent architecture and Prove2Me platform as serious tools, not just research exercises.

Human formalization teams lose some of their urgency. Buzzard’s project at Imperial was already underway when Claude produced its result in a fraction of the time. That doesn’t make human-led formalization pointless — human mathematicians still understand the structure and intuition behind these proofs in ways that matter for research — but it does mean the race to encode existing knowledge is now dominated by AI.

The software industry wins if they pay attention. The gap between what we can prove about our code and what we actually deploy has been the single most costly inefficiency in computing. If AI can close even a small fraction of that gap, the reliability of everything from medical devices to financial systems improves dramatically.

AGI skeptics lose a concrete argument. Formal theorem proving has long been held up as a domain where AI consistently fails to reach human parity. Claude just surpassed that benchmark at a scale that previously seemed years away. Whether this constitutes AGI is a separate debate — but it certainly constitutes a capability that was not credibly forecast before 2024.

What happens next

Anthropic’s expectation, stated in the source material, is that computer-verified formalizations will become standard alongside human-readable papers. That is a conservative prediction. The more likely trajectory is faster.

The immediate next step is applying Prove2Me to other landmark theorems — the Prime Number Theorem, the Four Color Theorem, the Kepler Conjecture. Each of these has its own formalization challenges, but the pipeline is now proven. The question is not whether it works, but how much depth Claude can handle before hitting architectural limits.

Then comes software. If the same multi-agent framework can formalize a 129-page number theory proof, it can formalize a TLS implementation, a distributed consensus protocol, a compiler front end. The specifications are harder — software behaves differently than abstract algebra — but the core problem is the same: bridging the gap between an informal claim and a mechanically verified one.

The 13 million lines of code are not the story. The story is that the bottleneck moved.

GitHub repository: https://github.com/anthropics/fermats-last-theorem