Documentation

Mathlib.SetTheory.Ordinal.NaturalOps

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 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 NatOrdinal, 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 #

Basic casts between Ordinal and NatOrdinal #

def NatOrdinal :
Type (u_1 + 1)

A type synonym for ordinals with natural addition and multiplication.

Equations
Instances For
    Equations
    Equations
    • One or more equations did not get rendered due to their size.
    @[match_pattern]

    The identity function between Ordinal and NatOrdinal.

    Equations
    Instances For
      @[match_pattern]

      The identity function between NatOrdinal and Ordinal.

      Equations
      Instances For
        @[simp]
        theorem NatOrdinal.toOrdinal_toNatOrdinal (a : NatOrdinal) :
        Ordinal.toNatOrdinal (NatOrdinal.toOrdinal a) = a
        theorem NatOrdinal.lt_wf :
        WellFounded fun (x x_1 : NatOrdinal) => x < x_1
        @[simp]
        theorem NatOrdinal.toOrdinal_zero :
        NatOrdinal.toOrdinal 0 = 0
        @[simp]
        theorem NatOrdinal.toOrdinal_one :
        NatOrdinal.toOrdinal 1 = 1
        @[simp]
        theorem NatOrdinal.toOrdinal_eq_zero (a : NatOrdinal) :
        NatOrdinal.toOrdinal a = 0 a = 0
        @[simp]
        theorem NatOrdinal.toOrdinal_eq_one (a : NatOrdinal) :
        NatOrdinal.toOrdinal a = 1 a = 1
        @[simp]
        theorem NatOrdinal.toOrdinal_max {a : NatOrdinal} {b : NatOrdinal} :
        NatOrdinal.toOrdinal (max a b) = max (NatOrdinal.toOrdinal a) (NatOrdinal.toOrdinal b)
        @[simp]
        theorem NatOrdinal.toOrdinal_min {a : NatOrdinal} {b : NatOrdinal} :
        NatOrdinal.toOrdinal (min a b) = min (NatOrdinal.toOrdinal a) (NatOrdinal.toOrdinal b)
        theorem NatOrdinal.succ_def (a : NatOrdinal) :
        Order.succ a = Ordinal.toNatOrdinal (NatOrdinal.toOrdinal a + 1)
        def NatOrdinal.rec {β : NatOrdinalSort u_1} (h : (a : Ordinal.{u_2}) → β (Ordinal.toNatOrdinal a)) (a : NatOrdinal) :
        β a

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

        Equations
        Instances For
          theorem NatOrdinal.induction {p : NatOrdinalProp} (i : NatOrdinal) :
          (∀ (j : NatOrdinal), (k < j, p k)p j)p i

          Ordinal.induction but for NatOrdinal.

          @[simp]
          theorem Ordinal.toNatOrdinal_toOrdinal (a : Ordinal.{u_1}) :
          NatOrdinal.toOrdinal (Ordinal.toNatOrdinal a) = a
          @[simp]
          theorem Ordinal.toNatOrdinal_zero :
          Ordinal.toNatOrdinal 0 = 0
          @[simp]
          theorem Ordinal.toNatOrdinal_one :
          Ordinal.toNatOrdinal 1 = 1
          @[simp]
          theorem Ordinal.toNatOrdinal_eq_zero (a : Ordinal.{u_1}) :
          Ordinal.toNatOrdinal a = 0 a = 0
          @[simp]
          theorem Ordinal.toNatOrdinal_eq_one (a : Ordinal.{u_1}) :
          Ordinal.toNatOrdinal a = 1 a = 1
          @[simp]
          theorem Ordinal.toNatOrdinal_max (a : Ordinal.{u_1}) (b : Ordinal.{u_1}) :
          Ordinal.toNatOrdinal (max a b) = max (Ordinal.toNatOrdinal a) (Ordinal.toNatOrdinal b)
          @[simp]
          theorem Ordinal.toNatOrdinal_min (a : Ordinal.{u_1}) (b : Ordinal.{u_1}) :
          Ordinal.toNatOrdinal (min a b) = min (Ordinal.toNatOrdinal a) (Ordinal.toNatOrdinal b)

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

          noncomputable def Ordinal.nadd :

          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
          • One or more equations did not get rendered due to their size.
          Instances For

            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
            Instances For
              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
              Instances For

                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
                Instances For

                  Natural addition #

                  theorem Ordinal.nadd_def (a : Ordinal.{u}) (b : Ordinal.{u}) :
                  Ordinal.nadd a b = max (Ordinal.blsub a fun (a' : Ordinal.{u}) (x : a' < a) => Ordinal.nadd a' b) (Ordinal.blsub b fun (b' : Ordinal.{u}) (x : b' < b) => Ordinal.nadd a b')
                  theorem Ordinal.lt_nadd_iff {a : Ordinal.{u}} {b : Ordinal.{u}} {c : Ordinal.{u}} :
                  a < Ordinal.nadd b c (∃ b' < b, a Ordinal.nadd b' c) ∃ c' < c, a Ordinal.nadd b c'
                  theorem Ordinal.nadd_le_iff {a : Ordinal.{u}} {b : Ordinal.{u}} {c : Ordinal.{u}} :
                  Ordinal.nadd b c a (b' < b, Ordinal.nadd b' c < a) c' < c, Ordinal.nadd b c' < a
                  theorem Ordinal.blsub_nadd_of_mono (a : Ordinal.{u}) (b : Ordinal.{u}) {f : (c : Ordinal.{u}) → c < Ordinal.nadd a bOrdinal.{max u v} } (hf : ∀ {i j : Ordinal.{u}} (hi : i < Ordinal.nadd a b) (hj : j < Ordinal.nadd a b), i jf i hi f j hj) :
                  Ordinal.blsub (Ordinal.nadd a b) f = max (Ordinal.blsub a fun (a' : Ordinal.{u}) (ha' : a' < a) => f (Ordinal.nadd a' b) ) (Ordinal.blsub b fun (b' : Ordinal.{u}) (hb' : b' < b) => f (Ordinal.nadd a b') )
                  @[simp]
                  @[simp]
                  @[simp]
                  theorem Ordinal.nadd_nat (a : Ordinal.{u}) (n : ) :
                  Ordinal.nadd a n = a + n
                  @[simp]
                  theorem Ordinal.nat_nadd (a : Ordinal.{u}) (n : ) :
                  Ordinal.nadd (n) a = a + n
                  @[simp]
                  theorem NatOrdinal.toOrdinal_cast_nat (n : ) :
                  NatOrdinal.toOrdinal n = n
                  theorem Ordinal.nadd_eq_add (a : Ordinal.{u_1}) (b : Ordinal.{u_1}) :
                  Ordinal.nadd a b = NatOrdinal.toOrdinal (Ordinal.toNatOrdinal a + Ordinal.toNatOrdinal b)
                  @[simp]
                  theorem Ordinal.toNatOrdinal_cast_nat (n : ) :
                  Ordinal.toNatOrdinal n = n

                  Natural multiplication #

                  theorem Ordinal.nmul_def (a : Ordinal.{u_1}) (b : Ordinal.{u_1}) :
                  Ordinal.nmul a b = sInf {c : Ordinal.{u_1} | a' < a, b' < b, Ordinal.nadd (Ordinal.nmul a' b) (Ordinal.nmul a b') < Ordinal.nadd c (Ordinal.nmul a' b')}
                  theorem Ordinal.nmul_nonempty (a : Ordinal.{u}) (b : Ordinal.{u}) :
                  Set.Nonempty {c : Ordinal.{u} | a' < a, b' < b, Ordinal.nadd (Ordinal.nmul a' b) (Ordinal.nmul a b') < Ordinal.nadd c (Ordinal.nmul a' b')}

                  The set in the definition of nmul is nonempty.

                  theorem Ordinal.nmul_nadd_lt {a : Ordinal.{u}} {b : Ordinal.{u}} {a' : Ordinal.{u}} {b' : Ordinal.{u}} (ha : a' < a) (hb : b' < b) :
                  theorem Ordinal.lt_nmul_iff {a : Ordinal.{u}} {b : Ordinal.{u}} {c : Ordinal.{u}} :
                  c < Ordinal.nmul a b ∃ a' < a, ∃ b' < b, Ordinal.nadd c (Ordinal.nmul a' b') Ordinal.nadd (Ordinal.nmul a' b) (Ordinal.nmul a b')
                  theorem Ordinal.nmul_le_iff {a : Ordinal.{u}} {b : Ordinal.{u}} {c : Ordinal.{u}} :
                  Ordinal.nmul a b c a' < a, b' < b, Ordinal.nadd (Ordinal.nmul a' b) (Ordinal.nmul a b') < Ordinal.nadd c (Ordinal.nmul a' b')
                  @[simp]
                  @[simp]
                  theorem Ordinal.nmul_lt_nmul_of_pos_left {a : Ordinal.{u}} {b : Ordinal.{u}} {c : Ordinal.{u}} (h₁ : a < b) (h₂ : 0 < c) :
                  theorem Ordinal.nmul_lt_nmul_of_pos_right {a : Ordinal.{u}} {b : Ordinal.{u}} {c : Ordinal.{u}} (h₁ : a < b) (h₂ : 0 < c) :
                  theorem Ordinal.nmul_eq_mul (a : Ordinal.{u_1}) (b : Ordinal.{u_1}) :
                  Ordinal.nmul a b = NatOrdinal.toOrdinal (Ordinal.toNatOrdinal a * Ordinal.toNatOrdinal b)