3

In simple type theory, how can I prove that there is no closed term of type?

$$((P \Rightarrow Q) \Rightarrow Q) \Rightarrow P$$

naslundx
  • 9,896

1 Answers1

5

I will use the fact that a formula is an intuitionistic tautology if and only if it is true in all Heyting algebras.

Introduction:

One convinient source of Heyting algebras is topology, namely, the lattice of open sets (with regard to inclusion) of any topological space is a Heyting algebra. In this example I will take the Heyting algebra of open sets of $\mathbb{R}$. Let $P$ and $Q$ be some open sets, then, we have the following relations

\begin{align} \DeclareMathOperator{inte}{int} P \land Q \quad&\text{ is }\quad P \cap Q \\ P \lor Q \quad&\text{ is }\quad P \cup Q \\ P \to Q \quad&\text{ is }\quad \inte(P^c \cup Q) \\ \bot \quad&\text{ is }\quad \varnothing \\ \top \quad&\text{ is }\quad \mathbb{R} \\ \neg P \quad&\text{ is }\quad P \to \bot = \inte(P^c) \end{align} where $\inte(P)$ is the interior of $P$ (i.e. the largest open set contained in $P$).

Just to demonstrate, we can show that that there is no double-negation elimination substituting $P = (0,1)\cup(1,2)$ and proving $\neg\neg P \to P$ is not $\top$, that is, \begin{align} \neg\neg \big((0,1)\cup(1,2)\big) &= \neg \inte\big((-\infty,0] \cup {1} \cup [2,\infty)\big) \\ &= \neg \big((-\infty,0) \cup (2,\infty)\big) \\ &= (0,2) \\ (0,2) \to \big((0,1)\cup(1,2)\big) &= \inte\big((0,2)^c \cup (0,1)\cup(1,2) \big) \\ &= \inte\big((-\infty,1) \cup (1,\infty)\big) \\ &= (-\infty,1) \cup (1,\infty) &\neq \top ,\end{align} nor law of excluded middle in a similar fashion with $P = (0,\infty)$ $$ (0,\infty) \cup \inte\big((0,\infty)^c\big) = \mathbb{R} \setminus \{0\} \neq \top .$$

Proof:

Now, by showing that some type is inhabited, we prove that the corresponding formula is a tautology. To show that some type is not inhabited, it is enough to show that the formula is not a tautology, that is, there is some valuation such that the formula does not evaluate to $\top$. We start with

$$((P \to Q) \to Q) \to P$$ for \begin{align} P &= \bot,\\ Q &= \top. \end{align}

That is,

\begin{align} P &\to Q &= \bot \to \top = \inte(\varnothing^c \cup \mathbb{R}) &= \top, \\ (P &\to Q) \to Q &= \top \to \top = \inte(\mathbb{R}^c \cup \mathbb{R}) &= \top, \\ \big((P &\to Q) \to Q\big) \to P &= \top \to \bot = \inte(\mathbb{R}^c \cup \bot) &= \bot \neq \top. \end{align}

Hence, it is not a intuitionistic tautology and by the Curry-Howard isomorphism, the corresponding type is not inhabited.

Afterword:

In fact, $\big((P\to Q)\to Q) \to P$ is not a tautology even in classical logic, where it is equivalent to $Q \to P$ and false for $P = \bot$ and $Q = \top$ (it is not a coincidence that I have used this valuation). Moreover, if a formula is not a tautology in classical logic, it cannot be one in in intuitionistic logic. So, we could prove this particular type to be uninhabited just by checking it in classical way, without introducing Heyting algebras. Why then making things complicated? Because I wanted to show how you could do it in a general way. There are other terms, like $\big((P \to Q)\to P) \to P$ which are tautologies in classical logic, but not in intuitionistic logic, and for which such simple approach would not work, while Heyting algebras would.

I hope this helps $\ddot\smile$

dtldarek
  • 37,969
  • Thanks, that helps a lot! The answer with the Heyting algebras is exactly what I was looking for since I also need to prove that no term exists for other propositions like: (P => Q) => Q that are true in classical logic but not in intuitionistic logic. – txominpelu Feb 28 '14 at 11:09
  • I was also wondering how providing a context affects inhabitation. For example given the following context in simply typed lambda calculus: y:(P => Q) => Q to prove that there can't be a term of type P is enough with proving that the context is malformed (because the proposition is not an intuitonistic tautology) or do I need to prove something else? – txominpelu Feb 28 '14 at 11:12
  • @txominpelu To respond to the first comment, $(P \to Q) \to Q$ is false for $P = \bot = Q$ even in classical logic. – dtldarek Feb 28 '14 at 11:29
  • 1
    @txominpelu To answer the second comment, if the context is given, then this becomes more complicated. Proving that the context is malformed is not enough if it was given (e.g. language was extended with special term of such type). What you could do is take a Heyting algebra and valuation which satisfy the context, and prove that the term is still not a tautology. Cont. – dtldarek Feb 28 '14 at 11:39
  • @txominpelu Cont. However, sometimes the context is so strong that weird things can happen. For example, if you would have $\mathtt{with_return} : \big((P \to Q) \to P\big) \to P$ in the context, then you could have prove $P \lor \neg P$, i.e. $$\mathtt{with_return}\ (\lambda k.\ \mathtt{Right}\ \lambda p.\ k\ (\mathtt{Left}\ p)).$$ You need to be very careful in such setting. Fin. – dtldarek Feb 28 '14 at 11:40
  • Thanks for all the explanations. Finally I think I've been capable of proving that there's no term of type P in y: (P=>Q) => Q by using the fact that the normal form of the term in STLC is a succession of lambdas with a term that is a variable in the context. Since the only variable in the context is y and I cannot generate a term of type P from y there's no term of type P. – txominpelu Feb 28 '14 at 14:52