Formalizing Fermat's Last Theorem

A September 2026 Science post reporting that a team of Claude agents, running largely autonomously for eleven days on the Prove2Me platform, wrote a complete Lean proof of Fermat's Last Theorem (about 13 million lines and 29,511 theorems) following the Darmon-Diamond-Taylor account of Wiles's proof; Lean, the comparator tool and a second kernel accepted it, and Kevin Buzzard, who leads the human formalization project, compiled and checked it and judged that it adds nothing new mathematically but shows what autoformalization can now do.

Anthropic (Science); the work was led by Tianyi Peng (Anthropic and Columbia University) · 2026-09-04 · original

Fermat's Last Theorem says that no positive integers a, b and c satisfy aⁿ + bⁿ = cⁿ for any n greater than 2. Andrew Wiles's proof, completed with Richard Taylor and published in 1995, rests on decades of modern number theory, and turning it into a form a computer can check had been expected to take years: since 2024 a funded community project led by Kevin Buzzard at Imperial College London has been working toward it in the Lean proof assistant. This post, published on 4 September 2026 under Anthropic's Science label, reports that Claude agents produced "the first end-to-end, computer-checked proof" of the theorem in Lean in eleven days. It stresses that the novelty is in the checking, not the mathematics: unlike the Riemann zeta result of the previous month, "what's novel here is the verification."

The post (about 2,400 words) is the main account. The version of record for what was proved is the repository it links, anthropics/fermats-last-theorem, at its first commit (aa2d8b3, 3 September 2026), whose README and PROOF-PATH file state the theorem, the checks run and the exact strength of each step. A 17-page companion document gives a timeline and excerpts from Claude's reasoning. The post names no individual authors; the work was started by Tianyi Peng, an Anthropic researcher whose group at Columbia University builds the Prove2Me platform, described in a separate preprint (Chen et al., arXiv:2608.28433). Buzzard's own blog post of the same day, and his replies to its comments, are the main outside assessment.

What formalization means here

A proof assistant such as Lean checks every logical step of a proof mechanically. A proof written for human readers skips steps and relies on the published literature; a formal proof must spell out every step and build on whatever has already been formalized, here Mathlib, Lean's community library of mathematics. Autoformalization is the conversion of human-written mathematics into such a formal proof by an AI system. The result is a guarantee that the stated theorem follows from the axioms, provided the checker is sound and the formal statement says what it is meant to say.

What was done

The mathematical route

The proof follows the argument of Frey, Serre, Ribet, Wiles and Taylor-Wiles in the 1995 exposition by Darmon, Diamond and Taylor (post, section "Formalizing Fermat's Last Theorem"; repository, PROOF-PATH.md). In outline: a counterexample with a prime exponent p of at least 5 would give a Frey curve, an elliptic curve with unusual properties; Mazur's work shows that a certain representation attached to it is irreducible; Wiles's argument shows the curve is modular; Ribet's level lowering then produces a weight-2 cusp form of level 2, and there are none.

The repository states that the named classical theorems are "proved in the strength the argument needs," and lists exactly what that is (PROOF-PATH.md, "Exact strength of the named steps"). For example, Mazur's irreducibility result is proved for Frey curves only, and only for p of at least 17 by Mazur's Eisenstein-ideal method; the exponents 5, 7, 11 and 13 are settled outright, 5 by a descent argument and 7, 11 and 13 by Kummer's theorem for regular primes ported from the flt-regular project, and the exponents 3 and 4 come from results already in Mathlib (PROOF-PATH.md, steps 1 and 3). Wiles's modularity theorem is proved for semistable curves in the form needed, and Ribet's theorem only for the Frey representation. Buzzard's blog post makes the same point about the small exponents and notes that the human project follows a more modern route (Khare, Taylor and others) than this one.

How the agents worked

According to the post, dozens of Claude agents worked in parallel, defining concepts and proving intermediate results on the way to harder ones, using "a general-purpose internal research model roughly comparable to Claude Fable 5.1" and about six billion output tokens. Earlier attempts without the platform failed because agents "quickly lost track of the project's state"; work from those attempts makes up about 7% of the non-boilerplate lines in the final proof. The run succeeded on Prove2Me, which keeps a directed graph of theorem statements for agents to choose from, separates statements from proofs to speed compilation, and stores a plain-language description of each statement for search and reuse.

The companion document gives the timeline: the run started in the early hours of 7 August 2026 and the final theorem was marked proved at 10:00:57 pm US Eastern on 17 August (Section 3 and Figure 1). That is the eleven days of the headline; the post elsewhere says the Prove2Me run took "a little under two weeks," and the companion's Section 4 describes the independent recheck on the following two days.

The human contribution

The post says human mathematical input "was limited to occasional high-level instructions from Tianyi," quoting two: "Jacobian as a scheme sounds high priority" and "push [the] Mazur [theorem] to be done soon." The companion document (Section 1) says humans "occasionally commented on priorities or offered encouragement, but wrote no mathematics and no Lean beyond the one-line statement of the goal theorem." The proof reuses human-written Lean: 106 files contain material adapted, with credit, from the Imperial College project and flt-regular, and 23 reproduce Mathlib text (ATTRIBUTION.md).

