# Reproducibility package This directory reproduces the empirical claims in Sections 3 and 4 of the paper. It is intentionally separate from `../paper`: the paper is a readable article, while this directory fixes executable objects, parameters and result artifacts. ## Frozen corpus | component | value | |---|---| | Mathlib release | `v4.33.0` | | Mathlib commit | `db584cd6d46c92f209a44c0f1c829460d327499d` | | Lean toolchain | `leanprover/lean4:v4.33.0` | | Raw schema | `mesomath-corpus-v2` | | set.mm commit | `057f4c461055d0b1ed78d9d333aa3de34d9771fa` | The tag is descriptive; the full commit is authoritative. ## Paper claims and experiment IDs | ID | Paper claim | Inputs | Result artifact | |---|---|---|---| | `S3.1-depth-growth` | theorem graph is deep and sparse | primary theorem view | `results/S3.1-depth-growth.json` | | `S3.2-namespace-depth` | namespace depths differ by over an order of magnitude | primary theorem view | `results/S3.2-namespace-depth.json` | | `S3.3-compression-reuse` | proof-term/statement ratio is associated with reuse | primary theorem view | `results/S3.3-compression-reuse.json` | | `S3.4-projection-geometry` | measurements depend on projection, but detected geometry lies within degree-preserving nulls | primary theorem hypergraph | `results/S3.4-projection-geometry.json` | | `S3.4-metamath` | depth growth is similar across libraries but compression--reuse is not | Mathlib primary view and pinned `set.mm` | `results/S3.4-metamath.json` | | `S4.1-navigation` | structure ranks a reviewed target above random | v4.33 declaration view and reviewed labels | `results/S4.1-navigation.json` | `claims.json` is the machine-readable version of this table. A result is not ready to enter the paper until it records the corpus manifest hash, analysis configuration and random seed where relevant. Sections 3 and 4 have been rerun on v4.33.0. Section 4's exact historical inputs remain as a regression fixture, while the paper result uses the reviewed current statements and a graph built entirely from the pinned v4.33.0 export. ## Layout ```text experiments/ claims.json claim-to-artifact registry spec/ exact mathematical and computational objects LEGACY_AUDIT.md claim-by-claim audit of the old implementation legacy/ small immutable regression fixtures from old runs lean/ native Mathlib environment extractor analysis/ statistical analysis and figure generation labels/ reviewed external labels (for Section 4) data/raw/ Lean exports; generated, not committed data/derived/ declared graph views; generated, not committed results/ reviewed machine-readable result manifests ``` ## Reproduction stages 1. Build and test the native extractor: ```sh cd lean lake update lake exe cache get lake build lake exe meso-extractor-tests ``` 2. Export the Mathlib corpus: ```sh lake exe meso-extract --out ../data/raw/mathlib-v4.33.0 ``` A fast format smoke test may import one module explicitly; this is never a substitute for the full command above: ```sh lake exe meso-extract \ --out /tmp/mesomath-smoke \ --import-module Mathlib.Data.Nat.ModEq \ --module-prefix Mathlib.Data.Nat.ModEq \ --limit 25 ``` 3. Materialize the paper's graph views and run analyses: ```sh cd ../analysis uv run pytest uv run mesomath-analysis views \ ../data/raw/mathlib-v4.33.0 ../data/derived/mathlib-v4.33.0 uv run mesomath-analysis run-s3 \ ../data/derived/mathlib-v4.33.0/primary-theorem-hypergraph.json \ ../results uv run mesomath-analysis run-geometry \ ../data/derived/mathlib-v4.33.0/primary-theorem-hypergraph.json \ ../results/S3.4-projection-geometry.json ``` The `views` command writes both the primary auto/private-filtered theorem hypergraph and an internal-name-only sensitivity view matching the legacy filter. Section 3 commands use the primary file unless explicitly pointed at the sensitivity file. 4. Clone the exact Metamath Proof Explorer snapshot and run the independent cross-library adapter: ```sh git clone https://github.com/metamath/set.mm ../data/raw/set.mm git -C ../data/raw/set.mm checkout 057f4c461055d0b1ed78d9d333aa3de34d9771fa uv run mesomath-analysis run-metamath \ ../data/raw/set.mm ../results/S3.4-metamath.json \ --revision 057f4c461055d0b1ed78d9d333aa3de34d9771fa \ --mathlib-depth-result ../results/S3.1-depth-growth.json \ --mathlib-compression-result ../results/S3.3-compression-reuse.json ``` The parser's theorem count and selected reuse/proof-size values were cross-checked against the official C verifier; the exact audit is recorded in `verification/metamath-official-verifier.md`. 5. Run the reviewed v4.33 declaration-graph experiment: ```sh uv run mesomath-analysis run-navigation \ ../data/raw/mathlib-v4.33.0 \ ../labels/ahlfors_positive_declarations_v4.33-review.csv \ ../results/S4.1-navigation.json ``` A complete second run produced a byte-identical result file (SHA-256 `76c7510f933daa39b0ae2ba42bd8e1d1728c481948bf03811a4e40aed4a2e9f3`). The full-corpus commands are deliberately separate from unit tests: importing and traversing all of Mathlib is an experiment run, not a build step.