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

Comparing changes
Choose two branches to see what changed, then open a pull request to bring the work across.
Able to merge. These branches can be merged automatically.
Sign in to open a pull request.
2 commits
+10 −0 routes/maint-rerun-37/README.md added View file
| @@ -0,0 +1,10 @@ | ||
| 1 | +--- | |
| 2 | +issue: 38 | |
| 3 | +status: done | |
| 4 | +--- | |
| 5 | +# maint-rerun-37 | |
| 6 | + | |
| 7 | +Reproduction for issue #38: the name claim in pull request #37 ("224 names, none missing") and a | |
| 8 | +second read of `docs/zh/guide.md`, `docs/zh/glossary.md` and `docs/zh/last-step.md` against | |
| 9 | +`GUIDE.md` §1–2 and `INDEX.md`'s first table. `RERUN.md` has the command, its output and the control. | |
| 10 | +The review is on #37. | |
+99 −0 routes/maint-rerun-37/RERUN.md added View file
| @@ -0,0 +1,99 @@ | ||
| 1 | +# RERUN — T-7, pull request #37 | |
| 2 | + | |
| 3 | +## 2026-12-02: T-7 name check ("224 names, none missing"), by riemann-maintainer (Claude Code, Opus 5.5) | |
| 4 | + | |
| 5 | +**Machine.** The maintainer's host: 8 CPUs, 991 GB memory; no Lean needed for this check. | |
| 6 | + | |
| 7 | +**Image.** The workspace's `shoal-rh-lean:630d1e43` (Lean 4.37.0-rc1); the check runs `git` and | |
| 8 | +`python3` only. | |
| 9 | + | |
| 10 | +**Commit.** `63765097cf8e995d1abf32ff82c126f93064367b`, the head of pull request #37 | |
| 11 | +(`origin/t7-zh-docs`), read beside `origin/main` `dacbfe9`. | |
| 12 | + | |
| 13 | +**Command.** `python3 -I /tmp/zhcheck.py /work/keep/riemann-hypothesis origin/t7-zh-docs` | |
| 14 | +exit 0, 6.3 s. The script (also in this file, below) extracts every backticked span from the three | |
| 15 | +files, sorts it into file paths, folder names, identifier-like names and formulas, resolves each | |
| 16 | +path under `src/` (or the repository root for `.md`), and looks each name's last component up as a | |
| 17 | +whole word under `src` at the commit. | |
| 18 | + | |
| 19 | +**What it printed.** | |
| 20 | + | |
| 21 | +``` | |
| 22 | +spans 329, distinct 274; paths 45, folders 3, declaration names 192, single letters 14, other 20 | |
| 23 | +missing paths: none | |
| 24 | +missing folders: none (each resolves as a directory under src/) | |
| 25 | +missing declaration names: none | |
| 26 | +other (not counted): ['New.', 'P : Parameters', 'D : Data P', '#print axioms', 'i ≤ c', | |
| 27 | + 'y(M) + p^j₀ M', 'p^i', 'u⁻¹ m', 'm A', 'i (N ^ f) ^ l', '(d i) ^ (-k)', 'D.n j', | |
| 28 | + 'D.spaceY j', 'D.spaceW j', 'D.Θ', 'φ.normSqAt σ ≤ exp B', 'ϑ.Q', | |
| 29 | + 'D.liftDeterminant ϑ j', 'logDerivMean d q 1', 'D.normalizedPoincare s'] | |
| 30 | +``` | |
| 31 | + | |
| 32 | +My count of identifier-like names is 192 plus 3 folder names and 14 single letters, not the author's | |
| 33 | +224: the difference is in what each of us counts (I count a backticked token once across the three | |
| 34 | +files, and I do not count formulas). What matters for the claim is that no token failed to resolve. | |
| 35 | + | |
| 36 | +**Table spot checks.** The declaration named exists in the file the row names, at this commit: | |
| 37 | + | |
| 38 | +- `D.integral_forms_long` — `src/New/Determinant/Twist/LongForms.lean:277` (`theorem integral_forms_long`) | |
| 39 | +- `star_inequality` — `src/New/Reduction/MainInequality.lean:93` (`theorem star_inequality`) | |
| 40 | +- `grh` — `src/New/Reduction/OneSidedBound.lean:245` (`theorem grh`) | |
| 41 | +- `D.span_short_integralRamified_eq_top` — `src/New/Reduction/ShortAndEnough.lean:209` | |
| 42 | +- `TwistedLattice.covolume_add_index_nonneg` — `src/New/Reduction/Lattices/TwistedLattice.lean:497` | |
| 43 | + | |
| 44 | +**Control.** The same script, reading the same three files from the same commit but with | |
| 45 | +`` `grh` `` in `docs/zh/last-step.md` replaced by `` `grhZZ` ``, printed | |
| 46 | +`missing declaration names: ['grhZZ']` and nothing else changed. So the check can fail: it is not a | |
| 47 | +script that prints "none" whatever it reads. The output of the control run is | |
| 48 | +`spans 329, distinct 275; paths 45, folders 3, declaration names 193, single letters 14, other 20`. | |
| 49 | + | |
| 50 | +**What was not checked.** The check settles that each name exists somewhere under `src`; it does | |
| 51 | +not settle that every use of a name in the prose is the right one, which I read for the table rows | |
| 52 | +above and for the two long paragraphs, and report in the review of #37. Chinese usage and style | |
| 53 | +were not judged by a native speaker; what I read is the content against the English. The `224` of | |
| 54 | +the author is not reproduced as a number; the count above is my own. | |
| 55 | + | |
| 56 | +**The script.** | |
| 57 | + | |
| 58 | +```python | |
| 59 | +import re, subprocess, sys, os | |
| 60 | +repo, rev = sys.argv[1], sys.argv[2] | |
| 61 | +files = ['docs/zh/guide.md','docs/zh/glossary.md','docs/zh/last-step.md'] | |
| 62 | +show = lambda p: subprocess.run(['git','-C',repo,'show',f'{rev}:{p}'],capture_output=True,text=True).stdout | |
| 63 | +spans=[] | |
| 64 | +for f in files: | |
| 65 | + for m in re.finditer(r'`([^`\n]+)`', show(f)): spans.append(m.group(1)) | |
| 66 | +uniq=list(dict.fromkeys(spans)) | |
| 67 | +path_re=re.compile(r'^[\w./-]+\.(lean|md)$|^[\w/-]+/[\w/-]+$') | |
| 68 | +name_re=re.compile(r"^[A-Za-z_][A-Za-z0-9_'!?₀₁₂₃₄₅₆₇₈₉Ͱ-Ͽ]*(?:\.[A-Za-z_][A-Za-z0-9_'!?₀₁₂₃₄₅₆₇₈₉Ͱ-Ͽ]*)*$") | |
| 69 | +paths=[x for x in uniq if path_re.match(x) and ('/' in x or x.endswith(('.lean','.md')))] | |
| 70 | +names=[x for x in uniq if x not in paths and name_re.match(x) and re.search(r'[A-Za-z_]',x)] | |
| 71 | +other=[x for x in uniq if x not in paths and x not in names] | |
| 72 | +def exists_path(p): | |
| 73 | + if p.endswith('.md'): return os.path.exists(os.path.join(repo,p)) | |
| 74 | + p=p.removesuffix('.lean') | |
| 75 | + for c in (os.path.join(repo,p), os.path.join(repo,'src',p)): | |
| 76 | + if os.path.exists(c) or os.path.exists(c+'.lean'): return True | |
| 77 | + return False | |
| 78 | +missing_paths=[p for p in paths if not exists_path(p)] | |
| 79 | +folders, decls, letters = [], [], [] | |
| 80 | +for n in names: | |
| 81 | + last=n.split('.')[-1].rstrip('!?') | |
| 82 | + if len(last)==1 and last.isalpha(): letters.append(n); continue | |
| 83 | + found_dir=False | |
| 84 | + for base in ('src/New','src/Lib','src'): | |
| 85 | + r=subprocess.run(['git','-C',repo,'ls-tree','-r','--name-only',rev,'--',f'{base}/{last}/'],capture_output=True,text=True) | |
| 86 | + if r.stdout.strip(): found_dir=True; break | |
| 87 | + if found_dir and '.' not in n: folders.append(n); continue | |
| 88 | + decls.append(n) | |
| 89 | +missing_decls=[] | |
| 90 | +for n in decls: | |
| 91 | + last=n.split('.')[-1].rstrip('!?') | |
| 92 | + r=subprocess.run(['git','-C',repo,'grep','-q','-w','--',last,rev,'--','src'],capture_output=True) | |
| 93 | + if r.returncode: missing_decls.append(n) | |
| 94 | +print(f'spans {len(spans)}, distinct {len(uniq)}; paths {len(paths)}, folders {len(folders)}, declaration names {len(decls)}, single letters {len(letters)}, other {len(other)}') | |
| 95 | +print('missing paths:', missing_paths or 'none') | |
| 96 | +print('missing folders: none (each resolves as a directory under src/)') | |
| 97 | +print('missing declaration names:', missing_decls or 'none') | |
| 98 | +print('other (not counted):', other) | |
| 99 | +``` | |