AWM
← All games‹ ka59lp85 ›

lf52

Peg solitaire: click pegs to jump and capture, and win a level when only one peg is left.

10 levels · 11 rules · all levels replayed in Lean

Replay

The certified run that cleared every level, one action at a time.

lf52, first frame of the certified run

Press Play or step to load the run. Keys, while the player is on screen: ← → step, Space play / pause. A click is circled; cells that changed are outlined.

How it plays

This is a game of peg solitaire. The light grey cells are holes and the green round pieces are pegs. Click a peg to select it; grey rings appear on the cells it can jump to. Click one of the rings and the peg jumps over the adjacent cell and lands there; if the cell it jumps over holds a peg, that peg is captured. The level is won when only one peg is left, counting pegs outside the view. The board is split into several pieces joined by black rails; the arrow keys move the orange cart on a rail one step along it, the peg in the cart moves with it, and the camera scrolls with the loaded cart. Red and blue pegs can also be selected and can jump, but they do not capture what they jump over; purple stones sit on holes, and a peg can jump over them. When a jump leaves a dead position, a large disc appears in the lower-left corner; the undo key takes back the last move.

lf52, first frame of the certified run
Start
lf52, last frame of the certified run
After the winning move

Model

The final model: 12 object types and 11 rules. Each rule is a Python check against every recorded step; 10 of them are translated into Lean (the paper's per-game table). Code under a rule is the file of the same name in the agent's Lean project.

Object types

Rules

Code is shown with comments and the agent's notes removed; the files as written are in the archive under Check it yourself.

Proof

For every level, Lean starts from the level's first screen, applies the model's rules to the certified actions, and checks that every computed state agrees with the recorded frame on the components the model represents, and that the last one wins. Each theorem is closed by the Lean kernel and is a statement about the learned model.

Every level can be won

theorem L0_winnable : Winnable board0 (start0 : World) := …
theorem L1_winnable : Winnable board1 (start1 : World) := …
theorem L2_winnable : Winnable board2 (start2 : World) := …
theorem L3_winnable : Winnable board3 (start3 : World) := …
theorem L4_winnable : Winnable board4 (start4 : World) := …
theorem L5_winnable : Winnable board5 (start5 : World) := …
theorem L6_winnable : Winnable board6 (start6 : World) := …
theorem L7_winnable : Winnable board7 (start7 : World) := …
theorem L8_winnable : Winnable board8 (start8 : World) := …
theorem L9_winnable : Winnable board9 (start9 : World) := …
theorem scene_winnable : Winnable sceneB (sceneWin : World) := …

What cannot be won under the model

theorem nopegs_no_win (b : Board) : ∀ s a s', NoPegs s → step b s a ≠ .won s' := …
theorem unsolvable_nopegs (b : Board) (s : World) (h : NoPegs s) : Unsolvable b s := …
theorem scene_empty_unsolvable : Unsolvable sceneB (sceneEmpty : World) := …

Statements only; the proofs and the full Lean project are in the archive, with the steps to re-run them, under Check it yourself.

Check it yourself

Everything on this page comes from files you can download and check. The archive holds the agent's files: the recorded run, the concept book, the concept sources, the Lean project and the sealed model file, plus the record of our kernel check.

Download lf52.zip 1.1 MB · 89 files

Re-run the proof

Before you start: our run of this check took 826 s and 35.7 GB of memory at its peak (2026-10-24).

  1. Download lf52.zip and unpack it. The model and its theorems are in archive/lf52-20260920/formal/Game.lean. Before changing it, check that its SHA-256 is
    888f93639f4854f82ba3e93534ad14fcf20ad6323786d58105818bd279ae0e1d
  2. Install Lean with elan, then the version named in the archive's lean-toolchain:
    elan toolchain install leanprover/lean4:v4.34.0
  3. Copy the model file to Check.lean and append these two lines to the copy:
    #print axioms consistent
    #print axioms faithful
  4. In the folder that holds Check.lean, run:
    lean +leanprover/lean4:v4.34.0 -M60000 Check.lean
  5. Lean should finish without errors and print:
    GUARD_HITS click_selected_peg_noop=3,click_selects_peg=384,click_switches_selection=6,click_stuck_peg_deselects=40,click_ring_jumps=187,jump_over_step_captures_nothing=101,grey_jumps_and_eats_nothing=39,stone_moves_when_no_peg_selected=26,click_dead_hole_inert=44,click_step_inert=6,click_outside_board=23,non_click_keys_inert=752,keys_clear_selection_iff_board_moved=18,disc_click_consumes=5,disc_only_at_the_killing_move=2884,no_disc_on_already_dead_position=723,levelup_needs_capture_jump=2905,levelup_is_two_peg_capture=165,loaded_cart_column_pinned=459,action7_undoes_one_move=91,cart_moves_iff_rail_ahead=1107
    'consistent' depends on axioms: [propext]
    'faithful' depends on axioms: [propext]
    The first line is printed by the file itself: for each rule, how many recorded transitions meet its condition.

What a pass establishes

consistent: for every recorded transition, as read by the agent's parser and with duplicates removed, every rule whose condition holds also has its effect hold. faithful: the certified run, recomputed step by step from the first screen of each level, matches the record and ends in a win. Axioms used: propext, all among Lean's standard ones.

What it does not establish: that the parser reads the screens correctly (that step runs in Python, outside Lean), or that a rule whose condition never occurs in the record is right. The Python file that produced the readings inside the model file is in the archive at meta/repair-20260928/lib/lf52-20260920/_lib.py.