Indicogni Interactive Engineering Course · Lean 4.36.0

Don't hope the AI's code works. Prove it.

A hands-on software and distributed-systems verification course for working engineers. Skip Peano arithmetic warmups and multi-gigabyte library downloads: catch protocol bugs with a 35-line TLA+ state explorer, seal 64-bit hardware invariants in Lean's kernel, audit untrusted AI code with verigate, and differential-fuzz Rust/Go/TS services against oracle.

16 chapters + 4 closed-notes synthesis checkpoints
4 capstones CedarLite, FencingKV, StackVM, VeriGate
6 live labs Zero-install BFS, BitVec, Erasure & Red-Team
$0 / Zero tracking No cookies, no telemetry, offline-ready

Dual-Mode Learning: Zero-Setup Browser + Full Local Lake Toolchain

Mode 1 · Runs in your browser

Zero Install, Instant Proof Intuition

Every chapter opens with a concrete 5-line production bug, locks your Socratic prediction before revealing the mechanism, lets you step line-by-line through a simulated Lean 4 Infoview (j / k), and launches standalone zero-dependency code in one click on live.lean-lang.org.

Open Browser Labs →
Mode 2 · Your machine or Codespaces

Production Proof Engineering & CI Gates

Clone indicogni/prove-it or launch GitHub Codespaces. Because we pin pure Core/Std Lean v4.36.0 with zero external packages, cold lake build finishes in seconds offline—complete with lake exe check, lake exe verigate, and lake exe oracle.

How Systems Verification & AI Supervision Fit Together

The Two-Gear Verification Loop: TLA+ Bounded BFS and Lean 4 Kernel Proof System state machine flows into Gear 1 bounded BFS search to catch shallow counterexample traces in milliseconds, then into Gear 2 inductive invariants in the Lean 4 kernel to seal unbounded state spaces. 1. Executable Spec State · Init · Next Total functions (no null) Sum types eliminate boolean-soup states Chapters 01–03 2. Gear 1 · TLA+ BFS Search #guard bfs depth≤6 == .safe Explores packet delays, crashes, & interleavings in <5 ms Chapter 04 · Browser Lab 2 Shortest Counterexample Trace [c1Send, c2Commit, deliverStale] Fix spec/code BEFORE proving! 3. Gear 2 · Lean 4 Kernel Unbounded Mathematical Proof • Init s → Inv s • Inv s → Next s s' → Inv s' • abs (compact s) = abs s • BitVec 64 wrap-around sealed Infinite epochs & 2^64 states Chapters 08–12 · Zero sorry
Architecture 1 — The Two-Gear Verification Loop: Never burn hours attempting an inductive proof on a buggy protocol. Gear 1 falsifies shallow bugs with concrete traces in milliseconds; Gear 2 seals unbounded epochs, arbitrary message reorderings, and 64-bit hardware boundaries inside Lean's tiny trusted kernel.
The AI Vericoding Gate: Locked Human Spec vs Untrusted Coding Agent Human engineers lock Spec.lean and non-vacuity witnesses while untrusted AI agents synthesize Impl.lean and tactic proofs; lake exe verigate blocks all 9 exploit vectors before deployment or oracle fuzzing. Human TCB · Spec.lean SHA-256 Pinned · Read-Only Domain types + Soundness + Non-vacuity (∃ x, Pre x) Untrusted Agent · Impl.lean 100x Fast Synthesis, Zero Trust Optimized algorithms + tactics (may attempt spec-gaming!) lake exe verigate (CI Gate) 1. Lean Kernel Typecheck 2. Spec SHA-256 Integrity Check 3. Axiom Whitelist (Tier 0 / Tier 1) 4. Ban @[implemented_by] / @[extern] 5. Ban raw native_decide & sorryAx 6. Verify Non-Vacuity Witness Chapters 13–14 · Browser Lab 6 Reject Cheating PRs sorry · custom axiom · csimp False → Safe · Spec drift Verified Artifact + Oracle lake exe oracle Differential-fuzz Rust, Go, TS & Python in CI (Ch 16)
Architecture 2 — The AI Vericoding Gate: Coding agents share correlated blind spots when writing both code and unit tests. Locking human-owned specifications and auditing kernel axioms/attributes turns Lean 4 into an unforgeable sandbox for AI-generated software.

Complete 4-Part Curriculum (16 Chapters + 4 Checkpoints)

Progress is stored locally in your browser (localStorage["indicogni.proveit.v1"]) and never transmitted anywhere.

Part I · Executable Specifications & Gear 1 Model Checking 5 units
Part II · The Proof Engine & Gear 2 Inductive Invariants 5 units
Part III · Precision Types, 64-Bit Hardware & Refinement 5 units
Part IV · AI-Native Verification & Monday-Morning Transfer 5 units

The 4 Production Capstones

Capstone 01 · Cloud Security

CedarLite — Cloud IAM Policy Engine & Optimizer

Inspired by AWS's Lean-verified Cedar authorization engine. Model principals, actions, resources, and `permit`/`forbid` policy sets, then build a policy constant-folder/dead-rule eliminator and prove three non-negotiable security theorems.

ProveIt/Capstones/CedarLite.lean

Inspect Capstone & Run in Browser →
Capstone 02 · Distributed Systems

FencingKV — Split-Brain Leases & Tombstone Compaction

Full Two-Gear TLA+-in-Lean distributed verification: use Gear 1 BFS to reproduce a GC-pause split-brain write on unfenced storage, then prove Gear 2 unbounded inductive epoch monotonicity AND tombstone-compaction refinement.

ProveIt/Capstones/FencingKV.lean

Inspect Capstone & Run in Browser →
Capstone 03 · Compilers & Runtimes

StackVM — Verified Optimizing Compiler & Bytecode VM

Compile an expression AST with variables, arithmetic, and conditionals into flat stack-machine bytecode, write an algebraic constant-folding optimizer, and prove end-to-end semantic preservation for arbitrary code continuations.

ProveIt/Capstones/StackVM.lean

Inspect Capstone & Run in Browser →
Capstone 04 · AI Safety & Polyglot CI

VeriGate & Oracle — AI Proof-Carrying Gate & Differential Fuzzer

Build the supervision harness that lets autonomous coding agents write fast implementations without compromising soundness: lock `Spec` hashes, audit axioms/attributes against `RedTeam/` exploits, and differential-fuzz external services.

ProveIt/Capstones/VeriGate.lean

Inspect Capstone & Run in Browser →

Field Reference & Monday-Morning Playbooks

TLA+ ↔ Lean 4 Rosetta Stone

Side-by-side translation of VARIABLES, Init, Next, UNCHANGED, TLC BFS, inductive invariants, and stuttering refinement.

Spec-First AI Playbook & Polyglot Oracle

Copyable agent prompts, VeriGate GitHub Actions workflow, and Rust / Go / TypeScript / Python differential-fuzzing harnesses.