logic · 2 min read

The Curry–Howard Correspondence: Proofs as Programs

An introduction to the deep isomorphism between type systems and intuitionistic logic — where every proof is a program and every proposition is a type.

#type-theory#lambda-calculus#proof-theory#intuitionistic-logic

The Curry–Howard correspondence is one of the most beautiful results in theoretical computer science: it establishes a deep isomorphism between proof systems and type systems.

The Core Idea

The fundamental slogan is:

propositions    types,proofs    programs\text{propositions} \;\cong\; \text{types}, \qquad \text{proofs} \;\cong\; \text{programs}

More precisely, under the Curry–Howard correspondence:

LogicType Theory
Proposition AAType AA
Proof of AATerm t:At : A
ABA \Rightarrow BABA \to B (function type)
ABA \wedge BA×BA \times B (product type)
ABA \vee BA+BA + B (sum type)
\bot (false)Void (empty type)

Intuitionistic Logic and λ\lambda-Calculus

The correspondence was first observed between:

  • Intuitionistic propositional logic (Heyting’s formalization)
  • Simply typed λ\lambda-calculus (Church’s type theory)

A proof of ABA \Rightarrow B in natural deduction corresponds to a λ\lambda-term of type ABA \to B:

Γ,x:At:BΓλx.t:AB(-intro)\frac{\Gamma, x : A \vdash t : B}{\Gamma \vdash \lambda x.\, t : A \to B} \quad (\text{$\Rightarrow$-intro})

The modus ponens rule ABAB\frac{A \Rightarrow B \quad A}{B} corresponds to function application:

Γf:ABΓa:AΓfa:B(App)\frac{\Gamma \vdash f : A \to B \quad \Gamma \vdash a : A}{\Gamma \vdash f\,a : B} \quad (\text{App})

Normalization = Proof Simplification

A remarkable consequence: cut-elimination in proof theory corresponds to β\beta-reduction in the λ\lambda-calculus.

(λx.t)a  β  t[a/x](\lambda x.\, t)\, a \;\xrightarrow{\beta}\; t[a/x]

This means that simplifying a proof (removing detours via the cut rule) is the same as evaluating a program. Termination of evaluation = consistency of logic.

Extensions

The correspondence extends far beyond the simply typed case:

  • System F ↔ Second-order propositional logic
  • Dependent types ↔ First-order predicate logic (Martin-Löf type theory)
  • Linear types ↔ Linear logic (Girard)
  • Modal types ↔ Modal logic (S4, etc.)

This is the foundation for proof assistants like Coq, Agda, and Lean 4.

A Concrete Example

Here is the identity proof/program:

-- The proposition "A implies A"
id : (A : Set) → A → A
id A x = x

This term inhabits the type A.AA\forall A.\, A \to A, which corresponds to the tautology P.PP\forall P.\, P \Rightarrow P.

Further Reading

  • Howard, W.A. (1980). “The formulae-as-types notion of construction”
  • Wadler, P. (2015). “Propositions as Types” — Communications of the ACM
  • Martin-Löf, P. (1984). Intuitionistic Type Theory
Blog