Ordinal arithmetic #
Ordinals have an addition (corresponding to the 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 (truncated) subtraction and division operators.
Ordinal powers and logarithms are defined in Mathlib.SetTheory.Ordinal.Exponential.
Main definitions and results #
a + bis the order type of the lexicographic suma ⊕ₗ b.a - bis the unique ordinalcsuch thatb + c = a, whenb ≤ a.a * bis the order type of the lexicographic productb ×ₗ a.a / bis the ordinalqsuch thata = b * q + rwithr < b. We also define the divisibility predicate, and a modulo operation.limitRecOnis limit recursion on ordinals, i.e. well-founded recursion separating out the zero, successor, and limit cases.
We discuss the properties of casts of natural numbers of and of ω with respect to these
operations.
Note that some basic functions and properties of ordinals have been generalized to other orders, and exist on other files:
Order.succ o = o + 1is the successor ofo.Order.IsSuccLimit o: an ordinal is a limit ordinal if it is neither0nor a successor.Order.IsNormal: a functionf : Ordinal → Ordinalis normal if it is strictly increasing and order-continuous, i.e., the imagef oof a limit ordinalois the supremum off afora < o.
Various other basic arithmetic results are given in Principal.lean instead.
Further properties of addition on ordinals #
Limit ordinals #
Limit induction on ordinals: if one can prove a property by induction at successor ordinals and at limit ordinals, then it holds for all ordinals.
Note that this is just a special (though sometimes convenient) case of the more general
well-founded recursion WellFoundedLT.fix.
Instances For
Bounded recursion on ordinals. Similar to limitRecOn, with the assumption o < l
added to all cases. The final term's domain is the ordinals below l.
Instances For
The predecessor of an ordinal #
The ordinal predecessor of a is b if a = succ b, and a otherwise.
Instances For
Alias of Ordinal.pred_eq_of_isSuccPrelimit.
Ordinal.pred and Order.succ form a Galois insertion.
Instances For
A normal ordinal function is a strictly increasing function which is
order-continuous, i.e., the image f o of a limit ordinal o is the sup of f a for
a < o.
Instances For
Subtraction on ordinals #
a - b is the unique ordinal satisfying b + (a - b) = a when b ≤ a.
Multiplication of ordinals #
The multiplication of ordinals a and b is the order type of the lexicographic order on
b × a.
Alias of Ordinal.isSuccLimit_mul_right.
Alias of Ordinal.nsmul_eq_mul.
Division on ordinals #
a / b is the unique ordinal q satisfying a = b * q + r with r < b.
Multiplication and division by a non-zero ordinal form a Galois connection.
a % b is the unique ordinal r satisfying a = b * q + r with r < b.
Casting naturals into ordinals, compatibility with operations #
Properties of ω #
Alias of Ordinal.natCast_lt_omega0.