goldbach-spectral-bridge
Li and Liu's GRH + S ⇒ Goldbach in Lean, checked against the paper by Comparator: clean it up together, and settle S
Bring the check, the baseline search and what is known
Browse files a1-audit a10-audit a11-audit a2-audit a3-audit a5-audit a5b-trace-transfer a6-audit a7-audit a8-audit a9-audit codex-a4-meng-interval-audit d1-delete-dead-decls l1b-status-table little-fish/s1-monotone-in-h m1-mathlib-lemma-shumo main maintainer-statement maintainer-statement-1203 maintainer-statement-v5 p1-proofs-unused-hypotheses-shumo p1-reproduce-96 p2-paper-to-lean-guide p3-page-check p4-guide-checker p4-negative-fixture s2-pn-dn-shumo s2-tn-bound-shumo s3-average-n-shumo shumo-codex/review-pr41 shumo-codex/review-pr41-pin v5-pdf-statements v8-inventory-subsections
+14 −2 .gitignore View file
| @@ -1,6 +1,18 @@ | ||
| 1 | 1 | .lake/ |
| 2 | 2 | *.olean |
| 3 | 3 | *.ilean |
| 4 | -*.trace | |
| 5 | -node_modules/ | |
| 6 | 4 | __pycache__/ |
| 5 | +.venv/ | |
| 6 | +metrics.json | |
| 7 | +examples/*/metrics.json | |
| 8 | +routes/*/metrics.json | |
| 9 | +*.aux | |
| 10 | +*.log | |
| 11 | +*.out | |
| 12 | +# a route's logs are evidence its piece asks for (build logs and their hashes, a reproduction's output): kept | |
| 13 | +!routes/**/*.log | |
| 14 | +!routes/**/*.out | |
| 15 | +.DS_Store | |
| 16 | + | |
| 17 | +# check outputs | |
| 18 | +*-metrics.json | |
+144 −0 AGENTS.md added View file
| @@ -0,0 +1,144 @@ | ||
| 1 | +# AGENTS.md | |
| 2 | + | |
| 3 | +Read [README.md](README.md) first, then `KNOWN.md`. `main` is Ziyu Zhou's Lean library of Li and Liu's reduction, and | |
| 4 | +what we want is a proof that people can read, and the open statements of `Open.lean` settled. A change that makes the | |
| 5 | +code shorter or faster but harder to read is not welcome. Goldbach's conjecture is open, and S with it: never describe | |
| 6 | +a change here as progress on Goldbach unless it proves an open statement, and then say exactly which. | |
| 7 | + | |
| 8 | +## First session | |
| 9 | + | |
| 10 | +```bash | |
| 11 | +python3 checks/challenge.py . # last line: ok: 6 challenge files and the build configuration as approved; … | |
| 12 | +git fetch origin issues && git show origin/issues:BOARD.md # who works on what | |
| 13 | +``` | |
| 14 | + | |
| 15 | +Pick one issue. Each says which files it touches and how to tell it is done. If you have agent time and no change in | |
| 16 | +mind, take **P-1** (linter warnings in one folder), **M-1** (one of our lemmas that Mathlib has), **S-1** (S is | |
| 17 | +monotone in the weight) or **V-4** (rebuild and run Comparator). What counts as progress here is what `build` | |
| 18 | +verifies; the reviews and research below keep the record honest and close on their readers. | |
| 19 | + | |
| 20 | +## Reviews and research | |
| 21 | + | |
| 22 | +These change no Lean file and are judged by people and other agents, not by `build`: | |
| 23 | + | |
| 24 | +- **Audits (A-1…A-10)**: one claim made elsewhere since 2026-11-20 each. Write `routes/<your-branch>/AUDIT.md`: the | |
| 25 | + claim and its pin, what you rebuilt or read (commands, versions and hashes, or pages), and its state with the | |
| 26 | + evidence: machine-checked only, claimed, refuted, or statement wrong. A second party reproduces it in a review. | |
| 27 | +- **The status table (L-1)** in the root README, and **research on S (S-2, S-3)** and **¬R read as mathematics | |
| 28 | + (V-6)**: a note in your route; S-2, S-3 and V-6 close when two readers who know the area accept it. | |
| 29 | + | |
| 30 | +## Claim an issue | |
| 31 | + | |
| 32 | +Work on a branch of your own, and say what you take in its notes: | |
| 33 | + | |
| 34 | +```bash | |
| 35 | +git switch -c my-change origin/main | |
| 36 | +mkdir -p routes/my-change | |
| 37 | +cat > routes/my-change/README.md <<'EOF' | |
| 38 | +--- | |
| 39 | +issue: 3 | |
| 40 | +status: working | |
| 41 | +--- | |
| 42 | +# my-change | |
| 43 | + | |
| 44 | +Which files, and what I change in them. | |
| 45 | + | |
| 46 | +## Next | |
| 47 | + | |
| 48 | +The first concrete step. | |
| 49 | +EOF | |
| 50 | +``` | |
| 51 | + | |
| 52 | +A push keeps the claim alive. If you stop, leave `## Next` so whoever continues knows where you stopped. Your change | |
| 53 | +itself is in the Lean files, anywhere in the repository; the notes say what it is. | |
| 54 | + | |
| 55 | +## Changes we want | |
| 56 | + | |
| 57 | +- A proof of one of the open statements of `Open.lean`, in a file of its own, sorry-free. | |
| 58 | +- Using a result from Mathlib in place of our own proof of it, and deleting ours. Check that the | |
| 59 | + statements agree, hypotheses included. If the library states it in another form, keep our lemma as a short wrapper | |
| 60 | + rather than adding a conversion at every caller. | |
| 61 | +- Deleting declarations that nothing uses. | |
| 62 | +- Proving once, as a lemma, an argument that appears several times, and using it everywhere. | |
| 63 | +- Splitting a long proof into lemmas with names and docstrings. A comment that explains a step moves with it. | |
| 64 | +- 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 | |
| 65 | + old one. | |
| 66 | +- Fixing linter warnings, wrong docstrings and open issues. A docstring says what its declaration states, including | |
| 67 | + both directions of an `iff`. | |
| 68 | + | |
| 69 | +## Changes we don't want | |
| 70 | + | |
| 71 | +- Inlining a lemma into its only caller, or folding helper lemmas or named `have` steps into one long proof. A step | |
| 72 | + with a name still tells the reader what it proves. | |
| 73 | +- Cutting an `iff` down to one direction, or dropping conclusions from a lemma, because no caller needs them. | |
| 74 | +- Replacing `simp` with a long `simp only [...]` list, or expanding a tactic into many hand-written steps, to save a | |
| 75 | + second or a few lines. | |
| 76 | +- A `simp` or other flexible tactic followed by steps that depend on the exact form it leaves. Make it the last step, | |
| 77 | + or use `simp only`. | |
| 78 | +- A new or wider `seal` without a timing that shows it is needed. | |
| 79 | +- Adding or changing a reference to the literature without checking it against the source. Say which edition you | |
| 80 | + checked and give the theorem number. | |
| 81 | +- Any change to the challenge (`Challenge.lean`, `Reference14.lean`, `Reference57.lean`, `ReferenceAB.lean`), | |
| 82 | + `comparator.json`, `Open.lean` or `checks/`: the `challenge` check fails it, as it fails a change to `lakefile.toml` beyond a | |
| 83 | + `require`'s `rev`, `leanOptions`, `defaultTargets`, `lean_exe` or `[cache]`, a dependency outside leanprover and | |
| 84 | + leanprover-community (goldbach-lean and LeanArchitect excepted), a `lakefile.lean`, or files under `.lake/`. | |
| 85 | + If you think a statement is wrong, open an issue titled "Ruling: …" and say why. | |
| 86 | + | |
| 87 | +## Pull requests | |
| 88 | + | |
| 89 | +Keep each pull request to one change; fixing linter warnings in the files you edit doesn't count as a second one. Check | |
| 90 | +that it compiles (`lake exe cache get`, then `lake build`) before you open it, but don't write in it that it builds: | |
| 91 | +the `build` check says that. Titles follow [Mathlib's convention](https://leanprover-community.github.io/contribute/commit.html). | |
| 92 | +In the description, name the issue it answers (`Closes #3`), say in two or three sentences what the change does and why | |
| 93 | +it makes the proof easier to read, and keep the title and description in step with the diff when you push more | |
| 94 | +commits. Leave out timings and heartbeat counts unless speed is the reason for the change; then give the few numbers a | |
| 95 | +maintainer needs to decide, per declaration where you can, and say how you measured them. | |
| 96 | + | |
| 97 | +If you want to make the same kind of change in many places, open one pull request first and wait for the maintainer to | |
| 98 | +say we want it before you open the others. | |
| 99 | + | |
| 100 | +## CI | |
| 101 | + | |
| 102 | +Two checks run on every push that changes a Lean file or the build's files (`lakefile.toml`, `lake-manifest.json`, | |
| 103 | +`lean-toolchain`; for `challenge` also `comparator.json` and `.lake/`), like upstream's GitHub CI, and both gate the | |
| 104 | +merge. A push of notes, an audit or a job's output alone keeps the verdicts of the commit it builds on, at once. Their | |
| 105 | +code is `checks/` at the approved version, so editing it on your branch changes nothing about your verdict. `build` | |
| 106 | +takes about eight minutes and queues behind others' builds: wait for it with `shoal wait`, and do not push again to | |
| 107 | +hurry it (each push is built anew). | |
| 108 | + | |
| 109 | +- **`challenge`** (upstream's `challenge-files.yml`), seconds: the Comparator challenge files and the build | |
| 110 | + configuration are as approved, and the source has no `sorry`, `admit`, `axiom`, `native_decide`, `implemented_by` or | |
| 111 | + `extern`. Run it yourself: `python3 checks/challenge.py .` | |
| 112 | +- **`build`** (upstream's `build.yml`), about eight minutes on a change of a few files (up to hours if it rebuilds much): in the project's Lean image with no network, `lake build` ends | |
| 113 | + without error, no module reports `sorry`, the theorems use no axiom beyond `propext`, `Classical.choice` and | |
| 114 | + `Quot.sound`, and Comparator accepts the solution. Its last line says what held or what did not; its logs are kept | |
| 115 | + with the job. Before you push, the same locally: `lake exe cache get && lake build`, then `lake comparator --config comparator.json`. | |
| 116 | + | |
| 117 | +A toolchain or Mathlib bump passes `challenge`, but `build` needs a new image first (`docker/README.md`): open an issue | |
| 118 | +for a person who maintains the project rather than a pull request that cannot pass. | |
| 119 | + | |
| 120 | +## For the maintainer | |
| 121 | + | |
| 122 | +The site reads each pull request within minutes of a push; the house's maintainer agent (`shoal-maintainer`) comes | |
| 123 | +every two hours, and within minutes when someone writes to it, to rebuild what is claimed, answer questions and keep | |
| 124 | +"Where it stands" current; a person decides what it leaves to a person. | |
| 125 | + | |
| 126 | +Judge every pull request against the two lists above: whether the proof is easier to read after it, not only whether | |
| 127 | +it is shorter or faster. | |
| 128 | + | |
| 129 | +- **Merge** a change we want once `challenge` and `build` have passed on its head, and the description says what it | |
| 130 | + changes and why. | |
| 131 | +- **Escalate** a claimed proof of an open statement, even with both checks green: a person adds it to the Comparator | |
| 132 | + challenge, and Goldbach's status is a person's word. | |
| 133 | +- **Request changes** when the description and the diff disagree, when it is two changes in one, when it is on the | |
| 134 | + second list (say which item), or when a reference is added without the edition and theorem number. | |
| 135 | +- **Request changes** when `challenge` or `build` failed: quote the check's last line. | |
| 136 | +- **Escalate** a change to the challenge files, to `checks/` or `docker/`, to `lakefile.toml`'s libraries or dependencies, a new | |
| 137 | + dependency, or two reviews that disagree: say in one sentence what a person must decide. | |
| 138 | +- **Close** a repeat of a change already merged or open, pointing to it, and a mass change opened before the first of | |
| 139 | + its kind was wanted. | |
| 140 | +- **An audit or a research note** (A-n, L-1, S-2, S-3, V-6) changes no Lean file: merge it when its note says what its | |
| 141 | + piece asks and a second party has reproduced or read it in a review; it never claims more than its evidence. | |
| 142 | + | |
| 143 | +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 | |
| 144 | +from a library, which one. | |
+42 −0 Open.lean added View file
| @@ -0,0 +1,42 @@ | ||
| 1 | +import ConditionalGoldbach.Definitions.Characters | |
| 2 | +import ConditionalGoldbach.Definitions.Hypotheses | |
| 3 | + | |
| 4 | +/-! | |
| 5 | +# Open statements | |
| 6 | + | |
| 7 | +The questions this project leaves open, each stated with `sorry`. Do not edit this file: it is frozen, and the | |
| 8 | +`challenge` check fails a commit that changes it. Prove one in a file of your own (`Open/<Name>.lean`) that imports | |
| 9 | +this one and states the same proposition under another name; a person who maintains the project then adds it to the | |
| 10 | +Comparator challenge. | |
| 11 | + | |
| 12 | +They are the open targets of this project before 2026-12 (`targets/` then), unchanged. | |
| 13 | +-/ | |
| 14 | + | |
| 15 | +namespace ConditionalGoldbach | |
| 16 | + | |
| 17 | +/-- Hypothesis S (the paper's H) for the explicit admissible weight `h(N) = log N`. -/ | |
| 18 | +theorem hypothesisH_log : HypothesisS (fun N : ℕ => Real.log (N : ℝ)) := by | |
| 19 | + sorry | |
| 20 | + | |
| 21 | +/-- The same, refuted. -/ | |
| 22 | +theorem not_h_log : ¬ HypothesisS (fun N : ℕ => Real.log (N : ℝ)) := by | |
| 23 | + sorry | |
| 24 | + | |
| 25 | +/-- Hypothesis S holds for some admissible weight. -/ | |
| 26 | +theorem some_s : ∃ h, HypothesisS h := by | |
| 27 | + sorry | |
| 28 | + | |
| 29 | +/-- Hypothesis S holds for no weight. -/ | |
| 30 | +theorem no_s : ¬ ∃ h, HypothesisS h := by | |
| 31 | + sorry | |
| 32 | + | |
| 33 | +/-- S is monotone in the weight: a smaller admissible weight inherits it. -/ | |
| 34 | +theorem s_monotone : | |
| 35 | + ∀ h h' : ℕ → ℝ, HypothesisS h → IsAdmissible h' → EvenEventually (fun N => h' N ≤ h N) → HypothesisS h' := by | |
| 36 | + sorry | |
| 37 | + | |
| 38 | +/-- Hypothesis R is false under GRH (claimed by Leiming Fu, 2026-11-26, in another repository). -/ | |
| 39 | +theorem not_hypothesisR (hGRH : ∀ N, GRH N) : ¬ HypothesisR := by | |
| 40 | + sorry | |
| 41 | + | |
| 42 | +end ConditionalGoldbach | |
+190 −338 README.md View file
| @@ -1,357 +1,209 @@ | ||
| 1 | -# Conditional Goldbach: proof library | |
| 1 | +# goldbach-spectral-bridge | |
| 2 | 2 | |
| 3 | -[Chinese](README.zh.md) · [Proof explorer](progress.html) · [Axiom ledger](proof-status.json) | |
| 3 | +A community effort to clean up and maintain the Lean proof of Li and Liu's reduction of binary Goldbach to GRH and a | |
| 4 | +spectral hypothesis S, and to settle S in Lean. | |
| 4 | 5 | |
| 5 | -Lean 4 proofs of the reviewed Li–Liu statements, including the analytic, Hardy-space, operator, and spectral constructions. The main theorems give asymptotics for sufficiently large even integers under GRH and spectral condition S or R, with the original quantifier order and constant dependencies. | |
| 6 | +> **Status, 2026-12-01.** GRH plus hypothesis **S** implies Goldbach for every sufficiently large even number, and that | |
| 7 | +> chain is proved in Lean and checked against the paper's statements by Comparator. The stronger hypothesis **R** has | |
| 8 | +> been refuted in Lean elsewhere (not yet reviewed). **S** is open. Nothing here claims that Goldbach's conjecture is | |
| 9 | +> proved. | |
| 6 | 10 | |
| 7 | -## Current status | |
| 11 | +The purpose of this project is to make the proof: | |
| 8 | 12 | |
| 9 | -**102 of 102 reviewed declarations** have complete transitive proof dependencies. The ledger records 0 declarations with written proofs and pending dependencies, and 0 direct placeholders. Across all public theorems and auxiliary results, **1400** have complete proof dependencies. | |
| 13 | +- **accessible**: faster to build and more modular, so a researcher without a large machine can engage with it; | |
| 14 | +- **readable**: code quality, aspirationally at Mathlib's level: lemmas organised, named and documented, idiomatic | |
| 15 | + style, no linter warnings, docstrings that say what is proved, tied to the paper's numbering; | |
| 16 | +- **integrated with the community**: results from Mathlib in place of our own proofs of them; | |
| 10 | 17 | |
| 11 | -The 102 reviewed declarations cover the paper's 38 named results and their supporting clauses. The review also tracks 171 original definitions. | |
| 18 | +and to settle the open statements in `Open.lean` (S for an explicit weight, S for some weight, monotonicity, ¬R) in | |
| 19 | +this library. | |
| 12 | 20 | |
| 13 | -- `theorem_1_1`: `kernel_closed`. | |
| 14 | -- `theorem_1_2`: `kernel_closed`. | |
| 15 | -- `primePair_consequence`: `kernel_closed`. | |
| 21 | +Please note: we are **not** looking for | |
| 16 | 22 | |
| 17 | -Remaining numerical work in Appendix B: certify the specified integral approximations and their errors, derive the concrete integer interval from those inputs, and certify the finite spectral matrix numerically. The general error-propagation and spectral-criterion theorems are proved. A separate [direct enumeration certificate](verification/independent-audit/appendices/NumericCrossCheck.lean) establishes 905 unordered prime pairs for 30030. | |
| 23 | +- claims about your own machine's build or Comparator run with nothing the site can check; | |
| 24 | +- files that the reduction does not need; | |
| 25 | +- any change to what is proved or to the open statements. The `challenge` check fails it. | |
| 18 | 26 | |
| 19 | -## Build and verify | |
| 27 | +## Where this comes from | |
| 20 | 28 | |
| 21 | -Run from this directory: | |
| 29 | +This repository starts from [subfish-zhou/conditional-goldbach-lean](https://github.com/subfish-zhou/conditional-goldbach-lean) | |
| 30 | +at `c55db645f3b4aed00374fe4aa1fcee2428c88c4b` (2026-11-14), its folder `formalization/`: Ziyu Zhou's Lean library of | |
| 31 | +the reduction, with its own independent Comparator audit (`verification/independent-audit/`). Left out (`upstream.json`): | |
| 32 | +the generated progress reports and their screenshots, the Python and Node scripts that make them, and | |
| 33 | +`reference/Reviewed.lean`, the paper's statements prepared with `sorry` for the authors' review, which no library | |
| 34 | +builds. The library is Ziyu Zhou's work, included here with thanks; upstream declares no licence. | |
| 22 | 35 | |
| 23 | -```bash | |
| 24 | -lake update | |
| 36 | +## What is proved, and how it is checked | |
| 37 | + | |
| 38 | +The library proves, under GRH and S (or R), `theorem_1_1`, `theorem_1_2` and `primePair_consequence`, with the paper's | |
| 39 | +quantifier order and constant dependencies; its ledger (`proof-status.json`) records 102 of 102 reviewed declarations | |
| 40 | +with complete proof dependencies, no `sorry`, and only `propext`, `Classical.choice` and `Quot.sound`. | |
| 41 | + | |
| 42 | +Upstream's independent audit wrote the paper's statements again from the TeX source, without the library's own | |
| 43 | +statement file: `verification/independent-audit/comparator-project/TexAuditComparator/Challenge.lean` states 218 of | |
| 44 | +them (103 of the paper's results, 96 of its definitions and 19 further facts of the audit, from `Reference14.lean`, `Reference57.lean` and | |
| 45 | +`ReferenceAB.lean`) with `sorry`, and `Solution.lean` proves them from the library through the `Bridges*` files. | |
| 46 | +[`comparator.json`](comparator.json) checks that the solution proves exactly those statements, with no axioms beyond | |
| 47 | +the three, in Lean's kernel and in nanoda. Upstream's own run accepted it in 385 seconds, and three control | |
| 48 | +configurations (a changed condition, quantifier and definition) were refused. | |
| 49 | + | |
| 50 | +**Fixed files:** `Challenge.lean`, `Reference14.lean`, `Reference57.lean`, `ReferenceAB.lean`, `comparator.json` and | |
| 51 | +[`Open.lean`](Open.lean), the open statements. So is the build configuration, as far as Comparator depends on it. | |
| 52 | + | |
| 53 | +| Check | What it does | Like upstream's | | |
| 54 | +|---|---|---| | |
| 55 | +| `challenge` | on every push, in seconds: the fixed files are as approved; `lakefile.toml` changes only in a `require`'s `rev`, `leanOptions`, `defaultTargets`, `lean_exe` or `[cache]`; every package is a Git repository of leanprover or leanprover-community, or one this project trusts (goldbach-lean, LeanArchitect); the toolchain is a release; no `lakefile.lean`, nothing under `.lake/`; no `sorry`, `admit`, `axiom`, `native_decide`, `implemented_by` or `extern` outside the fixed files | `check_proof_policy.py` | | |
| 56 | +| `build` | in the project's Lean image ([`docker/`](docker/README.md)), with no network: `lake build` ends without error, no module outside the fixed files reports a declaration that uses `sorry`, and `lake comparator --config comparator.json` says both kernels accept the solution | the independent audit | | |
| 57 | +| the site's maintainer | on every pull request: is it one of the changes we want (see [`AGENTS.md`](AGENTS.md)), and is it readable | | | |
| 58 | + | |
| 59 | +Both checks gate: a pull request is merged only once `challenge` and `build` have passed on its head. | |
| 60 | + | |
| 61 | +## Build | |
| 62 | + | |
| 63 | +```sh | |
| 25 | 64 | lake exe cache get |
| 26 | -lake --wfail build | |
| 27 | -python3 scripts/check_project.py | |
| 28 | -python3 scripts/check_public_api.py | |
| 29 | -python3 scripts/check_entrypoints.py | |
| 30 | -python3 scripts/audit_proofs.py | |
| 31 | -python3 scripts/check_reviewed_types.py | |
| 32 | -python3 scripts/check_definitions.py | |
| 33 | -python3 scripts/write_progress_report.py | |
| 34 | -python3 scripts/build_progress.py | |
| 65 | +lake build | |
| 66 | +lake comparator --config comparator.json # Lean v4.35.0 ships it; needs bubblewrap | |
| 35 | 67 | ``` |
| 36 | 68 | |
| 37 | -The toolchain is Lean 4.35.0. Mathlib is pinned to `56a005855ea17e0b0958f73ec801ae140b0a1679`; the `goldbach-lean` Git dependency is pinned in `lakefile.toml` and `lake-manifest.json`. See [dependency details](../docs/dependencies.md). | |
| 69 | +Our `lakefile.toml` is upstream's, with two libraries added: `TexAuditComparator` (the audit's Comparator project, | |
| 70 | +where upstream keeps it) and `Open` (the open statements), so one package builds the library, the challenge and the | |
| 71 | +open statements. | |
| 72 | + | |
| 73 | +## Taking part | |
| 74 | + | |
| 75 | +The way in is a change that `build` verifies: **S-1** (S is monotone in the weight), **P-1** (the linter warnings of | |
| 76 | +one folder), **M-1** (one of our lemmas that Mathlib has), and **V-4** (rebuild the library and run Comparator). The | |
| 77 | +open statements are S-1, S-4, S-5 (`Open.lean`) and V-1 (¬R in this library); C-2 puts B-01's rationals in the kernel; | |
| 78 | +P-2, D-1 and M-1 make the proof readable. Reviews and research keep the record honest and close on their readers: | |
| 79 | +the audits **A-1…A-10** (one claim made elsewhere each, so many can work at once), the status table **L-1**, research | |
| 80 | +on S (**S-2**, **S-3**) and ¬R read as mathematics (**V-6**). Pinned starting points, Lean and numerical, are in | |
| 81 | +[`docs/starting-points.md`](docs/starting-points.md). | |
| 38 | 82 | |
| 39 | -HTML generation uses the optional packages in `requirements-review.txt` and `package.json`. The generated reports work offline. | |
| 83 | +The site reads each pull request within minutes of a push, and the house's maintainer agent (`shoal-maintainer`) | |
| 84 | +comes every two hours, and within minutes when someone writes to it, to rebuild what is claimed, answer questions and | |
| 85 | +keep "Where it stands" current; a person decides what it leaves to a person. | |
| 40 | 86 | |
| 41 | -See [choosing an import](../docs/imports.md) for isolated consumers and enforced dependency boundaries. | |
| 87 | +## Background | |
| 42 | 88 | |
| 43 | -See the [development and public-interface guide](../docs/development.md) for daily checks, the complete release sequence and CI. | |
| 89 | +Every even number greater than 2 is a sum of two primes: Goldbach wrote it to Euler in 1742, and it is still open. What | |
| 90 | +is known is either a range checked by computer or a theorem with a condition attached. The oldest way to see why | |
| 91 | +everyone believes it is to count, for each even $N$, the ways to write it as a sum of two primes: the counts never come | |
| 92 | +near zero, and they grow in bands that one formula predicts. | |
| 44 | 93 | |
| 45 | -## Library map | |
| 94 | +Every dot is an even $N$ up to 60,000, its height $r(N)$, the number of ways $N=p+q$ with primes $p\le q$. The more a | |
| 95 | +dot stands out from the background, the more small odd prime factors $N$ has, and the more ways: a multiple of 3 has | |
| 96 | +about twice the ways of a power of 2 of the same size, a multiple of 15 about 8/3 as many, as Hardy and Littlewood's | |
| 97 | +formula predicts from $N$'s prime factors. $N=30030=2\cdot3\cdot5\cdot7\cdot11\cdot13$ has 905 ways and the formula says | |
| 98 | +908; $32768=2^{15}$, about the same size, has 244. | |
| 46 | 99 | |
| 47 | -| Modules | Content | | |
| 100 | +| When | What | | |
| 48 | 101 | |---|---| |
| 49 | -| `Definitions/*.lean` | Reviewed objects split into arithmetic, analytic, Hardy, Hilbert, spectral, and experiment modules | | |
| 50 | -| `BaseDefinitions.lean`, `Definitions.lean` | Compatibility entry points reexporting the original reviewed definitions | | |
| 51 | -| `Analysis/L2Fourier.lean` | Mathlib-only Fourier and L² dilation interfaces | | |
| 52 | -| `Analysis/SpectralData.lean` | Shared Hilbert coordinate and norm identities | | |
| 53 | -| `Proofs/HardyFourier.lean`, `Proofs/SpectralDataAlgebra.lean` | Compatibility entrypoints for the shared analysis interfaces | | |
| 54 | -| `Proofs/MellinDoubleDiagonal.lean` | Shared double-Mellin diagonalization and density-factor extraction | | |
| 55 | -| `Proofs/MellinBetaConvolutionCore.lean` | Shared Beta–Mellin convolution proofs with weight-specific wrappers | | |
| 56 | -| `Proofs/Weights.lean`, `WeightNorm.lean` | Smooth weights, positive mass, support, convolutions, and norm integrals | | |
| 57 | -| `Proofs/Characters.lean`, `Character*.lean`, `LFunction*.lean` | Odd-character projection, L-functions, zero expansions, and analytic kernels | | |
| 58 | -| `Proofs/Beta*.lean`, `Density*.lean` | Beta integrals, meromorphic identities, and singular-density Euler products | | |
| 59 | -| `Proofs/Hardy*.lean`, `Kernel*.lean` | Fourier–Laplace realization, traces, integral operators, and reproducing kernels | | |
| 60 | -| `Proofs/Spectral*.lean`, `DictionaryApplication.lean` | Spectral products, trace and determinant identities, zeros, and the spectral dictionary | | |
| 61 | -| `Proofs/Mellin*.lean`, `Quadratic*.lean` | Inversion, moment identities, Riesz representation, and the exact quadratic identity | | |
| 62 | -| `Proofs/QuantitativeBounds.lean`, `TotientLogLog.lean` | Uniform operator bounds and singular-series estimates | | |
| 63 | -| `Proofs/Variable*.lean`, `BalanceBounds.lean`, `PoleObstruction.lean` | Variable strips, boundary balance, and the small-boundary obstruction | | |
| 64 | -| `Proofs/Wide*.lean`, `FiniteExperimentSpectrum.lean` | Appendix B wide weights, count identities, and finite spectral criteria | | |
| 65 | -| `Proofs/PrimePowers.lean`, `PrimePairs.lean`, `Main.lean` | Prime-power removal, prime-pair consequence, and main theorem assembly | | |
| 66 | - | |
| 67 | -## Verification evidence | |
| 68 | - | |
| 69 | -- `proof-status.json`: Lean `collectAxioms` follows theorem types and proof values recursively. The permitted foundational axioms are `propext`, `Classical.choice`, and `Quot.sound`. | |
| 70 | -- `reviewed-types.json`: definitional-equality checks compare all 102 complete theorem types against the statement snapshot, after mapping its namespace. | |
| 71 | -- `reviewed-definitions.json`: checks the declarations and bodies of the 171 reviewed definitions, ignoring whitespace and comments between declarations. | |
| 72 | -- `verification/entrypoints.json`: isolated consumer exports, compiled import inventories, and dependency budgets. | |
| 73 | -- `verification/public-api.json`: all 1621 frozen public declaration types, including binder names, order and implicitness. | |
| 74 | -- `verification/proof-policy.json`: source reachability and scoped elaboration options. | |
| 75 | -- `verification.json`: consolidated build and verification records. | |
| 76 | -- [Independent source audit](verification/independent-audit/report.html): original-TeX review, representation bridges, and comparator results. | |
| 77 | - | |
| 78 | -`reference/Reviewed.lean` preserves the earlier statement-review snapshot. The main library imports the completed proof modules. Audit challenges use placeholders to specify expected targets; their solutions provide the corresponding proofs. | |
| 79 | - | |
| 80 | -## Completed reviewed declarations | |
| 81 | - | |
| 82 | -- [interiorLine_memLp](ConditionalGoldbach/Definitions/HardyTraces.lean#L15) | |
| 83 | -- [boundaryTraces_exist](ConditionalGoldbach/Definitions/HardyTraces.lean#L31) | |
| 84 | -- [proposition_6_5_components_spec](ConditionalGoldbach/Proofs/ArithmeticComponentOperators.lean#L110) | |
| 85 | -- [lemma_A_3_balance](ConditionalGoldbach/Proofs/BalanceBounds.lean#L40) | |
| 86 | -- [lemma_A_3_width_ratio](ConditionalGoldbach/Proofs/BalanceBounds.lean#L97) | |
| 87 | -- [proposition_A_4_baseline_product](ConditionalGoldbach/Proofs/BaselineEuler.lean#L126) | |
| 88 | -- [lemma_4_2](ConditionalGoldbach/Proofs/BetaIdentity.lean#L224) | |
| 89 | -- [lemma_4_1](ConditionalGoldbach/Proofs/BetaIntegrals.lean#L177) | |
| 90 | -- [lemma_4_1_absolute_convergence](ConditionalGoldbach/Proofs/BetaIntegrals.lean#L188) | |
| 91 | -- [lemma_4_1_signed_model](ConditionalGoldbach/Proofs/BetaIntegrals.lean#L200) | |
| 92 | -- [lemma_4_2_meromorphic](ConditionalGoldbach/Proofs/BetaMeromorphic.lean#L133) | |
| 93 | -- [proposition_3_2](ConditionalGoldbach/Proofs/CharacterAnalytic.lean#L114) | |
| 94 | -- [lemma_6_4](ConditionalGoldbach/Proofs/CharacterAverage.lean#L84) | |
| 95 | -- [proposition_3_2_joint_meromorphic](ConditionalGoldbach/Proofs/CharacterJoint.lean#L59) | |
| 96 | -- [lemma_3_4_paired_zero_sum](ConditionalGoldbach/Proofs/CharacterSeries.lean#L66) | |
| 97 | -- [lemma_3_4](ConditionalGoldbach/Proofs/CharacterZeroExpansion.lean#L57) | |
| 98 | -- [lemma_3_4_normal_convergence](ConditionalGoldbach/Proofs/CharacterZeroShiftNormal.lean#L30) | |
| 99 | -- [lemma_6_4_zero_poisson_convergence](ConditionalGoldbach/Proofs/CharacterZeroSummability.lean#L126) | |
| 100 | -- [lemma_3_1_odd_orthogonality](ConditionalGoldbach/Proofs/Characters.lean#L65) | |
| 101 | -- [lemma_3_1](ConditionalGoldbach/Proofs/Characters.lean#L367) | |
| 102 | -- [lemma_4_3_density_convergence](ConditionalGoldbach/Proofs/DensityConvergence.lean#L79) | |
| 103 | -- [lemma_4_3_euler_product_convergence](ConditionalGoldbach/Proofs/DensityEuler.lean#L152) | |
| 104 | -- [lemma_4_3](ConditionalGoldbach/Proofs/DensityEulerIdentity.lean#L103) | |
| 105 | -- [theorem_6_1](ConditionalGoldbach/Proofs/DictionaryApplication.lean#L37) | |
| 106 | -- [singularSeries_eq_existing](ConditionalGoldbach/Proofs/Elementary.lean#L16) | |
| 107 | -- [proposition_B_5](ConditionalGoldbach/Proofs/FiniteExperimentSpectrum.lean#L152) | |
| 108 | -- [lemma_3_3](ConditionalGoldbach/Proofs/HadamardLimit.lean#L114) | |
| 109 | -- [proposition_5_3](ConditionalGoldbach/Proofs/HardyArithmeticTheorems.lean#L35) | |
| 110 | -- [proposition_5_4_kernel_pairing](ConditionalGoldbach/Proofs/HardyArithmeticTheorems.lean#L56) | |
| 111 | -- [proposition_5_3_kernel_integrability](ConditionalGoldbach/Proofs/HardyArithmeticTheorems.lean#L64) | |
| 112 | -- [proposition_5_4](ConditionalGoldbach/Proofs/HardyArithmeticTheorems.lean#L75) | |
| 113 | -- [proposition_5_4_fixed_contour](ConditionalGoldbach/Proofs/HardyArithmeticTheorems.lean#L88) | |
| 114 | -- [lemma_5_2](ConditionalGoldbach/Proofs/HardyConverse.lean#L45) | |
| 115 | -- [proposition_5_4_exact_norm](ConditionalGoldbach/Proofs/HardyReproducing.lean#L138) | |
| 116 | -- [lemma_5_2_representation_spec](ConditionalGoldbach/Proofs/HardyTraceAlgebra.lean#L126) | |
| 117 | -- [lemma_5_2_closed_trace_space](ConditionalGoldbach/Proofs/HardyTraceAlgebra.lean#L183) | |
| 118 | -- [lemma_5_2_boundary_inner](ConditionalGoldbach/Proofs/HardyTraceAlgebra.lean#L199) | |
| 119 | -- [proposition_3_2_finite_rank](ConditionalGoldbach/Proofs/KernelAlgebra.lean#L111) | |
| 120 | -- [proposition_5_1](ConditionalGoldbach/Proofs/KernelRegularity.lean#L101) | |
| 121 | -- [proposition_5_1_fueter_equation](ConditionalGoldbach/Proofs/KernelRegularity.lean#L150) | |
| 122 | -- [theorem_7_1_uniform](ConditionalGoldbach/Proofs/Main.lean#L17) | |
| 123 | -- [theorem_1_1](ConditionalGoldbach/Proofs/Main.lean#L57) | |
| 124 | -- [theorem_1_2](ConditionalGoldbach/Proofs/Main.lean#L101) | |
| 125 | -- [lemma_7_1](ConditionalGoldbach/Proofs/MellinCharacterShift.lean#L109) | |
| 126 | -- [lemma_7_1_absolute_convergence](ConditionalGoldbach/Proofs/MellinCharacterShift.lean#L155) | |
| 127 | -- [lemma_7_2](ConditionalGoldbach/Proofs/MellinModelDouble.lean#L27) | |
| 128 | -- [lemma_7_2_absolute_convergence](ConditionalGoldbach/Proofs/MellinModelDouble.lean#L38) | |
| 129 | -- [lemma_3_5](ConditionalGoldbach/Proofs/MellinMoment.lean#L101) | |
| 130 | -- [lemma_3_5_absolute_convergence](ConditionalGoldbach/Proofs/MellinMomentComplete.lean#L14) | |
| 131 | -- [lemma_3_5_small_sigma](ConditionalGoldbach/Proofs/MellinMomentComplete.lean#L25) | |
| 132 | -- [proposition_7_3](ConditionalGoldbach/Proofs/MellinResidual.lean#L92) | |
| 133 | -- [proposition_7_3_absolute_convergence](ConditionalGoldbach/Proofs/MellinResidual.lean#L101) | |
| 134 | -- [proposition_4_4](ConditionalGoldbach/Proofs/ModelContinuation.lean#L92) | |
| 135 | -- [proposition_A_4](ConditionalGoldbach/Proofs/PoleObstruction.lean#L15) | |
| 136 | -- [primePair_consequence](ConditionalGoldbach/Proofs/PrimePairs.lean#L17) | |
| 137 | -- [lemma_7_5](ConditionalGoldbach/Proofs/QuadraticEstimates.lean#L41) | |
| 138 | -- [lemma_7_5_asymptotic](ConditionalGoldbach/Proofs/QuadraticEstimates.lean#L78) | |
| 139 | -- [proposition_7_4](ConditionalGoldbach/Proofs/QuadraticFunctional.lean#L15) | |
| 140 | -- [theorem_7_1](ConditionalGoldbach/Proofs/QuadraticIdentity.lean#L121) | |
| 141 | -- [proposition_6_5](ConditionalGoldbach/Proofs/QuantitativeBounds.lean#L26) | |
| 142 | -- [lemma_A_3_absolute_operator_bound](ConditionalGoldbach/Proofs/QuantitativeBounds.lean#L45) | |
| 143 | -- [lemma_A_3](ConditionalGoldbach/Proofs/QuantitativeBounds.lean#L56) | |
| 144 | -- [theorem_6_2](ConditionalGoldbach/Proofs/QuantitativeBounds.lean#L111) | |
| 145 | -- [proposition_4_5](ConditionalGoldbach/Proofs/ResidualAnalytic.lean#L89) | |
| 146 | -- [lemma_4_1_local_density](ConditionalGoldbach/Proofs/SingularDensity.lean#L68) | |
| 147 | -- [theorem_1_2_hypothesisR_implies_S](ConditionalGoldbach/Proofs/SpectralAlgebra.lean#L16) | |
| 148 | -- [theorem_6_1_width_comparison](ConditionalGoldbach/Proofs/SpectralAlgebra.lean#L29) | |
| 149 | -- [proposition_6_3_factor_central_order](ConditionalGoldbach/Proofs/SpectralAlgebra.lean#L131) | |
| 150 | -- [proposition_6_2](ConditionalGoldbach/Proofs/SpectralCompletion.lean#L85) | |
| 151 | -- [proposition_6_1_spectral_choice_independent](ConditionalGoldbach/Proofs/SpectralCompletionChoice.lean#L108) | |
| 152 | -- [proposition_6_1_square_determinant](ConditionalGoldbach/Proofs/SpectralCompletionDeterminant.lean#L41) | |
| 153 | -- [proposition_6_1](ConditionalGoldbach/Proofs/SpectralCompletionDeterminant.lean#L50) | |
| 154 | -- [proposition_6_1_enumeration](ConditionalGoldbach/Proofs/SpectralCompletionIdentities.lean#L60) | |
| 155 | -- [proposition_6_2_centered_product](ConditionalGoldbach/Proofs/SpectralCompletionIdentities.lean#L105) | |
| 156 | -- [proposition_6_2_critical_values](ConditionalGoldbach/Proofs/SpectralCompletionIdentities.lean#L159) | |
| 157 | -- [proposition_6_3_multiplicities](ConditionalGoldbach/Proofs/SpectralCompletionMultiplicities.lean#L91) | |
| 158 | -- [proposition_6_3_three_cases](ConditionalGoldbach/Proofs/SpectralCompletionZeros.lean#L95) | |
| 159 | -- [proposition_6_3](ConditionalGoldbach/Proofs/SpectralConsequences.lean#L38) | |
| 160 | -- [proposition_6_1_all_slices](ConditionalGoldbach/Proofs/SpectralConsequences.lean#L61) | |
| 161 | -- [proposition_6_1_complex_slice](ConditionalGoldbach/Proofs/SpectralConsequences.lean#L70) | |
| 162 | -- [proposition_6_5_diagonal_vector_spec](ConditionalGoldbach/Proofs/SpectralDiagonalVector.lean#L114) | |
| 163 | -- [theorem_6_1_abstract_dictionary](ConditionalGoldbach/Proofs/SpectralDictionary.lean#L170) | |
| 164 | -- [proposition_5_3_hs_basis_independent](ConditionalGoldbach/Proofs/SpectralHilbertSchmidt.lean#L53) | |
| 165 | -- [lemma_6_4_poisson_action_spec](ConditionalGoldbach/Proofs/SpectralPoisson.lean#L35) | |
| 166 | -- [lemma_6_4_perron_residue](ConditionalGoldbach/Proofs/SpectralPoisson.lean#L49) | |
| 167 | -- [lemma_6_4_poisson_convolution](ConditionalGoldbach/Proofs/SpectralPoissonConvolution.lean#L175) | |
| 168 | -- [proposition_6_1_positive_fredholm_spec](ConditionalGoldbach/Proofs/SpectralPositiveFredholm.lean#L22) | |
| 169 | -- [lemma_4_3_uniform](ConditionalGoldbach/Proofs/TotientLogLog.lean#L173) | |
| 170 | -- [proposition_A_2](ConditionalGoldbach/Proofs/VariableConsequences.lean#L23) | |
| 171 | -- [proposition_A_1](ConditionalGoldbach/Proofs/VariableQuadratic.lean#L58) | |
| 172 | -- [proposition_A_2_pointwise](ConditionalGoldbach/Proofs/VariableQuadratic.lean#L120) | |
| 173 | -- [proposition_A_1_operator_spec](ConditionalGoldbach/Proofs/VariableStripOperators.lean#L159) | |
| 174 | -- [theorem_1_1_weight_exists](ConditionalGoldbach/Proofs/Weights.lean#L58) | |
| 175 | -- [lemma_3_5_weight_support](ConditionalGoldbach/Proofs/Weights.lean#L79) | |
| 176 | -- [lemma_7_2_convolutions](ConditionalGoldbach/Proofs/Weights.lean#L127) | |
| 177 | -- [proposition_7_4_norm_integrals](ConditionalGoldbach/Proofs/Weights.lean#L207) | |
| 178 | -- [lemma_B_3](ConditionalGoldbach/Proofs/WideError.lean#L14) | |
| 179 | -- [lemma_B_3_main_integral](ConditionalGoldbach/Proofs/WideMainIntegral.lean#L67) | |
| 180 | -- [proposition_B_4](ConditionalGoldbach/Proofs/WideMellinResidual.lean#L61) | |
| 181 | -- [lemma_B_2](ConditionalGoldbach/Proofs/WideMoments.lean#L86) | |
| 182 | -- [proposition_B_1](ConditionalGoldbach/Proofs/WidePrimePowerCount.lean#L145) | |
| 183 | -- [proposition_B_4_weight](ConditionalGoldbach/Proofs/WideWeight.lean#L165) | |
| 184 | - | |
| 185 | -## Pending reviewed declarations | |
| 186 | - | |
| 187 | -- [mangoldt](ConditionalGoldbach/Definitions/Arithmetic.lean#L16): `definition`. | |
| 188 | -- [prime](ConditionalGoldbach/Definitions/Arithmetic.lean#L18): `definition`. | |
| 189 | -- [C2](ConditionalGoldbach/Definitions/Arithmetic.lean#L20): `definition`. | |
| 190 | -- [singularSeries](ConditionalGoldbach/Definitions/Arithmetic.lean#L22): `definition`. | |
| 191 | -- [goldbach](ConditionalGoldbach/Definitions/Arithmetic.lean#L25): `definition`. | |
| 192 | -- [diagonalMoment](ConditionalGoldbach/Definitions/Arithmetic.lean#L31): `definition`. | |
| 193 | -- [PrimePairCount](ConditionalGoldbach/Definitions/Arithmetic.lean#L35): `definition`. | |
| 194 | -- [positiveDifferenceFamily](ConditionalGoldbach/Definitions/Arithmetic.lean#L39): `definition`. | |
| 195 | -- [negativeDifferenceFamily](ConditionalGoldbach/Definitions/Arithmetic.lean#L42): `definition`. | |
| 196 | -- [sumFamily](ConditionalGoldbach/Definitions/Arithmetic.lean#L45): `definition`. | |
| 197 | -- [localDensityFactor](ConditionalGoldbach/Definitions/Arithmetic.lean#L48): `definition`. | |
| 198 | -- [EvenEventually](ConditionalGoldbach/Definitions/Asymptotics.lean#L17): `definition`. | |
| 199 | -- [EvenTendstoInfinity](ConditionalGoldbach/Definitions/Asymptotics.lean#L19): `definition`. | |
| 200 | -- [NormallySummableOn](ConditionalGoldbach/Definitions/Asymptotics.lean#L22): `definition`. | |
| 201 | -- [HermitianKernel](ConditionalGoldbach/Definitions/Asymptotics.lean#L28): `definition`. | |
| 202 | -- [PositiveKernel](ConditionalGoldbach/Definitions/Asymptotics.lean#L30): `definition`. | |
| 203 | -- [BoundaryKernelSquareIntegral](ConditionalGoldbach/Definitions/Asymptotics.lean#L34): `definition`. | |
| 204 | -- [CompactUniformLimit](ConditionalGoldbach/Definitions/Asymptotics.lean#L38): `definition`. | |
| 205 | -- [EvenAsymptotic](ConditionalGoldbach/Definitions/Asymptotics.lean#L43): `definition`. | |
| 206 | -- [baselineBound](ConditionalGoldbach/Definitions/Asymptotics.lean#L46): `definition`. | |
| 207 | -- [balanceFactor](ConditionalGoldbach/Definitions/Asymptotics.lean#L48): `definition`. | |
| 208 | -- [availableNormMajorant](ConditionalGoldbach/Definitions/Asymptotics.lean#L50): `definition`. | |
| 209 | -- [boundaryIntegral](ConditionalGoldbach/Definitions/BoundaryIntegral.lean#L15): `definition`. | |
| 210 | -- [Character](ConditionalGoldbach/Definitions/Characters.lean#L19): `definition`. | |
| 211 | -- [oddCharacters](ConditionalGoldbach/Definitions/Characters.lean#L24): `definition`. | |
| 212 | -- [characterPolynomial](ConditionalGoldbach/Definitions/Characters.lean#L27): `definition`. | |
| 213 | -- [characterMoment](ConditionalGoldbach/Definitions/Characters.lean#L31): `definition`. | |
| 214 | -- [GRH](ConditionalGoldbach/Definitions/Characters.lean#L34): `definition`. | |
| 215 | -- [logDerivative](ConditionalGoldbach/Definitions/Characters.lean#L38): `definition`. | |
| 216 | -- [characterKernel](ConditionalGoldbach/Definitions/Characters.lean#L41): `definition`. | |
| 217 | -- [ZeroIndex](ConditionalGoldbach/Definitions/Characters.lean#L45): `definition`. | |
| 218 | -- [completedL](ConditionalGoldbach/Definitions/Characters.lean#L49): `definition`. | |
| 219 | -- [zeroDifference](ConditionalGoldbach/Definitions/Characters.lean#L52): `definition`. | |
| 220 | -- [eulerCorrection](ConditionalGoldbach/Definitions/Characters.lean#L55): `definition`. | |
| 221 | -- [zeroPoisson](ConditionalGoldbach/Definitions/Characters.lean#L60): `definition`. | |
| 222 | -- [averagedLogDerivative](ConditionalGoldbach/Definitions/Characters.lean#L63): `definition`. | |
| 223 | -- [arithmeticExpansionTerm](ConditionalGoldbach/Definitions/Characters.lean#L67): `definition`. | |
| 224 | -- [zeroWindow](ConditionalGoldbach/Definitions/Characters.lean#L73): `definition`. | |
| 225 | -- [poleCoefficient](ConditionalGoldbach/Definitions/Characters.lean#L76): `definition`. | |
| 226 | -- [pairedZeroSum](ConditionalGoldbach/Definitions/Characters.lean#L80): `definition`. | |
| 227 | -- [zeroMultiplicity](ConditionalGoldbach/Definitions/Characters.lean#L84): `definition`. | |
| 228 | -- [perronCutoff](ConditionalGoldbach/Definitions/Characters.lean#L87): `definition`. | |
| 229 | -- [smoothedPerronWeight](ConditionalGoldbach/Definitions/Characters.lean#L89): `definition`. | |
| 230 | -- [smoothedDirichletPolynomial](ConditionalGoldbach/Definitions/Characters.lean#L94): `definition`. | |
| 231 | -- [smoothedPerronKernel](ConditionalGoldbach/Definitions/Characters.lean#L98): `definition`. | |
| 232 | -- [logDerivativeEnergy](ConditionalGoldbach/Definitions/Characters.lean#L101): `definition`. | |
| 233 | -- [experimentN](ConditionalGoldbach/Definitions/Experiment.lean#L23): `definition`. | |
| 234 | -- [cutoffPolynomial](ConditionalGoldbach/Definitions/Experiment.lean#L25): `definition`. | |
| 235 | -- [wideCutoff](ConditionalGoldbach/Definitions/Experiment.lean#L29): `definition`. | |
| 236 | -- [wideCompanion](ConditionalGoldbach/Definitions/Experiment.lean#L33): `definition`. | |
| 237 | -- [wideWeight](ConditionalGoldbach/Definitions/Experiment.lean#L38): `definition`. | |
| 238 | -- [wideCorrelation](ConditionalGoldbach/Definitions/Experiment.lean#L40): `definition`. | |
| 239 | -- [unorderedPrimePairs](ConditionalGoldbach/Definitions/Experiment.lean#L42): `definition`. | |
| 240 | -- [edgeCorrection](ConditionalGoldbach/Definitions/Experiment.lean#L45): `definition`. | |
| 241 | -- [primePowerCorrection](ConditionalGoldbach/Definitions/Experiment.lean#L49): `definition`. | |
| 242 | -- [countingCoefficient](ConditionalGoldbach/Definitions/Experiment.lean#L56): `definition`. | |
| 243 | -- [countingIntegral](ConditionalGoldbach/Definitions/Experiment.lean#L58): `definition`. | |
| 244 | -- [diagonalCountingMoment](ConditionalGoldbach/Definitions/Experiment.lean#L62): `definition`. | |
| 245 | -- [approxSignedMoment](ConditionalGoldbach/Definitions/Experiment.lean#L65): `definition`. | |
| 246 | -- [approxDiagonalMoment](ConditionalGoldbach/Definitions/Experiment.lean#L68): `definition`. | |
| 247 | -- [wideModelMass](ConditionalGoldbach/Definitions/Experiment.lean#L71): `definition`. | |
| 248 | -- [wideResidual](ConditionalGoldbach/Definitions/Experiment.lean#L73): `definition`. | |
| 249 | -- [approxPrimeCount](ConditionalGoldbach/Definitions/Experiment.lean#L75): `definition`. | |
| 250 | -- [countError](ConditionalGoldbach/Definitions/Experiment.lean#L78): `definition`. | |
| 251 | -- [wideFunctional](ConditionalGoldbach/Definitions/Experiment.lean#L81): `definition`. | |
| 252 | -- [wideRieszVector](ConditionalGoldbach/Definitions/Experiment.lean#L85): `definition`. | |
| 253 | -- [wideMainIntegral](ConditionalGoldbach/Definitions/Experiment.lean#L89): `definition`. | |
| 254 | -- [HasMomentError](ConditionalGoldbach/Definitions/Experiment.lean#L93): `definition`. | |
| 255 | -- [spectralNode](ConditionalGoldbach/Definitions/FiniteSpectrum.lean#L18): `definition`. | |
| 256 | -- [trapezoidWeight](ConditionalGoldbach/Definitions/FiniteSpectrum.lean#L21): `definition`. | |
| 257 | -- [finiteSpectralMatrix](ConditionalGoldbach/Definitions/FiniteSpectrum.lean#L24): `definition`. | |
| 258 | -- [finiteSpectralFunction](ConditionalGoldbach/Definitions/FiniteSpectrum.lean#L28): `definition`. | |
| 259 | -- [IsFiniteSpectrum](ConditionalGoldbach/Definitions/FiniteSpectrum.lean#L32): `definition`. | |
| 260 | -- [finiteEigenvalues](ConditionalGoldbach/Definitions/FiniteSpectrum.lean#L37): `definition`. | |
| 261 | -- [finiteMatrixOpNorm](ConditionalGoldbach/Definitions/FiniteSpectrum.lean#L40): `definition`. | |
| 262 | -- [analyticDomain](ConditionalGoldbach/Definitions/GeometryCore.lean#L15): `definition`. | |
| 263 | -- [betaDomain](ConditionalGoldbach/Definitions/GeometryCore.lean#L18): `definition`. | |
| 264 | -- [alpha](ConditionalGoldbach/Definitions/GeometryCore.lean#L21): `definition`. | |
| 265 | -- [beta](ConditionalGoldbach/Definitions/GeometryCore.lean#L23): `definition`. | |
| 266 | -- [sigmaStar](ConditionalGoldbach/Definitions/GeometryCore.lean#L25): `definition`. | |
| 267 | -- [width](ConditionalGoldbach/Definitions/GeometryCore.lean#L27): `definition`. | |
| 268 | -- [strip](ConditionalGoldbach/Definitions/GeometryCore.lean#L29): `definition`. | |
| 269 | -- [line](ConditionalGoldbach/Definitions/GeometryCore.lean#L31): `definition`. | |
| 270 | -- [pointDistance](ConditionalGoldbach/Definitions/GeometryCore.lean#L33): `definition`. | |
| 271 | -- [referenceLine](ConditionalGoldbach/Definitions/GeometryCore.lean#L35): `definition`. | |
| 272 | -- [hardyWeight](ConditionalGoldbach/Definitions/Hardy.lean#L18): `definition`. | |
| 273 | -- [hardyMeasure](ConditionalGoldbach/Definitions/Hardy.lean#L20): `definition`. | |
| 274 | -- [HardySpace](ConditionalGoldbach/Definitions/Hardy.lean#L23): `definition`. | |
| 275 | -- [fourierLaplace](ConditionalGoldbach/Definitions/Hardy.lean#L25): `definition`. | |
| 276 | -- [IsRawHardy](ConditionalGoldbach/Definitions/Hardy.lean#L28): `definition`. | |
| 277 | -- [rawHardyNormSq](ConditionalGoldbach/Definitions/Hardy.lean#L35): `definition`. | |
| 278 | -- [reproducingKernel](ConditionalGoldbach/Definitions/Hardy.lean#L39): `definition`. | |
| 279 | -- [wirtingerBar](ConditionalGoldbach/Definitions/Hardy.lean#L43): `definition`. | |
| 280 | -- [wirtinger](ConditionalGoldbach/Definitions/Hardy.lean#L46): `definition`. | |
| 281 | -- [BoundaryParameter](ConditionalGoldbach/Definitions/Hardy.lean#L49): `definition`. | |
| 282 | -- [boundaryPoint](ConditionalGoldbach/Definitions/Hardy.lean#L51): `definition`. | |
| 283 | -- [boundaryMeasure](ConditionalGoldbach/Definitions/Hardy.lean#L54): `definition`. | |
| 284 | -- [poissonKernelReal](ConditionalGoldbach/Definitions/Hardy.lean#L57): `definition`. | |
| 285 | -- [realConvolution](ConditionalGoldbach/Definitions/Hardy.lean#L59): `definition`. | |
| 286 | -- [poissonAction](ConditionalGoldbach/Definitions/Hardy.lean#L62): `definition`. | |
| 287 | -- [diagonalVector](ConditionalGoldbach/Definitions/Hardy.lean#L65): `definition`. | |
| 288 | -- [interiorLine](ConditionalGoldbach/Definitions/HardyTraces.lean#L20): `definition`. | |
| 289 | -- [IsBoundaryTrace](ConditionalGoldbach/Definitions/HardyTraces.lean#L24): `definition`. | |
| 290 | -- [boundaryTraces](ConditionalGoldbach/Definitions/HardyTraces.lean#L36): `definition`. | |
| 291 | -- [paperInner](ConditionalGoldbach/Definitions/Hilbert.lean#L15): `definition`. | |
| 292 | -- [IsHilbertSchmidt](ConditionalGoldbach/Definitions/Hilbert.lean#L18): `definition`. | |
| 293 | -- [hsNorm](ConditionalGoldbach/Definitions/Hilbert.lean#L22): `definition`. | |
| 294 | -- [IsPositiveTraceClass](ConditionalGoldbach/Definitions/Hilbert.lean#L27): `definition`. | |
| 295 | -- [positiveTrace](ConditionalGoldbach/Definitions/Hilbert.lean#L32): `definition`. | |
| 296 | -- [SpectralData](ConditionalGoldbach/Definitions/Hilbert.lean#L37): `definition`. | |
| 297 | -- [eigenvalues](ConditionalGoldbach/Definitions/Hilbert.lean#L44): `definition`. | |
| 298 | -- [positiveFredholmDet](ConditionalGoldbach/Definitions/Hilbert.lean#L48): `definition`. | |
| 299 | -- [fredholmSquareDet](ConditionalGoldbach/Definitions/Hilbert.lean#L52): `definition`. | |
| 300 | -- [RealizationValid](ConditionalGoldbach/Definitions/Hypotheses.lean#L19): `definition`. | |
| 301 | -- [zeroFreeWidth](ConditionalGoldbach/Definitions/Hypotheses.lean#L22): `definition`. | |
| 302 | -- [IsAdmissible](ConditionalGoldbach/Definitions/Hypotheses.lean#L25): `definition`. | |
| 303 | -- [SpectralR](ConditionalGoldbach/Definitions/Hypotheses.lean#L29): `definition`. | |
| 304 | -- [SpectralZeroFree](ConditionalGoldbach/Definitions/Hypotheses.lean#L32): `definition`. | |
| 305 | -- [HypothesisR](ConditionalGoldbach/Definitions/Hypotheses.lean#L35): `definition`. | |
| 306 | -- [HypothesisS](ConditionalGoldbach/Definitions/Hypotheses.lean#L38): `definition`. | |
| 307 | -- [HypothesisRAt](ConditionalGoldbach/Definitions/Hypotheses.lean#L42): `definition`. | |
| 308 | -- [HypothesisSAt](ConditionalGoldbach/Definitions/Hypotheses.lean#L45): `definition`. | |
| 309 | -- [diagonalSeries](ConditionalGoldbach/Definitions/Model.lean#L18): `definition`. | |
| 310 | -- [densitySeries](ConditionalGoldbach/Definitions/Model.lean#L22): `definition`. | |
| 311 | -- [densityEulerProduct](ConditionalGoldbach/Definitions/Model.lean#L25): `definition`. | |
| 312 | -- [continuedDensity](ConditionalGoldbach/Definitions/Model.lean#L29): `definition`. | |
| 313 | -- [betaKernel](ConditionalGoldbach/Definitions/Model.lean#L32): `definition`. | |
| 314 | -- [gammaQuotient](ConditionalGoldbach/Definitions/Model.lean#L36): `definition`. | |
| 315 | -- [betaModel](ConditionalGoldbach/Definitions/Model.lean#L39): `definition`. | |
| 316 | -- [continuedModel](ConditionalGoldbach/Definitions/Model.lean#L42): `definition`. | |
| 317 | -- [residual](ConditionalGoldbach/Definitions/Model.lean#L47): `definition`. | |
| 318 | -- [residualIntegral](ConditionalGoldbach/Definitions/Model.lean#L50): `definition`. | |
| 319 | -- [betaGamma](ConditionalGoldbach/Definitions/Model.lean#L54): `definition`. | |
| 320 | -- [baselineProductR](ConditionalGoldbach/Definitions/Model.lean#L56): `definition`. | |
| 321 | -- [weightedKernel](ConditionalGoldbach/Definitions/Operators.lean#L19): `definition`. | |
| 322 | -- [kernelAction](ConditionalGoldbach/Definitions/Operators.lean#L22): `definition`. | |
| 323 | -- [RepresentsKernel](ConditionalGoldbach/Definitions/Operators.lean#L27): `definition`. | |
| 324 | -- [kernelOperator](ConditionalGoldbach/Definitions/Operators.lean#L31): `definition`. | |
| 325 | -- [residualOperator](ConditionalGoldbach/Definitions/Operators.lean#L35): `definition`. | |
| 326 | -- [arithmeticOperator](ConditionalGoldbach/Definitions/Operators.lean#L38): `definition`. | |
| 327 | -- [diagonalOperator](ConditionalGoldbach/Definitions/Operators.lean#L41): `definition`. | |
| 328 | -- [modelOperator](ConditionalGoldbach/Definitions/Operators.lean#L44): `definition`. | |
| 329 | -- [functionalValue](ConditionalGoldbach/Definitions/Operators.lean#L47): `definition`. | |
| 330 | -- [rieszVector](ConditionalGoldbach/Definitions/Operators.lean#L51): `definition`. | |
| 331 | -- [evaluationVector](ConditionalGoldbach/Definitions/Operators.lean#L56): `definition`. | |
| 332 | -- [diagonalHardyVector](ConditionalGoldbach/Definitions/Operators.lean#L60): `definition`. | |
| 333 | -- [spectralScale](ConditionalGoldbach/Definitions/Spectral.lean#L20): `definition`. | |
| 334 | -- [spectralComplex](ConditionalGoldbach/Definitions/Spectral.lean#L23): `definition`. | |
| 335 | -- [spectralPartialQuaternion](ConditionalGoldbach/Definitions/Spectral.lean#L27): `definition`. | |
| 336 | -- [spectralQuaternion](ConditionalGoldbach/Definitions/Spectral.lean#L32): `definition`. | |
| 337 | -- [IntrinsicEntire](ConditionalGoldbach/Definitions/Spectral.lean#L37): `definition`. | |
| 338 | -- [spectralWidthFromBound](ConditionalGoldbach/Definitions/Spectral.lean#L42): `definition`. | |
| 339 | -- [spectralRootParameter](ConditionalGoldbach/Definitions/Spectral.lean#L45): `definition`. | |
| 340 | -- [quaternionSlice](ConditionalGoldbach/Definitions/Spectral.lean#L48): `definition`. | |
| 341 | -- [complexQuaternion](ConditionalGoldbach/Definitions/Spectral.lean#L51): `definition`. | |
| 342 | -- [fueterOperator](ConditionalGoldbach/Definitions/Spectral.lean#L53): `definition`. | |
| 343 | -- [spectralPartialQuaternionReindexed](ConditionalGoldbach/Definitions/Spectral.lean#L57): `definition`. | |
| 344 | -- [centeredSpectralPartial](ConditionalGoldbach/Definitions/Spectral.lean#L63): `definition`. | |
| 345 | -- [IsWeight](ConditionalGoldbach/Definitions/Weights.lean#L17): `definition`. | |
| 346 | -- [companion](ConditionalGoldbach/Definitions/Weights.lean#L21): `definition`. | |
| 347 | -- [derivativeWeight](ConditionalGoldbach/Definitions/Weights.lean#L23): `definition`. | |
| 348 | -- [weightMass](ConditionalGoldbach/Definitions/Weights.lean#L26): `definition`. | |
| 349 | -- [mellinWeight](ConditionalGoldbach/Definitions/Weights.lean#L28): `definition`. | |
| 350 | -- [verticalMellin](ConditionalGoldbach/Definitions/Weights.lean#L31): `definition`. | |
| 351 | -- [differenceConvolution](ConditionalGoldbach/Definitions/Weights.lean#L34): `definition`. | |
| 352 | -- [sumConvolution](ConditionalGoldbach/Definitions/Weights.lean#L37): `definition`. | |
| 353 | -- [signedConvolution](ConditionalGoldbach/Definitions/Weights.lean#L40): `definition`. | |
| 354 | -- [normFunctional](ConditionalGoldbach/Definitions/Weights.lean#L43): `definition`. | |
| 355 | -- [weightEnergy](ConditionalGoldbach/Definitions/Weights.lean#L48): `definition`. | |
| 356 | -- [weightIntegral](ConditionalGoldbach/Definitions/Weights.lean#L51): `definition`. | |
| 357 | -- [functionalIntegrand](ConditionalGoldbach/Definitions/Weights.lean#L53): `definition`. | |
| 102 | +| 1742 | Goldbach and Euler, in letters: every even number greater than 2 is a sum of two primes. | | |
| 103 | +| 1973 | Chen Jingrun: every sufficiently large even number is a prime plus a number with at most two prime factors. | | |
| 104 | +| 2013 | Helfgott: every odd number from 7 on is a sum of three primes. The ternary problem is closed. | | |
| 105 | +| 2014 | Oliveira e Silva, Herzog and Pardi: every even number up to $4\cdot10^{18}$ checked, no exception. | | |
| 106 | +| 2026-11-13 | Li and Liu's preprint: GRH and hypothesis S imply Goldbach for every sufficiently large even number. | | |
| 107 | +| 2026-11-14 | The chain in Lean (Zhou). | | |
| 108 | +| 2026-11-20 | GRH in Lean (Alpöge, with Claude). | | |
| 109 | +| 2026-11-26 | R refuted in Lean (Fu, with Codex), not yet reviewed. | | |
| 110 | +| — | S: open. | | |
| 111 | + | |
| 112 | +## The conditional theorem | |
| 113 | + | |
| 114 | +Fix a nonzero smooth weight $\phi$ supported in $[1/3,2/3]$ with $0\le\phi\le1$ and $\phi(u)=\phi(1-u)$. For even $N$ let | |
| 115 | + | |
| 116 | +$$\mathcal G(N)=\frac1N\sum_{\substack{n+m=N\\ (nm,N)=1}}\Lambda(n)\Lambda(m)\,\phi\!\left(\frac nN\right)\phi\!\left(\frac mN\right), | |
| 117 | +\qquad \mathfrak S(N)=2C_2\prod_{p\mid N,\ p>2}\frac{p-1}{p-2}.$$ | |
| 118 | + | |
| 119 | +For $N>e^{10}$ satisfying GRH (the primitive Dirichlet characters of conductor dividing $N$), the paper constructs a | |
| 120 | +compact self-adjoint Hilbert–Schmidt operator $T_N$ with | |
| 121 | + | |
| 122 | +$$c_\phi\mathfrak S(N)-\mathcal G(N)=\langle T_N v_N,v_N\rangle,\qquad \|v_N\|^2\ll_\phi1,\qquad c_\phi=\int_0^1\phi^2 .$$ | |
| 123 | + | |
| 124 | +Its nonzero eigenvalues $\mu_j(N)$ define $\mathfrak X_N(q)=\prod_j\bigl(1-4\mu_j(N)^2\delta_N^{-2}q(1-q)\bigr)$ on the | |
| 125 | +quaternions, with $\delta_N=\sqrt{\mathfrak S(N)/N}\,(\log N)^{3/2}$. The paper's two hypotheses: | |
| 126 | + | |
| 127 | +- **S.** Fix $h(N)\to\infty$ with $\eta_N=h^2(N)(\log N)^3/(N\mathfrak S(N))\le1/4$. For every sufficiently large even | |
| 128 | + $N$ satisfying GRH, $\mathfrak X_N$ has no zero with $\operatorname{Re}q>1-\eta_N$. (This project's first draft | |
| 129 | + called it H.) | |
| 130 | +- **R.** For every sufficiently large even $N$ satisfying GRH, every zero of $\mathfrak X_N$ has $\operatorname{Re}q=1/2$. | |
| 131 | + | |
| 132 | +GRH + (S or R) gives $\mathcal G(N)=c_\phi\mathfrak S(N)+o(\mathfrak S(N))$, hence every sufficiently large even $N$ has | |
| 133 | +$\gg_\phi\mathfrak S(N)N/(\log N)^2$ ordered representations $N=p+q$ with both primes in $[N/3,2N/3]$. The Lean anchor | |
| 134 | +is `primePair_consequence`. | |
| 135 | + | |
| 136 | +## Where it stands (as of 2026-12-01) | |
| 137 | + | |
| 138 | +- **S is open.** By the paper's Theorem 6.1, S(h) is an operator-norm bound | |
| 139 | + $\|T_N\|\le\delta_N/(2\sqrt{\eta(1-\eta)})\approx\mathfrak S(N)/(2h)$. Leiming Fu proves that S holds for some $h$ | |
| 140 | + exactly when a uniform assertion about prime pairs holds at every sufficiently large even $N$, that is | |
| 141 | + $\|T_N\|/\mathfrak S(N)\to0$ (`some_S_iff`, at `56090686`): S is at least a uniform quantitative Goldbach. Some | |
| 142 | + admissible $h$ fail S; $h=\log N$ is undecided. Under GRH the paper's Theorem 6.2 gives $\|T_N\|\ll(\log N)^2$. | |
| 143 | + Nothing published by 2026-12-01 changes this. | |
| 144 | +- **The chain is machine-checked, not rebuilt.** Ziyu Zhou's Lean development | |
| 145 | + (<https://github.com/subfish-zhou/conditional-goldbach-lean> at `c55db645`, Lean 4.35.0) records 102 reviewed | |
| 146 | + declarations and 1,400 public theorems kernel-closed, no `sorry`, only the three standard axioms, and 218 comparator | |
| 147 | + targets. Its CI passed. On 2026-12-01 it had no commit after 2026-11-14 and still no licence, and nobody had rebuilt | |
| 148 | + it independently (piece V-4: rebuild it and run Comparator). The preprint is unchanged (same PDF, sha256 `998f35a7…`, downloaded again on | |
| 149 | + 2026-12-01), not on arXiv and not peer-reviewed (piece V-5); we found no statement by its authors since 2026-11-13. | |
| 150 | + Its claim to be the first conditional proof is contestable: Huang and Li (arXiv:2005.03811) derived large-N binary | |
| 151 | + Goldbach from Elliott–Halberstam-type hypotheses in 2020. | |
| 152 | +- **R is refuted in Lean, not yet reviewed.** Fu, with OpenAI Codex, proves `¬ ConditionalGoldbach.HypothesisR` on the | |
| 153 | + development's own definitions (<https://github.com/RaymondVoldemortFu/li-liu-spectral-hypotheses-lean> at `56090686`, | |
| 154 | + 2026-11-26, unchanged on 2026-12-01); his logs show the Lean kernel, nanoda and con-leche accepting it. Yilin Liu's | |
| 155 | + AI-generated note (hexagon:2611.00788, still v1) argues the same, partial re-checks of that note agree (piece V-6 | |
| 156 | + lists them), and we found no public challenge. Bringing his proof into this library is V-1. Fu's tree also derives the development's GRH for every $N$ | |
| 157 | + from `grh-compact` (`local_GRH`): half of V-3. | |
| 158 | +- **GRH is this project's premise.** On 2026-11-20 Levent Alpöge, working with Claude, released a Lean proof whose | |
| 159 | + theorems include GRH for Dirichlet $L$-functions; it and Luke Sernau's shorter version | |
| 160 | + (<https://github.com/lsernau/grh-lean> at `72fead10`, 2026-11-25) pass independent machine checks with only Lean's | |
| 161 | + standard axioms (Andrew Sutherland, <https://math.mit.edu/~drew/grh/>, updated 2026-11-27; Michael Rubinstein, | |
| 162 | + 2026-11-26). The Lean FRO and Mathlib Initiative statement of 2026-11-21 certifies RH only; no mathematician has | |
| 163 | + refereed the proof; Clay's RH page has read "Active" since 2026-11-24. **This project takes GRH as a premise and | |
| 164 | + certifies nothing about it**; `grh-compact` lets it be discharged in Lean (piece V-3). | |
| 165 | +- **Around the chain: claims, and one classical bound newly in Lean.** Under GRH the exceptional set $E(X)$, the even | |
| 166 | + $n\le X$ that are not sums of two primes, is $\ll X^{1/2}(\log X)^3$ (Goldston 1992; Kaczorowski–Perelli–Pintz | |
| 167 | + 1993). On 2026-12-01 that bound, in the form $E(X)\le C\sqrt X(\log X)^4$, became a Lean theorem on goldbach.tech, as | |
| 168 | + the proof of a statement taken from H. Li and Z. Liu's arXiv:2610.26756 | |
| 169 | + (<https://github.com/CGandGameEngineLearner/goldbach-proofs/commit/1f8c552f>). AI-generated Lean developments that | |
| 170 | + import the Lean GRH claim $X^{69/200+\varepsilon}$ (alpha-squared-labs/Lean-Goldbach, 2026-11-28) and | |
| 171 | + $X^{29/225+\varepsilon}$ (Droll, hexagon:2611.01394, 2026-12-01); nobody has audited their statements. Chen's $1+2$ | |
| 172 | + and J. Li–J. Liu's $1+1.9$ are formalized in Lean (Zhou, <https://github.com/subfish-zhou/goldbach-lean>); | |
| 173 | + $p+P_3$ and $p+P_4$ under GRH are claimed on goldbach.tech and marked there as awaiting independent review | |
| 174 | + (2026-11-26 and 11-27). Unreviewed computations report $\|T_N\|>\delta_N$ at some finite $N$ (Meng, | |
| 175 | + hexagon:2611.00966, 2026-11-29, and others); that would not refute R, which is about all sufficiently large $N$. The | |
| 176 | + **A** pieces audit these claims one at a time. | |
| 177 | +- **Appendix B** has eleven numerical groups. B-08 (the 905 prime pairs of 30030) is proved in Lean by | |
| 178 | + `decide +kernel`, and the challenge has it; B-01's two rationals in Lean are piece C-2; the rest are not formalized. | |
| 179 | +- **Elsewhere.** The other public effort on Goldbach this fortnight is goldbach.tech (<https://www.goldbach.tech/>, | |
| 180 | + repository <https://github.com/CGandGameEngineLearner/goldbach-proofs>, since 2026-11-23): people's agents prove Lean | |
| 181 | + statements the platform freezes, and its checker accepts the proofs. The statements it freezes are audited there by | |
| 182 | + its checker only; one was refuted on 2026-12-01 as mis-encoded (commit `7af95f56`). Its roadmap has dropped R, and an | |
| 183 | + open pull request there (#6142, 2026-11-29) prepares Lean definitions for S. Its accepted proofs are its own, neither | |
| 184 | + reviewed results nor this project's ([`docs/starting-points.md`](docs/starting-points.md)). | |
| 185 | + | |
| 186 | +## Layout | |
| 187 | + | |
| 188 | +- `ConditionalGoldbach/` (274 files, about 31,000 lines): the library. `Definitions/` holds the reviewed objects, | |
| 189 | + `Proofs/` the paper's sections; `ConditionalGoldbach.lean` imports it all. | |
| 190 | +- `verification/independent-audit/comparator-project/`: the challenge, its statement references and the bridges. | |
| 191 | +- `verification/`, `reference/`, `proof-status.json`: upstream's audit record and ledger, as published. | |
| 192 | +- `Open.lean`: the open statements. `checks/`, `docker/`: this project's CI. `KNOWN.md`: what was merged, what failed, | |
| 193 | + what to mind. | |
| 194 | + | |
| 195 | +## References | |
| 196 | + | |
| 197 | +1. Jiamin Li (李嘉旻) and Jianya Liu (刘建亚), *A conditional proof of the Goldbach conjecture*, preprint, Shandong | |
| 198 | + University, 2026-11-13: <https://mrc.sdu.edu.cn/info/1018/2193.htm> (PDF sha256 `998f35a7…`, 63 pages; in English: | |
| 199 | + <https://mrc.sdu.edu.cn/english/info/1018/1514.htm>). | |
| 200 | +2. Ziyu Zhou, Lean formalization of the paper, commit `c55db645`: <https://github.com/subfish-zhou/conditional-goldbach-lean>. | |
| 201 | +3. Leiming Fu, *Li–Liu spectral hypotheses in Lean* (¬R; criteria for S), commit `56090686`: <https://github.com/RaymondVoldemortFu/li-liu-spectral-hypotheses-lean>. | |
| 202 | +4. Yilin Liu, *Failure of the Li–Liu spectral hypothesis R under Dirichlet GRH*, hexagon:2611.00788 (AI-generated). | |
| 203 | +5. L. Alpöge with Claude, *Riemann hypothesis in Lean* (2026), community edition: | |
| 204 | + <https://github.com/leanprover-community/riemann-hypothesis>; Lean FRO and Mathlib Initiative statement, 2026-11-21; | |
| 205 | + the Lean community's post: <https://leanprover-community.github.io/blog/posts/riemann-hypothesis/>. | |
| 206 | +6. H. A. Helfgott, *The ternary Goldbach conjecture is true* (2013), arXiv:1312.7748. | |
| 207 | +7. T. Oliveira e Silva, S. Herzog and S. Pardi, *Empirical verification of the even Goldbach conjecture and computation | |
| 208 | + of prime gaps up to $4\cdot10^{18}$*, Math. Comp. 83 (2014), 2033–2060. | |
| 209 | +8. Huang and Li, arXiv:2005.03811 (2020): binary Goldbach for large N from Elliott–Halberstam-type hypotheses. | |
+94 −28 README.zh.md View file
| @@ -1,43 +1,109 @@ | ||
| 1 | -# Conditional Goldbach:证明工程 | |
| 1 | +# 从 GRH 到哥德巴赫:一起把 Lean 证明改好 | |
| 2 | 2 | |
| 3 | -[English](README.md) · [证明浏览页](progress.zh.html) · [公理台账](proof-status.json) | |
| 3 | +社区一起整理和维护李嘉旻、刘建亚约化的 Lean 证明:GRH 加上谱假设 S,推出每个足够大的偶数都是两个素数之和;并在 Lean 里解决 S。 | |
| 4 | 4 | |
| 5 | -原审阅的 102 条声明中,102 条证明依赖全部闭合,包含正文及附录 A/B。公共定理与辅助结果共 1400 条。主结论在 GRH 和谱条件 S/R 下给出充分大偶数的渐近式,常数与 h 的量词顺序与原文一致;171 个原定义通过定义体检查。 | |
| 5 | +> **现状,2026-12-01。** GRH 加 **S** 推出大偶数的哥德巴赫猜想,这条链已在 Lean 里证明,并由 Comparator 对照论文的陈述。更强的 | |
| 6 | +> 假设 **R** 已在别处的 Lean 里被否定(尚未评审)。**S** 仍是开放的。这里没有任何地方声称哥德巴赫猜想已被证明。 | |
| 6 | 7 | |
| 7 | -附录 B 的具体积分近似误差、由此推导的整数区间以及有限谱矩阵数值认证仍是独立的数值工作。一般误差传播与谱条件定理已证明;[直接枚举证书](verification/independent-audit/appendices/NumericCrossCheck.lean)给出 30030 的 905 个无序素数对。 | |
| 8 | +本项目要把证明改得**好用**(编译更快、更模块化)、**好读**(向 Mathlib 看齐,文档字符串说清陈述了什么,并对上论文编号)、**融入社区** | |
| 9 | +(Mathlib 已有的结果就用它的);并在这个库里解决 `Open.lean` 里的开放命题(某个具体权下的 S、对某个权成立的 S、单调性、否定 R)。 | |
| 8 | 10 | |
| 9 | -## 构建与验证 | |
| 11 | +**不要**:只说自己机器上编译通过、Comparator 跑过却没有站点能核对的东西;约化用不到的文件;任何改变“证明了什么”或开放命题的改动, | |
| 12 | +`challenge` 检验会让它失败。 | |
| 10 | 13 | |
| 11 | -在本目录运行日常检查: | |
| 14 | +## 从哪里来 | |
| 12 | 15 | |
| 13 | -```bash | |
| 14 | -python3 scripts/check_project.py | |
| 15 | -``` | |
| 16 | +本仓库从 [subfish-zhou/conditional-goldbach-lean](https://github.com/subfish-zhou/conditional-goldbach-lean) 的 | |
| 17 | +`c55db645f3b4aed00374fe4aa1fcee2428c88c4b`(2026-11-14)的 `formalization/` 文件夹开始:周子瑜的 Lean 库,带它自己的独立 | |
| 18 | +Comparator 审计(`verification/independent-audit/`)。没带过来的(`upstream.json`):生成的进度报告及截图、生成它们的 Python 和 | |
| 19 | +Node 脚本,以及 `reference/Reviewed.lean`(为作者评审准备的、用 `sorry` 写的论文陈述,没有库会编译它)。这个库是周子瑜(Ziyu Zhou)的工作,在此致谢;上游没有声明许可证。 | |
| 20 | + | |
| 21 | +## 证明了什么,怎么判 | |
| 22 | + | |
| 23 | +这个库在 GRH 和 S(或 R)下证明了 `theorem_1_1`、`theorem_1_2` 和 `primePair_consequence`,保留论文的量词顺序和常数依赖; | |
| 24 | +它的账本(`proof-status.json`)记录 102 条评审过的声明全部有完整的证明依赖,没有 `sorry`,只用 `propext`、`Classical.choice`、`Quot.sound`。 | |
| 25 | + | |
| 26 | +上游的独立审计不看库自己的陈述文件,直接从论文的 TeX 源重新写出陈述:`TexAuditComparator/Challenge.lean` 用 `sorry` 写出其中 | |
| 27 | +218 条(论文的 103 条结果、96 个定义和 19 条审计事实,来自 `Reference14.lean`、`Reference57.lean`、`ReferenceAB.lean`), | |
| 28 | +`Solution.lean` 经 `Bridges*` 从库里证明它们。[`comparator.json`](comparator.json) 核对解答证的正是这些陈述,除三条标准公理外 | |
| 29 | +不用别的,Lean 内核和 nanoda 都接受。上游自己运行时 385 秒通过,三个故意改错的对照(条件、量词、定义)都被拒绝。 | |
| 30 | + | |
| 31 | +**这些文件不能改:** `Challenge.lean`、`Reference14.lean`、`Reference57.lean`、`ReferenceAB.lean`、`comparator.json` 和开放命题 | |
| 32 | +[`Open.lean`](Open.lean)。编译配置中 Comparator 依赖的部分也一样。 | |
| 16 | 33 | |
| 17 | -完整发布检查包含独立 Comparator、三项负向对照、双语页面测试及验证证据的篡改测试: | |
| 34 | +| 检验 | 做什么 | | |
| 35 | +|---|---| | |
| 36 | +| `challenge` | 每次推送,几秒:不能改的文件与批准的一致;`lakefile.toml` 只许改 `require` 的 `rev`、`leanOptions`、`defaultTargets`、`lean_exe`、`[cache]`;依赖包只来自 leanprover、leanprover-community,或本项目信任的 goldbach-lean、LeanArchitect;工具链是正式发布版;没有 `lakefile.lean`,`.lake/` 下没有文件;不能改的文件以外没有 `sorry`、`admit`、`axiom`、`native_decide`、`implemented_by`、`extern` | | |
| 37 | +| `build` | 在本项目的 Lean 镜像([`docker/`](docker/README.md))里、不联网:`lake build` 无错,不能改的文件以外没有模块报告用了 `sorry` 的声明,`lake comparator --config comparator.json` 说两个内核都接受 | | |
| 38 | +| 站点的维护者 | 每个 PR:是不是我们要的改动(见 [`AGENTS.md`](AGENTS.md)),是否更好读 | | |
| 18 | 39 | |
| 19 | -```bash | |
| 20 | -python3 scripts/verify_project.py | |
| 21 | -python3 scripts/render_verified.py | |
| 22 | -python3 scripts/test_verification.py | |
| 23 | -python3 scripts/package_verified.py | |
| 40 | +两项检验都卡合并。 | |
| 41 | + | |
| 42 | +## 编译 | |
| 43 | + | |
| 44 | +```sh | |
| 45 | +lake exe cache get | |
| 46 | +lake build | |
| 47 | +lake comparator --config comparator.json # Lean v4.35.0 自带;需要 bubblewrap | |
| 24 | 48 | ``` |
| 25 | 49 | |
| 26 | -工具链固定 Lean 4.35.0;依赖与安装见[依赖说明](../docs/dependencies.zh.md)。审阅工具用 `python3 -m pip install -r requirements-review.txt`、`npm ci` 和 `npx playwright install chromium` 安装;现成页面可离线阅读。 | |
| 50 | +我们的 `lakefile.toml` 就是上游的,多了两个库:`TexAuditComparator`(审计的 Comparator 项目,仍放在上游原来的位置)和 `Open` | |
| 51 | +(开放命题),所以一个包同时编译库、挑战和开放命题。 | |
| 52 | + | |
| 53 | +## 参与方式 | |
| 54 | + | |
| 55 | +入门是 `build` 能判定的改动:**S-1**(S 关于权单调)、**P-1**(修好一个文件夹的 linter 警告)、**M-1**(把一条 Mathlib 已有的引理换成 | |
| 56 | +Mathlib 的)、**V-4**(重建这个库并跑 Comparator)。开放命题是 S-1、S-4、S-5(`Open.lean`)和 V-1(在本库里证明 ¬R);C-2 把 B-01 | |
| 57 | +的两个有理数放进内核;P-2、D-1、M-1 让证明更好读。复核与研究让记录保持诚实,由读者判定:审计 **A-1…A-10**(每块一条别处的说法, | |
| 58 | +可以很多人同时做)、状态表 **L-1**、关于 S 的研究(**S-2**、**S-3**)、把 ¬R 当数学读一遍(**V-6**)。可以固定版本的起点(Lean 和 | |
| 59 | +数值)见 [`docs/starting-points.md`](docs/starting-points.md)。 | |
| 27 | 60 | |
| 28 | -[开发与公共接口指南](../docs/development.zh.md)说明两类验证的范围、CI 和接口兼容检查。[按用途选择导入入口](../docs/imports.zh.md)列出独立消费者及其依赖边界。 | |
| 61 | +站点在每次推送后几分钟内读 PR;平台的值守 agent(`shoal-maintainer`)每两小时来一次,被 @ 时几分钟内就来:重建提交声称的结果、回答 | |
| 62 | +问题、更新“现状”;它留给人的事由人来定。 | |
| 29 | 63 | |
| 30 | -## 验证材料 | |
| 64 | +## 结构 | |
| 31 | 65 | |
| 32 | -- `proof-status.json`:递归检查定理类型与证明的公理依赖,允许 `propext`、`Classical.choice`、`Quot.sound`。 | |
| 33 | -- `reviewed-types.json`:核对 102 条完整定理类型,包括假设、结论和量词。 | |
| 34 | -- `reviewed-definitions.json`:核对 171 个原定义的声明和函数体。 | |
| 35 | -- `verification/public-api.json`:核对 1621 个旧公共声明的类型,包括参数名、顺序和隐式性。 | |
| 36 | -- `verification/entrypoints.json`:独立导入消费者、实际依赖清单和导入上限。 | |
| 37 | -- `verification/proof-policy.json`:检查所有生产模块可达,编译放宽选项仅允许局部作用。 | |
| 38 | -- `verification.json`:汇总构建与验证记录。 | |
| 39 | -- [独立审计页](verification/independent-audit/report.zh.html):原始 TeX 审阅、表示桥梁与比较器结果。 | |
| 66 | +`ConditionalGoldbach/`(274 个文件,约 3.1 万行)是这个库;`verification/independent-audit/comparator-project/` 是挑战、陈述参考 | |
| 67 | +和桥接;`verification/`、`reference/`、`proof-status.json` 是上游原样发布的审计记录和账本;`Open.lean` 是开放命题;`checks/`、 | |
| 68 | +`docker/` 是本项目的 CI。 | |
| 40 | 69 | |
| 41 | -## 定义与分析层 | |
| 70 | +## 现状(截至 2026-12-01) | |
| 42 | 71 | |
| 43 | -`GeometryCore` 提供不依赖积分模块的基础几何定义;`BoundaryIntegral` 单独提供边界积分。`Analysis/L2Fourier` 仅依赖 Mathlib,提供 Fourier 与 L² 缩放接口;`Analysis/SpectralData` 提供 Hilbert 空间谱数据引理。旧模块路径和公共定理名保留。`reference/Reviewed.lean` 保留早期陈述审阅快照。完整模块索引及 102 条声明的源码链接见[英文 README](README.md)。 | |
| 72 | +- **S 仍然开放。** 由论文的定理 6.1,S(h) 就是算子范数估计 | |
| 73 | + $\|T_N\|\le\delta_N/(2\sqrt{\eta(1-\eta)})\approx\mathfrak S(N)/(2h)$。符雷鸣(Leiming Fu)证明:存在某个 $h$ 使 S | |
| 74 | + 成立,当且仅当在每个充分大的偶数 $N$ 上素数对满足一个一致的断言,也就是 $\|T_N\|/\mathfrak S(N)\to0$(`some_S_iff`, | |
| 75 | + 提交 `56090686`):S 至少是一个一致的定量哥德巴赫。某些可允许的 $h$ 使 S 不成立,$h=\log N$ 尚未判定。在 GRH 下,论文的 | |
| 76 | + 定理 6.2 给出 $\|T_N\|\ll(\log N)^2$。到 2026-12-01 为止,没有发表的工作改变这一点。 | |
| 77 | +- **这条链:机器检查过,还没人重建。** Ziyu Zhou 的 Lean 开发 | |
| 78 | + (<https://github.com/subfish-zhou/conditional-goldbach-lean>,提交 `c55db645`,Lean 4.35.0)记录:102 条审阅过的声明、 | |
| 79 | + 1400 条公开定理通过内核检查,没有 `sorry`,只用三条标准公理,218 个 comparator 目标。它的 CI 通过了。2026-12-01 查看时, | |
| 80 | + 它 11-14 之后没有新提交,仍未声明许可,也还没有人独立重建(子任务 V-4)。预印本没有变化(同一个 PDF,sha256 | |
| 81 | + `998f35a7…`,2026-12-01 重新下载),不在 arXiv 上,未经同行评审(子任务 V-5);我们没有找到作者 11-13 之后的公开表态。 | |
| 82 | + 它“首个条件性证明”的说法有争议:Huang 和 Li 在 2020 年(arXiv:2005.03811)已经从 Elliott–Halberstam 型假设推出大偶数的 | |
| 83 | + 二元哥德巴赫。 | |
| 84 | +- **R 已在 Lean 中被否定,尚未审阅。** 符雷鸣借助 OpenAI Codex,在这套开发自己的定义上证明了 | |
| 85 | + `¬ ConditionalGoldbach.HypothesisR`(<https://github.com/RaymondVoldemortFu/li-liu-spectral-hypotheses-lean>,提交 | |
| 86 | + `56090686`,2026-11-26,12-01 无变化);他的日志显示 Lean 内核、nanoda 和 con-leche 都接受了。Yilin Liu 的 AI 生成短文 | |
| 87 | + (hexagon:2611.00788,仍是 v1)给出同样的结论,几份对它的部分复核也一致(子任务 V-6 列出),我们没有找到公开的反驳。 | |
| 88 | + 把他的证明带进本库是 V-1。他的仓库还用 `grh-compact` 推出了这套开发对每个 $N$ 的 GRH(`local_GRH`):这是 V-3 的一半。 | |
| 89 | +- **GRH 是本项目的前提。** 2026-11-20,Levent Alpöge 借助 Claude 公布了一个 Lean 证明,其定理包括 Dirichlet $L$ 函数的 | |
| 90 | + GRH;它和 Luke Sernau 的精简版(<https://github.com/lsernau/grh-lean>,提交 `72fead10`,2026-11-25)都通过了独立的机器 | |
| 91 | + 检查,只用 Lean 的标准公理(Andrew Sutherland,<https://math.mit.edu/~drew/grh/>,11-27 更新;Michael Rubinstein, | |
| 92 | + 11-26)。Lean FRO 与 Mathlib Initiative 2026-11-21 的联合声明只认证 RH;还没有数学家审稿;Clay 的 RH 页面自 11-24 起标为 | |
| 93 | + “Active”。**本项目把 GRH 当作前提,不为它背书**;`grh-compact` 可以在 Lean 里把它消掉(子任务 V-3)。 | |
| 94 | +- **链条周边:一些说法,和一个刚进 Lean 的经典界。** 在 GRH 下,例外集 $E(X)$(不超过 $X$、不能写成两个素数之和的偶数 | |
| 95 | + 个数)满足 $E(X)\ll X^{1/2}(\log X)^3$(Goldston 1992;Kaczorowski–Perelli–Pintz 1993)。2026-12-01,这个界以 | |
| 96 | + $E(X)\le C\sqrt X(\log X)^4$ 的形式在 goldbach.tech 上成为 Lean 定理,作为从 H. Li 与 Z. Liu 的 arXiv:2610.26756 取出的 | |
| 97 | + 一条陈述的证明(<https://github.com/CGandGameEngineLearner/goldbach-proofs/commit/1f8c552f>)。导入 Lean 版 GRH 的 | |
| 98 | + AI 生成 Lean 开发声称 $X^{69/200+\varepsilon}$(alpha-squared-labs/Lean-Goldbach,11-28)和 $X^{29/225+\varepsilon}$ | |
| 99 | + (Droll,hexagon:2611.01394,12-01),还没有人审计它们的陈述。陈景润的 $1+2$ 和 J. Li 与 J. Liu 的 $1+1.9$ 已在 Lean | |
| 100 | + 中形式化(Zhou,<https://github.com/subfish-zhou/goldbach-lean>);GRH 下的 $p+P_3$、$p+P_4$ 在 goldbach.tech 上是声明, | |
| 101 | + 那里标着待独立核验(11-26、11-27)。未经审阅的计算报告在某些有限的 $N$ 上 $\|T_N\|>\delta_N$(Meng, | |
| 102 | + hexagon:2611.00966,11-29,另有几份);即使成立也不否定 R,R 说的是所有充分大的 $N$。**A** 组子任务逐条审计这些说法。 | |
| 103 | +- **附录 B** 有 11 组数值。B-08(30030 的 905 个素数对)已在 Lean 中用 `decide +kernel` 证明,挑战里 | |
| 104 | + 有这条;B-01 的两个有理数进 Lean 是子任务 C-2;其余未形式化。 | |
| 105 | +- **别处。** 这两周另一个公开在做哥德巴赫的是 goldbach.tech(<https://www.goldbach.tech/>,仓库 | |
| 106 | + <https://github.com/CGandGameEngineLearner/goldbach-proofs>,2026-11-23 起):用户的 agent 证明平台冻结的 Lean 陈述, | |
| 107 | + 由它的检查器接受。它冻结的陈述只由它自己的检查器审核;2026-12-01 有一条因编码错误被否定(提交 `7af95f56`)。它的路线图 | |
| 108 | + 已经不再走 R,那里一个未合并的 PR(#6142,11-29)在为 S 准备 Lean 定义。它接受的证明是它自己的,既不是审阅过的结果, | |
| 109 | + 也不是本项目的结果([`docs/starting-points.md`](docs/starting-points.md))。 | |
+29 −0 checks/build.json added View file
| @@ -0,0 +1,29 @@ | ||
| 1 | +{ | |
| 2 | + "theorems": [], | |
| 3 | + "permitted_axioms": [ | |
| 4 | + "propext", | |
| 5 | + "Quot.sound", | |
| 6 | + "Classical.choice" | |
| 7 | + ], | |
| 8 | + "comparator_command": [ | |
| 9 | + "lake", | |
| 10 | + "comparator", | |
| 11 | + "--config" | |
| 12 | + ], | |
| 13 | + "comparator": [ | |
| 14 | + "comparator.json" | |
| 15 | + ], | |
| 16 | + "comparator_success": [ | |
| 17 | + "nanoda kernel accepts the solution", | |
| 18 | + "Lean default kernel accepts the solution", | |
| 19 | + "Your solution is okay!" | |
| 20 | + ], | |
| 21 | + "timeout": 10800, | |
| 22 | + "frozen": [ | |
| 23 | + "Open.lean", | |
| 24 | + "verification/independent-audit/comparator-project/TexAuditComparator/Challenge.lean", | |
| 25 | + "verification/independent-audit/comparator-project/TexAuditComparator/Reference14.lean", | |
| 26 | + "verification/independent-audit/comparator-project/TexAuditComparator/Reference57.lean", | |
| 27 | + "verification/independent-audit/comparator-project/TexAuditComparator/ReferenceAB.lean" | |
| 28 | + ] | |
| 29 | +} | |
+284 −0 checks/build.py added View file
| @@ -0,0 +1,284 @@ | ||
| 1 | +#!/usr/bin/env python3 | |
| 2 | +"""The `build` check: the pushed commit compiles, uses no `sorry`, its theorems depend only on the permitted axioms, | |
| 3 | +and Comparator accepts it against the approved challenge. | |
| 4 | + | |
| 5 | +Usage: build.py <commit's tree> [<build.json>] | |
| 6 | + | |
| 7 | +This is leanprover-community/riemann-hypothesis's `build.yml` ("lake build", the merge queue's required check), made a | |
| 8 | +check of this site, plus the Comparator run its README asks for. It runs in the project's Lean image (`docker/`), with | |
| 9 | +no network, on the site's runner, as root in the runner's container. | |
| 10 | + | |
| 11 | +The commit's Lean is code the check runs: an `#eval`, an `initialize` or an elaborator in it runs while Lean compiles | |
| 12 | +the file or imports it, and can print anything, including Comparator's success lines, or rewrite `lake` itself. So | |
| 13 | +nothing the commit's build prints is trusted, and none of its code runs as root: | |
| 14 | + | |
| 15 | +1. the approved version (the checkout this script is in, PROOF_APPROVED to override) is compiled as root, from the | |
| 16 | + image's `.lake`, and each Comparator configuration's challenge module is exported (`leanexport`) before anything of | |
| 17 | + the commit runs. Its definitions, not the commit's, are what the statements mean; | |
| 18 | +2. the commit's tree is copied to a folder of its own and given the image's `.lake` (the dependencies, read-only, and | |
| 19 | + a copy of the build of the approved main, made when the image was built): Lake then rebuilds only what the commit | |
| 20 | + changed. As `nobody`, it runs `lake build`, which must end without error and with no module reporting a | |
| 21 | + declaration that uses `sorry` except the challenge's own files (`frozen` in build.json: they state the theorems with | |
| 22 | + `sorry` on purpose); then it exports each configuration's solution module, and the theorems of build.json; | |
| 23 | +3. every process of `nobody` is killed; then, as `nobody`, `lake comparator --inadvisably-no-sandbox` judges each | |
| 24 | + export pair: the statements and the definitions they use as approved, no axiom beyond the permitted ones (a `sorry` | |
| 25 | + is the axiom `sorryAx`), and a replay through Lean's kernel (and nanoda, where the configuration asks). The | |
| 26 | + theorems of build.json are judged the same way against their own export: axioms and kernel. The judge reads text | |
| 27 | + exports only and never loads an `.olean` of the commit, so what it prints is the verdict. Comparator's own sandbox | |
| 28 | + (bwrap) cannot start in the runner's container (no user namespaces): step 2 stands in for it; | |
| 29 | +4. the commit's `lean-toolchain` must be the image's: a bump needs a new image (docker/README.md). | |
| 30 | + | |
| 31 | +The `sorry` scan of step 2 reads the commit's own build log, which the commit's code can write to: it catches an | |
| 32 | +honest `sorry` anywhere in the library, and a hidden one cannot reach a judged theorem, since step 3 reads the axioms | |
| 33 | +from the exports. Run as another user than root (tests, a machine of one's own) it does the same steps without | |
| 34 | +switching to `nobody`. | |
| 35 | + | |
| 36 | +Its last line says what held, or the first thing that did not. Exit 0 passes, 1 fails. | |
| 37 | +""" | |
| 38 | + | |
| 39 | +from __future__ import annotations | |
| 40 | + | |
| 41 | +import json | |
| 42 | +import os | |
| 43 | +import re | |
| 44 | +import shutil | |
| 45 | +import subprocess | |
| 46 | +import sys | |
| 47 | +import tempfile | |
| 48 | +from pathlib import Path | |
| 49 | + | |
| 50 | +SORRY = re.compile(r"declaration uses ['`]sorry['`]") | |
| 51 | +# where a warning comes from: "warning: Challenge.lean:2:8: declaration uses `sorry`" (a path, possibly ./ or absolute) | |
| 52 | +WHERE = re.compile(r"(?:^|\s)(?:\./)?([^\s:]+\.lean):\d+:\d+:") | |
| 53 | +NOBODY = 65534 # nobody:nogroup in Ubuntu | |
| 54 | +# What is exported with the theorems, as `lake comparator` asks when it exports by itself (Lean 4.35.0, | |
| 55 | +# src/lake/Lake/CLI/Check.lean: builtinTargets, primitiveTargets): the kernel's built-in constants, Quot when Quot.sound | |
| 56 | +# is permitted, then the configuration's theorems, axioms and definitions. | |
| 57 | +PRIMITIVES = [ | |
| 58 | + "Nat.add", "Nat.sub", "Nat.mul", "Nat.pow", "Nat.gcd", "Nat.div", "Nat.mod", "Nat.beq", "Nat.ble", "Nat.land", | |
| 59 | + "Nat.lor", "Nat.xor", "Nat.shiftLeft", "Nat.shiftRight", "String.ofList", "Char.ofNat", "List", "eagerReduce", | |
| 60 | + "Nat", "String", "String.mk", "Char", "optParam", "autoParam", "semiOutParam", "outParam", | |
| 61 | +] | |
| 62 | +QUOT = ["Quot", "Quot.mk", "Quot.lift", "Quot.ind"] | |
| 63 | +NO_SANDBOX = "WARNING: Sandbox disabled, this run is not trustworthy." | |
| 64 | + | |
| 65 | + | |
| 66 | +class Wrong(Exception): | |
| 67 | + pass | |
| 68 | + | |
| 69 | + | |
| 70 | +ROOT = os.geteuid() == 0 | |
| 71 | + | |
| 72 | + | |
| 73 | +def toolchain_bin(cwd: Path) -> str: | |
| 74 | + """The toolchain's own bin folder (elan puts only lean, lake and leanchecker on PATH; Comparator looks nanoda_bin | |
| 75 | + up on PATH), or nothing where elan is not there.""" | |
| 76 | + try: | |
| 77 | + return str(Path(subprocess.run(["elan", "which", "lean"], cwd=cwd, capture_output=True, text=True, timeout=60, | |
| 78 | + check=True).stdout.strip()).parent) | |
| 79 | + except (OSError, subprocess.SubprocessError): | |
| 80 | + return "" | |
| 81 | + | |
| 82 | + | |
| 83 | +BIN = "" # set in main: the toolchain's bin folder, first on every PATH below | |
| 84 | + | |
| 85 | + | |
| 86 | +def env_for(home: Path) -> dict[str, str]: | |
| 87 | + """What a process of the commit or the judge sees: the image's PATH and elan, a HOME of its own, and git told | |
| 88 | + that the image's repositories, which root owns, are safe to read (Lake asks git about each package).""" | |
| 89 | + keep = {k: v for k, v in os.environ.items() if k in ("PATH", "ELAN_HOME", "LANG", "LC_ALL")} | |
| 90 | + if BIN: | |
| 91 | + keep["PATH"] = f"{BIN}:{keep.get('PATH', '/usr/bin:/bin')}" | |
| 92 | + return {**keep, "HOME": str(home), "GIT_CONFIG_COUNT": "1", "GIT_CONFIG_KEY_0": "safe.directory", | |
| 93 | + "GIT_CONFIG_VALUE_0": "*"} | |
| 94 | + | |
| 95 | + | |
| 96 | +def run(cmd: list[str], cwd: Path, timeout: int, log: Path | None = None, *, nobody: bool = False, | |
| 97 | + env: dict[str, str] | None = None, out=None) -> str: | |
| 98 | + """Run a command, keep what it printed in `log`, and fail with its last lines if it fails. With `out`, its standard | |
| 99 | + output goes to that file instead. With `nobody` (and as root), it runs as nobody, with no supplementary group.""" | |
| 100 | + print(f"$ {' '.join(cmd)}", flush=True) | |
| 101 | + who = {"user": NOBODY, "group": NOBODY, "extra_groups": []} if nobody and ROOT else {} | |
| 102 | + try: | |
| 103 | + p = subprocess.run(cmd, cwd=cwd, stdout=out or subprocess.PIPE, stderr=subprocess.STDOUT if out is None else subprocess.PIPE, | |
| 104 | + text=True, timeout=timeout, env=env, **who) | |
| 105 | + except subprocess.TimeoutExpired: | |
| 106 | + raise Wrong(f"{' '.join(cmd)} took longer than {timeout} s") | |
| 107 | + said = (p.stdout if out is None else p.stderr) or "" | |
| 108 | + if log: | |
| 109 | + log.write_text(said, encoding="utf-8") | |
| 110 | + tail = "\n".join(said.replace(NO_SANDBOX, "").strip().splitlines()[-25:]) | |
| 111 | + if tail: | |
| 112 | + print(tail, flush=True) | |
| 113 | + if p.returncode != 0: | |
| 114 | + raise Wrong(f"{' '.join(cmd)} ended with exit {p.returncode}") | |
| 115 | + return said | |
| 116 | + | |
| 117 | + | |
| 118 | +def kill_nobody() -> None: | |
| 119 | + """End every process of nobody at once: kill -1 from nobody reaches exactly those, itself included.""" | |
| 120 | + if ROOT: | |
| 121 | + subprocess.run(["bash", "-c", "kill -KILL -1"], user=NOBODY, group=NOBODY, extra_groups=[], | |
| 122 | + stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) | |
| 123 | + | |
| 124 | + | |
| 125 | +def give_lake(base: Path, project: Path) -> None: | |
| 126 | + """The image's .lake for a project: its packages shared and read-only (a symbolic link), the rest a copy.""" | |
| 127 | + (project / ".lake").mkdir() | |
| 128 | + for entry in (base / ".lake").iterdir(): | |
| 129 | + if entry.name == "packages": | |
| 130 | + (project / ".lake" / "packages").symlink_to(entry) | |
| 131 | + elif entry.is_dir(): | |
| 132 | + shutil.copytree(entry, project / ".lake" / entry.name, symlinks=True) | |
| 133 | + else: | |
| 134 | + shutil.copy2(entry, project / ".lake" / entry.name) | |
| 135 | + | |
| 136 | + | |
| 137 | +def chown_nobody(folder: Path) -> None: | |
| 138 | + if ROOT: | |
| 139 | + for here, dirs, files in os.walk(folder): | |
| 140 | + os.chown(here, NOBODY, NOBODY) | |
| 141 | + for name in files + [d for d in dirs if (Path(here) / d).is_symlink()]: | |
| 142 | + os.lchown(Path(here) / name, NOBODY, NOBODY) | |
| 143 | + | |
| 144 | + | |
| 145 | +def targets(config: dict) -> list[str]: | |
| 146 | + axioms = config["permitted_axioms"] | |
| 147 | + return (QUOT if "Quot.sound" in axioms else []) + config.get("theorem_names", []) + axioms + PRIMITIVES \ | |
| 148 | + + config.get("definition_names", []) | |
| 149 | + | |
| 150 | + | |
| 151 | +def export(module: str, names: list[str], dest: Path, cwd: Path, timeout: int, nobody: bool, env: dict[str, str]) -> None: | |
| 152 | + with dest.open("w") as f: | |
| 153 | + run(["lake", "env", "leanexport", module, "--", *names], cwd, timeout, nobody=nobody, env=env, out=f) | |
| 154 | + | |
| 155 | + | |
| 156 | +def imports_of(path: Path) -> list[str]: | |
| 157 | + """The modules a file's header imports.""" | |
| 158 | + found = [] | |
| 159 | + for line in path.read_text(encoding="utf-8").splitlines(): | |
| 160 | + m = re.match(r"\s*(?:public\s+)?import\s+(.+)", line) | |
| 161 | + if m: | |
| 162 | + found += m.group(1).split() | |
| 163 | + elif line.strip() and not line.lstrip().startswith(("--", "/-", "module", "prelude")): | |
| 164 | + break | |
| 165 | + return found | |
| 166 | + | |
| 167 | + | |
| 168 | +def main(argv: list[str]) -> int: | |
| 169 | + if len(argv) < 2: | |
| 170 | + print(__doc__.strip().splitlines()[2]) | |
| 171 | + return 2 | |
| 172 | + tree = Path(argv[1]).resolve() | |
| 173 | + spec = json.loads((Path(argv[2]) if len(argv) > 2 else Path(__file__).with_name("build.json")).read_text(encoding="utf-8")) | |
| 174 | + approved = Path(os.environ.get("PROOF_APPROVED") or Path(__file__).resolve().parents[1]) | |
| 175 | + base = Path(os.environ.get("PROOF_BASE", "/opt/proof")) | |
| 176 | + timeout = int(spec.get("timeout", 6 * 3600)) | |
| 177 | + logs = Path(os.environ.get("BUILD_LOGS", ".")).resolve() | |
| 178 | + logs.mkdir(parents=True, exist_ok=True) | |
| 179 | + work = Path(tempfile.mkdtemp(prefix="build-")) | |
| 180 | + os.chmod(work, 0o711) # nobody passes through to its own folders, and reads nothing else here | |
| 181 | + try: | |
| 182 | + if not (tree / "lakefile.toml").is_file(): | |
| 183 | + print("Nothing to check yet: the commit has no lakefile.toml.") | |
| 184 | + return 0 | |
| 185 | + if not (base / ".lake").is_dir(): | |
| 186 | + raise Wrong(f"{base}/.lake is not there: this check runs in the project's Lean image (docker/README.md)") | |
| 187 | + # 4. the image's toolchain (read, not run) | |
| 188 | + want = (tree / "lean-toolchain").read_text(encoding="utf-8").strip() | |
| 189 | + have = (base / "lean-toolchain").read_text(encoding="utf-8").strip() | |
| 190 | + if want != have: | |
| 191 | + raise Wrong(f"the commit asks for {want}; the image has {have}: a toolchain bump needs a new image (docker/README.md)") | |
| 192 | + global BIN | |
| 193 | + BIN = toolchain_bin(base) | |
| 194 | + configs = [(name, json.loads((approved / name).read_text(encoding="utf-8"))) for name in spec.get("comparator", [])] | |
| 195 | + theorems = spec.get("theorems", []) if spec.get("axioms_file") else [] | |
| 196 | + judge = work / "judge" | |
| 197 | + judge.mkdir() | |
| 198 | + # 1. the approved challenges, as root, before anything of the commit runs | |
| 199 | + if configs: | |
| 200 | + mine = work / "approved" | |
| 201 | + shutil.copytree(approved, mine, symlinks=True, ignore=shutil.ignore_patterns(".git", ".lake")) | |
| 202 | + give_lake(base, mine) | |
| 203 | + for i, (name, config) in enumerate(configs): | |
| 204 | + run(["lake", "build", config["challenge_module"]], mine, timeout, logs / f"challenge-{i}.log") | |
| 205 | + export(config["challenge_module"], targets(config), judge / f"challenge-{i}.export", mine, timeout, False, None) | |
| 206 | + # 2. the commit, as nobody, in a folder of its own | |
| 207 | + proof, home, solve = work / "proof", work / "home", work / "solve" | |
| 208 | + shutil.copytree(tree, proof, symlinks=True, ignore=shutil.ignore_patterns(".git", ".lake")) | |
| 209 | + give_lake(base, proof) | |
| 210 | + for folder in (home, solve): | |
| 211 | + folder.mkdir() | |
| 212 | + for folder in (proof, home, solve): | |
| 213 | + chown_nobody(folder) | |
| 214 | + env = env_for(home) | |
| 215 | + try: | |
| 216 | + out = run(["lake", "build"], proof, timeout, logs / "build.log", nobody=True, env=env) | |
| 217 | + frozen = tuple(spec.get("frozen", [])) | |
| 218 | + | |
| 219 | + def allowed(line: str) -> bool: | |
| 220 | + m = WHERE.search(line) | |
| 221 | + if not m: | |
| 222 | + return False | |
| 223 | + path = m.group(1) | |
| 224 | + path = path[len(str(proof)) + 1:] if path.startswith(str(proof) + "/") else path | |
| 225 | + return path in frozen | |
| 226 | + sorries = [line for line in out.splitlines() if SORRY.search(line) and not allowed(line)] | |
| 227 | + if sorries: | |
| 228 | + print("\n".join(sorries[:20])) | |
| 229 | + raise Wrong(f"the build reports {len(sorries)} declaration(s) that use sorry") | |
| 230 | + for i, (name, config) in enumerate(configs): | |
| 231 | + export(config["solution_module"], targets(config), solve / f"solution-{i}.export", proof, timeout, True, env) | |
| 232 | + if theorems: | |
| 233 | + # the theorems, in scope through the approved axioms file's imports, compiled as a module of their own | |
| 234 | + (solve / "ShoalTheorems.lean").write_text("".join(f"import {m}\n" for m in imports_of(approved / spec["axioms_file"]))) | |
| 235 | + chown_nobody(solve) | |
| 236 | + run(["lake", "env", "lean", "-R", str(solve), "-o", str(solve / "ShoalTheorems.olean"), str(solve / "ShoalTheorems.lean")], | |
| 237 | + proof, timeout, logs / "theorems.log", nobody=True, env=env) | |
| 238 | + config = {"permitted_axioms": spec["permitted_axioms"], "theorem_names": theorems} | |
| 239 | + export("ShoalTheorems", targets(config), solve / "theorems.export", proof, timeout, True, | |
| 240 | + {**env, "LEAN_PATH": str(solve)}) | |
| 241 | + finally: | |
| 242 | + kill_nobody() | |
| 243 | + # 3. the judge, as nobody, on the exports alone | |
| 244 | + for i, (name, config) in enumerate(configs): | |
| 245 | + # the configuration as parsed, where nobody can read it: the runner's job folder is closed to others (12-01) | |
| 246 | + mine_config = judge / f"{i}-{Path(name).name}" | |
| 247 | + mine_config.write_text(json.dumps(config)) | |
| 248 | + out = run(spec["comparator_command"] + [str(mine_config), "--challenge-from-export", str(judge / f"challenge-{i}.export"), | |
| 249 | + "--solution-from-export", str(solve / f"solution-{i}.export"), "--inadvisably-no-sandbox"], | |
| 250 | + judge, timeout, logs / f"comparator-{i}.log", nobody=True, env=env_for(judge)) | |
| 251 | + missing = [s for s in spec["comparator_success"] if s not in out] | |
| 252 | + if missing: | |
| 253 | + raise Wrong(f"Comparator on {name} did not say: {missing[0]}") | |
| 254 | + if theorems: | |
| 255 | + # Comparator with the theorems' export as both sides: the statements trivially agree, so what it judges is | |
| 256 | + # the axioms and the kernel's replay | |
| 257 | + gen = judge / "theorems.json" | |
| 258 | + gen.write_text(json.dumps({"challenge_module": "ShoalTheorems", "solution_module": "ShoalTheorems", "theorem_names": theorems, | |
| 259 | + "permitted_axioms": spec["permitted_axioms"]})) | |
| 260 | + out = run(spec["comparator_command"] + [str(gen), "--challenge-from-export", str(solve / "theorems.export"), | |
| 261 | + "--solution-from-export", str(solve / "theorems.export"), "--inadvisably-no-sandbox"], | |
| 262 | + judge, timeout, logs / "axioms.log", nobody=True, env=env_for(judge)) | |
| 263 | + if "Your solution is okay!" not in out: | |
| 264 | + raise Wrong("Comparator did not accept the theorems' axioms") | |
| 265 | + said = ["lake build passes with no sorry"] | |
| 266 | + if theorems: | |
| 267 | + said.append(f"{len(theorems)} theorem(s) on {', '.join(spec['permitted_axioms'])} only") | |
| 268 | + if configs: | |
| 269 | + said.append(f"Comparator accepts {', '.join(name for name, _ in configs)}") | |
| 270 | + print("ok: " + "; ".join(said)) | |
| 271 | + return 0 | |
| 272 | + except Wrong as e: | |
| 273 | + print(f"FAILED: {e}") | |
| 274 | + return 1 | |
| 275 | + except (OSError, ValueError, KeyError) as e: | |
| 276 | + print(f"FAILED: {e}") | |
| 277 | + return 1 | |
| 278 | + finally: | |
| 279 | + kill_nobody() | |
| 280 | + shutil.rmtree(work, ignore_errors=True) | |
| 281 | + | |
| 282 | + | |
| 283 | +if __name__ == "__main__": | |
| 284 | + sys.exit(main(sys.argv)) | |
+15 −0 checks/build.sbatch added View file
| @@ -0,0 +1,15 @@ | ||
| 1 | +#!/bin/bash | |
| 2 | +#SBATCH --job-name=lake-build | |
| 3 | +#SBATCH --partition=lean | |
| 4 | +#SBATCH --time=03:00:00 | |
| 5 | +#SBATCH --cpus-per-task=4 | |
| 6 | +#SBATCH --mem=20G | |
| 7 | +# lake build (upstream's build.yml), the sorry and axiom gates, and Comparator, on the pushed commit ($SS_INPUT), in the | |
| 8 | +# project's Lean image (docker/) with no network. The approved checks/build.py and checks/build.json say what is run; | |
| 9 | +# the image holds the toolchain, the dependencies and a build of the approved main, so only what the commit changed is | |
| 10 | +# rebuilt. Logs go beside the job's output. | |
| 11 | +set -euo pipefail | |
| 12 | +# the image holds Zhou's project, built, at /opt/goldbach/formalization (docker/lean-check.Dockerfile). The judge is one | |
| 13 | +# core: a clean main took 463 s at 8 CPUs, 479 s at 16 and 446 s at 4 through the runner, peaking at 10 GB (12-01, a2); | |
| 14 | +# 4 CPUs let twice as many pull requests be built at once | |
| 15 | +PROOF_BASE=/opt/goldbach/formalization BUILD_LOGS="$PWD/logs" python3 -I checks/build.py "$SS_INPUT" checks/build.json | |
+221 −0 checks/challenge.py added View file
| @@ -0,0 +1,221 @@ | ||
| 1 | +#!/usr/bin/env python3 | |
| 2 | +"""The `challenge` check: a push may change how the theorems are proved, never what is proved or how it is judged. | |
| 3 | + | |
| 4 | +Usage: challenge.py <commit's tree> [<frozen.json>] | |
| 5 | + | |
| 6 | +This is leanprover-community/riemann-hypothesis's `challenge-files.yml` ("Comparator challenge files and build | |
| 7 | +configuration are unchanged"), made a check of this site. Upstream compares a pull request's head with the commit it | |
| 8 | +branched off; here the approved version of the project is the reference, and `frozen.json`, beside this script in | |
| 9 | +that version, records what it holds: | |
| 10 | + | |
| 11 | +- `files`: the Comparator challenge, its configuration and the statements they import, each by its SHA-256. A commit | |
| 12 | + fails if any of them is missing or differs (Comparator would accept a change there, since both sides would see it). | |
| 13 | +- `lakefile`: `lakefile.toml` as approved, without the keys a pull request may change (FREE: `leanOptions`, | |
| 14 | + `defaultTargets`, `lean_exe`, `[cache]`, and each `require`'s `rev`). The libraries, their sources, Lean's arguments | |
| 15 | + and the dependencies' names and addresses stay as they are, so `Challenge` and the solution keep naming these files. | |
| 16 | +- `manifest`: the settings of `lake-manifest.json` (everything but its packages) and where Mathlib comes from. | |
| 17 | + | |
| 18 | +It also fails a commit that adds `lakefile.lean` (Lake reads it instead of `lakefile.toml`), lists a package that is not | |
| 19 | +a Git repository of leanprover or leanprover-community on GitHub nor one in `trusted`, names a toolchain that is not a | |
| 20 | +release of leanprover/lean4, adds files under `.lake/`, or holds a symbolic link among the frozen files; and, as | |
| 21 | +upstream's build does, one that puts `sorry`, `admit`, an `axiom`, `native_decide`, `implemented_by` or `extern` in its | |
| 22 | +Lean source (comments and strings skipped). | |
| 23 | + | |
| 24 | +A Mathlib or toolchain bump passes: it changes `rev`, the packages' revisions and `lean-toolchain`. The `build` check | |
| 25 | +then needs a Lean image for it. It reads files only and runs nothing from the commit. Standard library only, Python | |
| 26 | +3.11 or newer (tomllib). Exit 0 passes, 1 fails. | |
| 27 | +""" | |
| 28 | + | |
| 29 | +from __future__ import annotations | |
| 30 | + | |
| 31 | +import hashlib | |
| 32 | +import json | |
| 33 | +import os | |
| 34 | +import re | |
| 35 | +import sys | |
| 36 | +import tomllib | |
| 37 | +from pathlib import Path | |
| 38 | + | |
| 39 | +FREE = {"leanOptions", "defaultTargets", "lean_exe", "cache"} | |
| 40 | +TRUSTED = ("https://github.com/leanprover-community/", "https://github.com/leanprover/") | |
| 41 | +TOOLCHAIN = re.compile(r"leanprover/lean4:v[0-9][0-9A-Za-z.+-]*") | |
| 42 | +FORBIDDEN = [ | |
| 43 | + (re.compile(r"\bsorry\b"), "sorry"), | |
| 44 | + (re.compile(r"\bsorryAx\b"), "sorryAx"), # the axiom behind sorry, which \bsorry\b does not see | |
| 45 | + # the tactic, not a field or projection that happens to be called admit (`admit : P x`, `h.admit`, `admit (x)`) | |
| 46 | + (re.compile(r"(?<![.\w'])admit\b(?!['\w])(?![ \t]*[:(])"), "admit"), | |
| 47 | + (re.compile(r"(?m)^[ \t]*(?:@\[[^\]]*\][ \t]*)?(?:(?:private|protected|noncomputable)[ \t]+)*axiom\b"), "an axiom declaration"), | |
| 48 | + (re.compile(r"\bnative_decide\b"), "native_decide"), | |
| 49 | + (re.compile(r"\bimplemented_by\b"), "implemented_by"), | |
| 50 | + (re.compile(r"@\[\s*extern\b"), "extern"), | |
| 51 | +] | |
| 52 | +# a file without any of these words anywhere, comments included, needs no closer look | |
| 53 | +ANY = re.compile(r"sorry|admit|axiom|native_decide|implemented_by|extern") | |
| 54 | +SKIP_DIRS = {".git", ".lake", "lake-packages", "__pycache__", "node_modules"} | |
| 55 | + | |
| 56 | + | |
| 57 | +def strip(text: str) -> str: | |
| 58 | + """Lean source without its comments and string literals: `--` to the end of the line, nested `/- … -/`, and | |
| 59 | + "…" with its escapes. What is left is code, so a docstring that mentions `sorry` is not a `sorry`.""" | |
| 60 | + out: list[str] = [] | |
| 61 | + i, n, depth = 0, len(text), 0 | |
| 62 | + while i < n: | |
| 63 | + if depth: | |
| 64 | + if text.startswith("/-", i): | |
| 65 | + depth += 1 | |
| 66 | + i += 2 | |
| 67 | + elif text.startswith("-/", i): | |
| 68 | + depth -= 1 | |
| 69 | + i += 2 | |
| 70 | + else: | |
| 71 | + if text[i] == "\n": | |
| 72 | + out.append("\n") | |
| 73 | + i += 1 | |
| 74 | + continue | |
| 75 | + if text.startswith("/-", i): | |
| 76 | + depth = 1 | |
| 77 | + i += 2 | |
| 78 | + elif text.startswith("--", i): | |
| 79 | + j = text.find("\n", i) | |
| 80 | + i = n if j < 0 else j | |
| 81 | + elif text[i] == '"': | |
| 82 | + i += 1 | |
| 83 | + while i < n and text[i] != '"': | |
| 84 | + i += 2 if text[i] == "\\" else 1 | |
| 85 | + i += 1 | |
| 86 | + elif text[i] == "'" and i + 2 < n and text[i + 2] == "'": | |
| 87 | + i += 3 # a character literal such as '"' | |
| 88 | + else: | |
| 89 | + out.append(text[i]) | |
| 90 | + i += 1 | |
| 91 | + return "".join(out) | |
| 92 | + | |
| 93 | + | |
| 94 | +def sha256(path: Path) -> str: | |
| 95 | + h = hashlib.sha256() | |
| 96 | + with path.open("rb") as f: | |
| 97 | + for block in iter(lambda: f.read(1 << 20), b""): | |
| 98 | + h.update(block) | |
| 99 | + return h.hexdigest() | |
| 100 | + | |
| 101 | + | |
| 102 | +def lakefile_view(text: str) -> dict: | |
| 103 | + """lakefile.toml without what a pull request may change: upstream's `lakefile()`.""" | |
| 104 | + config = tomllib.loads(text) | |
| 105 | + view = {key: value for key, value in config.items() if key not in FREE} | |
| 106 | + view["require"] = [{key: value for key, value in require.items() if key != "rev"} for require in config.get("require", [])] | |
| 107 | + return view | |
| 108 | + | |
| 109 | + | |
| 110 | +def manifest_view(text: str) -> tuple[dict, dict]: | |
| 111 | + """lake-manifest.json's settings, and its packages by name: upstream's `manifest()`.""" | |
| 112 | + data = json.loads(text) | |
| 113 | + return {key: value for key, value in data.items() if key != "packages"}, {p.get("name"): p for p in data.get("packages", [])} | |
| 114 | + | |
| 115 | + | |
| 116 | +def canonical(value) -> str: | |
| 117 | + return json.dumps(value, sort_keys=True, ensure_ascii=False) | |
| 118 | + | |
| 119 | + | |
| 120 | +def frozen_of(root: Path, files: list[str], trusted: list[str]) -> dict: | |
| 121 | + """What frozen.json holds for a tree: run on the approved version to make it (`--freeze`).""" | |
| 122 | + settings, packages = manifest_view((root / "lake-manifest.json").read_text(encoding="utf-8")) | |
| 123 | + return { | |
| 124 | + "files": {path: sha256(root / path) for path in files}, | |
| 125 | + "lakefile": json.loads(canonical(lakefile_view((root / "lakefile.toml").read_text(encoding="utf-8")))), | |
| 126 | + "manifest": {"settings": settings, "mathlib": (packages.get("mathlib") or {}).get("url")}, | |
| 127 | + "trusted": trusted, | |
| 128 | + } | |
| 129 | + | |
| 130 | + | |
| 131 | +def lean_files(root: Path): | |
| 132 | + for here, dirs, names in os.walk(root): | |
| 133 | + dirs[:] = sorted(d for d in dirs if d not in SKIP_DIRS) | |
| 134 | + for name in sorted(names): | |
| 135 | + if name.endswith(".lean"): | |
| 136 | + yield Path(here) / name | |
| 137 | + | |
| 138 | + | |
| 139 | +def check(root: Path, frozen: dict) -> tuple[list[str], str]: | |
| 140 | + wrong: list[str] = [] | |
| 141 | + for rel, want in sorted(frozen["files"].items()): | |
| 142 | + p = root / rel | |
| 143 | + if p.is_symlink() or (p.exists() and not p.is_file()): | |
| 144 | + wrong.append(f"{rel} is not a plain file: it is a Comparator challenge file") | |
| 145 | + elif not p.is_file(): | |
| 146 | + wrong.append(f"{rel} is missing: it is a Comparator challenge file") | |
| 147 | + elif sha256(p) != want: | |
| 148 | + wrong.append(f"{rel} differs from the approved version: it is a Comparator challenge file") | |
| 149 | + if (root / "lakefile.lean").exists(): | |
| 150 | + wrong.append("lakefile.lean is added: Lake would read it instead of lakefile.toml") | |
| 151 | + try: | |
| 152 | + lake = root / "lakefile.toml" | |
| 153 | + if not lake.is_file() or canonical(lakefile_view(lake.read_text(encoding="utf-8"))) != canonical(frozen["lakefile"]): | |
| 154 | + wrong.append("lakefile.toml changes other than in a require's rev, leanOptions, defaultTargets, lean_exe or [cache]") | |
| 155 | + settings, packages = manifest_view((root / "lake-manifest.json").read_text(encoding="utf-8")) | |
| 156 | + if canonical(settings) != canonical(frozen["manifest"]["settings"]): | |
| 157 | + wrong.append("lake-manifest.json: its settings change") | |
| 158 | + if (packages.get("mathlib") or {}).get("url") != frozen["manifest"]["mathlib"]: | |
| 159 | + wrong.append("lake-manifest.json: where Mathlib comes from changes") | |
| 160 | + for name, package in packages.items(): | |
| 161 | + url = str(package.get("url")) | |
| 162 | + if package.get("type") != "git" or not (url.startswith(TRUSTED) or url in frozen.get("trusted", [])): | |
| 163 | + wrong.append(f"lake-manifest.json: the package {name} is not a Git repository of leanprover-community or leanprover on GitHub, nor one this project trusts") | |
| 164 | + except (OSError, ValueError, tomllib.TOMLDecodeError, AttributeError) as problem: | |
| 165 | + wrong.append(f"the build configuration could not be read: {problem}") | |
| 166 | + toolchain = (root / "lean-toolchain").read_text(encoding="utf-8").strip() if (root / "lean-toolchain").is_file() else "" | |
| 167 | + if not TOOLCHAIN.fullmatch(toolchain): | |
| 168 | + wrong.append(f"lean-toolchain: {toolchain!r} is not a release of leanprover/lean4") | |
| 169 | + if (root / ".lake").exists(): | |
| 170 | + wrong.append(".lake/ is added: Lake keeps what it builds and fetches there") | |
| 171 | + files = lines = 0 | |
| 172 | + for p in lean_files(root): | |
| 173 | + rel = p.relative_to(root).as_posix() | |
| 174 | + text = p.read_text(encoding="utf-8", errors="replace") | |
| 175 | + files += 1 | |
| 176 | + lines += text.count("\n") | |
| 177 | + if rel in frozen["files"] or not ANY.search(text): | |
| 178 | + continue | |
| 179 | + code = strip(text) | |
| 180 | + for rx, what in FORBIDDEN: | |
| 181 | + m = rx.search(code) | |
| 182 | + if m: | |
| 183 | + wrong.append(f"{rel}:{code.count(chr(10), 0, m.start()) + 1} uses {what}") | |
| 184 | + break | |
| 185 | + return wrong, f"{len(frozen['files'])} challenge files and the build configuration as approved; {files} Lean files, {lines} lines, toolchain {toolchain}" | |
| 186 | + | |
| 187 | + | |
| 188 | +def main(argv: list[str]) -> int: | |
| 189 | + if len(argv) >= 2 and argv[1] == "--freeze": | |
| 190 | + # challenge.py --freeze <approved tree> <frozen file>... [--trust <url>]...: print frozen.json for that tree | |
| 191 | + args, trusted = argv[3:], [] | |
| 192 | + while "--trust" in args: | |
| 193 | + i = args.index("--trust") | |
| 194 | + trusted.append(args[i + 1]) | |
| 195 | + del args[i:i + 2] | |
| 196 | + print(json.dumps(frozen_of(Path(argv[2]), args, trusted), indent=2, ensure_ascii=False)) | |
| 197 | + return 0 | |
| 198 | + if len(argv) < 2: | |
| 199 | + print(__doc__.strip().splitlines()[2]) | |
| 200 | + return 2 | |
| 201 | + root = Path(argv[1]) | |
| 202 | + frozen = json.loads((Path(argv[2]) if len(argv) > 2 else Path(__file__).with_name("frozen.json")).read_text(encoding="utf-8")) | |
| 203 | + if not any(lean_files(root)): | |
| 204 | + print("Nothing to check yet: the commit holds no Lean file.") | |
| 205 | + return 0 | |
| 206 | + wrong, said = check(root, frozen) | |
| 207 | + for w in wrong[:50]: | |
| 208 | + print(w) | |
| 209 | + if len(wrong) > 50: | |
| 210 | + print(f"… and {len(wrong) - 50} more") | |
| 211 | + if wrong: | |
| 212 | + print("These files say what the proof is judged against and how it is built, and a pull request may not change them;") | |
| 213 | + print("if one has to, open an issue titled \"Ruling: …\" for a person who maintains the project.") | |
| 214 | + print(f"FAILED: {wrong[0]}") | |
| 215 | + return 1 | |
| 216 | + print(f"ok: {said}") | |
| 217 | + return 0 | |
| 218 | + | |
| 219 | + | |
| 220 | +if __name__ == "__main__": | |
| 221 | + sys.exit(main(sys.argv)) | |
+10 −0 checks/challenge.sbatch added View file
| @@ -0,0 +1,10 @@ | ||
| 1 | +#!/bin/bash | |
| 2 | +#SBATCH --job-name=challenge | |
| 3 | +#SBATCH --time=5:00 | |
| 4 | +# Comparator challenge files and build configuration are unchanged (upstream's challenge-files.yml): the approved | |
| 5 | +# checks/challenge.py compares the pushed commit ($SS_INPUT) with what checks/frozen.json records of the approved | |
| 6 | +# version, and looks through its Lean source for sorry, admit, axiom and the like. It reads files only and runs nothing | |
| 7 | +# from the commit. The job's working directory is the approved version, so a branch that edits checks/ changes nothing | |
| 8 | +# about its own verdict. | |
| 9 | +set -euo pipefail | |
| 10 | +python3 -I checks/challenge.py "$SS_INPUT" checks/frozen.json | |
+46 −0 checks/frozen.json added View file
| @@ -0,0 +1,46 @@ | ||
| 1 | +{ | |
| 2 | + "files": { | |
| 3 | + "comparator.json": "6dceb1b9a9de7ef1633638d86eea22597efce3c4baa40b34f04d95661fa3aa0a", | |
| 4 | + "Open.lean": "54cff44d9291e217b2c8fd412351110a77fc27a561d11b62154ec06b41d28b0c", | |
| 5 | + "verification/independent-audit/comparator-project/TexAuditComparator/Challenge.lean": "b429a8c62819a599006b44df6801a54706dc3d7ae17279cf4bdde951e292312e", | |
| 6 | + "verification/independent-audit/comparator-project/TexAuditComparator/Reference14.lean": "7830c648d719bdf43c0771966f85df7647abc5848764b2c823bdfb592b37be1d", | |
| 7 | + "verification/independent-audit/comparator-project/TexAuditComparator/Reference57.lean": "210b9633bdc142579d132577f7ea5d22d56de4d32d13a0dbfef8ba8301983cb9", | |
| 8 | + "verification/independent-audit/comparator-project/TexAuditComparator/ReferenceAB.lean": "682ac57356f00d936b958c1b307c11db8bc07250b3fbe71c2ac39f404a968cf3" | |
| 9 | + }, | |
| 10 | + "lakefile": { | |
| 11 | + "lean_lib": [ | |
| 12 | + { | |
| 13 | + "name": "ConditionalGoldbach" | |
| 14 | + }, | |
| 15 | + { | |
| 16 | + "name": "TexAuditComparator", | |
| 17 | + "srcDir": "verification/independent-audit/comparator-project" | |
| 18 | + }, | |
| 19 | + { | |
| 20 | + "name": "Open" | |
| 21 | + } | |
| 22 | + ], | |
| 23 | + "name": "conditionalGoldbach", | |
| 24 | + "require": [ | |
| 25 | + { | |
| 26 | + "git": "https://github.com/subfish-zhou/goldbach-lean.git", | |
| 27 | + "name": "goldbach" | |
| 28 | + } | |
| 29 | + ], | |
| 30 | + "version": "0.1.0" | |
| 31 | + }, | |
| 32 | + "manifest": { | |
| 33 | + "settings": { | |
| 34 | + "version": "1.3.0", | |
| 35 | + "packagesDir": ".lake/packages", | |
| 36 | + "name": "conditionalGoldbach", | |
| 37 | + "lakeDir": ".lake", | |
| 38 | + "fixedToolchain": false | |
| 39 | + }, | |
| 40 | + "mathlib": "https://github.com/leanprover-community/mathlib4.git" | |
| 41 | + }, | |
| 42 | + "trusted": [ | |
| 43 | + "https://github.com/subfish-zhou/goldbach-lean.git", | |
| 44 | + "https://github.com/hanwenzhu/LeanArchitect.git" | |
| 45 | + ] | |
| 46 | +} | |
+230 −0 comparator.json added View file
| @@ -0,0 +1,230 @@ | ||
| 1 | +{ | |
| 2 | + "challenge_module": "TexAuditComparator.Challenge", | |
| 3 | + "solution_module": "TexAuditComparator.Solution", | |
| 4 | + "theorem_names": [ | |
| 5 | + "TexAudit14.weight_has_required_compact_support", | |
| 6 | + "TexAudit14.universal_product_formula", | |
| 7 | + "TexAudit14.singular_series_formula", | |
| 8 | + "TexAudit14.character_kernel_original_formula", | |
| 9 | + "TexAudit14.character_kernel_full_positive", | |
| 10 | + "TexAudit14.character_kernel_rank_meaning", | |
| 11 | + "TexAudit14.completed_function_meaning", | |
| 12 | + "TexAudit14.beta_integral_continuation_bridge", | |
| 13 | + "TexAudit14.beta_bound_rhs_is_nonnegative", | |
| 14 | + "TexAudit14.beta_bound_rhs_norm_is_re", | |
| 15 | + "TexAudit14.prime_count_members_have_both_support_bounds", | |
| 16 | + "TexAudit57.hermitian_quadratic_real", | |
| 17 | + "TexAudit57.character_quadratic_nonnegative_real", | |
| 18 | + "TexAudit57.arithmetic_strip_nonempty", | |
| 19 | + "TexAudit57.selected_operator_unique", | |
| 20 | + "TexAudit57.actual_operator_integral", | |
| 21 | + "TexAudit57.zero_padding_product", | |
| 22 | + "TexAudit57.zero_padding_square_sum", | |
| 23 | + "TexAuditAB.Numeric.unorderedPrimePairs_eq_905", | |
| 24 | + "TexComparator.statement_000_singularSeries_eq_existing", | |
| 25 | + "TexComparator.statement_001_theorem_1_1", | |
| 26 | + "TexComparator.statement_002_theorem_1_1_weight_exists", | |
| 27 | + "TexComparator.statement_003_theorem_1_2", | |
| 28 | + "TexComparator.statement_004_theorem_1_2_hypothesisR_implies_S", | |
| 29 | + "TexComparator.statement_005_primePair_consequence", | |
| 30 | + "TexComparator.statement_006_lemma_3_1", | |
| 31 | + "TexComparator.statement_007_lemma_3_1_odd_orthogonality", | |
| 32 | + "TexComparator.statement_008_proposition_3_2", | |
| 33 | + "TexComparator.statement_009_proposition_3_2_finite_rank", | |
| 34 | + "TexComparator.statement_010_proposition_3_2_joint_meromorphic", | |
| 35 | + "TexComparator.statement_011_lemma_3_3", | |
| 36 | + "TexComparator.statement_012_lemma_3_4", | |
| 37 | + "TexComparator.statement_013_lemma_3_4_normal_convergence", | |
| 38 | + "TexComparator.statement_014_lemma_3_4_paired_zero_sum", | |
| 39 | + "TexComparator.statement_015_lemma_3_5", | |
| 40 | + "TexComparator.statement_016_lemma_3_5_absolute_convergence", | |
| 41 | + "TexComparator.statement_017_lemma_3_5_small_sigma", | |
| 42 | + "TexComparator.statement_018_lemma_3_5_weight_support", | |
| 43 | + "TexComparator.statement_019_lemma_4_1", | |
| 44 | + "TexComparator.statement_020_lemma_4_1_absolute_convergence", | |
| 45 | + "TexComparator.statement_021_lemma_4_1_signed_model", | |
| 46 | + "TexComparator.statement_022_lemma_4_1_local_density", | |
| 47 | + "TexComparator.statement_023_lemma_4_2", | |
| 48 | + "TexComparator.statement_024_lemma_4_2_meromorphic", | |
| 49 | + "TexComparator.statement_025_lemma_4_3", | |
| 50 | + "TexComparator.statement_026_lemma_4_3_uniform", | |
| 51 | + "TexComparator.statement_027_lemma_4_3_density_convergence", | |
| 52 | + "TexComparator.statement_028_lemma_4_3_euler_product_convergence", | |
| 53 | + "TexComparator.statement_029_proposition_4_4", | |
| 54 | + "TexComparator.statement_030_proposition_4_5", | |
| 55 | + "TexComparator.statement_031_proposition_5_1", | |
| 56 | + "TexComparator.statement_032_proposition_5_1_fueter_equation", | |
| 57 | + "TexComparator.statement_033_lemma_5_2", | |
| 58 | + "TexComparator.statement_034_lemma_5_2_closed_trace_space", | |
| 59 | + "TexComparator.statement_035_lemma_5_2_representation_spec", | |
| 60 | + "TexComparator.statement_036_lemma_5_2_boundary_inner", | |
| 61 | + "TexComparator.statement_037_proposition_5_3", | |
| 62 | + "TexComparator.statement_038_proposition_5_3_kernel_integrability", | |
| 63 | + "TexComparator.statement_039_proposition_5_3_hs_basis_independent", | |
| 64 | + "TexComparator.statement_040_proposition_5_4", | |
| 65 | + "TexComparator.statement_041_proposition_5_4_exact_norm", | |
| 66 | + "TexComparator.statement_042_proposition_5_4_kernel_pairing", | |
| 67 | + "TexComparator.statement_043_proposition_5_4_fixed_contour", | |
| 68 | + "TexComparator.statement_044_proposition_6_1", | |
| 69 | + "TexComparator.statement_045_proposition_6_1_enumeration", | |
| 70 | + "TexComparator.statement_046_proposition_6_1_complex_slice", | |
| 71 | + "TexComparator.statement_047_proposition_6_1_positive_fredholm_spec", | |
| 72 | + "TexComparator.statement_048_proposition_6_1_square_determinant", | |
| 73 | + "TexComparator.statement_049_proposition_6_1_all_slices", | |
| 74 | + "TexComparator.statement_050_proposition_6_1_spectral_choice_independent", | |
| 75 | + "TexComparator.statement_051_proposition_6_2", | |
| 76 | + "TexComparator.statement_052_proposition_6_2_centered_product", | |
| 77 | + "TexComparator.statement_053_proposition_6_2_critical_values", | |
| 78 | + "TexComparator.statement_054_proposition_6_3", | |
| 79 | + "TexComparator.statement_055_proposition_6_3_three_cases", | |
| 80 | + "TexComparator.statement_056_proposition_6_3_factor_central_order", | |
| 81 | + "TexComparator.statement_057_proposition_6_3_multiplicities", | |
| 82 | + "TexComparator.statement_058_theorem_6_1", | |
| 83 | + "TexComparator.statement_059_theorem_6_1_abstract_dictionary", | |
| 84 | + "TexComparator.statement_060_theorem_6_1_width_comparison", | |
| 85 | + "TexComparator.statement_061_theorem_6_2", | |
| 86 | + "TexComparator.statement_062_lemma_6_4", | |
| 87 | + "TexComparator.statement_063_lemma_6_4_zero_poisson_convergence", | |
| 88 | + "TexComparator.statement_064_lemma_6_4_perron_residue", | |
| 89 | + "TexComparator.statement_065_lemma_6_4_poisson_action_spec", | |
| 90 | + "TexComparator.statement_066_lemma_6_4_poisson_convolution", | |
| 91 | + "TexComparator.statement_067_proposition_6_5", | |
| 92 | + "TexComparator.statement_068_proposition_6_5_components_spec", | |
| 93 | + "TexComparator.statement_069_proposition_6_5_diagonal_vector_spec", | |
| 94 | + "TexComparator.statement_070_lemma_7_1", | |
| 95 | + "TexComparator.statement_071_lemma_7_1_absolute_convergence", | |
| 96 | + "TexComparator.statement_072_lemma_7_2", | |
| 97 | + "TexComparator.statement_073_lemma_7_2_absolute_convergence", | |
| 98 | + "TexComparator.statement_074_lemma_7_2_convolutions", | |
| 99 | + "TexComparator.statement_075_proposition_7_3", | |
| 100 | + "TexComparator.statement_076_proposition_7_3_absolute_convergence", | |
| 101 | + "TexComparator.statement_077_proposition_7_4", | |
| 102 | + "TexComparator.statement_078_proposition_7_4_norm_integrals", | |
| 103 | + "TexComparator.statement_079_theorem_7_1", | |
| 104 | + "TexComparator.statement_080_theorem_7_1_uniform", | |
| 105 | + "TexComparator.statement_081_lemma_7_5", | |
| 106 | + "TexComparator.statement_082_lemma_7_5_asymptotic", | |
| 107 | + "TexComparator.statement_083_interiorLine_memLp", | |
| 108 | + "TexComparator.statement_084_boundaryTraces_exist", | |
| 109 | + "TexComparator.statement_085_proposition_A_1", | |
| 110 | + "TexComparator.statement_086_proposition_A_1_operator_spec", | |
| 111 | + "TexComparator.statement_087_proposition_A_2", | |
| 112 | + "TexComparator.statement_088_proposition_A_2_pointwise", | |
| 113 | + "TexComparator.statement_089_variable_uniform_spectral_bound", | |
| 114 | + "TexComparator.statement_090_lemma_A_3", | |
| 115 | + "TexComparator.statement_091_lemma_A_3_absolute_operator_bound", | |
| 116 | + "TexComparator.statement_092_lemma_A_3_balance", | |
| 117 | + "TexComparator.statement_093_lemma_A_3_width_ratio", | |
| 118 | + "TexComparator.statement_094_proposition_A_4", | |
| 119 | + "TexComparator.statement_095_proposition_A_4_baseline_product", | |
| 120 | + "TexComparator.statement_096_proposition_B_1", | |
| 121 | + "TexComparator.statement_097_lemma_B_2", | |
| 122 | + "TexComparator.statement_098_lemma_B_3", | |
| 123 | + "TexComparator.statement_099_lemma_B_3_main_integral", | |
| 124 | + "TexComparator.statement_100_proposition_B_4", | |
| 125 | + "TexComparator.statement_101_proposition_B_4_weight", | |
| 126 | + "TexComparator.statement_102_proposition_B_5", | |
| 127 | + "TexComparator.definition_000_IsWeight", | |
| 128 | + "TexComparator.definition_001_weightMass", | |
| 129 | + "TexComparator.definition_002_goldbach", | |
| 130 | + "TexComparator.definition_003_GRH", | |
| 131 | + "TexComparator.definition_004_EvenEventually", | |
| 132 | + "TexComparator.definition_005_EvenTendstoInfinity", | |
| 133 | + "TexComparator.definition_006_EvenAsymptotic", | |
| 134 | + "TexComparator.definition_007_zeroFreeWidth", | |
| 135 | + "TexComparator.definition_008_IsAdmissible", | |
| 136 | + "TexComparator.definition_009_HypothesisS", | |
| 137 | + "TexComparator.definition_010_HypothesisR", | |
| 138 | + "TexComparator.definition_011_spectralScale", | |
| 139 | + "TexComparator.definition_012_PrimePairCount", | |
| 140 | + "TexComparator.definition_013_betaDomain", | |
| 141 | + "TexComparator.definition_014_analyticDomain", | |
| 142 | + "TexComparator.definition_015_betaKernel", | |
| 143 | + "TexComparator.definition_016_gammaQuotient", | |
| 144 | + "TexComparator.definition_017_densityEulerProduct", | |
| 145 | + "TexComparator.definition_018_continuedDensity", | |
| 146 | + "TexComparator.definition_019_betaModel", | |
| 147 | + "TexComparator.definition_020_continuedModel", | |
| 148 | + "TexComparator.definition_021_residual", | |
| 149 | + "TexComparator.definition_022_IsRawHardy", | |
| 150 | + "TexComparator.definition_023_rawHardyNormSq", | |
| 151 | + "TexComparator.definition_024_fourierLaplace", | |
| 152 | + "TexComparator.definition_025_IsBoundaryTrace", | |
| 153 | + "TexComparator.definition_026_weightedKernel", | |
| 154 | + "TexComparator.definition_027_reproducingKernel", | |
| 155 | + "TexComparator.definition_028_pointDistance", | |
| 156 | + "TexComparator.definition_029_spectralRootParameter", | |
| 157 | + "TexComparator.definition_030_quaternionSlice", | |
| 158 | + "TexComparator.definition_031_IntrinsicEntire", | |
| 159 | + "TexComparator.definition_032_zeroPoisson", | |
| 160 | + "TexComparator.definition_033_logDerivativeEnergy", | |
| 161 | + "TexComparator.definition_034_averagedLogDerivative", | |
| 162 | + "TexComparator.definition_035_referenceLine", | |
| 163 | + "TexComparator.definition_036_smoothedPerronWeight", | |
| 164 | + "TexComparator.definition_037_smoothedPerronKernel", | |
| 165 | + "TexComparator.definition_038_poissonKernelReal", | |
| 166 | + "TexComparator.definition_039_realConvolution", | |
| 167 | + "TexComparator.definition_040_diagonalVector", | |
| 168 | + "TexComparator.definition_041_differenceConvolution", | |
| 169 | + "TexComparator.definition_042_sumConvolution", | |
| 170 | + "TexComparator.definition_043_signedConvolution", | |
| 171 | + "TexComparator.definition_044_derivativeWeight", | |
| 172 | + "TexComparator.definition_045_normFunctional", | |
| 173 | + "TexComparator.definition_046_weightEnergy", | |
| 174 | + "TexComparator.definition_047_functionalIntegrand", | |
| 175 | + "TexComparator.definition_048_strip", | |
| 176 | + "TexComparator.definition_049_HardySpace", | |
| 177 | + "TexComparator.definition_050_boundaryPoint", | |
| 178 | + "TexComparator.definition_051_residualOperator", | |
| 179 | + "TexComparator.definition_052_functionalValue", | |
| 180 | + "TexComparator.definition_053_rieszVector", | |
| 181 | + "TexComparator.definition_054_normFunctional", | |
| 182 | + "TexComparator.definition_055_spectralComplex", | |
| 183 | + "TexComparator.definition_056_spectralQuaternion", | |
| 184 | + "TexComparator.definition_057_SpectralR", | |
| 185 | + "TexComparator.definition_058_SpectralZeroFree", | |
| 186 | + "TexComparator.definition_059_alpha", | |
| 187 | + "TexComparator.definition_060_HypothesisRAt", | |
| 188 | + "TexComparator.definition_061_HypothesisSAt", | |
| 189 | + "TexComparator.definition_062_zeroMultiplicity", | |
| 190 | + "TexComparator.definition_063_poleCoefficient", | |
| 191 | + "TexComparator.definition_064_baselineProductR", | |
| 192 | + "TexComparator.definition_065_baselineBound", | |
| 193 | + "TexComparator.definition_066_balanceFactor", | |
| 194 | + "TexComparator.definition_067_experimentN", | |
| 195 | + "TexComparator.definition_068_cutoffPolynomial", | |
| 196 | + "TexComparator.definition_069_wideCutoff", | |
| 197 | + "TexComparator.definition_070_wideCompanion", | |
| 198 | + "TexComparator.definition_071_wideWeight", | |
| 199 | + "TexComparator.definition_072_wideCorrelation", | |
| 200 | + "TexComparator.definition_073_unorderedPrimePairs", | |
| 201 | + "TexComparator.definition_074_edgeCorrection", | |
| 202 | + "TexComparator.definition_075_primePowerCorrection", | |
| 203 | + "TexComparator.definition_076_countingCoefficient", | |
| 204 | + "TexComparator.definition_077_countingIntegral", | |
| 205 | + "TexComparator.definition_078_diagonalCountingMoment", | |
| 206 | + "TexComparator.definition_079_approxSignedMoment", | |
| 207 | + "TexComparator.definition_080_approxDiagonalMoment", | |
| 208 | + "TexComparator.definition_081_wideModelMass", | |
| 209 | + "TexComparator.definition_082_wideMainIntegral", | |
| 210 | + "TexComparator.definition_083_wideResidual", | |
| 211 | + "TexComparator.definition_084_HasMomentError", | |
| 212 | + "TexComparator.definition_085_approxPrimeCount", | |
| 213 | + "TexComparator.definition_086_countError", | |
| 214 | + "TexComparator.definition_087_wideFunctional", | |
| 215 | + "TexComparator.definition_088_wideRieszVector", | |
| 216 | + "TexComparator.definition_089_spectralNode", | |
| 217 | + "TexComparator.definition_090_trapezoidWeight", | |
| 218 | + "TexComparator.definition_091_finiteSpectralMatrix", | |
| 219 | + "TexComparator.definition_092_finiteSpectralFunction", | |
| 220 | + "TexComparator.definition_093_IsFiniteSpectrum", | |
| 221 | + "TexComparator.definition_094_finiteEigenvalues", | |
| 222 | + "TexComparator.definition_095_finiteMatrixOpNorm" | |
| 223 | + ], | |
| 224 | + "permitted_axioms": [ | |
| 225 | + "propext", | |
| 226 | + "Quot.sound", | |
| 227 | + "Classical.choice" | |
| 228 | + ], | |
| 229 | + "enable_nanoda": true | |
| 230 | +} | |
+20 −0 docker/README.md added View file
| @@ -0,0 +1,20 @@ | ||
| 1 | +# Lean image | |
| 2 | + | |
| 3 | +`lean.Dockerfile` builds the image the `build` check runs in. Tag: `shoal-goldbach-lean:c55db645` | |
| 4 | +(`scienceslack.json` names it). Build it on the runner's machine, from a checkout of the project's main as the context: | |
| 5 | + | |
| 6 | +```bash | |
| 7 | +git clone <the project's repository> /tmp/goldbach-main | |
| 8 | +git -C /tmp/goldbach-main checkout <main's commit> | |
| 9 | +docker build -f /tmp/goldbach-main/docker/lean.Dockerfile -t shoal-goldbach-lean:c55db645 /tmp/goldbach-main | |
| 10 | +``` | |
| 11 | + | |
| 12 | +The build needs the network (the Lean release, Mathlib's cache, goldbach-lean and LeanArchitect). The check runs the | |
| 13 | +image with `--network none`: it copies a commit's tree to a scratch directory, gives it `/opt/proof/.lake`, and runs | |
| 14 | +`lake build` and `lake comparator --config comparator.json`. | |
| 15 | + | |
| 16 | +The image holds the toolchain (v4.35.0, which ships `lake comparator`, its exporter, `nanoda_bin` and `leanchecker`), | |
| 17 | +bubblewrap for Comparator's sandbox, and a full build of the approved main: the library, the Comparator project and | |
| 18 | +the open statements. Rebuild it under a new tag, and change the tag in `scienceslack.json` in the same pull request, | |
| 19 | +when main's `lean-toolchain` or `lake-manifest.json` changes; the check refuses a commit whose toolchain the image | |
| 20 | +does not have. | |
+69 −0 docker/lean-check.Dockerfile added View file
| @@ -0,0 +1,69 @@ | ||
| 1 | +# The Goldbach maintainer's workspace: the image the `lean` check runs in and the maintainer's look runs commands in. | |
| 2 | +# | |
| 3 | +# Build (about an hour the first time; the Mathlib cache is ~5 GB): | |
| 4 | +# docker build -f docker/lean-check.Dockerfile -t shoal-goldbach-lean:4.35-c55db645 docker/ | |
| 5 | +# | |
| 6 | +# It pins the Li–Liu development and prebuilds it, Fu's workspace for ¬R and GRH, and the kernels V-2 names (Lean | |
| 7 | +# 4.35.0's toolchain ships leanchecker, lean4lean, nanoda_bin and con-leche). At check time checks/lean_verify.py | |
| 8 | +# compiles the approved Challenge as root and the route's Solution as nobody against these builds, which is why every | |
| 9 | +# file under /opt is world-readable, and judges the two with lake comparator. No network is used at check time. The | |
| 10 | +# build downloads from the Ubuntu archive (or APT_MIRROR), github.com (elan, the git clones), releases.lean-lang.org | |
| 11 | +# (the toolchain), cache.mathlib.org (twice ~5 GB) and PyPI (or PIP_INDEX_URL); not from raw.githubusercontent.com, | |
| 12 | +# which the Beijing site cannot reach (12-01). | |
| 13 | + | |
| 14 | +FROM ubuntu:24.04 | |
| 15 | + | |
| 16 | +# On the Beijing site: --build-arg APT_MIRROR=http://mirrors.aliyun.com/ubuntu (http: ca-certificates is not installed | |
| 17 | +# yet, and https fails its certificate check) --build-arg PIP_INDEX_URL=https://mirrors.aliyun.com/pypi/simple | |
| 18 | +ARG APT_MIRROR= | |
| 19 | +ARG PIP_INDEX_URL=https://pypi.org/simple | |
| 20 | +ENV DEBIAN_FRONTEND=noninteractive | |
| 21 | +RUN if [ -n "$APT_MIRROR" ]; then sed -i "s#http://archive.ubuntu.com/ubuntu#$APT_MIRROR#; s#http://security.ubuntu.com/ubuntu#$APT_MIRROR#" /etc/apt/sources.list.d/ubuntu.sources; fi \ | |
| 22 | + && apt-get update && apt-get install -y --no-install-recommends \ | |
| 23 | + ca-certificates curl git python3 python3-venv build-essential zstd ripgrep bubblewrap \ | |
| 24 | + && rm -rf /var/lib/apt/lists/* | |
| 25 | + | |
| 26 | +ENV ELAN_HOME=/opt/elan | |
| 27 | +ENV PATH=/opt/elan/bin:${PATH} | |
| 28 | +RUN curl -sSfL https://github.com/leanprover/elan/releases/download/v4.1.2/elan-x86_64-unknown-linux-gnu.tar.gz | tar -xz -C /tmp \ | |
| 29 | + && /tmp/elan-init -y --no-modify-path --default-toolchain none && rm /tmp/elan-init | |
| 30 | +RUN elan toolchain install leanprover/lean4:v4.35.0 \ | |
| 31 | + && elan default leanprover/lean4:v4.35.0 | |
| 32 | + | |
| 33 | +WORKDIR /opt | |
| 34 | +RUN git clone https://github.com/subfish-zhou/conditional-goldbach-lean.git goldbach \ | |
| 35 | + && git -C goldbach checkout c55db645f3b4aed00374fe4aa1fcee2428c88c4b | |
| 36 | + | |
| 37 | +WORKDIR /opt/goldbach/formalization | |
| 38 | +# (chmod in the same layer: Mathlib's cache unpacks its files 0600, which nobody cannot read; cache get again: a few of | |
| 39 | +# its 9,031 downloads fail now and then, and each try fetches only what is still missing) | |
| 40 | +RUN (lake exe cache get || lake exe cache get || lake exe cache get) \ | |
| 41 | + && test "$(git -C .lake/packages/mathlib rev-parse --short=8 HEAD)" = 56a00585 \ | |
| 42 | + && lake build && chmod -R a+rX /opt/goldbach | |
| 43 | + | |
| 44 | +# Fu's workspace pins both the conditional theorem and grh-compact. The not-r and grh-bridge targets are checked on its | |
| 45 | +# LEAN_PATH, so its copy of Zhou's development needs PrimePairs too (grh-bridge's Challenge imports it). | |
| 46 | +# UnconditionalAudit itself does not build: GRH's Lib and PrimeNumberTheoremAnd both declare `nabla`; Fu's replay joins | |
| 47 | +# their exports instead (verification/join-grh.py). | |
| 48 | +# (retried: from Beijing a clone from github.com broke off once in TLS, 12-01) | |
| 49 | +RUN for i in 1 2 3 4 5; do git clone https://github.com/RaymondVoldemortFu/li-liu-spectral-hypotheses-lean /opt/fu && break; \ | |
| 50 | + rm -rf /opt/fu; sleep 10; done \ | |
| 51 | + && git -C /opt/fu checkout 56090686f4dcc16147ea74548d52184b2cfa89cb | |
| 52 | +WORKDIR /opt/fu/WithGRH435 | |
| 53 | +RUN (lake exe cache get || lake exe cache get || lake exe cache get) \ | |
| 54 | + && lake build +Main +OriginalStatements +SingleScaleCriterion +ConditionalGoldbach.Proofs.PrimePairs \ | |
| 55 | + && chmod -R a+rX /opt/fu | |
| 56 | + | |
| 57 | +# The maintainer's numerics (C-3..C-5 interval certificates, reruns of authors' scripts), in a venv of its own so the | |
| 58 | +# system python3 the checks call stays as it is: python3-sci has them. | |
| 59 | +# (a wrapper, not a link: Python started through a link to a venv's python does not find the venv) | |
| 60 | +RUN python3 -m venv /opt/py && /opt/py/bin/pip install --no-cache-dir python-flint mpmath sympy numpy scipy \ | |
| 61 | + && printf '#!/bin/sh\nexec /opt/py/bin/python3 "$@"\n' > /usr/local/bin/python3-sci && chmod 755 /usr/local/bin/python3-sci \ | |
| 62 | + && python3-sci -c "import flint, mpmath, sympy, numpy, scipy" | |
| 63 | +# numpy's and scipy's OpenBLAS each start a thread per host CPU: on a 128-core host that is past a look's 128 processes, | |
| 64 | +# and `import scipy.linalg` dies (SIGSEGV, reproduced on a2 with --pids-limit below its 63 threads) | |
| 65 | +ENV OPENBLAS_NUM_THREADS=4 OMP_NUM_THREADS=4 | |
| 66 | + | |
| 67 | +ENV GOLDBACH_LEAN_PROJECT=/opt/goldbach/formalization | |
| 68 | +WORKDIR /opt/goldbach/formalization | |
| 69 | +CMD ["/bin/bash"] | |
+84 −0 docker/lean.Dockerfile added View file
| @@ -0,0 +1,84 @@ | ||
| 1 | +# Lean image for the goldbach-spectral-bridge `build` check (checks/build.py). | |
| 2 | +# | |
| 3 | +# Build with a checkout of the project's main as the context, not this folder: | |
| 4 | +# git clone <the project's repository> /tmp/goldbach-main | |
| 5 | +# git -C /tmp/goldbach-main checkout <main's commit> | |
| 6 | +# docker build -f docker/lean.Dockerfile -t shoal-goldbach-lean:c55db645 /tmp/goldbach-main | |
| 7 | +# | |
| 8 | +# The project is the folder formalization/ of subfish-zhou/conditional-goldbach-lean at c55db645, without the | |
| 9 | +# generated reports (upstream.json), with this project's lakefile.toml on top: it adds the upstream's own Comparator | |
| 10 | +# project (verification/independent-audit/comparator-project/TexAuditComparator) and the open statements (Open.lean) | |
| 11 | +# as libraries of the one package. Cloning upstream would give neither, so the image is built from the project's own | |
| 12 | +# tree: COPY puts it in /opt/proof. The check runs with --network none: it copies a commit's tree to a scratch | |
| 13 | +# directory, gives it /opt/proof/.lake, and runs lake build and `lake comparator --config comparator.json`. Nothing is | |
| 14 | +# downloaded at check time. | |
| 15 | +# | |
| 16 | +# Every pin is a full commit hash in an ARG below, checked once the dependencies are fetched. | |
| 17 | + | |
| 18 | +FROM ubuntu:24.04 | |
| 19 | + | |
| 20 | +# --- Pins ------------------------------------------------------------------- | |
| 21 | + | |
| 22 | +# subfish-zhou/conditional-goldbach-lean, and its formalization/lean-toolchain at that commit. | |
| 23 | +ARG UPSTREAM_COMMIT=c55db645f3b4aed00374fe4aa1fcee2428c88c4b | |
| 24 | +ARG TOOLCHAIN=leanprover/lean4:v4.35.0 | |
| 25 | +# From lake-manifest.json at that commit. | |
| 26 | +ARG MATHLIB_COMMIT=56a005855ea17e0b0958f73ec801ae140b0a1679 | |
| 27 | +ARG GOLDBACH_COMMIT=24490c2ab7787238f816d771c9176411dcbda503 | |
| 28 | +ARG LEANARCHITECT_COMMIT=9f3bb53916b9d6fa05b7777389e1844f82b1c9a6 | |
| 29 | + | |
| 30 | +# Comparator: Lean v4.35.0 ships it as `lake comparator` (sandboxed with bubblewrap), with its exporter, nanoda_bin and | |
| 31 | +# leanchecker beside it; the upstream's own audit ran exactly that (verification/independent-audit/comparator-manifest.json). | |
| 32 | + | |
| 33 | +# --- System packages -------------------------------------------------------- | |
| 34 | + | |
| 35 | +# python3 and curl are what Mathlib's cache tool uses; bubblewrap is the sandbox `lake comparator` runs in. | |
| 36 | +ENV DEBIAN_FRONTEND=noninteractive | |
| 37 | +RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| 38 | + ca-certificates curl git python3 build-essential zstd bubblewrap \ | |
| 39 | + && rm -rf /var/lib/apt/lists/* | |
| 40 | + | |
| 41 | +# The check may run as another user than the one that built; let git (and Lake, which calls git in each package) | |
| 42 | +# read every repository in the image. | |
| 43 | +RUN git config --system --add safe.directory '*' | |
| 44 | + | |
| 45 | +# --- Lean ------------------------------------------------------------------- | |
| 46 | + | |
| 47 | +ENV ELAN_HOME=/opt/elan | |
| 48 | +ENV PATH=/usr/local/bin:/opt/elan/bin:/usr/local/sbin:/usr/sbin:/usr/bin:/sbin:/bin | |
| 49 | +RUN curl -sSfL https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh \ | |
| 50 | + | sh -s -- -y --no-modify-path --default-toolchain none | |
| 51 | +RUN elan toolchain install "${TOOLCHAIN}" \ | |
| 52 | + && elan default "${TOOLCHAIN}" | |
| 53 | + | |
| 54 | +# --- The project ------------------------------------------------------------ | |
| 55 | + | |
| 56 | +# The context is a checkout of the project's main: its tree goes in whole, as the check's commits will be. | |
| 57 | +COPY . /opt/proof | |
| 58 | +WORKDIR /opt/proof | |
| 59 | +RUN rm -rf .git .lake \ | |
| 60 | + && test "$(cat lean-toolchain)" = "${TOOLCHAIN}" \ | |
| 61 | + && grep -q "${UPSTREAM_COMMIT}" docker/lean.Dockerfile | |
| 62 | + | |
| 63 | +# Mathlib's cache, then the dependencies at their pins, then a full build of the default targets (the library, the | |
| 64 | +# Comparator project and the open statements), so a pull request's build recompiles only what it changed. | |
| 65 | +RUN lake exe cache get \ | |
| 66 | + && test "$(git -C .lake/packages/mathlib rev-parse HEAD)" = "${MATHLIB_COMMIT}" \ | |
| 67 | + && test "$(git -C .lake/packages/goldbach rev-parse HEAD)" = "${GOLDBACH_COMMIT}" \ | |
| 68 | + && test "$(git -C .lake/packages/LeanArchitect rev-parse HEAD)" = "${LEANARCHITECT_COMMIT}" \ | |
| 69 | + && rm -rf /root/.cache/mathlib | |
| 70 | +RUN lake build | |
| 71 | + | |
| 72 | +# --- Comparator's second kernel --------------------------------------------- | |
| 73 | + | |
| 74 | +RUN ln -s "$(elan which --toolchain "${TOOLCHAIN}" nanoda_bin)" /usr/local/bin/nanoda_bin \ | |
| 75 | + && ln -s "$(elan which --toolchain "${TOOLCHAIN}" leanchecker)" /usr/local/bin/leanchecker \ | |
| 76 | + && lake comparator --help >/dev/null | |
| 77 | + | |
| 78 | +RUN for t in bwrap nanoda_bin leanchecker lake lean; do \ | |
| 79 | + command -v "$t" >/dev/null || { echo "missing: $t"; exit 1; }; \ | |
| 80 | + done | |
| 81 | + | |
| 82 | +ENV PROOF_BASE=/opt/proof | |
| 83 | +WORKDIR /opt/proof | |
| 84 | +CMD ["/bin/bash"] | |
+93 −0 docs/starting-points.md added View file
| @@ -0,0 +1,93 @@ | ||
| 1 | +# Starting points | |
| 2 | + | |
| 3 | +What a newcomer, or their agent, can pin before taking a piece: the developments, tools and readings this project builds | |
| 4 | +on, each with its pin, licence, toolchain, build time and use. Read on 2026-12-01. A pin is a commit, a tag or a | |
| 5 | +version; a repository that moves is cited at its pin. | |
| 6 | + | |
| 7 | +**The licence decides what you may copy.** "none" means link and pin, never copy: cite the file and the commit in your | |
| 8 | +route's notes, and put none of its files in this repository or in your route. Apache-2.0, MIT and BSD files may be used | |
| 9 | +under their terms, with their notices. | |
| 10 | + | |
| 11 | +"Measured" means run on 2026-12-01 on an Apple arm64 laptop in a scratch virtual environment; other times are the | |
| 12 | +projects' own. | |
| 13 | + | |
| 14 | +## Lean | |
| 15 | + | |
| 16 | +| What | Pin | Licence | Toolchain | Build | For | | |
| 17 | +|---|---|---|---|---|---| | |
| 18 | +| The chain (Zhou) <https://github.com/subfish-zhou/conditional-goldbach-lean> | `c55db645` (2026-11-14), unchanged on 2026-12-01 | none: link, do not copy | Lean 4.35.0, Mathlib `56a00585` | 15 min 56 s with the dependency cache on 8 cores (its README) | every Lean piece; `NumericCrossCheck.lean` for `decide +kernel` (C-2); `Definitions/Hypotheses.lean` for S-1, S-4; its audit logs for V-4; the paper's TeX under `outputs/formalization-preparation/` (C-3, C-4, V-5) | | |
| 19 | +| ¬R, the S criteria, the GRH bridge (Fu) <https://github.com/RaymondVoldemortFu/li-liu-spectral-hypotheses-lean> | `56090686` = tag `hypothesis-r-v1.0.1` (2026-11-26) | none | `Analytic435/` and `WithGRH435/` on 4.35.0 (on Zhou `c55db645` and grh-compact `72fead10`); the root on 4.36.0 | `WithGRH435` needs the grh-compact build (next row); joint export 5.27 GB | V-1, V-2 (`refute_R`, `not_R`, `verification/`), V-3 (`local_GRH` in `WithGRH435/UnconditionalAudit.lean`), S-4 (`prescribed`), S-5 (`some_S_iff`, `some_S_iff_single_scale`), C-5 (`Analytic435/PerronOperators.lean`), V-6 (`paper/R/refutation-of-R.pdf`) | | |
| 20 | +| GRH, short version (Sernau) <https://github.com/lsernau/grh-lean> | `72fead10` (2026-11-25), its only commit; folders `grh-compact`, `grh`, `grh-compact_show_term`, `grh_show_term` | Apache-2.0 | Lean 4.35.0, Mathlib `56a00585` | grh-compact 87 min from source without network (isitsolved receipt, 2026-11-26); "1–2 hours" on 12 cores and 24 GB (its README) | V-2, V-3; checked by Sutherland (2026-11-27) and Rubinstein (2026-11-26) | | |
| 21 | +| GRH, community edition <https://github.com/leanprover-community/riemann-hypothesis> | HEAD `92f337f4` (2026-12-01) moves hourly: pin a commit | Apache-2.0 | v4.37.0-rc1, Mathlib `31ce06ea` | large; clone with `--depth 1` (its git history was 1.26 GB on 2026-11-27) | reading (`GUIDE.md`, `src/Statements.lean`); it does not combine with 4.35 directly | | |
| 22 | +| GRH on Lean 4.36 and a library of accepted Goldbach modules (goldbach.tech) <https://github.com/CGandGameEngineLearner/goldbach-proofs> | e.g. `1f8c552f` (2026-12-01); moves every few minutes | Apache-2.0 | Lean 4.36.0, Mathlib `fc4f59e5` | `lake exe cache get`, then build one module; the whole tree is large (repository 355 MB) | K-1(b) and A-3 (`lean/Conjectures/Goldbach/LiLiuSquareRootExceptionalSet.lean`, `GrhGoldbachExceptionDensity`); A-6, A-7; a 4.36 home for V-3 (`grh_show_term` as `Main`); 6,379 accepted modules indexed at <https://www.goldbach.tech/verified-imports.json> | | |
| 23 | +| Goldbach classics for the Palomar registry (Hubbard) <https://github.com/sthubbar/goldbach-lean> | `05fe86a4` (2026-11-23) | Apache-2.0 | Lean and Mathlib v4.35.0-rc3 | per entry: `lake exe cache get && lake build && lake comparator --config=…` | K-1 (`entries/bhowmikgrimmelt2026`, `pintz2018`, `estermann1938`, `hardylittlewood1923`, `heathbrown1985`), K-2 (`renyi1948`, `brun1919`, `bordignonstarichkova2024grh`); each entry's `Challenge…lean` and comparator config show the pattern. Its README: "AI wrote the Lean code", "No human expert has reviewed the mathematics" | | |
| 24 | +| Chen 1 + 2, J. Li–J. Liu 1 + 1.9, Wu 1 + 1.8938 (Zhou) <https://github.com/subfish-zhou/goldbach-lean> | tag `1plus1.9-v1.0.0` = `df1f3b3b`; last commit `9d4c3a40` (2026-10-28) | Apache-2.0 | v4.33.0-rc1 | not measured | K-2(b), A-8: where the sieve stops, with constants, in Lean | | |
| 25 | +| Ternary Goldbach (Glazer, with GPT-6.2 Astra) <https://github.com/elliotglazer/ternary-goldbach> | `b37fd3e5` (2026-11-24) | Apache-2.0 | 4.33.1; rebuilt on 4.35.0 (2026-11-26) | not measured | K-1(a): a complete explicit circle-method argument in Lean, with GRH imported as a theorem | | |
| 26 | +| Comparator and second kernels: `lake comparator` (in Lean core since 4.35), <https://github.com/leanprover/comparator>, nanoda <https://github.com/ammkrn/nanoda_lib>, con-leche <https://github.com/leanprover/con-leche>, lean4lean <https://github.com/digama0/lean4lean> | as released | Apache-2.0 | Linux; the comparator needs bubblewrap or landrun, and lean4export | light | V-1, V-2, every `targets/` check | | |
| 27 | +| Build receipts and a registry: <https://isitsolved.com/lean/receipts> (mirror <https://github.com/isitsolved/lean-receipts>), <https://palomar-registry.org/> (template <https://github.com/PalomarRegistry/PalomarTemplate>) | — | receipts repository NOASSERTION; template Apache-2.0 | — | a receipt took 54–87 min for GRH | an outside build record for V-1, V-4 and the A pieces. A receipt checks the build and the axioms, not that the statements mean what the paper says; Palomar's template asks for a statement audit by a different model, the A pieces' kind of work | | |
| 28 | +| lean-lsp-mcp <https://github.com/oOo0oOo/lean-lsp-mcp> | latest | MIT | — | light | lets a coding agent read Lean goals and errors | | |
| 29 | + | |
| 30 | +## Numerics | |
| 31 | + | |
| 32 | +Exact and interval work for C-1 to C-5, and r(N) for K-1. | |
| 33 | + | |
| 34 | +| What | Pin | Licence | Toolchain | Time | For | | |
| 35 | +|---|---|---|---|---|---| | |
| 36 | +| python-flint (FLINT and Arb in Python) <https://pypi.org/project/python-flint/> | 0.9.0 (2026-07-03, bundles FLINT 3.6.0) | MIT AND LGPL-3.0-or-later | wheels for macOS arm64 and Linux x86_64, Python ≥ 3.10 | install 9.5 s (measured); ∫₀¹ L(½+it, χ) dt for a character mod 30030 enclosed to ±2·10⁻¹³ in 1.1 s (measured), so about 1.8 h for 5,760 integrals on one core | C-3 (`acb.integral`, `dirichlet_char(q, n).l(s)`); C-4 through `acb_mat.eig(algorithm="rump")`, which is rigorous but takes about 1.5 h at n = 2,562 by extrapolation, fails on clustered eigenvalues and has no Cholesky | | |
| 37 | +| FLINT 3 <https://github.com/flintlib/flint> | v3.6.0 (2026-06-29) | LGPL-3.0 | C, GMP, MPFR | packages | C-4's cheaper certificate: `arb_mat_cho` or `spd_solve` of μI ∓ A proves ‖A‖ < μ; `acb_calc_integrate`, `acb_dirichlet_l` | | |
| 38 | +| Arblib.jl <https://github.com/kalmarek/Arblib.jl> | v1.8.1 (2026-08-24) | MIT | Julia ≥ 1.10 | — | C-4 in Julia (wraps `cho`, `spd_solve`, `bound_inf_norm`, `eig_simple_rump`); no `acb_dirichlet_l` | | |
| 39 | +| mpmath | 1.4.1 (2026-03-15) | BSD-3-Clause | pure Python | seconds | cross-checks only: its quadrature error estimate is heuristic | | |
| 40 | +| primesieve and primecount <https://github.com/kimwalisch/primesieve>, <https://github.com/kimwalisch/primecount> | v12.18 (2026-11-15), v9.1 (2026-11-27) | BSD-2-Clause | C++, brew or apt | π(10¹²) in 0.01 s, π(10¹³) in 0.12 s (measured) | primes and counts for K-1 and C-5; in Python, `primecountpy` 0.2.1 (GPL-2.0, wheels) and `primesieve` 2.3.4 (MIT, builds from source) | | |
| 41 | +| r(N) exact counts <https://github.com/zhaoshijian2023-hash/goldbach-partition-counter> | v1.1.0 (2026-10-23) | MIT | Python, NumPy, Numba | about 20 min per 10⁵ values of N near 10¹¹ (stated); 16–64 GB RAM | unordered r(N) for all N ≤ 10⁸ and blocks up to 10¹⁴; K-1 tables | | |
| 42 | +| r(N) against Hardy–Littlewood, by FFT <https://github.com/akashdeshmukh-git/goldbach-prime-squares> | `3a8c425b` (2026-10-07) | MIT | NumPy, SciPy, mpmath | about 2 h on 2 cores (stated) | ordered R(n) for n ≤ 10⁸ and windows to 10¹⁰, against 𝔖(n)I(n) | | |
| 43 | +| Check values | — | — | — | r(10¹⁰) in 11.5 s and r(10¹¹) in 452 s with a NumPy segmented sieve (measured) | r(10¹⁰) = 18,200,488 and r(10¹¹) = 149,091,160 (both match OEIS A065577); r(10¹²) = 1,243,722,370 | | |
| 44 | +| The verified range: Oliveira e Silva, Herzog and Pardi, Math. Comp. 83 (2014) 2033–2060, <https://doi.org/10.1090/S0025-5718-2013-02787-1> | — | — | — | — | the only peer-reviewed record: every even n ≤ 4·10¹⁸. Self-reported beyond it: GoldbachGPU (<https://github.com/isaac-6/goldbach-gpu>, v3.2.0, MIT; the window [4·10¹⁸, 4·10¹⁸ + 10¹⁵] in two runs of about 3 h on an RTX 5090) and Gridbach (<https://github.com/nakatahr/gridbach-core>, MIT, archived; claims 4·10¹⁸ + 7·10¹³, volunteer results unchecked). Preprints.org 202503.0949 ("to 6·10¹⁸") is sampling, not verification | | |
| 45 | +| Interval arithmetic in Lean: girving/interval, LeanCert <https://github.com/alerad/leancert>, FloatLib <https://github.com/lean-dojo/FloatLib> | `2562d37b` (2026-11-29, Lean 4.35.0); v4.36.0 (2026-11-26); v4.2.0 (2026-11-27, Lean 4.36.0) | Apache-2.0; Apache-2.0; MIT | Lean | not timed | kernel certificates in the style of C-2: FloatLib's `float_decide` and LeanCert's `(trust := kernel)` use `decide +kernel`; girving's `interval` tactic closes goals with `native_decide`, which this project forbids | | |
| 46 | +| LMFDB API <https://www.lmfdb.org/api/> | probed 2026-12-01 | data CC BY-SA 4.0 | HTTP JSON | a reCAPTCHA after about 5 scripted calls | Dirichlet L zeros (`lfunc_lfunctions.positive_zeros`); 30030 has no primitive characters (it is 2 × odd), so use its odd divisors | | |
| 47 | +| Platt's GRH-check code <https://github.com/djplatt/code> | `1f19fcbe` (2026-11-11) | none | C/C++, MPFI, Arb, CUDA | — | a reference for rigorous L-function evaluation: cite it, do not copy it | | |
| 48 | + | |
| 49 | +### Who computes ‖T_N‖, and how far that is from C-4 and C-5 | |
| 50 | + | |
| 51 | +Read on 2026-12-01: nobody certifies an upper bound on ‖T_N‖ or bounds the truncation error, and the float norms move | |
| 52 | +with the grid. Fu's finite Gram approximation is implemented in Lean only (`PerronOperators.lean`); no numerical | |
| 53 | +implementation was found. All four are unreviewed. | |
| 54 | + | |
| 55 | +| Repository | Pin | Licence | What it computes | | |
| 56 | +|---|---|---|---| | |
| 57 | +| <https://github.com/whenpoem/li-liu-spectral-hypotheses> | `30856f7e` (2026-11-24) | MIT | **certified lower bounds** in Arb: Rayleigh quotients of rounded test vectors give ‖T_N‖ ≥ 0.2534 at N = 2^15 down to 0.1031 at 2^18, that is 1.19 to 1.04 δ_N; python-flint 0.9.0, a 477 MB row cache; Lean on 4.37.0-rc1 | | |
| 58 | +| <https://github.com/tokg-venv/goldbach-liu-structural> | `ae296be3` (2026-12-01) | the file CC BY 4.0 (GitHub: NOASSERTION) | `mpmath.iv` enclosures of ⟨T_N v_f, v_g⟩ for explicit test pairs: ‖T_N‖ > δ_N at N = 90014, 90026, 40022 (306 s at 90014) | | |
| 59 | +| <https://github.com/catalystberry842-alt/goldbach-post-grh-research> | `06a63ce4` (2026-11-28) | MIT | a float64 rebuild of Appendix B.4 (N = 30030, T = 40, h = 1/16, **2,562 nodes**), compared with the paper's extreme eigenvalues −0.353421 and +0.357462; float operator and Hilbert–Schmidt norms for N = 30 … 10⁵ | | |
| 60 | +| <https://github.com/ecthelion2061-sys/li-liu-goldbach-spectral-audit> | v1.0.0 (2026-11-28) | MIT | float NumPy: a trapezoid grid on Re s = 1/log N and 1/8, \|t\| ≤ 30, dt = 0.25 (482 nodes), P − D − K then `eigvalsh`; calibrated at N = 30030; under 15 s | | |
| 61 | + | |
| 62 | +For C-4 the cheapest rigorous route on these numbers: a float `eigh` for a candidate μ, then a rigorous Cholesky of | |
| 63 | +μI ∓ A in FLINT's C library or Arblib.jl, which proves ‖A‖ < μ; or rigorous residual bounds with `arb_mat` products | |
| 64 | +(about 10 s at n = 2,562, by extrapolation from 0.58 s at n = 1,000). Gershgorin is instant but too loose. | |
| 65 | + | |
| 66 | +## Reading | |
| 67 | + | |
| 68 | +Cite these; copy only what the licence allows. | |
| 69 | + | |
| 70 | +| What | Pin | Licence | For | | |
| 71 | +|---|---|---|---| | |
| 72 | +| The official PDF <https://mrc.sdu.edu.cn/info/1018/2193.htm> | sha256 `998f35a787a2f568113fac12caf5a9a799f537e83a5e649be25f3a76ac81bc58`, 2,943,320 bytes, unchanged on 2026-12-01 | none stated | V-5 and everything else | | |
| 73 | +| Yilin Liu, hexagon:2611.00788v1 <https://hexagonmath.org/2611.00788v1> | v1, 2026-11-21, still v1 on 2026-12-01 | CC BY 4.0 | V-6 | | |
| 74 | +| wentao Meng, hexagon:2611.00966v1 <https://hexagonmath.org/2611.00966v1>: R fails at 2^15 … 2^18 with interval bounds; S ⇒ Hardy–Littlewood for (p, p + N) | v1, public 2026-11-29 | see the page | V-6, C-4, S-5, A-4 | | |
| 75 | +| Zeng Chunping, hexagon:2611.00803v1 <https://hexagonmath.org/2611.00803v1>: hypothesis D | v1, public 2026-11-29 | see the page | the S pieces, as an alternative to S; A-10 | | |
| 76 | +| Fu's R and S manuscripts, `paper/R/` and `paper/S/` in his repository | `56090686` | none | V-6, S-4, S-5 | | |
| 77 | +| J. Pintz, arXiv:1804.09084 <https://arxiv.org/abs/1804.09084> | 2018 | see the page | K-1: the unconditional E(X) ≪ X^{0.72} to beat; it calls Goldston's GRH bound "even today the best conditional result" | | |
| 78 | +| A graded reading of the paper <https://github.com/LaPingvino/goldbach-overlay> | `68feb338` | Apache-2.0 | V-5, L-1 | | |
| 79 | +| Notes on a "weak S", in Chinese <https://github.com/h1n4k0/goldbach-spectral-research> | `704b7eb7` | none | S-3, S-5, V-6 | | |
| 80 | +| A numerical audit of T_N, and claims about it <https://github.com/catalystberry842-alt/goldbach-post-grh-research> | `06a63ce4` | MIT | C-4, C-5, S-2, A-5 | | |
| 81 | + | |
| 82 | +## Another platform: goldbach.tech | |
| 83 | + | |
| 84 | +goldbach.tech (<https://www.goldbach.tech/>, mirror <https://www.movan.tech/goldbach/>, repository | |
| 85 | +<https://github.com/CGandGameEngineLearner/goldbach-proofs>, Apache-2.0, created 2026-11-23) is the other public effort | |
| 86 | +on Goldbach this fortnight; it is not this project. Every task there is a frozen Lean statement (Lean 4.36.0, Mathlib | |
| 87 | +`fc4f59e5`): a user's agent claims one with `tools/goldbach.py`, proves it privately and submits it, a checker builds | |
| 88 | +it in a sandbox, and the first accepted proof earns the points. On 2026-12-01 its page counted 762 agents at work and | |
| 89 | +its registry listed 1,178 published gaps in 56 tracks. The statements it freezes are audited there by its checker | |
| 90 | +only. Its own tracker records what that misses: a frozen statement refuted as mis-encoded (`7af95f56`, 2026-12-01), a | |
| 91 | +volunteer audit that found 33 decompositions with an empty branch and constants off by 4–15× (Discussion #6447, | |
| 92 | +2026-11-29), and new decompositions frozen on 2026-11-29 after they reached 74% of all tasks (#6407). Link its accepted | |
| 93 | +proofs as its own; do not present them as this project's results, or as reviewed. | |
+13 −1 lakefile.toml View file
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | name = "conditionalGoldbach" |
| 2 | 2 | version = "0.1.0" |
| 3 | -defaultTargets = ["ConditionalGoldbach"] | |
| 3 | +defaultTargets = ["ConditionalGoldbach", "TexAuditComparator", "Open"] | |
| 4 | 4 | |
| 5 | 5 | [[require]] |
| 6 | 6 | name = "goldbach" |
| @@ -9,3 +9,15 @@ rev = "24490c2ab7787238f816d771c9176411dcbda503" | ||
| 9 | 9 | |
| 10 | 10 | [[lean_lib]] |
| 11 | 11 | name = "ConditionalGoldbach" |
| 12 | + | |
| 13 | +# The independent Comparator project upstream keeps beside the library (its own lakefile.toml there requires this | |
| 14 | +# package by path): built here as a library of this package, so `lake comparator --config comparator.json` runs from | |
| 15 | +# the root. Its sources stay where upstream keeps them. | |
| 16 | +[[lean_lib]] | |
| 17 | +name = "TexAuditComparator" | |
| 18 | +srcDir = "verification/independent-audit/comparator-project" | |
| 19 | + | |
| 20 | +# The open statements of this project: hypothesis S and its neighbours, each stated with sorry, to be proved in | |
| 21 | +# files of their own. | |
| 22 | +[[lean_lib]] | |
| 23 | +name = "Open" | |
