# Proving using axioms of propositional logic

As part of my upcoming exam in Mathematical Logic we are supposed to be able to prove a given statement using a list of given $axioms$, $M.P.$ and $H.S.$ My question is, how do I approach these kinds of problems? Where do I begin? Once I look at the solution I can fully understand it. But I cannot do it myself.

For example, using the following axioms and $M.P.$ and $H.S.$ prove the following statement:

(($\lnot$$\alpha)\rightarrow$$\beta$)$\rightarrow$(($\lnot$$\beta)\rightarrow$$\alpha$)

(L1) $\phi$$\rightarrow(\eta$$\rightarrow$$\phi) (L2) (\phi$$\rightarrow$($\eta$$\rightarrow$$\psi$)) $\rightarrow$(($\phi$$\rightarrow$$\eta$)$\rightarrow$($\phi$$\rightarrow$$\psi$))

(L3) (($\lnot$$\phi)\rightarrow(\lnot$$\eta$))$\rightarrow$($\eta$$\rightarrow$$\phi$)

(L4) $\phi$$\rightarrow$$\phi$

(L5) ($\lnot$($\lnot$$\phi))\rightarrow$$\phi$

(L6) $\phi$$\rightarrow(\lnot(\lnot$$\phi$))

The solution is here:

But I don't understand the thought process that goes into solving these problems. Any help is welcome.

• Do you happen to be following a textbook or class notes? What book? Are the notes freely available? – Git Gud Feb 24 '15 at 11:04
• @GitGud Unfortunately I'm following class notes, which also happen to be in Hebrew, so it would be difficult to share them. – Airwavezx Feb 24 '15 at 11:11
• Ahh, unlucky. Thanks anyway. – Git Gud Feb 24 '15 at 11:12

Such problems can be quite hard. I pride myself of being reasonably good at them, but I'm unable to give you more than very vague and highlevel guidelines for how to attack them.

In some cases you may be lucky enough to have a surefire method to fall back to. In particular if you have a constructive proof that the formal system you're using is complete, then this gives you an guaranteed if-everything-else-fails approach: First verify that the formula you have is a tautology, using truth tables, then trace out the steps in the completeness proof as applied to your formula.

The downside is that this method can lead to some humongously long and cumbersome formal proofs, even for pretty innocent-looking conclusions. Trying to be smart first is almost always worth the effort.

What is a general plan for trying to be smart, then? Eventually it comes down to practice and experience. I think, tenatively, that the required experience can be broken into two broad categories.

(1) A good intuitive understanding of logical formulas. Or preferably several intuitive views of formulas that you have enough practice with to switch between effortlessly, to look at the problem from several sides.

The official semantics of propositional formulas say that they specify how to combine truth values for the propositional letters into a truth value for the entire formula, using truth tables for each of the connectives. That's not wrong, but it's also not very stimulating to the imagination.

I think it is important to know at least one "resource interpretation" for propositional logic, along the lines of:

1. Each propositional letter is some kind of primitive resource.
2. $\varphi\to\psi$ is a machine that will give you a $\psi$ if you put a $\varphi$ into it.
3. $\varphi\land\psi$ is a boxed set containing a $\varphi$ and a $\psi$.
4. $\varphi\lor\psi$ is a mystery box that contains either a $\varphi$ or a $\psi$. You're allowed to look into it to see what it is. When you need to make a $\varphi\lor\psi$ yourself, you get to decide to whether to put a $\varphi$ or a $\psi$ into a box.
5. $\neg\varphi$ is a genie who always wanted a $\varphi$ and will grant you unlimited wishes if you give one to him. Or perhaps it is a snooty condescending genie who's convinced that $\varphi$s don't exist and is willing to bet you anything that you can't show him one.

Then a proof of $\varphi$ is the same as a recipe for making a $\varphi$.

For example, here you're asked to prove $(\neg\alpha\to\beta)\to(\neg\beta\to\alpha)$. My first step would be to get a mental model of that that means in the resource picture.

Hmm, I need to construct a machine that gets a $\neg\alpha\to\beta$ and produces another machine ... so that's the same as making a machine that gets a $\neg\alpha\to\beta$ and a $\neg\beta$ and must produce an $\alpha$. I have to figure out how I would combine those two components to get the required output.

