Module docstring
{"# Ordinal arithmetic
Ordinals have an addition (corresponding to disjoint union) that turns them into an additive monoid, and a multiplication (corresponding to the lexicographic order on the product) that turns them into a monoid. One can also define correspondingly a subtraction, a division, a successor function, a power function and a logarithm function.
We also define limit ordinals and prove the basic induction principle on ordinals separating
successor ordinals and limit ordinals, in limitRecOn.
Main definitions and results
o₁ + o₂is the order on the disjoint union ofo₁ando₂obtained by declaring that every element ofo₁is smaller than every element ofo₂.o₁ - o₂is the unique ordinalosuch thato₂ + o = o₁, wheno₂ ≤ o₁.o₁ * o₂is the lexicographic order ono₂ × o₁.o₁ / o₂is the ordinalosuch thato₁ = o₂ * o + o'witho' < o₂. We also define the divisibility predicate, and a modulo operation.Order.succ o = o + 1is the successor ofo.pred oif the predecessor ofo. Ifois not a successor, we setpred o = o.
We discuss the properties of casts of natural numbers of and of ω with respect to these
operations.
Some properties of the operations are also used to discuss general tools on ordinals:
IsLimit o: an ordinal is a limit ordinal if it is neither0nor a successor.limitRecOnis the main induction principle of ordinals: if one can prove a property by induction at successor ordinals and at limit ordinals, then it holds for all ordinals.IsNormal: a functionf : Ordinal → OrdinalsatisfiesIsNormalif it is strictly increasing and order-continuous, i.e., the imagef oof a limit ordinalois the sup off afora < o.
Various other basic arithmetic results are given in Principal.lean instead.
","### Further properties of addition on ordinals ","### The predecessor of an ordinal ","### Limit ordinals ","### Normal ordinal functions ","### Subtraction on ordinals ","### Multiplication of ordinals ","### Division on ordinals ","### Casting naturals into ordinals, compatibility with operations "}