Documentation

Mathlib.SetTheory.Nimber.Field

Nimber multiplication and division #

The nim product a * b is recursively defined as the least nimber not equal to any a' * b + a * b' + a' * b' for a' < a and b' < b. When endowed with this operation, the nimbers form a field.

It's possible to show the existence of the nimber inverse implicitly via the simplicity theorem. Instead, we employ the explicit formula given in [On Numbers And Games][conway2001] (p. 56), which uses mutual induction and mimics the definition for the surreal inverse. This definition invAux "accidentally" gives the inverse of 0 as 1, which the real inverse corrects.

Todo #

Nimber multiplication #

@[irreducible]
def Nimber.mul (a b : Nimber) :

Nimber multiplication is recursively defined so that a * b is the smallest nimber not equal to a' * b + a * b' + a' * b' for a' < a and b' < b.

Equations
    Instances For
      theorem Nimber.mul_def (a b : Nimber) :
      a * b = sInf {x : Nimber | โˆƒ a' < a, โˆƒ b' < b, a' * b + a * b' + a' * b' = x}แถœ
      theorem Nimber.exists_of_lt_mul {a b c : Nimber} (h : c < a * b) :
      โˆƒ a' < a, โˆƒ b' < b, a' * b + a * b' + a' * b' = c
      theorem Nimber.mul_le_of_forall_ne {a b c : Nimber} (h : โˆ€ a' < a, โˆ€ b' < b, a' * b + a * b' + a' * b' โ‰  c) :
      a * b โ‰ค c
      @[irreducible]
      theorem Nimber.mul_comm (a b : Nimber) :
      a * b = b * a
      @[irreducible]
      theorem Nimber.mul_add (a b c : Nimber) :
      a * (b + c) = a * b + a * c
      theorem Nimber.add_mul (a b c : Nimber) :
      (a + b) * c = a * c + b * c
      @[irreducible]
      theorem Nimber.mul_assoc (a b c : Nimber) :
      a * b * c = a * (b * c)
      @[irreducible]
      theorem Nimber.one_mul (a : Nimber) :
      1 * a = a

      Nimber division #

      @[irreducible]

      The nimber inverse aโปยน is mutually recursively defined as the smallest nimber not in the set s = invSet a, which itself is defined as the smallest set with 0 โˆˆ s and (1 + (a + a') * b) / a' โˆˆ s for 0 < a' < a and b โˆˆ s.

      This preliminary definition "accidentally" satisfies invAux 0 = 1, which the real inverse corrects. The lemma inv_eq_invAux can be used to transfer between the two.

      Equations
        Instances For
          @[irreducible]

          The set in the definition of invAux a.

          Equations
            Instances For
              theorem Nimber.cons_mem_invSet {a b a' : Nimber} (haโ‚€ : a' โ‰  0) (ha : a' < a) (hb : b โˆˆ a.invSet) :
              a'.invAux * (1 + (a + a') * b) โˆˆ a.invSet

              "cons" is our operation (1 + (a + a') * b) / a' in the definition of the inverse.

              theorem Nimber.invSet_recOn {p : Nimber โ†’ Prop} (a : Nimber) (h0 : p 0) (hi : โˆ€ a' < a, a' โ‰  0 โ†’ โˆ€ (b : Nimber), p b โ†’ p (a'.invAux * (1 + (a + a') * b))) (x : Nimber) (hx : x โˆˆ a.invSet) :
              p x

              A recursion principle for invSet.