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 (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
    theorem Nimber.mul_one (a : Nimber) :
    a * 1 = a
    Equations
    • One or more equations did not get rendered due to their size.

    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 : NimberProp} (a : Nimber) (h0 : p 0) (hi : a' < a, a' 0∀ (b : Nimber), p bp (a'.invAux * (1 + (a + a') * b))) (x : Nimber) (hx : x a.invSet) :
        p x

        A recursion principle for invSet.

        theorem Nimber.invAux_mem_invSet_of_lt {a b : Nimber} (ha : a 0) (hb : a < b) :
        theorem Nimber.mul_invAux_cancel {a : Nimber} (h : a 0) :
        a * a.invAux = 1
        Equations
        theorem Nimber.inv_eq_invAux {a : Nimber} (ha : a 0) :
        Equations
        • One or more equations did not get rendered due to their size.