Hodge conjecture: the CM case in Lean, read and discussed
OpenAI's Lean proof of the Hodge conjecture for CM abelian varieties: rerun it, read its statement, and keep the open questions with their sources. The conjecture is open

| 1 | # AGENTS.md |
| 2 | |
| 3 | Read [README.md](README.md) first, then `KNOWN.md`. `main` is OpenAI's Lean proof of the rational Hodge conjecture for |
| 4 | CM abelian varieties as published, cut to what the theorem imports. What we want: the proof rerun on stated hardware |
| 5 | and with a second kernel; its statement read one definition at a time and tested by theorems in Lean, since nobody has |
| 6 | published a reading of it; the open questions kept with their sources; and a proof people can read and build. A change |
| 7 | that makes the code shorter or faster but harder to read is not welcome. Never describe a change here as progress on |
| 8 | the Hodge conjecture itself: the theorem is one case of it, it is fixed, and only its proof changes. |
| 9 | |
| 10 | ## First session |
| 11 | |
| 12 | In your clone of this project, with Python 3 and no Lean (the clone is large: 33,000 Lean files): |
| 13 | |
| 14 | ```bash |
| 15 | python3 checks/challenge.py . # last line: ok: 260 challenge files and the build configuration as approved; … |
| 16 | git fetch origin issues && git show origin/issues:BOARD.md # the pieces, and who works on what |
| 17 | cd ComparatorChallenges/HodgeConjectureCMAbelianVarieties |
| 18 | cat Challenge.lean CM.lean HodgeConjecture/Statement.lean # the theorem, what CM means here, the conjecture itself |
| 19 | ``` |
| 20 | |
| 21 | Then pick one piece nobody holds. Each issue says what to do, what it needs (reading only, compiling against the |
| 22 | statement library, or a full build on a large machine), when it closes and what it does not show. By what you have: |
| 23 | |
| 24 | - **Reading only**: one definition of the statement (R-2 to R-10, one each: start with R-2, complex points, where the |
| 25 | earlier Lean statement failed), one open question (Q-1 to Q-6), V-4 (what the repair of 2026-10-29 changed), L-1 or |
| 26 | L-2 (one row), T-4. |
| 27 | - **Lean and patience** (the statement library is 257 files on Lean v4.34.1): R-12 (a first checked example), R-11, |
| 28 | R-13, P-1, M-1. |
| 29 | - **A large machine and days**: V-1 (the only public pass took 31 hours). |
| 30 | |
| 31 | ## Reruns, readings and questions |
| 32 | |
| 33 | A rerun (Comparator on this project, nanoda on its export, a build of the original library) is a dated record in |
| 34 | `routes/<your-branch>/RERUN.md`, one section per run, never replaced: a later run is a new section. The one template: |
| 35 | |
| 36 | ```markdown |
| 37 | ## 2026-12-02: <what was rerun>, by <who> (<which agent, if one ran it>) |
| 38 | |
| 39 | - Machine: <CPU model, cores, RAM, OS>; <your own machine, or the site's job number> |
| 40 | - Image: <the image tag and id, or `lean --version` and the Mathlib commit; Comparator, lean4export, landrun, nanoda> |
| 41 | - Commit: <repository URL and the full commit that was rerun> |
| 42 | - Command: <each command as typed, with its exit code, wall time and peak memory> |
| 43 | - What it printed: <the lines that carry the verdict, copied, not paraphrased> |
| 44 | - What was not checked: <every part of the claim this run does not cover; never "what the statement means"> |
| 45 | ``` |
| 46 | |
| 47 | A reading is `docs/readings/<piece>.md`, a question `docs/questions/<piece>.md`. Every claim in them has a source: a file |
| 48 | and line (as Lean's `#print` shows the declaration), or a paper with its version and page. A reading's first line is its |
| 49 | status, "unread by a person" until a named person who knows the area says in a review that they read it. In a |
| 50 | question, each position stands under its author's name with its source; where two differ, both stay. Nothing is |
| 51 | settled by a count of voices, and a position leaves only when its source is withdrawn or it misquotes. Your own view |
| 52 | goes in under your name, with sources, beside the others. A reading that finds the statement wrong is an issue titled |
| 53 | "Ruling: …" as well. |
| 54 | |
| 55 | ## Claim an issue |
| 56 | |
| 57 | Work on a branch of your own, and say what you take in its notes: |
| 58 | |
| 59 | ```bash |
| 60 | git switch -c my-change origin/main |
| 61 | mkdir -p routes/my-change |
| 62 | cat > routes/my-change/README.md <<'NOTES' |
| 63 | --- |
| 64 | issue: 3 |
| 65 | status: working |
| 66 | --- |
| 67 | # my-change |
| 68 | |
| 69 | Which files, and what I change in them. |
| 70 | |
| 71 | ## Next |
| 72 | |
| 73 | The first concrete step. |
| 74 | NOTES |
| 75 | ``` |
| 76 | |
| 77 | A push keeps the claim alive. If you stop, leave `## Next` so whoever continues knows where you stopped. Your change |
| 78 | itself is in the Lean files under `OAI/`; the notes say what it is. |
| 79 | |
| 80 | ## Changes we want |
| 81 | |
| 82 | - Using a result from Mathlib in place of our own proof of it, and deleting ours. Check that the statements agree, |
| 83 | hypotheses included. If Mathlib states it in another form, keep our lemma as a short wrapper rather than adding a |
| 84 | conversion at every caller. |
| 85 | - Deleting declarations and files that nothing uses. The proof imports 33,000 modules of a library written for many |
| 86 | results; much of it may serve none of this theorem's steps. |
| 87 | - Proving once, as a lemma, an argument that appears several times, and using it everywhere. |
| 88 | - Merging a chain of tiny files that only re-export one another, when the merged file reads as one topic. |
| 89 | - Splitting a long proof into lemmas with names and docstrings. A comment that explains a step moves with it. |
| 90 | - Tying a declaration to the paper: a docstring that names the section, lemma or equation of OpenAI's paper (or of van |
| 91 | Hoften and Sempliner's) it formalises, checked against the paper. |
| 92 | - Fixing linter warnings, wrong docstrings and open issues. A docstring says what its declaration states, including |
| 93 | both directions of an `iff`. |
| 94 | - Theorems that test the statement, in new files outside the frozen ones: an example that satisfies the hypotheses |
| 95 | (R-12), every algebraic class is a Hodge class (R-11), Lefschetz (1,1) (R-13). A test that fails is a finding: say so |
| 96 | in a "Ruling: …" issue rather than working around it. |
| 97 | - Readings and questions under `docs/` in the form above. |
| 98 | |
| 99 | ## Changes we don't want |
| 100 | |
| 101 | - Inlining a lemma into its only caller, or folding helper lemmas or named `have` steps into one long proof. A step |
| 102 | with a name still tells the reader what it proves. |
| 103 | - Cutting an `iff` down to one direction, or dropping conclusions from a lemma, because no caller needs them. |
| 104 | - Replacing `simp` with a long `simp only [...]` list, or expanding a tactic into many hand-written steps, to save a |
| 105 | second or a few lines. |
| 106 | - A `simp` or other flexible tactic followed by steps that depend on the exact form it leaves. Make it the last step, |
| 107 | or use `simp only`. |
| 108 | - Removing a file's `set_option backward.*` lines without a build that shows the file still compiles without them. |
| 109 | - Bringing back another package of upstream's `lakefile.lean` (Tau Ceti, carleson and the rest): nothing here imports |
| 110 | them, and `challenge` fails a dependency outside leanprover and leanprover-community. |
| 111 | - Adding or changing a reference to the papers or the literature without checking it against the source. Say which |
| 112 | version you checked and give the section or equation number. |
| 113 | - A reading or a question that states a claim without its source, removes someone else's sourced position, or marks |
| 114 | itself read by a person who has not said so. |
| 115 | - Any change to `Challenge.lean`, `CM.lean`, `main.json` or the statement library `HodgeConjecture/` in |
| 116 | `ComparatorChallenges/HodgeConjectureCMAbelianVarieties/`, or to `checks/`: the `challenge` check fails it, as it |
| 117 | fails a change to `lakefile.toml` beyond a `require`'s `rev`, `leanOptions`, `defaultTargets`, `lean_exe` or |
| 118 | `[cache]`, a dependency outside leanprover and leanprover-community, a `lakefile.lean`, or files under `.lake/`. If |
| 119 | you think a statement is wrong, open an issue titled "Ruling: …" and say why. |
| 120 | |
| 121 | ## Pull requests |
| 122 | |
| 123 | Keep each pull request to one change; fixing linter warnings in the files you edit doesn't count as a second one. |
| 124 | Compile what you changed if you can (`lake exe cache get`, then `lake build` of the modules you touched and what |
| 125 | imports them); if you cannot, push and let the `build` check say. Either way, open the pull request, and don't write |
| 126 | in it that it builds: `build` says that. Titles follow |
| 127 | [Mathlib's convention](https://leanprover-community.github.io/contribute/commit.html). In the description, name the |
| 128 | issue it answers (`Closes #3`), say in two or three sentences what the change does and why it makes the proof easier |
| 129 | to read, and keep the title and description in step with the diff when you push more commits. Leave out timings and |
| 130 | heartbeat counts unless speed is the reason for the change; then give the few numbers a maintainer needs to decide, |
| 131 | per declaration where you can, and say how you measured them. |
| 132 | |
| 133 | If you want to make the same kind of change in many places, open one pull request first and wait for the maintainer to |
| 134 | say we want it before you open the others. |
| 135 | |
| 136 | ## CI |
| 137 | |
| 138 | Two checks run on every push, and a third, `replay`, is the maintainer's; all three gate the merge. Their code is |
| 139 | `checks/` at the approved version, so editing it on your branch changes nothing about your verdict. |
| 140 | |
| 141 | - **`challenge`**, seconds: the Comparator challenge files and the build configuration are as approved, and the source |
| 142 | has no `sorry`, `admit`, `axiom`, `native_decide`, `implemented_by` or `extern`. Run it yourself: |
| 143 | `python3 checks/challenge.py .` |
| 144 | - **`build`**, up to hours: in the project's Lean image with no network, `lake build` ends without error, no module |
| 145 | reports `sorry`, and the theorems use no axiom beyond `propext`, `Quot.sound` and `Classical.choice`. It does not |
| 146 | run Comparator: its last line says what held and "not replayed". Its logs are kept with the job. If you can build, |
| 147 | `lake exe cache get && lake build` before you push; if you cannot, push and let `build` say. |
| 148 | - **`replay`**: the full replay, Comparator on |
| 149 | `ComparatorChallenges/HodgeConjectureCMAbelianVarieties/main.json` (the same statement, the Lean kernel), which the |
| 150 | maintainer's machine runs on a pull request's head once `build` has passed there, and on `main` when it moves, and |
| 151 | reports itself. You do nothing for it and need not wait for it; the merge does. |
| 152 | |
| 153 | A toolchain or Mathlib bump passes `challenge`, but `build` needs a new image first (`docker/README.md`): open an issue |
| 154 | for a person who maintains the project rather than a pull request that cannot pass. |
| 155 | |
| 156 | ## For the maintainer |
| 157 | |
| 158 | The house's maintainer agent (`hodge-maintainer`) comes about every two hours while people work here, at least twice a |
| 159 | day, and within minutes when written to. It reviews (first line ``**Review of `<commit>`: <verdict>**``), does not |
| 160 | merge, logs each round on the issue "Maintainer log", and opens `Ruling: …` issues (`needs-person`) for what only a |
| 161 | person decides. Here, as a `reading` problem: |
| 162 | |
| 163 | - **Discussions kept useful** (skill `discussion`): a source asked for every fact; what was checked here kept apart |
| 164 | from what is only sourced and from opinion; a thread of eight replies, or quiet for two days with a question open, |
| 165 | summarised on its issue. A thread nobody qualified has read says "unread by a person". |
| 166 | - **Readings of the Lean statement reviewed** clause by clause: the Lean side quoted from Lean's own `#print` in the |
| 167 | project's image, the literature's side quoted with edition and number. A reading that finds the statement does not |
| 168 | say what the conjecture says goes to a person. |
| 169 | - **Main replayed once a round.** Here `build` on a push compiles and scans for `sorry` but does not run Comparator |
| 170 | (`"replay": "round"` in `checks/build.json`): its last line says "not replayed". The full replay of main runs on the |
| 171 | maintainer's host (`house/maintainer/replay.sh`) at the start of a round when main moved; a failure is a ruling for |
| 172 | a person, who may revert. |
| 173 | - **Sources watched**: `openai/math` (the upstream) and the papers the README cites. |
| 174 | |
| 175 | Judge every pull request against the two lists above: whether the proof is easier to read after it, not only whether |
| 176 | it is shorter or faster. |
| 177 | |
| 178 | - **Merge** a change we want once `challenge` and `build` have passed on its head, and the description says what it |
| 179 | changes and why. |
| 180 | - **Request changes** when the description and the diff disagree, when it is two changes in one, when it is on the |
| 181 | second list (say which item), or when a reference to a paper is added without the version and the number. |
| 182 | - **Request changes** when `challenge` or `build` failed: quote the check's last line. |
| 183 | - **Escalate** a change to `ComparatorChallenges/`, to `checks/` or `docker/`, to `lakefile.toml`'s libraries or |
| 184 | dependencies, a new dependency, a claim that the statement does not say what the Hodge conjecture says, or two |
| 185 | reviews that disagree: say in one sentence what a person must decide. |
| 186 | - **Close** a repeat of a change already merged or open, pointing to it, a mass change opened before the first of its |
| 187 | kind was wanted, and anything that offers a proof of the general Hodge conjecture. |
| 188 | |
| 189 | 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 |
| 190 | changed and, if it took a lemma from Mathlib, which one. |