Claude formalizes Fermat's Last Theorem in 11 days, completing the first complete machine-verified proof with 13 million lines of Lean code.



On September 4, 2026, AI development company Anthropic announced that its AI, 'Claude,' had completed a fully machine-verifiable proof of Fermat's Last Theorem. Claude worked almost autonomously for 11 days, generating approximately 13 million lines of code using the proof assistance system 'Lean 4.' Anthropic described this as the first complete machine-verified proof of Fermat's Last Theorem.

Formalizing Fermat's Last Theorem \ Anthropic

https://www.anthropic.com/research/formalizing-fermats-last-theorem




Fermat's Last Theorem states that 'for any integer n greater than 2, there are no positive integers a, b, and c that satisfy aⁿ + bⁿ = cⁿ.' It remained unsolved for over 350 years after being written down by the French mathematician Pierre de Fermat in the 17th century, until mathematician Andrew Wiles and others completed the proof and published it in 1995. Wiles' proof spans 129 pages, and verifying its correctness took several months.

In mathematical proofs, even a single breakdown in the logical flow can render the entire conclusion invalid. While obvious steps may be omitted in papers intended for human readers, when a proof is to be verified by a computer, even the smallest, seemingly 'obvious' steps must be described precisely. The process of rewriting known mathematical proofs into a format that proof-assistance systems can verify is called 'formalization.'

Kevin Buzzard, a mathematician at Imperial College London, has been leading a collaborative project since 2024 to formalize Fermat's Last Theorem using Lean, and the initial work plan alone has reached 86 pages. The formalization was expected to take several years.

Tianyi Peng, a researcher at Anthropic who studies the formalization of mathematics using AI, had Claude work on a task. In 11 days, Claude proved approximately 30,300 theorems in a machine-verifiable form, using about 29,500 of them in the final proof. The scale of approximately 13 million lines of code is more than five times that of the Lean mathematics library 'Mathlib'. Dozens of Claude agents shared the task of defining concepts and proving intermediate theorems, progressing sequentially to the proofs of more difficult propositions.



However, simply running multiple AIs didn't guarantee progress. In initial trials, problems arose where each agent lost track of the progress of the massive project, making it difficult to effectively utilize each other's results. For complex tasks spanning long periods, in addition to the AI's own capabilities, a system is needed to manage 'how far along the process is' and 'what needs to be proven next.'

The solution to the problem was Prove2Me, a collaborative platform for formalizing mathematical concepts developed by Penn and his colleagues. Prove2Me manages the dependencies between theorems using a structure called a directed acyclic graph (DAG), allowing multiple Claudes to see which theorem to work on next. It also speeds up compilation by separating the theorem content and proof into different files, and makes it easier to search and reuse completed proofs by adding natural language explanations to each theorem.



The completed proof has passed Lean checks and is publicly available on GitHub. The proof relies only on Lean's three standard axioms and does not include any temporary 'sorry' statements to pass unproven parts. Comparison tools have confirmed that the proof matches the description of Fermat's Last Theorem included in Mathlib. Furthermore, it has been reported that the independent Lean kernel 'nanoda,' implemented in Rust, was able to check over 1 million declarations without errors.

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


As AI becomes capable of generating vast quantities of mathematical proofs, the burden on humans to verify their correctness will also increase. Therefore, Anthropic predicts that in the future, it will become common practice to create formalized proofs that can be verified by computers, alongside papers intended for human readers.

in AI, Posted by log1d_ts