Sums and comparison

The sum is the object

Real positions come apart into independent regions, and a move happens in exactly one of them. That operation — the disjunctive sum — is what the whole theory is built to survive, and it is the reason values exist at all.
17 min read 7 figures Who moves lastThe sum is the object

Assumes: Who moves last

Late in a game of Go the board is not one position. It is a dozen small independent fights, none of which affects any other, and a move goes into exactly one of them.

That decomposition is not a convenience. It is the structure the entire theory is built around, and the operation that describes it is called the disjunctive sum.

A position is the sum of its parts. Four separate Hackenbush sprigs. A move is a move in one of them, so the position is their disjunctive sum, and its value is the sum of their values. Which part to play in is the entire decision, and the values are what makes it decidable.
Fig. 1 Four independent components and the value of the whole. Each part is evaluated on its own, and the total is their sum — which is the theorem the rest of the subject exists to establish.

The definition

Given games GG and HH, their sum G+HG + H is the game in which a move consists of choosing one component and making a legal move in it, leaving the other untouched.

Formally,

G+H={GL+H,  G+HLGR+H,  G+HR}G + H = \{\, G^L + H,\; G + H^L \mid G^R + H,\; G + H^R \,\}

Left’s options are: move in GG, or move in HH. Same for Right. The components never interact.

Play ends when neither component has a move, so under normal play the loser is whoever faces a sum in which every component is exhausted.

Why this is the operation that matters

Two reasons, and the second is the deeper one.

Real positions decompose. A Go endgame, a Domineering board that has broken into disconnected regions, a Hackenbush picture of several separate drawings, a Nim position of several heaps — all of these are sums, and none of them can be analysed as a single monolith without an explosion in the state space.

A theory of single positions would be worthless. Suppose the only question ever asked were “who wins this position”. The answer would be one of four outcome classes, and it would be a fact about that position and nothing else. It would not compose. Analysing a board of six regions would require analysing the whole board.

What makes analysis possible is a value that composes: an object attached to each component such that the value of the sum is determined by the values of the parts. The requirement is additivity, and everything about game values — the numbers, the nimbers, the infinitesimals, the canonical forms — exists to satisfy it.

Sums come first. Values are what the theory has to invent in order to handle them.

Outcomes do not compose

The immediate evidence that outcome classes are not enough:

+=0\ast + \ast = 0. Two first-player wins summing to a second-player win.

+2=3\ast + \ast 2 = \ast 3. Two first-player wins summing to a first-player win.

Same input classes, different output classes. So no function of outcome classes can predict the outcome of a sum, and the failure is worth its own treatment.

Knowing who wins is not enough. Three pairs of positions, every one of which is in outcome class N on its own. Their sums are not all the same, and not all in the same outcome class — so the outcome of a sum cannot be worked out from the outcomes of its parts, and that is why the theory needs values.
Fig. 2 Three sums whose parts are all in the same outcome class and whose totals are not. The class of a component says nothing about how the component behaves when added to something.

The gap is exactly the gap between “who wins this” and “what is this worth”. The first question is answerable and useless; the second is harder and composes.

A sum, played out

The definition is short and the experience of using it is not, so one sum played move by move is worth the space.

Take G+HG + H where GG is a Nim heap of two and HH is a Nim heap of three. Values 2\ast 2 and 3\ast 3, so the sum is (23)=1\ast(2 \oplus 3) = \ast 1, a first-player win.

Left — impartial games have no sides, so read this as whoever moves first — takes one from the heap of three, leaving 2+2=0\ast 2 + \ast 2 = 0. The opponent now faces a balanced position and every move unbalances it.

Suppose the opponent takes both counters from one heap, leaving 2\ast 2. The reply takes both from the other, leaving 00, and the opponent has no move.

Suppose instead the opponent takes one, leaving 1+2\ast 1 + \ast 2. The reply takes one from the two, leaving 1+1=0\ast 1 + \ast 1 = 0.

Every line ends the same way, and the reason is that after the first move the position is a sum of a game and its own negative — which for impartial games is a sum of two identical heaps — and the mirroring strategy takes over.

What the sum contributed here is that the two heaps never interacted. A move in one left the other exactly as it was, so the analysis of each heap could be done once, in isolation, and combined afterwards. That is the whole economy of the thing.

