Lean4-Mathlib / README.md
phanerozoic's picture
Add dataset card
eb8bc8a verified
|
raw
history blame
2.1 kB
metadata
license: apache-2.0
task_categories:
  - text-generation
  - feature-extraction
language:
  - en
tags:
  - theorem-proving
  - formal-methods
  - lean4
  - mathlib
  - mathematics
size_categories:
  - 100K<n<1M

Mathlib4

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

Dataset Description

Schema

Column Type Description
fact string Full declaration body
type string theorem, lemma, def, class, structure, instance, inductive, abbrev, axiom
library string Top-level Mathlib module (Algebra, Analysis, Topology, etc.)
imports list Import statements from source file
filename string Source file path within Mathlib
symbolic_name string Declaration identifier
docstring string Documentation comment (30% coverage)

Statistics

By Type

Type Count Percentage
theorem 111,804 57%
lemma 36,970 19%
def 27,965 14%
instance 10,322 5%
abbrev 2,570 1%
class 1,710 1%
structure 1,387 1%
inductive 310 <1%

By Library (Top 10)

Library Count
Algebra 30,936
Analysis 20,343
Data 20,327
CategoryTheory 18,553
Topology 16,800
Order 13,686
RingTheory 12,566
LinearAlgebra 9,279
MeasureTheory 8,927
Combinatorics 4,949

Docstring Coverage

Type With Docstring
def 98%
class 98%
structure 93%
theorem 15%
lemma 14%

Use Cases

  • Retrieval / RAG for Lean 4 theorem proving
  • Mathematical content search and exploration
  • Training embeddings for formal mathematics
  • Documentation generation
  • Semantic search over mathematical definitions

Example Entry

Citation

If you use this dataset, please cite Mathlib: