Module docstring
{"# Ordinals
Ordinals are defined as equivalences of well-ordered sets under order isomorphism. They are endowed with a total order, where an ordinal is smaller than another one if it embeds into it as an initial segment (or, equivalently, in any way). This total order is well founded.
Main definitions
Ordinal: the type of ordinals (in a given universe)Ordinal.type r: given a well-founded orderr, this is the corresponding ordinalOrdinal.typein r a: given a well-founded orderron a typeα, anda : α, the ordinal corresponding to all elements smaller thana.enum r ⟨o, h⟩: given a well-orderron a typeα, and an ordinalostrictly smaller than the ordinal corresponding tor(this is the assumptionh), returns theo-th element ofα. In other words, the elements ofαcan be enumerated using ordinals up totype r.Ordinal.card o: the cardinality of an ordinalo.Ordinal.liftlifts an ordinal in universeuto an ordinal in universemax u v. For a version registering additionally that this is an initial segment embedding, seeOrdinal.liftInitialSeg. For a version registering that it is a principal segment embedding ifu < v, seeOrdinal.liftPrincipalSeg.Ordinal.omega0orωis the order type ofℕ. It is called this to matchCardinal.aleph0and so that the omega function can be namedOrdinal.omega. This definition is universe polymorphic:Ordinal.omega0.{u} : Ordinal.{u}(contrast withℕ : Type, which lives in a specific universe). In some cases the universe level has to be given explicitly.o₁ + o₂is the order on the disjoint union ofo₁ando₂obtained by declaring that every element ofo₁is smaller than every element ofo₂. The main properties of addition (and the other operations on ordinals) are stated and proved inMathlib/SetTheory/Ordinal/Arithmetic.lean. Here, we only introduce it and prove its basic properties to deduce the fact that the order on ordinals is total (and well founded).succ ois the successor of the ordinalo.Cardinal.ord c: whencis a cardinal,ord cis the smallest ordinal with this cardinality. It is the canonical way to represent a cardinal with an ordinal.
A conditionally complete linear order with bot structure is registered on ordinals, where ⊥ is
0, the ordinal corresponding to the empty type, and Inf is the minimum for nonempty sets and 0
for the empty set by convention.
Notations
ωis a notation for the first infinite ordinal in the localeOrdinal. ","### Definition of ordinals ","### Basic properties of the order type ","### The order on ordinals ","### Enumerating elements in a well-order with ordinals ","### Cardinality of ordinals ","### Lifting ordinals to a higher universe ","### The first infinite ordinal ω ","### Definition and first properties of addition on ordinals
In this paragraph, we introduce the addition on ordinals, and prove just enough properties to
deduce that the order on ordinals is total (and therefore well-founded). Further properties of
the addition, together with properties of the other operations, are proved in
Mathlib/SetTheory/Ordinal/Arithmetic.lean.
","### Successor order properties ","### Extra properties of typein and enum ","### Universal ordinal ","### Representing a cardinal with an ordinal ","### Sorted lists "}