Documentation

CombinatorialGames.Mathlib.NatOrdinal

Natural operations on ordinals #

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 give the ordinals a CommSemiring + IsStrictOrderedRing structure. To make the best use of it, we define them on a type alias NatOrdinal.

An equivalent characterization explains the relevance of these operations to game theory: they are the restrictions of surreal addition and multiplication to the ordinals.

Implementation notes #

To reduce API duplication, we opt not to implement operations on NatOrdinal on Ordinal. The order isomorphisms NatOrdinal.of and NatOrdinal.val allow us to cast between them whenever needed.

For similar reasons, most results about ordinals and games are written using NatOrdinal rather than Ordinal (except when Nimber would make more sense).

def NatOrdinal :
Type (u_1 + 1)
Equations
Instances For
    @[instance_reducible]
    Equations
    • One or more equations did not get rendered due to their size.
    def NatOrdinal.type {α : Type u} (r : α → α → Prop) [wo : IsWellOrder α r] :
    Equations
    Instances For
      theorem PrincipalSeg.nat_ordinal_type_lt {α β : Type u_1} {r : α → α → Prop} {s : β → β → Prop} [IsWellOrder α r] [IsWellOrder β s] (h : PrincipalSeg r s) :
      theorem NatOrdinal.inductionOn {C : NatOrdinal → Prop} (o : NatOrdinal) (H : ∀ (α : Type u_1) (r : α → α → Prop) [inst : IsWellOrder α r], C (type r)) :
      C o
      def NatOrdinal.typein {α : Type u} (r : α → α → Prop) [IsWellOrder α r] :
      PrincipalSeg r fun (x1 x2 : NatOrdinal) => x1 < x2
      Equations
      Instances For
        def NatOrdinal.enum {α : Type u} (r : α → α → Prop) [IsWellOrder α r] :
        (fun (x1 x2 : ↑(Set.Iio (type r))) => x1 < x2) ≃r r
        Equations
        Instances For
          @[simp]
          theorem NatOrdinal.enum_symm_apply_coe {α : Type u} (r : α → α → Prop) [IsWellOrder α r] (a✝ : α) :
          ↑((enum r).symm a✝) = (typein r).toRelEmbedding a✝
          theorem NatOrdinal.lt_wf :
          WellFounded fun (x1 x2 : NatOrdinal) => x1 < x2
          @[instance_reducible]
          Equations
          @[instance_reducible]
          Equations
          @[instance_reducible]
          Equations
          theorem NatOrdinal.type_eq {α β : Type u_1} {r : α → α → Prop} {s : β → β → Prop} [IsWellOrder α r] [IsWellOrder β s] :
          theorem RelIso.nat_ordinal_type_eq {α β : Type u_1} {r : α → α → Prop} {s : β → β → Prop} [IsWellOrder α r] [IsWellOrder β s] (h : r ≃r s) :
          theorem NatOrdinal.type_eq_zero_of_empty {α : Type u_1} (r : α → α → Prop) [IsWellOrder α r] [IsEmpty α] :
          type r = 0
          @[simp]
          theorem NatOrdinal.type_eq_zero_iff_isEmpty {α : Type u} {r : α → α → Prop} [IsWellOrder α r] :
          type r = 0 ↔ IsEmpty α
          theorem NatOrdinal.type_ne_zero_iff_nonempty {α : Type u} {r : α → α → Prop} [IsWellOrder α r] :
          theorem NatOrdinal.type_ne_zero_of_nonempty {α : Type u} (r : α → α → Prop) [IsWellOrder α r] [h : Nonempty α] :
          type r ≠ 0
          @[simp]
          theorem NatOrdinal.of_val (a : NatOrdinal) :
          of (val a) = a
          @[simp]
          theorem NatOrdinal.val_of (a : Ordinal.{u_1}) :
          val (of a) = a
          @[simp]
          theorem NatOrdinal.of_zero :
          of 0 = 0
          @[simp]
          @[simp]
          theorem NatOrdinal.of_one :
          of 1 = 1
          @[simp]
          theorem NatOrdinal.val_one :
          val 1 = 1
          @[simp]
          theorem NatOrdinal.of_eq_zero {a : Ordinal.{u_1}} :
          of a = 0 ↔ a = 0
          @[simp]
          theorem NatOrdinal.val_eq_zero {a : NatOrdinal} :
          val a = 0 ↔ a = 0
          @[simp]
          theorem NatOrdinal.of_eq_one {a : Ordinal.{u_1}} :
          of a = 1 ↔ a = 1
          @[simp]
          theorem NatOrdinal.val_eq_one {a : NatOrdinal} :
          val a = 1 ↔ a = 1
          @[simp]
          def NatOrdinal.ind {motive : NatOrdinal → Sort u_1} (mk : (a : Ordinal.{u_2}) → motive (of a)) (a : NatOrdinal) :
          motive a
          Equations
          Instances For
            theorem NatOrdinal.induction {p : NatOrdinal → Prop} (i : NatOrdinal) :
            (∀ (j : NatOrdinal), (∀ k < j, p k) → p j) → p i
            @[simp]
            theorem NatOrdinal.zero_le (a : NatOrdinal) :
            0 ≤ a
            @[simp]
            theorem NatOrdinal.le_zero {a : NatOrdinal} :
            a ≤ 0 ↔ a = 0
            @[simp]
            @[instance_reducible]
            Equations
            • One or more equations did not get rendered due to their size.
            @[simp]
            theorem NatOrdinal.le_one_iff {a : NatOrdinal} :
            a ≤ 1 ↔ a = 0 ∨ a = 1
            theorem NatOrdinal.eq_natCast_of_le_natCast {a : NatOrdinal} {b : ℕ} (h : a ≤ of ↑b) :
            ∃ (c : ℕ), a = of ↑c
            theorem NatOrdinal.le_iSup {ι : Type u_1} (f : ι → NatOrdinal) [Small.{u, u_1} ι] (i : ι) :
            f i ≤ iSup f
            theorem NatOrdinal.iSup_le_iff {ι : Type u_1} {f : ι → NatOrdinal} {a : NatOrdinal} [Small.{u, u_1} ι] :
            ⨆ (i : ι), f i ≤ a ↔ ∀ (i : ι), f i ≤ a
            theorem NatOrdinal.lt_iSup_iff {ι : Type u_1} [Small.{u, u_1} ι] (f : ι → NatOrdinal) {x : NatOrdinal} :
            x < ⨆ (i : ι), f i ↔ ∃ (i : ι), x < f i
            theorem NatOrdinal.iSup_eq_zero_iff {ι : Type u_1} [Small.{u, u_1} ι] {f : ι → NatOrdinal} :
            ⨆ (i : ι), f i = 0 ↔ ∀ (i : ι), f i = 0

            Natural addition #

            @[instance_reducible]

            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

            Add two NatOrdinals as ordinal numbers.

            Equations
            Instances For
              theorem NatOrdinal.add_def (a b : NatOrdinal) :
              a + b = max (⨆ (x : ↑(Set.Iio a)), Order.succ (↑x + b)) (⨆ (x : ↑(Set.Iio b)), Order.succ (a + ↑x))
              theorem NatOrdinal.lt_add_iff {a b c : NatOrdinal} :
              a < b + c ↔ (∃ b' < b, a ≤ b' + c) ∨ ∃ c' < c, a ≤ b + c'
              theorem NatOrdinal.add_le_iff {a b c : NatOrdinal} :
              b + c ≤ a ↔ (∀ b' < b, b' + c < a) ∧ ∀ c' < c, b + c' < a
              @[instance_reducible]
              Equations
              • One or more equations did not get rendered due to their size.
              @[simp]
              theorem NatOrdinal.add_eq_zero_iff {a b : NatOrdinal} :
              a + b = 0 ↔ a = 0 ∧ b = 0
              @[simp]
              theorem NatOrdinal.of_add_one (a : Ordinal.{u_1}) :
              of (a + 1) = of a + 1
              @[simp]
              theorem NatOrdinal.val_add_one (a : NatOrdinal) :
              val (a + 1) = val a + 1
              @[simp]
              @[instance_reducible]
              Equations
              • One or more equations did not get rendered due to their size.
              @[simp]
              theorem NatOrdinal.of_natCast (n : ℕ) :
              of ↑n = ↑n
              @[simp]
              theorem NatOrdinal.val_natCast (n : ℕ) :
              val ↑n = ↑n
              @[simp]
              theorem NatOrdinal.forall_lt_natCast {P : NatOrdinal → Prop} {n : ℕ} :
              (∀ a < ↑n, P a) ↔ ∀ a < n, P ↑a
              @[simp]
              theorem NatOrdinal.exists_lt_natCast {P : NatOrdinal → Prop} {n : ℕ} :
              (∃ a < ↑n, P a) ↔ ∃ a < n, P ↑a
              theorem NatOrdinal.lt_omega0 {o : NatOrdinal} :
              o < of Ordinal.omega0 ↔ ∃ (n : ℕ), o = ↑n
              @[simp]
              theorem NatOrdinal.of_add_natCast (a : Ordinal.{u_1}) (n : ℕ) :
              of (a + ↑n) = of a + ↑n
              @[simp]
              theorem NatOrdinal.val_add_natCast (a : NatOrdinal) (n : ℕ) :
              val (a + ↑n) = val a + ↑n
              theorem NatOrdinal.oadd_le_add' (a b : Ordinal.{u_1}) :
              a + b ≤ val (of a + of b)

              A version of oadd_le_add stated in terms of Ordinal.

              theorem NatOrdinal.oadd_le_add (a b : NatOrdinal) :
              of (val a + val b) ≤ a + b
              theorem NatOrdinal.lt_omega0' {o : NatOrdinal} :
              o < of Ordinal.omega0 ↔ ∃ (n : ℕ), o = ↑n
              @[simp]
              theorem NatOrdinal.add_lt_add_iff_left_right {a b c : NatOrdinal} :
              a + b < c + a ↔ b < c
              @[simp]
              theorem NatOrdinal.add_lt_add_iff_right_left {a b c : NatOrdinal} :
              b + a < a + c ↔ b < c