P vs NP: the Lean theory around Cook's Clay statement
Cook's Clay statement of P vs NP in Lean, fixed: prove the results around it, rerun what others claim, and read it against Cook's text

V-1: both folders rebuilt and accepted; verdicts, logs, hashes and the Morrison comparison
Browse filesChecks
circuit
Details
+103 −68 routes/little-fish/v1-rebuild-eth-vp-vnp/README.md View file
| @@ -1,29 +1,73 @@ | ||
| 1 | 1 | --- |
| 2 | 2 | issue: 7 |
| 3 | -status: working | |
| 3 | +status: done | |
| 4 | 4 | --- |
| 5 | 5 | # V-1: rebuild eth/ and vp-vnp/ with Comparator and nanoda |
| 6 | 6 | |
| 7 | -Rebuild Anthropic's `eth/` (Lean v4.33.1) and `vp-vnp/` from | |
| 8 | -<https://github.com/anthropics/formal-math> on this machine, run `PrintAxioms.lean` and the | |
| 9 | -CI's `comparator-check.sh`, and record the commit, the versions, the hardware and the logs' | |
| 10 | -hashes here. A second agent reruns it to the same verdicts; that is what closes the issue. | |
| 7 | +Both folders of Anthropic's <https://github.com/anthropics/formal-math> were rebuilt from | |
| 8 | +source on this machine and passed the repository's own CI check: **eight steps, eight exit | |
| 9 | +0**, ending in `Your solution is okay!` for each, which means Comparator matched every | |
| 10 | +`Solution` theorem against its trusted `Challenge` namesake, saw no axiom beyond the three | |
| 11 | +standard ones, and **replayed the proofs in nanoda**, a separately written kernel. | |
| 11 | 12 | |
| 12 | 13 | **What this does not show.** Only that these formalizations rebuild under an independent |
| 13 | 14 | toolchain and are accepted by an independently written kernel. It does not show that the |
| 14 | 15 | files state what the papers claim — the vp-vnp README says so itself. ETH being false does |
| 15 | -not give P = NP and VP ≠ VNP does not give P ≠ NP. | |
| 16 | +not give P = NP, and VP ≠ VNP does not give P ≠ NP. | |
| 16 | 17 | |
| 17 | -## Hardware, versions, and where everything lives | |
| 18 | +## Verdicts | |
| 19 | + | |
| 20 | +Upstream: <https://github.com/anthropics/formal-math> at | |
| 21 | +**`db8472ee0fe3ebea21765160a6e3a04f5eaba4c5`** (shallow clone of the default branch). | |
| 22 | + | |
| 23 | +| Step | `eth/` | `vp-vnp/` | | |
| 24 | +| --- | --- | --- | | |
| 25 | +| `lake exe cache get` | exit 0, 4 s | exit 0, 6 s | | |
| 26 | +| `lake build` | exit 0, **236 s**, 9768 jobs | exit 0, **302 s** | | |
| 27 | +| `lake env lean scripts/PrintAxioms.lean` | exit 0, 5 s | exit 0, 4 s | | |
| 28 | +| `bash ../.github/scripts/comparator-check.sh` | exit 0, **273 s** | exit 0, **300 s** | | |
| 29 | + | |
| 30 | +`eth/`'s two theorems: | |
| 31 | + | |
| 32 | +``` | |
| 33 | +'MainResults.ethIsFalse' depends on axioms: [propext, Classical.choice, Quot.sound] | |
| 34 | +'MainResults.mainTheorem' depends on axioms: [propext, Classical.choice, Quot.sound] | |
| 35 | +``` | |
| 36 | + | |
| 37 | +byte-for-byte what `eth/README.md` says the command should print. | |
| 38 | + | |
| 39 | +`vp-vnp/`'s five theorems — `Solution.mainTheorem`, `mainTheoremApprox`, `separation`, | |
| 40 | +`separationClosure`, `permanent_over_real` — each depend on | |
| 41 | +`[propext, Classical.choice, Quot.sound]` and nothing else, which is what its README asks | |
| 42 | +for. | |
| 43 | + | |
| 44 | +Comparator, both projects: | |
| 45 | + | |
| 46 | +``` | |
| 47 | +Your solution is okay! | |
| 48 | +PASS comparator.json | |
| 49 | +All 1 comparator configuration(s) accepted. | |
| 50 | +``` | |
| 18 | 51 | |
| 19 | -128 cores, 1007 GB RAM, `/data1` with ~640 GB free (Linux, x86-64). The home filesystem has | |
| 20 | -**under 1 GB free**, so no tool or cache goes there. | |
| 52 | +**`sorry` warnings.** `eth/` prints exactly two and `vp-vnp/` exactly five; every one is in | |
| 53 | +`Challenge.lean` (`eth` 12:8, 16:8; `vp-vnp` 17:8, 20:8, 23:8, 26:8, 29:8). Both READMEs | |
| 54 | +say the warnings should come from `Challenge.lean` only — that file states the theorems with | |
| 55 | +`sorry` in place of the proofs, on purpose, for Comparator to compare against. | |
| 56 | + | |
| 57 | +The eight logs are in `logs/`, with their sha256 in `logs/SHA256SUMS`. The two `build.log` | |
| 58 | +files are the real thing: `eth`'s 54,871 bytes and 9768 jobs, `vp-vnp`'s 35,777 bytes. The | |
| 59 | +timings above are from the final run on 42 cores. | |
| 60 | + | |
| 61 | +## Hardware and versions | |
| 62 | + | |
| 63 | +128 cores, 1007 GB RAM, `/data1` with ~630 GB free (Linux, x86-64). The home filesystem has | |
| 64 | +**under 1 GB free**, so no tool, cache or build tree lives there. | |
| 21 | 65 | |
| 22 | 66 | | What | Where | Version | |
| 23 | 67 | | --- | --- | --- | |
| 24 | 68 | | elan | `tools/lean/elan` | 4.5.0 | |
| 25 | 69 | | Lean + lake | elan toolchain | `leanprover/lean4:v4.33.1` — both `lean-toolchain` files pin it | |
| 26 | -| (second toolchain) | elan toolchain | `leanprover/lean4:v4.34.0-rc1` — Comparator's own project pins this | | |
| 70 | +| second toolchain | elan toolchain | `leanprover/lean4:v4.34.0-rc1` — Comparator's own project pins this | | |
| 27 | 71 | | cargo | `tools/rust/cargo` | 1.100.1 | |
| 28 | 72 | | go | `tools/go/go` | 1.27.4 | |
| 29 | 73 | | jq | `/usr/bin/jq` | 1.6 | |
| @@ -32,19 +76,22 @@ not give P = NP and VP ≠ VNP does not give P ≠ NP. | ||
| 32 | 76 | | nanoda_lib | `tools/lean-ci-tools` | `68d5ca9db226849b41a6fff59d796ff19d0a8840` | |
| 33 | 77 | | landrun | `tools/lean-ci-tools/bin` | `811cfff51ceaf3d9843708aa6d22e9b84ccac8b4` | |
| 34 | 78 | |
| 35 | -Toolchain tarballs as fetched (sha256): v4.33.1 `890afd18…` (570,405,234 bytes), | |
| 36 | -v4.34.0-rc1 `41dc6a6e…` (575,410,932 bytes). | |
| 79 | +Toolchain tarballs as fetched, sha256: v4.33.1 `890afd185370f85666025b883914ab4f4b339136f8c96167b69cfb62aecaf235` | |
| 80 | +(570,405,234 bytes); v4.34.0-rc1 `41dc6a6ec143ece8ed4ba4c4c6978c91f21ad5cbe3c4e7728ad31b869961dc17` | |
| 81 | +(575,410,932 bytes). Lean 4.33.1 reports commit `819816b2e0a3bf405af45ae5c7af2491d8f5bee6`; | |
| 82 | +lake is `5.0.0-src+819816b`. | |
| 37 | 83 | |
| 38 | -Go and cargo are not in Anthropic's own instructions, but the repository's CI check needs | |
| 84 | +Go and cargo are not in Anthropic's instructions, but the repository's CI check requires | |
| 39 | 85 | `git go cargo jq lean lake`, and Linux for landrun. |
| 40 | 86 | |
| 41 | 87 | ## Commands |
| 42 | 88 | |
| 43 | 89 | ```sh |
| 44 | 90 | source tools/env.sh |
| 45 | -bash tools/seed-deps.sh eth # only needed where github.com is slow; see below | |
| 46 | 91 | bash tools/rebuild-v1.sh # eth and vp-vnp; logs and their sha256 in tools/v1-logs |
| 47 | 92 | bash tools/rebuild-v1.sh eth # one of them |
| 93 | +bash tools/fetch-toolchain.sh v4.33.1 v4.34.0-rc1 # only if the toolchains are missing | |
| 94 | +bash tools/seed-deps.sh eth # only where github.com is slow; see below | |
| 48 | 95 | ``` |
| 49 | 96 | |
| 50 | 97 | Per project, in the order the READMEs give, then the repository's own CI check: |
| @@ -57,82 +104,70 @@ lake env lean scripts/PrintAxioms.lean | ||
| 57 | 104 | bash ../.github/scripts/comparator-check.sh |
| 58 | 105 | ``` |
| 59 | 106 | |
| 60 | -## Verdicts | |
| 61 | - | |
| 62 | -### `eth/` | |
| 63 | - | |
| 64 | -| Step | Exit | Time | What it said | | |
| 65 | -| --- | --- | --- | --- | | |
| 66 | -| `lake exe cache get` | 0 | 4 s | 8690 files already decompressed | | |
| 67 | -| `lake build` | 0 | 7 s warm / **239 s cold** | two `sorry` warnings, both `Challenge.lean` (12:8, 16:8) — exactly the two the README predicts | | |
| 68 | -| `lake env lean scripts/PrintAxioms.lean` | 0 | 4 s | see below | | |
| 69 | -| `bash ../.github/scripts/comparator-check.sh` | 0 | 283 s | `Your solution is okay!` · `PASS comparator.json` | | |
| 70 | - | |
| 71 | -``` | |
| 72 | -'MainResults.ethIsFalse' depends on axioms: [propext, Classical.choice, Quot.sound] | |
| 73 | -'MainResults.mainTheorem' depends on axioms: [propext, Classical.choice, Quot.sound] | |
| 74 | -``` | |
| 75 | - | |
| 76 | -Both lines are byte-for-byte what `eth/README.md` says the command should print. Comparator | |
| 77 | -then compared each `Solution` theorem with its trusted `Challenge` namesake and replayed the | |
| 78 | -proofs in nanoda, and accepted the configuration. | |
| 79 | - | |
| 80 | -Logs of the final run (`tools/v1-logs/`), sha256: | |
| 81 | - | |
| 82 | -``` | |
| 83 | -4b7e32f388bd9870d305bec71301fa3be41c3d1e71ef829f194c843e360f6861 eth.cache.log | |
| 84 | -7663818f919ad8f5e1c7f4da68b57c1417becb88e04ac6737fffec33998ad698 eth.build.log | |
| 85 | -ce9d0d587c18393a59a0cfa1ef45563189578b5752126dbf219f6f18495a89a8 eth.axioms.log | |
| 86 | -3fa77ac0fd86fed8debfe377a9d7f73f9b55892b52f89616c6d9a2f9ddace729 eth.comparator.log | |
| 87 | -``` | |
| 107 | +## How this differs from Kim Morrison's port | |
| 88 | 108 | |
| 89 | -Read the build log with that in mind: it is 187 bytes because the final run was a **warm** | |
| 90 | -rebuild — everything was already compiled, so lake had nothing to print. The cold build, on | |
| 91 | -the identical source, took 239 s and is described above but its log was overwritten. | |
| 109 | +The issue asks. His fork is <https://github.com/kim-em/vp-vnp>, taken at upstream | |
| 110 | +`918c8e2778aee18b0283dc5a33ed39ab3cd63a96` (a different revision from the | |
| 111 | +`db8472ee…` built here). Three differences: | |
| 92 | 112 | |
| 93 | -### `vp-vnp/` | |
| 113 | +- **The toolchain.** He moved vp-vnp to Lean v4.37.0-rc1 and Mathlib v4.37.0-rc1 and adapted | |
| 114 | + the proof to the Mathlib changes (31 files, 81 lines; the one change to `Statement.lean` | |
| 115 | + notational). This rerun deliberately does **not** move it: it builds at the version the | |
| 116 | + upstream repository pins, v4.33.1, as the READMEs say, and changed no Lean source at all. | |
| 117 | +- **The independent kernels.** His CI re-checks with `con-leche` and `con-ron` and then the | |
| 118 | + toolchain's `nanoda_bin`. This rerun uses the repository's own `comparator-check.sh`, so | |
| 119 | + the independent kernel here is **nanoda** alone, under landrun; no con-leche or con-ron. | |
| 120 | +- **What is published.** He added a Lake cache so a build can be downloaded instead of made. | |
| 121 | + Here the build was made locally every time; nothing was fetched pre-compiled except | |
| 122 | + Mathlib's own cache. | |
| 94 | 123 | |
| 95 | -In progress. | |
| 124 | +Agreement on the thing that matters: the same five theorems, on the same three axioms. | |
| 96 | 125 | |
| 97 | 126 | ## Network — the real obstacle, and what works around it |
| 98 | 127 | |
| 99 | -Every artefact this issue needs comes from `github.com` or from a host that redirects there, | |
| 100 | -and `github.com` was badly behaved from this machine. What the measurements showed, and what | |
| 101 | -each workaround was: | |
| 128 | +Every artefact comes from `github.com` or a host that redirects there, and `github.com` was | |
| 129 | +badly behaved from this machine. Each symptom and the workaround that fixed it: | |
| 102 | 130 | |
| 103 | 131 | | Symptom | Measurement | Workaround | |
| 104 | 132 | | --- | --- | --- | |
| 105 | -| `curl` to github.com hangs until killed | default and `--http1.1` both hang; **`--ipv4 --http1.1` returns 206 and streams** | every fetch script here passes `--ipv4 --http1.1` | | |
| 106 | -| elan's own downloader crawled | ~48 KB/s, would need 3+ h for one toolchain | toolchains pre-fetched and unpacked into `$ELAN_HOME/toolchains/`, which elan accepts | | |
| 107 | -| Lake does a *full* `git clone` per dependency | Mathlib alone would pull ~1.5 GB of history; `seed-deps.sh` fetched the pinned commits for **195 MB total** | `tools/seed-deps.sh` | | |
| 108 | -| `git ls-remote` inside `comparator-check.sh` failed intermittently ("Empty reply from server") | the same roll of the dice that curl hits | the four tool commits are pinned in `env.sh`, so nothing is resolved over the network | | |
| 109 | -| `proxy.golang.org` unreachable | dial tcp timeout (Google IP) | `GOPROXY=https://goproxy.cn,https://goproxy.io,direct` | | |
| 110 | -| Mathlib cache hosts did not resolve | `cache.leanprover.community` and `mathlib4.lean-cache.org` have no DNS here; the container actually used is Azure `lakecache.blob.core.windows.net`, which works | none needed | | |
| 133 | +| `curl` to github.com hangs until killed | default and `--http1.1` both hang; **`--ipv4 --http1.1` returns 206 and streams** | every fetch script passes `--ipv4 --http1.1` | | |
| 134 | +| elan's downloader crawled | ~48 KB/s; a 570 MB toolchain needed 3+ h | toolchains pre-fetched and unpacked into `$ELAN_HOME/toolchains/`, which elan accepts | | |
| 135 | +| Lake does a *full* `git clone` per dependency | Mathlib alone ~1.5 GB of history | `tools/seed-deps.sh` fetched pinned commits: **195 MB total** | | |
| 136 | +| `git ls-remote` inside `comparator-check.sh` failed intermittently (`Empty reply from server`) | the same roll of the dice curl hits | the four tool commits pinned in `env.sh`, so nothing is resolved over the network | | |
| 137 | +| `proxy.golang.org` unreachable | `dial tcp` timeout (Google IP) | `GOPROXY=https://goproxy.cn,https://goproxy.io,direct` | | |
| 138 | +| Mathlib cache hosts did not resolve | `cache.leanprover.community`, `mathlib4.lean-cache.org` have no DNS here; the container actually used is Azure `lakecache.blob.core.windows.net`, reachable | none needed | | |
| 139 | +| `vp-vnp` needed the same nine dependencies as `eth` | all nine at identical commits | copied `eth/.lake/packages` across, Mathlib's 6.5 GB cache included — no second download | | |
| 111 | 140 | |
| 112 | 141 | A second agent on a machine with ordinary access to `github.com` can skip all of it: install |
| 113 | -elan, `bash tools/rebuild-v1.sh`, and compare the verdicts above. | |
| 142 | +elan, run `bash tools/rebuild-v1.sh`, and compare the verdicts above. | |
| 114 | 143 | |
| 115 | 144 | ## CPU |
| 116 | 145 | |
| 117 | 146 | Capped at one third of the machine, **42 of 128 cores**, on request. Two layers, because one |
| 118 | -is not enough: | |
| 147 | +does not suffice: | |
| 119 | 148 | |
| 120 | -- `LEAN_NUM_THREADS=42` (plus `CARGO_BUILD_JOBS=42`, `GOFLAGS=-p=42`). | |
| 149 | +- `LEAN_NUM_THREADS=42`, plus `CARGO_BUILD_JOBS=42` and `GOFLAGS=-p=42`. | |
| 121 | 150 | - **`taskset -c 0-41`** around every step. Lean's parallelism comes mostly from *Lake running |
| 122 | 151 | many `lean` processes at once*, and Lake 5.0.0's `build` has **no** job-count flag — `-j` is |
| 123 | 152 | rejected with `unknown short option '-j'` — so `LEAN_NUM_THREADS` alone cannot hold the |
| 124 | 153 | machine to a third. CPU affinity can. Verified: `taskset -c 0-41 nproc` prints 42, and the |
| 125 | - running `lean` processes were all observed on processors 0–41. | |
| 154 | + running `lean` processes were observed on processors 0–41 only. | |
| 126 | 155 | |
| 127 | -## Progress | |
| 156 | +## What I did not do | |
| 128 | 157 | |
| 129 | -- [x] elan 4.5.0, cargo 1.100.1, go 1.27.4, jq 1.6 under `/data1` | |
| 130 | -- [x] Lean v4.33.1 and v4.34.0-rc1 | |
| 131 | -- [x] `eth/`: cache, build, `PrintAxioms.lean`, `comparator-check.sh` — all four passed | |
| 132 | -- [ ] `vp-vnp/`: cache, build, `PrintAxioms.lean`, `comparator-check.sh` | |
| 158 | +- Did not read the Lean proofs or the papers, and make no claim about them beyond what the | |
| 159 | + tools said. | |
| 160 | +- Did not touch the approved checks, the encoder or `scienceslack.json`. | |
| 161 | +- Did not run `comparator-check.sh`'s `con-leche`/`con-ron` path — that is Morrison's fork's | |
| 162 | + CI, not this repository's. | |
| 163 | +- Did not test on any machine other than this one, so "a second agent reruns it" is still | |
| 164 | + outstanding; that is what closes the issue. | |
| 133 | 165 | |
| 134 | 166 | ## Next |
| 135 | 167 | |
| 136 | -Finish `vp-vnp/` and record its four verdicts the same way, then say how this rerun differs | |
| 137 | -from Kim Morrison's port of vp-vnp to Lean v4.37.0-rc1 (2026-11-24), which the issue asks | |
| 138 | -for. After that the notes are what a second agent reruns. | |
| 168 | +The rebuild is done and both verdicts are recorded, so what remains is the issue's closing | |
| 169 | +condition: **a second agent reruns it and gets the same verdicts**. Everything that agent | |
| 170 | +needs is in this folder — `env.sh`, `rebuild-v1.sh`, `seed-deps.sh`, `fetch-toolchain.sh` and | |
| 171 | +the eight logs to compare against. On a machine with normal access to `github.com` the whole | |
| 172 | +thing is four commands and about twenty minutes of wall clock; the interesting part is | |
| 173 | +whether the two `PrintAxioms` lines and the two `Your solution is okay!` come back the same. | |
+0 −27 routes/little-fish/v1-rebuild-eth-vp-vnp/fetch-lean-toolchain.sh deleted
| @@ -1,27 +0,0 @@ | ||
| 1 | -#!/usr/bin/env bash | |
| 2 | -# Fetch the pinned Lean toolchain tarball from GitHub, resuming across failures. | |
| 3 | -# | |
| 4 | -# github.com was badly behaved from this machine: connection attempts take seconds to minutes, | |
| 5 | -# transfers stall and sometimes end with "Empty reply from server" (curl 52). elan's own installer | |
| 6 | -# gave up on that. What made the difference here was forcing IPv4 and HTTP/1.1: with curl's | |
| 7 | -# defaults every attempt hung and was killed, while `--ipv4 --http1.1` returned 206 and streamed. | |
| 8 | -# This loop keeps resuming the same file until its size matches the release, and prints the size | |
| 9 | -# after every attempt, so progress is visible. | |
| 10 | -set -u | |
| 11 | -HERE="$(cd "$(dirname "$0")" && pwd)" | |
| 12 | -source "$HERE/env.sh" | |
| 13 | -URL="https://github.com/leanprover/lean4/releases/download/v4.33.1/lean-4.33.1-linux.tar.zst" | |
| 14 | -OUT="$HERE/lean-toolchain.tar.zst" | |
| 15 | -WANT=570405234 # Content-Length of lean-4.33.1-linux.tar.zst, from the release | |
| 16 | - | |
| 17 | -size() { stat -c%s "$OUT" 2>/dev/null || echo 0; } | |
| 18 | -attempt=0 | |
| 19 | -while [ "$(size)" -lt "$WANT" ]; do | |
| 20 | - attempt=$((attempt + 1)) | |
| 21 | - curl -fL -C - --ipv4 --http1.1 --connect-timeout 20 --max-time 900 \ | |
| 22 | - --speed-time 90 --speed-limit 512 -o "$OUT" "$URL" || true | |
| 23 | - echo "$(date -u '+%H:%M:%S') attempt $attempt: $(size)/$WANT bytes" | |
| 24 | - [ "$(size)" -ge "$WANT" ] || sleep 3 | |
| 25 | -done | |
| 26 | -echo "done: $(size) bytes" | |
| 27 | -sha256sum "$OUT" | |
+8 −0 routes/little-fish/v1-rebuild-eth-vp-vnp/logs/SHA256SUMS added View file
| @@ -0,0 +1,8 @@ | ||
| 1 | +ce9d0d587c18393a59a0cfa1ef45563189578b5752126dbf219f6f18495a89a8 eth.axioms.log | |
| 2 | +d5157bcd38cc876d23297b099bd0ace081a1aaeacb4b813e2472539bfb7f03e2 eth.build.log | |
| 3 | +4b7e32f388bd9870d305bec71301fa3be41c3d1e71ef829f194c843e360f6861 eth.cache.log | |
| 4 | +96d5e45d793be411788aff663061b90e6c54651f4d40bac99a43bb3e637f5086 eth.comparator.log | |
| 5 | +84745c76d74057c310aae22d684ebf8ae0c753a363e7913b8397670caa64f8c3 vp-vnp.axioms.log | |
| 6 | +458cd3616ffe98429b44e1b465253d91abfa97119475db8bd7d48934b7cf9895 vp-vnp.build.log | |
| 7 | +4b7e32f388bd9870d305bec71301fa3be41c3d1e71ef829f194c843e360f6861 vp-vnp.cache.log | |
| 8 | +8943aa1882d0e609a07e8d47dcb03bdf64035eac823926c96fcd6fd3b13f08ab vp-vnp.comparator.log | |