docs/building.md

This project (Stafford38) ยท 1029fdb382eee06e7b59bcf32801f40931e2079a

1 # Building and verification
2 
3 ## Pins
4 
5 - Lean: `leanprover/lean4:v4.35.0-rc3` (`lean-toolchain`).
6 - Mathlib: `c55e6e786f49471c72fbddbec5415808896aec1e`.
7 - AlgebraicAnalysis: `bbbbf3fc358ca8100b158cec4cf47f336ab70163`.
8 
9 The last two are set in `lakefile.toml` and resolved in
10 `lake-manifest.json`. Keep them unchanged unless the full verification is
11 rerun afterwards.
12 
13 ## Build
14 
15 ```sh
16 lake exe cache get
17 lake build
18 ```
19 
20 The default targets are `Stafford38`, `Solution` and `FixedSourceSolution`.
21 
22 ## Repository verifier
23 
24 ```sh
25 scripts/verify.sh
26 ```
27 
28 The verifier checks the repository layout and the comparator source policy,
29 runs the Python behaviour tests under `tests/`, builds every module under
30 `Stafford38/` together with all solution and challenge roots, and runs the
31 dependency guard (`scripts/dependency-guard/`) to confirm that the solution
32 roots use only permitted dependencies and axioms. Logs go to
33 `.lake/verification/`.
34 
35 ## Comparator replay
36 
37 Each `*Challenge.lean` file states a theorem with Mathlib-only definitions and
38 ends in an intentional `sorry`; the matching `*Solution.lean` proves it
39 without importing the challenge. The four `comparator*.json` files select the
40 pairs. After building:
41 
42 ```sh
43 scripts/bootstrap-palomar-tools.sh
44 scripts/verify-palomar.sh comparator.json
45 scripts/verify-palomar.sh comparator-fixed-source.json
46 scripts/verify-palomar.sh comparator-alternative.json
47 scripts/verify-palomar.sh comparator-alternative-fixed-source.json
48 ```
49