A position is the sum of its parts. Two separate components, added. A move is a move in exactly one of them, so the position is their disjunctive sum and its value is the sum of their values. The components are of different kinds — the arithmetic does not ask which kind each one is, and that is what having values buys.
Fig. 3 The same two heaps written as what they are worth, with the form each value takes underneath. The total was computed by adding the games rather than the labels, and it comes to ∗ — the exclusive or, which is what additivity looks like when the values happen to be nimbers. Neither heap knows about the other, and neither had to.

The size of what is avoided

The saving is worth quantifying, because it is the reason anybody bothers.

A Domineering board with four disconnected empty regions, each admitting ten positions, has ten thousand joint positions. Analysed as a monolith, the recursion visits all of them, and each visit branches over every move in every region.

Analysed as a sum, each region is evaluated once — forty positions in total — and the four values are added. Four evaluations and three additions replace ten thousand.

The saving is multiplicative in the number of components, which means it is the difference between possible and impossible rather than between slow and fast. A late Go board has twenty or more independent regions, and the product of their state spaces is a number with no physical meaning. The sum of their values is a short calculation.

The regions themselves are usually small enough to have been solved once and for all. A 1 × 2 Domineering region is worth 1-1, since Right has a move there and Left has none; a 2 × 2 is the switch {11}\{1 \mid -1\}, and a 2 × 3 is the switch {212}\{2 \mid -\tfrac12\}. A board that has broken into regions of that size is settled by looking each one up and adding. The catalogue is short because the regions are small, and the regions are small because the game has been played into a state where they are — which is the ordinary shape of an endgame in any of these games.

This is what it means to say the theory is about sums. It is not that sums are an interesting special case; it is that without the decomposition there is no analysis of anything larger than a toy.

Adding a component can change everything

One caution, since additivity can be over-read as saying components are independent in every sense.

The components do not interact during play — a move in one leaves the others untouched. They interact completely in outcome: adding a component to a position can change who wins it, and that is the entire point.

A position worth \uparrow is a Left win. Add a component worth \downarrow and the total is zero, a second-player win. Add \downarrow\downarrow instead and Right wins. Nothing about the first component changed; the answer to “who wins” changed completely.

A position is the sum of its parts. Two separate components, added. A move is a move in exactly one of them, so the position is their disjunctive sum and its value is the sum of their values. The components are of different kinds — the arithmetic does not ask which kind each one is, and that is what having values buys.
Fig. 4 The third of those, added. The first component is a win for Left whoever moves and the second is twice as far the other way, so the total is ↓ and Right wins it whoever moves — an outcome neither component has on its own. The value of the up is unchanged by any of this: what changed is the company it is in.

So a value is a statement about a component’s contribution, never about its fate. Asking “who wins this component” is asking the wrong question of a part — the right question is what it is worth, and the outcome belongs to the whole.

That distinction is exactly what the failure of outcome classes is about, and it is the most common early misreading of the subject.

The group structure

Once sums are the operation, the natural question is what algebraic structure the values form, and the answer is clean.

Associativity and commutativity are immediate from the definition — the components are a bag, and the order of writing them down is nothing.

Zero is the identity. G+0=GG + 0 = G for every GG, where 00 is the empty position. Adding a component with no moves changes nothing, which is exactly what an identity does.

Negation exists. G-G is GG with the players swapped, defined recursively as G={GRGL}-G = \{-G^R \mid -G^L\}, and G+(G)=0G + (-G) = 0 for every GG.

That last identity is the load-bearing one, and its proof is the mirroring argument that runs through everything here. The second player in GGG - G copies each of the first player’s moves into the other component. The position after each of the copier’s moves is of the form XXX - X, which always has a reply available, so the copier never runs out and the first player does.

A position is the sum of its parts. Four separate Hackenbush sprigs. A move is a move in one of them, so the position is their disjunctive sum, and its value is the sum of their values. Which part to play in is the entire decision, and the values are what makes it decidable.
Fig. 5 A sprig and its mirror image, added. Blue over red is worth a half, red over blue is worth minus a half, and the two together are worth exactly nought — computed by adding the games, not by cancelling the labels. Every negation on this site is that picture with the colours exchanged all the way up.

So games under disjunctive sum form an abelian group. The values are the group elements, and equality of games is equality in that group.

The partial order that comes with it

