Lean 4 for Software Engineers
leangineer.com · Join the Discord
Abstract
Lean 4 is best known as a theorem prover for mathematics. It's also a compiled functional language you can build real software with today.
Leangineering is a community for people who use Lean for software engineering and computer science.
Start with the directory of Lean libraries and tools, or read writing about real projects built with them.
1Repos
Awesome Lean Programming is a directory of 530 libraries, tools and projects for building software in Lean.
Recent projects
- sc-http-lean: an async HTTP Library for LeanCows are Friend · December 4, 2026scidonia/sc-http-lean
- Ladybug for Leanvpavlyshyn · November 23, 2026Volland/ladybug-lean
- LeanRDF: RDF semantics you can prove 🧾✅vpavlyshyn · November 22, 2026volland.github.io
Built something in Lean? Share it in #projects-and-repos on the Discord.
2Articles
- Practical Vericoding in Lean | Scidonia
Proof is cheap enough to use in day-to-day engineering. A tour of the routes into Lean: code and specification in one language, LeanIn for concurrency, LLVM-level proofs for speed, an external compiler for Zig, and what to do with code you cannot replace.
- A toy workflow engine in Lean 4
At the November 2026 BFPG Hack Day my friend Raphael implemented a workflow system in Lean, inspired by his experience with DBOS. I promised that I’d make my own toy implementation and this blog post 🙂 The code is at carlohamalainen/lean-workflow-demo. What is a workflow system? Link to heading…
- Sungrow in Lean, part 4
In part 3 we implemented chunked (block) reading of registers and also writing control registers. The next step is to implement our own charging algorithms and manual overrides so that we can control the inverter and battery in real time. In the Go implementation, charging algorithms and state (the…
Written about Lean? Share it in #blog-posts on the Discord.
3How this site is built
Theorem 1 (Written in Lean). Every page on this site is a typed HTML value produced by a Lean program.
Proof. Pages are built with lean-html, so a <div> inside a <p> is a compile error. The directory comes from the awesome-lean-programming readme, which the site sanitizes and turns into lean-html nodes as well. Search streams results from the server with Datastar, so there's no frontend build step. Figure 1 shows part of the code.∎
-- the routes this page was served from route_table Site [ home := "/", blog := "/blog", awesome := "/awesome", category := "/awesome/:slug:String" ] def hero : Node .flow := h1 [ "Lean 4 for Software Engineers" ] -- what lean-html proves about escaping #check escape_safe
▼ Main.lean:12:0
Html.escape_safe (s : String) (c : Char) : c ∈ (escape s).toList → c ≠ '<' ∧ c ≠ '>' ∧ c ≠ '\"'
Figure 1. Some of the code behind this page. On the right, Lean's infoview shows the theorem lean-html proves about escaping.
The site's code is open source if you want to see how it's done or improve it.
4Community
Most of the conversation happens on the Discord. Beginners and people without a maths background are welcome.