# The Goldbach maintainer's workspace: the image the `lean` check runs in and the maintainer's look runs commands in. # # Build (about an hour the first time; the Mathlib cache is ~5 GB): # docker build -f docker/lean-check.Dockerfile -t shoal-goldbach-lean:4.35-c55db645 docker/ # # It pins the Li–Liu development and prebuilds it, Fu's workspace for ¬R and GRH, and the kernels V-2 names (Lean # 4.35.0's toolchain ships leanchecker, lean4lean, nanoda_bin and con-leche). At check time checks/lean_verify.py # compiles the approved Challenge as root and the route's Solution as nobody against these builds, which is why every # file under /opt is world-readable, and judges the two with lake comparator. No network is used at check time. The # build downloads from the Ubuntu archive (or APT_MIRROR), github.com (elan, the git clones), releases.lean-lang.org # (the toolchain), cache.mathlib.org (twice ~5 GB) and PyPI (or PIP_INDEX_URL); not from raw.githubusercontent.com, # which the Beijing site cannot reach (12-01). FROM ubuntu:24.04 # On the Beijing site: --build-arg APT_MIRROR=http://mirrors.aliyun.com/ubuntu (http: ca-certificates is not installed # yet, and https fails its certificate check) --build-arg PIP_INDEX_URL=https://mirrors.aliyun.com/pypi/simple ARG APT_MIRROR= ARG PIP_INDEX_URL=https://pypi.org/simple ENV DEBIAN_FRONTEND=noninteractive RUN if [ -n "$APT_MIRROR" ]; then sed -i "s#http://archive.ubuntu.com/ubuntu#$APT_MIRROR#; s#http://security.ubuntu.com/ubuntu#$APT_MIRROR#" /etc/apt/sources.list.d/ubuntu.sources; fi \ && apt-get update && apt-get install -y --no-install-recommends \ ca-certificates curl git python3 python3-venv build-essential zstd ripgrep bubblewrap \ && rm -rf /var/lib/apt/lists/* ENV ELAN_HOME=/opt/elan ENV PATH=/opt/elan/bin:${PATH} RUN curl -sSfL https://github.com/leanprover/elan/releases/download/v4.1.2/elan-x86_64-unknown-linux-gnu.tar.gz | tar -xz -C /tmp \ && /tmp/elan-init -y --no-modify-path --default-toolchain none && rm /tmp/elan-init RUN elan toolchain install leanprover/lean4:v4.35.0 \ && elan default leanprover/lean4:v4.35.0 WORKDIR /opt RUN git clone https://github.com/subfish-zhou/conditional-goldbach-lean.git goldbach \ && git -C goldbach checkout c55db645f3b4aed00374fe4aa1fcee2428c88c4b WORKDIR /opt/goldbach/formalization # (chmod in the same layer: Mathlib's cache unpacks its files 0600, which nobody cannot read; cache get again: a few of # its 9,031 downloads fail now and then, and each try fetches only what is still missing) RUN (lake exe cache get || lake exe cache get || lake exe cache get) \ && test "$(git -C .lake/packages/mathlib rev-parse --short=8 HEAD)" = 56a00585 \ && lake build && chmod -R a+rX /opt/goldbach # Fu's workspace pins both the conditional theorem and grh-compact. The not-r and grh-bridge targets are checked on its # LEAN_PATH, so its copy of Zhou's development needs PrimePairs too (grh-bridge's Challenge imports it). # UnconditionalAudit itself does not build: GRH's Lib and PrimeNumberTheoremAnd both declare `nabla`; Fu's replay joins # their exports instead (verification/join-grh.py). # (retried: from Beijing a clone from github.com broke off once in TLS, 12-01) RUN for i in 1 2 3 4 5; do git clone https://github.com/RaymondVoldemortFu/li-liu-spectral-hypotheses-lean /opt/fu && break; \ rm -rf /opt/fu; sleep 10; done \ && git -C /opt/fu checkout 56090686f4dcc16147ea74548d52184b2cfa89cb WORKDIR /opt/fu/WithGRH435 RUN (lake exe cache get || lake exe cache get || lake exe cache get) \ && lake build +Main +OriginalStatements +SingleScaleCriterion +ConditionalGoldbach.Proofs.PrimePairs \ && chmod -R a+rX /opt/fu # The maintainer's numerics (C-3..C-5 interval certificates, reruns of authors' scripts), in a venv of its own so the # system python3 the checks call stays as it is: python3-sci has them. # (a wrapper, not a link: Python started through a link to a venv's python does not find the venv) RUN python3 -m venv /opt/py && /opt/py/bin/pip install --no-cache-dir python-flint mpmath sympy numpy scipy \ && printf '#!/bin/sh\nexec /opt/py/bin/python3 "$@"\n' > /usr/local/bin/python3-sci && chmod 755 /usr/local/bin/python3-sci \ && python3-sci -c "import flint, mpmath, sympy, numpy, scipy" # numpy's and scipy's OpenBLAS each start a thread per host CPU: on a 128-core host that is past a look's 128 processes, # and `import scipy.linalg` dies (SIGSEGV, reproduced on a2 with --pids-limit below its 63 threads) ENV OPENBLAS_NUM_THREADS=4 OMP_NUM_THREADS=4 ENV GOLDBACH_LEAN_PROJECT=/opt/goldbach/formalization WORKDIR /opt/goldbach/formalization CMD ["/bin/bash"]