Nimbers #
The goal of this file is to define the nimbers, constructed as ordinals endowed with new
arithmetical operations. The nim sum a + b is recursively defined as the least ordinal not equal
to any a' + b or a + b' for a' < a and b' < b. There is also a nim product, defined in the
CombinatorialGames.Nimber.Field file.
Nim arithmetic arises within the context of impartial games. By the Sprague-Grundy theorem, each
impartial game is equivalent to some game of nim. If x ≈ nim o₁ and y ≈ nim o₂, then
x + y ≈ nim (o₁ + o₂) and x * y ≈ nim (o₁ * o₂), where the ordinals are summed or multiplied
together as nimbers.
Notation #
Following [On Numbers And Games][conway2001] (p. 121), we define notation ∗o for the cast from
Ordinal to Nimber. Note that for general n : ℕ, ∗n is not the same as ↑n. For
instance, ∗2 ≠ 0, whereas ↑2 = ↑1 + ↑1 = 0.
Implementation notes #
The nimbers inherit the order from the ordinals - this makes working with minimum excluded values much more convenient. However, the fact that nimbers are of characteristic 2 prevents the order from interacting with the arithmetic in any nice way.
To reduce API duplication, we opt not to implement operations on Nimber on Ordinal. The order
isomorphisms Nimber.of and Nimber.val allow us to cast between them whenever needed.
Equations
Equations
Equations
Equations
A recursor for Nimber. Use as induction x.
Equations
- Nimber.ind mk a✝ = mk (Nimber.val a✝)
Instances For
The identity function between Ordinal._@.CombinatorialGames.Nimber.Basic.3967026805._hygCtx._hyg.3 and Nimber.
Equations
Instances For
The identity function between Nimber and Ordinal._@.CombinatorialGames.Nimber.Basic.3967026805._hygCtx._hyg.3.
Equations
Instances For
The identity function between Ordinal._@.CombinatorialGames.Nimber.Basic.3967026805._hygCtx._hyg.3 and Nimber.
Conventions for notations in identifiers:
- The recommended spelling of
∗in identifiers isof.
Equations
- Nimber.«term∗_» = Lean.ParserDescr.node `Nimber.«term∗_» 75 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol "∗") (Lean.ParserDescr.cat `term 75))
Instances For
Nimber addition #
Nimber addition is recursively defined so that a + b is the smallest nimber not equal to
a' + b or a + b' for a' < a and b' < b.
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.