Nurikabe

Islands and a sea: the rules, the checker and all six tactics are proved in Lean.

The rules are a proposition. The checker works like a proof checker: an untrusted search produces a certificate, a small program checks it, and a theorem shows that an accepted certificate implies a solved grid. Hints are deductions, and all six tactics are proved sound: solving a grid with them is writing a proof.

Game in English and French

Play →

In Lean

These statements are read from the games' Lean code when the site is built: if one of them disappears or changes, the site does not build.

Games.Nurikabe.Solved (p : Puzzle) (g : Grid) : Prop
The board `g` solves the puzzle `p`. source →
Games.Nurikabe.solved_sound {p : Puzzle} {g : Grid} (h : solved p g = true) : Solved p g
The engine never says "solved" for a board that is not. source →
Games.Nurikabe.Follows (p : Puzzle) (g g' : Grid) : Prop
Going from `g` to `g'` loses no solution (`LeanGames.Core.Follows`). source →
Games.Nurikabe.Follows.set {p : Puzzle} {g : Grid} {x : LeanGames.Cell} {v : St}
  (h : Games.Nurikabe.Forced p g x v) : Games.Nurikabe.Follows p g (Board.set g x v)
Deciding a forced cell loses no solution. source →
Games.Nurikabe.no2x2Ocean_sound : no2x2Ocean.Sound
source →
Games.Nurikabe.proved_sound (t : Tactic) : t ∈ tactics → t.proved = true → t.Sound
Every tactic marked `proved` has its proof. source →