Claude Formalizes Fermat's Last Theorem: AI Writes the Largest Computer-Checked Proof Ever

A 350-Year-Old Theorem, Checked by a Machine

Fermat's Last Theorem is deceptively simple: no three positive integers x, y, and z can satisfy xn + yn = zn for any integer n greater than 2. Pierre de Fermat scribbled the claim in a book margin around 1637, famously claiming a proof too large to fit β€” and then mathematics spent 358 years chasing it. Andrew Wiles finally proved it in 1995 with a 129-page argument connecting elliptic curves to modular forms, a result reviewers took months to verify by hand.

On September 4, 2026, Anthropic announced the next chapter: the first complete, end-to-end, computer-checked formalization of Fermat's Last Theorem β€” and it was written largely autonomously by Claude, in the Lean proof assistant, in about eleven days.

What Anthropic Just Announced

According to Anthropic's research post, researcher Tianyi Peng β€” whose group at Columbia University builds tools for AI formalization β€” set out to test how far Claude could get on formalizing the theorem. The experiment went further than anyone expected.

Working on Prove2Me, an open collaborative platform for scaling mathematical formalization, and orchestrated through a Claude Code-based multi-agent harness, a team of Claude agents ran from August 7 to August 17, 2026. Humans occasionally commented on priorities or offered encouragement, but as Anthropic tells it, people wrote no mathematics and no Lean beyond the one-line statement of the goal theorem.

The finished proof was verified by Lean's kernel, relies on nothing beyond Lean's three standard axioms, and contains no sorry β€” the notorious placeholder that quietly marks unproven steps. An independent comparator confirmed that the theorem Claude proved is exactly Mathlib's own statement of Fermat's Last Theorem. The full proof is published on GitHub at anthropics/fermats-last-theorem.

The formalization was the last remaining item on Freek Wiedijk's famous list of 100 challenge problems for computer formalization β€” the same milestone Kevin Buzzard's multi-year community project at Imperial College London had been driving toward since 2024, and on whose foundations (Mathlib, the Imperial FLT project, and the flt-regular effort) Claude's proof builds.

The Numbers: 13 Million Lines of Lean

The scale of the run is what separates this from previous AI-math headlines:

Claude's proof follows the simplified version of Wiles's argument by Darmon, Diamond, and Taylor, winding through Mazur's torsion theorem (proved on Day 5), Ribet's level lowering, the Langlands–Tunnell theorem (closed on Day 11, just hours before the end), the Taylor–Wiles modularity lifting argument, and the famous "R = T" result that finishes the theorem. Along the way, the reasoning log shows the agents catching each other's false lemmas, correcting mislabeled difficulty estimates, and β€” 39 seconds after the last open statement was accepted β€” polling the platform repeatedly to confirm the root theorem had flipped to "Proved."

How Claude Did It: Multi-Agent Math on Prove2Me

The architecture matters as much as the result. Dozens of Claude agents worked in parallel on Prove2Me, which organizes a large proof as a shared dependency graph of "cards" β€” one theorem statement per node, plus its proof once accepted. Agents proposed statements, reviewed one another's statements for truth before work began, proved intermediate results, and assembled them into harder theorems. Anthropic notes that peer review caught several false statements early β€” including one false lemma that had passed a first review and was killed by a counterexample from a second reviewer before anyone wasted days proving against it.

Kevin Buzzard, the Imperial College mathematician who led the community FLT formalization effort, reviewed the output and told Anthropic the work holds up. Anthropic also reports a striking follow-up: in a small experiment, agents running on just three personal Claude Max subscriptions jointly formalized Vinogradov's Three Primes Theorem β€” a classic result in analytic number theory β€” in three days.

And there's a feedback loop: Anthropic says writing Lean seems to help Claude prove novel results in the first place, with the model using partial formalizations to independently check its own hypotheses, much as it writes numerical simulations to sanity-check its reasoning.

Why This Matters Beyond Pure Math

Formal verification has always been bottlenecked by a brutal translation problem. Human proofs skip "obvious" steps and lean on centuries of literature; proof assistants demand every step, spelled out, from a formalized foundation. That's why formalizing a 129-page proof was considered a decade-scale community effort. If an AI system can now do the autoformalization heavy lifting β€” 13 million lines in under two weeks β€” the economics of verified correctness change:

The takeaway isn't that mathematicians are obsolete. It's that the marginal cost of certainty just collapsed. As Anthropic puts it, this is a significant step toward a future in which all of mathematics can be readily checked.

AI Math Tools You Can Use Today

You don't need a research grant to start experimenting with AI-assisted mathematics and reasoning. A growing ecosystem of tools brings formal methods, symbolic math, and proof search to everyday users β€” from Wolfram Alpha's computational intelligence to Lean-based playgrounds and general reasoning models like Claude, ChatGPT, and Gemini. You can explore and compare math, research, and reasoning AI tools on aitrove.ai, where every tool is categorized, described, and linked to its official site.

Frequently Asked Questions

Did Claude prove Fermat's Last Theorem before humans?

No. Andrew Wiles proved the theorem mathematically in 1995. What Claude did in 2026 is formalize that proof β€” translating the human argument into the Lean language so a computer can verify every logical step mechanically, with no gaps and no trust in reviewers required. This is the first complete computer-checked version of the proof.

What is Lean?

Lean is an open-source proof assistant and programming language. Proofs written in Lean are checked algorithmically by a small, auditable kernel β€” if Lean accepts a proof, its correctness follows from logic alone. Mathlib, Lean's community mathematics library, contains hundreds of thousands of lines of formalized results. Claude's FLT proof is over 5x the size of Mathlib.

How autonomous was Claude really?

Anthropic says Claude ran largely autonomously for 11 days. Humans commented on priorities and offered encouragement, but wrote no mathematics and no Lean beyond the one-line goal statement. The multi-agent system managed its own decomposition, peer review, and assembly of roughly 29,500 intermediate theorems.

Can I read the proof myself?

Yes. Anthropic published the full proof and a written walkthrough on GitHub at github.com/anthropics/fermats-last-theorem, along with a companion document excerpting Claude's reasoning during the run.

What comes next for AI formalization?

Anthropic has expanded support for external researchers with free and discounted subscriptions and dedicated grants for larger projects β€” including formalizing other major theorems or improving Lean and Mathlib. A small follow-up experiment already formalized Vinogradov's Three Primes Theorem in three days using three personal Claude Max plans.

Discover AI Tools for Math, Research, and More

Explore 300+ curated AI tools on aitrove.ai β€” from reasoning models to research assistants and developer frameworks.

Browse All AI Tools β†’