Datasets:
|
Download README.md from CloK-Lab/MathlibGraph: direct link, hf CLI and curl.
- Browser
- Download file 2.58 kB
-
https://huggingface.co/datasets/CloK-Lab/MathlibGraph/resolve/01286a430b8c7e2ba6b773a04d6bd7cd98dba3fe/README.md
- Command line
-
hf download hf://datasets/CloK-Lab/MathlibGraph@01286a430b8c7e2ba6b773a04d6bd7cd98dba3fe/README.md
-
curl -L -o README.md https://huggingface.co/datasets/CloK-Lab/MathlibGraph/resolve/01286a430b8c7e2ba6b773a04d6bd7cd98dba3fe/README.md
2.58 kB
| license: apache-2.0 | |
| task_categories: | |
| - graph-ml | |
| language: | |
| - en | |
| tags: | |
| - mathematics | |
| - lean4 | |
| - mathlib | |
| - dependency-graph | |
| - formal-verification | |
| size_categories: | |
| - 100K<n<1M | |
| # MathFactor: Mathlib Dependency Graph Dataset | |
| Dependency graph of [Mathlib](https://github.com/leanprover-community/mathlib4) (v4.28.0-rc1), the largest formal mathematics library for Lean 4. | |
| ## Files | |
| | File | Rows | Description | | |
| |------|------|-------------| | |
| | `mathlib_nodes.csv` | 347,356 | Mathlib declarations (name, kind, module) | | |
| | `mathlib_edges.csv` | 10,417,589 | Mathlib dependencies (source, target, is_explicit) | | |
| | `nodes.csv` | 633,364 | Full environment (Lean + Std + Mathlib) | | |
| | `edges.csv` | 10,889,011 | Full environment edges | | |
| ## Statistics (Mathlib only) | |
| | Kind | Count | % | | |
| |------|-------|---| | |
| | theorem | 273,767 | 78.8% | | |
| | definition | 55,671 | 16.0% | | |
| | abbrev | 7,490 | 2.2% | | |
| | constructor | 5,436 | 1.6% | | |
| | inductive | 4,297 | 1.2% | | |
| | other | 695 | 0.2% | | |
| ## Quick Start | |
| ```python | |
| from huggingface_hub import hf_hub_download | |
| import pandas as pd | |
| nodes = pd.read_csv(hf_hub_download("Xinze-Li-Moqian/mathfactor", "mathlib_nodes.csv", repo_type="dataset")) | |
| edges = pd.read_csv(hf_hub_download("Xinze-Li-Moqian/mathfactor", "mathlib_edges.csv", repo_type="dataset")) | |
| print(f"Nodes: {len(nodes)}, Edges: {len(edges)}") | |
| # Output: Nodes: 347356, Edges: 10417589 | |
| ``` | |
| ## Extraction Pipeline | |
| - **Nodes**: [lean4export](https://github.com/leanprover/lean4export) (official leanprover tool) | |
| - **Edges**: [lean-training-data premises](https://github.com/kim-em/lean-training-data) (Kim Morrison, Mathlib maintainer) | |
| - **Filtering**: premises whitelist method — `lake exe premises Mathlib` outputs only Mathlib declarations, which we use to filter the full lean4export output | |
| ## Schema | |
| ### mathlib_nodes.csv | |
| | Column | Type | Description | | |
| |--------|------|-------------| | |
| | name | string | Declaration name (e.g., `CategoryTheory.Functor.comp_id`) | | |
| | kind | string | `theorem`, `definition`, `abbrev`, `inductive`, `constructor`, etc. | | |
| | module | string | Lean namespace (e.g., `CategoryTheory.Functor`) | | |
| ### mathlib_edges.csv | |
| | Column | Type | Description | | |
| |--------|------|-------------| | |
| | source | string | Dependent declaration | | |
| | target | string | Dependency | | |
| | is_explicit | bool | Appears in explicit arguments | | |
| | is_simplifier | bool | Used by simplifier | | |
| ## Citation | |
| Part of the [MathFactor](https://github.com/Xinze-Li-Moqian/MathFactor) project — network science analysis of mathematical knowledge. | |
| ## License | |
| Apache 2.0 | |