This doesn't immediately help, because there seems to be nowhere to start. The $\neg \beta$ genie would give me the desired $\alpha$ if I provided him a $\beta$, which I could get the $\beta$ from $\neg\alpha\to\beta$, but then I need a $\neg\alpha$. Hmm.

This is where having several perspectives available helps, because -- back to the truth-value picture -- $\alpha$ is either true or false. If it's true, then I'm done immediately; if it's false then I have $\neg\alpha$ and can trade that for a $\beta$ and finally for a $\alpha$, and I'll be done.

So if the system proves the law of excluded middle, it means in the resource picture I can get, for free, a box that will contain either $\alpha$ or $\neg\alpha$. Open the box; if it's an $\alpha$ inside output that; but if it $\neg\alpha$ stick it into the $\neg\alpha\to\beta$ machine, and give the $\beta$ that comes out to the $\neg\beta$ genie. Then wish for an $\alpha$ you can output.

Unfortunately that doesn't really help us because the axioms you're using here don't seem to make it particularly easy to prove the law of excluded middle (actually as quoted it doesn't even know what $\lor$ is). And that brings us to the second kind of experience we need:

(2) Experience in working with the formal system in question. This is where we would file (2a) "if I understand how to do something in the resource picture, then how do I express that recipe in form of a proof in this particular system?". It's also where we need to answer (2b) "if I need to do something that's not possible in the constructive resource picture alone, then what means do I get for escaping it?" -- such as appealing to excluded middle, or double-negation elimination, or Peirce's law.

