duaLab Contribute

Cofree game

Project: Games as recursive coalgebras

Contents

The cofree game on a set $\Lambda$ is the value at $\Lambda$ of the right adjoint of the forgetful functor from Games to sets: a game morphism from a game to the cofree game is the same as a labeling of the positions of the game by elements of $\Lambda$. Its positions are the $\Lambda$-labeled hereditarily finite sets. Every limit of games is a subgame of a cofree game.

1. Definition

Write $\mathcal{P}_{\mathrm{fin}}(X)$ for the set of finite subsets of a set $X$. The right adjoint exists for a general reason, and the cofree game is defined as its value. The explicit description then computes it.

Definition 1.1 (Forgetful functor)

The forgetful functor $U:\mathbf{Games}\to\mathbf{Set}$ takes a game $(X,\theta)$ to its set $X$ of positions.

Definition 1.2 (Subgame)

A subgame of a game $(X,\theta)$ is a subset $S\subseteq X$ with $\theta(x)\subseteq S$ for all $x\in S$. In words, a subgame is a set of positions that contains every option of its elements.

See Definition B.3.

Proposition 1.3 (Right adjoint)★

$U$ has a right adjoint $R:\mathbf{Set}\to\mathbf{Games}$. See Corollary B.12.

Proof

Games is locally finitely presentable, and $U$ preserves small colimits by Lemma B.2. Apply the adjoint functor theorem for locally presentable categories.

Definition 1.4 (Cofree game)

The cofree games functor is the right adjoint $R$ of $U$. The cofree game on a set $\Lambda$ is $R(\Lambda)$, with counit $\epsilon_\Lambda:UR(\Lambda)\to\Lambda$. For a game $(X,\theta)$, each function $\sigma:X\to\Lambda$ is $\epsilon_\Lambda\circ\sigma^\flat$ for a unique game morphism $\sigma^\flat:X\to R(\Lambda)$, its transpose.

