Domain-driven development in Lean: using theorem proving to separate what from how
hargup13 · x · 2026-10-06
The author publishes a tutorial on domain-driven development in Lean, using tic-tac-toe as a complete worked example, built on their earlier LeanAPI and LeanDB libraries.
- Core idea: define the program purely in the language of its domain and let the compiler derive execution details — in most other languages, the "what" and "how" get mixed together.
- A domain is a vocabulary and its rules: defined by its grammar, e.g. players of two kinds (X and O) and a nine-square board, plus rules for combining them.
- Why Lean: theorem-proving languages let you define the domain abstractly and precisely, something mainstream languages struggle with.
- Full code examples make this followable as a hands-on tutorial.
More from Research
- PerturBot Breaks Shortcut Priors in Vision-Language-Action Models With Perturbative Training — Mingyu Liu · 2026-10-06
- Georgia Tech's TextReg Fixes Prompt Distributional Overfitting, Gains Up to +11.8% OOD — GeorgiaTech · 2026-10-06
- SourceLearn Builds Source-Specific Agent Competence, Wins 13 of 15 Benchmarks — GeorgiaTech · 2026-10-06
- Representation-Space MMD Post-Training Boosts Diffusion LMs, More Parallel Decoding at 16B — yresearch · 2026-10-06
- Attention Relay makes embedding models instruction-aware without training via LLM attention weights — _reachsumit · 2026-10-06
- Programmatic Search Agents boost task success by up to 7.56 points over query-based agents — _reachsumit · 2026-10-06