File size: 3,491 Bytes
1ec5046
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41b3662
1ec5046
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41b3662
6d79f1a
 
 
1ec5046
 
 
 
 
 
 
 
 
 
 
 
 
 
41b3662
 
 
 
1ec5046
 
 
 
 
8e9bfa5
41b3662
8e9bfa5
41b3662
8e9bfa5
41b3662
 
 
8e9bfa5
41b3662
 
1ec5046
 
 
 
 
41b3662
6d79f1a
 
 
 
1ec5046
 
6d79f1a
1ec5046
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
---

license: apache-2.0
task_categories:
  - text-generation
  - feature-extraction
language:
  - en
tags:
  - theorem-proving
  - formal-methods
  - lean
  - mathlib
  - mathematics
size_categories:
  - 10K<n<100K
dataset_info:
  features:
  - {name: fact, dtype: string}
  - {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: line_start, dtype: int64}
  - {name: line_end, dtype: int64}
  - {name: has_proof, dtype: bool}
  - {name: source_url, dtype: string}
  - {name: commit, dtype: string}
  splits:
  - {name: train, num_examples: 133201}
  config_name: default
configs:
- config_name: default
  data_files:
  - split: train
    path: data/train-*
---


# Lean3-Mathlib

Declarations from mathlib3, the Lean 3 mathematical library (archived).

## Source

- Repository: https://github.com/leanprover-community/mathlib
- Commit: `65a1391a0106c9204fe45bc73a039f056558cb83`
- Files: 3220
- License: apache-2.0

## Schema

| Column | Type | Description |
|--------|------|-------------|
| fact | string | Verbatim declaration with the leading keyword removed: signature and body/proof joined |
| statement | string | Signature with the leading keyword removed (verbatim slice) |
| proof | string | Verbatim proof/body, empty if 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, null if absent |

| line_start | int | First source line |
| line_end | int | Last source line |

| has_proof | bool | Whether a proof block was captured |
| source_url | string | Upstream repository |

| commit | string | Upstream commit extracted |



## Statistics



- Entries: 133,201

- With proof: 132,770 (99.7%)

- With docstring: 35,100 (26.4%)

- Libraries: 417



### By type



| Type | Count |

|---|---|

| lemma | 83,206 |

| def | 19,387 |

| theorem | 14,273 |

| instance | 13,632 |

| class | 1,010 |

| structure | 732 |

| abbreviation | 496 |

| inductive | 252 |

| example | 199 |

| definition | 10 |

| class inductive | 3 |

| macro | 1 |



## Example



```coq

add_torsor (G : out_param Type*) (P : Type*) [out_param $ add_group G]

  extends add_action G P, has_vsub G P :=

[nonempty : nonempty P]

(vsub_vadd' : ∀ (p1 p2 : P), (p1 -ᵥ p2 : G) +ᵥ p2 = p1)
(vadd_vsub' : ∀ (g : G) (p : P), g +ᵥ p -ᵥ p = g)

```



- type: class | symbolic_name: `add_torsor` | src/algebra/add_torsor.lean:48



## Use



Statement and proof are available both joined (`fact`) and split (`statement`, `proof`) for

proof-term modeling, autoformalization, retrieval, and dependency analysis via `deps`.



## Citation



```bibtex

@misc{lean3_mathlib_dataset,

  title  = {Lean3-Mathlib},

  author = {Norton, Charles},

  year   = {2026},

  note   = {Extracted from https://github.com/leanprover-community/mathlib, commit 65a1391a0106},

  url    = {https://huggingface.co/datasets/phanerozoic/Lean3-Mathlib}

}

```