The group structure carries an order, defined in terms of the sum:

GH    GH0    Left wins GH moving secondG \ge H \iff G - H \ge 0 \iff \text{Left wins } G - H \text{ moving second}

That definition is compatible with addition — if GHG \ge H then G+KH+KG + K \ge H + K for every KK — which is what makes it useful. Comparing components is meaningful precisely because the comparison survives being embedded in a larger position.

It is only a partial order, and that is not a defect. Some pairs are confused, meaning neither player wins their difference moving second, and confusion is a real relation with real consequences rather than a failure to decide.

The mirroring strategy in general

The copying argument used above is the most reusable technique in the subject and deserves stating on its own.

If a position contains two components that are negatives of each other, the second player can neutralise both. Whatever the opponent does in one, copy it in the other. This never fails, because the components are mirror images and every move in one has an exact counterpart in the other.

That single idea proves GG=0G - G = 0, proves the two-heap Nim strategy, proves that a symmetric position is a second-player win, and underlies the strategy-stealing arguments used to show a first-player win exists in games like Hex without exhibiting one.

Its limitation is that it proves a position is worth zero without saying anything about a position that is not. Mirroring is a complete answer for symmetric positions and no answer at all otherwise, which is why the rest of the machinery is needed.

What the solver computed

add(g, h) implements the definition literally — Left’s options of the sum are the sums of each component’s Left options with the other component intact — and returns an interned game.

The additivity claims in the figures are computed rather than quoted. For the Hackenbush strings drawn above, each part’s value is computed twice: by the game recursion through canonical, and by reading the string as a binary numeral. The build asserts the two agree, for all 126 strings up to length six, before it will render anything. Then the sum’s value is computed by the recursion and compared against the sum of the parts’ values, computed independently in the arithmetic of dyadic rationals.

Where a component’s value is a nimber, the comparison is against the exclusive-or. Where it is infinitesimal, the comparison is by canonical form. In every case the check is: two independent routes to the same value, asserted equal before the figure is drawn.

The interning matters here more than anywhere. Sums duplicate subpositions enormously — G+HG + H contains GL+HG^L + H and G+HLG + H^L, which share structure — and without interning the recursion recomputes the same games exponentially often. With it, 3+5\ast 3 + \ast 5 evaluates instantly; without it, the first implementation did not finish.

The conventions this sum is not

The disjunctive sum is one of several ways to combine games, and the others are genuinely different.

Conjunctive sum: a move must be made in every component simultaneously, and play ends when any component runs out. This has its own theory, involving a quantity called the remoteness, and it is not the sum on this site.

Selective sum: a move is made in any non-empty subset of components. Also different, also with its own theory.

Short sum, continued sum, and others appear in the literature for particular games.

The disjunctive sum is the one that models a board breaking into independent regions, which is why it is the default and why “sum” without qualification means it. Naming the convention matters: results about one do not transfer to another, and the theory of the disjunctive sum is by far the most developed because it is the one that describes real endgames.

Where the sum lives in real games

It is worth being concrete about the decomposition, because it is the step that connects the theory to a board.

Go. Late in the game the board is a set of independent local fights separated by settled groups. Each is a small game; the whole is their sum. This is the case the theory was extended to handle, and temperature is the tool that came out of it.

Domineering. A partly filled board breaks into disconnected empty regions. Each region is a game; the board is the sum. Small regions can be evaluated exactly, and a board that decomposes into small regions is solved.

Hackenbush. Separate drawings are separate components, and even a single connected drawing often decomposes into stalks with independent values.

Nim. Each heap is a component, and the sum is the whole reason exclusive-or appears.

A position is the sum of its parts. Three separate components, added. A move is a move in exactly one of them, so the position is their disjunctive sum and its value is the sum of their values. The components are of different kinds — the arithmetic does not ask which kind each one is, and that is what having values buys.
Fig. 6 Three components of completely different kinds, added: a Clobber board of three stones, a single green Hackenbush edge, and a number. Their values are ↑, ∗ and 1, and the total is 1↑∗. The arithmetic never asks what game a component came from — that is the whole of what having values buys, and it is why a board and a drawing can appear in one sum.

In each case the theory’s contribution is the same: evaluate the parts, add the values, and never build the product state space.

Who found it, and when

