Your first verified app
Start from a project created with lakeport init my-app --template blank. Inside the project directory, start the dev server:
lakeport dev serves the app locally, compiles your CSS (plus any configured build plugins in lakeport.json), hot-swaps stylesheet edits in milliseconds without recompiling Lean, and reloads state changes with HMR.
Check and build
To run the full type-check, CSS class validation, and theorem verification, then build an optimized WebAssembly bundle:
The build writes dist/web, including pre-rendered HTML (in SSG mode) and compiled Lean WebAssembly. Clicking Increment calls your pure Lean transition directly; there is no JavaScript copy of the reducer.
Inspect the theorem
Read src/Counter.lean and src/CounterLaws.lean with your coding agent. The transition adds one to a natural number, and increment_increases proves that for every possible count, the next count is strictly larger; increment_zero supplies a concrete witness from 0 to 1.
Ask your agent to break the transition so it returns the old count unchanged, then run:
Compilation fails immediately because CounterLaws.lean no longer holds. If your agent is connected via lakeport mcp (or you have lakeport-lsp open in VS Code, Cursor, or Zed), the exact file, span, and unsolved Lean proof goal are returned right away. Restore the addition and re-run lakeport check ..
Adding a new rule
For your next feature, ask your agent to add a decrement action that never drops below zero:
Remember to read the theorem statements themselves: the compiler verifies that the proof matches the statement, while you verify that the statement matches your product rule.
Continue to .