# mathlib3documentation

set_theory.ordinal.natural_ops

# Natural operations on ordinals #

THIS FILE IS SYNCHRONIZED WITH MATHLIB4. Any changes to this file require a corresponding PR to mathlib4.

The goal of this file is to define natural addition and multiplication on ordinals, also known as the Hessenberg sum and product, and provide a basic API. The natural addition of two ordinals a ♯ b is recursively defined as the least ordinal greater than a' ♯ b and a ♯ b' for a' < a and b' < b. The natural multiplication a ⨳ b is likewise recursively defined as the least ordinal such that a ⨳ b ♯ a' ⨳ b' is greater than a' ⨳ b ♯ a ⨳ b' for any a' < a and b' < b.

These operations form a rich algebraic structure: they're commutative, associative, preserve order, have the usual 0 and 1 from ordinals, and distribute over one another.

Moreover, these operations are the addition and multiplication of ordinals when viewed as combinatorial games. This makes them particularly useful for game theory.

Finally, both operations admit simple, intuitive descriptions in terms of the Cantor normal form. The natural addition of two ordinals corresponds to adding their Cantor normal forms as if they were polynomials in ω. Likewise, their natural multiplication corresponds to multiplying the Cantor normal forms as polynomials.

# Implementation notes #

Given the rich algebraic structure of these two operations, we choose to create a type synonym nat_ordinal, where we provide the appropriate instances. However, to avoid casting back and forth between both types, we attempt to prove and state most results on ordinal.

# Todo #

• Prove the characterizations of natural addition and multiplication in terms of the Cantor normal form.

### Basic casts between ordinal and nat_ordinal#

@[protected, instance]
noncomputable def nat_ordinal.linear_order  :
@[protected, instance]
@[protected, instance]
noncomputable def nat_ordinal.succ_order  :
@[protected, instance]
def nat_ordinal  :
Type (u_1+1)

A type synonym for ordinals with natural addition and multiplication.

Equations
Instances for nat_ordinal
@[protected, instance]
@[protected, instance]

The identity function between ordinal and nat_ordinal.

Equations
noncomputable def nat_ordinal.to_ordinal  :

The identity function between nat_ordinal and ordinal.

Equations
@[simp]
@[simp]
@[protected, instance]
@[protected, instance]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[protected]
noncomputable def nat_ordinal.rec {β : nat_ordinal Sort u_2} (h : Π (a : ordinal), ) (a : nat_ordinal) :
β a

A recursor for nat_ordinal. Use as induction x using nat_ordinal.rec.

Equations
theorem nat_ordinal.induction {p : nat_ordinal Prop} (i : nat_ordinal) (h : (j : nat_ordinal), ( (k : nat_ordinal), k < j p k) p j) :
p i

ordinal.induction but for nat_ordinal.

@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
@[simp]
theorem ordinal.to_nat_ordinal_max (a b : ordinal) :
@[simp]
theorem ordinal.to_nat_ordinal_min (a b : ordinal) :

We place the definitions of nadd and nmul before actually developing their API, as this guarantees we only need to open the natural_ops locale once.

Natural addition on ordinals a ♯ b, also known as the Hessenberg sum, is recursively defined as the least ordinal greater than a' ♯ b and a ♯ b' for all a' < a and b' < b. In contrast to normal ordinal addition, it is commutative.

Natural addition can equivalently be characterized as the ordinal resulting from adding up corresponding coefficients in the Cantor normal forms of a and b.

Equations
noncomputable def ordinal.nmul  :

Natural multiplication on ordinals a ⨳ b, also known as the Hessenberg product, is recursively defined as the least ordinal such that a ⨳ b + a' ⨳ b' is greater than a' ⨳ b + a ⨳ b' for all a' < a and b < b'. In contrast to normal ordinal multiplication, it is commutative and distributive (over natural addition).

Natural multiplication can equivalently be characterized as the ordinal resulting from multiplying the Cantor normal forms of a and b as if they were polynomials in ω. Addition of exponents is done via natural addition.

Equations

