← Retour au blog
tech 5 September 2026

Fermat's Last Theorem Proven with Lean 4

Fermat's Last Theorem, a centuries-old mathematical puzzle, has found its formal solution with Lean 4. Let's dive into this technological and mathematical feat.

Article inspired by the original source
Fermat's Last Theorem in Lean 4 ↗ github.com

Introduction

Fermat's Last Theorem, first stated in the 17th century by Pierre de Fermat, puzzled mathematicians for centuries. Although proven by Andrew Wiles in 1994, machine formalization of this proof remained a monumental challenge. Today, thanks to Lean 4, a formal proof tool developed by Microsoft Research, we have a complete machine-checked validation of the theorem. Here's how this feat was achieved.

Lean 4: A Powerful Formalization Tool

Lean 4 is an interactive proof assistant, software that helps verify the validity of mathematical proofs. It uses formal logic to ensure that each step of a proof is correct, thus eliminating potential human errors. Using Lean 4, mathematicians and computer scientists can collaborate to formalize complex proofs.

Why Lean 4?

Lean 4 offers several advantages:

  • Reliability: Each step of the proof is machine-verified, ensuring absolute precision.
  • Collaborative: The Lean community is active and growing, providing invaluable support and resources.
  • Extensible: Lean 4 can adapt to new domains in mathematics and computer science.

The Challenge of Formalization

Formalizing Fermat's theorem in Lean 4 was no small feat. Wiles' proof, though elegant, is complex and requires a deep understanding of advanced mathematical concepts.

Key Steps in the Formalization

  1. Understanding the Context: Before transcribing the proof into Lean 4, it was crucial to thoroughly understand Wiles' work and the mathematical concepts involved.
  2. Translation into Lean: The proof had to be translated into a formal language that Lean 4 could understand. This involved detailing each step exhaustively.
  3. Verification: Once the proof was entered, Lean 4 verified each step to ensure conformity with logical rules.

The Impact of This Achievement

The formalization of Fermat's proof in Lean 4 has major implications:

  • Proof Validation: It confirms the validity of Wiles' proof with machine certainty.
  • Education and Research: Lean 4 is a powerful tool for teaching mathematics and for advanced research.
  • Future Innovations: This project paves the way for formalizing other complex theorems.

Conclusion

Demonstrating Fermat's theorem with Lean 4 is a perfect illustration of how computing and mathematics can combine to solve age-old problems. It is a giant step towards a more rigorous and formal understanding of mathematics. If you are interested in theorem formalization or applying Lean 4 to your project, let's discuss your project in 15 minutes.

Lean 4 Fermat's Last Theorem Formalization Proof Assistant Mathematics
Deepthix newsletter · 100% AI · every Monday 8am

An AI agent reads tech for you.

Our AI agent scans ~200 sources per week and ships the best articles to your inbox Monday 8am. Free. One click to unsubscribe.

Visit the newsletter page →

Want to automate your operations?

Let's talk about your project in 15 minutes.

Book a call