Here is one of the most beautiful facts in all of computer science, and it sounds too good to be true: a logical proof and a computer program are the same thing. Not "analogous", not "similar in spirit" — literally the same mathematical object, viewed through two lenses. A proof of a theorem is a program; the theorem it proves is that program's type; and running the program is simplifying the proof. This is the Curry–Howard correspondence (also called the proofs-as-programs, or propositions-as-types, principle).
Haskell Curry noticed the shape of the coincidence in the 1930s–40s; William Howard wrote it out in full
in 1969. It ties together three worlds you have met separately — the
The first consequence is startling: because a well-typed term is a proof, a type checker is a
proof checker. If your program compiles at type
The correspondence is a precise, connective-by-connective dictionary between logic and types. Learn this table and you can translate any statement in one column into the other:
| Logic | Types / programs | Reading |
|---|---|---|
| Implication |
Function type |
A proof of |
| Conjunction |
Product / pair |
To prove "both", give a pair: a proof of each. |
| Disjunction |
Sum / tagged union |
To prove "either", give a tagged choice saying which side you proved. |
| Truth |
Unit type |
Trivially provable — the empty tuple |
| Falsehood |
Empty type |
No proof, no value — the type with no inhabitants. |
| Negation |
A proof of |
|
| Universal |
Dependent function |
A function whose result type depends on the input value. |
| Existential |
Dependent pair |
A witness value paired with a proof it has the property. |
Take the tautology
Read proof as a derivation: "assume a proof both of
k is the proof of
It removes detours. In natural deduction, a "cut" is a wasteful step where you prove a lemma and
immediately use it — introduce a connective, then eliminate it right away. Normalising the proof
(cut-elimination) splices the lemma's proof directly into where it's used. On the program side that
detour is exactly a redex:
Simple types (with
This is the engineering payoff. A proof assistant — Coq, Lean, Agda — is a programming language with dependent types in which you write proofs as programs and the type checker verifies them. When Georges Gonthier's team machine-checked the Four Colour Theorem, or when the Feit–Thompson theorem was formalised in Coq, the "proof" was a program the type checker accepted. Software verified this way (the CompCert C compiler, the seL4 microkernel) carries a correctness guarantee as strong as a mathematical theorem — because, by Curry–Howard, it is one.
The clean dictionary holds for intuitionistic (constructive) logic, not classical logic.
The reason is built into "proofs are programs": to prove