metadata
license: apache-2.0
task_categories:
- text-generation
- feature-extraction
language:
- en
tags:
- theorem-proving
- formal-methods
- lean4
- batteries
- standard-library
size_categories:
- 1K<n<10K
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: 3061
config_name: default
configs:
- config_name: default
data_files:
- split: train
path: data/train-*
Lean4-Batteries
Structured dataset from Lean 4 Batteries - the community standard library extensions.
Source
- Repository: https://github.com/leanprover-community/batteries
- Commit:
41680f5d84023c7406c841d08ef83bf15a9782a6 - Files: 187
- 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: 3,061
- With proof: 2,965 (96.9%)
- With docstring: 1,199 (39.2%)
- Libraries: 35
By type
| Type | Count |
|---|---|
| theorem | 1,874 |
| def | 1,005 |
| abbrev | 48 |
| structure | 37 |
| elab | 30 |
| inductive | 24 |
| class | 22 |
| macro | 11 |
| instance | 9 |
| opaque | 1 |
Example
Function.id_def : @id α = fun x => x
rfl
/-! ## decidable -/
protected alias ⟨Decidable.exists_not_of_not_forall, _⟩ := Decidable.not_forall
- type: theorem | symbolic_name:
Function.id_def| Batteries/Logic.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
@misc{lean4_batteries_dataset,
title = {Lean4-Batteries},
author = {Norton, Charles},
year = {2026},
note = {Extracted from https://github.com/leanprover-community/batteries, commit 41680f5d8402},
url = {https://huggingface.co/datasets/phanerozoic/Lean4-Batteries}
}