Skip to main content

Deduction

(Content adapted from Critchlow & Eck)

Arguments

Logic can be applied to draw conclusions from a set of premises. A premise is just a proposition that is known to be true or that has been accepted to be true for the sake of argument, and a conclusion is a proposition that can be deduced logically from the premises. The idea is that if you believe that the premises are true, then logic forces you to accept that the conclusion is true. An "argument" is a claim that a certain conclusion follows from a given set of premises. Here is an argument laid out in a traditional format:

If today is Tuesday, then this is BelgiumToday is TuesdayThis is Belgium\begin{array}{l} \text{If today is Tuesday, then this is Belgium}\\ \text{Today is Tuesday}\\ \hline\therefore \text{This is Belgium} \end{array}

The premises of the argument are shown above the line, and the conclusion below. The symbol \therefore is read "therefore." The claim is that the conclusion, "This is Belgium," can be deduced logically from the two premises, "If today is Tuesday, then this is Belgium" and "Today is Tuesday." In fact, this claim is true. Logic forces you to accept this argument. Why is that?

Let pp stand for the proposition "Today is Tuesday," and let qq stand for the proposition "This is Belgium." Then the above argument has the form

pqpq\begin{array}{l} p\rightarrow q\\ p\\ \hline\therefore q \end{array}

Now, for any propositions pp and qqnot just the ones in this particular argumentif pqp\rightarrow q is true and pp is true, then qq must also be true. This is easy to check in a truth table:

ppqqpqp\rightarrow q
falsefalsetrue
falsetruetrue
truefalsefalse
truetruetrue

The only case where both pqp\rightarrow q and pp are true is on the last line of the table, and in this case, qq is also true. If you believe that pqp\rightarrow q and pp are true, you have no logical choice but to believe qq. This applies no matter what pp and qq represent. For example, if you believe "If Jill is breathing, then Jill pays taxes," and you believe that "Jill is breathing," logic forces you to believe that "Jill pays taxes." Note that we can't say for sure that the conclusion is true, only that if the premises are true, then the conclusion must be true.

This fact can be rephrased by saying that ((pq)p)q\big((p\rightarrow q)\land p\big)\rightarrow q is a tautology. More generally, for any compound propositions P\mathscr{P} and Q\mathscr{Q}, saying "PQ\mathscr{P}\rightarrow \mathscr{Q} is a tautology" is the same as saying that "in all cases where P\mathscr{P} is true, Q\mathscr{Q} is also true".1 We will use the notation PQ\mathscr{P}\vdash\mathscr{Q} to mean that PQ\mathscr{P}\rightarrow \mathscr{Q} is a tautology. Think of P\mathscr{P} as being the premise of an argument. To say PQ\mathscr{P}\vdash\mathscr{Q} is to say that Q\mathscr{Q} follows logically from P\mathscr{P}. We will use the same notation in both propositional logic and predicate logic. (Note that the relation of \vdash to \rightarrow is the same as the relation of \equiv to \leftrightarrow.)

Let P\mathscr{P} and Q\mathscr{Q} be any formulas in either propositional logic or predicate logic. The notation PQ\mathscr{P}\vdash\mathscr{Q} is used to mean that PQ\mathscr{P}\rightarrow\mathscr{Q} is a tautology. That is, in all cases where P\mathscr{P} is true, Q\mathscr{Q} is also true. We then say that Q\mathscr{Q} can be logically deduced from P\mathscr{P} or that P\mathscr{P} logically implies Q\mathscr{Q}.

More generally, if P1,,Pn\mathscr{P}_1, \ldots, \mathscr{P}_n and Q\mathscr{Q} are formulas, then we say that Q\mathscr{Q} can be logically deduced from the premises P1\mathscr{P}_1 through Pn\mathscr{P}_n, and write P1,,PnQ\mathscr{P}_1, \ldots, \mathscr{P}_n\vdash\mathscr{Q}, if P1PnQ\mathscr{P}_1\land\ldots\land\mathscr{P}_n\rightarrow\mathscr{Q} is a tautology.

An argument in which the conclusion follows logically from the premises is said to be a valid argument. To test whether an argument is valid, you have to replace the particular propositions or predicates that it contains with variables, and then test whether the conjunction of the premises logically implies the conclusion. We have seen that any argument of the form

pqpq\begin{array}{l} p\rightarrow q\\ p\\ \hline\therefore q \end{array}

is valid, since ((pq)p)q\big((p\rightarrow q)\land p\big)\rightarrow q is a tautology. This rule of deduction is called modus ponens. It plays a central role in logic. Another, closely related rule is modus tollens, which applies to arguments of the form

pq¬q¬p\begin{array}{l} p\rightarrow q\\ \lnot q\\ \hline\therefore \lnot p \end{array}

To verify that this is a valid argument, just check that pq,¬q¬pp\rightarrow q, \lnot q\vdash \lnot p, that is, that ((pq)¬q)¬p\big((p\rightarrow q)\land \lnot q\big)\rightarrow \lnot p is a tautology. As an example, the following argument has the form of modus tollens and is therefore a valid argument:

