Skip to content

The Curry-Howard Correspondence

References:

Classical vs Intuitionistic Logic

Example

There exist irrational numbers and such that is rational.

Proof. is either rational or irrational. If it is rational, we’re done.
Otherwise, take and . Then and we’re done.

We didn’t give and : the proof is non-constructive.

In intuitionistic logic, the following are forbidden:

  • Excluded middle:
  • Double negation elimination:
  • Pierce’s Law:

What do we gain? → Constructiveness

Theorem (Disjunction and witness properties)

If , then either or .
If , then there is a term such that .

What do we lose? → Nothing! (almost)

Theorem

There is a map from formulas to formulas, such that whenever , then .
Moreover, they are classically equivalent: .

Natural Deduction

There are two important families of deduction systems. The two most important are:

  • Natural Deduction: Natural deduction follows the natural style of reasoning in text books. Most of an ND proof consists of forward reasoning. Occassionally additional assumptions are introduced or dropped. Natural deduction treats conclusions and assumptions different. Because of this, it fits better to intuitionistic logic than to classical logic.
  • Sequent Calculus: In sequent calculus, conclusions and premisses are treated in exactly the same way. Because of this, sequent calculus naturally fits to classical logic. Automated proof search in sequent calculus is relatively easy. Each time when a rule is applied, most formulas are copied unchanged, and one has to write very much.

Now we introduce the intuitionistic natural deduction system .

Formulas ( is an atomic proposition):

Notation:

Sequents of the form , where:

  • is a formula.
  • is an unordered finite list of formulas.
  • stands for logical consequence.

Proof: finite tree of sequents using deduction rules.

Deduction rules:

Basic Properties

Weakening: If , then .

Contraction: If , then .

Theorem (admitted)

The excluded middle is not provable in : there is a formula such that .

Classical Natural Deduction (): All the rules of + Law of Excluded Middle:

Untyped -calculus

Syntax:

-reduction:

Its reflexive-symmetric-transitive closure is written .

⚠ beware of free and bound variables:

Examples:

Exercise: reduce the following λ-terms:

Theorem (admitted)

The untyped λ-calculus is Turing-complete.

Simply-typed -calculus

Types ( is a base type):

Context: finite map from variables to types

Typing judgement: “The term has type in context ”.

Typing rules:

Exercise: derive the following typing judgements

Solution

  • Let .

Exercise: type the following terms:

Solution

  • Let .

Exercise: is typable?

Full Type System

We extend the simply-typed -calculus with Sum Types, Product Types, Unit Type, and Void Type.

Types:

Terms:

-reduction:

Typing rules:

Properties

Inversion:

  • If then and
  • If then and
  • If then and
  • ...

Substitution: If and then

Theorem (Subject Reduction)

If and then .

Theorem (Strong Normalization)

If then is strongly normalizing.

Curry-Howard Correspondence

  • Propositions Types
  • Proofs Programs
  • Computation Proof Simplification

Propositions:

Types:

Theorem (Curry-Howard Correspondence for )

is derivable in iff there is a term with such that .

Reminder: some properties of :

  • Subject reduction: if and then .
  • If is typable, then it is strongly normalizing.

Lemma (Closed normal forms)

If is typed, closed, and in -normal form, then is of the form: or or or .

Corollary: in intuitionistic propositional logic ,

  • is not provable.
  • if , then either or .

Beyond and simple types

The correspondence can be extended in many ways:

  • System F → second-order logic
  • Martin-Löf Type Theory → dependent types (quantifiers)
  • Calculus of Constructions
  • Calculus of Inductive Constructions → Coq
  • Homotopy Type Theory
  • ...

Other approaches to the “Proofs as Programs” paradigm:

  • Realizability
  • Classical Realizability