MathLabs
TheoremProved

Curry–Howard correspondence

Statement

Let φ\varphi be a propositional formula built from atoms, ∧\wedge, and →\to, and let AφA_\varphi be the simple type obtained by translating atoms to base types, ∧\wedge to product ×\times, and →\to to function type →\to. Then φ\varphi is provable in intuitionistic propositional logic if and only if AφA_\varphi is inhabited: there is a closed term tt with ⊢t:Aφ\vdash t : A_\varphi.

Why is it true?

This is the precise statement behind "a proof assistant is just a type-checker": Coq, Agda, and Lean accept a machine-checked proof of a theorem exactly when they accept a term of the corresponding type, and type-checking (unlike theorem-proving in general) is a small, fast, mechanical, and highly trustworthy algorithm.

Proof sketch

(Proofs become programs.) By induction on a natural-deduction derivation of ⊢φ\vdash \varphi. If the last rule is →\to-introduction, deriving φ=ψ→χ\varphi=\psi\to\chi from a subproof of χ\chi under hypothesis ψ\psi: by the induction hypothesis that subproof translates to a term tt with x:Aψ⊢t:Aχx{:}A_\psi \vdash t : A_\chi (the hypothesis becomes a free variable xx); then λx:Aψ. t\lambda x{:}A_\psi.\,t is closed and has type Aψ→Aχ=AφA_\psi\to A_\chi=A_\varphi. If the last rule is →\to-elimination (modus ponens) from ψ→χ\psi\to\chi and ψ\psi: by the induction hypothesis we have terms t1:Aψ→Aχt_1 : A_\psi\to A_\chi and t2:Aψt_2 : A_\psi; then t1 t2:Aχt_1\,t_2 : A_\chi. The ∧\wedge-introduction and ∧\wedge-elimination rules translate symmetrically to pairing ⟨t1,t2⟩\langle t_1,t_2\rangle and the two projections. Every rule of the proof system has a matching term-building rule, so induction on the derivation produces a well-typed closed term of type AφA_\varphi.

(Programs become proofs.) Conversely, by induction on a typing derivation ⊢t:A\vdash t : A. Each typing rule — variable, abstraction, application, pairing, projection — has exactly the same tree shape as a natural-deduction rule — hypothesis, →\to-introduction, →\to-elimination, ∧\wedge-introduction, ∧\wedge-elimination. So take the same derivation tree, erase all the terms, and read each type as the formula it translates from: this is precisely a valid intuitionistic proof of φ\varphi (where A=AφA=A_\varphi).

Since the two translations (proof →\to term, and term →\to proof) are structural inverses of each other on derivation trees — each one undoes exactly what the other does, rule by rule — φ\varphi is provable exactly when AφA_\varphi is inhabited. ■\blacksquare

Topics that use this theorem

Step-by-step proofs

No step-by-step proof yet for this theorem.

References

  1. The Univalent Foundations Program (2013). Homotopy Type Theory: Univalent Foundations of Mathematics
  2. Wikipedia contributors (2024). Curry–Howard correspondence
  3. Wikipedia contributors (2024). Intuitionistic type theory