Lean Tutorial

Wojciech Różowski
Lean FRO
VeTSS Summer School, Glasgow | Aug 4, 2026
Lean

Lean Beginnings

Strategy Challenge in SMT Solving — de Moura and Passmore

Excerpt from the abstract highlighting user control of strategies

Lean

Lean

Created as a platform for white-box automation by Leonardo de Moura

An interactive theorem prover and a functional programming language

Features a lean kernel: a minimised type theory compared to similar systems

A short Lean proof: the square of an odd natural number is odd

Lean

The Lean System

Diagram of the Lean ecosystem: Lean core, Lake, Reservoir, VS Code plugin, Std library, Verso, Reference Manual, Website, Loogle

Lean

The Liquid Tensor Experiment — 2021

Peter Scholze (Fields Medal 2018) was unsure about one of his latest results in Analytic Geometry.

The Lean community not only verified the proof within months but also simplified it. They did this without fully understanding the entire proof.

Followed by many similar projects since.

Screenshot of the Liquid Tensor Experiment contributors

Lean

Software Verification in Lean 4

AWS blog post: Lean Into Verified Software Development

SampCert: verified discrete Gaussian sampler in Lean

AWS Cedar: a formal model of the Cedar authorisation language in Lean

Lean

Veil Verification Framework (NUS)

Veil action example — request procedure with require/if/let

Veil invariants and generated spec

github.com/verse-lab/veil

Lean

AI with Lean

New York Times: Move Over, Mathematicians, Here Comes AlphaProof

Lean-Curious: AI-assisted proof exploration

Lean

The Lean Focused Research Organization (FRO)

A non-profit organisation dedicated to the development of Lean.

Missions:

  • Address scalability, usability, and proof automation in Lean

  • Support formal mathematics

  • Achieve self-sustainability in 5 years

Supported by Simons Foundation International, Alfred P. Sloan Foundation, Merkin Family Foundation, Alex Gerko, and Convergent Research.

lean-lang.org · lean-lang.org/fro

Lean

Agenda: verification of foreign programs in Lean

  • Embedding languages in Lean

  • Operational semantics of an imperative language

  • Proving correctness of programs and optimizations

  • Combining tools: calling SAT solvers from Lean

Lean

Imp: An Imperative Language

Statements: while loops, conditionals, assignment.

Mutable memory; flat mapping from names to 32-bit values (no local scope).

def fact : Stmt := imp { out := 1; while (n > 0) { out := out * n; n := n - 1; } } def swap : Stmt := imp { temp := x; x := y; y := temp; } def min : Stmt := imp { if (x < y) { min := x; } else { min := y; } }
Lean

Next steps…