# Mathlib Types: Lean 4 Declaration Names, Type Signatures and Docstrings from Mathlib (Mathlib Initiative)

## Facts

- Provider: Mathlib Initiative (extraction); leanprover-community Mathlib contributors
- License: Apache-2.0 (https://github.com/leanprover-community/mathlib4/blob/master/LICENSE)
- Size: 131 files
- Format: Parquet (in sampled files)
- Stored at: Hugging Face, https://huggingface.co/datasets/mathlib-initiative/mathlib-types
- Access: public, readable without an account
- Category: Mathematics
- Source: https://doi.org/10.1145/3372885.3373824
- Page: https://scigantic.com/archive/610c96ea-f38e-56f2-8466-8b5cfa601f0b
- Keywords: Mathematics, Parquet, Hugging Face

## About

The name, module, type signature and documentation string of every declaration in Mathlib, the Lean 4 library of formalized mathematics. That covers about 807,000 theorems, lemmas, definitions and structures, extracted with lean_scout from Mathlib commit fc4f59e5. Each row holds the fully qualified constant name, the Mathlib module that defines it, its pretty-printed type (for a theorem, the formal statement of what it proves), its docstring where one exists, and an allowCompletion flag. Researchers use it for formal-statement retrieval, autoformalization (translating informal mathematics into Lean), premise selection and building search engines over formal mathematics. It pairs with the Mathlib Constant Dependencies and Mathlib Tactics datasets from the same commit. The data is in Parquet shards with a manifest.json; read it with pyarrow, pandas or Hugging Face datasets. Mathlib is Apache-2.0 licensed by the leanprover-community. Cite the Mathlib paper (CPP 2020, doi 10.1145/3372885.3373824).

## Load the data

```python
from datasets import load_dataset
ds = load_dataset("mathlib-initiative/mathlib-types")
print(ds)
```

## Data structure

File types in sampled files: Parquet

Example file: `part-000.parquet`

## Open it

- In a hosted notebook with the data mounted: https://scigantic.com/archive/610c96ea-f38e-56f2-8466-8b5cfa601f0b
- Full record as JSON (schema card included): https://api.scigantic.com/api/archives/610c96ea-f38e-56f2-8466-8b5cfa601f0b
- Over MCP: `get_schema_card` with id `610c96ea-f38e-56f2-8466-8b5cfa601f0b` at https://api.scigantic.com/mcp

## Related topics

- [Parquet datasets](https://scigantic.com/topics/parquet)
- [Mathematics datasets](https://scigantic.com/topics/mathematics)