X \arrow[r, dashed, "\sigma^\flat"] \arrow[dr, "\sigma"'] & UR(\Lambda) \arrow[d, "\epsilon_\Lambda"] \\ & \Lambda

See §B.2.

Definition 1.5 (Labeled hereditarily finite sets)

For a set $\Lambda$, a $\Lambda$-labeled hereditarily finite set is a pair $(S,\lambda)$ of a finite set $S$ of $\Lambda$-labeled hereditarily finite sets and a label $\lambda\in\Lambda$. Their set is

$$ \mathbb{H}_\Lambda=\bigcup_{n\ge 0}\mathbb{H}_{\Lambda,n},\qquad \mathbb{H}_{\Lambda,0}=\varnothing,\quad \mathbb{H}_{\Lambda,n+1}=\mathcal{P}_{\mathrm{fin}}(\mathbb{H}_{\Lambda,n})\times\Lambda. $$

In words, a hereditarily finite set is written with finitely many braces, and a $\Lambda$-labeled one is written with finitely many braces that each carry a label.

See Definition B.13.

Proposition 1.6 (Explicit description)☆

The cofree game $R(\Lambda)$ has positions $\mathbb{H}_\Lambda$ and structure map $\theta_\Lambda(S,\lambda)=S$; a move from $(S,\lambda)$ goes to an element of $S$. The counit $\epsilon_\Lambda$ sends $(S,\lambda)$ to its label $\lambda$.

Proof

$\mathbb{H}_\Lambda$ is the colimit of the chain in the colimit description. See §B.2 and Proposition B.14.

Remark 1.7 (Transposes)

For a game $(X,\theta)$ and a function $\sigma:X\to\Lambda$, the transpose is given recursively by

$$ \sigma^\flat(x)=\bigl(\{\sigma^\flat(u)\mid u\in\theta(x)\},\ \sigma(x)\bigr). $$

In words, $\sigma^\flat(x)$ records the label of $x$ and the transposes of its options. The formula says that the following square commutes.

[column sep=huge] X \arrow[r, "{\langle\theta,\sigma\rangle}"] \arrow[d, "\sigma^\flat"'] & \mathcal{P}_{\mathrm{fin}}(X)\times\Lambda \arrow[d, "\mathcal{P}_{\mathrm{fin}}(\sigma^\flat)\times\mathrm{id}"] \\ \mathbb{H}_\Lambda \arrow[r, "{\langle\theta_\Lambda,\epsilon_\Lambda\rangle}"'] & \mathcal{P}_{\mathrm{fin}}(\mathbb{H}_\Lambda)\times\Lambda

See §B.2.

2. Examples

The first two examples show the positions of a cofree game for one label and for three labels. The third example uses two labels to encode subsets, and leads to the subobject classifier.

Example 2.1 (One label)

For a one-element set of labels, the cofree game is the terminal game of hereditarily finite sets. See §B.2.

Example 2.2 (Three labels)

Write $\{\ldots\}_\lambda$ for $(\{\ldots\},\lambda)$. For $\Lambda=\{r,g,b\}$, a typical element of $\mathbb{H}_\Lambda$ is

$$ \bigl\{\{\}_g,\ \{\{\{\}_r,\{\}_g,\{\}_b\}_r,\ \{\{\{\}_r\}_b\}_g\}_b\bigr\}_g. $$

The positions that are reached from this element in the cofree game are drawn below. Each position is marked with its label, and an arrow goes from a labeled set to one of its elements.

g \arrow[dddd] \arrow[dr] & & \\ & b \arrow[d] \arrow[dr] & \\ & r \arrow[ddl] \arrow[dd] \arrow[ddr] & g \arrow[d] \\ & & b \arrow[d] \\ g & b & r

See §B.2; there the labels are drawn as colors.

Example 2.3 (Truth values)

For $\Lambda=\{\top,\bot\}$, a subset $S\subseteq X$ of a game $(X,\theta)$ corresponds to the transpose $\chi_S:X\to R(\{\top,\bot\})$ of its characteristic function: the position $\chi_S(x)$ is labeled $\top$ exactly when $x\in S$. The truth-closed elements give the subobject classifier.

See §B.5.

3. Properties

The cofree game is the terminal recursive coalgebra of the functor $\mathcal{P}_{\mathrm{fin}}(-)\times\Lambda$, and this gives its explicit description. The rest of the section contains the subobject classifier of games, which is a subgame of a cofree game, and the statement on limits.

Lemma 3.1 (Recursive labeled coalgebras)☆

A $\mathcal{P}_{\mathrm{fin}}(-)\times\Lambda$-coalgebra $\langle\theta,\sigma\rangle:X\to\mathcal{P}_{\mathrm{fin}}(X)\times\Lambda$ is recursive if and only if $(X,\theta)$ is a game.

Proof

This is checked directly.

Proposition 3.2 (Terminal recursive coalgebra)☆

The coalgebra $\langle\theta_\Lambda,\epsilon_\Lambda\rangle$ on $UR(\Lambda)$ is the terminal recursive $\mathcal{P}_{\mathrm{fin}}(-)\times\Lambda$-coalgebra.

Proof

For a recursive $\langle\theta,\sigma\rangle$, the transpose $\sigma^\flat$ is the unique coalgebra homomorphism into $\langle\theta_\Lambda,\epsilon_\Lambda\rangle$, which is recursive by the lemma. See §B.2.

Corollary 3.3 (Colimit description)☆

The set $UR(\Lambda)$ of positions of the cofree game is the colimit of

$$ \varnothing\to\mathcal{P}_{\mathrm{fin}}(\varnothing)\times\Lambda\to\mathcal{P}_{\mathrm{fin}}(\mathcal{P}_{\mathrm{fin}}(\varnothing)\times\Lambda)\times\Lambda\to\cdots. $$

Proof

The terminal recursive coalgebra is the initial algebra (Proposition 3.7; Capretta–Uustalu–Vene, Proposition 2), given by Adámek's construction. See §B.2.

Definition 3.4 (Truth-closed element)

An element $(T,\lambda)\in\mathbb{H}_{\{\top,\bot\}}$ is truth-closed if every element of $T$ is truth-closed, and is labeled $\top$ whenever $\lambda=\top$. In words, no brace labeled $\bot$ lies inside a brace labeled $\top$. For example, $\{\}_\top$ and $\{\}_\bot$ are truth-closed, and $\{\{\}_\bot\}_\top$ is not.

See Definition B.24.

Proposition 3.5 (Subobject classifier)☆

The truth-closed elements form the subobject classifier $\Omega$ of Games, a subgame of $R(\{\top,\bot\})$. Explicitly, a subset $S$ of a game $X$ is a subgame if and only if every value of $\chi_S:X\to R(\{\top,\bot\})$ is truth-closed.

See Proposition B.26.

Proposition 3.6 (Limits)☆

For a small diagram $F:J\to\mathbf{Games}$, the limit $\lim F$ is a subgame of $R(\lim UF)$, the cofree game on the limit of the underlying sets.

Proof

Since $U$ is faithful, naturally in a game $X$,

$$ \mathbf{Games}(X,\lim F)\cong\mathrm{Cone}(X,F)\subseteq\mathrm{Cone}(UX,UF)\cong\mathbf{Set}(UX,\lim UF)\cong\mathbf{Games}(X,R(\lim UF)). $$

By the Yoneda lemma, this is composition with a monomorphism $\lim F\to R(\lim UF)$. Monomorphisms of games are subgame inclusions by Proposition B.18. See §B.3.4.

Remark 3.7 (Computing limits)

The functor $U$ does not preserve limits, and this description does not say which subgame is the limit. Even the products of the stars involve Stirling numbers of the second kind. See §B.3.4. FinGames uses the description for its finite limits.

Example 3.8 (Stars)

For $n\geq1$, the star $\mathbb{S}_n$ is the game with a root whose options are $n$ positions without options. The star $\mathbb{S}_3$ is drawn below.

& \bullet \arrow[dl] \arrow[d] \arrow[dr] & \\ \bullet & \bullet & \bullet

A game morphism $\mathbb{S}_n\to\mathbb{S}_k$ is a surjection from the $n$ options onto the $k$ options. So there are $k!\,S(n,k)$ of them, with $S(n,k)$ a Stirling number of the second kind. A game morphism to a product is a pair of game morphisms, and the product $\mathbb{S}_2\times\mathbb{S}_3$ reflects the identity

$$2!\,S(n,2)\cdot 3!\,S(n,3)=6!\,S(n,6)+6\cdot5!\,S(n,5)+12\cdot4!\,S(n,4)+6\cdot3!\,S(n,3).$$

See §B.3.4 and Figure 16.

5. References

Last edited