Datasets:
Commit ·
3519bf9
0
Parent(s):
Duplicate from MathNetwork/MathlibGraph
Browse filesCo-authored-by: Xinze Li <Xinze-Li-Moqian@users.noreply.huggingface.co>
Files changed (22)
- .gitattributesAdded+70
- README.mdAdded+232
- edges.csvAdded+3
- experiments/holdout_decl_level.jsonAdded+113
- experiments/holdout_edge_level.jsonAdded+63
- experiments/premise_retrieval_hard_negatives.jsonAdded+38
- experiments/premise_retrieval_results.jsonAdded+86
- mathlib_edges.csvAdded+3
- mathlib_nodes.csvAdded+3
- mechanisms.ndjsonAdded+3
- nodes.csvAdded+3
- summary.mdAdded+46
- tactic_usage.ndjsonAdded+3
- v2/declaration/metrics.csvAdded+3
- v2/declaration/nodes.csvAdded+3
- v2/module/edges.csvAdded
- v2/module/metrics.csvAdded
- v2/module/nodes.csvAdded
- v2/namespace/edges.csvAdded+3
- v2/namespace/metrics.csvAdded
- v2/namespace/nodes.csvAdded
- v2/summary.jsonAdded+68
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970*.7z filter=lfs diff=lfs merge=lfs -text*.arrow filter=lfs diff=lfs merge=lfs -text*.bin filter=lfs diff=lfs merge=lfs -text*.bz2 filter=lfs diff=lfs merge=lfs -text*.ckpt filter=lfs diff=lfs merge=lfs -text*.ftz filter=lfs diff=lfs merge=lfs -text*.gz filter=lfs diff=lfs merge=lfs -text*.h5 filter=lfs diff=lfs merge=lfs -text*.joblib filter=lfs diff=lfs merge=lfs -text*.lfs.* filter=lfs diff=lfs merge=lfs -text*.lz4 filter=lfs diff=lfs merge=lfs -text*.mds filter=lfs diff=lfs merge=lfs -text*.mlmodel filter=lfs diff=lfs merge=lfs -text*.model filter=lfs diff=lfs merge=lfs -text*.msgpack filter=lfs diff=lfs merge=lfs -text*.npy filter=lfs diff=lfs merge=lfs -text*.npz filter=lfs diff=lfs merge=lfs -text*.onnx filter=lfs diff=lfs merge=lfs -text*.ot filter=lfs diff=lfs merge=lfs -text*.parquet filter=lfs diff=lfs merge=lfs -text*.pb filter=lfs diff=lfs merge=lfs -text*.pickle filter=lfs diff=lfs merge=lfs -text*.pkl filter=lfs diff=lfs merge=lfs -text*.pt filter=lfs diff=lfs merge=lfs -text*.pth filter=lfs diff=lfs merge=lfs -text*.rar filter=lfs diff=lfs merge=lfs -text*.safetensors filter=lfs diff=lfs merge=lfs -textsaved_model/**/* filter=lfs diff=lfs merge=lfs -text*.tar.* filter=lfs diff=lfs merge=lfs -text*.tar filter=lfs diff=lfs merge=lfs -text*.tflite filter=lfs diff=lfs merge=lfs -text*.tgz filter=lfs diff=lfs merge=lfs -text*.wasm filter=lfs diff=lfs merge=lfs -text*.xz filter=lfs diff=lfs merge=lfs -text*.zip filter=lfs diff=lfs merge=lfs -text*.zst filter=lfs diff=lfs merge=lfs -text*tfevents* filter=lfs diff=lfs merge=lfs -text# Audio files - uncompressed*.pcm filter=lfs diff=lfs merge=lfs -text*.sam filter=lfs diff=lfs merge=lfs -text*.raw filter=lfs diff=lfs merge=lfs -text# Audio files - compressed*.aac filter=lfs diff=lfs merge=lfs -text*.flac filter=lfs diff=lfs merge=lfs -text*.mp3 filter=lfs diff=lfs merge=lfs -text*.ogg filter=lfs diff=lfs merge=lfs -text*.wav filter=lfs diff=lfs merge=lfs -text# Image files - uncompressed*.bmp filter=lfs diff=lfs merge=lfs -text*.gif filter=lfs diff=lfs merge=lfs -text*.png filter=lfs diff=lfs merge=lfs -text*.tiff filter=lfs diff=lfs merge=lfs -text# Image files - compressed*.jpg filter=lfs diff=lfs merge=lfs -text*.jpeg filter=lfs diff=lfs merge=lfs -text*.webp filter=lfs diff=lfs merge=lfs -text# Video files - compressed*.mp4 filter=lfs diff=lfs merge=lfs -text*.webm filter=lfs diff=lfs merge=lfs -textnodes.csv filter=lfs diff=lfs merge=lfs -textedges.csv filter=lfs diff=lfs merge=lfs -textmathlib_nodes.csv filter=lfs diff=lfs merge=lfs -textmathlib_edges.csv filter=lfs diff=lfs merge=lfs -texttactic_usage.ndjson filter=lfs diff=lfs merge=lfs -textmechanisms.ndjson filter=lfs diff=lfs merge=lfs -textv2/mathlib_nodes_enriched.csv filter=lfs diff=lfs merge=lfs -textv2/mathlib_namespace_edges_k2.csv filter=lfs diff=lfs merge=lfs -textv2/declaration/nodes.csv filter=lfs diff=lfs merge=lfs -textv2/namespace/edges.csv filter=lfs diff=lfs merge=lfs -textv2/declaration/metrics.csv filter=lfs diff=lfs merge=lfs -text123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232---license: apache-2.0task_categories: - graph-mllanguage: - entags: - mathematics - lean4 - mathlib - dependency-graph - formal-verification - network-analysissize_categories: - 100K<n<1M---
# MathlibGraph: The Multinetwork of Mathlib
Dependency graph of [Mathlib](https://github.com/leanprover-community/mathlib4) (commit [`534cf0b`](https://github.com/leanprover-community/mathlib4/commit/534cf0b), 2 Feb 2026), the largest formal mathematics library for Lean 4 (`v4.28.0-rc1`).
Three dependency layers (declarations, modules, namespaces), each with nodes, edges, and precomputed network metrics.
## Quick Stats
| | Declarations | Modules | Namespaces (k=2) ||---|---|---|---|| Nodes | 308,129 | 7,564 | 10,097 || Edges | 8,436,366 | 20,881 | 332,081 (weighted) || DAG depth | 83 | 154 | 7 (after SCC condensation) || Louvain modularity | 0.478 | 0.610 | 0.270 || Synthesized edges | 74.2% | — | — || In cycles | 5,732 nodes | 0 (DAG) | 6,055 nodes (38 SCCs) |
## Files
### Raw Data (v1)
| File | Rows | Description ||------|------|-------------|| `mathlib_edges.csv` | 8,436,366 | Declaration dependency edges || `mathlib_nodes.csv` | 317,655 | Declarations before deduplication || `nodes.csv` / `edges.csv` | 633K / 10.9M | Full environment (Lean + Std + Mathlib) || `mechanisms.ndjson` | — | Lean language mechanism extractions || `tactic_usage.ndjson` | — | Per-declaration tactic usage profiles |
### Three-Layer Graphs (v2)
Each layer has `nodes.csv`, `edges.csv`, and `metrics.csv`:
| Folder | Nodes | Edges | Metrics | Description ||--------|-------|-------|---------|-------------|| `v2/declaration/` | 308,129 | (use root `mathlib_edges.csv`) | 308,129 x 11 | Theorems, definitions, and other named constants || `v2/module/` | 7,564 | 20,881 | 7,564 x 10 | Source files linked by `import` statements || `v2/namespace/` | 10,097 | 332,081 | 10,097 x 11 | Depth-2 dotted-name prefixes, weighted edges |
`v2/summary.json` contains headline statistics for all three levels.
## Quick Start
```pythonfrom datasets import load_dataset
# Declaration leveldecl = load_dataset("MathNetwork/MathlibGraph", data_files="v2/declaration/metrics.csv", split="train").to_pandas()edges = load_dataset("MathNetwork/MathlibGraph", data_files="mathlib_edges.csv", split="train").to_pandas()
# Module levelmod_nodes = load_dataset("MathNetwork/MathlibGraph", data_files="v2/module/nodes.csv", split="train").to_pandas()mod_edges = load_dataset("MathNetwork/MathlibGraph", data_files="v2/module/edges.csv", split="train").to_pandas()
# Namespace levelns_nodes = load_dataset("MathNetwork/MathlibGraph", data_files="v2/namespace/nodes.csv", split="train").to_pandas()ns_edges = load_dataset("MathNetwork/MathlibGraph", data_files="v2/namespace/edges.csv", split="train").to_pandas()```
## Schema
### v2/declaration/nodes.csv
Deduplicated from `mathlib_nodes.csv` (317,655 to 308,129 rows; 9,526 `@[to_additive]` mirrors removed).
| Column | Type | Description ||--------|------|-------------|| name | str | Fully qualified declaration name || kind | str | theorem, definition, abbrev, inductive, constructor, opaque, axiom, or quotient || module | str | Parent namespace (null for 30,944 Lean core declarations) |
### v2/declaration/metrics.csv
All columns from `nodes.csv` plus:
| Column | Type | Description ||--------|------|-------------|| namespace_depth2 | str | First 2 dot-separated components (e.g., `Mathlib.Algebra`) || namespace_depth3 | str | First 3 dot-separated components || in_degree | int | Declarations that depend on this one || out_degree | int | Declarations this one depends on || pagerank | float | PageRank (alpha=0.85) || betweenness | float | Betweenness centrality (k=500, seed=42) || community_id | int | Louvain community || dag_layer | int | Topological depth; -1 for 5,732 nodes in cycles || file_module | str | Source file module (from Lean environment, 278K coverage) || is_tactic_proof | bool | Whether the proof uses tactics (78,315 declarations) || tactic_count | int | Number of tactics used in the proof || top_tactic | str | Most frequently used tactic in this proof || is_instance | bool | Whether this is a typeclass instance (26,415 declarations) || instance_class | str | Which typeclass this instance implements || is_coercion | bool | Whether this is a coercion (241 declarations) || to_additive_pair | str | Name of the corresponding additive/multiplicative variant || def_height | float | Definitional height in the kernel (42,935 declarations) |
### v2/module/nodes.csv
| Column | Type | Description ||--------|------|-------------|| module | str | Dotted module name (e.g., `Mathlib.Algebra.Group.Defs`) || decl_count | int | Declarations defined in this source file |
### v2/module/edges.csv
| Column | Type | Description ||--------|------|-------------|| source | str | Importing module || target | str | Imported module || is_exported | bool | Whether this is a public import (20,699 of 20,881) |
### v2/module/metrics.csv
| Column | Type | Description ||--------|------|-------------|| module | str | Module name || decl_count | int | Declarations in this module (full decl_module mapping, 499K coverage) || in_degree | int | Modules that import this one || out_degree | int | Modules this one imports || pagerank | float | PageRank on module import graph || betweenness | float | Betweenness centrality (exact) || dag_layer | int | Topological depth in module DAG || community_id | int | Louvain community || cohesion | float | Fraction of declaration edges staying within module || import_utilization_median | float | Median fraction of imported declarations used |
### v2/namespace/nodes.csv
| Column | Type | Description ||--------|------|-------------|| namespace | str | Depth-2 namespace (e.g., `Mathlib.Algebra`) || decl_count | int | Declarations in this namespace || in_cycle | bool | True if this namespace is in a strongly connected component || scc_id | int | SCC identifier (-1 if not in a cycle) |
### v2/namespace/edges.csv
| Column | Type | Description ||--------|------|-------------|| source | str | Source namespace || target | str | Target namespace || weight | int | Number of declaration-level edges between these namespaces |
### v2/namespace/metrics.csv
| Column | Type | Description ||--------|------|-------------|| namespace | str | Depth-2 namespace || decl_count | int | Declarations in this namespace || in_degree | int | Unweighted in-degree || out_degree | int | Unweighted out-degree || edge_weight_sum | int | Total declaration edges involving this namespace || pagerank | float | Weighted PageRank (alpha=0.85) || betweenness | float | Weighted betweenness (k=300, seed=42) || community_id | int | Louvain community (weighted undirected) || cross_ns_ratio | float | Fraction of edges crossing namespace boundaries || in_cycle | bool | In a strongly connected component (6,055 of 10,097) || scc_id | int | SCC identifier (-1 if acyclic) |
## Methodology
- **Extraction**: lean4export (nodes) + lean-training-data (edges) + importGraph (module graph) + jixia (metadata)- **Deduplication**: by name, 317,655 to 308,129 rows (9,526 `@[to_additive]` mirrors)- **Self-loops**: 4,755 constructor self-references filtered- **PageRank**: alpha=0.85, max_iter=100, tol=1e-6- **Betweenness**: declaration k=500, namespace k=300, module exact; seed=42- **Communities**: Louvain, resolution=1.0, random_state=42, undirected projection- **DAG layers**: Kahn's algorithm; cycle nodes get layer=-1; namespace graph condensed via SCC- **Namespace cycles**: 6,055 of 10,097 namespaces in 38 SCCs (largest: 5,899 nodes)
## Hold-Out Experiments
We validate the premise retrieval results with two levels of hold-out experiments to assess information leakage. In the original experiment, all network features (degree, PageRank, betweenness, community, DAG layer) are precomputed on the full graph. Hold-out experiments recompute features on a reduced graph to test whether full-graph computation inflates AUC.
### Edge-level hold-out- Randomly remove 20% of edges, recompute all features on remaining 80% graph- Tests whether full-graph feature computation inflates AUC
### Declaration-level hold-out- Split theorems 80/20, remove ALL edges (incoming and outgoing) of test theorems from training graph- Test theorems have zero degree in training graph- Simulates the real scenario: predicting premises for a brand new theorem
### Results (Split 1, seed=42)
| Method | AUC (original) | AUC (edge hold-out) | AUC (decl hold-out) ||--------|---------------|---------------------|---------------------|| Random | 0.499 | 0.497 | 0.500 || Same module | 0.563 | 0.562 | 0.563 || Same namespace | 0.590 | 0.590 | 0.592 || Same community | 0.768 | 0.755 | 0.500 || Network features | 0.991 | 0.988 | 0.978 || All features | 0.994 | 0.992 | 0.984 |
The community feature drops to random (0.500) in declaration-level hold-out because test declarations become isolated nodes with unique community IDs. Despite this, the combined network feature model retains AUC=0.978, confirming that degree, PageRank, and DAG position carry genuine predictive signal independent of information leakage.
Full 5-split results with mean and std are in `experiments/holdout_decl_level.json` (updated incrementally).
### Experiment Files
| File | Description ||------|-------------|| `experiments/premise_retrieval_results.json` | Original experiment: 6 methods, 4 metrics, 95% CI || `experiments/premise_retrieval_hard_negatives.json` | Hard negatives (same-community) variant || `experiments/holdout_edge_level.json` | Edge-level hold-out (1 split) || `experiments/holdout_decl_level.json` | Declaration-level hold-out (5 splits, incremental) |
## License
Apache 2.0123version https://git-lfs.github.com/spec/v1oid sha256:78b20d6311388159bdab03ddfb68d5ef5687ced629ee04a99d9880bcd043a08fsize 753711915123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113{ "completed_splits": [ { "seed": 42, "results_uniform": { "Random": { "AUC": 0.5003, "R@10": 0.1333, "R@50": 0.676, "MRR": 0.524, "n_problems": 5000 }, "Same module": { "AUC": 0.563, "R@10": 0.1789, "R@50": 0.642, "MRR": 0.998, "n_problems": 5000 }, "Same namespace": { "AUC": 0.5922, "R@10": 0.2233, "R@50": 0.664, "MRR": 0.966, "n_problems": 5000 }, "Same community": { "AUC": 0.5, "R@10": 0.0683, "R@50": 0.618, "MRR": 1.0, "n_problems": 5000 }, "Network features": { "AUC": 0.9778, "R@10": 0.5124, "R@50": 0.937, "MRR": 0.997, "n_problems": 5000 }, "All features": { "AUC": 0.9844, "R@10": 0.5212, "R@50": 0.94, "MRR": 0.997, "n_problems": 5000 } }, "results_hard": { "Random": { "AUC": 0.5003, "R@10": 0.1333, "R@50": 0.676, "MRR": 0.524, "n_problems": 5000 }, "Same module": { "AUC": 0.563, "R@10": 0.1789, "R@50": 0.642, "MRR": 0.997, "n_problems": 5000 }, "Same namespace": { "AUC": 0.5922, "R@10": 0.2234, "R@50": 0.664, "MRR": 0.964, "n_problems": 5000 }, "Same community": { "AUC": 0.5, "R@10": 0.0683, "R@50": 0.618, "MRR": 1.0, "n_problems": 5000 }, "Network features": { "AUC": 0.9776, "R@10": 0.5097, "R@50": 0.937, "MRR": 0.997, "n_problems": 5000 }, "All features": { "AUC": 0.9842, "R@10": 0.5191, "R@50": 0.94, "MRR": 0.997, "n_problems": 5000 } }, "diagnostics": { "in_degree_pearson_r": 0.999851, "out_degree_pearson_r": 0.999315, "pagerank_pearson_r": 0.950683, "betweenness_pearson_r": 0.712134, "community_nmi": 0.7821, "dag_layer_mean_shift": 2.9912, "test_decl_mean_in_degree": 0.0, "test_decl_mean_out_degree": 0.0, "test_decl_mean_pagerank": 7.667e-07, "n_wcc": 48812, "largest_wcc_size": 259311, "g_train_edges": 6727267, "edges_removed_pct": 20.21 }, "n_train_decls": 194929, "n_test_decls": 48733, "elapsed_s": 2396 } ]}123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263{ "completed_splits": [ { "seed": 42, "results": { "Random": { "AUC": 0.497, "R@10": 0.179, "R@50": 0.897, "MRR": 0.25, "n_problems": 5000 }, "Same module": { "AUC": 0.562, "R@10": 0.398, "R@50": 0.973, "MRR": 0.994, "n_problems": 5000 }, "Same namespace": { "AUC": 0.59, "R@10": 0.431, "R@50": 0.974, "MRR": 0.93, "n_problems": 5000 }, "Same community": { "AUC": 0.755, "R@10": 0.441, "R@50": 0.98, "MRR": 0.786, "n_problems": 5000 }, "Network features": { "AUC": 0.988, "R@10": 0.919, "R@50": 0.999, "MRR": 0.976, "n_problems": 5000 }, "All features": { "AUC": 0.992, "R@10": 0.926, "R@50": 0.999, "MRR": 0.984, "n_problems": 5000 } }, "diagnostics": { "in_degree_pearson_r": 0.999991, "out_degree_pearson_r": 0.996016, "pagerank_pearson_r": 0.911671, "betweenness_pearson_r": 0.658761, "community_nmi": 0.6737, "dag_layer_mean_shift": 3.1637, "dag_layer_max_shift": 80, "n_wcc": 363, "largest_wcc_size": 307763 }, "elapsed_s": 2937 } ]}1234567891011121314151617181920212223242526272829303132333435363738{ "Random": { "AUC": 0.5015032262104209, "R@10": 0.1360585603981675, "R@50": 0.6769906958015243, "MRR": 0.5216367807667213 }, "Same module": { "AUC": 0.562350943150883, "R@10": 0.17716134828405006, "R@50": 0.6429486391917959, "MRR": 0.9893142857142857 }, "Same namespace": { "AUC": 0.5803446516951352, "R@10": 0.2057242294389468, "R@50": 0.6591106708054222, "MRR": 0.9167673885966564 }, "Same community": { "AUC": 0.3601798080569178, "R@10": 0.05207239139664216, "R@50": 0.5079945224060302, "MRR": 0.793327165399728 }, "Network features": { "AUC": 0.9838247131236855, "R@10": 0.5103782600858937, "R@50": 0.9414442050593969, "MRR": 0.9986583333333334 }, "All features": { "AUC": 0.9894400400671409, "R@10": 0.5203356738855442, "R@50": 0.9426993462065937, "MRR": 0.9986333333333334 }}1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586{ "Random": { "AUC": 0.4988464624381927, "R@10": 0.13489873938604055, "R@50": 0.675421720785031, "MRR": 0.5177648872389418, "AUC_ci_lo": 0.4976579056909061, "AUC_ci_hi": 0.5025447127337402, "R@10_ci_lo": 0.13314589782962657, "R@10_ci_hi": 0.13807478534717094, "R@50_ci_lo": 0.6708032287760948, "R@50_ci_hi": 0.6822757937354658, "MRR_ci_lo": 0.5097106183497658, "MRR_ci_hi": 0.5304948072004493 }, "Same module": { "AUC": 0.563252943150883, "R@10": 0.17701251024723705, "R@50": 0.6434465696480249, "MRR": 0.9972, "AUC_ci_lo": 0.5611102003189763, "AUC_ci_hi": 0.5651486253506915, "R@10_ci_lo": 0.17269307941264872, "R@10_ci_hi": 0.18132900160478696, "R@50_ci_lo": 0.6354730399715295, "R@50_ci_hi": 0.6551981898656606, "MRR_ci_lo": 0.9961949999999999, "MRR_ci_hi": 0.9981 }, "Same namespace": { "AUC": 0.5902006516951351, "R@10": 0.2200081147938892, "R@50": 0.6626223704593136, "MRR": 0.9695453174603176, "AUC_ci_lo": 0.5880529846813214, "AUC_ci_hi": 0.5924840785351329, "R@10_ci_lo": 0.21586994086758424, "R@10_ci_hi": 0.22475987434791297, "R@50_ci_lo": 0.6548427218687078, "R@50_ci_hi": 0.6734164434880273, "MRR_ci_lo": 0.9664740277777778, "MRR_ci_hi": 0.9724816488095238 }, "Same community": { "AUC": 0.7675738080569178, "R@10": 0.2066798209803219, "R@50": 0.8225669566396177, "MRR": 0.889924414802174, "AUC_ci_lo": 0.7636466473774499, "AUC_ci_hi": 0.7701280102171949, "R@10_ci_lo": 0.20206740759955272, "R@10_ci_hi": 0.2099666022599327, "R@50_ci_lo": 0.8168676201838171, "R@50_ci_hi": 0.8301017721564548, "MRR_ci_lo": 0.8825203088999172, "MRR_ci_hi": 0.8968358562953322 }, "Network features": { "AUC": 0.9910488074402863, "R@10": 0.5200779274690902, "R@50": 0.9440300907986493, "MRR": 0.9978666666666666, "AUC_ci_lo": 0.9906065336840136, "AUC_ci_hi": 0.9915709117833958, "R@10_ci_lo": 0.513202566369347, "R@10_ci_hi": 0.5287072912456959, "R@50_ci_lo": 0.9401626991702056, "R@50_ci_hi": 0.9492015962873687, "MRR_ci_lo": 0.9969158333333333, "MRR_ci_hi": 0.9986 }, "All features": { "AUC": 0.9935149509905005, "R@10": 0.5246824912435099, "R@50": 0.944575070939189, "MRR": 0.9984, "AUC_ci_lo": 0.9931381533391922, "AUC_ci_hi": 0.9938923361368286, "R@10_ci_lo": 0.51749162029253, "R@10_ci_hi": 0.5334405006567039, "R@50_ci_lo": 0.9407193927667646, "R@50_ci_hi": 0.9497068095655786, "MRR_ci_lo": 0.9975475, "MRR_ci_hi": 0.999 }}123version https://git-lfs.github.com/spec/v1oid sha256:5e1426b2304a97924cca1e48fa22d76620e1cb7bbb496a1bd9dd742cc6906922size 584463744123version https://git-lfs.github.com/spec/v1oid sha256:b222647e7f5871ae20603c2ef87ec0da58143f097e03babdd584c654061725cbsize 17813672123version https://git-lfs.github.com/spec/v1oid sha256:c8d0905876f58af256e2f56bc6ac3c8f90f6a6e5d4c0a4b7f921e3e113e123f9size 86007387123version https://git-lfs.github.com/spec/v1oid sha256:cf2578bb394a14efb77bb5ce31e3313e5f24498a86139aa35be1f2c8c5a685b2size 5112187212345678910111213141516171819202122232425262728293031323334353637383940414243444546# MathFactor Data Summary
**Validation**: WARNING - Some edges reference missing nodes - Missing sources: 15914 (e.g., ['Set.preimage_add_preimage_subset', 'Left.add_neg_of_neg_of_nonpos', 'Hindman.FS.head']) - Missing targets: 12885 (e.g., ['Set.preimage_add_preimage_subset', 'GroupSeminorm.instSupSet._proof_3._to_additive_1', 'dist_sub_eq_dist_add_right'])
## Nodes
**Total**: 633,364
| Kind | Count ||------|-------|| theorem | 441,230 || definition | 82,962 || abbrev | 79,627 || constructor | 9,070 || opaque | 7,356 || recursor | 6,614 || inductive | 6,494 || axiom | 7 || quotient | 4 |
## Edges
**Total**: 10,889,011
| Type | Count ||------|-------|| Explicit (*) | 3,248,395 || Simplifier (s) | 0 || Direct | 7,640,616 |
## Top Modules (by node count)
| Module | Count ||--------|-------|| | 31,302 || List | 5,233 || Set | 5,065 || Finset | 4,954 || Nat | 4,566 || MeasureTheory | 3,496 || CategoryTheory | 3,471 || Polynomial | 3,280 || Int | 2,929 || CategoryTheory.Limits | 2,757 |123version https://git-lfs.github.com/spec/v1oid sha256:3927807af5920b626b687565f415233219df017b5b1555a074a073809bff4f84size 45050618123version https://git-lfs.github.com/spec/v1oid sha256:0c88b5044db57d48ba150fbe0a3550d47684739ca9b97dbb141564c5ce7a5658size 57521366123version https://git-lfs.github.com/spec/v1oid sha256:c0d2ad9ce65b83b1b650455eebea408b9820e9eef2ac8524d2b70a496044247esize 37905777123version https://git-lfs.github.com/spec/v1oid sha256:83bfba3f35e645002b03877bd82cf0013b9ee79d858c9a7b6fbe6281981fbc92size 107998481234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768{ "snapshot": { "mathlib_commit": "534cf0b", "snapshot_date": "2026-02-02", "lean_version": "leanprover/lean4:v4.28.0-rc1" }, "declaration_graph": { "node_count": 308129, "edge_count_raw": 8436366, "edge_count_no_self_loops": 8431611, "self_loops": 4755, "explicit_edge_count": 2178534, "explicit_edge_ratio": 0.2582, "synthesized_edge_ratio": 0.7418, "dag_depth": 83, "dag_layers": 84, "nodes_in_cycles": 5732, "louvain_modularity": 0.4778, "louvain_num_communities": 89, "nmi_namespace_vs_community": 0.3458, "power_law_alpha_in": 1.781, "power_law_alpha_in_source": "paper appendix-decl.tex table, xmin=20", "power_law_alpha_out": 2.936, "power_law_alpha_out_source": "paper appendix-decl.tex table" }, "module_graph": { "node_count": 7564, "edge_count": 20881, "dag_depth": 154, "dag_layers": 155, "louvain_modularity": 0.6101, "louvain_num_communities": 15, "transitive_redundancy_ratio": 0.175, "transitive_redundancy_ratio_source": "paper contribution.tex", "median_import_utilization": 0.016, "median_import_utilization_source": "paper contribution.tex (per-edge median over all import edges)", "critical_path_parallelism_ratio": 22.4, "critical_path_parallelism_ratio_source": "paper appendix-module.tex" }, "namespace_graph_k2": { "node_count": 10097, "edge_count": 332081, "dag_depth": 7, "dag_layers": 8, "dag_note": "namespace graph has cycles; depth computed on condensed SCC graph", "louvain_modularity": 0.2703, "louvain_num_communities": 13, "nmi_namespace_vs_community": 0.2456, "cross_namespace_ratio": 0.8581, "cross_namespace_ratio_note": "fraction of declaration edges crossing depth-2 namespace boundaries" }, "edge_decompositions": { "proof_only_ratio": 0.439, "statement_only_ratio": 0.081, "mixed_ratio": 0.48, "source": "paper contribution.tex (requires Lean extraction not in current dataset)" }, "kind_distribution": { "theorem": 243725, "definition": 48664, "abbrev": 6667, "constructor": 4755, "inductive": 3813, "opaque": 499, "quotient": 3, "axiom": 3 }}.gitattributesAdded+70
README.mdAdded+232
edges.csvAdded+3
experiments/holdout_decl_level.jsonAdded+113
experiments/holdout_edge_level.jsonAdded+63
experiments/premise_retrieval_hard_negatives.jsonAdded+38
experiments/premise_retrieval_results.jsonAdded+86
mathlib_edges.csvAdded+3
mathlib_nodes.csvAdded+3
mechanisms.ndjsonAdded+3
nodes.csvAdded+3
summary.mdAdded+46
tactic_usage.ndjsonAdded+3
v2/declaration/metrics.csvAdded+3
v2/declaration/nodes.csvAdded+3
v2/module/edges.csvAdded
v2/module/metrics.csvAdded
v2/module/nodes.csvAdded
v2/namespace/edges.csvAdded+3
v2/namespace/metrics.csvAdded
v2/namespace/nodes.csvAdded
v2/summary.jsonAdded+68