AWM
← All games‹ lp85m0r0 ›

ls20

Walk a block to doors that match your key; walking into the last door clears the level.

7 levels · 21 rules · all levels replayed in Lean

Replay

The certified run that cleared every level, one action at a time. Beside each step: the rules of the model that explain it; they are also marked in the rule list below.

ls20, first frame of the certified run

Explained by

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

The player is a block, and the direction keys make it walk one cell. Each door has a pattern drawn on it, and the key in the player's hand is in the bottom-left corner. Only when the key's shape and colour are both the same as the door's can it walk into the door; walking into the last door clears the level. The key is changed by stepping on things on the ground: a white cross switch makes it turn a right angle clockwise, a white switch of another shape changes it to the next shape, and a coloured small block changes it to the next colour. Every step taken deducts energy, and when the energy bar at the bottom is used up and one steps again, a life is lost (the red block in the bottom-right corner) and the level restarts; a yellow small square is a supply, and walking into it refills the energy. The light-coloured thin strips beside the walls are spring lines, and stopping beside them one gets pushed sliding all the way. On some levels the switches walk back and forth along a fixed path, one cell for each step the player moves; one level has fog, where only a ring around the player can be seen.

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

Model

The final model: 12 object types and 21 rules. Each rule is a Python check against every recorded step; 18 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 (board 0) (L0_start : World) := …
theorem L1_winnable : Winnable (board 1) (L1_start : World) := …
theorem L2_winnable : Winnable (board 2) (L2_start : World) := …
theorem L3_winnable : Winnable (board 3) (L3_start : World) := …
theorem L4_winnable : Winnable (board 4) (L4_start : World) := …
theorem L5_winnable : Winnable (board 5) (L5_start : World) := …
theorem L6_winnable : Winnable (board 6) (L6_start : 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 ls20.zip 0.6 MB · 67 files

Re-run the proof

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

  1. Download ls20.zip and unpack it. The model and its theorems are in archive/ls20-20260916/formal/Game.lean. Before changing it, check that its SHA-256 is
    287c7dcf9ce693fcd18172a79d41ce75195802297c912c009347226bf94dbb1a
  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 move_up=372,move_down=315,move_left=275,move_right=307,passable=1269,energy_cost=1232,energy_tick=1078,death_reset=10,refill=37,refill_vanishes=1269,toggle_rotates_hud=66,toggle_maps_hud=49,toggle_changes_hud=1229,paint_recolors_hud=1269,mover_shifts=898,paint_orbits=1142,frame_consumed=1269,levelup_iff_match=1283,fog_disc=222
    '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/ls20-20260916/_lib.py.