What is Lean? The free proof checker behind the Riemann proof
Lean is a free, open-source language where a computer checks every step of a math proof. It just verified the Claude-made Riemann hypothesis proof.
Checked and updated 21 November 2026 at 21:30 UTC

Key points
- Lean is a free, open-source programming language and proof assistant: you write a proof as code, and the computer checks every step down to basic logic.
- Mathlib is Lean's shared, community-built math library. Its expert-vetted definitions are why the Riemann hypothesis proof could be checked against a statement nobody involved wrote.
- On November 21, 2026 the Lean and Mathlib communities certified Levent Alpöge's Claude-made Riemann hypothesis proof, about 17 million lines of Lean.
Lean is a free, open-source programming language and "proof assistant": you write a math proof as code, and the computer checks that every step follows from the last, all the way down to basic logic. It is in the news because on November 21, 2026 the Lean and Mathlib communities used it to certify a proof of the Riemann hypothesis made with Claude, posted by Anthropic mathematician Levent Alpöge as about 17 million lines of Lean.
Here is what Lean is, why it matters for AI, what it can and can't guarantee, and how to try it yourself.
Lean in plain English
Normally a proof is a written argument that other mathematicians read and judge. For a long, tricky proof that can take years, and mistakes still slip through.
Lean changes the checker. You give it:
- Definitions: what a prime number, a function or a zero of a function is.
- A statement: the theorem you claim is true.
- A proof: the steps, written as code.
Lean then checks the proof. If any step doesn't follow, it refuses to accept it. The Lean community describes the result this way: in a formalization, every definition is spelled out exactly and proofs are "virtually guaranteed" to be correct.
The language was created mainly by Leonardo de Moura. Today the Lean FRO, a nonprofit research organization, develops it, and its goals include supporting AI research and verified code.
What Mathlib is
Mathlib is Lean's huge shared math library, built by a community of volunteers with new contributions every day. It holds carefully reviewed definitions and theorems, from basic algebra to number theory.
That matters a lot for AI proofs. The Riemann hypothesis proof was checked against Mathlib's own definition of the Riemann hypothesis, which Lean and number theory experts had vetted long before. So Claude and Alpöge couldn't quietly prove an easier, slightly different statement.
Why AI companies care about Lean
AI models can now produce very long mathematical arguments, far longer than anyone can read quickly. Alpöge's Riemann proof is about 17 million lines of Lean code, per the Lean community's statement. Lean solves the trust problem: a computer does the line-by-line checking, and humans focus on a much smaller question, "is the theorem stated correctly?"
It isn't only Anthropic. The Xena Project blog notes that a batch of 722 math papers released by OpenAI in October came with Lean code for about 45% of them.
What Lean can't guarantee
The Xena Project, a Lean blog for mathematicians, published a simple test on November 12, 2026 for judging claims like "this was checked in Lean", especially when an AI wrote the code:
| Question | What can go wrong |
|---|---|
| Does the Lean statement match the real theorem? | A tiny slip can turn it into a different, even trivially false, statement. Lean checks the proof, not your intentions. |
| Does the code actually compile? | Code that fails to build proves nothing. |
| Does the proof use only standard axioms? | Extra assumptions hidden in the code can "prove" anything. |
| Is the checker itself trustworthy? | Independent checkers reduce the risk of a bug in Lean being exploited. |
For the Riemann proof, the Lean community said all four were satisfied. MIT mathematician Andrew Sutherland reported that all 175,187 modules compile, the main theorems use only Lean's three standard axioms, and independent checkers (nanoda, written in Rust, and con-leche) accept the full proof.
What Lean does not give you is understanding. A verified proof tells you a result is true; mathematicians still have to work out why, and write it up for people.
How to try Lean (free)
You don't need to be a mathematician to poke at it:
- In your browser: the Lean community offers an online version, linked from its homepage. Nothing to install.
- On your computer: install VS Code, add the official Lean 4 extension from the marketplace, then follow its setup guide (in VS Code, click the ∀ symbol at the top right, then Documentation > Docs: Show Setup Guide).
- To learn: the community points beginners to games, tutorials and the free book Theorem Proving in Lean 4.
Lean runs on Linux, Windows and macOS.
What it means for you
- For everyday AI users, nothing changes today. You won't see Lean inside ChatGPT, Gemini or Claude apps.
- It's a sign of where AI is heading: pairing a model that generates ideas with a strict checker that catches mistakes. We saw the same pattern this week with Claude's black hole physics results and the Frostbite CPU designed and verified by AI.
- Be skeptical of "AI proved X" headlines that don't mention verification. Ask whether the result was checked, and by whom.
AI Tools This Week is not affiliated with the Lean FRO, Mathlib or Anthropic.
Frequently asked questions
Is Lean free?
Yes. The Lean community describes Lean as free, open-source software that runs on Linux, Windows and macOS. You can also try it in your web browser without installing anything.
Can a Lean proof be wrong?
The checking is extremely reliable, but a proof can still prove the wrong thing. If the theorem is stated incorrectly, or extra assumptions are slipped in, the code can compile and still not prove what people think. That is why experts check the statement, the axioms and the build before trusting AI-written Lean code.
Why does AI use Lean for math?
Because a long AI-written argument is hard for people to read, but Lean can check it mechanically. If an AI's proof compiles against a trusted statement, humans don't have to verify every line themselves.
Sources
- Lean Programming Language (official site)
- Install Lean (official instructions)
- Lean Focused Research Organization
- Lean and its Mathematical Library (Lean community)
- Lean verification of the Riemann Hypothesis (Lean community blog, Nov 21, 2026)
- RH Lean proof: verification files (Andrew Sutherland, MIT)
- ...and the proof is checked in Lean (Xena Project, Nov 12, 2026)
Related
Claude for Teachers: free until July 30, 2028 (how to sign up)
Anthropic extended free Claude for Teachers for verified US K-12 educators, schools and districts through July 30, 2028. What's included and how to join.
How to prompt Claude Opus 5.5: what to change (Nov 2026)
Anthropic's Opus 5.5 prompting guide in plain English: why old habits waste tokens, the new medium effort default, and the prompts to drop or add.
How to make GIFs in Gemini (November 2026): steps and limits
Gemini now makes ~3-second looping GIFs from a prompt, photo or video with Omni 1.2 Flash. Steps, the 8 countries, and whether you need a paid plan.