Skip to main content
AI MathematicsScientific Milestone· 3 min read· in Science

AI Agents Formalize Fermat's Last Theorem in 11 Days, Compressing a Multi-Year Mathematical Project

Anthropic's Claude completed the first end-to-end, machine-checked Lean 4 proof of Fermat's Last Theorem, generating 13 million lines of code and proving over 30,000 intermediate theorems.

By Harper Lane

Formal Methods Researchers 45%Traditional Mathematicians 35%AI Systems Engineers 20%
Formal Methods Researchers
Value the absolute certainty of machine-checked proofs and view AI as the necessary engine to scale formalization across all modern mathematics.
Traditional Mathematicians
Acknowledge the technical achievement but emphasize that formalizing an existing proof is distinct from the creative human intuition required to discover it.
AI Systems Engineers
Focus on the multi-agent orchestration breakthrough, viewing the shared dependency graph as a blueprint for solving complex software engineering tasks.

The ultimate arbiter of modern mathematical truth is no longer a peer-review committee, but a software kernel. A proof assistant like Lean evaluates logical dependencies without intuition or fatigue, deciding definitively whether a mathematical claim holds. On September 4, 2026, that kernel verified the first complete, end-to-end formalization of Fermat's Last Theorem. The 13-million-line proof certificate was not written by a team of human mathematicians over a decade, but by a coordinated swarm of artificial intelligence agents operating largely autonomously over 11 days.[2]

The milestone, announced by Anthropic, does not represent a new mathematical discovery. British mathematician Andrew Wiles, alongside Richard Taylor, proved Fermat's 1637 conjecture in 1995. Instead, the AI system translated that historic 129-page human proof into Lean, a specialized programming language that requires every hidden dependency, omitted algebraic step, and logical implication to be explicitly defined. Human mathematical prose routinely skips steps that experts consider obvious; Lean does not.[1][2]

To bridge that gap, an internal research model comparable to Anthropic's Claude Fable 5.1 generated approximately six billion output tokens. The resulting artifact is massive: it contains roughly 30,300 newly proved theorems, with about 29,500 intermediate theorems woven into the final dependency structure. By line count, the 13-million-line file is more than five times larger than Mathlib, the principal community-built mathematical proof library it builds upon.[1][2]

The scale of Claude's autoformalization artifact compared to traditional human timelines.

Early attempts at this scale failed because individual AI agents lost track of the project's state and stopped collaborating effectively. The breakthrough relied on Prove2Me, an open collaborative platform developed by Tianyi Peng and researchers at Columbia University. Prove2Me maintains a shared directed acyclic graph of theorem statements. This architecture allowed dozens of Claude agents to work in parallel, defining concepts, proving sub-results, and reusing completed work without trampling each other's progress.[1][2]

Early attempts at this scale failed because individual AI agents lost track of the project's state and stopped collaborating effectively.

The proof relies on only three standard mathematical axioms and contains no omitted steps or unverified placeholders. To ensure the result was genuine, the theorem statement was computationally compared against Mathlib's existing statement of Fermat's Last Theorem, and the logic was verified by an independent Lean kernel implementation.[2][3]

Kevin Buzzard, a mathematician at Imperial College London who has led a human community effort to formalize the theorem since 2024, reviewed the AI-generated artifact. "This extraordinary autoformalization achievement, which Anthropic researchers say only took 11 days, proves Fermat's Last Theorem with no assumptions other than the axioms of mathematics," Buzzard stated. He noted that the success signals a major shift: "If the automatic formalization of FLT is possible now, then we have taken a big step towards automatic formalization of the modern mathematical literature."[1][2]

While the achievement compresses a multi-year human timeline into less than two weeks, the resulting code is highly verbose. Anthropic researchers acknowledge that the 13-million-line proof is longer than strictly necessary, lacking the conciseness and elegance of human-curated Mathlib entries. Furthermore, formalizing a known proof path is fundamentally different from discovering a novel mathematical truth from scratch.[2]

The generated proof is more than five times the size of Mathlib, the principal Lean mathematics library.

The immediate consequence is a collapse in the barrier to entry for machine-checkable mathematics. In a separate experiment, three consumer-tier Claude models formalized Vinogradov's Three Primes Theorem in just three days using the same Prove2Me platform. As AI models begin generating novel conjectures and proofs at scale, the Lean kernel will serve as the necessary bottleneck, capable of instantly separating hallucination from absolute mathematical certainty.[1][2]

What we don’t know

  • Whether the broader mathematical community will accept AI-generated formalizations as standard practice, given the thin initial coverage of this milestone outside of specialized tech and AI outlets.
  • How much of the 13-million-line artifact can be cleanly merged into community libraries like Mathlib, which prioritize concise, human-readable code.
  • Whether the multi-agent Prove2Me architecture can successfully discover novel mathematical proofs, rather than just formalizing existing ones.

Viewpoints in depth

Formal Methods Researchers

Advocates for machine-checked proofs view this as the beginning of automated mathematics.

For researchers working in formal verification, the 13-million-line artifact represents a paradigm shift. The primary bottleneck in modern mathematics is no longer generating proofs, but verifying them—a process that can take human referees years for complex theorems. By demonstrating that an AI swarm can translate human prose into a strict, compiler-checked language like Lean in a matter of days, formal methods advocates argue that the entire corpus of modern mathematics could soon be digitized and mechanically verified, eliminating the possibility of hidden logical errors.

Traditional Mathematicians

Emphasize the distinction between formalizing an existing proof and discovering a new one.

While acknowledging the immense engineering achievement, traditional mathematicians caution against conflating formalization with discovery. Andrew Wiles spent years developing the creative intuition and novel connections required to prove Fermat's Last Theorem in 1995. Claude did not replicate that creative leap; it performed the highly structured, mechanical task of translating Wiles's known logic into code. Furthermore, human mathematicians value elegance and readability—qualities entirely absent from the AI's verbose 13-million-line output, which is more than five times larger than the community's curated Mathlib.

Why this matters

Checking a major mathematical proof by hand can take a team of experts years, creating a bottleneck in scientific progress. By proving that AI agents can translate complex human mathematics into machine-verifiable code in days, this milestone paves the way for automated error-checking across the entire modern mathematical literature.

Sources

Source coverage

3 outlets

3 viewpoints surfaced

Formal Methods Researchers 45%Traditional Mathematicians 35%AI Systems Engineers 20%
  1. [1]New ScientistTraditional Mathematicians

    Fermat’s last theorem formalised by AI agents in just 11 days

    Read on New Scientist
  2. [2]AnthropicFormal Methods Researchers

    Formalizing Fermat's Last Theorem

    Read on Anthropic
  3. [3]GitHubFormal Methods Researchers

    anthropics/fermats-last-theorem

    Read on GitHub

Comments

Stay informed

Every angle. Every day.

Get Science stories with full source coverage and perspective breakdowns delivered to your inbox.