Β The Lean Language Reference
This is the Lean Language Reference, an in-progress reference work on Lean. It is intended to be a comprehensive, precise description of Lean: a reference work in which Lean users can look up detailed information, rather than a tutorial intended for new users. For other documentation, please refer to the Lean documentation site.
This reference manual is not yet complete, but there's enough information to provide value to users. The top priority is to add the missing information as quickly as possible while staying up to date with Lean development. As the rest of the text is written, regular snapshots will be released, tracking upstream changes. This snapshot covers Lean version 4.15.0-rc1.
Our prioritization of content is based on our best understanding of our users' needs. Please use the issue tracker to help us better understand what you need to know. In particular, please create or upvote issues for topics that are important to you. Your feedback is much appreciated! Once sufficient content is available, we will begin saving snapshots for each release of Lean and making them conveniently available.
API reference documentation is included from the Lean standard library source code. Due to technical limitations at the moment, the Lean terms and examples embedded in it do not render as nicely as we would like. In the near future, we will be working on removing these limitations. Additionally, we will be adding missing API reference documentation and revising and improving the existing API reference documentation.
Release History
- 2024-12-16
This is the initial release of the reference manual.
- 1. Introduction
- 2. Elaboration and Compilation
- 3. The Type System
- 4. Source Files
- 5. Terms
- 6. Type Classes
-
7. Functors, Monads and
do
-Notation - 8. IO
- 9. Tactic Proofs
- 10. The Simplifier
-
11. Basic Types
- 11.1. Natural Numbers
- 11.2. Integers
- 11.3. Finite Natural Numbers
- 11.4. Fixed-Precision Integer Types
- 11.5. Bitvectors
- 11.6. Floating-Point Numbers
- 11.7. Characters
- 11.8. Strings
- 11.9. The Unit Type
- 11.10. The Empty Type
- 11.11. Booleans
- 11.12. Optional Values
- 11.13. Tuples
- 11.14. Sum Types
- 11.15. Dependent Pairs
- 11.16. Linked Lists
- 11.17. Arrays
- 11.18. Subtypes
- 11.19. Lazy Computations
- 11.20. Tasks and Threads
- 12. Standard Library
- 13. Notations and Macros
- 14. Output from Lean
- 15. Elan
- 16. Lake and Reservoir
- Index