Birch and Swinnerton-Dyer: certified ranks in Lean
ECCompute: Lean that certifies rank lower bounds for 480 elliptic curves, up to rank ≥ 31. Certify more, rerun it, read what 2026 claimed about BSD

| 1 | |
| 2 | # Build the Lean image of the `build` check, on the machine whose runner will use it. |
| 3 | # |
| 4 | # sh docker/build.sh <checkout of the project's main> [<tag>] |
| 5 | # |
| 6 | # MIRRORS=cn take apt, the Lean release and seven of the Lean packages from the mirrors a host in Beijing can reach |
| 7 | # (lean.Dockerfile's ARGs) |
| 8 | # CPUSET=32-63 the cores the build may use (Docker's classic builder honours it; the default is all of them) |
| 9 | # |
| 10 | # The tag is the one the project's rules name for the `build` check (scienceslack.json) unless given. One |
| 11 | # `docker build` of lean.Dockerfile with the checkout as its context: the tools and the toolchain, the dependencies |
| 12 | # with Mathlib's cache (a layer that stays while lakefile.toml, lake-manifest.json and lean-toolchain stay), then the |
| 13 | # tree and its build. |
| 14 | set -eu |
| 15 | main=$(cd "$1" && pwd) |
| 16 | tag=${2:-$(python3 -c 'import json, sys; print(json.load(open(sys.argv[1]))["checks"]["build"]["image"])' "$main/scienceslack.json")} |
| 17 | if [ -e "$main/.lake" ]; then echo "$main holds .lake: build from a clean checkout" >&2; exit 2; fi |
| 18 | cpus=${CPUSET:+--cpuset-cpus $CPUSET} |
| 19 | mirrors= |
| 20 | if [ "${MIRRORS:-}" = cn ]; then |
| 21 | mirrors="--build-arg APT_MIRROR=http://mirrors.aliyun.com/ubuntu --build-arg GIT_MIRROR=https://mirror.sjtu.edu.cn/git/lean4-packages --build-arg LEAN_DL=https://mirror.sjtu.edu.cn/elan/leanprover/lean4/releases/download" |
| 22 | fi |
| 23 | # (the classic builder: BuildKit ignores --cpuset-cpus; the host's network: through Docker's bridge downloads crawl) |
| 24 | DOCKER_BUILDKIT=0 docker build --network host $cpus $mirrors -f "$main/docker/lean.Dockerfile" -t "$tag" "$main" |
| 25 | docker image inspect --format "$tag {{.Id}} {{.Size}} bytes" "$tag" |