Member-only story
Making a “Hello World” in Lean
The Language That Proves Math
If you’re not a Medium member, a video version is available on YouTube.
Not so long time ago, in September 2026, OpenAI claimed that they solved one of the Millennium Prize math problems — the Navier–Stokes equations, describing the motion of viscous fluids. What is interesting for us, the proof was written in the programming language Lean, and it is available on GitHub.
As a software developer, I had never used Lean before, but after reading the news, I became curious about how it works. And I decided to make a simple “Hello World” in Lean and also to prove two simple school-level theorems.
Let’s get started! If you’re interested in the coding process “in action,” a video is also added at the end of the article.
1. The Pythagorean Theorem
Let’s start with something simple — the Pythagorean theorem. It is simple, and hopefully everyone knows it. Let’s say we have a right triangle:
The Pythagorean theorem states that:
C² = A² + B²









