Getting started·/docs/getting-started

Your first verified app

Start from a project created with lakeport init my-app --template blank. Inside the project directory, start the dev server:

sh
lakeport dev .

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:

sh
lakeport check .
lakeport build web . --release

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:

sh
lakeport check .

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:

1.
Agree on the behavior and state the theorem (decrement_nonneg and decrement_zero_stays_zero).
2.
Keep the transition pure in Lean and prove the theorem without sorry or custom axioms.
3.
Wire the button in src/App.lp styled with standard CSS (or your configured CSS plugin).
4.
Run lakeport check . and inspect both the theorem statement and the live UI in lakeport dev ..

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 .