| ---
|
| license: apache-2.0
|
| task_categories:
|
| - text-generation
|
| - feature-extraction
|
| language:
|
| - en
|
| tags:
|
| - theorem-proving
|
| - formal-methods
|
| - lean
|
| - mathlib
|
| - mathematics
|
| size_categories:
|
| - 10K<n<100K
|
| dataset_info:
|
| features:
|
| - {name: statement, dtype: string}
|
| - {name: proof, dtype: string}
|
| - {name: type, dtype: string}
|
| - {name: symbolic_name, dtype: string}
|
| - {name: library, dtype: string}
|
| - {name: filename, dtype: string}
|
| - {name: imports, list: string}
|
| - {name: deps, list: string}
|
| - {name: docstring, dtype: string}
|
| - {name: source_url, dtype: string}
|
| - {name: commit, dtype: string}
|
| splits:
|
| - {name: train, num_examples: 124644}
|
| config_name: default
|
| configs:
|
| - config_name: default
|
| data_files:
|
| - split: train
|
| path: data/train-*
|
| ---
|
|
|
| # Lean3-Mathlib
|
|
|
| Declarations from mathlib3, the Lean 3 mathematical library (archived).
|
|
|
| ## Source
|
|
|
| - Repository: https://github.com/leanprover-community/mathlib
|
| - Commit: `65a1391a0106c9204fe45bc73a039f056558cb83`
|
| - Files: 3220
|
| - License: apache-2.0
|
|
|
| ## Schema
|
|
|
| | Column | Type | Description |
|
| |--------|------|-------------|
|
| | statement | string | Declaration signature/claim with the leading keyword removed (verbatim slice); the full declaration minus its proof |
|
| | proof | string | Verbatim proof/body, empty if the declaration has none |
|
| | type | string | Declaration keyword |
|
| | symbolic_name | string | Declaration identifier |
|
| | library | string | Sub-library |
|
| | filename | string | Repository-relative source path |
|
| | imports | list[string] | File-level `Require`/`Import` modules |
|
| | deps | list[string] | Intra-corpus identifiers referenced |
|
| | docstring | string | Preceding documentation comment, empty if absent |
|
| | source_url | string | Upstream repository |
|
| | commit | string | Upstream commit extracted |
|
|
|
| ## Statistics
|
|
|
| - Entries: 124,644
|
| - With proof: 124,216 (99.7%)
|
| - With docstring: 34,238 (27.5%)
|
| - Libraries: 417
|
|
|
| ### By type
|
|
|
| | Type | Count |
|
| |---|---|
|
| | lemma | 82,758 |
|
| | def | 19,312 |
|
| | theorem | 14,208 |
|
| | instance | 5,867 |
|
| | class | 1,010 |
|
| | structure | 731 |
|
| | abbreviation | 496 |
|
| | inductive | 249 |
|
| | definition | 10 |
|
| | class inductive | 3 |
|
|
|
| ## Example
|
|
|
| ```
|
| add_torsor (G : out_param Type*) (P : Type*) [out_param $ add_group G]
|
| extends add_action G P, has_vsub G P
|
| [nonempty : nonempty P]
|
| (vsub_vadd' : ∀ (p1 p2 : P), (p1 -ᵥ p2 : G) +ᵥ p2 = p1)
|
| (vadd_vsub' : ∀ (g : G) (p : P), g +ᵥ p -ᵥ p = g)
|
| ```
|
|
|
| - type: class | symbolic_name: `add_torsor` | src/algebra/add_torsor.lean
|
|
|
| ## Use
|
|
|
| Each declaration is split into a `statement` (signature/claim) and a `proof` (body) that are disjoint
|
| and together form the complete declaration, for proof modeling, autoformalization, retrieval, and
|
| dependency analysis via `deps`.
|
|
|
| ## Citation
|
|
|
| ```bibtex
|
| @misc{lean3_mathlib_dataset,
|
| title = {Lean3-Mathlib},
|
| author = {Norton, Charles},
|
| year = {2026},
|
| note = {Extracted from https://github.com/leanprover-community/mathlib, commit 65a1391a0106},
|
| url = {https://huggingface.co/datasets/phanerozoic/Lean3-Mathlib}
|
| }
|
| ```
|
| |