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: record what the network to github.com actually does here
Browse filesChecks
circuit
Details
+22 −6 routes/little-fish/v1-rebuild-eth-vp-vnp/README.md View file
| @@ -60,12 +60,28 @@ lake env lean scripts/PrintAxioms.lean | ||
| 60 | 60 | bash ../.github/scripts/comparator-check.sh |
| 61 | 61 | ``` |
| 62 | 62 | |
| 63 | -## Network | |
| 64 | - | |
| 65 | -`github.com` was intermittent from this machine: a 5 MB download succeeded only on the third | |
| 66 | -attempt (14.7 s, then a timeout, then 3.2 s), and `curl` hit a 28 s connection timeout inside | |
| 67 | -elan's own installer. elan was therefore fetched with `curl -fL --retry 20` and installed from | |
| 68 | -the local tarball. The Lean toolchain comes from `releases.lean-lang.org`. | |
| 63 | +## Network — the one real obstacle | |
| 64 | + | |
| 65 | +Every artefact this issue needs — the Lean toolchain, the nine git dependencies of each project | |
| 66 | +(Mathlib first), and the four CI tools — is served from `github.com`, and `github.com` was badly | |
| 67 | +behaved from this machine. The measurements: | |
| 68 | + | |
| 69 | +- `pypi.org`, `conda.anaconda.org` and the Shoal site answer in well under a second. | |
| 70 | +- `github.com` answers in anywhere from 3 s to 15 s, or not at all; a 5 MB download succeeded | |
| 71 | + only on the third attempt (14.7 s, then a timeout, then 3.2 s). | |
| 72 | +- A single 570 MB toolchain transfer managed 32 MB in 89 s (≈357 KB/s), then `curl` (52) "Empty | |
| 73 | + reply from server". elan's own installer had already given up on the same URL. | |
| 74 | +- `releases.lean-lang.org` is only a 302 to `github.com`, so there is no alternative host. | |
| 75 | +- Mathlib's cache hosts, `cache.leanprover.community` and `mathlib4.lean-cache.org`, did not | |
| 76 | + answer at all from here; the S3 bucket `leanprover-community-mathlib4-bucket` did. | |
| 77 | + | |
| 78 | +Because of that, elan was installed from a locally downloaded tarball, and the pinned toolchain is | |
| 79 | +fetched by `fetch-lean-toolchain.sh`, which resumes the same file across failures (the release is | |
| 80 | +570,405,234 bytes; check the size, then `sha256sum`). Expect this to be the slow part on any | |
| 81 | +machine with the same egress. | |
| 82 | + | |
| 83 | +A second agent on a machine with ordinary access to `github.com` can skip all of it: install elan, | |
| 84 | +run `bash tools/rebuild-v1.sh`, and compare the four logs per project. | |
| 69 | 85 | |
| 70 | 86 | ## Progress |
| 71 | 87 | |
+25 −0 routes/little-fish/v1-rebuild-eth-vp-vnp/fetch-lean-toolchain.sh added View file
| @@ -0,0 +1,25 @@ | ||
| 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. This loop keeps resuming the same file until its size matches the release, and | |
| 7 | +# prints the size after every attempt, so progress is visible. | |
| 8 | +set -u | |
| 9 | +HERE="$(cd "$(dirname "$0")" && pwd)" | |
| 10 | +source "$HERE/env.sh" | |
| 11 | +URL="https://github.com/leanprover/lean4/releases/download/v4.33.1/lean-4.33.1-linux.tar.zst" | |
| 12 | +OUT="$HERE/lean-toolchain.tar.zst" | |
| 13 | +WANT=570405234 # Content-Length of lean-4.33.1-linux.tar.zst, from the release | |
| 14 | + | |
| 15 | +size() { stat -c%s "$OUT" 2>/dev/null || echo 0; } | |
| 16 | +attempt=0 | |
| 17 | +while [ "$(size)" -lt "$WANT" ]; do | |
| 18 | + attempt=$((attempt + 1)) | |
| 19 | + curl -fL -C - --connect-timeout 20 --max-time 900 --speed-time 90 --speed-limit 512 \ | |
| 20 | + -o "$OUT" "$URL" || true | |
| 21 | + echo "$(date -u '+%H:%M:%S') attempt $attempt: $(size)/$WANT bytes" | |
| 22 | + [ "$(size)" -ge "$WANT" ] || sleep 5 | |
| 23 | +done | |
| 24 | +echo "done: $(size) bytes" | |
| 25 | +sha256sum "$OUT" | |