The disjunctive sum in its modern form is Conway’s, but the idea is older in a special case: Bouton’s 1901 analysis of Nim is entirely about a sum of heaps, and the nim-sum is additivity for that game before anybody had the general concept.

Sprague and Grundy in the 1930s made the additivity explicit for impartial games — the Grundy value of a sum is the nim-sum of the values — and that is the first general statement of the pattern.

Conway’s contribution around 1970 was to see that additivity is the requirement, and to build a value system rich enough to satisfy it for partizan games as well. The move from “games have outcomes” to “games have values that add” is the founding move of the subject, and everything on this site is downstream of it.

Where the model stops

The components must be independent. If a move in one region affects another, the position is not a sum and none of this applies. Real Go positions violate this — ko fights and shared liberties couple regions — and the theory applies to endgames precisely because that is where the coupling has ended.

Normal play, throughout. Additivity of values fails under misère play, which is the single fact that makes misère theory hard.

Finite play. Loopy sums need extra machinery.

Additivity is exact, not approximate. The value of a sum is exactly the sum of the values, with no error term. That is why the theory is worth having, and it is also why the values have to be as complicated as they are — a simpler value system would not have survived the requirement.

What has to be true of a game for the sum to apply

The operation is defined for any two games, and applying it to a position carries a hypothesis that is easy to leave unstated. Naming it says which games on this site are inside the theory and which are only near it.

The hypothesis is that the position is the sum: that its legal moves are exactly the legal moves of the parts, that a move in one part leaves the others untouched, and that the game ends when no part has a move. Three things can break it and this site has an example of each.

A rule that consults the whole board. NoGo’s liberties make a placement’s legality depend on stones elsewhere, so two regions that look separate are one game.

A component that cannot state its own moves. A capped heap, an obligation, a spent token — the rule is local and the state is not, and a heap on its own does not know what it may do.

And a boundary that is not there. A Push strip cut at a gap produces one genuine subposition and one new game, because the wall the values are computed against belongs to only one of the halves.

None of the three is detected by looking at the picture, which is why each of them cost a measurement to find. The habit that catches them is to ask, before adding: can each part be handed to somebody who has never seen the other, with the same rules, and produce the same moves? If the answer needs a caveat, the sum is not the object.

And the step that is not a theorem

Everything above is about what follows once a position has been split. The splitting itself is a separate claim.

A boundary drawn, and a boundary there. One Domineering board split two ways. Above, a line imagined down the middle: the two halves are evaluated separately and their sum is not the value of the board, because every horizontal domino that would have crossed the line has been thrown away. Below, the same column blocked out: the halves are then genuinely independent and the sum is exact. Every value is computed from its own board.
Fig. 7 The same squares split two ways: a boundary imagined, and a boundary there. The first loses every domino that would have crossed and the values differ; the second is genuine and the sum is exact. Independence is a claim counts how often the difference is visible and how often it is not.

Where the ladder goes next

disjunctive-sum opens here with the operation the whole theory is built around: a move in exactly one component, and the values add.

Which part to move in takes the first thing the addition does not supply. Knowing every component’s value settles who wins and says nothing about where to play, and that second question has its own answer built out of comparisons rather than out of the total.

Other ways to add sets the disjunctive sum beside the two rivals — move in every component, move in any non-empty set — and argues rather than assumes that values belong to the first. The other two have their own theories and their own numbers, and none of those numbers is a value.

Whether the parts are parts is where the hypothesis fails on a real board: a game whose move rule consults the whole position has regions that look separate and are not, and the addition has nothing to say about them.

And how wrong a nearly independent split is measures what it costs to add anyway. The error is a game rather than a number, which is the only currency in which the answer composes — and the bound on it is a bound on every sum the split appears in rather than on one board’s total.

Read in order they are the operation, the thing it does not do, the operations it is not, the hypothesis it needs, and the price of proceeding without it.

Part 1 of 6

One argument about Disjunctive sum. The parts either side of it:

What links here

Essays that reach for this one mid-argument — the half of a link its own author cannot write down, the 8 sharing most with it of 99.

What this makes readable

Essays that declare this one a prerequisite.

The objects named here

The third axis, after the field and the series: the games, values and theorems themselves, and every essay that touches each one.

AdditivityComparisonDisjunctive sumDomineeringGroupHackenbushIndependenceInfinitesimalNegationNim