Temperature

Cooling

Charge a tax on every move and a fight becomes a number. The height of tax at which that happens is the temperature — so cooling is not a technique for finding the temperature, it is what the temperature is.

A switch is a position both players want to move in, and the amount they want it is the temperature. That is a definition by description, and descriptions are unsatisfying: it says what the number means without saying how to get it.

Here is an operation that produces it. Charge both players a tax for the privilege of moving — the same amount, every move, throughout the position — and watch what the tax does.

Cooling {5 | 1}, one degree at a timeThe same position under a rising tax on moving. Each bar is what Left gets moving first and what Right gets moving first, once every move costs the tax. The bars close as the tax rises, and at the temperature they meet — and from there on the position is worth its mean value and neither player wants to touch it.mean 3tax 0gap 4tax 1/2gap 3tax 1gap 2tax 3/2gap 1tax 2frozen — a numbertax 5/2frozen — a numbervaluethe walls meet at a tax of 2, which is the temperatureheating a number by t makes a switch of temperature t, and cooling it by t gives the number back
Fig. 1 The same position under a rising tax. Each bar spans what Left gets moving first and what Right gets moving first, once every move costs the amount on the left. As the tax rises the two close on each other, and above a certain height they have met and the position has stopped being a fight.

What a tax does

Take {51}\{5 \mid 1\}, worth 33 on average with 22 at stake.

With no tax, Left moving first gets 55 and Right moving first holds it to 11. The two scores are four apart, and that gap is what makes it worth fighting over.

Charge a tax of 11 per move. Left still moves to the option worth 55 but pays a unit for the move, so Left’s score is 44; Right’s is 22. The gap has closed to two.

Charge a tax of 22. Left’s score is 33 and Right’s is 33. The gap has closed entirely, and neither player gains anything by moving — moving costs exactly what it wins.

Charge a tax of 33 and the gap does not go negative. Once the tax exceeds what is at stake, nobody moves voluntarily, and the position sits at its mean value permanently — which is to say it has become a number, and nobody moves in numbers.

tax 0:[1,5]tax 1:[2,4]tax 2:[3,3]tax 3:[3,3].\text{tax } 0: [1,5] \qquad \text{tax } 1: [2,4] \qquad \text{tax } 2: [3,3] \qquad \text{tax } 3: [3,3].

The tax at which the two scores meet is 22, which is the temperature, and the value they meet at is 33, which is the mean. Both numbers came out of the operation rather than being put into it.

Cooling is the thermograph, read across

The two scores at each tax level are the two walls of the thermograph, and this is not a coincidence — it is what a thermograph is.

The thermograph of {5 | 1}Temperature runs up the page and value across it. Each wall is where a player is willing to move once a tax of that much is charged per move; above the temperature at which they meet, neither wants to move and the position is worth its mean value. The height of the meeting point is what is at stake.012345601234valuetemperaturetemperature 2mean 3Left's wallRight's wall{5 | 1} — mean 3, temperature 2
Fig. 2 The same information as a diagram. Temperature runs up the page, value across it, and each wall traces one player’s score as the tax rises. The point where they meet is the temperature and the mean, and every horizontal slice of this diagram is one row of the strip above.

A thermograph is usually introduced as a picture of a position and cooling as an operation on positions, with the connection stated afterwards. That order gets the logic backwards. Cooling by tt is reading the thermograph at height tt, and the diagram is a plot of the cooling operation against its own parameter.

The consequence worth carrying is that cooling needs no machinery of its own. The recursion that computes a thermograph — take each option’s thermograph, shift it inward by the tax, take the extreme — is the same recursion that computes cooling, run once and read many times.

Heating, and the round trip

The operation has an inverse, and it is worth having because it is the direction in which a check can be made.

Heating a game by tt pays a bonus of tt for moving instead of charging a tax. Applied to a number xx — a position where nobody wants to move at all — it manufactures a fight:

x heated by t  =  {x+txt}.x \text{ heated by } t \;=\; \{\, x+t \mid x-t \,\}.

Left may take x+tx+t, Right may hold it to xtx-t, both want to, and the resulting switch has mean xx and temperature tt by construction.

Cool that switch by tt and xx comes back. That round trip is the check the site’s gate runs on every build: heat a number by an amount, cool the result by the same amount, and require both scores to equal the original number exactly and the temperature to equal the original tax exactly.

The two directions have nothing in common computationally. Heating builds a position from two arithmetic expressions; cooling runs a recursion over piecewise-linear walls and solves for an intersection. Getting the original number back is a coincidence only if something is wrong.

A switch, its mean and its temperaturePositions of the form {a | b} with a above b: both players want to move there, so neither is settled. The bar spans the two options, the marked point is the mean the position is worth once the fighting is over, and the temperature is half the gap — which is exactly what moving first is worth.-206{2 | -2}mean 0t = 2{4 | 0}mean 2t = 2{3 | 3}mean 3t = 0{1 | -1}mean 0t = 1{6 | 2}mean 4t = 2valuethe mean is the midpoint of the two options, and the temperature is half the distance between thema switch is worth nothing on average and everything to whoever moves in it
Fig. 3 Five positions with their means and temperatures. Three are switches — heated numbers, and the heating is visible as the width of the bar. One is a number, worth exactly itself with nothing at stake, which is what heating by zero produces and what cooling far enough always produces.

