phanerozoic commited on
Commit
fc5b022
·
verified ·
1 Parent(s): 5a04812

Re-extract: full statement+proof, normalized schema, provenance

Browse files
Files changed (2) hide show
  1. README.md +130 -121
  2. 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
- dtype: string
20
- - name: type
21
- dtype: string
22
- - name: library
23
- dtype: string
24
- - name: imports
25
- list: string
26
- - name: filename
27
- dtype: string
28
- - name: symbolic_name
29
- dtype: string
30
- - name: docstring
31
- dtype: string
32
- splits:
33
- - name: train
34
- num_bytes: 110117432
35
- num_examples: 193047
36
- download_size: 26646919
37
- dataset_size: 110117432
38
- configs:
39
- - config_name: default
40
- data_files:
41
- - split: train
42
- path: data/train-*
43
- ---
44
-
45
- # Mathlib4
46
-
47
- Structured dataset of mathematical formalizations from the Mathlib4 library for Lean 4.
48
-
49
- ## Dataset Description
50
-
51
- - **Source:** [leanprover-community/mathlib4](https://github.com/leanprover-community/mathlib4)
52
- - **Entries:** 193,047
53
- - **Files processed:** 6,943
54
- - **License:** Apache 2.0
55
-
56
- ## Schema
57
-
58
- | Column | Type | Description |
59
- |--------|------|-------------|
60
- | fact | string | Full declaration body |
61
- | type | string | theorem, lemma, def, class, structure, instance, inductive, abbrev, axiom |
62
- | library | string | Top-level Mathlib module (Algebra, Analysis, Topology, etc.) |
63
- | imports | list | Import statements from source file |
64
- | filename | string | Source file path within Mathlib |
65
- | symbolic_name | string | Declaration identifier |
66
- | docstring | string | Documentation comment (30% coverage) |
67
-
68
- ## Statistics
69
-
70
- ### By Type
71
- | Type | Count | Percentage |
72
- |------|-------|------------|
73
- | theorem | 111,804 | 57% |
74
- | lemma | 36,970 | 19% |
75
- | def | 27,965 | 14% |
76
- | instance | 10,322 | 5% |
77
- | abbrev | 2,570 | 1% |
78
- | class | 1,710 | 1% |
79
- | structure | 1,387 | 1% |
80
- | inductive | 310 | <1% |
81
-
82
- ### By Library (Top 10)
83
- | Library | Count |
84
- |---------|-------|
85
- | Algebra | 30,936 |
86
- | Analysis | 20,343 |
87
- | Data | 20,327 |
88
- | CategoryTheory | 18,553 |
89
- | Topology | 16,800 |
90
- | Order | 13,686 |
91
- | RingTheory | 12,566 |
92
- | LinearAlgebra | 9,279 |
93
- | MeasureTheory | 8,927 |
94
- | Combinatorics | 4,949 |
95
-
96
- ### Docstring Coverage
97
- | Type | With Docstring |
98
- |------|----------------|
99
- | def | 98% |
100
- | class | 98% |
101
- | structure | 93% |
102
- | theorem | 15% |
103
- | lemma | 14% |
104
-
105
- ## Use Cases
106
-
107
- - Retrieval / RAG for Lean 4 theorem proving
108
- - Mathematical content search and exploration
109
- - Training embeddings for formal mathematics
110
- - Documentation generation
111
- - Semantic search over mathematical definitions
112
-
113
- ## Example Entry
114
-
115
-
116
-
117
- ## Citation
118
-
119
- If you use this dataset, please cite Mathlib:
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:d482205b40ad06a649ddba5ea2c3044be8ba60c78c2bedd2905b7ab715974d52
3
- size 26646919
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f2f179477403a76f334b03ed8a5b815a3abddffeb1b566a0006a923a5a0904f2
3
+ size 72056258