Handout 1 Natural Deduction For Propositional Logic EECS 203 Fall 2019
Handout 1 Natural Deduction For Propositional Logic EECS 203 Fall 2019
Before we give examples of Natural Deduction proofs, we will discuss why we use
proof systems and, in particular, why we chose this proof system.
It seems easy to determine whether a proposition follows from a given set of
propositions. Just construct a truth table. The difficulty is the size of the table. If
there are just three propositional variables, the table has 8 = 23 rows – not a problem.
However, if there are 1000 propositional variables (which may happen in applications),
the table has 21000 rows. This is more than the number elementary particles in the
universe. It is physically impossible to construct such a table! Even if we could,
the time required to construct it would be more than the lifetime of universe. For
predicate logic the situation is even worse. Many of the most useful domains are
infinite (for example, the domain of integers or the domain of real numbers). It is
impossible to verify the truth of an expression if we have to consider every element
of an infinite domain. Yet mathematicians know lots of true statements about the
integers and the real numbers. They derive these truths by starting with certain
fundamental axioms and deriving other truths from them by means of proofs.
In computer science we build automatic theorem provers for applications such as
hardware and software verification, programming languages such as Prolog, intelligent
systems, software engineering, and database systems. Usually, the proof systems used
in these kinds of applications are either resolution or tableaux systems. We will not
discuss these kinds of proof systems in EECS 203. You may encounter them later in
upper level computer science courses.
Instead, we present a system called Natural Deduction which was first studied
in the 1930s (in a slightly different form) by the Polish logician Stanislaw Jaśkowksi
and the German logician Gerhard Gentzen. They wanted to design a proof system
that more closely represents proofs mathematicians actually write. In sections 1.7
and 1.8 of textbook you will see these kinds mathematical proofs written in a natural
language (English here, but mathematicians write proofs in many natural languages).
An underlying assumption in mathematics is that every proof written in natural
language could be recast (with some effort) as a formal proof in logic. We have
chosen the Natural Deduction system because it gives a much clearer picture of the
connection between natural language proofs and formal proofs.
1
Example 1. Let’s start with a simple example. We prove the Modus Tollens rule,
which is one of the derived rules on the second page of Handout 2.
¬q p→q
¬p
Here is the Natural Deduction derivation.
¬q premise
p→q premise
p assumption
q →-elim 2, 2
F ¬-elim 4, 1
¬p ¬-intro 2-5
We begin by writing the premises at the beginning of the proof. Since there are two
premises, we write them on lines 1 and 2. Now look at the conclusion ¬p we are
trying to prove. Look at the rules on the first page of of Handout 2. The rules in the
left column are introduction rules. You use them when you want to introduce logical
operations or symbols in propositions in your proof. The rules in the left column are
elimination rules. You use them when you want to eliminate logical operations or
symbols from propositions in your proof. In this case, since we are trying to prove
¬p, we need to introduce a negation ¬ at some point, so we will use the ¬-intro rule
which says
p
..
.
F
(¬-intro)
¬p
The box here indicates that you will have a subderivation which begins with an
.
assumption p, then has some number of lines (indicated by the vertical ellipsis ..), and
ends with the contradiction F. Immediately after the subderivation ends you have a
line containing ¬p. You are allowed to write p because the assumption of ¬p led to a
contradiction. This is how you introduce ¬. You can see the subderivation on lines 3
through 5 in the derivation above.
Notice that every line of derivation has a number, a proposition, and a justifica-
tion. The justifications on lines 1 and 2 indicate that the propositions are premises.
The justification on line 3 says that p is the assumption at the beginning of the sub-
derivation. The justification within a subderivation box may refer to any previous
2
line number in the box or any previous line number outside the box as long as that
line in not in some other disjoint box. On line 4, for example, the justification refers
to lines 2 (outside the subderivation box but not in any other box) and 3 (inside the
subderivation box). We can apply the →-elim (which is called Modus Ponens in the
textbook) to the propositions on lines 2 and 3 to get the proposition on line 4. Sim-
ilarly, the justification on line 5 says that we can apply the ¬-elim to propositions
on lines 4 and 1 (namely, q and ¬q) to get the contradiction F. Finally, on line 6
the justification says that we have applied the ¬-intro rule to the subderivation box
occupying lines 3-5 to get the conclusion ¬p.
We could express this formal proof in English as follows.
We are given that p implies q and that q is false. We wish to show that
p is false. Assume, on the contrary, that p is true. Then, since p implies
q, q is true. But this is a contradiction because q is false. Therefore, our
assumption p is false.
p→r premise
q→r premise
p∨q assumption
p assumption
r → -elim 1, 2
q assumption
r → -elim 2, 6
r ∨-elim 3, 2-5, 6-7
p∨q →r → -intro 3-8
3
We are given that p implies r and that q implies r. We wish to show that
if p or q holds, then so does r. Assuming p or q, there are two cases. In
the first case p is true; but since p implies r, r is true. In the second case
q is true; but since q implies r, r is true. Since r holds in either case, p or
q holds, then r holds.
p→q
¬q → ¬p
This example shows you how to use derived rules. In this case, you are using the
Modus Tollens rule from Example 1.
p→q premise
¬q assumption
¬p Modus Tollens 1, 2
¬q → ¬p →-intro 2-3
Example 4. The ¬-intro rule is closely related to the Proof by Contradiction (PBC)
rule. The difference is that in the ¬-intro rule, if the assumption that p holds results
in a contradiction, you conclude ¬p; whereas, in the PBC rule, if the assumption that
¬p holds results in a contradiction, you conclude p. It is not hard to derive the PBC
rule from the ¬-intro rule. To show
¬p
..
.
F
p
note that the ¬-intro rule tells us
¬p
..
.
F
¬¬p
The by the ¬¬-elim rule,
¬¬p
p
4
Example 5. Prove the Law of the Excluded Middle (LEM). This is an example of a
proof where there are no premises.
p ∨ ¬p
Example 6. Recall that one of De Morgan’s Laws says ¬(p ∨ q) ≡ ¬p ∧ ¬q. That
means that we should be able to derive ¬(p ∨ q) from ¬p ∧ ¬q, and ¬p ∧ ¬q from
¬(p ∨ q). Let’s show one of these derivations.
¬(p ∨ q)
¬p ∧ ¬q
¬(p ∨ q) premise
p assumption
p∨ q ∨-intro 2
F ¬-elim 3, 1
¬p ¬-intro 2-4
q assumption
p∨q ∨-intro 6
F ¬-elim 7, 1
¬q ¬-intro 6-8
¬p ∧ ¬q ∧-intro 5, 9
5
Sometimes it is tricky to come up with a proof. There is no efficient method to
automatically produce short proofs (which is one reason we need mathematicians to
provide insight). There is, however, an approach that often helps: work backward. In
this example you want to show that ¬p ∧ ¬q follows from the ¬(p ∨ q), so you write
¬(p ∨ q) premise
¬p ∧ ¬q
You do not know how many lines the proof will have, but you do know that the last
line should be ¬p ∧ ¬q. To get this, need to get both ¬p and ¬q, so you begin filling
in:
¬(p ∨ q) premise
¬p
¬q
¬p ∧ ¬q ∧-intro
We need to get ¬p and ¬q. This suggests that we need to use ¬-intro twice,so we
write
¬(p ∨ q) premise
p assumption
F
¬p ¬-intro
q assumption
F
¬q ¬-intro
¬p ∧ ¬q ∧-intro
We see that we need to get a contradiction. But what is there to contradict! Only
¬(p ∨ q). Aha! That is contradicted by p ∨ q, which is exactly what we needed using
∨-intro . Fill in the places to get
6
¬(p ∨ q) premise
p assumption
p∨q ∨-intro
F ∨-elim
¬p ¬-intro
q assumption
p∨q ∨-intro
F ∨-elim
¬q ¬-intro
¬p ∧ ¬q ∧-intro
Now it is a simple matter to number the lines and insert the appropriate line numbers
in the justifications.
Working backward doesn’t always work, but often it does.