← Back to Tech Radar
Hacker News tech

Anatomy of a Lean proof for software engineers

Trending on Hacker News: Anatomy of a Lean proof for software engineers (50 points / 1 comments, via agostbiro.net)

Opening excerpt

I recently worked through a problem from a theory of computation textbook that asked me to prove a property of a language using finite automata. The informal proof is a simple constructive proof where you build an automaton and show that it recognizes the language. This is kind of similar to program verification, so I thought it’d be interesting to see what it takes to formalize the proof. Lean is a good choice for this, because its Mathlib has all the theorems for the problem.

After finishing the formal proof, I decided to write it up, because I think it provides software engineers with good insight into what it takes to formally prove properties of a system.

I tried to make this post accessible. If you’re comfortable with a modern statically typed programming language (such as TypeScript or Rust), binary arithmetic, basic propositional logic, and inductive proofs, you should be able to follow along.

Feel free to skip to the next section if you’re comfortable with DFAs and regular languages.

(Excerpted from the original; full article via the source link below.)

This story hit the Hacker News front page today (50 points / 1 comments, via agostbiro.net). Our Tech Radar aggregates daily signals on AI engineering, backend architecture and DevOps — browse the related services and further reading below, or get in touch with our team.

Source: Hacker News

Related Services

Related Reading