theorem ordinal.nadd_def (a b : ordinal) :
a.nadd b = linear_order.max (a.blsub (λ (a' : ordinal) (h : a' < a), a'.nadd b)) (b.blsub (λ (b' : ordinal) (h : b' < b), a.nadd b'))
theorem ordinal.lt_nadd_iff {a b c : ordinal} :
a < b.nadd c ( (b' : ordinal) (H : b' < b), a b'.nadd c) (c' : ordinal) (H : c' < c), a b.nadd c'
theorem ordinal.nadd_le_iff {a b c : ordinal} :
b.nadd c a ( (b' : ordinal), b' < b b'.nadd c < a) (c' : ordinal), c' < c b.nadd c' < a
theorem ordinal.nadd_lt_nadd_left {b c : ordinal} (h : b < c) (a : ordinal) :
theorem ordinal.nadd_lt_nadd_right {b c : ordinal} (h : b < c) (a : ordinal) :
theorem ordinal.nadd_le_nadd_left {b c : ordinal} (h : b c) (a : ordinal) :
theorem ordinal.nadd_le_nadd_right {b c : ordinal} (h : b c) (a : ordinal) :
theorem ordinal.nadd_comm (a b : ordinal) :
theorem ordinal.blsub_nadd_of_mono (a b : ordinal) {f : Π (c : ordinal), c < a.nadd b ordinal} (hf : {i j : ordinal} (hi : i < a.nadd b) (hj : j < a.nadd b), i j f i hi f j hj) :
(a.nadd b).blsub f = linear_order.max (a.blsub (λ (a' : ordinal) (ha' : a' < a), f (a'.nadd b) _)) (b.blsub (λ (b' : ordinal) (hb' : b' < b), f (a.nadd b') _))
theorem ordinal.nadd_assoc (a b c : ordinal) :
@[simp]
theorem ordinal.nadd_zero (a : ordinal) :
@[simp]
theorem ordinal.zero_nadd (a : ordinal) :
@[simp]
theorem ordinal.nadd_one (a : ordinal) :
@[simp]
theorem ordinal.one_nadd (a : ordinal) :
theorem ordinal.nadd_succ (a b : ordinal) :
theorem ordinal.succ_nadd (a b : ordinal) :
@[simp]
theorem ordinal.nadd_nat (a : ordinal) (n : ) :
a.nadd n = a + n
@[simp]
theorem ordinal.nat_nadd (a : ordinal) (n : ) :
n.nadd a = a + n
@[protected, instance]
Equations
@[protected, instance]
@[protected, instance]
@[protected, instance]
@[protected, instance]
Equations
@[protected, instance]
Equations
@[simp]
@[simp]
@[simp]
theorem ordinal.nadd_left_cancel {a b c : ordinal} :
theorem ordinal.nadd_right_cancel {a b c : ordinal} :
theorem ordinal.nadd_left_cancel_iff {a b c : ordinal} :
theorem ordinal.nadd_right_cancel_iff {a b c : ordinal} :
theorem ordinal.le_nadd_self {a b : ordinal} :
theorem ordinal.le_nadd_left {a b c : ordinal} (h : a c) :
theorem ordinal.le_self_nadd {a b : ordinal} :
theorem ordinal.le_nadd_right {a b c : ordinal} (h : a b) :
theorem ordinal.nadd_left_comm (a b c : ordinal) :
theorem ordinal.nadd_right_comm (a b c : ordinal) :

### Natural multiplication #

theorem ordinal.nmul_def (a b : ordinal) :
a.nmul b = has_Inf.Inf {c : ordinal | (a' : ordinal), a' < a (b' : ordinal), b' < b (a'.nmul b).nadd (a.nmul b') < c.nadd (a'.nmul b')}
theorem ordinal.nmul_nonempty (a b : ordinal) :
{c : ordinal | (a' : ordinal), a' < a (b' : ordinal), b' < b (a'.nmul b).nadd (a.nmul b') < c.nadd (a'.nmul b')}.nonempty

The set in the definition of nmul is nonempty.

theorem ordinal.nmul_nadd_lt {a b a' b' : ordinal} (ha : a' < a) (hb : b' < b) :
theorem ordinal.nmul_nadd_le {a b a' b' : ordinal} (ha : a' a) (hb : b' b) :
theorem ordinal.lt_nmul_iff {a b c : ordinal} :
c < a.nmul b (a' : ordinal) (H : a' < a) (b' : ordinal) (H : b' < b), c.nadd (a'.nmul b') (a'.nmul b).nadd (a.nmul b')
theorem ordinal.nmul_le_iff {a b c : ordinal} :
a.nmul b c (a' : ordinal), a' < a (b' : ordinal), b' < b (a'.nmul b).nadd (a.nmul b') < c.nadd (a'.nmul b')
theorem ordinal.nmul_comm (a b : ordinal) :
a.nmul b = b.nmul a
@[simp]
theorem ordinal.nmul_zero (a : ordinal) :
a.nmul 0 = 0
@[simp]
theorem ordinal.zero_nmul (a : ordinal) :
0.nmul a = 0
@[simp]
theorem ordinal.nmul_one (a : ordinal) :
a.nmul 1 = a
@[simp]
theorem ordinal.one_nmul (a : ordinal) :
1.nmul a = a
theorem ordinal.nmul_lt_nmul_of_pos_left {a b c : ordinal} (h₁ : a < b) (h₂ : 0 < c) :
c.nmul a < c.nmul b
theorem ordinal.nmul_lt_nmul_of_pos_right {a b c : ordinal} (h₁ : a < b) (h₂ : 0 < c) :
a.nmul c < b.nmul c
theorem ordinal.nmul_le_nmul_of_nonneg_left {a b c : ordinal} (h₁ : a b) (h₂ : 0 c) :
c.nmul a c.nmul b
theorem ordinal.nmul_le_nmul_of_nonneg_right {a b c : ordinal} (h₁ : a b) (h₂ : 0 c) :
a.nmul c b.nmul c
theorem ordinal.nmul_nadd (a b c : ordinal) :
theorem ordinal.nadd_nmul (a b c : ordinal) :
theorem ordinal.nmul_nadd_lt₃ {a b c a' b' c' : ordinal} (ha : a' < a) (hb : b' < b) (hc : c' < c) :
theorem ordinal.nmul_nadd_le₃ {a b c a' b' c' : ordinal} (ha : a' a) (hb : b' b) (hc : c' c) :
theorem ordinal.nmul_nadd_lt₃' {a b c a' b' c' : ordinal} (ha : a' < a) (hb : b' < b) (hc : c' < c) :
theorem ordinal.nmul_nadd_le₃' {a b c a' b' c' : ordinal} (ha : a' a) (hb : b' b) (hc : c' c) :
theorem ordinal.lt_nmul_iff₃ {a b c d : ordinal} :
d < (a.nmul b).nmul c (a' : ordinal) (H : a' < a) (b' : ordinal) (H : b' < b) (c' : ordinal) (H : c' < c), ((d.nadd ((a'.nmul b').nmul c)).nadd ((a'.nmul b).nmul c')).nadd ((a.nmul b').nmul c') ((((a'.nmul b).nmul c).nadd ((a.nmul b').nmul c)).nadd ((a.nmul b).nmul c')).nadd ((a'.nmul b').nmul c')
theorem ordinal.nmul_le_iff₃ {a b c d : ordinal} :
(a.nmul b).nmul c d (a' : ordinal), a' < a (b' : ordinal), b' < b (c' : ordinal), c' < c ((((a'.nmul b).nmul c).nadd ((a.nmul b').nmul c)).nadd ((a.nmul b).nmul c')).nadd ((a'.nmul b').nmul c') < ((d.nadd ((a'.nmul b').nmul c)).nadd ((a'.nmul b).nmul c')).nadd ((a.nmul b').nmul c')
theorem ordinal.lt_nmul_iff₃' {a b c d : ordinal} :
d < a.nmul (b.nmul c) (a' : ordinal) (H : a' < a) (b' : ordinal) (H : b' < b) (c' : ordinal) (H : c' < c), ((d.nadd (a'.nmul (b'.nmul c))).nadd (a'.nmul (b.nmul c'))).nadd (a.nmul (b'.nmul c')) (((a'.nmul (b.nmul c)).nadd (a.nmul (b'.nmul c))).nadd (a.nmul (b.nmul c'))).nadd (a'.nmul (b'.nmul c'))
theorem ordinal.nmul_le_iff₃' {a b c d : ordinal} :
a.nmul (b.nmul c) d (a' : ordinal), a' < a (b' : ordinal), b' < b (c' : ordinal), c' < c (((a'.nmul (b.nmul c)).nadd (a.nmul (b'.nmul c))).nadd (a.nmul (b.nmul c'))).nadd (a'.nmul (b'.nmul c')) < ((d.nadd (a'.nmul (b'.nmul c))).nadd (a'.nmul (b.nmul c'))).nadd (a.nmul (b'.nmul c'))
theorem ordinal.nmul_assoc (a b c : ordinal) :
(a.nmul b).nmul c = a.nmul (b.nmul c)
@[protected, instance]
noncomputable def nat_ordinal.has_mul  :
Equations
@[protected, instance]
noncomputable def nat_ordinal.ordered_comm_semiring  :
Equations
theorem ordinal.nmul_eq_mul (a b : ordinal) :
theorem ordinal.nmul_nadd_one (a b : ordinal) :