mathlib documentation

set_theory.​ordinal_arithmetic

set_theory.​ordinal_arithmetic

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 limit_rec_on.

Main definitions and results

We also define the power function and the logarithm function on ordinals, and discuss the properties of casts of natural numbers of and of omega with respect to these operations.

Some properties of the operations are also used to discuss general tools on ordinals:

Further properties of addition on ordinals

@[simp]
theorem ordinal.​lift_add (a b : ordinal) :
(a + b).lift = a.lift + b.lift

@[simp]

theorem ordinal.​add_le_add_iff_left (a : ordinal) {b c : ordinal} :
a + b a + c b c

theorem ordinal.​add_succ (o₁ o₂ : ordinal) :
o₁ + o₂.succ = (o₁ + o₂).succ

@[simp]
theorem ordinal.​succ_zero  :
0.succ = 1

theorem ordinal.​one_le_iff_pos {o : ordinal} :
1 o 0 < o

theorem ordinal.​succ_pos (o : ordinal) :
0 < o.succ

@[simp]
theorem ordinal.​card_succ (o : ordinal) :
o.succ.card = o.card + 1

theorem ordinal.​add_left_cancel (a : ordinal) {b c : ordinal} :
a + b = a + c b = c

theorem ordinal.​lt_succ {a b : ordinal} :
a < b.succ a b

theorem ordinal.​add_lt_add_iff_left (a : ordinal) {b c : ordinal} :
a + b < a + c b < c

theorem ordinal.​lt_of_add_lt_add_right {a b c : ordinal} :
a + b < c + ba < c

@[simp]
theorem ordinal.​succ_lt_succ {a b : ordinal} :
a.succ < b.succ a < b

@[simp]
theorem ordinal.​succ_le_succ {a b : ordinal} :
a.succ b.succ a b

theorem ordinal.​succ_inj {a b : ordinal} :
a.succ = b.succ a = b

theorem ordinal.​add_le_add_iff_right {a b : ordinal} (n : ) :
a + n b + n a b

theorem ordinal.​add_right_cancel {a b : ordinal} (n : ) :
a + n = b + n a = b

The zero ordinal

@[simp]
theorem ordinal.​card_eq_zero {o : ordinal} :
o.card = 0 o = 0

theorem ordinal.​type_ne_zero_iff_nonempty {α : Type u_1} {r : α → α → Prop} [is_well_order α r] :

@[simp]
theorem ordinal.​type_eq_zero_iff_empty {α : Type u_1} {r : α → α → Prop} [is_well_order α r] :

theorem ordinal.​zero_lt_one  :
0 < 1

The predecessor of an ordinal

The ordinal predecessor of o is o' if o = succ o', and o otherwise.

Equations
@[simp]
theorem ordinal.​pred_succ (o : ordinal) :
o.succ.pred = o

theorem ordinal.​pred_eq_iff_not_succ {o : ordinal} :
o.pred = o ¬∃ (a : ordinal), o = a.succ

theorem ordinal.​pred_lt_iff_is_succ {o : ordinal} :
o.pred < o ∃ (a : ordinal), o = a.succ

theorem ordinal.​succ_pred_iff_is_succ {o : ordinal} :
o.pred.succ = o ∃ (a : ordinal), o = a.succ

theorem ordinal.​succ_lt_of_not_succ {o : ordinal} (h : ¬∃ (a : ordinal), o = a.succ) {b : ordinal} :
b.succ < o b < o

theorem ordinal.​lt_pred {a b : ordinal} :
a < b.pred a.succ < b

theorem ordinal.​pred_le {a b : ordinal} :
a.pred b a b.succ

@[simp]
theorem ordinal.​lift_is_succ {o : ordinal} :
(∃ (a : ordinal), o.lift = a.succ) ∃ (a : ordinal), o = a.succ

@[simp]

Limit ordinals

def ordinal.​is_limit  :
ordinal → Prop

A limit ordinal is an ordinal which is not zero and not a successor.

