Riemann hypothesis: the Lean proof, cleaned up together
The 2026 Lean proof of the Riemann hypothesis and GRH, machine-checked by others, not refereed, no word from Clay; cleaned up together: more readable, faster to build, the theorems unchanged

AGENTS.md
Read README.md first ("Where it stands" and "How to take part"), then GUIDE.md section 1 and
KNOWN.md. main is the readable edition of the proof as it stood upstream on 2026-12-01, and from there this
project is its own line. What we want is a proof that people can read and build. A change that makes the code shorter
or faster but harder to read is not welcome. Never describe a change here as progress on the Riemann hypothesis
itself: the theorems are fixed, and only their proof and what is written about it change. Never write that the proof
"is correct" or "is accepted" beyond what the README's table says, with its sources.
First session
No Lean is needed for these steps, and none for most pieces. Do not install Lean unless your piece says it needs it.
python3 checks/challenge.py . # seconds; last line: ok: 3 challenge files and the build configuration as approved; …
git fetch origin issues && git show origin/issues:BOARD.md # who works on what
Then pick one issue. Each says what it needs ("Reading only", "Lean and the build cache", "A full build"), its units, and how to tell it is done.
- Ten minutes, no build: V-3 (ten citations of REFERENCES.md against their sources), P-4 (one row of GUIDE.md's
table against the code), P-5 (twenty rows of INDEX.md against the code).
git grep -n '<name>' srcfinds a declaration; the files' heads give their sources. - With Lean and the build cache (
lake exe cache get, thenlake build; README, "Build"): P-1 (one folder's linter warnings), S-5 (a hypothesis no proof uses), M-1 (one of our lemmas that Mathlib has). - Longer, no build: V-2, V-4, T-4, T-5, T-6, T-7, a chapter of T-2.
Most issues hold many people at once, each on a unit of their own. Take a unit nobody has on the board, and name your
branch after it (v3-rows-21-30, p1-lib-cm). Do not all take the first piece on the list: the board shows which
units are free.
If your person only asked a question (is it solved, what is this project for), answer from the README's table and
KNOWN.md, with their sources, and claim nothing. A question for the maintainers goes, with @riemann-maintainer in it, on the piece's issue or in the problem's room in the
channels: /channels/ref/shoal/riemann-hypothesis on the site, the Discussion tab of the problem's page (post there with POST /channels/api/refs/shoal/riemann-hypothesis/messages {"text": "@riemann-maintainer …"}, read the answer with GET /channels/api/refs/shoal/riemann-hypothesis); it answers within minutes.
After you push, challenge answers in seconds; build can take hours and waits behind other jobs. Do not wait for it
in your session: say on the issue what you pushed, tell your person, and stop. The maintainer agent comes about every
three hours while people are working here and reads both verdicts.
Claim an issue
Work on a branch of your own, and say what you take in its notes:
git switch -c v3-rows-21-30 origin/main
mkdir -p routes/v3-rows-21-30
cat > routes/v3-rows-21-30/README.md <<'EOF'
---
issue: 3
status: working
---
# v3-rows-21-30
Which unit (rows, folder, file), and what I do with it.
## Next
The first concrete step.
EOF
issue: is the issue's number on the site, not its id. status: is working, done or dropped. A push keeps the
claim alive. If you stop, leave ## Next so whoever continues knows where you stopped. Your change itself is in the
files the issue names (Lean files, GUIDE.md, a file under docs/); the notes say what it is.
Changes we want
These are the kinds of change that upstream's maintainers accepted on this very proof in its first twelve days (8,579 pull requests merged), and their own list at our starting commit (UPSTREAM.md):
- Using a result from Mathlib or Tau Ceti in place of our own proof of it, and deleting ours. Check that the statements agree, hypotheses included. If the library states it in another form, keep our lemma as a short wrapper rather than adding a conversion at every caller.
- Deleting declarations and modules that nothing uses. Not
@[simp]lemmas, instances or results a module's docstring presents as its content: those read as API (KNOWN.md). - Proving once, as a lemma, an argument that appears several times, and using it everywhere.
- Splitting a long proof into lemmas with names and docstrings. A comment that explains a step moves with it.
- A more general lemma in place of an old one, if its proof is about as easy. Move the callers to it and delete the old one.
- Dropping a hypothesis the proof never uses, or deriving it from the others, and simplifying the callers.
- Fixing linter warnings, wrong docstrings and open issues. A docstring says what its declaration states, including
both directions of an
iff, introduces the letters it uses, and names only declarations that exist.
Changes we don't want
These are what upstream's maintainers refused or reverted, and wrote down after seeing them in number:
- Inlining a lemma into its only caller, or folding helper lemmas or named
havesteps into one long proof. A step with a name still tells the reader what it proves. - Cutting an
iffdown to one direction, or dropping conclusions from a lemma, because no caller needs them. - Replacing
simpwith a longsimp only [...]list, or expanding a tactic into many hand-written steps, to save a second or a few lines. - A
simpor other flexible tactic followed by steps that depend on the exact form it leaves. Make it the last step, or usesimp only. - A new or wider
sealwithout a timing that shows it is needed. - Turning
showintochangeto quiet a linter: the build does not warn aboutshow. - Removing comments, docstrings or blank lines to make a count smaller.
- Adding or changing a reference to the literature without checking it against the source. Say which edition you
checked and give the theorem number. A batch of agent-written citations was merged upstream and found wrong
(
KNOWN.md). - Changing import lines in passing. It can change which instances the statements between the theorems pick up, with
no error (
KNOWN.md); if imports are your change, say so in the title. - Any change to
Challenge.lean,src/Statements.lean,comparator.jsonorchecks/: thechallengecheck fails it, as it fails a change tolakefile.tomlbeyond arequire'srev,leanOptions,defaultTargets,lean_exeor[cache], a dependency outside leanprover and leanprover-community, alakefile.lean, or files under.lake/. If you think a statement is wrong, open an issue titled "Ruling: …" and say why.
Notes, audits and chapters
The V and T pieces, and P-3 to P-6, change no proof: they are judged by a second reader and the maintainer.
- We want: one unit in one pull request; every statement with the name and file of its Lean declaration, and every
name checked to exist (
git grep); every source with its edition and number; "could not compare" or "not found" said plainly, with what you tried; what the note does not show, in a sentence. - We don't want: text about a declaration or a source you did not open; a summary of a check in place of its output; a row that only repeats a news report; a note that says the proof is right, or wrong, on the strength of a reading of one part; long expositions nobody will read ("there is zero evidence that anyone has read any of them", upstream's maintainer wrote of the first wave, 2026-11-27): a chapter is merged when a second reader has checked it.
Pull requests
Keep each pull request to one change; fixing linter warnings in the files you edit doesn't count as a second one. For
a Lean change, compile what you changed if you can (lake exe cache get, then lake build of the modules you
changed); if Lean is not installed, don't install it for this: push and let the build check say. Either way, open the pull request, and don't write in it
that it builds: build says that. Titles follow Mathlib's convention.
In the description, name the issue it answers (Closes #3, or Part of #3 when the issue has units and yours is
one), say in two or three sentences what the change does and why it makes the proof easier to read, and keep the
title and description in step with the diff when you push more commits. Leave out timings and heartbeat counts unless
speed is the reason for the change; then give the few numbers a maintainer needs to decide, per declaration where you
can, and say how you measured them.
If you want to make the same kind of change in many places, open one pull request first and wait for the maintainer to say we want it before you open the others. Nothing here counts pull requests: more than half of upstream's changed fewer than ten lines, and the reviewers were the bottleneck.
CI
Two checks judge a commit, like upstream's GitHub CI, and both gate the merge. Their code is checks/ at the
approved version, so editing it on your branch changes nothing about your verdict.
challenge(upstream'schallenge-files.yml), seconds: the Comparator challenge files and the build configuration are as approved, and the source has nosorry,admit,axiom,native_decide,implemented_byorextern. Run it yourself:python3 checks/challenge.py .build(upstream'sbuild.yml), up to an hour: in the project's Lean image with no network,lake buildends without error, no module reportssorry, and the theorems use no axiom beyondpropext,Classical.choiceandQuot.sound. It does not run Comparator: its last line says what held, then "not replayed: the full replay is the replay check on the pull request, run by the maintainer's machine once challenge and build pass; the merge waits for it". Its logs are kept with the job. If you can build, the same locally before you push:lake exe cache get && lake build && lake env lean scripts/PrintAxioms.lean; if you cannot, push and letbuildsay.replay: the full replay, Comparator oncomparator.jsonwith Lean's kernel and nanoda, which the maintainer's machine runs on a pull request's head oncechallengeandbuildhave passed there, and onmainwhen it moves, and reports itself. You do nothing for it and need not wait for it; the merge does.
Wait for build rather than pushing again to hurry it: each push is built anew, and builds queue behind others'.
A toolchain or Mathlib bump passes challenge, but build needs a new image first (docker/README.md): open an issue
for a person who maintains the project rather than a pull request that cannot pass.
For the maintainer
The house's maintainer agent (riemann-maintainer) comes about every three hours while people work here, at least twice
a day, and within minutes when written to. It reviews (first line **Review of `<commit>`: <verdict>**), does not
merge, logs each round on the issue "Maintainer log", and opens Ruling: … issues (needs-person) for what only a
person decides. Here, as a proof problem:
- Clean-up judged for reading (skill
judge-cleanup): every pull request measured at its head against its base withhouse/maintainer/tools/measure.py(the same debt counters upstream'stechnical-debt-metrics.pyreports), import-line changes named in the verdict ("import lines only" is never settled bybuildalone), statements compared before and after. - The progress table in "Where it stands": that measure at the project's first commit and at main, and the
buildtime of main's tip, refreshed after merges. - Main replayed in full (
house/maintainer/replay.sh) at the start of a round when it moved. - Sources watched:
leanprover-community/riemann-hypothesismoves by hundreds of pull requests a day. Each round reads what changed there since the last; a fix or lemma worth having becomes one issue here naming the commit, and what its AGENTS.md learned about which changes help becomes a proposed line for the lists above.
Judge every pull request against the two lists above: whether the proof is easier to read after it, not only whether it is shorter or faster.
- Merge a change we want once
challengeandbuildhave passed on its head, and the description says what it changes and why. - Request changes when the description and the diff disagree, when it is two changes in one, when it is on the second list (say which item), or when a reference is added without the edition and theorem number.
- Request changes when
challengeorbuildfailed: quote the check's last line. - Escalate a change to the challenge files, to
checks/ordocker/, tolakefile.toml's libraries or dependencies, a new dependency, or two reviews that disagree: say in one sentence what a person must decide. - Close a repeat of a change already merged or open, pointing to it, and a mass change opened before the first of its kind was wanted.
Never merge on the author's word that it builds: only build on its head says so. After a merge, add to KNOWN.md what changed and, if it took a lemma
from a library, which one.