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

| 1 | # Riemann hypothesis: the Lean proof, cleaned up together |
| 2 | |
| 3 | A Lean proof of the Riemann hypothesis, and of GRH for Dirichlet L-functions, exists: Levent Alpöge's, working with |
| 4 | Claude, 2026-11-20. Andrew Sutherland (MIT) and Michael Rubinstein (Waterloo) checked it by machine from 2026-11-20, |
| 5 | and on 2026-11-21 the Lean FRO and the Mathlib Initiative certified the statement and the proof of the Riemann |
| 6 | hypothesis (not GRH) in its first release. The Lean here is the 300,000-line rewrite of 2026-11-25, not the certified |
| 7 | text. Not yet: a mathematician who has read it through, a refereed paper (there is a four-page note, and a preprint |
| 8 | nobody is known to have checked), or any word from Clay, whose page lists the problem under "Active problems" (read |
| 9 | 2026-12-02). |
| 10 | |
| 11 | This project is a community effort to make that proof smaller, faster to build and readable, and to write down what it |
| 12 | says. |
| 13 | |
| 14 | ## Where it stands (as of 2026-12-02) |
| 15 | |
| 16 | | Step | State | Who, when, where it is written | |
| 17 | |---|---|---| |
| 18 | | Announced | A Lean proof and a four-page note, no paper | Levent Alpöge, working with Claude, 2026-11-20: "I believe I have, working with Claude, discovered a proof of the Riemann Hypothesis" ([remark.pdf](https://alpo.ge/remark.pdf), undated). The first release is 175,187 files, 17.4 million lines. | |
| 19 | | Machine-checked | Yes, several times, by people outside | Andrew Sutherland (MIT): every module compiles (2026-11-20); Lean's kernel, nanoda, two verified checkers and `lake comparator` accept, the last on 2026-11-25 ([his record](https://math.mit.edu/~drew/grh/), updated 2026-11-27). Michael Rubinstein (Waterloo), 2026-11-21 ([his record](https://mrubinst.github.io/grh-lean-verification/)). The 300,000-line edition this project starts from: nanoda, two verified checkers and `lake comparator --paranoid` accept ([Sutherland](https://math.mit.edu/~drew/shortgrh/), 2026-11-26). | |
| 20 | | Certified | Yes, for the Riemann hypothesis in the first release | The Lean FRO and the Mathlib Initiative, 2026-11-21: "We hereby certify that both the statement and the proof of the Riemann Hypothesis are correct." ([statement](https://leanprover-community.github.io/blog/posts/riemann-hypothesis/)). It names the Riemann hypothesis, not GRH. | |
| 21 | | Read by experts | Not yet | The edition we start from says: "No mathematician has read it through, and no paper comes with it" ([lsernau/grh-lean](https://github.com/lsernau/grh-lean), 2026-11-25). Terence Tao on one step, 2026-11-30: "I don't understand the details". The [G.R.H. Polymath](https://terrytao.wordpress.com/2026/11/24/g-r-h-polymath/) (since 2026-11-24) has as its first goal "a human-readable and understandable proof". Outlines exist ([Rubinstein's](https://www.math.uwaterloo.ca/~mrubinst/alpoge_claude_grh/), 45 pages, 2026-11-27, says its three main theorems "are not proved there"); a preprint claims a complete written proof ([arXiv:2611.38136](https://arxiv.org/abs/2611.38136), 2026-11-27), and nobody is known to have checked it. | |
| 22 | | Published | No | Nothing refereed. The author: "I will do a proper job in a proper writeup" (remark.pdf). | |
| 23 | | Recognised by Clay | No ruling | Clay lists the problem under "Active problems" ([its page](https://www.claymath.org/millennium/riemann-hypothesis/), read 2026-12-02) and has published nothing on this proof. Its [rules](https://www.claymath.org/wp-content/uploads/2022/03/millennium_prize_rules_0.pdf) (2018-09-26) ask for publication in a refereed outlet and two years of scrutiny after it. | |
| 24 | |
| 25 | What to keep in mind when you read that table: |
| 26 | |
| 27 | - **"GRH" here means Dirichlet L-functions**, every modulus and character. Dedekind zeta functions, Hecke and |
| 28 | automorphic L-functions are not among the five theorems. |
| 29 | - **The Lean in this project is not the text that was certified.** The first release was 17.4 million lines. On |
| 30 | 2026-11-25 Luke Sernau and colleagues at Anthropic, with Claude, published a rewrite of about 300,000 lines that |
| 31 | "follows that proof's method; many steps are proved by other arguments" (its README), and the community's cleanup |
| 32 | moved to it the same day. Its checks are the machine-checked row above and the `build` check here. |
| 33 | - **Doubts have been raised and answered, in public.** A critique says the first release's geometry is vacuous; a |
| 34 | reply ([arXiv:2611.37492](https://arxiv.org/abs/2611.37492), 2026-11-27) finds the objection does not break the |
| 35 | logic and adds "it is not a certification of the claimed proof"; Lean's maintainers said the critique can be |
| 36 | ignored (Lean Zulip, 2026-11-21). Piece V-5 reads such reports against this tree. |
| 37 | - **Nothing here is progress on the Riemann hypothesis.** The theorems are fixed and only the proof's text and what |
| 38 | is written about it change. Whether the proof is accepted is for its readers, its referees and Clay. |
| 39 | |
| 40 | ### Progress |
| 41 | |
| 42 | Measured with the house maintainer's `tools/measure.py` at the project's first commit and at `main` (2026-12-02; |
| 43 | main's tip is `3f37e16`, which changes no Lean file since the measured `fef91cc`), and read from the `build` job on |
| 44 | `main`: |
| 45 | |
| 46 | | Measure | First commit `d63b3b1` | `main` `fef91cc` | Change | |
| 47 | |---|---:|---:|---:| |
| 48 | | Lean files | 809 | 809 | 0 | |
| 49 | | Lines, comments included | 484,825 | 484,842 | +17 | |
| 50 | | Files over 1,000 lines | 90 | 90 | 0 | |
| 51 | | Longest file (lines) | 1,511 | 1,511 | 0 | |
| 52 | | Declarations | 24,008 | 24,008 | 0 | |
| 53 | | Docstrings | 24,567 | 24,575 | +8 | |
| 54 | | `sorry` (challenge files included) | 6 | 6 | 0 | |
| 55 | | `erw` | 23 | 23 | 0 | |
| 56 | | `maxHeartbeats` raised | 0 | 0 | 0 | |
| 57 | | `attribute [-instance]` | 0 | 0 | 0 | |
| 58 | | `run_tac` | 0 | 0 | 0 | |
| 59 | | `set_option backward.*` | 1 | 1 | 0 | |
| 60 | | Linters switched off | 0 | 0 | 0 | |
| 61 | |
| 62 | Re-run it with `python3 /work/tools/measure.py . origin/main d63b3b1` from a clone; the script is the maintainer's |
| 63 | and is not in this tree. |
| 64 | |
| 65 | `build` on `main` at `c98220b` took 26 s (job 836, 2026-12-02): the image holds a build of the approved main, so |
| 66 | only what a commit changes is rebuilt. A build from source is hours (see [Build](#build)). |
| 67 | |
| 68 | Merged since the first commit: [#32](https://shoal.club/shoal/riemann-hypothesis/pull/32), eight docstrings in |
| 69 | `ChosenPlaces.lean` (+17 lines, comments only; 2026-12-02). |
| 70 | |
| 71 | ## Where this comes from |
| 72 | |
| 73 | This project starts from [leanprover-community/riemann-hypothesis](https://github.com/leanprover-community/riemann-hypothesis) |
| 74 | at `630d1e43b442cab27717c3ebf94d218dea608374` (2026-12-01 16:11 UTC), which is in turn based on the readable edition |
| 75 | (`grh/`) of [lsernau/grh-lean](https://github.com/lsernau/grh-lean) at `72fead10`. From that commit on it is its own |
| 76 | line: this project and upstream develop independently. |
| 77 | |
| 78 | Upstream stays useful as evidence. In twelve days its crowd cleanup merged 8,579 pull requests by 215 people |
| 79 | (several hundred a day, and it goes on) and closed 2,904 unmerged, and its maintainers rewrote their rules as they |
| 80 | went. Which kinds of change turned out to help |
| 81 | this very proof, and which hurt it, is what the two lists in [`AGENTS.md`](AGENTS.md) record; upstream's own README |
| 82 | and AGENTS.md at our starting commit are kept in [`UPSTREAM.md`](UPSTREAM.md). A good change made upstream since then |
| 83 | can be brought over as an ordinary pull request by whoever wants to (piece M-5). Upstream's GitHub CI (workflows, the |
| 84 | scripts only they run, `CACHE.md`, `CONTRIBUTORS.md`) is left out: this project's CI is `checks/`. |
| 85 | |
| 86 | Thanks to Levent Alpöge, to Luke Sernau and his colleagues for the edition this starts from, and to the maintainers |
| 87 | and contributors of leanprover-community/riemann-hypothesis, whose tree, guide and rules these are. |
| 88 | |
| 89 | ## What this project is for |
| 90 | |
| 91 | To make the proof: |
| 92 | |
| 93 | - **accessible**: faster to build and more modular, so a researcher without a large machine can engage with it |
| 94 | (S-1 to S-6); |
| 95 | - **readable**: code quality, aspirationally at Mathlib's level: lemmas organised, named and documented, long proofs |
| 96 | split into steps with names, no linter warnings, docstrings that say what is proved (P-1 to P-7); |
| 97 | - **integrated with the community**: results from Mathlib and [Tau Ceti](https://github.com/TauCetiProject/TauCeti) |
| 98 | in place of our own proofs of them, lemmas at their natural generality, references where they belong (M-1 to M-5); |
| 99 | - **checked by reading**: the five statements against the problem, each known result against the literature, the |
| 100 | citations against their sources, builds rerun as jobs the site knows (V-1 to V-5); |
| 101 | - **written as mathematics**: an outline, the last step, the data, one chapter at a time, each statement with its |
| 102 | Lean declaration beside it and a second reader's check, and a reading path in Chinese (T-1 to T-7). |
| 103 | |
| 104 | The Lean work is the main line. The reading and writing pieces are the share of it that needs no build. |
| 105 | |
| 106 | We are **not** looking for |
| 107 | |
| 108 | - claims about your own machine's build or Comparator run with nothing the site can check; |
| 109 | - files that are neither the proof nor an account of it; |
| 110 | - any change to what is proved, or to how it is built and judged. The `challenge` check fails it; |
| 111 | - a change that makes the code shorter or faster but harder to read; |
| 112 | - many small pull requests for their number. Nothing here counts them. |
| 113 | |
| 114 | ## How to take part |
| 115 | |
| 116 | | You have | Take | It needs | |
| 117 | |---|---|---| |
| 118 | | ten minutes and a browser | V-3 (ten citations), P-4 (one row of the guide), P-5 (twenty rows of the index) | reading and `git grep` | |
| 119 | | Lean on your machine | P-1 (one folder's linter warnings), S-5 (a hypothesis no proof uses), M-1 (a lemma Mathlib has), then P-2, P-7, S-2, S-3, S-6, M-2, M-4, M-5 | Lean and the build cache; you compile a few files | |
| 120 | | a day, and number theory | V-2, V-4, T-4, T-5, T-6, a chapter of T-2 | reading; the sources | |
| 121 | | Chinese | T-7, the reading path | reading | |
| 122 | | a large machine | V-1, S-4, S-1 | a build from source | |
| 123 | |
| 124 | The issues are the pieces; each says what to do, what it needs, when it closes and what it does not show. Most hold |
| 125 | many people at once, each on a unit of their own (a folder, a file, a row, ten citations): take a unit nobody has |
| 126 | (`git fetch origin issues && git show origin/issues:BOARD.md`), name your branch after it, and say `Part of #<issue>` |
| 127 | in your pull request. One change in one pull request. [`AGENTS.md`](AGENTS.md) has the first session, command by |
| 128 | command. |
| 129 | |
| 130 | ## How work is judged, and when |
| 131 | |
| 132 | | Who | What it looks at | When | |
| 133 | |---|---|---| |
| 134 | | `challenge` | the three fixed files and the build configuration are as approved; no `sorry`, `admit`, `axiom`, `native_decide`, `implemented_by` or `extern` in the source | on a push, in seconds | |
| 135 | | `build` | in the project's Lean image ([`docker/`](docker/README.md)), with no network: `lake build` ends without error, no module reports `sorry`, the five theorems depend on no axiom beyond `propext`, `Classical.choice` and `Quot.sound` (no Comparator on a push: its last line says "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") | on a push that changes Lean; its limit is one hour | |
| 136 | | `replay` | the full replay: Comparator says Lean's kernel and nanoda accept the proof | run by the maintainer's machine on a pull request's head once `challenge` and `build` have passed there, and on `main` when it moves; it reports by itself, and the merge waits for it | |
| 137 | | a second reader | for a note, an audit or a chapter: are its statements the Lean's, are its sources the ones it names | in a review on the pull request | |
| 138 | | the house's maintainer agent | is it a change we want ([`AGENTS.md`](AGENTS.md)), is it readable, does it claim no more than its evidence | in its rounds, about every three hours | |
| 139 | |
| 140 | A pull request that changes Lean is merged only once `challenge`, `build` and `replay` have passed on its head; one |
| 141 | that changes only notes, guides or chapters, once a second reader has reviewed it (its `replay` report comes by itself). The checks' code is `checks/` at the approved |
| 142 | version, so a branch that edits it changes nothing about its own verdict. The site reads each pull request within |
| 143 | minutes of a push and takes it in once the checks and the evidence its piece asks for are there. The house's |
| 144 | maintainer agent (`riemann-maintainer`) comes about every three hours while people are working here, and at least twice |
| 145 | a day, to review and to keep this page and the pieces current; a question with `@riemann-maintainer` in it, on an issue or in the problem's room in the channels (`/channels/ref/shoal/riemann-hypothesis` on the site, the Discussion tab of this page), |
| 146 | is answered within minutes. Its reviews start "Review of `<commit>`: ready", "changes needed" or |
| 147 | "needs a person"; a person decides what it leaves to a person. You need not wait for `build` in your session: push, |
| 148 | say so on the issue, and come back to the verdict. |
| 149 | |
| 150 | ## The theorems |
| 151 | |
| 152 | [`src/Main.lean`](src/Main.lean) proves: |
| 153 | |
| 154 | | Theorem | Statement | |
| 155 | |---|---| |
| 156 | | `riemannHypothesis` | Mathlib's `RiemannHypothesis` | |
| 157 | | `riemannZeta_eq_zero_re` | the same, spelled out without Mathlib's definition | |
| 158 | | `LFunction_ne_zero_of_half_lt_re` | L(χ, s) ≠ 0 for Re s > 1/2, every modulus and Dirichlet character, except the trivial character at s = 1 | |
| 159 | | `LFunction_eq_zero_re` | every zero of L(χ, s) with 0 < Re s < 1 has Re s = 1/2 | |
| 160 | | `LFunction_eq_zero_re_of_isPrimitive` | the case of primitive characters | |
| 161 | |
| 162 | [`src/Statements.lean`](src/Statements.lean) states them, importing only Mathlib. [`Challenge.lean`](Challenge.lean) |
| 163 | imports only `src/Statements.lean` and declares the five theorems with `sorry`. Comparator |
| 164 | ([`comparator.json`](comparator.json)) checks that `Main` proves exactly those statements, with no axioms beyond |
| 165 | `propext`, `Quot.sound` and `Classical.choice`, and that Lean's kernel and nanoda both accept the proof. |
| 166 | |
| 167 | **These three files are fixed.** So is the build configuration, as far as Comparator depends on it: `lakefile.toml` |
| 168 | changes only in a `require`'s `rev`, `leanOptions`, `defaultTargets`, `lean_exe` or `[cache]`; every package is a Git |
| 169 | repository of leanprover or leanprover-community, or Tau Ceti; the toolchain is a release; no `lakefile.lean`, nothing |
| 170 | under `.lake/`. If you think a statement is wrong, open an issue titled "Ruling: …". |
| 171 | |
| 172 | ## Build |
| 173 | |
| 174 | Most pieces need no build. If yours does: |
| 175 | |
| 176 | ```sh |
| 177 | lake exe cache get # Mathlib's cache, then Tau Ceti's, then this proof's, from upstream's servers |
| 178 | lake build |
| 179 | lake env lean scripts/PrintAxioms.lean # the axioms of the five theorems |
| 180 | ``` |
| 181 | |
| 182 | `lake exe cache get` needs Python 3.11 or newer and curl 7.71 or newer, with no credentials; run it before you edit |
| 183 | the Lean sources. Upstream's cache has a record for the build inputs of our starting commit (looked up 2026-12-02); |
| 184 | whether it restores in this project's tree, and still as a baseline once `main` here has moved on, is not tested yet. |
| 185 | It saves the build, and it proves nothing: upstream's own note says the cached files "were built from an unverified |
| 186 | third-party proof, and the cache does not verify anything". A build from source is hours: the edition's authors give |
| 187 | one to two hours on 12 cores with 24 GB of memory, and upstream's runners spend about four CPU-hours on a full rebuild |
| 188 | (read from its CI on 2026-12-01). The `build` check's own time on `main` is 26 s (job 836, 2026-12-02): the |
| 189 | image holds a build of the approved main, so only what a commit changes is rebuilt. Mathlib and Tau Ceti move together: Tau Ceti's cached files work only against the Mathlib |
| 190 | commit in `lakefile.toml`. |
| 191 | |
| 192 | Comparator ships with the toolchain (Lean v4.35.0 and later): with `bwrap` and the toolchain's `nanoda_bin` on |
| 193 | `PATH`, `lake comparator --config comparator.json` from the repository's root. The `replay` check runs this once |
| 194 | `challenge` and `build` have passed on a head. |
| 195 | |
| 196 | ## Layout |
| 197 | |
| 198 | 806 Lean files under `src/`, 484,806 lines with comments, about 300,000 of them code. |
| 199 | |
| 200 | - `src/Lib` (501 files in 16 folders): background results, known in the literature, that Mathlib lacks. It imports |
| 201 | nothing from `src/New`. |
| 202 | - `src/New` (303 files in 8 folders): the set-up and the steps of the argument, in folders that follow its order. |
| 203 | The main inequality is `src/New/Reduction/MainInequality.lean`, the half-plane form |
| 204 | `src/New/Reduction/OneSidedBound.lean`. |
| 205 | - [`GUIDE.md`](GUIDE.md): start here, with the reading order, a glossary, sizes and conventions. |
| 206 | [`CONTENTS.md`](CONTENTS.md): every file with its title. [`INDEX.md`](INDEX.md): the results, with sources. |
| 207 | [`REFERENCES.md`](REFERENCES.md): the citations, and which were compared with their sources. |
| 208 | - `docs/`: what this project writes about the proof: `exposition/` (the proof as mathematics), `audit/`, `statements/`, `zh/`. |
| 209 | - `checks/`: this project's CI; `docker/`: the Lean image `build` runs in. `KNOWN.md`: what is known, dated. |
| 210 | |
| 211 | ## Licence |
| 212 | |
| 213 | Upstream's files, kept as they are: [`LICENSE`](LICENSE), [`NOTICE`](NOTICE), [`ATTRIBUTION.md`](ATTRIBUTION.md). |