Equations
theorem ordinal.​not_succ_of_is_limit {o : ordinal} :
o.is_limit(¬∃ (a : ordinal), o = a.succ)

theorem ordinal.​succ_lt_of_is_limit {o : ordinal} (h : o.is_limit) {a : ordinal} :
a.succ < o a < o

theorem ordinal.​le_succ_of_is_limit {o : ordinal} (h : o.is_limit) {a : ordinal} :
o a.succ o a

theorem ordinal.​limit_le {o : ordinal} (h : o.is_limit) {a : ordinal} :
o a ∀ (x : ordinal), x < ox a

theorem ordinal.​lt_limit {o : ordinal} (h : o.is_limit) {a : ordinal} :
a < o ∃ (x : ordinal) (H : x < o), a < x

theorem ordinal.​is_limit.​pos {o : ordinal} :
o.is_limit0 < o

theorem ordinal.​is_limit.​nat_lt {o : ordinal} (h : o.is_limit) (n : ) :
n < o

theorem ordinal.​zero_or_succ_or_limit (o : ordinal) :
o = 0 (∃ (a : ordinal), o = a.succ) o.is_limit

def ordinal.​limit_rec_on {C : ordinalSort u_2} (o : ordinal) :
C 0(Π (o : ordinal), C oC o.succ)(Π (o : ordinal), o.is_limit(Π (o' : ordinal), o' < oC o')C o)C o

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
@[simp]
theorem ordinal.​limit_rec_on_zero {C : ordinalSort u_2} (H₁ : C 0) (H₂ : Π (o : ordinal), C oC o.succ) (H₃ : Π (o : ordinal), o.is_limit(Π (o' : ordinal), o' < oC o')C o) :
0.limit_rec_on H₁ H₂ H₃ = H₁

@[simp]
theorem ordinal.​limit_rec_on_succ {C : ordinalSort u_2} (o : ordinal) (H₁ : C 0) (H₂ : Π (o : ordinal), C oC o.succ) (H₃ : Π (o : ordinal), o.is_limit(Π (o' : ordinal), o' < oC o')C o) :
o.succ.limit_rec_on H₁ H₂ H₃ = H₂ o (o.limit_rec_on H₁ H₂ H₃)

@[simp]
theorem ordinal.​limit_rec_on_limit {C : ordinalSort u_2} (o : ordinal) (H₁ : C 0) (H₂ : Π (o : ordinal), C oC o.succ) (H₃ : Π (o : ordinal), o.is_limit(Π (o' : ordinal), o' < oC o')C o) (h : o.is_limit) :
o.limit_rec_on H₁ H₂ H₃ = H₃ o h (λ (x : ordinal) (h : x < o), x.limit_rec_on H₁ H₂ H₃)

theorem ordinal.​has_succ_of_is_limit {α : Type u_1} {r : α → α → Prop} [wo : is_well_order α r] (h : (ordinal.type r).is_limit) (x : α) :
∃ (y : α), r x y

Normal ordinal functions

def ordinal.​is_normal  :
(ordinalordinal) → Prop

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
theorem ordinal.​is_normal.​limit_le {f : ordinalordinal} (H : ordinal.is_normal f) {o : ordinal} (a : o.is_limit) {a_1 : ordinal} :
f o a_1 ∀ (b : ordinal), b < of b a_1

theorem ordinal.​is_normal.​limit_lt {f : ordinalordinal} (H : ordinal.is_normal f) {o : ordinal} (h : o.is_limit) {a : ordinal} :
a < f o ∃ (b : ordinal) (H : b < o), a < f b

theorem ordinal.​is_normal.​lt_iff {f : ordinalordinal} (H : ordinal.is_normal f) {a b : ordinal} :
f a < f b a < b

theorem ordinal.​is_normal.​le_iff {f : ordinalordinal} (H : ordinal.is_normal f) {a b : ordinal} :
f a f b a b

theorem ordinal.​is_normal.​inj {f : ordinalordinal} (H : ordinal.is_normal f) {a b : ordinal} :
f a = f b a = b

theorem ordinal.​is_normal.​le_set {f : ordinalordinal} (H : ordinal.is_normal f) (p : ordinal → Prop) (p0 : ∃ (x : ordinal), p x) (S : ordinal) (H₂ : ∀ (o : ordinal), S o ∀ (a : ordinal), p aa o) {o : ordinal} :
f S o ∀ (a : ordinal), p af a o

theorem ordinal.​is_normal.​le_set' {α : Type u_1} {f : ordinalordinal} (H : ordinal.is_normal f) (p : α → Prop) (g : α → ordinal) (p0 : ∃ (x : α), p x) (S : ordinal) (H₂ : ∀ (o : ordinal), S o ∀ (a : α), p ag a o) {o : ordinal} :
f S o ∀ (a : α), p af (g a) o

theorem ordinal.​add_le_of_limit {a b c : ordinal} :
b.is_limit(a + b c ∀ (b' : ordinal), b' < ba + b' c)

theorem ordinal.​add_is_limit (a : ordinal) {b : ordinal} :
b.is_limit(a + b).is_limit

Subtraction on ordinals

a - b is the unique ordinal satisfying b + (a - b) = a when b ≤ a.

Equations
theorem ordinal.​le_add_sub (a b : ordinal) :
a b + (a - b)

theorem ordinal.​sub_le {a b c : ordinal} :
a - b c a b + c

theorem ordinal.​lt_sub {a b c : ordinal} :
a < b - c c + a < b

theorem ordinal.​add_sub_cancel (a b : ordinal) :
a + b - a = b

theorem ordinal.​sub_eq_of_add_eq {a b c : ordinal} :
a + b = cc - a = b

theorem ordinal.​sub_le_self (a b : ordinal) :
a - b a

theorem ordinal.​add_sub_cancel_of_le {a b : ordinal} :
b ab + (a - b) = a

@[simp]
theorem ordinal.​sub_zero (a : ordinal) :
a - 0 = a

@[simp]
theorem ordinal.​zero_sub (a : ordinal) :
0 - a = 0

@[simp]
theorem ordinal.​sub_self (a : ordinal) :
a - a = 0

theorem ordinal.​sub_eq_zero_iff_le {a b : ordinal} :
a - b = 0 a b

theorem ordinal.​sub_sub (a b c : ordinal) :
a - b - c = a - (b + c)

theorem ordinal.​add_sub_add_cancel (a b c : ordinal) :
a + b - (a + c) = b - c

theorem ordinal.​sub_is_limit {a b : ordinal} :
a.is_limitb < a(a - b).is_limit

@[simp]

Multiplication of ordinals

@[instance]

The multiplication of ordinals o₁ and o₂ is the (well founded) lexicographic order on o₂ × o₁.

Equations
@[simp]
theorem ordinal.​type_mul {α β : Type u} (r : α → α → Prop) (s : β → β → Prop) [is_well_order α r] [is_well_order β s] :

@[simp]
theorem ordinal.​lift_mul (a b : ordinal) :
(a * b).lift = a.lift * b.lift

@[simp]
theorem ordinal.​card_mul (a b : ordinal) :
(a * b).card = a.card * b.card

@[simp]
theorem ordinal.​mul_zero (a : ordinal) :
a * 0 = 0

@[simp]
theorem ordinal.​zero_mul (a : ordinal) :
0 * a = 0

theorem ordinal.​mul_add (a b c : ordinal) :
a * (b + c) = a * b + a * c

@[simp]
theorem ordinal.​mul_add_one (a b : ordinal) :
a * (b + 1) = a * b + a

@[simp]
theorem ordinal.​mul_succ (a b : ordinal) :
a * b.succ = a * b + a

theorem ordinal.​mul_le_mul_left {a b : ordinal} (c : ordinal) :
a bc * a c * b

theorem ordinal.​mul_le_mul_right {a b : ordinal} (c : ordinal) :
a ba * c b * c

theorem ordinal.​mul_le_mul {a b c d : ordinal} :
a cb da * b c * d

theorem ordinal.​mul_le_of_limit {a b c : ordinal} :
b.is_limit(a * b c ∀ (b' : ordinal), b' < ba * b' c)

theorem ordinal.​lt_mul_of_limit {a b c : ordinal} :
c.is_limit(a < b * c ∃ (c' : ordinal) (H : c' < c), a < b * c')

theorem ordinal.​mul_lt_mul_iff_left {a b c : ordinal} :
0 < a(a * b < a * c b < c)

theorem ordinal.​mul_le_mul_iff_left {a b c : ordinal} :
0 < a(a * b a * c b c)

theorem ordinal.​mul_lt_mul_of_pos_left {a b c : ordinal} :
a < b0 < cc * a < c * b

theorem ordinal.​mul_pos {a b : ordinal} :
0 < a0 < b0 < a * b

theorem ordinal.​mul_ne_zero {a b : ordinal} :
a 0b 0a * b 0

theorem ordinal.​le_of_mul_le_mul_left {a b c : ordinal} :
c * a c * b0 < ca b

theorem ordinal.​mul_right_inj {a b c : ordinal} :
0 < a(a * b = a * c b = c)

theorem ordinal.​mul_is_limit {a b : ordinal} :
0 < ab.is_limit(a * b).is_limit

theorem ordinal.​mul_is_limit_left {a b : ordinal} :
a.is_limit0 < b(a * b).is_limit

Division on ordinals

theorem ordinal.​div_aux (a b : ordinal) :
b 0{o : ordinal | a < b * o.succ}.nonempty

a / b is the unique ordinal o satisfying a = b * o + o' with o' < b.

Equations
@[simp]
theorem ordinal.​div_zero (a : ordinal) :
a / 0 = 0

theorem ordinal.​div_def (a : ordinal) {b : ordinal} (h : b 0) :
a / b = ordinal.omin {o : ordinal | a < b * o.succ} _

theorem ordinal.​lt_mul_succ_div (a : ordinal) {b : ordinal} :
b 0a < b * (a / b).succ

theorem ordinal.​lt_mul_div_add (a : ordinal) {b : ordinal} :
b 0a < b * (a / b) + b

theorem ordinal.​div_le {a b c : ordinal} :
b 0(a / b c a < b * c.succ)

theorem ordinal.​lt_div {a b c : ordinal} :
c 0(a < b / c c * a.succ b)

theorem ordinal.​le_div {a b c : ordinal} :
c 0(a b / c c * a b)

theorem ordinal.​div_lt {a b c : ordinal} :
b 0(a / b < c a < b * c)

theorem ordinal.​div_le_of_le_mul {a b c : ordinal} :
a b * ca / b c

theorem ordinal.​mul_lt_of_lt_div {a b c : ordinal} :
a < b / cc * a < b

@[simp]
theorem ordinal.​zero_div (a : ordinal) :
0 / a = 0

theorem ordinal.​mul_div_le (a b : ordinal) :
b * (a / b) a

theorem ordinal.​mul_add_div (a : ordinal) {b : ordinal} (b0 : b 0) (c : ordinal) :
(b * a + c) / b = a + c / b

theorem ordinal.​div_eq_zero_of_lt {a b : ordinal} :
a < ba / b = 0

@[simp]
theorem ordinal.​mul_div_cancel (a : ordinal) {b : ordinal} :
b 0b * a / b = a

@[simp]
theorem ordinal.​div_one (a : ordinal) :
a / 1 = a

@[simp]
theorem ordinal.​div_self {a : ordinal} :
a 0a / a = 1

theorem ordinal.​mul_sub (a b c : ordinal) :
a * (b - c) = a * b - a * c

theorem ordinal.​dvd_add_iff {a b c : ordinal} :
a b(a b + c a c)

theorem ordinal.​dvd_add {a b c : ordinal} :
a ba ca b + c

theorem ordinal.​dvd_zero (a : ordinal) :
a 0

theorem ordinal.​zero_dvd {a : ordinal} :
0 a a = 0

theorem ordinal.​one_dvd (a : ordinal) :
1 a

theorem ordinal.​div_mul_cancel {a b : ordinal} :
a 0a ba * (b / a) = b

theorem ordinal.​le_of_dvd {a b : ordinal} :
b 0a ba b

theorem ordinal.​dvd_antisymm {a b : ordinal} :
a bb aa = b

@[instance]

a % b is the unique ordinal o' satisfying a = b * o + o' with o' < b.

Equations
theorem ordinal.​mod_def (a b : ordinal) :
a % b = a - b * (a / b)

@[simp]
theorem ordinal.​mod_zero (a : ordinal) :
a % 0 = a

theorem ordinal.​mod_eq_of_lt {a b : ordinal} :
a < ba % b = a

@[simp]
theorem ordinal.​zero_mod (b : ordinal) :
0 % b = 0

theorem ordinal.​div_add_mod (a b : ordinal) :
b * (a / b) + a % b = a

theorem ordinal.​mod_lt (a : ordinal) {b : ordinal} :
b 0a % b < b

@[simp]
theorem ordinal.​mod_self (a : ordinal) :
a % a = 0

@[simp]
theorem ordinal.​mod_one (a : ordinal) :
a % 1 = 0

Supremum of a family of ordinals

def ordinal.​sup {ι : Type u_1} :
(ι → ordinal)ordinal

The supremum of a family of ordinals

Equations
theorem ordinal.​le_sup {ι : Type u_1} (f : ι → ordinal) (i : ι) :

theorem ordinal.​sup_le {ι : Type u_1} {f : ι → ordinal} {a : ordinal} :
ordinal.sup f a ∀ (i : ι), f i a

theorem ordinal.​lt_sup {ι : Type u_1} {f : ι → ordinal} {a : ordinal} :
a < ordinal.sup f ∃ (i : ι), a < f i

theorem ordinal.​is_normal.​sup {f : ordinalordinal} (H : ordinal.is_normal f) {ι : Type u_1} {g : ι → ordinal} :
nonempty ιf (ordinal.sup g) = ordinal.sup (f g)

theorem ordinal.​sup_ord {ι : Type u_1} (f : ι → cardinal) :
ordinal.sup (λ (i : ι), (f i).ord) = (cardinal.sup f).ord

theorem ordinal.​sup_succ {ι : Type u_1} (f : ι → ordinal) :
ordinal.sup (λ (i : ι), (f i).succ) (ordinal.sup f).succ

theorem ordinal.​unbounded_range_of_sup_ge {α β : Type u} (r : α → α → Prop) [is_well_order α r] (f : β → α) :

def ordinal.​bsup (o : ordinal) :
(Π (a : ordinal), a < oordinal)ordinal

The supremum of a family of ordinals indexed by the set of ordinals less than some o : ordinal.{u}. (This is not a special case of sup over the subtype, because {a // a < o} : Type (u+1) and sup only works over families in Type u.)

Equations
theorem ordinal.​bsup_le {o : ordinal} {f : Π (a : ordinal), a < oordinal} {a : ordinal} :
o.bsup f a ∀ (i : ordinal) (h : i < o), f i h a

theorem ordinal.​bsup_type {α : Type u_1} (r : α → α → Prop) [is_well_order α r] (f : Π (a : ordinal), a < ordinal.type rordinal) :
(ordinal.type r).bsup f = ordinal.sup (λ (a : α), f (ordinal.typein r a) _)

theorem ordinal.​le_bsup {o : ordinal} (f : Π (a : ordinal), a < oordinal) (i : ordinal) (h : i < o) :
f i h o.bsup f

theorem ordinal.​lt_bsup {o : ordinal} {f : Π (a : ordinal), a < oordinal} (hf : ∀ {a a' : ordinal} (ha : a < o) (ha' : a' < o), a < a'f a ha < f a' ha') (ho : o.is_limit) (i : ordinal) (h : i < o) :
f i h < o.bsup f

theorem ordinal.​bsup_id {o : ordinal} :
o.is_limito.bsup (λ (x : ordinal) (_x : x < o), x) = o

theorem ordinal.​is_normal.​bsup {f : ordinalordinal} (H : ordinal.is_normal f) {o : ordinal} (g : Π (a : ordinal), a < oordinal) :
o 0f (o.bsup g) = o.bsup (λ (a : ordinal) (h : a < o), f (g a h))

theorem ordinal.​is_normal.​bsup_eq {f : ordinalordinal} (H : ordinal.is_normal f) {o : ordinal} :
o.is_limito.bsup (λ (x : ordinal) (_x : x < o), f x) = f o

Ordinal exponential

The ordinal exponential, defined by transfinite recursion.

Equations
theorem ordinal.​zero_power' (a : ordinal) :
0 ^ a = 1 - a

@[simp]
theorem ordinal.​zero_power {a : ordinal} :
a 00 ^ a = 0

@[simp]
theorem ordinal.​power_zero (a : ordinal) :
a ^ 0 = 1

@[simp]
theorem ordinal.​power_succ (a b : ordinal) :
a ^ b.succ = a ^ b * a

theorem ordinal.​power_limit {a b : ordinal} :
a 0b.is_limita ^ b = b.bsup (λ (c : ordinal) (_x : c < b), a ^ c)

theorem ordinal.​power_le_of_limit {a b c : ordinal} :
a 0b.is_limit(a ^ b c ∀ (b' : ordinal), b' < ba ^ b' c)

theorem ordinal.​lt_power_of_limit {a b c : ordinal} :
b 0c.is_limit(a < b ^ c ∃ (c' : ordinal) (H : c' < c), a < b ^ c')

@[simp]
theorem ordinal.​power_one (a : ordinal) :
a ^ 1 = a

@[simp]
theorem ordinal.​one_power (a : ordinal) :
1 ^ a = 1

theorem ordinal.​power_pos {a : ordinal} (b : ordinal) :
0 < a0 < a ^ b

theorem ordinal.​power_ne_zero {a : ordinal} (b : ordinal) :
a 0a ^ b 0

theorem ordinal.​power_is_normal {a : ordinal} :
1 < aordinal.is_normal (λ (_y : ordinal), a ^ _y)

theorem ordinal.​power_lt_power_iff_right {a b c : ordinal} :
1 < a(a ^ b < a ^ c b < c)

theorem ordinal.​power_le_power_iff_right {a b c : ordinal} :
1 < a(a ^ b a ^ c b c)

theorem ordinal.​power_right_inj {a b c : ordinal} :
1 < a(a ^ b = a ^ c b = c)

theorem ordinal.​power_is_limit {a b : ordinal} :
1 < ab.is_limit(a ^ b).is_limit

theorem ordinal.​power_is_limit_left {a b : ordinal} :
a.is_limitb 0(a ^ b).is_limit

theorem ordinal.​power_le_power_right {a b c : ordinal} :
0 < ab ca ^ b a ^ c

theorem ordinal.​power_le_power_left {a b : ordinal} (c : ordinal) :
a ba ^ c b ^ c

theorem ordinal.​le_power_self {a : ordinal} (b : ordinal) :
1 < ab a ^ b

theorem ordinal.​power_lt_power_left_of_succ {a b c : ordinal} :
a < ba ^ c.succ < b ^ c.succ

theorem ordinal.​power_add (a b c : ordinal) :
a ^ (b + c) = a ^ b * a ^ c

theorem ordinal.​power_dvd_power (a : ordinal) {b c : ordinal} :
b ca ^ b a ^ c

theorem ordinal.​power_dvd_power_iff {a b c : ordinal} :
1 < a(a ^ b a ^ c b c)

theorem ordinal.​power_mul (a b c : ordinal) :
a ^ (b * c) = (a ^ b) ^ c

Ordinal logarithm

The ordinal logarithm is the solution u to the equation x = b ^ u * v + w where v < b and w < b.

Equations
@[simp]
theorem ordinal.​log_not_one_lt {b : ordinal} (b1 : ¬1 < b) (x : ordinal) :
b.log x = 0

theorem ordinal.​log_def {b : ordinal} (b1 : 1 < b) (x : ordinal) :
b.log x = (ordinal.omin {o : ordinal | x < b ^ o} _).pred

@[simp]
theorem ordinal.​log_zero (b : ordinal) :
b.log 0 = 0

theorem ordinal.​succ_log_def {b x : ordinal} (b1 : 1 < b) :
0 < x(b.log x).succ = ordinal.omin {o : ordinal | x < b ^ o} _

theorem ordinal.​lt_power_succ_log {b : ordinal} (b1 : 1 < b) (x : ordinal) :
x < b ^ (b.log x).succ

theorem ordinal.​power_log_le (b : ordinal) {x : ordinal} :
0 < xb ^ b.log x x

theorem ordinal.​le_log {b x c : ordinal} :
1 < b0 < x(c b.log x b ^ c x)

theorem ordinal.​log_lt {b x c : ordinal} :
1 < b0 < x(b.log x < c x < b ^ c)

theorem ordinal.​log_le_log (b : ordinal) {x y : ordinal} :
x yb.log x b.log y

theorem ordinal.​log_le_self (b x : ordinal) :
b.log x x

The Cantor normal form

theorem ordinal.​CNF_aux {b o : ordinal} :
b 0o 0o % b ^ b.log o < o

def ordinal.​CNF_rec {b : ordinal} (b0 : b 0) {C : ordinalSort u_2} (H0 : C 0) (H : Π (o : ordinal), o 0o % b ^ b.log o < oC (o % b ^ b.log o)C o) (o : ordinal) :
C o

Proving properties of ordinals by induction over their Cantor normal form.

Equations
@[simp]
theorem ordinal.​CNF_rec_zero {b : ordinal} (b0 : b 0) {C : ordinalSort u_2} {H0 : C 0} {H : Π (o : ordinal), o 0o % b ^ b.log o < oC (o % b ^ b.log o)C o} :
ordinal.CNF_rec b0 H0 H 0 = H0

@[simp]
theorem ordinal.​CNF_rec_ne_zero {b : ordinal} (b0 : b 0) {C : ordinalSort u_2} {H0 : C 0} {H : Π (o : ordinal), o 0o % b ^ b.log o < oC (o % b ^ b.log o)C o} {o : ordinal} (o0 : o 0) :
ordinal.CNF_rec b0 H0 H o = H o o0 _ (ordinal.CNF_rec b0 H0 H (o % b ^ b.log o))

The Cantor normal form of an ordinal is the list of coefficients in the base-b expansion of o.

CNF b (b ^ u₁ * v₁ + b ^ u₂ * v₂) = [(u₁, v₁), (u₂, v₂)]

Equations
@[simp]

theorem ordinal.​CNF_ne_zero {b o : ordinal} :
b 0o 0ordinal.CNF b o = (b.log o, o / b ^ b.log o) :: ordinal.CNF b (o % b ^ b.log o)

theorem ordinal.​one_CNF {o : ordinal} :
o 0ordinal.CNF 1 o = [(0, o)]

theorem ordinal.​CNF_foldr {b : ordinal} (b0 : b 0) (o : ordinal) :
list.foldr (λ (p : ordinal × ordinal) (r : ordinal), b ^ p.fst * p.snd + r) 0 (ordinal.CNF b o) = o

theorem ordinal.​CNF_snd_lt {b : ordinal} (b1 : 1 < b) (o : ordinal) (p : ordinal × ordinal) :
p ordinal.CNF b op.snd < b

Casting naturals into ordinals, compatibility with operations

@[simp]
theorem ordinal.​nat_cast_mul {m n : } :
(m * n) = m * n

@[simp]
theorem ordinal.​nat_cast_power {m n : } :
(m ^ n) = m ^ n

@[simp]
theorem ordinal.​nat_cast_le {m n : } :
m n m n

@[simp]
theorem ordinal.​nat_cast_lt {m n : } :
m < n m < n

@[simp]
theorem ordinal.​nat_cast_inj {m n : } :
m = n m = n

@[simp]
theorem ordinal.​nat_cast_eq_zero {n : } :
n = 0 n = 0

theorem ordinal.​nat_cast_ne_zero {n : } :
n 0 n 0

@[simp]
theorem ordinal.​nat_cast_pos {n : } :
0 < n 0 < n

@[simp]
theorem ordinal.​nat_cast_sub {m n : } :
(m - n) = m - n

@[simp]
theorem ordinal.​nat_cast_div {m n : } :
(m / n) = m / n

@[simp]
theorem ordinal.​nat_cast_mod {m n : } :
(m % n) = m % n

@[simp]
theorem ordinal.​nat_le_card {o : ordinal} {n : } :

@[simp]
theorem ordinal.​nat_lt_card {o : ordinal} {n : } :
n < o.card n < o

@[simp]
theorem ordinal.​card_lt_nat {o : ordinal} {n : } :
o.card < n o < n

@[simp]
theorem ordinal.​card_le_nat {o : ordinal} {n : } :

@[simp]
theorem ordinal.​card_eq_nat {o : ordinal} {n : } :
o.card = n o = n

@[simp]
theorem ordinal.​lift_nat_cast (n : ) :

theorem ordinal.​fintype_card {α : Type u_1} (r : α → α → Prop) [is_well_order α r] [fintype α] :

Properties of omega

@[simp]

theorem ordinal.​lt_omega {o : ordinal} :
o < ordinal.omega ∃ (n : ), o = n

theorem ordinal.​omega_le {o : ordinal} :
ordinal.omega o ∀ (n : ), n o

theorem ordinal.​nat_lt_limit {o : ordinal} (h : o.is_limit) (n : ) :
n < o

theorem ordinal.​add_absorp {a b c : ordinal} :
a < ordinal.omega ^ bordinal.omega ^ b ca + c = c

theorem ordinal.​add_absorp_iff {o : ordinal} :
0 < o((∀ (a : ordinal), a < oa + o = o) ∃ (a : ordinal), o = ordinal.omega ^ a)

theorem ordinal.​add_mul_limit_aux {a b c : ordinal} :
b + a = ac.is_limit(∀ (c' : ordinal), c' < c(a + b) * c'.succ = a * c'.succ + b)(a + b) * c = a * c

theorem ordinal.​add_mul_succ {a b : ordinal} (c : ordinal) :
b + a = a(a + b) * c.succ = a * c.succ + b

theorem ordinal.​add_mul_limit {a b c : ordinal} :
b + a = ac.is_limit(a + b) * c = a * c

theorem ordinal.​mul_lt_omega_power {a b c : ordinal} :
0 < ca < ordinal.omega ^ cb < ordinal.omegaa * b < ordinal.omega ^ c

theorem ordinal.​mul_omega_dvd {a : ordinal} (a0 : 0 < a) (ha : a < ordinal.omega) {b : ordinal} :
ordinal.omega ba * b = b

Fixed points of normal functions

def ordinal.​nfp  :

The next fixed point function, the least fixed point of the normal function f above a.

Equations
theorem ordinal.​iterate_le_nfp (f : ordinalordinal) (a : ordinal) (n : ) :

theorem ordinal.​is_normal.​nfp_le_fp {f : ordinalordinal} (H : ordinal.is_normal f) {a b : ordinal} :
a bf b bordinal.nfp f a b

theorem ordinal.​nfp_eq_self {f : ordinalordinal} {a : ordinal} :
f a = aordinal.nfp f a = a

The derivative of a normal function f is the sequence of fixed points of f.

Equations
@[simp]

theorem ordinal.​deriv_limit (f : ordinalordinal) {o : ordinal} :
o.is_limitordinal.deriv f o = o.bsup (λ (a : ordinal) (_x : a < o), ordinal.deriv f a)