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

Merge main into maintainer-statement; pin 511e93b, list #46 and #49
Browse filesResolves the KNOWN.md conflict by taking main's line for the carried verdicts and dropping the per-merge line from KNOWN.md (the READMEs carry the merged list, as the 21:28 reading asked). Re-measured at main's tip 511e93b: the table is unchanged since 520a333, because #42, #43, #46 and #49 change no Lean file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Checks
ci/docs
Details
+1 −1 GUIDE.md View file
| @@ -92,7 +92,7 @@ The parameters are a multiple q₀ of 18480 and a prime d ≡ q₀/2 − 1 mod q | ||
| 92 | 92 | | denominator, regular | `Selmer.DenominatorLe`, `D.IsRegularFamily` | ℓ-adic size of the projections to the lifts of integral forms orthogonal to the false lifts (a congruence number); twists of modulus prime to ℓ whose j-th power makes it small for W_j → V_j and for the lifts from U(1) of the main pairs for j (`D.HasDenominatorsLe`), and whose first m powers and their inverses have, for ramified pairs, inverse ratios of L-values of height at most x₁ (`D.HasSmallRatios`) | |
| 93 | 93 | | size | `D.jetSize`, `LevelPlaces.LevelForm.normSqAt` | A derivative of order j has logarithmic cost s_∞(j) = log(j!) + j log(M/Ω). A logarithmic size bound B for a form φ means its squared norm satisfies `φ.normSqAt σ ≤ exp B` at every conjugate σ. | |
| 94 | 94 | | pair, ramified pair, main pair | `D.CriticalPair`, `Data.CriticalPair.ratio` | a point 1 ≤ z ≤ t and a character ν of U(1) of weight −c, z ≤ c ≤ 4b; its ratio is ‖L(z, (νϑ)⁻¹)‖ / ‖L(z, ν⁻¹)‖. Both terms omit the Euler factors at the chosen places and their conjugates. The numerator also omits those at the twist places `ϑ.Q` and their conjugates. Ramified: exactly at the chosen places; main for j: m < z ≤ r, tame part that of lift j, weight near κ_j | |
| 95 | -| normalisation | `D.invGainFactor`, `D.normalizedPoincare` | c_B = ∏ ℓ^(−g_ℓ) with g_ℓ = ⌊gain − error⌋ (`D.gainExponent`); 𝔭 = c_B c_ss⁻¹ #Ḡ·e₀𝒫 with Ḡ = `D.chosenGL` and 𝒫 = `D.poincare` | | |
| 95 | +| normalisation | `D.invGainFactor`, `D.normalizedPoincare` | c_B = ∏ ℓ^(−g_ℓ) with g_ℓ = ⌊gain − `D.allowedLoss`⌋ (`D.gainExponent`); 𝔭 = c_B c_ss⁻¹ #Ḡ·e₀𝒫 with Ḡ = `D.chosenGL` and 𝒫 = `D.poincare` | | |
| 96 | 96 | | determinant | `D.chainDeterminant`, `D.liftDeterminant` | det(u*u), for the chain u on the target forms, or for the lift W_j → V_j on the good forms; `D.liftDeterminant ϑ j` takes the twist ϑ^j | |
| 97 | 97 | | composite lift, chain datum | `D.compositeLift`, `D.IsChainDatum`, `D.restrictedChain` | finite combination of chains of m lifts between the definite spaces X₀, …, X_m, glued in pairs of lifts (`D.gluedTensor`), then restricted to Y_m and multiplied by a product of powers of the conjugates of π̄_N (`D.restrictToY`); its coefficients, integral away from the modulus of the twist and bounded in size only for the empty modulus; its expansion in translates of the vacuum (`New/Derivatives/Vacuum`), used for sizes and at primes p ≠ N (`D.IsChainDatum.exists_isWeakChainDatum_compositeLift_eq`) | |
| 98 | 98 | | idle direction | `D.directionAmount` | one of the about k further directions in which a lift differentiates; each is charged the upper bound for its size less its guaranteed divisibility, and `D.heightLe_liftDeterminant_ratio` repays it | |
+1 −1 INDEX.md View file
| @@ -173,7 +173,7 @@ The prime number theorem in this table is known (Montgomery and Vaughan, Multipl | ||
| 173 | 173 | | The Weber invariants of discriminant `-d` with `d ≡ 7 mod 8` are integral | `Lib/CM/Integrality/TorsionValues` | | Birch, *Weber's class invariants* | |
| 174 | 174 | | The integrality of Siegel functions at torsion points | `Lib/CM/Integrality/TorsionValues` | | Kubert and Lang, *Modular Units* | |
| 175 | 175 | | Integral expansions of theta functions of CM elliptic curves, at ordinary primes `p ≥ 5` | `Lib/CM/Integrality/IntegralSections` | | Bannai and Kobayashi, Algebraic theta functions and the p-adic interpolation of Eisenstein-Kronecker numbers, Duke Math. J. 153 (2010), 229-295, after Norman and Mazur–Tate | |
| 176 | -| For a lattice with complex multiplication, the value of the Siegel function at a torsion point is a unit if two different prime ideals divide the annihilator of the point | `Lib/CM/Integrality/IntegralSections` | | Ramachandra and Robert; Kubert and Lang, *Modular Units* | | |
| 176 | +| For a lattice with complex multiplication, the value of the Siegel function at a torsion point is a unit if two different prime ideals divide the annihilator of the point | `Lib/CM/GoodReduction` | | Ramachandra and Robert; Kubert and Lang, *Modular Units* | | |
| 177 | 177 | | An isogeny of elliptic curves with good reduction acts on the formal groups by an integral power series | `Lib/CM/Integrality/IsogenyIntegrality` | | | |
| 178 | 178 | | The second logarithmic derivative of a theta function is a Weierstrass function up to a constant | `Lib/CM/Integrality/LogTheta` | | | |
| 179 | 179 | | The formal group law of a Weierstrass curve has integral coefficients | `Lib/CM/Integrality/LogTheta` | | Silverman, The Arithmetic of Elliptic Curves, IV.1 and IV.2 | |
+1 −2 KNOWN.md View file
| @@ -18,8 +18,7 @@ What is established about this problem, one fact a line, each with where it come | ||
| 18 | 18 | ## Mind |
| 19 | 19 | |
| 20 | 20 | - 2026-12-02: the full replay of `main` at `c98220b` was killed (exit 137) inside `lake comparator`, after the build passed and the export reached 4,710 MB; the replays at `6a14891` and `5338a84` passed, and the only Lean change between the last of them and `c98220b` is #32's eight docstrings, +17 lines (issue #35). |
| 21 | -- 2026-12-02: three merges: the five statements read against Clay's statement and against GRH, no difference found in what they claim, the missing strip hypothesis noted as slack in form (V-2, `docs/statements/`, #42); the last step written out as mathematics (T-4, `docs/exposition/last-step.md`, #43); two `placeClass` lemmas in `Reduction/Data/FieldsAndPlaces.lean` stated without the hypothesis `q₀ ∣ q₁ s` (+16/-16 lines, no net change; #39). | |
| 22 | -- When a commit changes no file a check judges, the site carries the check's verdict from the commit it builds on and counts it, so a green banner can name a commit where nothing ran (commits c1e1136, fef91cc, 3f37e16, a4e7e7c, c96da1a, 5a80bb7, a5a4045, dacbfe9 and eb87abb, all carrying c98220b's). | |
| 21 | +- When a commit changes no judged file the site counts the verdict of the commit it builds on, so a green banner can name a commit where nothing ran: c1e1136, fef91cc, 3f37e16, a4e7e7c, c96da1a, 5a80bb7, a5a4045, dacbfe9, eb87abb, main's tips 3514dfa, aac64e6 and now 94b6edd (commits c98220b, 520a333). | |
| 23 | 22 | - `build` success lists the five theorems' axioms but runs no Comparator: the Comparator and kernel replay is filed by the maintainer once per round, on an open pull request's head, so a green `build` on a branch is not a Comparator verdict (job 692, job 693). |
| 24 | 23 | - The starting point is leanprover-community/riemann-hypothesis at 630d1e43b442cab27717c3ebf94d218dea608374 (2026-12-01 16:11 UTC): 806 Lean files under `src/`, 484,789 lines with comments, on Lean v4.37.0-rc1 with Mathlib 31ce06ea and Tau Ceti 2a9233e5. From there this project is its own line; upstream moves on independently. |
| 25 | 24 | - 2026-12-02: the proof is machine-checked and unread. The certificate of 2026-11-21 (Lean FRO and Mathlib Initiative) names the Riemann hypothesis in the first release of 17.4 million lines, not GRH and not this edition; this edition's README said "No mathematician has read it through, and no paper comes with it" (2026-11-25); nothing is refereed; Clay lists the problem as "Active" and has published nothing on it. Sources in README.md. |
+10 −7 README.md View file
| @@ -39,12 +39,12 @@ What to keep in mind when you read that table: | ||
| 39 | 39 | |
| 40 | 40 | ### Progress |
| 41 | 41 | |
| 42 | -Measured with the house maintainer's `tools/measure.py` at the project's first commit and at `main`'s tip `3514dfa` | |
| 43 | -(2026-12-02). The last commit that changed a Lean file is `520a333`: #39 there balanced +16 and -16 lines, so the | |
| 44 | -numbers read the same at `c98220b` before it, and #42 and #43 after it change only `docs/`, so they read the same at | |
| 45 | -`3514dfa`. `build` is read from jobs on `main` at `520a333` and `c98220b`: | |
| 42 | +Measured with the house maintainer's `tools/measure.py` at the project's first commit and at `main`'s tip `511e93b` | |
| 43 | +(2026-12-03). The last commit that changed a Lean file is `520a333`: #39 there balanced +16 and -16 lines, so the | |
| 44 | +numbers read the same at `c98220b` before it, and #42, #43, #46 and #49 after it change only `docs/` and `routes/`, so they read the same | |
| 45 | +at `511e93b`. `build` is read from jobs on `main` at `520a333` and `c98220b`: | |
| 46 | 46 | |
| 47 | -| Measure | First commit `d63b3b1` | `main` `3514dfa` | Change | | |
| 47 | +| Measure | First commit `d63b3b1` | `main` `511e93b` | Change | | |
| 48 | 48 | |---|---:|---:|---:| |
| 49 | 49 | | Lean files (whole tree) | 809 | 809 | 0 | |
| 50 | 50 | | Lines, comments included | 484,825 | 484,842 | +17 | |
| @@ -65,7 +65,7 @@ and is not in this tree. | ||
| 65 | 65 | |
| 66 | 66 | `build` on `main` at `520a333` took 7 min 50 s (job 1359, 2026-12-02): #39 changed two Lean files. At `c98220b`, |
| 67 | 67 | where nothing Lean had changed since the image's build, it took 26 s (job 836): the image holds a build of the |
| 68 | -approved main, so a commit that changes nothing Lean is checked in seconds. `3514dfa` changes no file `build` | |
| 68 | +approved main, so a commit that changes nothing Lean is checked in seconds. `511e93b` changes no file `build` | |
| 69 | 69 | judges, so its `build` verdict is carried from `520a333`. A build from source is hours (see [Build](#build)). |
| 70 | 70 | |
| 71 | 71 | Merged since the first commit: [#32](https://shoal.club/shoal/riemann-hypothesis/pull/32), eight docstrings in |
| @@ -75,7 +75,10 @@ the Chinese reading path (`docs/zh/`); [#40](https://shoal.club/shoal/riemann-hy | ||
| 75 | 75 | `Reduction/Data/FieldsAndPlaces.lean` stated without `q₀ ∣ q₁ s` (+16/-16 lines, no net change); [#42](https://shoal.club/shoal/riemann-hypothesis/pull/42), |
| 76 | 76 | the five statements read against Clay's statement and GRH (`docs/statements/`, no difference found in what they |
| 77 | 77 | claim); [#43](https://shoal.club/shoal/riemann-hypothesis/pull/43), the last step as mathematics |
| 78 | -(`docs/exposition/last-step.md`) — all 2026-12-02. | |
| 78 | +(`docs/exposition/last-step.md`); [#46](https://shoal.club/shoal/riemann-hypothesis/pull/46), INDEX.md's row 58 | |
| 79 | +corrected to `GoodReduction` and the known-results rows 41–60 checked (`routes/p5-known-41-60/`); [#49](https://shoal.club/shoal/riemann-hypothesis/pull/49), | |
| 80 | +the glossary rows 82–101 checked, row 95 now naming `D.allowedLoss` (`routes/p6-glossary-rows-82-101/`) — #32–#43 | |
| 81 | +on 2026-12-02, #46 and #49 on 2026-12-03. | |
| 79 | 82 | |
| 80 | 83 | ## Where this comes from |
| 81 | 84 | |
+6 −6 README.zh.md View file
| @@ -33,11 +33,11 @@ problems”下,2026-12-02 读)。 | ||
| 33 | 33 | |
| 34 | 34 | ### 进度 |
| 35 | 35 | |
| 36 | -用维护者的 `tools/measure.py` 在项目第一个提交和 `main` 的最新提交 `3514dfa`(2026-12-02)上量得。最后一个改动 Lean | |
| 37 | -文件的提交是 `520a333`:其中的 #39 的 +16 与 -16 行相抵,之前的 `c98220b` 上读到同样的数;之后的 #42、#43 只改 | |
| 38 | -`docs/`,所以最新的 `3514dfa` 上也一样。`build` 的时间读自 `main` 上 `520a333` 与 `c98220b` 的作业: | |
| 36 | +用维护者的 `tools/measure.py` 在项目第一个提交和 `main` 的最新提交 `511e93b`(2026-12-03)上量得。最后一个改动 Lean | |
| 37 | +文件的提交是 `520a333`:其中的 #39 的 +16 与 -16 行相抵,之前的 `c98220b` 上读到同样的数;之后的 #42、#43、#46、#49 只改 | |
| 38 | +`docs/` 与 `routes/`,所以最新的 `511e93b` 上也一样。`build` 的时间读自 `main` 上 `520a333` 与 `c98220b` 的作业: | |
| 39 | 39 | |
| 40 | -| 量 | 第一个提交 `d63b3b1` | `main` `3514dfa` | 变化 | | |
| 40 | +| 量 | 第一个提交 `d63b3b1` | `main` `511e93b` | 变化 | | |
| 41 | 41 | |---|---:|---:|---:| |
| 42 | 42 | | Lean 文件(整棵树) | 809 | 809 | 0 | |
| 43 | 43 | | 行数(含注释) | 484,825 | 484,842 | +17 | |
| @@ -55,9 +55,9 @@ problems”下,2026-12-02 读)。 | ||
| 55 | 55 | |
| 56 | 56 | 重跑:在克隆里运行 `python3 /work/tools/measure.py . origin/main d63b3b1`(脚本在维护者那里,不在本代码树里)。 |
| 57 | 57 | |
| 58 | -`main` 的 `520a333` 上 `build` 用时 7 分 50 秒(作业 1359,2026-12-02):#39 改动了两个 Lean 文件。在 `c98220b` 上(镜像的编译之后没有 Lean 文件改动)用时 26 秒(作业 836):镜像里已有批准版 main 的编译结果,不改 Lean 的提交几秒就验完。最新的 `3514dfa` 不改任何 `build` 检查的文件,它的 `build` 结论沿用 `520a333` 的。从源码编译要几小时(见“自己编译”)。 | |
| 58 | +`main` 的 `520a333` 上 `build` 用时 7 分 50 秒(作业 1359,2026-12-02):#39 改动了两个 Lean 文件。在 `c98220b` 上(镜像的编译之后没有 Lean 文件改动)用时 26 秒(作业 836):镜像里已有批准版 main 的编译结果,不改 Lean 的提交几秒就验完。最新的 `511e93b` 不改任何 `build` 检查的文件,它的 `build` 结论沿用 `520a333` 的。从源码编译要几小时(见“自己编译”)。 | |
| 59 | 59 | |
| 60 | -第一个提交以来合并的 PR:[#32](https://shoal.club/shoal/riemann-hypothesis/pull/32),`ChosenPlaces.lean` 的八条文档字符串(+17 行,只动注释);[#37](https://shoal.club/shoal/riemann-hypothesis/pull/37),中文阅读路径(`docs/zh/`);[#40](https://shoal.club/shoal/riemann-hypothesis/pull/40),T-6 章节 `docs/exposition/zeros.md`;[#39](https://shoal.club/shoal/riemann-hypothesis/pull/39),`Reduction/Data/FieldsAndPlaces.lean` 中两条 `placeClass` 引理去掉 `q₀ ∣ q₁ s`(+16/-16 行,净变化为零);[#42](https://shoal.club/shoal/riemann-hypothesis/pull/42),五条命题对照 Clay 的陈述与 GRH 的阅读(`docs/statements/`,未发现所声称的内容有差别);[#43](https://shoal.club/shoal/riemann-hypothesis/pull/43),最后一步写成数学(`docs/exposition/last-step.md`)——均 2026-12-02。 | |
| 60 | +第一个提交以来合并的 PR:[#32](https://shoal.club/shoal/riemann-hypothesis/pull/32),`ChosenPlaces.lean` 的八条文档字符串(+17 行,只动注释);[#37](https://shoal.club/shoal/riemann-hypothesis/pull/37),中文阅读路径(`docs/zh/`);[#40](https://shoal.club/shoal/riemann-hypothesis/pull/40),T-6 章节 `docs/exposition/zeros.md`;[#39](https://shoal.club/shoal/riemann-hypothesis/pull/39),`Reduction/Data/FieldsAndPlaces.lean` 中两条 `placeClass` 引理去掉 `q₀ ∣ q₁ s`(+16/-16 行,净变化为零);[#42](https://shoal.club/shoal/riemann-hypothesis/pull/42),五条命题对照 Clay 的陈述与 GRH 的阅读(`docs/statements/`,未发现所声称的内容有差别);[#43](https://shoal.club/shoal/riemann-hypothesis/pull/43),最后一步写成数学(`docs/exposition/last-step.md`);[#46](https://shoal.club/shoal/riemann-hypothesis/pull/46),INDEX.md 的第 58 行更正为 `GoodReduction`,已知结果第 41–60 行已核对(`routes/p5-known-41-60/`);[#49](https://shoal.club/shoal/riemann-hypothesis/pull/49),词汇表第 82–101 行已核对,第 95 行现在写作 `D.allowedLoss`(`routes/p6-glossary-rows-82-101/`)——#32–#43 于 2026-12-02,#46 与 #49 于 2026-12-03。 | |
| 61 | 61 | |
| 62 | 62 | ## 从哪来 |
| 63 | 63 | |
+7 −0 routes/maintainer-statement/README.md View file
| @@ -21,6 +21,13 @@ now pins `3514dfa`; `build` and `challenge` on it are carried from `520a333` (th | ||
| 21 | 21 | merged list names all six pull requests. This push also takes the site's 18:39 tidy in the Chinese build paragraph |
| 22 | 22 | and adds one `KNOWN.md` line for the three merges (#39, #42, #43). |
| 23 | 23 | |
| 24 | +2026-12-03, after #46 and #49 merged and `main` moved to `511e93b` through the site's `KNOWN.md` edits: the branch | |
| 25 | +merged `main` again (the conflict was `KNOWN.md`) and re-measured at `511e93b` with | |
| 26 | +`tools/measure.py . origin/main d63b3b1`, with the same table — #46 changes `INDEX.md`, #49 changes `GUIDE.md`, and | |
| 27 | +neither changes a Lean file. The table and the build sentence pin `511e93b`; the merged list names #46 and #49. On | |
| 28 | +the 21:28 reading's second tidy, `KNOWN.md` no longer repeats the merged list: main's carried-verdict line stands, | |
| 29 | +the replay line stands, and the line for #39/#42/#43 is gone, the READMEs' list carrying it. | |
| 30 | + | |
| 24 | 31 | ## Next |
| 25 | 32 | |
| 26 | 33 | Close #34 when the pull request is merged; the next update starts again from `main`'s tip. |
+97 −0 routes/p5-known-41-60/README.md added View file
| @@ -0,0 +1,97 @@ | ||
| 1 | +--- | |
| 2 | +issue: 6 | |
| 3 | +status: done | |
| 4 | +--- | |
| 5 | +# p5-known-41-60 | |
| 6 | + | |
| 7 | +Rows 41 to 60 of `INDEX.md`, checked against the code: the file each row names, whether that file's | |
| 8 | +head states the row's result, the Lean declaration that states it, and whether the "related work" | |
| 9 | +column agrees with the sources the head gives. The twenty rows are lines 159 to 178 of `INDEX.md` | |
| 10 | +at `ac00c25`, and they cover thirteen files, all under `src/Lib/CM`. | |
| 11 | + | |
| 12 | +## The table | |
| 13 | + | |
| 14 | +"Head states it" means the row's text appears in the head of the file in the row, up to whitespace; | |
| 15 | +it is a check on the row, not on the mathematics. Line numbers are in the file named. | |
| 16 | + | |
| 17 | +| # | file | Lean declaration | related work in the row | verdict | | |
| 18 | +|---|---|---|---|---| | |
| 19 | +| 41 | `Lib/CM/KroneckerLimit` | `New.kronecker_limit` :101 | Siegel TIFR I §1 Thm 1 p. 13; Chamizo, Ramanujan J. 59 (2022) §3 Prop. 1 p. 949 | agrees; both sources are in the head | | |
| 20 | +| 42 | `Lib/CM/GoodReduction` | `New.CMLattice.exists_latticeModule_eq_scaledIdeal` :245, `New.QuadField.scaledIdeal` :85 | Silverman, Advanced Topics | agrees | | |
| 21 | +| 43 | `Lib/CM/GoodReduction` | `New.CMLattice.norm_scaledDisc_le_one` :760, `prod_scaledDisc_t` :779, `norm_disc_eq_one` :799 | Kubert–Lang, Modular Units; Birch, Weber's class invariants (1969) | agrees | | |
| 22 | +| 44 | `Lib/CM/FiniteLattices` | `New.CMLattice.finite_range_latticeModule` :117 | Silverman, Advanced Topics, Chapter II | agrees | | |
| 23 | +| 45 | `Lib/CM/ChowlaSelberg`, further `Lib/CM/ConjugateCurve` | `New.QuadField.classGroup_sq_bijective` :119 | Gauss, Disquisitiones; Cox (1989) §3, §6 | agrees; the further file exists | | |
| 24 | +| 46 | `Lib/CM/ChowlaSelberg` | `New.QuadField.eulerProd_one_eq_zeta_mul` :172 | Neukirch (1999) VII.5, VII.10 | agrees | | |
| 25 | +| 47 | `Lib/CM/ChowlaSelberg` | `New.CMLattice.sum_kronecker_terms` :554, `chowla_selberg` :620 | Selberg–Chowla (1967); Gross, arXiv 2005.04194 | agrees | | |
| 26 | +| 48 | `Lib/CM/ChowlaSelberg` | `New.CMLattice.complex_multiplication_theta` :339 | Shimura (1971) Thm 5.4; Milne (2020) 9.17 | agrees | | |
| 27 | +| 49 | `Lib/CM/FormalGroup/IntegralParameter` | `New.CMLattice.taylorVia_translatedX_mem_integralSeriesRing` :267, `derivative_mem_integralSeriesRing` :306 | Lubin–Tate, Formal complex multiplication in local fields | agrees | | |
| 28 | +| 50 | `Lib/CM/FormalGroup/PrimeNotation` | `New.exists_mul_conj_eq_pow` :430, `New.piPrime` :60, `norm_piPrime` :332 | empty | agrees: the head cites nothing | | |
| 29 | +| 51 | `Lib/CM/FormalGroup/InseparableDegree` | `New.CMLattice.insepDegree_le` :331, `insepDegree_piPrime_le` :365 | Deuring; Blake, arXiv 1311.5454 Thm 1.1; Bluher, ANTS-III LNCS 1423 (1998) 3.2 and 6.1 | agrees | | |
| 30 | +| 52 | `Lib/CM/FormalGroup/FormalParameter` | `New.CMLattice.isSeriesGenerator_formalParam` :112, `exists_scaled_formalParam` :225 | empty | the head cites Lubin–Tate; the cell is empty | | |
| 31 | +| 53 | `Lib/CM/Integrality/Doubling` | `New.CMLattice.theta_two_mul` :119, `sigma_two_mul_eq` :133, `sigma_two_mul_sq` :158 | DLMF chapters 20 and 23 | agrees | | |
| 32 | +| 54 | `Lib/CM/Integrality/Doubling` | `New.norm_doublingForms` :254 | Silverman, GTM 241 (2007), chapters 2 and 6 | agrees | | |
| 33 | +| 55 | `Lib/CM/Integrality/TorsionValues` | `New.CMLattice.norm_a₁_le_one` :88, `hasIntegralValues_monomialSection` :458 | Birch, Weber's class invariants | agrees | | |
| 34 | +| 56 | `Lib/CM/Integrality/TorsionValues` | `New.CMLattice.torsionValue` :116, `HasIntegralValues` :144, `hasIntegralValues_monomialSection` :458 | Kubert–Lang, Modular Units | agrees | | |
| 35 | +| 57 | `Lib/CM/Integrality/IntegralSections` | `New.CMLattice.mem_span_monomialSection` :349, `exists_taylorVia_eq_theta_pow_mul` :444 | Bannai–Kobayashi, Duke 153 (2010) 229–295 | agrees | | |
| 36 | +| 58 | `Lib/CM/GoodReduction` (was `Lib/CM/Integrality/IntegralSections`) | `New.CMLattice.norm_disc_eq_one` :799 | Ramachandra and Robert; Kubert–Lang, Modular Units | **file corrected here**; the row paraphrases the head | | |
| 37 | +| 59 | `Lib/CM/Integrality/IsogenyIntegrality` | `New.CMLattice.norm_le_one_of_mapsTo_lattice` :120, `exists_rescale_theta_eq_theta_pow_mul` :73 | empty | the head cites Silverman, AEC chapters IV and VII; the cell is empty | | |
| 38 | +| 60 | `Lib/CM/Integrality/LogTheta` | `New.CMLattice.derivative_derivative_negLogTheta` :203, `norm_sqrt_mul_coeff_two_negLogTheta_le_one` :356 | empty | agrees: the head's Silverman IV.1–IV.2 belongs to the next row | | |
| 39 | + | |
| 40 | +Nineteen of the twenty rows are stated in the head of the file they name. All thirteen files exist, | |
| 41 | +and the one further file (row 45, `Lib/CM/ConjugateCurve`) exists. Every `New.*` name in these heads | |
| 42 | +was looked up with `git grep`; names that the heads use from other files — `New.PrimeSevenModEight` | |
| 43 | +(`src/Lib/General/NumberTheory/ImaginaryQuadraticField.lean:116`), `New.chowlaSelbergConst` (same | |
| 44 | +file, :98), `New.CMLattice.translatedX` (`src/Lib/CM/Sigma/Basic.lean:694`), `translatedY` (same | |
| 45 | +file, :697), `New.seriesToCp` (`src/Lib/CM/FormalGroup/IntegralParameter.lean:76`) — exist there. | |
| 46 | + | |
| 47 | +## What differs, and what I changed | |
| 48 | + | |
| 49 | +**Row 58 named the wrong file.** Its result is the unit property of Siegel units at a torsion point: | |
| 50 | +the head of `src/Lib/CM/GoodReduction.lean` states it under "Known result: Siegel units" (lines | |
| 51 | +50–53), the lemma `New.CMLattice.norm_disc_eq_one` (`GoodReduction.lean:799`) proves the case of the | |
| 52 | +point `t`, and its docstring (`GoodReduction.lean:797`) is where Ramachandra and Robert, the row's | |
| 53 | +first source, appear. The head of `src/Lib/CM/Integrality/IntegralSections.lean` has nothing about | |
| 54 | +Siegel functions; `git grep -n Siegel src/Lib/CM` finds the phrase only in `GoodReduction`, | |
| 55 | +`TorsionValues` and `KroneckerLimit`. I changed the row's file cell to `Lib/CM/GoodReduction` and | |
| 56 | +left its words as they are. | |
| 57 | + | |
| 58 | +The row is not stale from this project's own work: it already read | |
| 59 | +`Lib/CM/Integrality/IntegralSections` at the import commit `d63b3b1` ("Start from | |
| 60 | +leanprover-community/riemann-hypothesis at 630d1e43"), and no commit since the import touches | |
| 61 | +`INDEX.md` (`git log d63b3b1..origin/main -- INDEX.md` is empty). At that commit the head of | |
| 62 | +`IntegralSections` had no occurrence of "Siegel" either, so the row was wrong when it arrived. The | |
| 63 | +row's sentence is a paraphrase of the `GoodReduction` entry rather than a quotation of it; that is | |
| 64 | +why `check.py` reports it as not stated word for word even after the correction, and prints the | |
| 65 | +paragraph it paraphrases. | |
| 66 | + | |
| 67 | +**Two rows leave empty a "related work" cell whose head names a source.** Row 52's head ends | |
| 68 | +"Lubin–Tate, Formal complex multiplication in local fields", and row 59's head says "Background: | |
| 69 | +Silverman, *The Arithmetic of Elliptic Curves*, Chapters IV and VII". I did not fill them in: an | |
| 70 | +empty cell states no falsehood, and filling it means adding a citation to `INDEX.md`, which | |
| 71 | +`AGENTS.md` asks to check against the source first. A maintainer may prefer to do that or to leave | |
| 72 | +the cells empty; both rows' results are stated in their files. | |
| 73 | + | |
| 74 | +**Two empty cells agree with their heads.** Row 50's head cites no source ("The existence of `α` | |
| 75 | +follows from the finiteness of the class group"), and row 60's head cites Silverman IV.1–IV.2 for | |
| 76 | +the *next* row's result, the formal group law, not for the second logarithmic derivative. | |
| 77 | + | |
| 78 | +## Reproducing | |
| 79 | + | |
| 80 | +`python3 routes/p5-known-41-60/check.py` prints, for each of the twenty rows, the file, whether its | |
| 81 | +head states the row, the `New.*` names of the head with the lines that declare them, and whether the | |
| 82 | +row's "related work" agrees with the head. It ends with the list of rows whose file does not state | |
| 83 | +them. It reads `INDEX.md` and `src/` only. | |
| 84 | + | |
| 85 | +## What this note does not show | |
| 86 | + | |
| 87 | +It does not check any source against the literature: it compares each row with the head of its file, | |
| 88 | +and the heads' own claims about sources are taken as given. It does not read the proofs, and it says | |
| 89 | +nothing about whether any of these statements is true, or about the proof of the Riemann hypothesis — | |
| 90 | +the rows are results classed as known in the literature. It also does not check the other rows of | |
| 91 | +`INDEX.md`. | |
| 92 | + | |
| 93 | +## Next | |
| 94 | + | |
| 95 | +Rows 61 to 80 (`Lib/CM/Sigma` onwards) are unchecked. A second reader could decide whether rows 43 | |
| 96 | +and 58, which now both point at the same `GoodReduction` entry, should be one row, and whether the | |
| 97 | +empty cells of rows 52 and 59 should carry the sources their heads name. | |
+133 −0 routes/p5-known-41-60/check.py added View file
| @@ -0,0 +1,133 @@ | ||
| 1 | +"""Check the twenty rows of INDEX.md numbered 41 to 60 against the code. | |
| 2 | + | |
| 3 | +Run from the project root: python3 routes/p5-known-41-60/check.py | |
| 4 | + | |
| 5 | +The twenty rows are the twenty consecutive table rows of `INDEX.md` that start with the row | |
| 6 | +"Kronecker's first limit formula" (rows 41 to 60 of the index). For each row the script prints the | |
| 7 | +file named in the row, whether that file's head states the row's statement, the `New.*` names the | |
| 8 | +head introduces together with the line that declares them, and whether the "related work" column | |
| 9 | +agrees with the sources the head names. Nothing here reads the literature: the script compares | |
| 10 | +`INDEX.md` with the heads of the files and with the declarations. | |
| 11 | +""" | |
| 12 | + | |
| 13 | +import os | |
| 14 | +import re | |
| 15 | +import sys | |
| 16 | + | |
| 17 | +START = "Kronecker's first limit formula" | |
| 18 | +COUNT = 20 | |
| 19 | + | |
| 20 | + | |
| 21 | +def cells(line): | |
| 22 | + parts, cur, i = [], '', 0 | |
| 23 | + while i < len(line): | |
| 24 | + if line[i] == '\\' and i + 1 < len(line) and line[i + 1] == '|': | |
| 25 | + cur += '|' | |
| 26 | + i += 2 | |
| 27 | + continue | |
| 28 | + if line[i] == '|': | |
| 29 | + parts.append(cur) | |
| 30 | + cur = '' | |
| 31 | + i += 1 | |
| 32 | + continue | |
| 33 | + cur += line[i] | |
| 34 | + i += 1 | |
| 35 | + parts.append(cur) | |
| 36 | + return [p.strip() for p in parts[1:-1]] | |
| 37 | + | |
| 38 | + | |
| 39 | +def norm(s): | |
| 40 | + s = s.replace('**', '').replace('`', '').replace('\\|', '|') | |
| 41 | + return re.sub(r'\s+', ' ', s).strip() | |
| 42 | + | |
| 43 | + | |
| 44 | +def index_rows(path='INDEX.md'): | |
| 45 | + out = [] | |
| 46 | + for line in open(path, encoding='utf-8'): | |
| 47 | + if line.startswith('|'): | |
| 48 | + c = cells(line) | |
| 49 | + if len(c) == 4: | |
| 50 | + out.append(c) | |
| 51 | + return out | |
| 52 | + | |
| 53 | + | |
| 54 | +def head_of(rel): | |
| 55 | + text = open(f'src/{rel}.lean', encoding='utf-8').read() | |
| 56 | + m = re.search(r'/-!(.*?)-/', text, re.S) | |
| 57 | + return m.group(1) if m else '' | |
| 58 | + | |
| 59 | + | |
| 60 | +def decl_lines(rel, name): | |
| 61 | + tail = name.split('.')[-1] | |
| 62 | + pat = re.compile( | |
| 63 | + r'^\s*(?:@\[[^\]]*\]\s*)?(?:noncomputable\s+|private\s+|protected\s+)*' | |
| 64 | + r'(?:lemma|theorem|def|abbrev|structure|instance|class)\s+' | |
| 65 | + r'(?:[A-Za-z0-9_.\'₀-₉]*\.)?' + re.escape(tail) + r'\b') | |
| 66 | + return [k for k, line in enumerate(open(f'src/{rel}.lean', encoding='utf-8').read().split('\n'), 1) | |
| 67 | + if pat.match(line)] | |
| 68 | + | |
| 69 | + | |
| 70 | +def known_results(head): | |
| 71 | + """The head's `Known result:` paragraphs, each up to the next one.""" | |
| 72 | + parts = norm(head).split('Known result:') | |
| 73 | + return ['Known result:' + p.strip() for p in parts[1:]] | |
| 74 | + | |
| 75 | + | |
| 76 | +def nearest_known_result(head, desc): | |
| 77 | + """The `Known result:` paragraph of the head that shares most of the row's words.""" | |
| 78 | + words = [w for w in re.findall(r'[a-z]+', desc.lower()) if len(w) >= 4] | |
| 79 | + paras = known_results(head) | |
| 80 | + if not paras or not words: | |
| 81 | + return 'none' | |
| 82 | + | |
| 83 | + def coverage(p): | |
| 84 | + have = set(re.findall(r'[a-z]+', p.lower())) | |
| 85 | + return sum(1 for w in words if w in have) / len(words) | |
| 86 | + | |
| 87 | + best = max(paras, key=coverage) | |
| 88 | + return f'{coverage(best):.2f} of the row\'s words: {best[:220]}' | |
| 89 | + | |
| 90 | + | |
| 91 | +def main(): | |
| 92 | + rows = index_rows() | |
| 93 | + starts = [i for i, r in enumerate(rows) if norm(r[0]) == START] | |
| 94 | + if not starts: | |
| 95 | + print(f'no row reads {START!r}', file=sys.stderr) | |
| 96 | + return 1 | |
| 97 | + block = rows[starts[0]:starts[0] + COUNT] | |
| 98 | + print(f'rows 41 to 60 of INDEX.md: {len(block)} rows, starting at {START!r}\n') | |
| 99 | + bad = [] | |
| 100 | + for n, (desc, filecell, further, work) in enumerate(block, 41): | |
| 101 | + rel = filecell.strip('`') | |
| 102 | + head = head_of(rel) | |
| 103 | + stated = norm(desc).rstrip('.').lower() in norm(head).lower() | |
| 104 | + print(f'--- row {n}: {norm(desc)}') | |
| 105 | + print(f' file `{rel}` head states the row: {stated}') | |
| 106 | + for f in re.split(r',\s*', further.replace('`', '').strip()): | |
| 107 | + if f: | |
| 108 | + print(f' further file `{f}`: {os.path.exists("src/" + f + ".lean")}') | |
| 109 | + here, elsewhere = [], [] | |
| 110 | + for name in dict.fromkeys(re.findall(r'`(New\.[A-Za-z0-9_.\'₀-₉]*)`', head)): | |
| 111 | + (here if decl_lines(rel, name) else elsewhere).append( | |
| 112 | + f'{name} -> src/{rel}.lean:{decl_lines(rel, name)}' if decl_lines(rel, name) else name) | |
| 113 | + for line in here: | |
| 114 | + print(f' declared here: {line}') | |
| 115 | + if elsewhere: | |
| 116 | + print(f' named from other files: {", ".join(elsewhere)}') | |
| 117 | + if work: | |
| 118 | + missing = [f for f in re.split(r';', work) if norm(f)[:24].lower() not in norm(head).lower()] | |
| 119 | + print(' related work: ' + ('agrees with the head' if not missing | |
| 120 | + else 'not in the head: ' + ' | '.join(missing))) | |
| 121 | + else: | |
| 122 | + cited = [norm(c) for c in re.findall(r'(?:Source:|Sources:|Background:)\s*([^\n]+)', head)] | |
| 123 | + print(f' related work: empty in INDEX; the head cites: {cited if cited else "nothing"}') | |
| 124 | + if not stated: | |
| 125 | + bad.append(n) | |
| 126 | + nearest = nearest_known_result(head, norm(desc)) | |
| 127 | + print(f' nearest "Known result" of the head: {nearest}') | |
| 128 | + print(f'\nrows whose file does not state the row: {bad if bad else "none"}') | |
| 129 | + return 0 | |
| 130 | + | |
| 131 | + | |
| 132 | +if __name__ == '__main__': | |
| 133 | + sys.exit(main()) | |
+188 −0 routes/p6-glossary-rows-82-101/README.md added View file
| @@ -0,0 +1,188 @@ | ||
| 1 | +--- | |
| 2 | +issue: 7 | |
| 3 | +status: done | |
| 4 | +--- | |
| 5 | +# p6-glossary-rows-82-101 | |
| 6 | + | |
| 7 | +The second of the four units of #7: the glossary of GUIDE.md, rows 82–101 (`filling` to `polar`). | |
| 8 | +For each row I found the definitions and statements it names, read them, and compared their words | |
| 9 | +with the row. `check.py` reproduces the tables below from the source. | |
| 10 | + | |
| 11 | +```bash | |
| 12 | +python3 routes/p6-glossary-rows-82-101/check.py | |
| 13 | +``` | |
| 14 | + | |
| 15 | +It reads the twenty rows of `GUIDE.md`, takes the names of the `Lean` column, and looks each one up | |
| 16 | +under `src` — as a declaration, as a field of a structure, or as a name taken from a library by an | |
| 17 | +`open`/`export` line. A name written `D.…` is a field of the data `D : Data P`, so its declaration is | |
| 18 | +looked for in a file of `namespace New.Data`. The second table does the same for the names the rows | |
| 19 | +give in their third column instead, so that a name a row relies on is not left unchecked. | |
| 20 | + | |
| 21 | +## The names of the `Lean` column | |
| 22 | + | |
| 23 | +| row | name | found as | place | | |
| 24 | +|---|---|---|---| | |
| 25 | +| filling | `Filling` | declaration | `src/New/Spanning/Unfolding/Setup.lean:71` | | |
| 26 | +| filling | `D.isSpread_goodPoincare` | declaration | `src/New/Spanning/SecondMoment/SpanningTheorem.lean:340` | | |
| 27 | +| floor | `Shape.Form.floorGroup` | declaration | `src/Lib/DiscreteSeries/Bruhat/FloorGroups.lean:197` | | |
| 28 | +| exchange | `Exchange.exchange_identity` | declaration | `src/New/Determinant/Exchange/TheoremForPartners.lean:1084` | | |
| 29 | +| square | `Exchange.one_square_identity_of_isEdgeFamily` | declaration | `src/New/Determinant/Exchange/OneSquare.lean:1039` | | |
| 30 | +| grid, path, turn | `D.gridSpace` | declaration | `src/New/Determinant/AuxiliaryForms/PathData.lean:162` | | |
| 31 | +| grid, path, turn | `TwoGridPath` | declaration | `src/New/Determinant/AuxiliaryForms/GridPaths.lean:158` | | |
| 32 | +| grid, path, turn | `TwoGridPath.Turn` | declaration | `src/New/Determinant/AuxiliaryForms/GridPaths.lean:178` | | |
| 33 | +| auxiliary form | `D.IsAuxiliaryForm` | declaration | `src/New/Determinant/Twist/LongForms.lean:56` | | |
| 34 | +| descent pair | `DescentPair` | declaration | `src/New/UpperBound/Objects/AuxiliaryPair.lean:171` | | |
| 35 | +| false lift | `DescentPair.falseLiftsAt` | declaration | `src/New/OneLift/TestedForms.lean:367` | | |
| 36 | +| type | `typeKernel` | declaration | `src/Lib/Adelic/AutomorphicForms/Basic.lean:85` | | |
| 37 | +| type | `Space.IsForm` | declaration | `src/Lib/Adelic/AutomorphicForms/Basic.lean:143` | | |
| 38 | +| gauge | `weylGauge` | declaration | `src/Lib/Adelic/AutomorphicForms/SmoothAlgebraicForms.lean:134` | | |
| 39 | +| gauge | `GaugeLe` | declaration | `src/Lib/Adelic/AutomorphicForms/PAdicGauge.lean:181` | | |
| 40 | +| denominator, regular | `Selmer.DenominatorLe` | declaration | `src/New/OneLift/TestedForms.lean:407` | | |
| 41 | +| denominator, regular | `D.IsRegularFamily` | declaration | `src/New/Determinant/Twist/FitTwists.lean:237` | | |
| 42 | +| size | `D.jetSize` | declaration | `src/New/Reduction/Data/AdmissibleData.lean:277` | | |
| 43 | +| size | `LevelPlaces.LevelForm.normSqAt` | declaration | `src/Lib/Adelic/AutomorphicForms/PAdicGauge.lean:692` | | |
| 44 | +| pair, ramified pair, main pair | `D.CriticalPair` | declaration | `src/New/Derivatives/Field/ChosenPlaces.lean:282` | | |
| 45 | +| pair, ramified pair, main pair | `Data.CriticalPair.ratio` | declaration | `src/New/Determinant/Twist/FitTwists.lean:87` | | |
| 46 | +| normalisation | `D.invGainFactor` | declaration | `src/New/Reduction/ShortAndEnough.lean:63` | | |
| 47 | +| normalisation | `D.normalizedPoincare` | declaration | `src/New/Reduction/ShortAndEnough.lean:159` | | |
| 48 | +| determinant | `D.chainDeterminant` | declaration | `src/New/Determinant/Chain/NormOfChain.lean:114` | | |
| 49 | +| determinant | `D.liftDeterminant` | declaration | `src/New/Determinant/Chain/NormOfChain.lean:84` | | |
| 50 | +| composite lift, chain datum | `D.compositeLift` | declaration | `src/New/UpperBound/Objects/Columns.lean:1027` | | |
| 51 | +| composite lift, chain datum | `D.IsChainDatum` | declaration | `src/New/UpperBound/Objects/Columns.lean:995` | | |
| 52 | +| composite lift, chain datum | `D.restrictedChain` | declaration | `src/New/UpperBound/Objects/Columns.lean:918` | | |
| 53 | +| idle direction | `D.directionAmount` | declaration | `src/New/Reduction/Data/AdmissibleData.lean:282` | | |
| 54 | +| exceptional, marked | `D.IsExceptional` | declaration | `src/New/UpperBound/Size/ShortColumns.lean:135` | | |
| 55 | +| exceptional, marked | `D.IsMarked` | declaration | `src/New/UpperBound/Divisibility/MarkedPrimes.lean:63` | | |
| 56 | +| exceptional, marked | `D.IsFullMark` | declaration | `src/New/UpperBound/Divisibility/MarkedPrimes.lean:75` | | |
| 57 | +| stably unramified | `HasPrimitiveRoot5040` | declaration | `src/Lib/Adelic/Adeles/Basic.lean:461` | | |
| 58 | +| polar | `IsPolar` | declaration | `src/Lib/Analytic/EntireLFunction.lean:98` | | |
| 59 | + | |
| 60 | +## The names of the third column | |
| 61 | + | |
| 62 | +| row | name | found as | place | | |
| 63 | +|---|---|---|---| | |
| 64 | +| filling | `D.poincare` | declaration | `src/New/Spanning/Unfolding/SeriesPeriod.lean:737` | | |
| 65 | +| grid, path, turn | `D.exists_transfersPeriods_first_last` | declaration | `src/New/Determinant/AuxiliaryForms/DiagonalTurns.lean:651` | | |
| 66 | +| type | `HasParahoricType` | declaration | `src/Lib/GaloisRep/LocalGlobal/LocalFormTypes.lean:228` | | |
| 67 | +| gauge | `Floors.Gauge` | declaration | `src/New/Spanning/Frames/Correlations.lean:129` | | |
| 68 | +| gauge | `Filling.maxGauge` | declaration | `src/New/Spanning/RemainingTerms/BorderedDeterminant.lean:470` | | |
| 69 | +| denominator, regular | `D.HasDenominatorsLe` | declaration | `src/New/Determinant/Twist/FitTwists.lean:189` | | |
| 70 | +| denominator, regular | `D.HasSmallRatios` | declaration | `src/New/Determinant/Twist/FitTwists.lean:226` | | |
| 71 | +| normalisation | `D.allowedLoss` | declaration | `src/New/UpperBound/Size/Estimates.lean:289` | | |
| 72 | +| normalisation | `D.gainExponent` | declaration | `src/New/Reduction/ShortAndEnough.lean:59` | | |
| 73 | +| normalisation | `D.chosenGL` | declaration | `src/New/UpperBound/Objects/LabelsAndIndexTypes.lean:338` | | |
| 74 | +| normalisation | `D.poincare` | declaration | `src/New/Spanning/Unfolding/SeriesPeriod.lean:737` | | |
| 75 | +| composite lift, chain datum | `D.gluedTensor` | declaration | `src/New/UpperBound/Objects/Columns.lean:982` | | |
| 76 | +| composite lift, chain datum | `D.restrictToY` | declaration | `src/New/UpperBound/Objects/Columns.lean:805` | | |
| 77 | +| composite lift, chain datum | `D.IsChainDatum.exists_isWeakChainDatum_compositeLift_eq` | declaration | `src/New/UpperBound/Divisibility/ChainDatumExpansion.lean:364` | | |
| 78 | +| idle direction | `D.heightLe_liftDeterminant_ratio` | declaration | `src/New/OneLift/LiftVolumeHeight.lean:770` | | |
| 79 | + | |
| 80 | +## What I read in the words of each row | |
| 81 | + | |
| 82 | +Every one of the twenty rows is true of the code, and no row is missing the name of a declaration, | |
| 83 | +with the one exception corrected below. What follows is what each row's own words do and do not | |
| 84 | +show; the file and line of each declaration are in the tables. | |
| 85 | + | |
| 86 | +- **82 filling.** `Filling` is the data of the unfolding theorem (N = ππ̄, the primes p₀ and p₁ with | |
| 87 | + their chosen places, `deltaE`, the source level, a Bessel system at every infinite place). The row | |
| 88 | + says the Poincaré series are "translates of the Poincaré series of the Bessel functions", and | |
| 89 | + `D.poincare` is documented as exactly that: it sends a source form to the form on Y₀ representing | |
| 90 | + its Bessel period, "which for this choice is the Poincaré series of the Bessel function". | |
| 91 | +- **83 floor.** `floorGroup` is "the group `H_l` of the isometries that fix every basis vector of | |
| 92 | + floor below `l`"; the row's "the step of the tower fixing the first hyperbolic pairs" is that | |
| 93 | + group, the basis being numbered by the floor. | |
| 94 | +- **84 exchange.** The statement of `exchange_identity` fixes the words of the row one by one: `v` is | |
| 95 | + chosen first, then `x` (before 𝔪 and ν), and for every weight μ and every ν tame at (𝔪, χ) there is | |
| 96 | + c with `‖c‖² = C · lValueProd 𝔪.places ν e ≠ 0`, and the theta integral of `(x, Φ)` equals c times | |
| 97 | + the one of `(v, Ψ)` for matching forms. "Of Siegel–Weil type" is a description of the identity; the | |
| 98 | + source does not use that phrase. | |
| 99 | +- **85 square.** The statement gives C and κ, and for each i a c ≠ 0 with `‖c‖² = C · lValueProd` | |
| 100 | + and the two sums related by κ/c. So κ exists, and the code neither computes it nor shows it | |
| 101 | + nonzero — as the row says. | |
| 102 | +- **86 grid, path, turn.** The theorem `exists_transfersPeriods_first_last` moves *path data*, not | |
| 103 | + forms: for c ϑ ≠ 0 whose modulus is a constant times the product of the turn ratios and a power of | |
| 104 | + Nm Q, it carries Ψ′ on the first path to Ψ on the last, and multiplies the size bound by | |
| 105 | + `vectorCountBound ^ m^2`. The row's "the first path becomes the last by m² turns" is a compression | |
| 106 | + of that: m² is the number of turn ratios and the exponent of the bound, not a count of the steps | |
| 107 | + the proof takes. | |
| 108 | +- **87 auxiliary form.** The definition is the two conditions — `γ ϑ • Θ_ϑ y` integral away from | |
| 109 | + ℓ ∤ ϑ.normQ, and `Θ_1 y` of squared norm at every conjugate ≤ `exp (2 x₁² b²)`. "Completes a | |
| 110 | + family to a basis in the lower bound" is what the notion is for, not part of the definition; the | |
| 111 | + row is still true of the code. | |
| 112 | +- **88 descent pair.** `W` is the space that carries the signs and `FormV = I_{r+t}` is the standard | |
| 113 | + definite space (Rows.lean, the docstring of the j-th descent pair says "W = W_j of rank r, | |
| 114 | + V = I_{r+t}"), so "with V definite" is right, and `incl : r ↪ n` is the basis of W in that of V. | |
| 115 | +- **89 false lift.** The definition is `(e₀'s range) ⊓ (kernel of the Hecke polynomial of the split | |
| 116 | + place w at liftHeckeRoot) ⊓ Z`: the e₀-image killed at one root of the Hecke polynomial and inside | |
| 117 | + Z. "Orthogonal to the lifts" is how the users of it choose Z. | |
| 118 | +- **90 type.** `typeKernel` is the product of the discrete-series kernels at the finite places and | |
| 119 | + `Space.IsForm` is the space of forms whose type is the character e_λ; `HasParahoricType` is the | |
| 120 | + "local type" of the row. | |
| 121 | +- **91 gauge.** `weylGauge` and `GaugeLe` are the adelic gauge of a form, and gauge ≤ 1 is | |
| 122 | + integrality. "Unrelated" is right and worth saying: `Floors.Gauge` (a structure extending `Size` | |
| 123 | + in `namespace New.Floors`) and `Filling.maxGauge` are a different notion with the same word. | |
| 124 | +- **92 denominator, regular.** `DenominatorLe` bounds the denominators of the projections to Z "per | |
| 125 | + dimension and per row", and `IsRegularFamily` extends `HasSmallRatios`, whose docstring is almost | |
| 126 | + the row's words: the modulus of θι is prime to ℓ and, for 1 ≤ j ≤ m, the j-th powers and their | |
| 127 | + inverses have, for every ramified pair, inverse ratios of L-values of height at most x₁. | |
| 128 | +- **93 size.** `jetSize` is `log j! + j log (M/Ω)`. The row's reading of a size bound B is the | |
| 129 | + code's: the uses bound `(Θ 1 y).normSqAt σ` by `exp B` at every conjugate, or the Weyl norm of a | |
| 130 | + form at every point; the two are the same statement in the two places the code writes it. | |
| 131 | +- **94 pair.** `CriticalPair` is the integer z with 1 ≤ z ≤ t and the character ν of weight −c with | |
| 132 | + z ≤ c(v) ≤ 4b; `ratio` is the ratio of the two L-values with the Euler factors omitted exactly as | |
| 133 | + the row says; `IsRamified` is "exactly at the chosen places"; `IsMainPair` has `z ∈ Ioc D.m D.r` | |
| 134 | + ("m < z ≤ r") and a weight between `w_j + r − t` and `w_j`, "near κ_j". | |
| 135 | +- **95 normalisation.** `invGainFactor` is `∏ ℓ^(−g_ℓ)` over the small non-split primes *and* the | |
| 136 | + level N, and `normalizedPoincare` is documented as "the translate `s 𝔭` of | |
| 137 | + `𝔭 = c_B c_ss⁻¹ #Ḡ · e₀ 𝒫`", which is the row's formula word for word. This is the one row I | |
| 138 | + changed; see below. | |
| 139 | +- **96 determinant.** `liftDeterminant ϑ j` is `(u*u).det` for the lift at j taken from ϑ^j, and | |
| 140 | + `chainDeterminant ϑ` the same for the chain on the target forms — the row's two cases. | |
| 141 | +- **97 composite lift, chain datum.** `IsChainDatum` is the integrality and size of the coefficients | |
| 142 | + — zero outside ℓ ∤ Mq, inside the admissible translations, integral away from q with denominator 1, | |
| 143 | + and bounded by `M^(3 f m n_m²)` only when ϑ.Q is empty — which is the row's clause. The composite | |
| 144 | + lift glues the tensor in pairs of lifts, restricts to Y_m and multiplies by the product of powers | |
| 145 | + of the conjugates of π̄_N, as the row says, and the expansion in translates of the vacuum is the | |
| 146 | + theorem that a chain datum has a weak chain datum with the same composite lift. | |
| 147 | +- **98 idle direction.** `directionAmount` is `∑_σ (s_∞(κ(σ)) − s_fin(κ(σ), σ))`, the size of a jet | |
| 148 | + less its guaranteed divisibility, and the height theorem bounds `Z_j(1)/Z_j(ξ_ι^j)` by | |
| 149 | + `d · k · (log b · denominatorBudget − directionAmount)`. The row's "about k" is the one hedge I | |
| 150 | + left: the theorem charges exactly `D.k` directions, and `D.k = r + 1 − m`. | |
| 151 | +- **99 exceptional, marked.** `IsExceptional` is χ_K(p) = −1, p not ±1 mod the lifts, `o₀` odd and | |
| 152 | + ≤ `ceilLogLifts`, the least 𝔯 with `m ≤ p^𝔯`; so `o₀ ≤ ceilLogLifts` is "p^(e−1) < m". `IsMarked` | |
| 153 | + is the set Λ disjoint from its conjugate, each prime ideal induced from an a-place, of an | |
| 154 | + exceptional p < x₁; `IsFullMark` adds that each a-place or its conjugate is induced. | |
| 155 | +- **100 stably unramified.** The class `HasPrimitiveRoot5040` is a field containing a primitive | |
| 156 | + 5040-th root of unity, and its docstring says "In the comments such a field E is called stably | |
| 157 | + unramified" — the row's words are the code's. | |
| 158 | +- **101 polar.** `IsPolar` states the meromorphic continuation to re s > 0, the existence of the | |
| 159 | + Laplace transform for re s > 2, poles of order at most one, and the residues r ρ. The row's | |
| 160 | + "E = O(e^v)" is *not* a field of the definition: it is the hypothesis of the lemmas that integrate | |
| 161 | + `E(v) e^{(1−s)v}` (`integrableOn_laplace_of_abs_le`, `src/Lib/Analytic/EntireLFunction.lean:110`), | |
| 162 | + which the definition assumes rather than states. I left the row as it is, since it describes the | |
| 163 | + class of functions the word is used for, and noted it here. | |
| 164 | + | |
| 165 | +## What I changed | |
| 166 | + | |
| 167 | +One line of `GUIDE.md`. Row 95 said `g_ℓ = ⌊gain − error⌋`, and "error" is the guide's name for | |
| 168 | +`D.errorUnit`, the unit `f · a · (log b)³` of row 71 and of the table of sizes — while the code | |
| 169 | +subtracts `D.allowedLoss` (`src/New/UpperBound/Size/Estimates.lean:289`: twice `D.loss p` at a | |
| 170 | +non-split prime p < x₁, twice `m f b` at the level N, and 0 elsewhere). The row now writes | |
| 171 | +`g_ℓ = ⌊gain − D.allowedLoss⌋`, which is both what `D.gainExponent` does and the name the row was | |
| 172 | +missing. | |
| 173 | + | |
| 174 | +## What this does not show | |
| 175 | + | |
| 176 | +As #7 says, nothing here shows whether these sizes suit the argument. I read definitions, | |
| 177 | +statements and their docstrings, not proofs: a row can be true of a definition whose uses are not | |
| 178 | +what the row implies. Two names are not in `src` and I could not compare them beyond what the code | |
| 179 | +says: `HeightLe` is Tau Ceti's, taken by `export` (`src/New/Reduction/Lattices/Heights.lean:50`), | |
| 180 | +and `MvPolynomial.jetPairing` is in the library's `MvPolynomial` namespace, which is not in this | |
| 181 | +checkout, so its statement is unchecked; the project's uses of it are. Nothing here says the proof | |
| 182 | +is right or wrong. | |
| 183 | + | |
| 184 | +## Next | |
| 185 | + | |
| 186 | +The third unit is rows 102–107 of the glossary, then the table of sizes in section 3 (which the | |
| 187 | +issue keeps as a fourth unit); both are the same reading, and `check.py` takes the range of rows in | |
| 188 | +`FIRST` and `LAST` at the top. | |
+199 −0 routes/p6-glossary-rows-82-101/check.py added View file
| @@ -0,0 +1,199 @@ | ||
| 1 | +#!/usr/bin/env python3 | |
| 2 | +"""Check that the names in GUIDE.md's glossary rows 82-101 exist in the Lean source. | |
| 3 | + | |
| 4 | +Run from the project root: python3 routes/p6-glossary-rows-82-101/check.py | |
| 5 | + | |
| 6 | +The script reads the twenty rows of the glossary (GUIDE.md lines 82-101), takes the names in the | |
| 7 | +`Lean` column, and looks each one up under `src`. A name is found as a declaration | |
| 8 | +(`def`, `lemma`, `theorem`, `abbrev`, `structure`, `class`, `inductive`, `instance`), as a field of | |
| 9 | +a structure (`bPlaces : Finset ...`), or as a name taken from a library by an `open`/`export` line. | |
| 10 | + | |
| 11 | +A name whose prefix is `D.` is a field of the data `D : Data P`, so its declaration is looked for | |
| 12 | +in a file that opens `namespace New.Data` (or, for the names of the files outside it, another `New` | |
| 13 | +namespace); this keeps `D.gain` from matching another `gain`. | |
| 14 | + | |
| 15 | +Some rows name further declarations in their third column rather than in the `Lean` column (for | |
| 16 | +example `D.HasSmallRatios` and `Floors.Gauge`). The second table lists those that look like Lean | |
| 17 | +names, with the same lookup, so that a name the row relies on is not left unchecked. | |
| 18 | + | |
| 19 | +The output is the audit table of `routes/p6-glossary-rows-82-101/README.md`. | |
| 20 | +""" | |
| 21 | + | |
| 22 | +import re | |
| 23 | +import subprocess | |
| 24 | +import sys | |
| 25 | + | |
| 26 | +sys.stdout.reconfigure(encoding="utf-8") | |
| 27 | + | |
| 28 | +GUIDE = "GUIDE.md" | |
| 29 | +FIRST, LAST = 82, 101 | |
| 30 | +SP = "[[:space:]]" | |
| 31 | +DECL = (f"({SP}*noncomputable{SP}+)?({SP}*protected{SP}+)?" | |
| 32 | + "(theorem|lemma|def|abbrev|structure|class|inductive|instance)") | |
| 33 | +SP_RE = r"\s" | |
| 34 | +DECL_RE = (f"({SP_RE}*noncomputable{SP_RE}+)?({SP_RE}*protected{SP_RE}+)?" | |
| 35 | + "(theorem|lemma|def|abbrev|structure|class|inductive|instance)") | |
| 36 | +TAIL_RE = r"(\s|:|\(|\[|\{|\$)" | |
| 37 | +SPLIT = re.compile(r"(?<!\\)\|") | |
| 38 | +BACKTICKED = re.compile(r"`([^`]+)`") | |
| 39 | +# A backticked token of the third column that looks like a Lean name: dotted, or CamelCase. | |
| 40 | +LEAN_LIKE = re.compile(r"^([A-Za-z][A-Za-z0-9_']*(\.[A-Za-z0-9_']+)+|[A-Z][a-z0-9]*[A-Z][A-Za-z0-9]*)$") | |
| 41 | + | |
| 42 | +_namespace_cache = {} | |
| 43 | + | |
| 44 | + | |
| 45 | +def norm(s): | |
| 46 | + return " ".join(s.replace("`", "").split()) | |
| 47 | + | |
| 48 | + | |
| 49 | +def guide_rows(): | |
| 50 | + text = open(GUIDE, encoding="utf-8").read().split("\n") | |
| 51 | + rows = [] | |
| 52 | + for line in text[FIRST - 1:LAST]: | |
| 53 | + cells = SPLIT.split(line) | |
| 54 | + if len(cells) < 4: | |
| 55 | + continue | |
| 56 | + # The third column keeps its backticks: the second table reads the names in it. | |
| 57 | + rows.append((norm(cells[1]), norm(cells[2]), cells[3])) | |
| 58 | + return rows | |
| 59 | + | |
| 60 | + | |
| 61 | +def names_in(ax): | |
| 62 | + """The names of the `Lean` column: backticked, and split on commas.""" | |
| 63 | + return [n.strip() for n in ax.replace("`", "").split(",") if n.strip()] | |
| 64 | + | |
| 65 | + | |
| 66 | +def last(name): | |
| 67 | + return name.split(".")[-1] | |
| 68 | + | |
| 69 | + | |
| 70 | +def grep(pattern, path="src"): | |
| 71 | + """`git grep -n -E` with a POSIX ERE pattern; returns matching lines.""" | |
| 72 | + r = subprocess.run(["git", "grep", "-n", "-E", "--", pattern, "--", path], | |
| 73 | + capture_output=True, text=True, encoding="utf-8") | |
| 74 | + if r.returncode not in (0, 1): | |
| 75 | + raise SystemExit(f"git grep failed on {pattern!r}: {r.stderr.strip()}") | |
| 76 | + return [l for l in r.stdout.splitlines() if l.strip()] | |
| 77 | + | |
| 78 | + | |
| 79 | +def where(line): | |
| 80 | + """`src/a/b.lean:123:...` -> `src/a/b.lean:123`.""" | |
| 81 | + return ":".join(line.split(":")[:2]) | |
| 82 | + | |
| 83 | + | |
| 84 | +def has_namespace(path, ns): | |
| 85 | + key = (path, ns) | |
| 86 | + if key not in _namespace_cache: | |
| 87 | + r = subprocess.run(["git", "grep", "-n", "-F", "--", f"namespace {ns}", "--", path], | |
| 88 | + capture_output=True, text=True, encoding="utf-8") | |
| 89 | + _namespace_cache[key] = bool(r.stdout.strip()) | |
| 90 | + return _namespace_cache[key] | |
| 91 | + | |
| 92 | + | |
| 93 | +def find(name): | |
| 94 | + """Return (kind, place) for a name, or (None, None). | |
| 95 | + | |
| 96 | + The patterns are POSIX ERE, as `git grep -E` takes them: no non-capturing groups, and | |
| 97 | + `[[:space:]]` for whitespace. | |
| 98 | + """ | |
| 99 | + leaf = last(name) | |
| 100 | + prefix = name[: -len(leaf)] # "D." / "Selmer." / "Space." / "" | |
| 101 | + tail = rf"({SP}|:|\(|\[|\{{|$)" | |
| 102 | + # 1. A declaration of the whole name, as written (`def Space.lift`). | |
| 103 | + if prefix: | |
| 104 | + hits = grep(rf"(^|[^A-Za-z0-9_.']){DECL}{SP}+{re.escape(prefix)}{re.escape(leaf)}{tail}") | |
| 105 | + if hits: | |
| 106 | + return "declaration", where(hits[0]) | |
| 107 | + # 2. A declaration of the leaf, with an optional dotted prefix (`structure PlaceData.IsCut`). | |
| 108 | + # The prefix it is declared under must end the prefix the row writes, so that `D.restrictToY` | |
| 109 | + # does not take `GaugeLe.restrictToY` for its declaration. | |
| 110 | + hits = grep(rf"(^|[^A-Za-z0-9_.']){DECL}{SP}+([A-Za-z0-9_']+\.)*{re.escape(leaf)}{tail}") | |
| 111 | + declared = re.compile(rf"{DECL_RE}{SP_RE}+((?:[A-Za-z0-9_']+\.)*){re.escape(leaf)}{TAIL_RE}") | |
| 112 | + | |
| 113 | + def under_the_prefix(line): | |
| 114 | + """Whether the declaration is written under the prefix the row gives. | |
| 115 | + | |
| 116 | + The declared prefix may be fuller (`def _root_.New.Selmer.DenominatorLe` for | |
| 117 | + `Selmer.DenominatorLe`) or shorter (`structure PlaceData.IsCut` for `Floors.PlaceData.IsCut`), | |
| 118 | + so either may end the other; but `GaugeLe.restrictToY` is no declaration of `D.restrictToY`. | |
| 119 | + """ | |
| 120 | + m = declared.search(line) | |
| 121 | + if m is None: | |
| 122 | + return True | |
| 123 | + dp = (m.group(4) or "").removeprefix("_root_.") | |
| 124 | + if not prefix.startswith("New.") and dp.startswith("New."): | |
| 125 | + dp = dp[len("New."):] | |
| 126 | + return prefix.endswith(dp) or dp.endswith(prefix) | |
| 127 | + | |
| 128 | + hits = [h for h in hits if under_the_prefix(h)] | |
| 129 | + if prefix == "D.": | |
| 130 | + # `D` is the data, so the declaration is in a file of `namespace New.Data`, or, for the | |
| 131 | + # names of the files outside it, of another `New` namespace. | |
| 132 | + hits = ([h for h in hits if has_namespace(h.split(":")[0], "New.Data")] | |
| 133 | + or [h for h in hits if has_namespace(h.split(":")[0], "New")] | |
| 134 | + or hits) | |
| 135 | + if hits: | |
| 136 | + return "declaration", where(hits[0]) | |
| 137 | + # 3. A field of a structure: `bPlaces : Finset (P.Φ towerExp)` on a line of its own. | |
| 138 | + hits = grep(rf"^{SP}+{re.escape(leaf)}{SP}*:") | |
| 139 | + if hits: | |
| 140 | + return "field", where(hits[0]) | |
| 141 | + # 4. A name taken from a library, by `open X (name ...)` or `export X (name ...)`. | |
| 142 | + hits = grep(rf"(open|export){SP}+[A-Za-z0-9_.']+{SP}+\([^)]*{re.escape(leaf)}") | |
| 143 | + if hits: | |
| 144 | + return "from a library (open/export)", where(hits[0]) | |
| 145 | + return None, None | |
| 146 | + | |
| 147 | + | |
| 148 | +def main(): | |
| 149 | + rows = guide_rows() | |
| 150 | + bad = [] | |
| 151 | + total = 0 | |
| 152 | + print("| row | name | found as | place |") | |
| 153 | + print("|---|---|---|---|") | |
| 154 | + for label, ax, _meaning in rows: | |
| 155 | + for n in names_in(ax): | |
| 156 | + total += 1 | |
| 157 | + kind, place = find(n) | |
| 158 | + if kind is None: | |
| 159 | + bad.append((label, n)) | |
| 160 | + print(f"| {label} | `{n}` | **not found** | |") | |
| 161 | + else: | |
| 162 | + print(f"| {label} | `{n}` | {kind} | `{place}` |") | |
| 163 | + print() | |
| 164 | + print(f"rows: {len(rows)}; names: {total}; not found: {len(bad)}") | |
| 165 | + for label, n in bad: | |
| 166 | + print(f" not found: {label}: `{n}`") | |
| 167 | + | |
| 168 | + print() | |
| 169 | + print("Names of the third column that look like Lean names:") | |
| 170 | + print() | |
| 171 | + print("| row | name | found as | place |") | |
| 172 | + print("|---|---|---|---|") | |
| 173 | + extra = 0 | |
| 174 | + for label, ax, meaning in rows: | |
| 175 | + seen = set(names_in(ax)) | |
| 176 | + for n in BACKTICKED.findall(meaning): | |
| 177 | + n = n.strip() | |
| 178 | + if n in seen or not LEAN_LIKE.match(n): | |
| 179 | + continue | |
| 180 | + seen.add(n) | |
| 181 | + extra += 1 | |
| 182 | + kind, place = find(n) | |
| 183 | + if kind is None: | |
| 184 | + bad.append((label, n)) | |
| 185 | + print(f"| {label} | `{n}` | **not found** | |") | |
| 186 | + else: | |
| 187 | + print(f"| {label} | `{n}` | {kind} | `{place}` |") | |
| 188 | + print() | |
| 189 | + print(f"names of the third column: {extra}; not found: {len(bad)}") | |
| 190 | + for label, n in bad: | |
| 191 | + print(f" not found: {label}: `{n}`") | |
| 192 | + return 0 if not bad else 1 | |
| 193 | + | |
| 194 | + | |
| 195 | +if __name__ == "__main__": | |
| 196 | + sys.exit(main()) | |
| 197 | + | |
| 198 | + | |
| 199 | + | |