
Levent Alpöge says he has proved the Riemann Hypothesis with help from AI. That claim is either the mathematical event of the century or another long proof that falls apart under scrutiny. Either way, you no longer have to wait years for referees to decide. Lean 4 formal verification, backed by the open-source Mathlib library, lets anyone with a laptop check whether a proof actually compiles against a precise statement. This guide covers what changed, why it matters, and how to check AI-generated proofs yourself, including what to look for before you trust a green checkmark.
What’s actually new: Lean 4 formal verification meets a headline claim
The news is the claim itself. Alpöge, a number theorist with a serious track record, has said publicly that AI tools played a real part in his proof of the Riemann Hypothesis. RH is the most famous open problem in mathematics. It is also the problem amateurs most often claim to have “solved”, so the community’s skepticism is automatic and earned. The setting is what’s different this time. In 2026, AI systems routinely produce long, plausible-looking arguments, and any big AI-assisted claim now meets one standard question: does it formalize?
That question has a concrete answer because the infrastructure is mature. Lean 4 is a proof assistant and programming language with a small, trusted kernel that checks every logical step. Mathlib is its community library of formalized mathematics, with well over 200,000 theorems covering analysis, algebra, number theory, and complex analysis. Mathlib already contains a formal definition called RiemannHypothesis in its zeta-function files. The target statement is fixed in public, so nobody can quietly move the goalposts.
As of this writing, the claim is public but the proof is not formally verified. Fully formalizing a deep analytic number theory argument could take months of expert work, even with AI autoformalization tools speeding up the routine parts. What you can do today is learn how verification works. Then, when a Lean artifact appears for this claim or the next one, you can judge it yourself instead of trusting someone’s tweet.
Why it matters
- Trust moves from reputation to the kernel. A proof that compiles in Lean against Mathlib’s statement is correct relative to Lean’s small kernel and standard axioms. You don’t need to be a world expert in L-functions to check that.
- AI output becomes auditable. Large language models hallucinate lemmas with total confidence. A formal checker ignores confidence and rejects every gap.
- The real attack surface is the statement. Once the proof checks, the remaining question is whether the formal statement means what the headline says. That is a much smaller, human-readable thing to review.
- AI theorem proving in 2026 is a real workflow. Models now draft Lean code, run tactics like
simpandlinarith, and repair their own errors. Knowing Lean is becoming a practical skill, the way knowing Git did for programmers. - Refereeing changes. Journals and reviewers can ask for a Lean artifact instead of spending years on line-by-line reading, and spend their human attention on the ideas.
- It’s free and open. Lean, Mathlib, and the tooling cost nothing. No vendor decides what counts as verified.
How to use it today: verify AI math proofs step by step
This workflow checks any AI-written Lean proof, from a homework lemma up to a Riemann Hypothesis proof. It assumes you’re comfortable with a terminal and have VS Code installed.
Step 1: Install Lean via elan
elan is Lean’s version manager, similar to rustup. On macOS or Linux:
curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | sh
source ~/.elan/env
lean --version
On Windows, install the official “Lean 4” extension in VS Code and follow its setup guide, which installs elan for you. Install the extension on any platform: it gives you the live goal view you’ll need.
Step 2: Create a Mathlib-backed project
Lake, Lean’s build tool, has a template that pins a compatible Mathlib version:
lake new proofcheck math
cd proofcheck
lake exe cache get
lake build
lake exe cache get downloads prebuilt Mathlib files. Skip it and you’ll spend an hour compiling Mathlib from source.
Step 3: Read the official statement before any proof
Open a file and inspect Mathlib’s definition:
import Mathlib
#check @RiemannHypothesis
#print RiemannHypothesis
You should see roughly: for every complex s with riemannZeta s = 0, where s is not a trivial zero (-2, -4, …) and s ≠ 1, we have s.re = 1/2. Read it slowly. This is the contract. Any claimed proof must produce a term of exactly this type.
Step 4: Pin the target theorem yourself
Never accept a theorem statement written by the same AI or person who wrote the proof. Write it yourself so it refers to the Mathlib definition directly:
import Mathlib
import Proofcheck.Claimed -- the submitted proof files
theorem my_target : RiemannHypothesis := by
exact Claimed.main_theorem
If Claimed.main_theorem has a subtly different type, such as a restricted strip or an extra hypothesis, this line fails to compile. That’s what you want.
Step 5: Audit the axioms
This is the most important step, and the one people skip. A proof can “compile” while relying on sorry or a sneaky custom axiom. Run:
#print axioms my_target
A clean result lists only propext, Classical.choice, and Quot.sound, Lean’s standard three. sorryAx means the proof has holes. Anything else, such as an axiom named zeta_bound, means someone assumed what they needed. Lean.ofReduceBool means the proof used native_decide, which trusts the compiler and not just the kernel. Hold a result this big to a stricter standard.
Step 6: Scan the source for red flags
A quick grep catches the usual tricks:
grep -rnE "sorry|axiom |admit|native_decide|implemented_by|@\[extern" Proofcheck/
Also look for files that redefine Mathlib names, use set_option to disable checks, or shadow RiemannHypothesis with a weaker local definition.
Step 7: Re-check with an independent kernel replay
For high-stakes claims, replay the compiled environment through a separate checker. The community tool lean4checker re-verifies declarations in an .olean environment:
git clone https://github.com/leanprover/lean4checker
cd lean4checker
lake build
# then, from your project:
lake env path/to/lean4checker/.lake/build/bin/lean4checker Proofcheck
AI proof competitions use tools that compare a trusted statement file against an untrusted proof file. They confirm the proof proves exactly your statement and nothing else, so they’re worth a look too.
Step 8: Use AI to help, not to judge
An LLM can explain what a Lean lemma means or draft a missing step. This prompt works well:
You are a Lean 4 + Mathlib expert. Here is a theorem statement and a failing proof.
Do not change the statement. Do not introduce sorry, axiom, or native_decide.
Explain the error at line N in plain English, then propose a fix using
existing Mathlib lemmas only. Name each lemma you use so I can #check it.
Then #check every lemma it names. Models invent Mathlib lemma names constantly. The compiler is the judge. The model is a junior assistant.
How Lean 4 compares to other proof assistants
Lean isn’t the only open-source proof assistant. Here’s how the main options compare for checking AI-generated mathematics:
| Tool | Math library | AI tooling in 2026 | Best for | Drawback |
|---|---|---|---|---|
| Lean 4 + Mathlib | Largest unified modern math library; includes zeta function and RH statement | Strongest: most AI provers and benchmarks target Lean | Research math, AI proof checking | Mathlib moves fast; version pinning matters |
| Rocq (formerly Coq) | Mathematical Components, many separate libraries | Solid, smaller ecosystem | Verified software, classic results like the Four Color Theorem | Fragmented libraries for mainstream math |
| Isabelle/HOL | Archive of Formal Proofs (very large) | Good automation via Sledgehammer | Highly automated proofs, CS theory | Simpler type theory makes some abstract math awkward |
| Metamath | set.mm, a huge set-theory database | Limited | Minimal trusted core, extreme auditability | Very low-level and verbose |
Our take: if you’re checking AI math proofs in 2026, learn Lean. The library, the community, and nearly all the AI research are there.
What’s next
Watch for a Lean artifact. If Alpöge wants to win over the field fast, the obvious path is a formalization effort, probably a collaborative project with a public blueprint. Terence Tao and others have shown how this works: split a big proof into a dependency graph of lemmas, then let humans and AI fill them in parallel. If a repository like that appears, track its sorry count. That’s the progress bar.
Watch Mathlib’s analytic number theory coverage too. A proof of RH would draw on deep results about the zeta function, zero-free regions, and possibly tools nobody has formalized yet. Every missing piece must be built first, so the timeline depends heavily on what the proof uses. A short, clever argument built on existing Mathlib would check quickly. One that relies on heavy unformalized machinery could take a year or more, and the delay wouldn’t mean it’s wrong.
Expect formal verification to become the default bar for AI-assisted math. The pattern is already set: an AI-assisted claim lands, the first reply is “where’s the Lean?”, and credibility follows the compiler. People who can read a statement file and run #print axioms will know what’s real before the press does.
Frequently Asked Questions
Has the Riemann Hypothesis proof been verified in Lean?
As of this writing, we know of no completed, publicly checked Lean formalization of the claimed proof. The claim is public, but formal verification is a separate step. Treat any “verified” headline with skepticism until you can see the repository, the statement file, and a clean #print axioms output.
Do I need to be a mathematician to use Lean 4 formal verification?
To write deep proofs, yes, and a strong one. To check a proof, much less so. An intermediate technical user can learn Steps 3 through 6 above (reading the statement, pinning the target, auditing axioms, scanning for red flags) in an afternoon.
What is the Mathlib library?
Mathlib is the community-maintained, open-source library of formalized mathematics for Lean 4. It covers undergraduate and much graduate-level math, maintainers review every contribution, and most AI theorem-proving systems build on it.
Can an AI fake a Lean proof?
It can’t fake the kernel check. It can cheat in ways a careless reviewer misses: using sorry, adding axioms, or proving a weaker statement that sounds the same. That’s why you write the target statement yourself and always audit the axioms.
Is Lean free to use?
Yes. Lean 4, Mathlib, Lake, elan, and the VS Code extension are all free and open source. A normal laptop can run full verification, though large Mathlib-based projects benefit from 16 GB of RAM.
What’s the fastest way to start learning?
Play the free “Natural Number Game” in your browser, then work through “Mathematics in Lean,” the official Mathlib tutorial. After that, practice by asking an AI to prove small lemmas and verifying its output with the workflow above.
Go deeper than this article
This article covers the essentials. Our premium eguide library gives you the full step-by-step playbooks — prompts, workflows, and copy-paste recipes you can put to work today.