Documentation

LeanPool.MisereGames.Mathlib.NatOrdinal

Misere combinatorial games.

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

Ordinals equipped with natural arithmetic.

Equations
Instances For
    @[implicit_reducible]
    Equations
    • One or more equations did not get rendered due to their size.
    def MisereGames.NatOrdinal.type {α : Type u} (r : ααProp) [wo : IsWellOrder α r] :

    The natural ordinal represented by a well-order.

    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 MisereGames.NatOrdinal.inductionOn {C : NatOrdinalProp} (o : NatOrdinal) (H : ∀ (α : Type u_1) (r : ααProp) [inst : IsWellOrder α r], C (type r)) :
      C o
      def MisereGames.NatOrdinal.typein {α : Type u} (r : ααProp) [IsWellOrder α r] :
      PrincipalSeg r fun (x1 x2 : NatOrdinal) => x1 < x2

      The initial segment of NatOrdinal below the order type of r.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        noncomputable def MisereGames.NatOrdinal.enum {α : Type u} (r : ααProp) [IsWellOrder α r] :
        (fun (x1 x2 : (Set.Iio (type r))) => x1 < x2) ≃r r

        Enumerate the ordinals below a given order type by the original well-order.

        Equations
        Instances For
          @[simp]
          theorem MisereGames.NatOrdinal.enum_symm_apply_coe {α : Type u} (r : ααProp) [IsWellOrder α r] (a✝ : α) :
          ((enum r).symm a✝) = (typein r).toRelEmbedding a✝
          theorem MisereGames.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 MisereGames.NatOrdinal.type_eq_zero_of_empty {α : Type u_1} (r : ααProp) [IsWellOrder α r] [IsEmpty α] :
          type r = 0
          @[simp]
          theorem MisereGames.NatOrdinal.type_eq_zero_iff_isEmpty {α : Type u} {r : ααProp} [IsWellOrder α r] :
          type r = 0 IsEmpty α
          theorem MisereGames.NatOrdinal.type_ne_zero_of_nonempty {α : Type u} (r : ααProp) [IsWellOrder α r] [h : Nonempty α] :
          type r 0
          @[match_pattern]

          The order isomorphism from ordinals to NatOrdinal.

          Equations
          Instances For
            @[match_pattern]

            The order isomorphism from NatOrdinal to ordinals.

            Equations
            Instances For
              @[implicit_reducible]
              Equations
              • One or more equations did not get rendered due to their size.
              def MisereGames.NatOrdinal.ind {motive : NatOrdinalSort u_1} (mk : (a : Ordinal.{u_2}) → motive (of a)) (a : NatOrdinal) :
              motive a

              Recursor through the underlying ordinal representation.

              Equations
              Instances For
                theorem MisereGames.NatOrdinal.induction {p : NatOrdinalProp} (i : NatOrdinal) :
                (∀ (j : NatOrdinal), (∀ k < j, p k)p j)p i
                @[implicit_reducible]
                Equations
                • One or more equations did not get rendered due to their size.
                theorem MisereGames.NatOrdinal.eq_natCast_of_le_natCast {a : NatOrdinal} {b : } (h : a of b) :
                ∃ (c : ), a = of c
                theorem MisereGames.NatOrdinal.le_iSup {ι : Type u_1} (f : ιNatOrdinal) [Small.{u, u_1} ι] (i : ι) :
                f i iSup f
                theorem MisereGames.NatOrdinal.iSup_le_iff {ι : Type u_1} {f : ιNatOrdinal} {a : NatOrdinal} [Small.{u, u_1} ι] :
                ⨆ (i : ι), f i a ∀ (i : ι), f i a
                theorem MisereGames.NatOrdinal.lt_iSup_iff {ι : Type u_1} [Small.{u, u_1} ι] (f : ιNatOrdinal) {x : NatOrdinal} :
                x < ⨆ (i : ι), f i ∃ (i : ι), x < f i
                theorem MisereGames.NatOrdinal.iSup_eq_zero_iff {ι : Type u_1} [Small.{u, u_1} ι] {f : ιNatOrdinal} :
                ⨆ (i : ι), f i = 0 ∀ (i : ι), f i = 0

                Natural addition #

                @[implicit_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
                • One or more equations did not get rendered due to their size.
                Instances For
                  theorem MisereGames.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 MisereGames.NatOrdinal.lt_add_iff {a b c : NatOrdinal} :
                  a < b + c (∃ b' < b, a b' + c) c' < c, a b + c'
                  theorem MisereGames.NatOrdinal.add_le_iff {a b c : NatOrdinal} :
                  b + c a (∀ b' < b, b' + c < a) c' < c, b + c' < a
                  @[implicit_reducible]
                  Equations
                  • One or more equations did not get rendered due to their size.
                  @[simp]
                  @[implicit_reducible]
                  Equations
                  • One or more equations did not get rendered due to their size.
                  @[simp]
                  theorem MisereGames.NatOrdinal.of_natCast (n : ) :
                  of n = n
                  @[simp]
                  theorem MisereGames.NatOrdinal.val_natCast (n : ) :
                  val n = n
                  @[simp]
                  theorem MisereGames.NatOrdinal.forall_lt_natCast {P : NatOrdinalProp} {n : } :
                  (∀ a < n, P a) a < n, P a
                  @[simp]
                  theorem MisereGames.NatOrdinal.exists_lt_natCast {P : NatOrdinalProp} {n : } :
                  (∃ a < n, P a) a < n, P a
                  @[simp]
                  theorem MisereGames.NatOrdinal.of_add_natCast (a : Ordinal.{u_1}) (n : ) :
                  of (a + n) = of a + n
                  @[simp]
                  theorem MisereGames.NatOrdinal.val_add_natCast (a : NatOrdinal) (n : ) :
                  val (a + n) = val a + n

                  A version of oadd_le_add stated in terms of Ordinal.