The λ-calculus is a tiny formal language invented by Alonzo Church in the 1930s. It has only three building blocks:
x, y, fλx. M, an anonymous function taking x and returning MM N, applying function M to argument Nx
variable
λx. x
abstraction
M N
application
From these three primitives, plus a single computation rule (β-reduction:
replace (λx. M) N by M with N substituted for x),
you can build everything: numbers, booleans, pairs, recursion, the whole of computation.
The λ-calculus is Turing-complete with one rule and one syntactic form.
John Tromp introduced a remarkable graphical notation that turns abstract λ-terms into something you can look at. Lambdas become horizontal bars; applications become connecting bars; variables are vertical wires plugging into their binder.
The result is that every λ-term has a unique geometric shape — and β-reduction becomes a kind of physical rearrangement of these shapes. The visualizer on this site animates that rearrangement step by step.
(λx. x x) y
y y
Each λ-term has its own geometric signature. Click any of these to open it in the visualizer.
Type any λ-expression and watch it reduce. Multiple strategies, animations, BLC encoding, presentation mode, and more.
A guided tour through the λ-calculus, from variables to Church numerals, booleans, and the Y combinator.
Look at a Tromp diagram and try to guess the λ-expression. Difficulty
escalates from I to pred.
Who built this and why. Credits, references, and useful links.
Some things to try in the visualizer:
plus 2 3 — Church addition reduces to 5Y — the fixed-point combinator, with its iconic self-replicating shapeomega — (λx. x x) (λx. x x), an infinite loopfst (pair a b) — pairs and projections