Of these (2a) is mostly a matter of practice with constructing proofs for the system. In your system, MP and the laws (L1), (L2) and (L4) are there essentially to be able to express manipulations of things into and out of machines, construction of machines that implement a given recipe and so forth. HS also seems to be in this category (I don't know what that stands for, but in your example it appears to be a shorthand rule for connecting the output of one machine to the input of another).

Also covered in (2a) is how to deal with negation in the system, which unfortunately varies a good deal more between systems than dealing with implication does.

All in all (2a) can be reasonably gained by doing a lot of exercises in the system. Unfortunately the skill this practice will result in is pretty much useless for anything but solving this kind of exercises, which only ever happens in formal-logic classrooms. In contrast, the experience I collected in (1) is in my experience pretty useful even outside classroom settings.

For (2b) there's some generally useful knowledge about common kinds of ways to escape the resource picture in proofs. In more technical terms, this is about knowing a variety of laws that can be added to intuititionistic logic to produce classical logic. This is where I went astray above, because my first idea was to use excluded middle, but excluded middle is not a primitive law in the particular system we're working with.

(I've kept that detour in the answer as an illustration of the kind of false starts one should be prepared to make a lot of before finding something that works).

A different escape hatch is double-negation elimination, your rule (L5). But there doesn't seem to be any simple way to bring that to bear on $(\neg\alpha\to\beta)\to(\neg\beta\to\alpha)$.

On the other hand, (L3) is clearly a form of contraposition, and $(\neg\alpha\to\beta)\to(\neg\beta\to\alpha)$ is also contraposition-like -- it's only a difference of where negations go. I also know, from long experience, that (L3) is a form of contraposition that's not intuitionistically valid, which makes (L3) begin to look promising indeed.

If I want to conclude $\neg\beta\to\alpha$ from (L3), I will need to supply it with $\neg\alpha\to\neg\neg\beta$. But all I have is $\neg\alpha\to\beta$. But -- back to truth values for a second here -- we know that $\neg\neg\beta$ is the same as $\beta$, so $\neg\alpha\to\neg\neg\beta$ is the same as $\neg\alpha\to\beta$.

This we can do in the resource picture. We want to construct a machine for $\neg\alpha\to\neg\neg\beta$. What this machine does is to get a $\neg\alpha$, run it trough the $\neg\alpha\to\beta$ we already have, and convert the resulting $\beta$ into $\neg\neg\beta$ using (L6), which conveniently does just that.

And this turns out to work. Getting these intuitive "kinematic" ideas about moving things into and out of machines transformed into the particular proof you quote is now just an application of category (2a) skills. The lines annotated (L1), (L2), MP, HS are part of standard idioms for tying things together; the creative content is in using (L3) and (L6).

As for how to learn those standard idioms for this particular system, I have no better advice than to look up the proof of the Deduction Theorem for the system (hopefully you have one) and working through exactly what it does in a fair number of examples.

Sorry if this answer is a bit rambling. I'm trying my best to give some kind of inside view of how a problem such as this would be attacked from a "quite experienced" standpoint. This may or may not be helpful to you -- the most general point to take home, I think, is that it is important to have many ways to think about logical formulas available, and being proficient in using all of them.

• I had to read your reply twice in order to fully digest it. But you gave me great tips which I will use. If I were to tell you that the language consists of $K={{\lnot, \rightarrow}}$ only and the aforementioned $axioms$, can you suggest an algorithm-like technique that will help me propel through the proof? Or is it just creativity? Or should I just refer to what you wrote in $(2a)$? – Airwavezx Feb 24 '15 at 11:15
• @Airwavezx: Well, again sorry for rambling. Mostly I'm afraid it's creativity and experience. As for an algorithmic approach, there's usually completeness theorems that can be applied, but as I mentioned at the beginning they tend to produce very large and ugly (even if formally correct) results. [And also ultimately such an algorithm is just a crutch, because what you eventually want to do is predicate logic, where there provably is no algorithm to apply]. – Henning Makholm Feb 24 '15 at 11:52
• I remembered this post and decided to come back. I got 93 in my exam. I solved this question in around 20 seconds (which got me 20/20 points ofc.) Your answer helped me achieve this :) – Airwavezx Jul 10 '15 at 16:19

Where do you begin?   You begin at the end!   Then you work backwards.

We wish to use $$\begin{array}{ll} (MP) & p, p\to q \vdash q \\ (HS) & p \to q, q\to r \vdash p \to r \\ (L1) & p \to (q \to p ) \\ (L2) & (p \to (q \to r )) \to ((p \to q ) \to (p \to r )) \\ (L3) & (\neg p \to \neg q )\to (q \to p ) \\ (L4) & p \to p \\ (L5) & \neg\neg p \to p \\ (L6) & p \to\neg\neg p \end{array}$$

To prove $(\neg a \to b )\to (\neg b \to a )$

Now working backwards we see that we almost have it in L3, except that substituting $\neg b$ for $q$ introduces a double negation where we need the literal.

$$(\neg p\to \neg q)\to(q\to p) \\ (\neg a \to \neg(\neg b) )\to ((\neg b) \to a )$$

This would be trivial if we could just substitute the double negation directly, but all we have are L5 and L6. So we need to somehow get from one of them to L3.

Now if we can show that $(\neg a \to b)\to(\neg a \to \neg\neg b)$ we can use hypothetical syllogism to get to what we want through L3.

$$\begin{array}{lll} P_{n-2} & (\neg a \to b)\to(\neg a \to \neg\neg b) & \\\hline P_{n-1} & (\neg a \to \neg(\neg b) )\to ((\neg b) \to a ) & L3 \\ \hline P_n & (\neg a \to b)\to(\neg b \to a) & HS, P_{n-1}, P_{n-2} \end{array}$$

However, that doesn't look like any of the axioms. So we'd need to get to it using MP or HS. We've already used HS, so looking at MP, we'd need something so that something implies $P_{n-2}$.

$$X \to ((\neg a \to b ) \to (\neg a \to \neg\neg b ))$$

One way to build such an implication is L1 $$p \to (q \to p ) \\ \color{red}{(\neg a \to \neg\neg b )} \to ((\neg a \to b ) \to (\neg a \to \neg\neg b ))$$

Another is L2. $$(p \to (q \to r )) \to ((p \to q ) \to (p \to r )) \\ \color{blue}{(\neg a \to (b \to \neg\neg b ))} \to ((\neg a \to b ) \to (\neg a \to \neg\neg b ))$$

That looks to be more fruitful of the two.

$$\begin{array}{lll} P_{n-4} & (\neg a \to (b \to \neg\neg b )) \\ \hline P_{n-3} & (\neg a \to (b \to \neg\neg b )) \to ((\neg a \to b ) \to (\neg a \to \neg\neg b )) & L2 \\ \hline P_{n-2} & (\neg a \to b)\to(\neg a \to \neg\neg b) & MP, P_{n-3}, P_{n-4} \\\hline P_{n-1} & (\neg a \to \neg(\neg b) )\to ((\neg b) \to a ) & L3 \\ \hline P_n & (\neg a \to b)\to(\neg b \to a) & HS, P_{n-1}, P_{n-2} \end{array}$$

Now let's try MP and L1, $X\to (\neg a \to (b \to \neg\neg b ))$

$$p \to (q \to p ) \\ \color{blue}{(b \to \neg\neg b )} \to (\neg a \to (b \to \neg\neg b ))$$

And we have stepped back to L6, and so by renumbering we have:

$$\begin{array}{lll} P_1 & b\to \neg \neg b & L6 \\ \hline P_2 & (b \to \neg\neg b ) \to (\neg a \to (b \to \neg\neg b )) & L1 \\ \hline P_3 & (\neg a \to (b \to \neg\neg b )) & MP, P_1, P_2 \\ \hline P_4 & (\neg a \to (b \to \neg\neg b )) \to ((\neg a \to b ) \to (\neg a \to \neg\neg b )) & L2 \\ \hline P_5 & (\neg a \to b)\to(\neg a \to \neg\neg b) & MP, P_3, P_4 \\\hline P_6 & (\neg a \to \neg(\neg b) )\to ((\neg b) \to a ) & L3 \\ \hline P_7 & (\neg a \to b)\to(\neg b \to a) & HS, P_5, P_6 \end{array}$$

• Thanks for the helpful reply. In your answer you mentioned "...We've already used HS, so looking at MP..." Is that simply intuition? Or is there something I don't fully understand when it comes to making this decision? – Airwavezx Feb 24 '15 at 11:37
• Mostly it would be intuition, @Airwavezx , but also because there's no other axioms we could use to build the syllogism. If we tried L3 again we'd need to show $(\neg a\to b)\to (\neg\neg\neg b\to \neg \neg a)$. If we tried $L1$ we'd need to show $(\neg a\to b)\to \neg\neg b$. Neither looks an attractive path. – Graham Kemp Feb 24 '15 at 12:34

This is a deep and difficult topic. You might want to see here: Tricks for Constructing Hilbert-Style Proofs There also exists some good advice in an old volume of L. H. Hackstaff entitled "Systems of Formal Logic".

I use Polish/Lukasiewicz notation.

For your particular system you have the deduction meta-theorem. Any time you can prove the rules of inference p $\vdash$ Cqp, and {CpCqr, Cpq} $\vdash$ Cpr you can prove the deduction theorem. That you can do so I hope is evident from having CpCqp and CCpCqrCCpqCpr as axioms in your system.

Thus, for your particular problem, we can assume things like follows:

assumption 1 | CNpq
assumption 2 |@ Nq


And we want to derive "p" from that. How can we get "p"? Well, if p is the consequent of some formula, and we can prove the antecedent of that same formula, then we can derive p in one step. Note that we only have "p" in the first assumption. So, we'll need to use that somewhere along the way. How do we get "p" into the consequent here? Well the axiom C CNpNq Cqp tells us that if can put a negation symbol before "q" we can then make that formula the antecedent which matches either with C CNpNq Cqp or a substitution instance of C CNpNq Cqp. CpNNp allows us to add two negations to any formula. Thus, from CNpq, and CqNNq, by having the rule HS we can derive CNpNNq. Then since we have C CNpNq Cqp we can derive CNqp. And the next step should be easy. Proceeding along those lines:

 instance of CpNNp               3 |@ CqNNq
this is a theorem               4 |@ C Cpq C Crp Crq
4, 3 MP (and some substitution) 5 |@ C Crq CrNNq
5, 1 MP (and some substitution) 6 |@ C Np NNq
axiom                           7 |@ C CNpNq Cqp
7, 6 MP (and some substitution) 8 |@ C Nq p
8, 2 MP                         9 |@ p


And from there we could apply the deduction meta-theorem to get our result.