2015-03-05 02:06:39 +00:00
|
|
|
The Lean Standard Library
|
|
|
|
=========================
|
2014-08-25 16:11:46 +00:00
|
|
|
|
2015-05-24 08:36:26 +00:00
|
|
|
The Lean standard library is contained in the following files and directories:
|
2014-08-25 16:11:46 +00:00
|
|
|
|
2014-12-22 20:33:29 +00:00
|
|
|
* [init](init/init.md) : constants and theorems needed for low-level system operations
|
2014-08-25 16:11:46 +00:00
|
|
|
* [logic](logic/logic.md) : logical constructs and axioms
|
|
|
|
* [data](data/data.md) : concrete datatypes and type constructors
|
2014-09-16 18:58:54 +00:00
|
|
|
* [algebra](algebra/algebra.md) : algebraic structures
|
2016-02-23 00:41:22 +00:00
|
|
|
* [theories](theories/theories.md) : more domain-specific theories
|
2014-08-25 16:11:46 +00:00
|
|
|
* [tools](tools/tools.md) : additional tools
|
|
|
|
|
2016-01-24 22:12:24 +00:00
|
|
|
The files in `init` are loaded by default, and hence do not need to be
|
|
|
|
imported manually. Other files can be imported individually, but the
|
|
|
|
following is designed to load most of the standard library:
|
2014-08-25 16:11:46 +00:00
|
|
|
|
|
|
|
* [standard](standard.lean) : constructive logic and datatypes
|
|
|
|
|
2016-01-24 22:12:24 +00:00
|
|
|
Lean's default logical framework is a version of the Calculus of
|
|
|
|
Constructions with:
|
2014-08-25 16:11:46 +00:00
|
|
|
|
|
|
|
* an impredicative, proof-irrelevant type `Prop` of propositions
|
2014-12-22 20:33:29 +00:00
|
|
|
* universe polymorphism
|
2014-08-25 16:11:46 +00:00
|
|
|
* a non-cumulative hierarchy of universes, `Type 1`, `Type 2`, ... above `Prop`
|
|
|
|
* inductively defined types
|
2015-08-05 00:17:14 +00:00
|
|
|
* quotient types
|
2014-08-25 16:11:46 +00:00
|
|
|
|
2016-01-24 22:12:24 +00:00
|
|
|
Most of the `standard` library does not rely on any axioms beyond this
|
|
|
|
framework, and is hence fully constructive.
|
2014-08-25 16:11:46 +00:00
|
|
|
|
2016-01-24 22:12:24 +00:00
|
|
|
The following additional axioms are defined in `init`:
|
|
|
|
|
|
|
|
* quotients and propositional extensionality (in `quot`)
|
|
|
|
* Hilbert choice (in `classical`)
|
|
|
|
|
|
|
|
Function extensionality is derived from the quotient construction, and
|
|
|
|
excluded middle is derived from Hilbert choice. For Hilbert choice and
|
|
|
|
excluded middle, use `open classical`. The additional axioms are used
|
|
|
|
sparingly. For example:
|
|
|
|
|
|
|
|
* The constructions of finite sets and the rationals use quotients.
|
|
|
|
* The set library uses propext and funext, as well as excluded middle to prove
|
|
|
|
some classical identities.
|
|
|
|
* Hilbert choice is used to define the multiplicative inverse on the reals, and
|
|
|
|
also to define function inverses classically.
|
|
|
|
|
|
|
|
You can use `print axioms foo` to see which axioms `foo` depends
|
|
|
|
on. Many of the theories in the `theories` folder are unreservedly
|
|
|
|
classical.
|
2014-08-25 16:11:46 +00:00
|
|
|
|
2015-03-05 02:06:39 +00:00
|
|
|
See also the [hott library](../hott/hott.md), a library for homotopy
|
|
|
|
type theory based on a predicative foundation.
|