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
AGENTS.md
Read README.md first, then KNOWN.md. main is Ziyu Zhou's Lean library of Li and Liu's reduction, and
what we want is a proof that people can read, and the open statements of Open.lean settled. A change that makes the
code shorter or faster but harder to read is not welcome. Goldbach's conjecture is open, and S with it: never describe
a change here as progress on Goldbach unless it proves an open statement, and then say exactly which.
First session
python3 checks/challenge.py . # last line: ok: 6 challenge files and the build configuration as approved; …
git fetch origin issues && git show origin/issues:BOARD.md # who works on what
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
mind, take P-1 (linter warnings in one folder), M-1 (one of our lemmas that Mathlib has), S-1 (S is
monotone in the weight) or V-4 (rebuild and run Comparator). What counts as progress here is what build
verifies; the reviews and research below keep the record honest and close on their readers.
Reviews and research
These change no Lean file and are judged by people and other agents, not by build:
- Audits (A-1…A-10): one claim made elsewhere since 2026-11-20 each. Write
routes/<your-branch>/AUDIT.md: the claim and its pin, what you rebuilt or read (commands, versions and hashes, or pages), and its state with the evidence: machine-checked only, claimed, refuted, or statement wrong. A second party reproduces it in a review. - The status table (L-1) in the root README, and research on S (S-2, S-3) and ¬R read as mathematics (V-6): a note in your route; S-2, S-3 and V-6 close when two readers who know the area accept it.
Claim an issue
Work on a branch of your own, and say what you take in its notes:
git switch -c my-change origin/main
mkdir -p routes/my-change
cat > routes/my-change/README.md <<'EOF'
---
issue: 3
status: working
---
# my-change
Which files, and what I change in them.
## Next
The first concrete step.
EOF
A push keeps the claim alive. If you stop, leave ## Next so whoever continues knows where you stopped. Your change
itself is in the Lean files, anywhere in the repository; the notes say what it is.
Changes we want
- A proof of one of the open statements of
Open.lean, in a file of its own, sorry-free. - Using a result from Mathlib in place of our own proof of it, and deleting ours. Check that the statements agree, hypotheses included. If the library states it in another form, keep our lemma as a short wrapper rather than adding a conversion at every caller.
- Deleting declarations that nothing uses.
- Proving once, as a lemma, an argument that appears several times, and using it everywhere.
- Splitting a long proof into lemmas with names and docstrings. A comment that explains a step moves with it.
- A more general lemma in place of an old one, if its proof is about as easy. Move the callers to it and delete the old one.
- Fixing linter warnings, wrong docstrings and open issues. A docstring says what its declaration states, including
both directions of an
iff.
Changes we don't want
- Inlining a lemma into its only caller, or folding helper lemmas or named
havesteps into one long proof. A step with a name still tells the reader what it proves. - Cutting an
iffdown to one direction, or dropping conclusions from a lemma, because no caller needs them. - Replacing
simpwith a longsimp only [...]list, or expanding a tactic into many hand-written steps, to save a second or a few lines. - A
simpor other flexible tactic followed by steps that depend on the exact form it leaves. Make it the last step, or usesimp only. - A new or wider
sealwithout a timing that shows it is needed. - Adding or changing a reference to the literature without checking it against the source. Say which edition you checked and give the theorem number.
- Any change to the challenge (
Challenge.lean,Reference14.lean,Reference57.lean,ReferenceAB.lean),comparator.json,Open.leanorchecks/: thechallengecheck fails it, as it fails a change tolakefile.tomlbeyond arequire'srev,leanOptions,defaultTargets,lean_exeor[cache], a dependency outside leanprover and leanprover-community (goldbach-lean and LeanArchitect excepted), alakefile.lean, or files under.lake/. If you think a statement is wrong, open an issue titled "Ruling: …" and say why.
Pull requests
Keep each pull request to one change; fixing linter warnings in the files you edit doesn't count as a second one. If
you have Lean 4.35 at hand, check that it compiles (lake exe cache get, then lake build) before you open it; if you
don't, push and let build judge it (about eight minutes): don't spend the session installing a toolchain. Either way,
don't write in it that it builds: the build check says that. A proof of an open statement goes in a file of its own,
Open/<Name>.lean (the build compiles every file under Open/), never under routes/; leave lakefile.toml and
Open.lean as they are. Titles follow Mathlib's convention.
In the description, name the issue it answers (Closes #3), say in two or three sentences what the change does and why
it makes the proof easier to read, and keep the title and description in step with the diff when you push more
commits. Leave out timings and heartbeat counts unless speed is the reason for the change; then give the few numbers a
maintainer needs to decide, per declaration where you can, and say how you measured them.
If you want to make the same kind of change in many places, open one pull request first and wait for the maintainer to say we want it before you open the others.
CI
Two checks run on every push that changes a Lean file or the build's files (lakefile.toml, lake-manifest.json,
lean-toolchain; for challenge also comparator.json and .lake/), like upstream's GitHub CI, and both gate the
merge. A push of notes, an audit or a job's output alone keeps the verdicts of the commit it builds on, at once: it
shows no statuses of its own (GET …/commits/<sha>/status says total_count 0), and its route's verdict is the one
that counts (shoal wait routes/<branch> until "verdict exists", or GET …/wait?on=routes/<branch>&until=verdict%20exists). Their
code is checks/ at the approved version, so editing it on your branch changes nothing about your verdict. build
takes about eight minutes and queues behind others' builds: wait for it with shoal wait, and do not push again to
hurry it (each push is built anew).
challenge(upstream'schallenge-files.yml), seconds: the Comparator challenge files and the build configuration are as approved, and the source has nosorry,admit,axiom,native_decide,implemented_byorextern. Run it yourself:python3 checks/challenge.py .build(upstream'sbuild.yml), 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 buildends without error, no module reportssorry, the theorems use no axiom beyondpropext,Classical.choiceandQuot.sound, and Comparator accepts the solution. Its last line says what held or what did not; its logs are kept with the job. With Lean at hand, the same locally before you push:lake exe cache get && lake build, thenlake comparator --config comparator.json.
A toolchain or Mathlib bump passes challenge, but build needs a new image first (docker/README.md): open an issue
for a person who maintains the project rather than a pull request that cannot pass.
For the maintainer
The site reads each pull request within minutes of a push; the house's maintainer agent (shoal-maintainer) comes
every two hours, and within minutes when someone writes to it, to rebuild what is claimed, answer questions and keep
"Where it stands" current; a person decides what it leaves to a person.
Judge every pull request against the two lists above: whether the proof is easier to read after it, not only whether it is shorter or faster.
- Merge a change we want once
challengeandbuildhave passed on its head, and the description says what it changes and why. A head whose commits change no file the checks judge (Lean files and the build's files: a README, notes, an audit are not) is not checked again: their verdicts on the commit it builds on stand for it, the site's gate counts them, and the head shows none of its own. Do not ask for a re-run that will never come. - Escalate a claimed proof of an open statement, even with both checks green: a person adds it to the Comparator challenge, and Goldbach's status is a person's word.
- Request changes when the description and the diff disagree, when it is two changes in one, when it is on the second list (say which item), or when a reference is added without the edition and theorem number.
- Request changes when
challengeorbuildfailed: quote the check's last line. - Escalate a change to the challenge files, to
checks/ordocker/, tolakefile.toml's libraries or dependencies, a new dependency, or two reviews that disagree: say in one sentence what a person must decide. - Close a repeat of a change already merged or open, pointing to it, and a mass change opened before the first of its kind was wanted.
- 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 piece asks and a second party has reproduced or read it in a review; it never claims more than its evidence.
Never merge on the author's word that it builds: only build says so, on the head or, for a head that changes no
file it judges, on the commit it builds on. After a merge, add to KNOWN.md what changed and, if it took a lemma
from a library, which one.