Where cooling stops being reversible

Heating then cooling gets the number back. Cooling then heating does not always get the position back, and the failure is instructive.

Cooling a position by its full temperature collapses it to its mean, which is a number. Heating that number by the same amount produces a simple switch — two straight walls, symmetric about the mean. If the original position had a thermograph with a bend in it, the bend is gone and cannot be recovered.

What a deeper position does to the shapeTwo thermographs. The first is a simple switch and its walls are straight; the second has an option that is itself a fight, and the wall bends where that inner fight cools out. Every bend in a thermograph is a decision changing hands.24012345{4 | 0}temperature 2 · mean 224012345{4 | {2|0}}temperature 3/2 · mean 5/2
Fig. 4 Two positions with the same kind of summary and different shapes. The left-hand one is a simple switch and its walls are straight. The right-hand one has an option that is itself a fight, and its wall bends where that inner fight cools out. Both have a mean and a temperature; only one is recoverable from them.

So the pair of numbers is a lossy summary, and cooling is the operation that performs the loss. That is not a defect — it is what a summary is for — but it means that a position cannot be replaced by its mean and temperature in general, only in the accounting where those are all that matter. Two positions may be interchangeable everywhere and that is a much stronger relation than sharing a summary.

The place this bites hardest is a position with several bends, where the temperature reports only the highest one. A component with temperature 44 and a secondary crossing at 11 behaves like a temperature-44 fight at first and like a temperature-11 fight afterwards, and a player who cooled it once and wrote down two numbers has thrown away the second act.

What the tax is a model of

A tax nobody pays is a strange thing to build a theory on, and it is worth saying what it stands in for, because the answer explains why the number it produces is useful.

The tax is a model of the rest of the board. A player deciding whether to take a fight worth two points is not choosing between taking it and doing nothing; they are choosing between taking it and taking something else. The cost of moving here is the value of the best move available elsewhere, and that is a real quantity even though no rule mentions it.

Cooling makes that opportunity cost a parameter and sweeps it. At tax tt, the position’s scores are what they would be if every other move on the board were worth tt. The temperature is the level of competition at which this component stops being worth taking — which is exactly the question a player asks about it.

That reading also explains why the temperature is a ranking device rather than a valuation. Two components are compared by asking which stays worth taking under a higher tax, and the one that does is the one to play in. Nothing has to be paid for the comparison to be meaningful; the tax is a common scale, and the scale is what makes two unlike fights comparable at all.

A position is the sum of its partsFour 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.3/2+−3/2+1/2+={1/2 | 1/2}outcome Leach sprig is a separate game; a move is a move in one of themthe total was computed by adding the games, not the labels
Fig. 5 The situation the tax is standing in for. Several components at once, each offering a move, and a player who can only take one of them per turn. The value of the whole is the sum of the parts; the cost of moving in any one of them is whatever the best of the others was worth.

What the solver computed, and how

Nothing here is evaluated by the formulas above. The strip and both thermographs are produced by the same recursion.

For a number, the thermograph is two horizontal lines at that value and the temperature is reported as negative — a convention chosen so that numbers sort last when components are ordered by what is at stake.

For anything else: compute the thermograph of every option; shift Left’s options’ right walls down by the tax and take the pointwise maximum, giving Left’s wall; shift Right’s options’ left walls up by the tax and take the pointwise minimum, giving Right’s. Walls are carried as exact lists of breakpoints, so the operations are on piecewise-linear functions rather than on samples, and the crossing is found by solving a linear equation on the interval where the sign of the difference changes.

The cooled scores at a given tax are then two lookups into those walls. coolScores does exactly that and nothing else, which is why cooling needed no new code on this site — it is a reading, not a computation.

The gate runs five heat-and-cool round trips on every build and requires exactness to a part in 10910^9. It also requires the temperature of a heated number to come back as the heating amount, which is a second, independent thing that could be wrong.

Where the model stops

The tax is uniform. Every move costs the same, everywhere in the position, at every depth. A game in which some moves are more expensive than others is a different object and cooling as defined here does not describe it.

Cooling does not commute with everything. Cooling a sum is not always the sum of the cooled components, and the failure is exactly where the interesting behaviour is. Where it does hold, the accounting of a whole endgame becomes arithmetic; where it does not, that arithmetic is out by a bounded amount.

Temperature is a single number for a position that may need several. As above: a thermograph with two bends has two temperatures in any useful sense, and the word refers only to the top one.

Infinitesimals have no temperature to speak of. An all-small position has temperature zero or thereabouts, and cooling says nothing useful about it — a different measurement is needed, and the fact that these two theories cover disjoint territory is why both exist.

Normal play. The base case of the thermograph recursion is a position with no moves, and its being a loss for the mover is the convention everything rests on.

