Proof Puzzle

Every move a proof. Every win checked by Lean.

Repo
Proof Puzzle banner

About

## Challenges we ran into

The main challenge was making every player line a genuine Lean tactic rather than merely animating a script. We defined pure board transitions and proved a Reaches.move lemma. Each tactic applies that lemma, proves the move legal with decide, and leaves the next state as the remaining goal. A final equality check closes the proof.

An early formulation duplicated state expressions and made proof goals grow rapidly. A named next-state function keeps the terms linear. Precompiling the rules to an .olean and caching repeated results reduced local checks to roughly 0.15–0.26 seconds in the recorded benchmark.

The browser preview also had to agree with Lean. We generated 20,310 one- and two-move sequences across three board configurations and compared outcomes, including illegal moves, exhausted resources, rotations, and locked tiles.

We mapped compiler diagnostics back to player lines, including helper calls. We also fixed a race where editing during verification could leave the check button disabled or allow stale responses to affect a newer proof. Completion badges now depend on the level definition so redesigned levels cannot inherit old wins.

Helper syntax was a usability hurdle, so we added a form that generates editable Lean macros. The editor intentionally accepts a restricted tactic grammar; arbitrary Lean execution and production hosting remain outside this prototype.

## The problem it solves

Proof Puzzle makes formal verification tangible through a visual game. Players rearrange colored blocks by writing short Lean tactics: swap, paint, and rotate. The board follows each line immediately, and illegal moves highlight the affected tiles. A level clears only after the Lean kernel checks that legal moves reach the target.

Seven levels progress from two simple swaps to 3×3 boards and player-defined helpers. A guided helper builder generates visible, editable Lean macros, so beginners can name and reuse patterns without memorizing the syntax. Helpers can compose earlier helpers.

The game connects functional programming concepts to concrete actions: immutable board states, pure transition functions, composition, resource constraints, invariants, and abstraction. It is designed as a first encounter with proof assistants; educational effectiveness has not yet been measured in a user study.

Verification is inspectable: players can download a standalone Lean file and check it independently. The browser provides an instant preview, while Lean checks bounds, adjacency, locked cells, paint, move budgets, orientation, and the final target.

Validation includes seven accepted reference solutions, rejection tests, 20,310 comparisons between the browser simulator and Lean across three configurations, and four UI-state regression tests. All 13 tests pass. Uncached local checks measured 148–257 ms after rule precompilation; these measurements exclude browser and network latency.

Built for the organizer-provided Proof Puzzle challenge in the Functional Programming Track. Current execution is local; the repository contains setup instructions, tests, and a standalone proof. AI coding assistants supported implementation, debugging, and test generation.

Screenshots

Proof Puzzle screenshot 1Proof Puzzle screenshot 2Proof Puzzle screenshot 3

Team

From the public Devfolio project page. Votes, swipes and the judge score are hackfeed's own.

AI judge

Not judged yet. A free model reads this page, compares it with similar projects and this event's winners, then scores it and says what would make it win.

Still being built?

Not checked yet.

Swipe stats

0upvotes
0skips
0saves

Discussion 0

No comments yet. Ask the team something, or say what you'd use it for.

Posting as a guest. Plain text, 1,000 characters max.

Already built nearby

Closest projects by meaning and shared words. Similar isn't the same as copied: read them.