Notes

Note   001

Invariants as Conservation Laws

A practical way to search for the quantity a legal move cannot change.

Aug 11, 20266 min read

An invariant is a quantity or property preserved by every legal move. A monovariant is allowed to change, but only in one direction. Both turn a long search over possible move sequences into a short statement about what no sequence can do.

Start with the move, not the goal

When a puzzle asks whether one state can reach another, resist the urge to simulate immediately. Write down exactly what one legal move changes:

  1. Which objects are created or removed?
  2. Which positions change color, parity, or orientation?
  3. Is there a natural weighted sum?
  4. Can the move be expressed as addition in a small modulus?

The mutilated chessboard uses a two-color count. Conway's Soldiers uses an infinite weighted sum. The surface details differ, but the proof pattern is the same.

A tiny algebraic model

Suppose a state is a vector x and every legal move adds one of the vectors m1,,mk. A linear invariant is a vector w such that

wmi=0for every legal move mi.

Then wx is unchanged along every reachable path. Coloring arguments are often this idea in disguise.

A useful checklist

SymptomCandidate tool
Pieces cover adjacent cellsColoring or parity
Jumps consume and create piecesWeighted sum
Moves rotate or swap objectsPermutation sign
Quantity appears to driftMonovariant or potential function

A good invariant does not describe how to win. It explains why an entire universe of attempted wins cannot work.

The creative step is choosing the representation in which the move becomes simple.