Documentation

CombinatorialGames.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 simplest extension 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.

Nimber multiplication #

@[implicit_reducible]
noncomputable instance Nimber.instMul :

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
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
@[implicit_reducible]
Equations
@[implicit_reducible]
noncomputable instance Nimber.instCommRing :
Equations
  • One or more equations did not get rendered due to their size.
theorem Nimber.mul_ne_of_ne {a b a' b' : Nimber} (ha : a' a) (hb : b' b) :
a' * b + a * b' + a' * b' a * b
theorem Fin.comp_cons_apply {α : Sort u_1} {β : Sort u_2} {n : } (g : αβ) (a : α) (f : Fin nα) (i : Fin (n + 1)) :
g (cons a f i) = cons (g a) (g f) i
theorem Nimber.pow_le_of_forall_ne {a b : Nimber} {n : } (H : ∀ (f : Fin n(Set.Iio a)), a ^ n + i : Fin n, (a + (f i)) b) :
a ^ n b

Nimber division #

@[implicit_reducible]
noncomputable instance Nimber.instInv :
Equations
@[implicit_reducible]
noncomputable instance Nimber.instField :
Equations
  • One or more equations did not get rendered due to their size.
@[simp]
theorem Nimber.inv_natCast (n : ) :
(↑n)⁻¹ = n
@[simp]
theorem Nimber.inv_intCast (n : ) :
(↑n)⁻¹ = n
theorem Nimber.ratCast_eq_if (q : ) :
q = if Odd q.num Odd q.den then 1 else 0