Lemma › Techniques › Invariants
Olympiad problem-solving technique

Invariants

Find what the chaos cannot touch.

A process runs wild: numbers merge, chips jump, cards flip. An invariant is a quantity that every legal move preserves. If the start and the target disagree on an invariant, the target is unreachable, and you have proven impossibility without examining a single sequence of moves.

First candidates to test: the sum, the product, the parity, a coloring count. If the move replaces a,ba, b by a+b+aba + b + ab, testing the product of (1+x)(1 + x) over all numbers reveals the hidden invariant.

The sibling notion, a monovariant, only ever moves one way (say, strictly decreases). Since it cannot decrease forever over integers, the process must halt, the standard weapon for termination arguments.

Where it appears on Lemma: Level 2 (parity) and Level 5 (invariants & monovariants).

Train it on Lemma

Invariants unlocks at Level 5 of Lemma's eight-level ladder, with lessons that teach it and drills that make it stick. 125 lessons, 1206 curated problems and unlimited generated practice at six difficulties. Free to start, no card, and every paid plan opens with 3 free days.

Find your level

More techniques