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-Mathlib

Structured dataset of mathematical formalizations from the Mathlib4 library for Lean 4.

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: 232,431
  • With proof: 228,818 (98.4%)
  • With docstring: 67,814 (29.2%)
  • Libraries: 1103

By type

Type Count
theorem 125,463
lemma 56,488
def 31,961
instance 10,971
abbrev 3,379
class 1,937
structure 1,580
inductive 326
elab 168
macro 147
class inductive 6
class abbrev 3
opaque 2

Example

infinite_of_charZero (R A : Type*) [CommRing R] [Ring A] [Algebra R A]
    [CharZero A] : { x : A | IsAlgebraic R x }.Infinite
by
  letI := MulActionWithZero.nontrivial R A
  exact infinite_of_injective_forall_mem Nat.cast_injective isAlgebraic_nat
  • type: theorem | symbolic_name: Algebraic.infinite_of_charZero | Mathlib/Algebra/AlgebraicCard.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_mathlib_dataset,
  title  = {Lean4-Mathlib},
  author = {Norton, Charles},
  year   = {2026},
  note   = {Extracted from https://github.com/leanprover-community/mathlib4, commit b9f14353520d},
  url    = {https://huggingface.co/datasets/phanerozoic/Lean4-Mathlib}
}
Downloads last month
54

Collection including phanerozoic/Lean4-Mathlib