phanerozoic commited on
Commit
7ec832c
·
verified ·
1 Parent(s): fd24ef5

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

Browse files
Files changed (2) hide show
  1. README.md +132 -62
  2. data/train-00000-of-00001.parquet +2 -2
README.md CHANGED
@@ -1,62 +1,132 @@
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
- - batteries
13
- - standard-library
14
- size_categories:
15
- - 1K<n<10K
16
- ---
17
-
18
- # Lean4-Batteries
19
-
20
- Structured dataset from Lean 4 Batteries - the community standard library extensions.
21
-
22
- ## Dataset Description
23
-
24
- - **Source:** [leanprover-community/batteries](https://github.com/leanprover-community/batteries)
25
- - **Entries:** 2,346
26
- - **Files processed:** 172
27
- - **License:** Apache 2.0
28
-
29
- ## Schema
30
-
31
- | Column | Type | Description |
32
- |--------|------|-------------|
33
- | fact | string | Declaration body |
34
- | type | string | theorem, def, class, structure, etc. |
35
- | library | string | Batteries module |
36
- | imports | list | Import statements |
37
- | filename | string | Source file path |
38
- | symbolic_name | string | Declaration identifier |
39
- | docstring | string | Documentation (48% coverage) |
40
-
41
- ## Statistics
42
-
43
- ### By Type
44
- | Type | Count |
45
- |------|-------|
46
- | theorem | 1,257 |
47
- | def | 951 |
48
- | abbrev | 48 |
49
- | structure | 38 |
50
- | inductive | 24 |
51
- | class | 22 |
52
- | instance | 4 |
53
- | opaque | 2 |
54
-
55
- ## About Batteries
56
-
57
- Batteries is the community-maintained extended standard library for Lean 4. It provides additional data structures, algorithms, and tactics beyond the core Init and Std libraries.
58
-
59
- ## Related Datasets
60
-
61
- - [Lean4-Stdlib](https://huggingface.co/datasets/phanerozoic/Lean4-Stdlib)
62
- - [Lean4-Mathlib](https://huggingface.co/datasets/phanerozoic/Lean4-Mathlib)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ - batteries
13
+ - standard-library
14
+ size_categories:
15
+ - 1K<n<10K
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: 3708}
37
+ config_name: default
38
+ configs:
39
+ - config_name: default
40
+ data_files:
41
+ - split: train
42
+ path: data/train-*
43
+ ---
44
+
45
+ # Lean4-Batteries
46
+
47
+ Structured dataset from Lean 4 Batteries - the community standard library extensions.
48
+
49
+ ## Source
50
+
51
+ - Repository: https://github.com/leanprover-community/batteries
52
+ - Commit: `41680f5d84023c7406c841d08ef83bf15a9782a6`
53
+ - Files: 187
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: 3,708
81
+ - With proof: 1,768 (47.7%)
82
+ - With docstring: 1,218 (32.8%)
83
+ - Libraries: 35
84
+
85
+ ### By type
86
+
87
+ | Type | Count |
88
+ |---|---|
89
+ | theorem | 2,142 |
90
+ | def | 1,145 |
91
+ | instance | 193 |
92
+ | abbrev | 62 |
93
+ | structure | 39 |
94
+ | elab | 31 |
95
+ | class | 28 |
96
+ | inductive | 24 |
97
+ | macro | 13 |
98
+ | macro_rules | 13 |
99
+ | elab_rules | 9 |
100
+ | example | 7 |
101
+ | opaque | 2 |
102
+
103
+ ## Example
104
+
105
+ ```coq
106
+ theorem Function.id_def : @id α = fun x => x := rfl
107
+
108
+ /-! ## decidable -/
109
+
110
+ protected alias ⟨Decidable.exists_not_of_not_forall, _⟩ := Decidable.not_forall
111
+
112
+ /-! ## classical logic -/
113
+ ```
114
+
115
+ - kind: theorem | symbolic_name: `Function.id_def` | Batteries/Logic.lean:17
116
+
117
+ ## Use
118
+
119
+ Statement and proof are available both joined (`fact`) and split (`statement`, `proof`) for
120
+ proof-term modeling, autoformalization, retrieval, and dependency analysis via `deps`.
121
+
122
+ ## Citation
123
+
124
+ ```bibtex
125
+ @misc{lean4_batteries_dataset,
126
+ title = {Lean4-Batteries},
127
+ author = {Norton, Charles},
128
+ year = {2026},
129
+ note = {Extracted from https://github.com/leanprover-community/batteries, commit 41680f5d8402},
130
+ url = {https://huggingface.co/datasets/phanerozoic/Lean4-Batteries}
131
+ }
132
+ ```
data/train-00000-of-00001.parquet CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:f3bee038915cdd252167b108191d8c54fb097090772f5cc6fd4a3b5e5bac23a1
3
- size 373693
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:e144685e861c2fa93e7a337f788f4fefb88f40942809e52330fef2407f2623f8
3
+ size 925388