# Curry-Howard isomorphism for disjunction elimination

I am trying to find out how the disjunction elimination rule of natural deduction relates to the Curry-Howard isomorphism. The rule:

$P \vee Q, P \Rightarrow C, Q \Rightarrow C \vdash C$

I have been able to write all rules typically used in a natural deduction proof in terms of either function application, function abstraction, bottom elimination (anything can be inferred from a false assumption) and double negation elimination (which is isomorphic to continuations). The only rule that does not seem to be writable using these four concepts is disjunction elimination.

Is there something I am overlooking, or does the lambda calculus needs to be extended with another concept to allow for disjunction elimination?

• Yes. You need to add coproducts (= disjoint unions) to your type system. – Zhen Lin Feb 6 '14 at 1:17

## 2 Answers

As Zhen Lin says in a comment, your type system needs disjoint unions. This is analogous to the way that you need to have ordered pairs (product objects) in order to model $\land I$ and $\land E$. (You might want to look at the product objects first. They are simpler, because the $\land I$ rule is simpler than the corresponding $\lor E$ rule you are trying to model.)

We will extend the basic type system with union types, as follows: for each pair of types $A$ and $B$ there is a union type, called $A\lor B$. For each term $a : A$ we have a term $\def\L#1{{\operatorname{Left}}\;#1}\L a : A\lor B$, and similarly for each term $b: B$ we have a term $\def\R#1{{\operatorname{Right}}\;#1}\R b : A \lor B$

($\L{}$ and $\R{}$ are actually different for each different $A\lor B$, so we should be writing $\operatorname{Left}_{A\lor B}$ and $\operatorname{Right}_{A\lor B}$, but I tried that way and the notation was just too much. I will leave the ${A\lor B}$ implicit.)

The $\lor I$ rules $A\to A+B$ and $B\to A+B$ then correspond to applications of $\L{}$ and $\R{}$, respectively.

We also need a destructor for removing the constructors again, which is a case statement: $$\def\csx{\operatorname{Case}} \def\C#1#2#3{\csx #1 \text{ of }\L y: #2\mid\R z: #3 }\C x{F(y)}{G(z)};$$ This tests $x$ to see if it is a $\L a$, in which case the result is $F(a)$, or $\R b$, in which case the result is $G(b)$. Here $F$ must be a term of type $A\to C$ and $G$ must be a term of type $B\to C$; the entire $\csx$ expression then has type $(A\lor B)\to C$. Variables $x,y,z$ have types $x:A\lor B, y: A, z: B$. (This is more or less exactly how it manifests in a programming language; you can translate this almost symbol-for-symbol into Haskell, for example.) The $\lor E$ rule you quoted corresponds to an appearance of $\csx$. In your rule, you have $$x:P\lor Q,\; F:P\to C,\; G:Q\to C,$$ and you can convert these to a single expression of type $C$ by writing $$\C x{F(y)}{G(z)}.$$

This is of course the intuitionistic $\lor$ operator, so one cannot construct a value with type $$P\lor\lnot P$$ unless some non-intuitionistic construction is available. (There is a rather famous paper by Wadler that discusses this: "Call-by-Value is Dual to Call-by-Name". See the story about the Devil and the billion dollars in section 4. The Devil uses continuations.)

For another example, see What is a constructive proof of $\lnot\lnot(P\vee\lnot P)$? on this web site, which discusses how to construct a value of that type.

• I would like to point out that $\wedge I$ and $\wedge E$ are possible to model without product object, by using the following definition: $P \wedge Q \equiv (P \rightarrow (Q \rightarrow \bot)) \rightarrow \bot$ Now, we can have $\wedge I$ like $\lambda p . \lambda q . \lambda a . p q$. For $\wedge E$, we then have $\lambda a . \text{doubleNegElim} \; (\lambda x . a (\lambda y . x y))$. Here $\text{doubleNegElim}$ is some continuation function. I guess my problem is that if I'm able to define this for $\wedge$, why cant I define it for $\vee$ without introducing extra constructs. – user1838636 Feb 6 '14 at 5:05
• It seems like perhaps your question isn't about CH, but rather about how to model $\lor$ in the $(\to, \bot)$-fragment of logic. – MJD Feb 6 '14 at 5:10
• Sorry for the many edits, it is a bit cumbersome on this website to stage an elaborate message as a comment. Wel, $P \vee Q$ is easily modeled as $(P \rightarrow \bot) \rightarrow Q$. My problem is that it does not seem possible to create a lambda term for disjunction elimination (disjunction introduction is not a problem though). Or am I missing something here? – user1838636 Feb 6 '14 at 5:15

I found the answer, it is possible to write a correct lambda term for disjunction elimination:

For simplicity, I assume there is a function $\text{pOrQ}:(P \rightarrow\bot) \rightarrow Q$, a function $\text{pToC}:P\rightarrow C$, a function $\text{qToC}:Q\rightarrow C$ and a helper function $\text{doubleNegElim}_{X}:((X\rightarrow\bot)\rightarrow\bot)\rightarrow X$ (can be implemented using double negation elimination). Now, we can obtain a term of type $C$ from these functions as follows:

$\text{doubleNegElim} \;\; \lambda x\!\!:\!\!(C\rightarrow\bot) \; . \; x \; (\text{qToC} \; (\text{pOrQ} \; \lambda a\!\!:\!\!P \; . x \; (\text{pToC} \; a)))$