Move where it is hottestFour independent components of one position, ordered by temperature. The temperature is how much a player loses by moving somewhere else instead, so the hottest component is the one to take — and a component that is already a number has no temperature at all, because nobody gains by moving in it.{6 | 0}t = 3a big fight{2 | 0}t = 1a smaller one{1 | 0}t = 1/2small change{0 | 1}no temperaturesettled — a numbercomponenthow much is at stakethe whole position is worth {{{19/2 | 17/2} | {15/2 | 13/2}} | {{7/2 | 5/2} | {3/2 | 1/2}}}and the first move goes in the hottest part, which is a theorem up to a small error rather than a rule of thumb
Fig. 6 What the number is finally for. Components ordered by the tax at which each stops being a fight, with the settled ones — the numbers, whose temperature is negative by convention — last. Cooling produces the ordering; the ordering is what a player uses.

Reading the strip carefully

The first figure repays a second look, because two of its rows say something the arithmetic above does not.

The bars close at a constant rate. Each unit of tax narrows the gap by two — one from each side — because both walls move inward at one unit of value per unit of tax. That slope of one is not an artefact of the example; it is forced, since a move costs tt and is worth whatever the option is worth, so the score falls linearly in tt with slope exactly one.

That is why the temperature of a simple switch is half the gap rather than the gap. The two walls approach at combined speed two, so a gap of four closes at a tax of two.

The rows above the temperature are the second thing. They are identical — the bar has become a point and stays a point however high the tax goes. A position that has frozen does not un-freeze, and no amount of further tax makes it worth less or more than its mean.

ttemperature    Left’s score=Right’s score=mean.t \geq \text{temperature} \;\Longrightarrow\; \text{Left's score} = \text{Right's score} = \text{mean}.

The freezing is permanent, and it is what makes the mean well defined. If the two scores could separate again at some higher tax, “the value it settles at” would not be a single number and the whole apparatus would have nothing to report.

Cooling {4 | 0}, one degree at a timeThe same position under a rising tax on moving. Each bar is what Left gets moving first and what Right gets moving first, once every move costs the tax. The bars close as the tax rises, and at the temperature they meet — and from there on the position is worth its mean value and neither player wants to touch it.mean 2tax 0gap 4tax 1/2gap 3tax 1gap 2tax 3/2gap 1tax 2frozen — a numbertax 3frozen — a numbervaluethe walls meet at a tax of 2, which is the temperatureheating a number by t makes a switch of temperature t, and cooling it by t gives the number back
Fig. 7 A second position under the same treatment, with a tax that overshoots. The bar closes at a tax of two and the last row, at a tax of three, is identical to the row at two. Cooling past the temperature does nothing at all, which is what makes the temperature a well-defined height rather than a place the diagram happens to be narrow.

The generalisation

Cooling has a relative that is stranger and more useful than it looks: cooling by an infinitesimal amount.

Charge a tax smaller than every positive number. Positions that were fights stay fights, because their temperature is a positive number and the tax cannot reach it. Positions that were already numbers stay numbers. But positions that were infinitesimally close to zero — the all-small ones — get flattened, and what emerges is a position stripped of everything that does not matter against a background of large fights.

The result is the reduced canonical form, and it is the right notion of “the same position for practical purposes” in a game where the small change is going to be irrelevant. Two positions with the same reduced canonical form play identically in any sum containing something hot, and may play differently in a sum of nothing but infinitesimals.

That is a second summary with a second loss, and it is a good illustration of the pattern this subject runs on: each layer of approximation is exact within a stated range and blind outside it, and the ranges are chosen so that between them they cover the positions that occur.

Who found it, and when

Cooling, heating and thermographs are Conway’s, worked out with Elwyn Berlekamp around 1970 and set out in On Numbers and Games and then in Winning Ways.

The motivation was Go, and specifically the observation that strong players evaluate an endgame region by asking how big it is — how many points the move there is worth — and then play the biggest. Formalising “how big” is exactly the problem cooling solves, and the fact that the answer is the height at which a diagram closes rather than a difference of scores is the part that had to be discovered.

Berlekamp went on to build the thermographic method into a working system for Go endgames, and the demonstrations in which it out-played professionals on constructed positions in the 1990s are the most direct evidence that the abstraction is the right one. The tax is imaginary; the points it predicts are not.

The ladder from here

This anchor began with what is at stake, which asks the question, and this rung supplies the operation that answers it. Reading a thermograph is the same object approached as a diagram, and playing the hottest is what the answer is spent on.

Later rungs: the mean value theorem, proved by cooling many copies. Cooling by infinitesimals and the reduced canonical form. Thermographs with several bends and what a second temperature means. Sente and gote — the asymmetric fights where one player’s move demands a reply — which is where the simple picture of a symmetric switch finally breaks. And the failure of cooling to distribute over sums, which is the error term in every endgame estimate.

The thing to carry from this rung is that the temperature was not defined and then measured. It is the output of an operation, the operation is a tax, and the tax is imaginary in exactly the way an interest rate is imaginary — nobody pays it, and it decides what things are worth.