Anthropic Publishes Machine-Checked Proof of Fermat's Last Theorem in Lean 4
2 min read
Anthropic has made available a complete, machine-verified proof of Fermat's Last Theorem implemented in the Lean 4 proof assistant. The formalization builds on Mathlib and uses Lean version 4.33.1 alongside Mathlib v4.33.0. The proof follows the well-established argument developed by Frey, Serre, Ribet, Wiles, and Taylor-Wiles.
This project includes a detailed breakdown of the proof steps, with each theorem named and linked to its Lean formalization. The entire proof is accessible offline through a set of static web pages included in the repository, allowing users to browse the 29,511 theorems and 1,450 definition modules interactively.
The formalization is notable for its strict adherence to Lean's core axioms, relying only on three standard axioms without introducing additional assumptions or unverified shortcuts. The build process compiles all 60,475 modules from source, ensuring every declaration is checked by the Lean kernel.
Verification extends beyond Lean's kernel: the proof was also validated using an independent Lean kernel implementation called nanoda, written in Rust. Nanoda confirmed the correctness of over one million declarations without errors, providing an additional layer of trust.
The repository includes scripts to reproduce the build and verification steps, although the process is resource-intensive, requiring substantial memory (up to 300 GB) and time (several hours on high-performance hardware). The proof sources were generated with the assistance of AI agents, but all results are checked rigorously by Lean.
This work represents a significant milestone in formalized mathematics, demonstrating the feasibility of verifying complex, historically important theorems with modern proof assistants. While the project is not actively maintained or open to contributions, it serves as a valuable research artifact and reference for the formal methods community.
The code and documentation are released under the Apache License 2.0, with appropriate attribution to prior projects and contributors. The repository also bundles tools for rendering mathematical expressions and dependency graphs, enhancing accessibility for users exploring the formal proof.