AI agents have completed a formal proof of Fermat’s last theorem in 11 days, confirming the validity of the original 1995 proof using computer code.

Key facts
- •Fermat’s last theorem states that no whole numbers a, b, and c satisfy the equation aⁿ + bⁿ = cⁿ for any whole number n greater than 2.
- •Andrew Wiles first proved the theorem in 1995 after seven years of secret work and a subsequent year spent fixing a flaw in his initial proof.
- •Anthropic’s proof consists of 13 million lines of Lean code and 29,500 intermediate theorems.
- •The AI agents utilized a collaboration tool called Prove2Me to track their progress and coordinate tasks effectively.
- •The completed work is more than five times larger than the existing Mathlib repository of formal mathematics.
The AI company Anthropic has successfully created a formal proof of Fermat’s last theorem, a mathematical puzzle that remained unsolved for centuries until Andrew Wiles proved it in 1995. Utilizing a group of AI agents working autonomously, the task was completed in just 11 days. The project confirms the correctness of the human-found proof by translating it into computer code, ensuring it is free from logical errors.
By the numbers
The Process of Formalization
Formalizing a mathematical theorem involves converting logical arguments from pen-and-paper notes into computer code. This process allows machines to methodically verify every step of a proof, exposing potential flaws that might otherwise go unnoticed. Anthropic’s effort utilized its Claude model, with numerous separate AI agents assigned to tackle smaller segments of the theorem simultaneously. While the agents worked autonomously, human experts provided high-level instructions to maintain progress. The team encountered challenges when agents occasionally lost track of the project's state, but performance improved after implementing Prove2Me, a tool originally designed to assist human mathematicians in collaborative work.
Scale and Significance
The resulting proof is the largest ever written in the Lean programming language, spanning 13 million lines of code and covering approximately 29,500 intermediate theorems. This output is more than five times the size of the entire Mathlib repository, which previously held 2 million lines of formal mathematics. Kevin Buzzard of Imperial College London, who had been leading a five-year project to formalize Wiles and Taylor’s original 100-page proof, noted that the AI's success leaves no assumptions beyond the basic axioms of mathematics. He stated that the project demonstrates that AI autoformalization is now robust enough to serve as a foundation for further research, marking a significant step toward the automatic formalization of modern mathematical literature.
Advertisement
This article was independently rewritten by ManyPress editorial AI from reporting originally published by New Scientist.

