โ† back to index

Compositional Game Theory

Ghani, Hedges, Kupke, Forsberg ยท 2018 ยท arxiv arXiv:1603.04641

Prereqs: ๐Ÿž Staton 2025 (composition of programs). 5 min.

wpNash equilibrium is a compositional predicate: if each sub-game is in equilibrium given its context, the whole game is in equilibrium. Games compose like programs.

Open games โ€” games with interfaces

An open game has inputs (what the player observes) and outputs (what the player does), plus a coplay channel that carries consequences back. Think of it as a function with a feedback wire. Games compose by wiring outputs to inputs, the same pattern as sequential composition of programs.

P X Y R observation action coplay
Scheme

Selection functions

A selection function picks the "best" element from a set, given a valuation (how good each element is). It's the decision-making core of an open game. The classic example: argmax picks the action that maximizes utility.

P argmax valuation low, med, high best action X
Scheme

Confidence: Exact. argmax is the canonical selection function from the paper.

Composing games โ€” sequential play

Two open games compose when the first player's action becomes the second player's observation. The composite game's equilibrium condition: each player plays optimally given what they observe.

P1 P2 X X U R P1 ⊗ P2 (simultaneous)
P1 P2 X Y Z R R P1 ; P2 (sequential)
Scheme

Nash equilibrium as a compositional predicate

Here's the punchline. An equilibrium is a predicate on strategy profiles: "no player can improve by deviating" (๐ŸŽฒ what is Nash equilibrium?). Hedges shows this predicate is compositional: if each sub-game satisfies it given its context, the whole game does too. Equilibrium is a postcondition.

P1 P2 D D U 1, 1 deviate to C? 0, 5 โ€” worse for P1 ✓ equilibrium no player improves by deviating = Nash equilibrium
Scheme

Confidence: Simplified. Pure strategies over finite games. The paper works with mixed strategies and continuous action spaces.

Why compositionality matters for games

Classical game theory checks equilibrium over the entire strategy profile at once. Hedges decomposes it: each sub-game checks locally, given its interface. Wire the sub-games together and the local checks compose into a global guarantee.

Firm price Buyer = Firm; Buyer local equilibria compose into global equilibrium
Scheme

Notation reference

Paper Scheme Meaning
ฮต : (X โ†’ R) โ†’ X(argmax actions valuation)Selection function
G : (X, S) โ†’ (Y, R)(make-game name play)Open game
Gโ‚ โŠ— Gโ‚‚(compose-games g1 g2)Sequential composition
NE(ฯƒ)(nash-eq? strategies ...)Nash equilibrium predicate
BR(ฯƒ)(best-response? ...)Best response
Neighbors

Other paper pages

Foundations (Wikipedia)

Translation notes

All examples use pure strategies over finite action spaces. The paper works with mixed strategies, continuous spaces, and open games as morphisms in a wpsymmetric monoidal category with a coplay (contravariant) channel. For example: the Nash equilibrium check on this page iterates over two players with two actions each. In the paper, the same construction applies to a network of open games composed via wpstring diagrams โ€” where equilibrium is verified by checking each node's selection function against the continuation induced by all downstream nodes. The compositionality is identical. The string-diagrammatic machinery is not.

Watch

Bartosz Milewski explains open games and compositional game theory:

Ready for the real thing? arxiv Read the paper. Start at ยง3 for open games, ยง5 for the compositionality theorem.

jkThe Handshake