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
        theorem NatOrdinal.lt_wf :
        WellFounded fun (x x_1 : NatOrdinal) => x < x_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.

          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.nadd a' b < Ordinal.nadd a b)) (Ordinal.blsub b fun (b' : Ordinal.{u}) (hb' : b' < b) => f (Ordinal.nadd a b') (_ : Ordinal.nadd a b' < 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
                  instance NatOrdinal.add_covariantClass_lt :
                  CovariantClass NatOrdinal NatOrdinal (fun (x x_1 : NatOrdinal) => x + x_1) fun (x x_1 : NatOrdinal) => x < x_1
                  Equations
                  instance NatOrdinal.add_covariantClass_le :
                  CovariantClass NatOrdinal NatOrdinal (fun (x x_1 : NatOrdinal) => x + x_1) fun (x x_1 : NatOrdinal) => x x_1
                  Equations
                  Equations

                  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) :