If Keanu Reeves is a good actor, then I’m the king of FranceI am not the king of FranceKeanu Reeves in not a good actor\begin{array}{l} \text{If Keanu Reeves is a good actor, then I'm the king of France}\\ \text{I am not the king of France}\\ \hline\therefore \text{Keanu Reeves in not a good actor} \end{array}

You should note carefully that the validity of this argument has nothing to do with whether or not Keanu Reeves can act well. The argument forces you to accept the conclusion only if you accept the premises. You can logically believe that the conclusion is false, as long as you believe that at least one of the premises is false.

Another named rule of deduction is the Law of Syllogism, which has the form

pqqrpr\begin{array}{l} p\rightarrow q\\ q\rightarrow r\\ \hline\therefore p\rightarrow r \end{array}

For example:

If you study hard, you do well in schoolIf you do well in school, you get a good jobIf you study hard, you get a good job\begin{array}{l} \text{If you study hard, you do well in school}\\ \text{If you do well in school, you get a good job}\\ \hline\therefore \text{If you study hard, you get a good job} \end{array}

There are many other possible rules that have been identified by logicians over the centuries. Below we will look at one particular set of rules known as natural deduction that may be used to derive all of the others in a fairly systematic way.

Logical deduction is related to logical equivalence. We defined P\mathscr{P} and Q\mathscr{Q} to be logically equivalent if PQ\mathscr{P}\leftrightarrow\mathscr{Q} is a tautology. Since PQ\mathscr{P}\leftrightarrow\mathscr{Q} is equivalent to (PQ)(QP)(\mathscr{P}\rightarrow\mathscr{Q})\land(\mathscr{Q}\rightarrow\mathscr{P}), we see that PQ\mathscr{P}\equiv \mathscr{Q} if and only if both QP\mathscr{Q}\vdash\mathscr{P} and PQ\mathscr{P}\vdash\mathscr{Q}. Thus, we can show that two statements are logically equivalent if we can show that each of them can be logically deduced from the other.

Natural Deduction

In general, arguments are more complicated that those we've considered so far. Here, for example, is an argument that has five premises:

(pr)sqptrqts\begin{array}{l} (p\land r)\rightarrow s\\ q\rightarrow p\\ t\rightarrow r\\ q\\ t\\ \hline\therefore s \end{array}

Is this argument valid? Of course, you could use a truth table to check whether the conjunction of the premises logically implies the conclusion. But with five propositional variables, the table would have 32 lines, and the size of the table grows quickly when more propositional variables are used. So, in general, truth tables are not practical.

Fortunately, there is another way to proceed, based on the fact that it is possible to chain several logical deductions together. That is, if PQ\mathscr{P}\vdash\mathscr{Q} and QR\mathscr{Q}\vdash\mathscr{R}, it follows that PR\mathscr{P}\vdash\mathscr{R}. This means we can demonstrate the validity of an argument by deducing the conclusion from the premises in a sequence of steps. These steps can be presented in the form of a proof:

A formal proof that an argument is valid consists of a sequence of propositions such that the last proposition in the sequence is the conclusion of the argument, and every proposition in the sequence is either a premise of the argument or follows by logical deduction from propositions that precede it in the list.

The deduction rules, the primitive argument forms that we will chain together into complete proofs, are described in more detail below. One of the characteristics of natural deduction is that there are rules associated with each logical operator that determine how to either introduce or eliminate the operator. This can provide a great deal of guidance when writing a proof, because as you fill in the steps you can look at the main operators of the current goal(s) and the available premiseseither you will work backwards from a goal by use of an introduction rule or you will work forwards from a premise by use of an elimination rule.

The existence of such a proof shows that the conclusion follows logically from the premises, and therefore that the argument is valid. Here is a formal proof that the argument given above is valid. The propositions in the proof are labeled, and each proposition has a justification.

1:qppremise2:qpremise3:pE 1,24:trpremise5:tpremise6:rE 4,57:prI 3,68:prspremise9:sE 8,7\begin{array}{l|l} \ell_1: q\rightarrow p & \text{premise}\\ \ell_2: q & \text{premise}\\ \ell_3: p & \rightarrow E\ \ell_1, \ell_2\\ \ell_4: t\rightarrow r & \text{premise}\\ \ell_5: t & \text{premise}\\ \ell_6: r & \rightarrow E\ \ell_4, \ell_5\\ \ell_7: p\land r & \land I\ \ell_3, \ell_6\\ \ell_8: p\land r\rightarrow s & \text{premise}\\ \ell_9: s & \rightarrow E\ \ell_8, \ell_7 \end{array}

Once a formal proof has been constructed, it is convincing. Unfortunately, it's not necessarily easy to come up with the proof. Usually, the best method is a combination of working forward ("Here's what I know, what can I deduce from that?") and working backwards ("Here's what I need to prove, what other things would imply that?"). For this proof, I might have thought: I want to prove ss. I know that prp\land r implies ss, so if I can prove prp\land r, I'm OK. But to prove prp\land r, it'll be enough to prove pp and rr separately.

Natural Deduction Rules

As mentioned above, the particular set of primitive argument forms that we will use are grouped into introduction and elimination rules for each of the logical operators. Here we will explain each deduction rule, justify it, and show examples of how they may be used in proofs. At the end of this section is a table summarizing all of the rules.

Conjunction

The conjunction pqp\land q is true when both pp and qq are true. Therefore, to introduce the conjunction pqp\land q in a proof we need to first establish the premises pp and qq individually:

i:pj:qpq,I i,j\begin{array}{l} i: p\\ j: q\\ \hline\therefore p\land q, \quad\land I\ i,j \end{array}

The ii and jj labels on the premises are shown here to allow us to refer to them in the "justification" attached to the conclusion: I i,j\land I\ i, j stands for "AND introduction from premises labeled ii and jj." Here is an example of how this rule might be used in the proof of ¬p,pq¬p(pq)\lnot p, p\lor q\vdash\lnot p\land(p\lor q):

1:¬ppremise2:pqpremise3:¬p(pq)I 1,2\begin{array}{l|l} \ell_1: \lnot p & \text{premise}\\ \ell_2: p\lor q & \text{premise}\\ \ell_3: \lnot p\land(p\lor q) & \land I\ \ell_1, \ell_2 \end{array}

The elimination rules for conjunction allow us to move from the premise pqp\land q to either the conclusion pp or the conclusion qq:

i:pqp,E1 i\begin{array}{l} i: p\land q\\ \hline\therefore p, \quad\land E_1\ i \end{array}
i:pqq,E2 i\begin{array}{l} i: p\land q\\ \hline\therefore q, \quad\land E_2\ i \end{array}

Here is a proof that combines the introduction and elimination rules for conjunction to prove pqqpp\land q\vdash q\land p, i.e., that AND is commutative:

1:pqpremise2:qE2 13:pE1 14:qpI 2,3\begin{array}{l|l} \ell_1: p\land q & \text{premise}\\ \ell_2: q & \land E_2\ \ell_1\\ \ell_3: p & \land E_1\ \ell_1\\ \ell_4: q\land p & \land I\ \ell_2, \ell_3 \end{array}

Note that we used the second elimination rule in step 2\ell_2 and the first in 3\ell_3, to extract respectively the second and the first terms of the conjunction. Here is an equivalent proof using the rules in the other order:

1:pqpremise2:pE1 13:qE2 14:qpI 3,2\begin{array}{l|l} \ell_1: p\land q & \text{premise}\\ \ell_2: p & \land E_1\ \ell_1\\ \ell_3: q & \land E_2\ \ell_1\\ \ell_4: q\land p & \land I\ \ell_3, \ell_2 \end{array}

In the justification for step 4\ell_4, we specify that the term from 3\ell_3 (qq) is used first in the conclusion. Although we have just proved that conjunction is commutative, it is important for a careful proof to keep track of this sort of distinction.

Implication

The implication pqp\rightarrow q says that whenever pp is true, qq must also be true. To introduce an implication in a proof, we will temporarily assume pp and show that, based on that assumption, we are then able to conclude qq. As a deduction rule, this argument will take the form of a nested proof, analogous to a nested block of code that may introduce temporary local variables, or a function definition that may use parameters. The notation we will use for this is inspired by the notation for an anonymous function block in languages such as JavaScript, Scala, and ReasonML:

i:p{q}pq,I i\begin{array}{l} i: p \Rightarrow\{\\ \quad\ldots\\ \quad q\\ \}\\ \hline\therefore p\rightarrow q, \quad\rightarrow I\ i \end{array}

The curly braces around the nested proof (which is also indented for clarity) emphasize that the temporary assumption that pp is true, labeled ii, is only available within that section of the proof. No conclusion within the braces should be referred to from outside that section (just as you cannot access local variables from a block or function definition when programming); at the end of the subproof, we extract the last conclusion (qq) but only in the form of the implication pqp\rightarrow qif pp is true, then qq is also true.

Here is an example of a proof of the tautology (since a tautology may be viewed as an argument with no premises) pqqpp\land q\rightarrow q\land p:

1:pq{2:qE2 13:pE1 14:qpI 2,3}5:pqqpI 1\begin{array}{l|l} \ell_1: p\land q\Rightarrow\{ & \\ \quad\ell_2: q & \land E_2\ \ell_1\\ \quad\ell_3: p & \land E_1\ \ell_1\\ \quad\ell_4: q\land p & \land I\ \ell_2, \ell_3\\ \}\\ \ell_5: p\land q\rightarrow q\land p & \rightarrow I\ \ell_1 \end{array}

Note that when the justification in step 5\ell_5 refers to 1\ell_1, it means the entire subproof. However, the reference to 1\ell_1 in the justifications for 2\ell_2 and 3\ell_3 is to the premise pp. The premise pp is only available within the braces, as are each of the conclusions 2\ell_2 through 4\ell_4 which rely on that temporary assumption.

The analogy with defining a function taking the hypothesis pp as a parameter and returning the conclusion qq is not accidental. The elimination rule, which you may recognize as our old friend modus ponens, is very much like function application: if we have a proof of pqp\rightarrow q, and we can also supply an argument that pp is true, then we may conclude that qq is true. Just as a function body describes how to takes an argument passed in through its parameter and compute a result, the subproof that establishes pqp\rightarrow q tells us how to take an argument (!) for pp and produce the extra steps needed to conclude qq.

i:pqj:pq,E i,j\begin{array}{l} i: p\rightarrow q\\ j: p\\ \hline\therefore q, \quad\rightarrow E\ i,j \end{array}

Here is a proof of the argument pqppqp\rightarrow q\vdash p\rightarrow p\land q:

1:pqpremise2:p{3:qE 1,24:pqI 2,3}5:ppqI 2\begin{array}{l|l} \ell_1: p\rightarrow q & \text{premise}\\ \ell_2: p\Rightarrow\{ & \\ \quad\ell_3: q & \rightarrow E\ \ell_1, \ell_2\\ \quad\ell_4: p\land q & \land I\ \ell_2, \ell_3\\ \}\\ \ell_5: p\rightarrow p\land q & \rightarrow I\ \ell_2 \end{array}

Disjunction

To prove the disjunction pqp\lor q, it is enough to prove either pp or qq alone. This leads to two obvious introduction rules:

i:ppq,I1 i\begin{array}{l} i: p\\ \hline\therefore p\lor q, \quad\lor I_1\ i \end{array}
i:qpq,I2 i\begin{array}{l} i: q\\ \hline\therefore p\lor q, \quad\lor I_2\ i \end{array}

Here are two distinct proofs of the argument pqpqp\land q\vdash p\lor q:

Proof 1:

1:pqpremise2:pE1 13:pqI1 2\begin{array}{l|l} \ell_1: p\land q & \text{premise}\\ \ell_2: p & \land E_1\ \ell_1\\ \ell_3: p\lor q & \lor I_1\ \ell_2 \end{array}

Proof 2:

1:pqpremise2:qE2 13:pqI2 2\begin{array}{l|l} \ell_1: p\land q & \text{premise}\\ \ell_2: q & \land E_2\ \ell_1\\ \ell_3: p\lor q & \lor I_2\ \ell_2 \end{array}

Although they have the same premises and conclusions, these two proofs are giving fundamentally different reasons why the conclusion follows from the premise. Note that in the introduction rules for disjunction, one of the terms in the disjunction appears "from nowhere". The argument in proof 1 could equally well conclude prp\lor r from the premise pqp\land q, where rr could be anything; however, the argument in proof 2 would allow us to conclude instead rqr\lor q for any proposition rr.

This peculiar behavior of disjunction extends to the elimination rule. Whereas the introduction rules appear to be duals of the elimination rules for conjunction, the elimination rule for disjunction is significantly more complicated that just a dual of the introduction for conjunction.2 What we have is essentially a case analysisto eliminate an OR, we need to conduct two subproofs (just as in the I\rightarrow I rule), one for each possible case. Here is the rule:

i:pqj:p{r}k:q{r}r,E i,j,k\begin{array}{l} i: p\lor q\\ j: p\Rightarrow\{\\ \quad\ldots\\ \quad r\\ \}\\ k: q\Rightarrow\{\\ \quad\ldots\\ \quad r\\ \}\\ \hline\therefore r, \quad\lor E\ i, j, k \end{array}

In words, this says that we have our disjunction, pqp\lor q, labeled ii, plus two nested subproofs, labeled jj and kk (as always, in an actual proof, these parts may be laid out in any order, with other parts of the proof in between; however, for readability it is suggested that the proof be structured just as shown). The subproof jj concludes some proposition rr from the additional premise pp, while the subproof kk concludes the same rr from the alternate premise qq. Since we know that either pp or qq is true at this point in the proof, we are able to conclude rr regardless of which it is.

Here is a proof that OR is commutative (pqqpp\lor q\vdash q\lor p):

1:pqpremise2:p{3:qpI2 2}4:q{5:qpI1 2}6:qpE 1,2,4\begin{array}{l|l} \ell_1: p\lor q & \text{premise}\\ \ell_2: p\Rightarrow\{\\ \quad\ell_3: q\lor p & \lor I_2\ \ell_2\\ \}\\ \ell_4: q\Rightarrow\{\\ \quad\ell_5: q\lor p & \lor I_1\ \ell_2\\ \}\\ \ell_6: q\lor p & \lor E\ \ell_1, \ell_2, \ell_4 \end{array}

True and False

We may think of T\T as a conjunction of zero things: it is true whenever all of those (zero) things are true, i.e., it is always true. Compare this with taking the sum of an empty set of numbers: the result is 0, which is the identity for ++, just as T\T is the identity for \land. Using this analogy, we get one introduction rule for T\T (with zero premises) and zero elimination rules:

T,TI\begin{array}{l} \hline\therefore \T, \quad\T I \end{array}

In words, we may conclude T\T at any time with no premises. This is not generally useful, but we include it for completeness.

Similarly, we may think of F\F as a disjunction of zero things, noting as above that F\F is the identity for \lor. It is false unless at least one of those zero things is true. This suggests that we get zero introduction rules and one elimination rule, which just has the premise F\F and zero nested subproofs:

i:Fr,FE i\begin{array}{l} i: \F\\ \hline\therefore r, \quad\F E\ i \end{array}

That is, if we have a proof of F\F, labeled ii, then we can produce a proof of any arbitrary proposition rr! Logicians like to refer to this as ex falso quodlibet, "from falsehood, anything." If your premises are consistent, you should never be able to prove F\F at the top level of a proof; if you could do that, then you could use this rule to prove anything whatsoever. This rule is useful in nested proofs (for example in disjunction elimination, doing a case analysis), where if temporary assumption leads to a contradiction then we can conclude anything in that subproof, secure in the belief that that assumption will never actually be true.

Here is an example, where we validate the common argument that if we know that either pp or qq is true, and we know that pp implies false, then qq must actually be true:

1:pqpremise2:pFpremise3:p{4:FE 2,35:qFE 4}6:q{7:q6 (see below)}8:qE 1,3,6\begin{array}{l|l} \ell_1: p\lor q & \text{premise}\\ \ell_2: p\rightarrow\F & \text{premise}\\ \ell_3: p\Rightarrow\{\\ \quad\ell_4: \F & \rightarrow E\ \ell_2, \ell_3\\ \quad\ell_5: q & \F E\ \ell_4\\ \}\\ \ell_6: q\Rightarrow\{\\ \quad\ell_7: q & \ell_6\text{ (see below)}\\ \}\\ \ell_8: q & \lor E\ \ell_1, \ell_3, \ell_6 \end{array}

Note that step 7\ell_7 is justified by simply copying the proposition from 6\ell_6; this will be discussed further in the Miscellaneous section below.

Negation

Since the laws of Boolean algebra tell us that ¬ppF\lnot p\equiv p\rightarrow\F, we could simply derive the rules for negation from those for implication, specialized to the conclusion F\F. However, it is convenient to have rules explicitly to deal with negation. There is also one additional rule for negation that does not fit the pattern of the rest of the rules (see below).

Accordingly, here is the introduction rule for negation:

i:p{F}¬p,¬I i\begin{array}{l} i: p \Rightarrow\{\\ \quad\ldots\\ \quad \F\\ \}\\ \hline\therefore \lnot p, \quad\lnot I\ i \end{array}

In words, if we give a nested subproof that arrives at a contradiction (i.e., a proof of F\F) from the assumption that pp is true, then pp must actually be false.

Similarly, here is the elimination rule for negation:

i:¬pj:pF,¬E i,j\begin{array}{l} i: \lnot p\\ j: p\\ \hline\therefore \F, \quad\lnot E\ i,j \end{array}

That is, one way to demonstrate a contradiction is to have proofs (ii and jj) of both ¬p\lnot p and pp. Compare these rules to I\rightarrow I and E\rightarrow E, and confirm that they are just the special case of rules for pqp\rightarrow q where qq is F\F.

Using these, here is a proof of one direction of the equivalence between pqp\rightarrow q and its contrapositive ¬q¬p\lnot q\rightarrow\lnot p:

1:pqpremise2:¬q{3:p{4:qE 1,35:F¬E 2,4}6:¬p¬I 3}7:¬q¬pI 2\begin{array}{l|l} \ell_1: p\rightarrow q & \text{premise}\\ \ell_2: \lnot q\Rightarrow\{\\ \quad\ell_3: p\Rightarrow\{\\ \quad\quad\ell_4: q & \rightarrow E\ \ell_1, \ell_3\\ \quad\quad\ell_5: \F & \lnot E\ \ell_2, \ell_4\\ \quad\}\\ \quad\ell_6: \lnot p & \lnot I\ \ell_3\\ \}\\ \ell_7: \lnot q\rightarrow\lnot p & \rightarrow I\ \ell_2 \end{array}

If you try to prove the other direction of this equivalence, you will have a surprisingly difficult time. In fact, it is possible to show that there is no proof of the argument ¬q¬ppq\lnot q\rightarrow\lnot p\vdash p\rightarrow q using the rules seen so far.3 The closest you will be able to get starting from the premise ¬q¬p\lnot q\rightarrow\lnot p is to conclude p¬¬qp\rightarrow\lnot\lnot q:

1:¬q¬ppremise2:p{3:¬q{4:¬pE 1,35:F¬E 4,2}6:¬¬q¬I 3}7:p¬¬qI 2\begin{array}{l|l} \ell_1: \lnot q\rightarrow\lnot p & \text{premise}\\ \ell_2: p\Rightarrow\{\\ \quad\ell_3: \lnot q\Rightarrow\{\\ \quad\quad\ell_4: \lnot p & \rightarrow E\ \ell_1, \ell_3\\ \quad\quad\ell_5: \F & \lnot E\ \ell_4, \ell_2\\ \quad\}\\ \quad\ell_6: \lnot\lnot q & \lnot I\ \ell_3\\ \}\\ \ell_7: p\rightarrow\lnot\lnot q & \rightarrow I\ \ell_2 \end{array}

Although you may be tempted to just erase the double negation, in a formal proof you need to justify every step, and it turns out that we do not have any way yet to prove ¬¬qq\lnot\lnot q\vdash q! Therefore, the very last rule we will add (apart from wrapping up some loose ends in the next section) is the rule of double negation elimination:

i:¬¬pp,¬¬E i\begin{array}{l} i: \lnot\lnot p\\ \hline\therefore p, \quad\lnot\lnot E\ i \end{array}

With this additional rule, we may finish the proof of the equivalence of the contrapositive:

1:¬q¬ppremise2:p{3:¬q{4:¬pE 1,35:F¬E 4,2}6:¬¬q¬I 37:q¬¬E 6}8:pqI 2\begin{array}{l|l} \ell_1: \lnot q\rightarrow\lnot p & \text{premise}\\ \ell_2: p\Rightarrow\{\\ \quad\ell_3: \lnot q\Rightarrow\{\\ \quad\quad\ell_4: \lnot p & \rightarrow E\ \ell_1, \ell_3\\ \quad\quad\ell_5: \F & \lnot E\ \ell_4, \ell_2\\ \quad\}\\ \quad\ell_6: \lnot\lnot q & \lnot I\ \ell_3\\ \quad\ell_7: q & \lnot\lnot E\ \ell_6\\ \}\\ \ell_8: p\rightarrow q & \rightarrow I\ \ell_2 \end{array}

Miscellaneous

As mentioned above, it is sometimes useful in a proof to repeat a proposition from earlier (always remembering that we do not have access to propositions from nested proofs from the outside). This leads to the trivial rule

i:pp,i\begin{array}{l} i: p\\ \hline\therefore p, \quad i \end{array}

The justification for pp is simply the label of the previous line where pp was established.

Here is an example of using this to prove the tautology ppp\rightarrow p:

1:p{2:p1}3:ppI 1\begin{array}{l|l} \ell_1: p\Rightarrow\{\\ \quad\ell_2: p & \ell_1\\ \}\\ \ell_3: p\rightarrow p & \rightarrow I\ \ell_1 \end{array}

As another convenience, once we have proven the validity of some argument p1,,pnqp_1,\ldots,p_n\vdash q, we may reuse that proof in future proofs as if it were another deduction rule:

i1:p1in:pnq,(p1,,pnq) i1,,in\begin{array}{l} i_1: p_1\\ \ldots\\ i_n: p_n\\ \hline\therefore q, \quad (p_1,\ldots,p_n\vdash q)\ i_1,\ldots,i_n \end{array}

Instead of citing the argument like that in the justification, it is common to give names to useful results (such as the modus tollens and syllogism arguments discussed earlier). Also note that we may perform any consistent substitution for the propositional variables in the argument.

As an example, here is a use of the modus tollens law, pq,¬q¬pp\rightarrow q, \lnot q\vdash\lnot p, to prove an extended version:

1:pqpremise2:qrpremise3:¬rpremise4:¬qmodus tollens 2,35:¬pmodus tollens 1,4\begin{array}{l|l} \ell_1: p\rightarrow q & \text{premise}\\ \ell_2: q\rightarrow r & \text{premise}\\ \ell_3: \lnot r & \text{premise}\\ \ell_4: \lnot q & \text{modus tollens}\ \ell_2, \ell_3\\ \ell_5: \lnot p & \text{modus tollens}\ \ell_1, \ell_4 \end{array}

Given a proof of the law of syllogism, pq,qrprp\rightarrow q, q\rightarrow r\vdash p\rightarrow r, we could also prove the above as follows:

1:pqpremise2:qrpremise3:prsyllogism 1,24:¬rpremise5:¬pmodus tollens 3,4\begin{array}{l|l} \ell_1: p\rightarrow q & \text{premise}\\ \ell_2: q\rightarrow r & \text{premise}\\ \ell_3: p\rightarrow r & \text{syllogism}\ \ell_1, \ell_2\\ \ell_4: \lnot r & \text{premise}\\ \ell_5: \lnot p & \text{modus tollens}\ \ell_3, \ell_4 \end{array}

In programming terms, using an already proven theorem like this is analogous to calling an already written function out of a library.

Summary of Natural Deduction Rules


Conjunction:

i:pj:qi:pqi:pqpq,I i,jp,E1 iq,E2 i\begin{array}{ll|ll|l} i: p & \qquad & & \qquad & \\ j: q & & i: p\land q & & i: p\land q\\ \hline \therefore p\land q, \quad\land I\ i, j & & \therefore p, \quad\land E_1\ i & & \therefore q, \quad\land E_2\ i \end{array}

Implication, Reference:

i:p{qi:pq}j:pi:ppq,I iq,E i,jp,i\begin{array}{ll|ll|l} i: p \Rightarrow\{ & \qquad & & \qquad & \\ \quad\ldots\\ \quad q & & i: p\rightarrow q\\ \} & & j: p & & i: p\\ \hline \therefore p\rightarrow q, \quad\rightarrow I\ i & & \therefore q, \quad\rightarrow E\ i,j & & \therefore p, \quad i \end{array}

Disjunction:

i:pqj:p{r}k:q{ri:pi:q}pq,I1 ipq,I2 ir,E i,j,k\begin{array}{ll|ll|l} & \qquad & & \qquad & i: p\lor q\\ & & & & j: p\Rightarrow\{\\ & & & & \quad\ldots\\ & & & & \quad r\\ & & & & \}\\ & & & & k: q\Rightarrow\{\\ & & & & \quad\ldots\\ & & & & \quad r\\ i: p & & i: q & & \}\\ \hline \therefore p\lor q, \quad\lor I_1\ i & & \therefore p\lor q, \quad\lor I_2\ i & & \therefore r, \quad\lor E\ i, j, k \end{array}

True, False, Theorem:

i1:p1i:Fin:pnT,TIr,FE iq,(p1,,pnq) i1,,in\begin{array}{ll|ll|l} & \qquad & & \qquad & i_1: p_1\\ & & & & \ldots\\ & & i: \F & & i_n: p_n\\ \hline \therefore\T, \quad\T I & & \therefore r, \quad\F E\ i & & \therefore q, \quad (p_1,\ldots,p_n\vdash q)\ i_1,\ldots,i_n \end{array}

Negation:

i:p{Fi:¬p}j:pi:¬¬p¬p,¬I iF,¬E i,jp,¬¬E i\begin{array}{ll|ll|l} i: p \Rightarrow\{ & \qquad & & \qquad & \\ \quad\ldots\\ \quad \F & & i: \lnot p\\ \} & & j: p & & i: \lnot\lnot p\\ \hline \therefore\lnot p, \quad\lnot I\ i & & \therefore\F, \quad\lnot E\ i,j & & \therefore p, \quad\lnot\lnot E\ i \end{array}

Invalid Arguments

Of course, not every argument is valid, so the question also arises, how can we show that an argument is invalid? Let's assume that the argument has been put into general form, with all the specific propositions replaced by propositional variables. The argument is valid if in all cases where all the premises are true, the conclusion is also true. The argument is invalid if there is even one case where all the premises are true and the conclusion is false. We can prove that an argument is invalid by finding an assignment of truth values to the propositional variables which makes all the premises true but makes the conclusion false. For example, consider an argument of the form:

pqq(pr)rp\begin{array}{l} p\rightarrow q\\ q\rightarrow (p\land r)\\ r\\ \hline\therefore p \end{array}

In the case where pp is false, qq is false, and rr is true, the three premises of this argument are all true, but the conclusion is false. This shows that the argument is invalid.

Example

To apply all this to arguments stated in English, we have to introduce propositional variables to represent all the propositions in the argument. For example, consider:

John will be at the party if Mary is there and Bill is not there. Mary will be at the party if it's on Friday or Saturday. If Bill is at the party, Tom will be there. Tom won't be at the party if it's on Friday. The party is on Friday. Therefore, John will be at the party.

Let jj stand for "John will be at the party," mm for "Mary will be there," bb for "Bill will be there," tt for "Tom will be there," ff for "The party is on Friday," and ss for "The party is on Saturday." Then this argument has the form

(m¬b)j(fs)mbtf¬tfj\begin{array}{l} (m\land \lnot b)\rightarrow j\\ (f\lor s)\rightarrow m\\ b\rightarrow t\\ f\rightarrow \lnot t\\ f\\ \hline\therefore j \end{array}

This is a valid argument, as the following proof shows:

1:f¬tpremise2:fpremise3:¬tE 1,24:btpremise5:¬bmodus tollens 4,36:fsI1 27:(fs)mpremise8:mE 7,69:m¬bI 8,510:(m¬b)jpremise11:jE 10,9\begin{array}{l|l} \ell_1: f\rightarrow\lnot t & \text{premise}\\ \ell_2: f & \text{premise}\\ \ell_3: \lnot t & \rightarrow E\ \ell_1, \ell_2\\ \ell_4: b\rightarrow t & \text{premise}\\ \ell_5: \lnot b & \text{modus tollens}\ \ell_4, \ell_3\\ \ell_6: f\lor s & \lor I_1\ \ell_2\\ \ell_7: (f\lor s)\rightarrow m & \text{premise}\\ \ell_8: m & \rightarrow E\ \ell_7, \ell_6\\ \ell_9: m\land\lnot b & \land I\ \ell_8, \ell_5\\ \ell_{10}: (m\land\lnot b)\rightarrow j & \text{premise}\\ \ell_{11}: j & \rightarrow E\ \ell_{10}, \ell_9 \end{array}

Predicate Logic

So far in this section, we have been working mostly with propositional logic. But the definitions of valid argument and logical deduction apply to predicate logic as well. One of the most basic rules of deduction in predicate logic says that (xP(x))P(a)(\forall xP(x))\vdash P(a) for any entity aa in the domain of discourse of the predicate PP. That is, if a predicate is true of all entities, then it is true of any given particular entity. This rule can be combined with rules of deduction for propositional logic to give the following valid arguments

x(P(x)Q(x))P(a)Q(a)\begin{array}{l} \forall x(P(x)\rightarrow Q(x))\\ P(a)\\ \hline\therefore Q(a) \end{array}
x(P(x)Q(x))¬Q(a)¬P(a)\begin{array}{l} \forall x(P(x)\rightarrow Q(x))\\ \lnot Q(a)\\ \hline\therefore \lnot P(a) \end{array}

These valid arguments go by the names of modus ponens and modus tollens for predicate logic. Note that from the premise x(P(x)Q(x))\forall x(P(x)\rightarrow Q(x)) we can deduce P(a)Q(a)P(a)\rightarrow Q(a). From this and from the premise that P(a)P(a), we can deduce Q(a)Q(a) by modus ponens. So the first argument above is valid. The second argument is similar, using modus tollens.

The most famous logical deduction of them all is an application of modus ponens for predicate logic:

All humans are mortalSocrates is humanSocrates is mortal\begin{array}{l} \text{All humans are mortal}\\ \text{Socrates is human}\\ \hline\therefore \text{Socrates is mortal} \end{array}

This has the form of modus ponens with P(x)P(x) standing for "xx is human," Q(x)Q(x) standing for "xx is mortal," and aa standing for the noted entity, Socrates.

There is a lot more to say about logical deduction and proof in predicate logic, and we'll spend the rest of this chapter on the subject.

Exercises

  1. Verify the validity of modus tollens and the Law of Syllogism.

    Answer

    For modus tollens, we need to check that ((pq)¬q)¬p((p\rightarrow q)\land\lnot q)\rightarrow\lnot p is a tautology. One way to do this is with a truth table:

    ppqq(pq(p\rightarrow q\land¬q)\lnot q)\rightarrow¬p\lnot p
    falsefalsetruetruetruetruetrue
    falsetruetruefalsefalsetruetrue
    truefalsefalsefalsetruetruefalse
    truetruetruefalsefalsetruefalse

    For the Law of Syllogism, we need to check that ((pq)(qr))(pr)((p\rightarrow q)\land(q\rightarrow r))\rightarrow(p\rightarrow r) is a tautology. Rather than building an eight-row truth table, let's do this with the laws of Boolean algebra, using the equivalence (pq)(¬pq)(p\rightarrow q)\equiv(\lnot p\lor q):

    ((pq)(qr))(pr)((p\rightarrow q)\land(q\rightarrow r))\rightarrow(p\rightarrow r)¬((¬pq)(¬qr))(¬pr)\equiv\lnot((\lnot p\lor q)\land(\lnot q\lor r))\lor(\lnot p\lor r)Definition of \rightarrow
    ¬(¬pq)¬(¬qr)(¬pr)\equiv\lnot(\lnot p\lor q)\lor\lnot(\lnot q\lor r)\lor(\lnot p\lor r)De Morgan
    (p¬q)(q¬r)¬pr\equiv(p\land\lnot q)\lor(q\land\lnot r)\lor\lnot p\lor rDe Morgan, Double Negation
    (p¬q)¬p(q¬r)r\equiv(p\land\lnot q)\lor\lnot p\lor(q\land\lnot r)\lor rCommutative
    ((p¬p)(¬q¬p))((qr)(¬rr))\equiv((p\lor\lnot p)\land(\lnot q\lor\lnot p))\lor((q\lor r)\land(\lnot r\lor r))Distributive
    (T(¬q¬p))((qr)T)\equiv(\T\land(\lnot q\lor\lnot p))\lor((q\lor r)\land\T)Excluded Middle
    ¬q¬pqr\equiv\lnot q\lor\lnot p\lor q\lor rIdentity
    T¬pr\equiv\T\lor\lnot p\lor rExcluded Middle
    T\equiv\TAnnihilation
  2. Each of the following is a valid rule of deduction. For each one, give an example of a valid argument in English that uses that rule.

pq¬pq\begin{array}{l} p\lor q\\ \lnot p\\ \hline\therefore q \end{array}
Answer

I have soup or a salad with my meal. I do not have soup with my meal. Therefore, I have a salad with my meal.

pqpq\begin{array}{l} p\\ q\\ \hline\therefore p\land q \end{array}
Answer

I have an apple. I have a banana. Therefore, I have an apple and a banana.

pqp\begin{array}{l} p\land q\\ \hline\therefore p \end{array}
Answer

I have an apple and a banana. Therefore, I have an apple.

ppq\begin{array}{l} p\\ \hline\therefore p\lor q \end{array}
Answer

I walked ten miles. Therefore, I walked ten miles or ran ten miles.

  1. There are two notorious invalid arguments that look deceptively like modus ponens and modus tollens:
pqqp\begin{array}{l} p\rightarrow q\\ q\\ \hline\therefore p \end{array}
pq¬p¬q\begin{array}{l} p\rightarrow q\\ \lnot p\\ \hline\therefore \lnot q \end{array}

Show that each of these arguments is invalid. Give an English example that uses each of these arguments.

Answer

The first argument fails when pp is false while qq is true. For example, "If I were a millionaire, then I would own a house. I own a house. Therefore, I am a millionaire."

The second argument also fails when pp is false while qq is true. For example, "If the moon is made of blue cheese, then 2+2=42+2=4. The moon is not made of blue cheese. Therefore, 2+242+2\not=4."

  1. Decide whether each of the following arguments is valid. If it is valid, give a formal proof. If it is invalid, show that it is invalid by finding an appropriate assignment of truth values to propositional variables.

    1. pqqsp\begin{array}{l} p\rightarrow q\\ q\rightarrow s\\ \hline\therefore p \end{array}
      Answer

      Invalid. Take pp and qq false, so that both premises are vacuously true but the conclusion is false.

    2. pqq(rs)¬rs\begin{array}{l} p\land q\\ q\rightarrow (r\lor s)\\ \lnot r\\ \hline\therefore s \end{array}
      Answer

      Valid:

      1:pqpremise2:qE2 13:q(rs)premise4:rsE 3,25:r{6:¬rpremise7:F¬E 6,58:sFE 7}9:s{10:s9}11:sE 4,5,9\begin{array}{l|l} \ell_1: p\land q & \text{premise}\\ \ell_2: q & \land E_2\ \ell_1\\ \ell_3: q\rightarrow(r\lor s) & \text{premise}\\ \ell_4: r\lor s & \rightarrow E\ \ell_3,\ell_2\\ \ell_5: r\Rightarrow\{\\ \quad\ell_6: \lnot r & \text{premise}\\ \quad\ell_7: \F & \lnot E\ \ell_6,\ell_5\\ \quad\ell_8: s & \F E\ \ell_7\\ \}\\ \ell_9: s\Rightarrow\{\\ \quad\ell_{10}: s & \ell_9\\ \}\\ \ell_{11}: s & \lor E\ \ell_4,\ell_5,\ell_9 \end{array}
    3. pqq(rs)¬ps\begin{array}{l} p\lor q\\ q\rightarrow (r\land s)\\ \lnot p\\ \hline\therefore s \end{array}
      Answer

      Valid:

      1:pqpremise2:p{3:¬ppremise4:F¬E 3,25:sFE 4}6:q{7:q(rs)premise8:rsE 7,69:sE2 8}10:sE 1,2,6\begin{array}{l|l} \ell_1: p\lor q & \text{premise}\\ \ell_2: p\Rightarrow\{\\ \quad\ell_3: \lnot p & \text{premise}\\ \quad\ell_4: \F & \lnot E\ \ell_3,\ell_2\\ \quad\ell_5: s & \F E\ \ell_4\\ \}\\ \ell_6: q\Rightarrow\{\\ \quad\ell_7: q\rightarrow(r\land s) & \text{premise}\\ \quad\ell_8: r\land s & \rightarrow E\ \ell_7,\ell_6\\ \quad\ell_9: s & \land E_2\ \ell_8\\ \}\\ \ell_{10}: s & \lor E\ \ell_1,\ell_2,\ell_6 \end{array}
    4. (¬p)tqsrq¬(qt)p\begin{array}{l} (\lnot p)\rightarrow t\\ q\rightarrow s\\ r\rightarrow q\\ \lnot(q\lor t)\\ \hline\therefore p \end{array}
      Answer

      Valid:

      1:¬p{2:(¬p)tpremise3:tE 2,14:qtI2 35:¬(qt)premise6:F¬E 5,4}7:¬¬p¬I 18:p¬¬E 7\begin{array}{l|l} \ell_1: \lnot p\Rightarrow\{\\ \quad\ell_2: (\lnot p)\rightarrow t & \text{premise}\\ \quad\ell_3: t & \rightarrow E\ \ell_2,\ell_1\\ \quad\ell_4: q\lor t & \lor I_2\ \ell_3\\ \quad\ell_5: \lnot(q\lor t) & \text{premise}\\ \quad\ell_6: \F & \lnot E\ \ell_5,\ell_4\\ \}\\ \ell_7: \lnot\lnot p & \lnot I\ \ell_1\\ \ell_8: p & \lnot\lnot E\ \ell_7 \end{array}
    5. psrqrq¬p¬s\begin{array}{l} p\\ s\rightarrow r\\ q\lor r\\ q\rightarrow\lnot p\\ \hline\therefore \lnot s \end{array}
      Answer

      Invalid. Take pp, rr, and ss all true, while qq is false. All of the premises are true, but the conclusion is false.

    6. qtp(ts)pqs\begin{array}{l} q\rightarrow t\\ p\rightarrow(t\rightarrow s)\\ p\\ \hline\therefore q\rightarrow s \end{array}
      Answer

      Valid:

      1:q{2:qtpremise3:tE 2,14:p(ts)premise5:ppremise6:tsE 4,57:sE 6,3}8:qsI 1\begin{array}{l|l} \ell_1: q\Rightarrow\{\\ \quad\ell_2: q\rightarrow t & \text{premise}\\ \quad\ell_3: t & \rightarrow E\ \ell_2,\ell_1\\ \quad\ell_4: p\rightarrow(t\rightarrow s) & \text{premise}\\ \quad\ell_5: p & \text{premise}\\ \quad\ell_6: t\rightarrow s & \rightarrow E\ \ell_4,\ell_5\\ \quad\ell_7: s & \rightarrow E\ \ell_6,\ell_3\\ \}\\ \ell_8: q\rightarrow s & \rightarrow I\ \ell_1 \end{array}
  2. For each of the following English arguments, express the argument in terms of propositional logic and determine whether the argument is valid or invalid.

    • If it is Sunday, it rains or snows. Today, it is Sunday and it's not raining. Therefore, it must be snowing.

      Answer

      Let pp be "it is Sunday", rr be "it is raining", and ss be "it is snowing." The argument is then

      p(rs)p¬rs\begin{array}{l} p\rightarrow(r\lor s)\\ p\land\lnot r\\ \hline\therefore s \end{array}

      This argument is valid:

      1:p(rs)premise2:p¬rpremise3:pE1 24:rsE 1,35:¬rE2 26:sdisjunctive syllogism\begin{array}{l|l} \ell_1: p\rightarrow(r\lor s) & \text{premise}\\ \ell_2: p\land\lnot r & \text{premise}\\ \ell_3: p & \land E_1\ \ell_2\\ \ell_4: r\lor s & \rightarrow E\ \ell_1,\ell_3\\ \ell_5: \lnot r & \land E_2\ \ell_2\\ \ell_6: s & \text{disjunctive syllogism} \end{array}

      The Law of Disjunctive Syllogism cited on line 6 was seen as the first argument in Exercise 2. It is a common enough argument (used for example in Exercise 4(ii)) that I decided to introduce it as a shortcut here.

    • If there are anchovies on the pizza, Jack won't eat it. If Jack doesn't eat pizza, he gets angry. Jack is angry. Therefore, there were anchovies on the pizza.

      Answer

      Let aa be "There are anchovies on the pizza", bb be "Jack doesn't eat the pizza", and cc be "Jack is angry." The argument is then

      abbcca\begin{array}{l} a\rightarrow b\\ b\rightarrow c\\ c\\ \hline\therefore a \end{array}

      This argument is invalid. Maybe Jack never eats pizza and is angry all the time (that is, bb and cc are true, making all the premises true with no obligation for aa to be true).

    • At 8:00, Jane studies in the library or works at home. It's 8:00 and Jane is not studying in the library. So she must be working at home.

      Answer

      Let ee be "it is 8:00", ss be "Jane studies in the library", and ww be "Jane works at home." The argument is then

      e(sw)e¬sw\begin{array}{l} e\rightarrow(s\lor w)\\ e\land\lnot s\\ \hline\therefore w \end{array}

      This argument is valid:

      1:e(sw)premise2:e¬spremise3:eE1 24:swE 1,35:¬sE2 26:wdisjunctive syllogism\begin{array}{l|l} \ell_1: e\rightarrow(s\lor w) & \text{premise}\\ \ell_2: e\land\lnot s & \text{premise}\\ \ell_3: e & \land E_1\ \ell_2\\ \ell_4: s\lor w & \rightarrow E\ \ell_1,\ell_3\\ \ell_5: \lnot s & \land E_2\ \ell_2\\ \ell_6: w & \text{disjunctive syllogism} \end{array}

  1. Here, "in all cases" means for all combinations of truth values of the propositional variables in P\mathscr{P} and Q\mathscr{Q}. Saying PQ\mathscr{P}\rightarrow \mathscr{Q} is a tautology means it is true in all cases. But by definition of \rightarrow, it is automatically true in cases where P\mathscr{P} is false. In cases where P\mathscr{P} is true, PQ\mathscr{P}\rightarrow \mathscr{Q} will be true if and only if Q\mathscr{Q} is true.
  2. Part of this complication is an inherent asymmetry in deduction: while our arguments may have multiple premises, they may only have one conclusion. A rule that was somehow "dual" to I\land I would need to have two conclusions. There is another formulation of logic, known as the "sequent calculus" (see https://en.wikipedia.org/wiki/Sequent_calculus), where arguments may have multiple conclusions, and this asymmetry disappears. However, natural deduction has a cleaner connection to functional programming, as we will see later on.
  3. Logicians have taken this observation and built an entire system of logic known as intuitionistic logic, on the grounds that there is something unusual with the rule of double negation elimination. As computer scientists, this should actually make sense: if we think of a proof as showing how to compute something, then all of the rest of the deduction rules are reasonable. However, the double negation rule says that if we don't have a way of showing that something is false, then somehow we get a proof that it is truejust because we run a program and it doesn't print out the wrong answer doesn't mean that it will print out the correct answer, because maybe the program will never print out an answer at all!