Posts

Showing posts with the label lean4

The Review Bottleneck

Image
A Reader Pushes Back Why Lean? argued that formal methods are the industry's answer to a world where testing can no longer keep up with the cost of failure. A reader, commenting on that post , pointed out something the post had left out entirely: sometimes bugs survive not because testing failed to catch them, but because nobody was ever going to fix them. That comment, and the conversation it started, turned into more than a reply. It was the second half of the argument. The Bugs We Choose Not to Fix The reader's point was blunt and specific: a company they had just left refused to fix known bugs because the market and investors wanted to see year-on-year growth, and growth comes from shipping new features, not from fixing what already exists. Bugs get "fixed" only when a client trips over one in production. In effect, the user base becomes an informal, unpaid QA layer — crowdsourced testing whether they like it or not. This is a different failure mode from ...

Why Lean?

Image
The Real Issue Is Trust Modern society runs on software that is increasingly essential and increasingly fragile. The problem is not simply that code has bugs. The deeper issue is that we have built a digital civilisation on systems whose correctness is assumed rather than demonstrated. The examples are familiar, and they are getting more costly. In 2025, a routine firewall upgrade caused the Optus emergency calling outage : ordinary calls were automatically rerouted to another network without incident, but Triple Zero calls were silently left undelivered for hours. The fault was narrow, yet it landed precisely on the one function that mattered most, raising serious questions about how deeply society depends on systems we assume are safe and reliable. In 2026, the Telstra outage brought widespread disruption across a continent, showing how a single infrastructure failure can cascade through communications, commerce, and daily life. In a world where a single logic error can disabl...

Using Lean 4 for Mathematics Proofs

Image
Using Lean 4 for Mathematics Proofs In the previous post, I explored Lean 4 as a functional programming language. If you already know functional languages like Haskell, you will recognise a lot of familiar ideas. Where Lean starts to feel different is in its annotations and, especially, in its use of tactics with dependent types. To make that concrete, I will walk through a small mathematical proof in Lean 4. The goal is to show an irrationality result. The classic classroom example is that  2 – √  is irrational, but that proof needs extra machinery. Here, I will use a simpler example that only needs basic arithmetic. I will start with the maths proof, then translate the same idea into Lean 4. I like this proof because it is compact. It is the classic “one side must be even, the other must be odd” contradiction. Mathematics: Prove that  log 2 ( 3 )  is irrational I start by assuming  log 2 ( 3 )  is rational. That means there exist positive integers...