# Reproducibility

## Prerequisites

- the Lean toolchain from `lean-toolchain`;
- Git and Lake;
- `lean-serial` for serialized Lean execution;
- Python 3 for payload materialization and the LP verifier;
- NumPy for the chunked adaptive-potential verifier; and
- a C++20 compiler with Boost.Multiprecision headers.

## Clean Checkout

From the complete Proof Atlas source archive or an optional source mirror:

```bash
lake exe cache get
make build
make challenge solution axiom-audit audit
make verify-python verify-cpp
```

Do not run `lake update`: the committed `lake-manifest.json` is part of the
release identity.

## Certificate Representation

Lean embeds 20 tracked lowercase-hexadecimal chunks:

- 16 chunks encode `516,560,652` bytes of level-18 LP weights;
- 4 chunks encode `129,140,163` bytes of adaptive potential values.

Each hexadecimal chunk is at most 64 MiB. The aggregate binary hashes are recorded in the
two manifests. `scripts/materialize_payloads.py` decodes the chunks
incrementally, checks the expected byte count and SHA-256, and writes ignored
binary files for the external verifiers.

## Expected Resource Profile

The retained preparation runs used roughly:

| Check | Wall time | Peak RSS |
| --- | ---: | ---: |
| level-18 LP native replay | 18.5 min | about 10.6 GiB |
| retained LP module build | 19.5 min | about 10.6 GiB |
| adaptive-potential native replay | 14.6 min | about 9.3 GiB |
| retained adaptive closure | 14.6 min | about 9.3 GiB |

Run Lean builds serially. A cold checkout may also spend time restoring the
pinned mathlib cache.

## Regeneration And Verification

The frozen payloads are the release evidence. Deterministic generators and
independent verifiers are included under `scripts/`. Regeneration is separate
from verification: regenerated bytes must match the frozen SHA-256 values.

The Python and C++ LP verifiers independently check all `129,140,163` rows.
The Python and C++ adaptive-potential verifiers independently check all
`215,233,605` inequalities; the C++ verifier also mutates one payload entry
and confirms rejection.

## Release Identity

`SHA256SUMS.txt` binds every other tracked release file (the checksum list
cannot include its own digest). `VERSION.txt` records the toolchain, source
proof commit, theorem module, and certificate parameters. The immutable source
URL includes the final Git commit.
