Dalaoli on Math

Proof: the computer (Maker) wins within 21 moves

The computer in this game does not search or use heuristics. It plays, verbatim, the 21-move certificate from the paper Snaky in 21 Maker moves (OpenAI, 2026-09-25) (data/certificate.txt, SHA-256 3fa12d36…3d04). Below is the full chain of proof, with the machine check behind each link.

1. The game

The board is the infinite plane ℤ², initially empty. Maker (the computer) moves first; the players alternately claim one free cell each, and claims are permanent. Maker wins by owning every cell of some copy of Snaky:

S = {(0,0),(1,0),(2,0),(3,0),(3,1),(4,1)}      □□□■■
allowed copies = t + R(S), R one of the 8      ■■■■□
signed permutation matrices

Breaker (you) doesn't need to build a shape of their own, only to stop Maker.

2. Conditional winning positions ("cards")

Definition. A triple (A, T, h) with finite sets A ⊆ T and h ≥ 1. It is valid if, whenever it is Maker's turn and

  • A ⊆ M (Maker already owns A),
  • B ∩ T = ∅ (Breaker has no stone in T),

Maker has already won or can win within at most h moves. Note that this places no restriction on extra Maker stones elsewhere, and none on Breaker stones outside T.

Validity is preserved under any translation, rotation or reflection F (F carries the whole strategy along with it), so a card can be "placed" anywhere and reused.

Base cards (Lemma 2). For each cell s_j of Snaky, (S∖{s_j}, S, 1) is valid: if Maker already owns s_j, S is complete; otherwise s_j is free (Breaker has no stone in S), and playing it wins.

Combination rule (Lemma 1). Let (A_i, T_i, h_i) (i = 1..r) be valid and let p be a cell. Set

T = {p} ∪ ⋃ T_i
A = ( ⋃ A_i  ∪  ⋂ T_i ) ∖ {p}
h = 1 + max h_i

Then (A, T, h) is valid.

Proof. Suppose it is Maker's turn, A ⊆ M and B ∩ T = ∅. Since p ∈ T, Breaker doesn't own p. Maker plays p (if p is already Maker's, Maker plays any free cell, which still counts as a real move). Maker now owns ⋃A_i ∪ ⋂T_i. If Maker has already won, stop. Otherwise Breaker plays some cell b; b is not Maker's, so b ∉ ⋂T_i, hence there is an i with b ∉ T_i. Because T_i ⊆ T, none of Breaker's earlier stones is in T_i either. So A_i ⊆ M and B ∩ T_i = ∅: the premise of child card i holds, and Maker wins within at most h_i further moves, ≤ 1 + h_i ≤ h in total. ∎

The key point: one Breaker move claims only one cell, and Maker already owns the intersection of all child envelopes, so Breaker cannot break every child card at once. A Breaker move outside T affects no child card at all.

3. The certificate

The certificate has 722 lines (cards 6..727). Each line is one (nested) application of the combination rule and refers only to cards with smaller numbers. By structural induction, all 728 cards are valid. For the final card:

p₇₂₇ = (8,8),  A₇₂₇ = ∅,  |T₇₂₇| = 251,  h₇₂₇ = 21

A₇₂₇ = ∅ and B = ∅ on the empty board, so the premise holds at the start of the game: Maker wins within at most 21 moves. ∎

4. From proof to program (snaky.js)

The strategy is the one in the paper's section "One strategy against every continuation":

  1. The active claim is a pair (combination node, global placement F). It starts as (card 727, identity).
  2. Maker plays F(p); if Maker already owns it, Maker plays the first free cell in a fixed enumeration (a substitute move, counted as usual).
  3. After Breaker's reply b, take the first child, in certificate order, whose F(T_i) does not contain b; a referenced child's placement is F∘G.
  4. On reaching a base card, Maker fills in the missing cell and wins.

Every move lowers the height by exactly 1, starting from 21, so there are at most 21 moves. The "AI guarantee ≤ k" shown in the game is moves so far + current card height − 1, and it never increases during a game.

5. Machine checks

Check Command Result
The paper's short verifier python3 -B verification/verify_certificate.py (in the paper's directory) PASS
The paper's full reconstruction suite (21/25/35-move certificates) python3.13 -B verification/supporting/verify_all.py --output-dir … PASS
This project's independent proof checker python3 -B proof/check_proof.py PASS
Adversarial tests against the browser engine jsc tests/run_tests.js -- 2000 PASS, 10,000 games

proof/check_proof.py (independent implementation)

It doesn't call any of the paper's code. It parses and evaluates the certificate itself and checks, at all 1620 combination nodes, the local conditions a single round of play needs. Let M₀ = A ∪ {p} (the least Maker is guaranteed to own after playing the pivot):

  • L1 every A_i ⊆ M₀: the child's required set is already in hand
  • L2 every T_i ⊆ T: old Breaker stones stay outside the child envelope
  • L3 h ≥ 1 + h_i: the height goes down
  • L4 for every possible Breaker reply b in T ∖ M₀ there is an i with b ∉ T_i (for replies outside T, take i = 0)
  • L5 p ∈ T: Breaker cannot already own the pivot

It also checks that the 6 base cards really are "Snaky minus one cell", and that the final card has A = ∅, h = 21 and T ⊆ {0..16}². Finally, starting from the empty board, it walks every (node, placement) state the strategy can actually reach and computes the most Maker moves needed against any Breaker play.

[1] Certificate evaluated: 728 cards, 1620 combination nodes, 4089 references
[2] Local conditions L1-L5 hold at all 1620 combination nodes; 35422 (node, Breaker reply cell) pairs checked
[3] All 6 base cards are "Snaky minus one cell", height 1
[4] Final card 727: A = ∅, |T| = 251 ⊆ {0..16}², h = 21
[5] Distinct strategy states (node, placement) reachable from the empty board: 53823; worst-case Maker moves = 21
PASS: Maker completes Snaky within 21 ≤ 21 moves against any Breaker play

The 35,422 replies inside T, plus one "outside T" reply class per node (1620), make 37,042 in total, matching the number of local reply classes reported in the paper's verification section.

L1–L5 are exactly the facts used in the proof of the combination rule in Section 2, so this check together with that proof covers any Breaker reply on the infinite board (replies outside T are all equivalent and form one class). Extra Maker stones only reduce Breaker's legal choices; they cannot break any condition.

tests/run_tests.js (checks the code that actually runs in the browser)

It uses the JavaScriptCore engine that ships with macOS to load the same snaky.js and certificate.js as the web page, first checks the figures in the paper's tables, then plays 2000 games against each of 5 Breakers. On every Maker turn it asserts the invariants A ⊆ M and B ∩ T = ∅, and that moves so far + remaining height ≤ 21.

Breaker Description Most Maker moves
random plays randomly near the action 8
envelope plays randomly, only inside the current envelope T 9
worst always sends Maker into the child card with the greatest remaining height (the strongest defence in the certificate's sense) 21 (exactly 21 in all 2000 games)
greedy blocks the cell covered by the most "live" Snaky copies 8
mixed switches to a random strategy every move 12

Conclusion: the bound of 21 is tight (for this strategy). The strongest defence drags the computer to move 21, but never to move 22.

6. Notes

  • What is proved here is "this strategy wins within 21 moves", not "21 is Maker's optimal number of moves" (the paper doesn't claim that either).
  • The web page shows a 23×23 window; by the rules the board is infinite. Moves outside the window have no effect on Maker (T₇₂₇ ⊆ {0..16}², marked by the dashed frame).

Comments