What is Lean, the software that can tell whether a mathematical proof is correct even if nobody understands it
Lean is a proof assistant that checks every step of an argument. How the software key to verifying the Riemann proof works.
In this article
Apps and services change often. The steps in this guide were reviewed on the date shown; if a menu doesn't match, check the official sources linked at the end. Information reviewed on .
If a proof runs to 17 million lines and no human can read it, how do we know it's right? That's the question raised by the AI-assisted proof of the Riemann hypothesis. And the answer, Xataka explains, has four letters: Lean.
The problem: proofs too big to review
It's not new. In 1998, Thomas Hales and Samuel Ferguson presented a proof of the Kepler conjecture (the densest way to stack spheres, like oranges at a fruit stall). After four years, a panel of 12 referees for Annals of Mathematics could only say it was "99% certain".
Hales then decided to check it by computer. His project, Flyspeck, began in 2003 and finished in 2014.
What Lean is
- It was released by Leonardo de Moura in 2015.
- It's both a proof assistant and a programming language.
- You write the proof step by step, and a small kernel checks that each step follows logically from the previous one. If something doesn't fit, it won't "compile".
- Proven mathematics is stored in Mathlib, a large shared library that grows with contributions from mathematicians worldwide.
Some milestones:
- Kevin Buzzard of Imperial College London launched the Xena project to bring Lean to mathematicians.
- In 2020, Fields medallist Peter Scholze challenged the community to verify one of his theorems with Dustin Clausen in Lean.
How the Riemann proof was checked
According to Xataka, to accept the proof the answer was "yes" to Buzzard's four questions:
- Is the statement the right one?
- Does the code compile?
- Does it prove exactly that statement?
- Is there any trick or exploit of the software itself?
On top of that, a reconstruction at MIT matched byte for byte, and another independent checker, nanoda, accepted it in 28 minutes using 80 threads. MIT's Andrew Sutherland told Scientific American the chance of something odd is "approximately zero". Terence Tao, one of the world's most respected mathematicians, warned that digesting the result "will take some time".
Why it matters beyond maths
The same technique, formal verification, can prove that software does what it should. It's what DeepMind used to check Signal's and WhatsApp's encryption. With AI writing more and more code, tools like Lean could be key to trusting what it produces.
Sources and documentation
- lean
- mathematics
- artificial intelligence
- programming
- news