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 ordinalo
such thato₂ + o = o₁
, wheno₂ ≤ o₁
.o₁ * o₂
is the lexicographic order ono₂ × o₁
.o₁ / o₂
is the ordinalo
such thato₁ = o₂ * o + o'
witho' < o₂
. We also define the divisibility predicate, and a modulo operation.Order.succ o = o + 1
is the successor ofo
.pred o
if the predecessor ofo
. Ifo
is 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 neither0
nor a successor.limitRecOn
is 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 → Ordinal
satisfiesIsNormal
if it is strictly increasing and order-continuous, i.e., the imagef o
of a limit ordinalo
is the sup off a
fora < o
.
Various other basic arithmetic results are given in Principal.lean
instead.
Further properties of addition on ordinals #
The predecessor of an ordinal #
The ordinal predecessor of o
is o'
if o = succ o'
,
and o
otherwise.
Equations
- o.pred = if h : ∃ (a : Ordinal.{?u.2}), o = Order.succ a then Classical.choose h else o
Instances For
Limit ordinals #
A limit ordinal is an ordinal which is not zero and not a successor.
TODO: deprecate this in favor of Order.IsSuccLimit
.
Equations
Instances For
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.
Equations
- o.limitRecOn H₁ H₂ H₃ = SuccOrder.limitRecOn o (fun (a : Ordinal.{?u.78}) (ha : IsMin a) => ⋯.mpr H₁) (fun (a : Ordinal.{?u.78}) (x : ¬IsMax a) => H₂ a) H₃
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
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Normal ordinal functions #
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
.
Equations
- Ordinal.IsNormal f = ((∀ (o : Ordinal.{?u.23}), f o < f (Order.succ o)) ∧ ∀ (o : Ordinal.{?u.23}), o.IsLimit → ∀ (a : Ordinal.{?u.22}), f o ≤ a ↔ ∀ b < o, f b ≤ a)
Instances For
Alias of Ordinal.isNormal_add_right
.
Alias of Ordinal.isLimit_add
.
Subtraction on ordinals #
a - b
is the unique ordinal satisfying b + (a - b) = a
when b ≤ a
.
Equations
- Ordinal.sub = { sub := fun (a b : Ordinal.{?u.6}) => sInf {o : Ordinal.{?u.6} | a ≤ b + o} }
Alias of Ordinal.isLimit_sub
.
Multiplication of ordinals #
The multiplication of ordinals o₁
and o₂
is the (well founded) lexicographic order on
o₂ × o₁
.
Alias of Ordinal.isNormal_mul_right
.
Alias of Ordinal.isLimit_mul
.
Alias of Ordinal.isLimit_mul_left
.
Division on ordinals #
a / b
is the unique ordinal o
satisfying a = b * o + o'
with o' < b
.
Equations
- Ordinal.div = { div := fun (a b : Ordinal.{?u.6}) => if b = 0 then 0 else sInf {o : Ordinal.{?u.6} | a < b * Order.succ o} }
a % b
is the unique ordinal o'
satisfying
a = b * o + o'
with o' < b
.
Equations
- Ordinal.mod = { mod := fun (a b : Ordinal.{?u.5}) => a - b * (a / b) }
Casting naturals into ordinals, compatibility with operations #
Alias of Ordinal.lt_omega0
.
Alias of Ordinal.nat_lt_omega0
.
Alias of Ordinal.omega0_ne_zero
.
Alias of Ordinal.one_lt_omega0
.
Alias of Ordinal.isLimit_omega0
.
Alias of Ordinal.isLimit_omega0
.
Alias of Ordinal.omega0_le
.
Alias of Ordinal.omega0_le_of_isLimit
.
Alias of Ordinal.one_add_omega0
.
Alias of Ordinal.add_omega0
.
Alias of Ordinal.one_add_of_omega0_le
.
Alias of Ordinal.isLimit_iff_omega0_dvd
.
Alias of Cardinal.isLimit_ord
.