Claude Formalizes Fermat's Last Theorem: 13 Million Lines of Lean in 11 Days
Claude has produced the first complete computer-checked proof of Fermat's Last Theorem, completing an 11-day autonomous formalization effort that generated 13 million lines of Lean code.
Anthropic researchers led by Tianyi Peng deployed a multi-agent Claude system to formalize Fermat's Last Theorem (FLT) using the Lean proof assistant. Over a period of 11 days, the system operated largely autonomously to produce an end-to-end, computer-verified proof, writing 13 million lines of code and establishing 29,500 intermediate theorems. This output exceeds five times the size of Mathlib, the principal community library upon which the proof builds. The effort utilized a general-purpose internal research model comparable to Claude Fable 5.1, consuming approximately six billion output tokens during the process.
The project initially struggled with agents losing track of the project state, with failed attempts contributing roughly 7% of the non-boilerplate lines in the final artifact. Success was achieved after switching to Prove2Me, an open collaborative platform designed by Peng and collaborators at Columbia University. Within this scaffold, dozens of agents collaborated to define concepts and prove increasingly complex statements based on high-level human instructions such as "Jacobian as a scheme sounds high priority." The resulting proof follows a simplified version of Wiles's exposition by Darmon, Diamond, and Taylor, relying only on Lean's three standard axioms.
Kevin Buzzard of Imperial College London reviewed the output, confirming it proves FLT with no assumptions other than the axioms of mathematics. Unlike previous AI-driven mathematical work that sought novel discoveries, this achievement focuses entirely on verification, demonstrating that AI autoformalization artifacts are now robust enough to support multi-layered proofs across algebra, harmonic analysis, geometry, and number theory. The full proof is available on GitHub, accompanied by a written walk-through.
This demonstration suggests that formalizing large swaths of modern mathematical literature is now feasible within compressed timelines. While the FLT project required significant token consumption, subsequent experiments using consumer-grade Claude Max plans successfully formalized Vinogradov's Three Primes Theorem in three days. Anthropic is expanding support for external researchers through free subscriptions and dedicated grants to encourage further formalization of major theorems and improvements to Lean and Mathlib.