# 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.

URL: https://aitoolsthisweek.com/what-is-lean-proof-checker
Published: 2026-11-21T21:20:06.681Z
Updated: 2026-11-21T21:20:06.681Z

**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](/anthropic-riemann-hypothesis-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:

1. **Definitions**: what a prime number, a function or a zero of a function is.
2. **A statement**: the theorem you claim is true.
3. **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:

1. **In your browser:** the Lean community offers an online version, linked from its homepage. Nothing to install.
2. **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).
3. **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](/claude-black-hole-physics) and the [Frostbite CPU designed and verified by AI](/ai-designed-cpu-frostbite).
- **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)](https://lean-lang.org/)
- [Install Lean (official instructions)](https://lean-lang.org/install/)
- [Lean Focused Research Organization](https://lean-lang.org/fro/)
- [Lean and its Mathematical Library (Lean community)](https://leanprover-community.github.io/)
- [Lean verification of the Riemann Hypothesis (Lean community blog, Nov 21, 2026)](https://leanprover-community.github.io/blog/posts/riemann-hypothesis/)
- [RH Lean proof: verification files (Andrew Sutherland, MIT)](https://math.mit.edu/~drew/grh/)
- [...and the proof is checked in Lean (Xena Project, Nov 12, 2026)](https://xenaproject.wordpress.com/2026/11/12/and-the-proof-is-checked-in-lean/)
