Dataset Viewer
The dataset viewer is not available for this dataset.
Unexpected token '<', "<html> <h"... is not valid JSON

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

Lean4-Stdlib

Structured dataset of definitions and theorems from the Lean 4 standard library (Init + Std).

Source

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: 52,970
  • With proof: 51,596 (97.4%)
  • With docstring: 7,626 (14.4%)
  • Libraries: 165

By type

Type Count
theorem 42,996
def 7,688
abbrev 441
structure 426
opaque 383
instance 349
class 313
inductive 184
macro 172
axiom 15
class inductive 2
class abbrev 1

Example

apply_dite (f : α → β) (P : Prop) [Decidable P] (x : P → α) (y : ¬P → α) :
    f (dite P x y) = dite P (fun h => f (x h)) (fun h => f (y h))
by
  by_cases h : P <;> simp [h]
  • type: theorem | symbolic_name: apply_dite | src/Init/ByCases.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_stdlib_dataset,
  title  = {Lean4-Stdlib},
  author = {Norton, Charles},
  year   = {2026},
  note   = {Extracted from https://github.com/leanprover/lean4, commit d265d1ca745e},
  url    = {https://huggingface.co/datasets/phanerozoic/Lean4-Stdlib}
}
Downloads last month
30

Collection including phanerozoic/Lean4-Stdlib