What it reports

  • Size. About 13 million lines of Lean (about 10.5 million without generated boilerplate) and 29,511 theorems in the final proof, out of about 30,300 proved on the platform (post; companion document, Section 2 and Figure 1). The post says the proof is over five times the size of Mathlib and attributes this partly to the proof being "likely much longer than it needs to be" (footnote 3). Buzzard measured "over 13.4 million lines of code."
  • Statement and axioms. The theorem is stated in elementary terms (no positive solutions for any n of at least 3), and the build fails unless the proof rests on exactly Lean's three standard axioms, with no unproved placeholders (README, "The statement").
  • Checks. A from-scratch build of all 60,475 modules, whose default target also derives Mathlib's own statement of the theorem from the repository's; the comparator tool of the Lean Focused Research Organization, which confirmed that the proved statement and every constant it mentions are identical to a reference statement written with Mathlib alone, that no other axiom is used, and that the whole proof replays through Lean's kernel; and nanoda, an independent Lean kernel written in Rust, which accepted all 1,052,234 declarations of an exported copy, run with four small published patches that the README says change no typing rule (README, "How it was verified").
  • Cost to check. The README reports 5 h 32 min to build at 96 parallel jobs with a peak of 153 GB of memory, and 14 h 46 min for the comparator run with a peak of 230 GB ("Check it yourself").
  • A smaller run. The post adds that three personal Claude Max subscriptions, collaborating through Prove2Me, formalized Vinogradov's three primes theorem in three days. It gives no further detail.

Who checked it, and what they said

The guarantee comes from the machine checks above. The README states their limit: the checks establish that the statement follows from the axioms, but "What no tool can check is that each intermediate theorem means what its name suggests"; Lean names in the repository are machine-generated and "where a name and a statement disagree the statement is what was proved."

Kevin Buzzard reviewed the proof at Anthropic's invitation and is quoted twice in the post, calling it an "extraordinary autoformalization achievement." On his own blog (4 September 2026) he reports that he compiled the code and ran comparator, and that "it checks out." He also writes that "mathematically this work of anthropic tells us essentially nothing," since the number theory community was already confident in the proof and the formalization "just faithfully follows the early literature on the proof and adds nothing"; its significance, in his view, is what it shows about autoformalization and the future of refereeing. He notes that his EPSRC-funded project had other aims the formalization does not meet, including contributions to Mathlib and a document for humans exploring the modern proof. Asked in the comments how he knew the agents had not exploited a soundness bug in Lean, he replied (5 September 2026) that he had spent many hours reading the code, had an agent list everything that was not a definition or proof, inspected the roughly 100 such lines with Claude and found them to define a convenience tactic, and noted that a recent review of Lean's code base by OpenAI's models had found no soundness issues in the Lean version used. In another reply he mentioned errors in the literature "which were spotted during the formalization process, which have been highlighted on the Lean Zulip"; this note did not read those discussions. In a later account (Xena, 12 November 2026) he adds that the code base would not compile on his own machine and that Anthropic gave him temporary access to one with 96 cores and 500 GB of memory.

A guest post on the same blog (16 October 2026) by seven formalization researchers, Buzzard among them (Avigad, Buzzard, Commelin, Degenne, Morrison, Nash and Topaz), writes that "although the accomplishment is impressive, this piece of AI-generated code probably has little ongoing value," because the theorem was not in doubt and the value of a formal library lies in others building on it. The same post lists Anthropic's Riemann zeta result among lab results "done well."

The companion document records that a Claude agent itself resisted an early claim of success, writing that the honest status was "proved on prove2me, pending the independent re-check" until the whole tree had been rebuilt as one project (Section 3, Day 11). It also states that the excerpts were "chosen mostly by Claude" and that Anthropic has "not independently verified the mathematical claims Claude makes in these excerpts" (Section 1).

The instructions given

The post quotes the only human instructions it reports, the two priority comments above. The steering of the run lay mostly in the Prove2Me platform: a graph of theorem statements, written by agents and checked by other agents, that defined what each agent should prove next. Neither the post nor the companion document compares different instructions or platform designs beyond the observation that runs without the platform failed.

Limitations and open questions

  • No new mathematics. Both the post and Buzzard say the work verifies a known proof; Buzzard adds that it follows the 1990s route, not the modern one.
  • Special cases only. The deep theorems are proved in the strength the argument needs, not in general (PROOF-PATH.md), so the library is not a general formalization of Mazur's, Ribet's or Wiles's results.
  • Not reusable as is. The companion document says the proof "is not yet in a form Mathlib would accept" (Section 2), and the post calls it much longer than necessary. The October guest post judges that it "probably has little ongoing value"; the post's quoted remark from Buzzard that such artefacts "are now robust enough to be built upon" is the opposing assessment. This note did not search for later work that builds on the repository.
  • Trust in the checkers and the statement. The guarantee depends on the Lean kernel (or nanoda) and on the one-line statement; the meaning of intermediate names is not checked.
  • Cost not reported in money. The post gives tokens (about six billion) but no compute cost; commenters on Buzzard's blog disputed estimates, and the post does not settle them.
  • One run. The post does not report how many attempts preceded this one beyond the failed pre-platform efforts, or whether the method has been repeated on another large theorem apart from the three-primes example.

Research questions

  1. How much of the speed comes from the platform rather than the model? The post says runs without Prove2Me failed. Running the same model with and without the shared statement graph, on a mid-sized target, would separate the two.
  2. How often were agent-written statements wrong? Agents wrote and checked one another's statements. Auditing a sample of intermediate statements against the cited literature would measure how often a correct proof of a misstated lemma had to be replaced.
  3. What literature errors did the formalization expose? Buzzard mentions errors highlighted on the Lean Zulip. A catalog of them would show what autoformalization adds to confidence in a proof already accepted by experts.
  4. Can the proof be shortened to Mathlib standards? The post and companion say it is far longer than needed. Measuring how much of it can be refactored, and at what human or model cost, would show whether such artifacts can be built upon, as Buzzard's quoted remark suggests.
  5. Does the method transfer to recent, less checked results? Buzzard's hope is to check recent work in the Langlands program. Applying the same pipeline to a recent paper and reporting what fails would test the post's claim that formalization can lighten refereeing.

How it connects

References