Games as recursive coalgebras
Contents
When games are combined, what determines the operation that combines their values and yields the outcome? The aim is to explain how this operation arises from the structure of recursive coalgebras. The guiding example is Nim, where bitwise XOR combines the values of the heaps and determines who wins.
Impartial games, the games in which both players have the same moves, are recursive coalgebras, "graphs on which we can conduct recursive calculations", and the nim-sum is the Bouton monoid of the Conway addition and the outcome [Hor25].
1. Idea§
Nim and the nim-sum§
In Nim with $n$ heaps, a position is an $n$-tuple $(a_1,\dots,a_n)$ of natural numbers, the numbers of stones in the heaps. Two players move in turn. A move removes at least one stone from exactly one heap, and the player who cannot move loses. The nim-sum $a\oplus b$ of two natural numbers is the bitwise exclusive or of their binary expansions. For example, $3\oplus 5=6$:
Fact 1.1 (Bouton's theorem [Bou01])§
A position $(a_1,\dots,a_n)$ of Nim is winning for the player who has just moved to it if and only if $a_1\oplus\dots\oplus a_n=0$.
See Hor25, Theorem 2.9.
The dictionary§
It is not hard to check that the strategy of Bouton's theorem wins. The question is why it works with this operation. To answer it, the project translates the notions of combinatorial game theory into the theory of coalgebras (Table 1):
Games and game values§
A game is a recursive coalgebra of the finite powerset functor $\mathcal P_{\mathrm{fin}}$, and a game morphism is a coalgebra homomorphism. Quantities such as the outcome and the Grundy number are game values: they are computed by recursion along the moves, and the recursion step is an algebra of $\mathcal P_{\mathrm{fin}}$. Every game value factors through the terminal game.
Game sums§
Nim with $n$ heaps is the Conway addition of $n$ copies of Nim with one heap, and the Grundy number of a Conway addition of two games is the nim-sum of their Grundy numbers [Sie13]. A position is winning for the player who has just moved to it exactly when its Grundy number is $0$, and the Grundy number of the position $n$ of one-heap Nim is $n$. Bouton's theorem follows [Hor25, Example 2.18]. Game sums such as the Conway addition are monoidal structures on the category of games. For a game sum and a game value $v$, the Bouton monoid is the smallest monoid $B$ with a game value in $B$ that determines $v$ and that sends a sum of games to a product in $B$. For the Conway addition and the outcome, it is the natural numbers with the nim-sum, and the game value in $B$ is the Grundy number.
The category of games§
The category of games is locally finitely presentable, symmetric monoidal closed for the Conway addition and comonadic over $\mathbf{Set}$, and it has a subobject classifier. See Games, FinGames, Cofree game and Game topos.
2. Open questions§
Further open problems on the category of games are on Games.
Question 2.1 (Differential structure)§
The nim-sum $\oplus$ and the mex satisfy a Rota–Baxter equation,
for finite sets $S,T\subseteq\mathbb N$, with $S\oplus n=n\oplus S=\{s\oplus n\mid s\in S\}$. It reflects a Leibniz rule for the Conway addition. How does this "differential structure" appear in the formulation, especially for Bouton monoids of the Conway addition?
Question 2.2 (Partisan games)§
To what extent is the theory of partisan games captured by replacing $\mathcal P_{\mathrm{fin}}$ with $\mathcal P_{\mathrm{fin}}\times\mathcal P_{\mathrm{fin}}$?
See Question 5.3.
Question 2.3 (Circular nim)§
What is the Bouton monoid of the Grundy number with respect to the selective sum? Is it just the miniature monoid of the selective sum? This bears on the open winning strategy of circular nim $\mathrm{CN}(6,2)$.
See Question 5.8.
Remark 2.4 (Circular nim)§
In circular nim $\mathrm{CN}(n,k)$, there are $n$ heaps on a circle, and a move removes at least one stone in total from $k$ consecutive heaps. The winning strategy of $\mathrm{CN}(6,2)$ is open [DH13]. Let $N$ be one-heap Nim, $\otimes$ the Conway addition and $\vee$ the selective sum. Then $\mathrm{CN}(6,2)$ contains $N\otimes(N\vee(N\otimes N))$ as a subgame. To the best of the author's knowledge, the winning strategy of this subgame is also open [Hor25, §5.4.2].
See §5.4.2.
3. Pages§
4. Related concepts§
5. References§
- [Hor25] Ryuya Hora, Games as recursive coalgebras: A categorical view on the Nim-sum, arXiv:2510.22886v3.
- [Bou01] Charles L. Bouton, Nim, a game with a complete mathematical theory, Annals of Mathematics 3 (1901–1902), 35–39.
- [Sie13] Aaron N. Siegel, Combinatorial Game Theory, Graduate Studies in Mathematics 146, American Mathematical Society (2013). The nim-sum rule is cited from it as Theorem 2.17 of Hora's paper.
- [DH13] Matthieu Dufour and Silvia Heubach, Circular Nim games, Electronic Journal of Combinatorics 20 (2013), no. 2, P22.