Re-extract: full statement+proof, normalized schema, provenance
Browse files- README.md +130 -121
- data/train-00000-of-00001.parquet +2 -2
README.md
CHANGED
|
@@ -1,121 +1,130 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
task_categories:
|
| 4 |
-
- text-generation
|
| 5 |
-
- feature-extraction
|
| 6 |
-
language:
|
| 7 |
-
- en
|
| 8 |
-
tags:
|
| 9 |
-
- theorem-proving
|
| 10 |
-
- formal-methods
|
| 11 |
-
- lean4
|
| 12 |
-
- mathlib
|
| 13 |
-
- mathematics
|
| 14 |
-
size_categories:
|
| 15 |
-
- 100K<n<1M
|
| 16 |
-
dataset_info:
|
| 17 |
-
features:
|
| 18 |
-
- name: fact
|
| 19 |
-
|
| 20 |
-
- name:
|
| 21 |
-
|
| 22 |
-
- name:
|
| 23 |
-
|
| 24 |
-
- name:
|
| 25 |
-
|
| 26 |
-
- name:
|
| 27 |
-
|
| 28 |
-
- name:
|
| 29 |
-
|
| 30 |
-
- name:
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
- name:
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
configs:
|
| 39 |
-
- config_name: default
|
| 40 |
-
data_files:
|
| 41 |
-
- split: train
|
| 42 |
-
path: data/train-*
|
| 43 |
-
---
|
| 44 |
-
|
| 45 |
-
#
|
| 46 |
-
|
| 47 |
-
Structured dataset of mathematical formalizations from the Mathlib4 library for Lean 4.
|
| 48 |
-
|
| 49 |
-
##
|
| 50 |
-
|
| 51 |
-
-
|
| 52 |
-
-
|
| 53 |
-
-
|
| 54 |
-
-
|
| 55 |
-
|
| 56 |
-
## Schema
|
| 57 |
-
|
| 58 |
-
| Column | Type | Description |
|
| 59 |
-
|--------|------|-------------|
|
| 60 |
-
| fact | string |
|
| 61 |
-
|
|
| 62 |
-
|
|
| 63 |
-
|
|
| 64 |
-
|
|
| 65 |
-
| symbolic_name | string | Declaration identifier |
|
| 66 |
-
|
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
|
| 72 |
-
|
|
| 73 |
-
|
|
| 74 |
-
|
|
| 75 |
-
|
|
| 76 |
-
|
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
|
| 88 |
-
|
|
| 89 |
-
|
|
| 90 |
-
|
|
| 91 |
-
|
|
| 92 |
-
|
|
| 93 |
-
|
|
| 94 |
-
|
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
|
| 98 |
-
|
|
| 99 |
-
|
|
| 100 |
-
|
|
| 101 |
-
|
|
| 102 |
-
|
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
task_categories:
|
| 4 |
+
- text-generation
|
| 5 |
+
- feature-extraction
|
| 6 |
+
language:
|
| 7 |
+
- en
|
| 8 |
+
tags:
|
| 9 |
+
- theorem-proving
|
| 10 |
+
- formal-methods
|
| 11 |
+
- lean4
|
| 12 |
+
- mathlib
|
| 13 |
+
- mathematics
|
| 14 |
+
size_categories:
|
| 15 |
+
- 100K<n<1M
|
| 16 |
+
dataset_info:
|
| 17 |
+
features:
|
| 18 |
+
- {name: fact, dtype: string}
|
| 19 |
+
- {name: statement, dtype: string}
|
| 20 |
+
- {name: proof, dtype: string}
|
| 21 |
+
- {name: type, dtype: string}
|
| 22 |
+
- {name: kind, dtype: string}
|
| 23 |
+
- {name: symbolic_name, dtype: string}
|
| 24 |
+
- {name: library, dtype: string}
|
| 25 |
+
- {name: filename, dtype: string}
|
| 26 |
+
- {name: imports, list: string}
|
| 27 |
+
- {name: deps, list: string}
|
| 28 |
+
- {name: docstring, dtype: string}
|
| 29 |
+
- {name: line_start, dtype: int64}
|
| 30 |
+
- {name: line_end, dtype: int64}
|
| 31 |
+
- {name: has_proof, dtype: bool}
|
| 32 |
+
- {name: source_url, dtype: string}
|
| 33 |
+
- {name: commit, dtype: string}
|
| 34 |
+
- {name: content_level, dtype: string}
|
| 35 |
+
splits:
|
| 36 |
+
- {name: train, num_examples: 322745}
|
| 37 |
+
config_name: default
|
| 38 |
+
configs:
|
| 39 |
+
- config_name: default
|
| 40 |
+
data_files:
|
| 41 |
+
- split: train
|
| 42 |
+
path: data/train-*
|
| 43 |
+
---
|
| 44 |
+
|
| 45 |
+
# Lean4-Mathlib
|
| 46 |
+
|
| 47 |
+
Structured dataset of mathematical formalizations from the Mathlib4 library for Lean 4.
|
| 48 |
+
|
| 49 |
+
## Source
|
| 50 |
+
|
| 51 |
+
- Repository: https://github.com/leanprover-community/mathlib4
|
| 52 |
+
- Commit: `b9f14353520df73472ae3825fb53f86559a01319`
|
| 53 |
+
- Files: 8170
|
| 54 |
+
- License: apache-2.0
|
| 55 |
+
|
| 56 |
+
## Schema
|
| 57 |
+
|
| 58 |
+
| Column | Type | Description |
|
| 59 |
+
|--------|------|-------------|
|
| 60 |
+
| fact | string | Verbatim declaration: statement followed by proof where present |
|
| 61 |
+
| statement | string | Verbatim statement (keyword through the closing period) |
|
| 62 |
+
| proof | string | Verbatim proof block (`Proof. ... Qed.`/`Defined.`), empty if none |
|
| 63 |
+
| type | string | Raw declaration keyword |
|
| 64 |
+
| kind | string | Normalized kind |
|
| 65 |
+
| symbolic_name | string | Declaration identifier |
|
| 66 |
+
| library | string | Sub-library |
|
| 67 |
+
| filename | string | Repository-relative source path |
|
| 68 |
+
| imports | list[string] | File-level `Require`/`Import` modules |
|
| 69 |
+
| deps | list[string] | Intra-corpus identifiers referenced |
|
| 70 |
+
| docstring | string | Preceding documentation comment, null if absent |
|
| 71 |
+
| line_start | int | First source line |
|
| 72 |
+
| line_end | int | Last source line |
|
| 73 |
+
| has_proof | bool | Whether a proof block was captured |
|
| 74 |
+
| source_url | string | Upstream repository |
|
| 75 |
+
| commit | string | Upstream commit extracted |
|
| 76 |
+
| content_level | string | `statement+proof` |
|
| 77 |
+
|
| 78 |
+
## Statistics
|
| 79 |
+
|
| 80 |
+
- Entries: 322,745
|
| 81 |
+
- With proof: 182,164 (56.4%)
|
| 82 |
+
- With docstring: 69,271 (21.5%)
|
| 83 |
+
- Libraries: 1106
|
| 84 |
+
|
| 85 |
+
### By type
|
| 86 |
+
|
| 87 |
+
| Type | Count |
|
| 88 |
+
|---|---|
|
| 89 |
+
| theorem | 169,373 |
|
| 90 |
+
| lemma | 71,480 |
|
| 91 |
+
| def | 43,147 |
|
| 92 |
+
| instance | 29,137 |
|
| 93 |
+
| abbrev | 3,785 |
|
| 94 |
+
| class | 2,373 |
|
| 95 |
+
| structure | 2,022 |
|
| 96 |
+
| example | 532 |
|
| 97 |
+
| inductive | 342 |
|
| 98 |
+
| elab | 202 |
|
| 99 |
+
| macro | 186 |
|
| 100 |
+
| elab_rules | 83 |
|
| 101 |
+
| macro_rules | 80 |
|
| 102 |
+
| opaque | 3 |
|
| 103 |
+
|
| 104 |
+
## Example
|
| 105 |
+
|
| 106 |
+
```coq
|
| 107 |
+
theorem infinite_of_charZero (R A : Type*) [CommRing R] [Ring A] [Algebra R A]
|
| 108 |
+
[CharZero A] : { x : A | IsAlgebraic R x }.Infinite := by
|
| 109 |
+
letI := MulActionWithZero.nontrivial R A
|
| 110 |
+
exact infinite_of_injective_forall_mem Nat.cast_injective isAlgebraic_nat
|
| 111 |
+
```
|
| 112 |
+
|
| 113 |
+
- kind: theorem | symbolic_name: `infinite_of_charZero` | Mathlib/Algebra/AlgebraicCard.lean:32
|
| 114 |
+
|
| 115 |
+
## Use
|
| 116 |
+
|
| 117 |
+
Statement and proof are available both joined (`fact`) and split (`statement`, `proof`) for
|
| 118 |
+
proof-term modeling, autoformalization, retrieval, and dependency analysis via `deps`.
|
| 119 |
+
|
| 120 |
+
## Citation
|
| 121 |
+
|
| 122 |
+
```bibtex
|
| 123 |
+
@misc{lean4_mathlib_dataset,
|
| 124 |
+
title = {Lean4-Mathlib},
|
| 125 |
+
author = {Norton, Charles},
|
| 126 |
+
year = {2026},
|
| 127 |
+
note = {Extracted from https://github.com/leanprover-community/mathlib4, commit b9f14353520d},
|
| 128 |
+
url = {https://huggingface.co/datasets/phanerozoic/Lean4-Mathlib}
|
| 129 |
+
}
|
| 130 |
+
```
|
data/train-00000-of-00001.parquet
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f2f179477403a76f334b03ed8a5b815a3abddffeb1b566a0006a923a5a0904f2
|
| 3 |
+
size 72056258
|