Topic3.2 3 LectureNotes

Download as pdf or txt
Download as pdf or txt
You are on page 1of 42

MATH1081 Discrete Mathematics F.Kuo and D.Angell / D.

Trenerry

Topic 3 Proof, Induction and Symbolic Logic


3.2 Mathematical Induction

The Principle of Mathematical Induction is a technique for proving


statements concerning the natural numbers N = {0, 1, 2, 3, 4, . . .} and other
sets like {n Z | n n0 } where n0 is some given integer.
Induction is poorly taught or understood at High School.
We are going to do it in a formal way which hopefully will help you better
understand induction and better set out an induction proof.
In tests and exams, you should use our formal approach.
The term proposition is commonly wrongly used in induction arguments,
where predicate is the correct term so we will use the term predicate.

A formal induction proof takes the following form.


To prove for a predicate P (n) that P (n) is true for all n N:
Basis step: show that P (0) is true.
Induction step: show that for all k N,
if P (k) is true then P (k + 1) is true
(or the truth of P (k) implies the truth of P (k + 1)) via:
Let k N. (Note that k is arbitrary, but fixed once chosen.)
Suppose that P (k) is true.
(This is called the induction hypothesis.)
..
.
Hence P (k + 1) is also true.

The proof then ends with a conclusion:


Hence by induction, P (n) is true for all n N.

For an induction on {n Z | n n0 }, simply change the basis step to


show P (n0 ) is true and ensure k n0 in the induction step.

1
The following is a High School intuitive understanding which is NOT a proof:
The base step leads to
P (0) is true

The induction step leads to


P (0) implies P (1)
P (1) implies P (2)
P (2) implies P (3)
etc.

Combining both steps leads to


P (0) is true
P (1) is true
P (2) is true
P (3) is true
etc.

Note however, that this is NOT A PROOF that induction works.

The Principle of Induction is actually an Axiom of Mathematics and therefore


CANNOT be proved. It has to be taken as fact.
NEVER try to explain it using the approach above.
Here is one form of the Peano Axioms for N that form the basis of Mathematics:
0 N.
There is an injective function f : N N such that 0 6 f (N).
If, whenever S N is such that
0 S and
whenever x S, then f (x) S,
then S = N.
This function f is called the successor function. Think f (n) = n + 1.
The first two Axioms say evey natural number except 0 is the successor of a
natural number.
Axiom 3 says that the principle of induction holds.

The Peano Axions will NOT BE EXAMINED.

2
Example. Prove by induction that n3 +2n is a multiple of 3 for all natural numbers
n.
A formal induction proof... (you may treat the green part as a template)

Proof. Let P (n) be the predicate


n3 + 2n is a multiple of 3 .
We want to prove that P (n) is true for all n N.

Basis step:
For n = 0, we have
03 + 2 0 = 0 = 3 0, which is a multiple of 3.
Hence P (0) is true.

Induction step: Suppose that k N. (This k is arbitrary, but fixed once chosen.)
Suppose that (for this k), P (k) is true. Then

k 3 + 2k = 3m for some integer m. (induction hypothesis)

We want to deduce that that P (k + 1) is true, that is,

(k + 1)3 + 2(k + 1) is a multiple of 3.


We have

(k + 1)3 + 2(k + 1)
= k 3 + 3k 2 + 3k + 1 + 2k + 2
= (k 3 + 2k) + 3k 2 + 3k + 3
= 3m + 3k 2 + 3k + 3 by the induction hypothesis
= 3(m + k 2 + k + 1),
which is a multiple of 3.

Hence we have deduced that P (k + 1) is true.


Thus we have shown that for all k N, if P (k) is true then P (k + 1) is true.

Conclusion:
Hence by induction, P (n) is true for all n N.

3
Note that this particular problem would be far quicker done using a proof by
cases.
Note the difference between our formal way of writing the induction step:
For any k N, if P (k) is true then P (k + 1) is true.
and some other ways of writing the induction step that are commonly used by
teachers and mathematicians, but are not quite right .....
Assume P (n) is true, then we prove that P (n + 1) is true
this seems to assume what we have to prove and does not quantify n.
We prove that if P (k) is true, then P (k + 1) is true this does not properly
quantify k.
If P (n) is true for some particular value of n then we show P (n + 1) is
true using the words some particular makes this sound like there is some
particular n such that if P (n) it true then P (n + 1) is true, and so this has
the wrong quantifier. (Epp uses this in places.) The intention here seems to
be that k is an arbitrary then particular value (rather than some particular
value) of n.

Some other correct ways of stating the induction step:

For any n N, if P (n) is true then P (n + 1) is true.


Note, however, using k instead of n psychologically separates the induction step
from what you are trying to prove, so is a useful approach.
Whenever P (k) is true for some arbitrary k N, then it follows that P (k + 1)
is true.
Suppose k is a value in N for which P (k) is true, then we prove that P (k + 1)
is true this is OK but not as formal as our way.
An informal approach is to say For an arbitrary k N, suppose the result
holds for n = k, then we prove it holds for n = k + 1, which does not formally
identify the predicate.
You should use our formal approach in MATH1081.

4
Example. Prove by induction that the sum of the squares of the first n positive
integers
1
12 + 22 + + n2 = n(n + 1)(2n + 1).
6
Induction can start at integers other than 0.

Proof. Let P (n) be the predicate 12 + 22 + + n2 = 16 n(n + 1)(2n + 1).


Basis step:
For n = 1, we have
1
LHS = 12 = 1 = 1 (1 + 1) (2 1 + 1) = RHS.
6
Hence P (1) is true.

Induction step: Let k N with k 1.


Suppose that P (k) is true, that is,
1
12 + 22 + + k 2 = k(k + 1)(2k + 1). (induction hypothesis)
6

We want to deduce that P (k + 1) is true, that is,


1
12 + 22 + + k 2 + (k + 1)2 = (k + 1)((k + 1) + 1)(2(k + 1) + 1).
6
We have
LHS = (12 + 22 + + k 2 ) + (k + 1)2
1
= k(k + 1)(2k + 1) + (k + 1)2 by the induction hypothesis
6
1
= (k + 1)[k(2k + 1) + 6(k + 1)]
6
1
= (k + 1)[2k 2 + 7k + 6]
6
1
= (k + 1)(k + 2)(2k + 3)
6
= RHS, and we have deduced that P (k + 1) is true.
Thus we have shown that for all k N with k 1, P (k) implies P (k + 1).
Conclusion:
Hence by induction, P (n) is true for all positive integers n.

5
What is wrong with the following as an attempt at part of the previous proof?
By the induction hypothesis, we have
1
12 + 22 + + k 2 = k(k + 1)(2k + 1).
6
Replace k by k + 1. Therefore
1
12 + 22 + + (k + 1)2 = (k + 1)(k + 2)(2k + 3),
6
which completes the induction step.

Example.
Show that 16 | 5n 4n 1 for all n 1.
Proof. Let P (n) be the predicate 16 | 5n 4n 1.
Basis:
We note that P (1) is true since 51 4 1 1 = 0 is divisible by 16.
Induction: Let k N with k 1.
Assume that P (k) is true, so that 16 | 5k 4k 1.
Then there is an integer m with 5k 4k 1 = 16m. Now

5k+1 4(k + 1) 1 = 5(5k ) 4k 5


= 5(16m + 4k + 1) 4k 5 by the induction hypothesis
= 5 16m + 16k

and this is divisible by 16, so P (k + 1) is true.


We have proved that for all k N with k 1, P (k) implies P (k + 1).
Conclusion: By induction 16 | 5n 4n 1 for all n 1.

6
Example. (Generalized Bezout Identity)
Let n 2 be an integer. For any n integers a1 , a2 , , an having no common
factor, there exist integers x1 , x2 , , xn such that

a1 x1 + a2 x2 + + an xn = 1.

Proof. Let P (n) be the predicate For any n integers a1 , a2 , , an having no


common factor, there exist integers x1 , x2 , , xn such that
a1 x1 + a2 x2 + + an xn = 1.

Basis:
Now P (2) is true, and was proved in section 2 of this course.

Induction: Let k N with k 2.


Now assume that P (k) is true, and let a1 , , ak , ak+1 be integers with no common
factor.
We must deduce that
a1 x1 + + ak xk + ak+1 xk+1 = 1 (1)

for some integers x1 , , xk , xk+1 .


Let g be the greatest common divisor of a1 , , ak .
a1 ak
Then , , are k integers having no common factor,
g g
and so by the induction assumption there exist integers y1 , , yk such that
   
a1 ak
y1 + + yk = 1. (2)
g g

Moreover, g and ak+1 have no common factor (if they did, it would be a common
factor of a1 , , ak , ak+1 ). So by the Basis case we have

gz + ak+1 zk+1 = 1 (3)

for some integers z and zk+1 . Multiplying equation (2) by g and substituting into
(3) gives
(a1 y1 + + ak yk )z + ak+1 zk+1 = 1.

7
Finally choosing x1 = y1 z, , xk = yk z and xk+1 = zk+1 gives a solution of
equation (1), and we have deduced that P (k + 1) is true.
Hence we have shown that for all k N with k 2, P (k) implies P (k + 1).
Conclusion
By induction, P (n) is true for all n 2.

Here we have proved by induction a doubly quantified statement of the form


for all . . . there exists . . . .
In this case the connection between the property for k and for k + 1 is that we
need to add one more term on the left hand side.
This proof is a bit unusual in that it uses the Basis case to prove the Induction
step.
As we have already seen a number of times, the some part of the statement
was proved by producing a specific example of the numbers required.
The argument also makes use of a short proof by contradiction (if they did,
then . . . ).

Exercise. Prove by induction that n3 3n for all natural numbers n 3.


Proof. (We will use an informal induction proof for a change)

8
Note that informal induction proofs are often used in mathematics, but they
tend to hide exactly what is being proved,
which here is (for Universe N),

(P (3) is true) and (k 3, P (k) implies P (k + 1)),


hence by induction (n 3, P (n) is true).

Avoid informal induction proofs in your Tests and Exam.

Strong Induction or Extended Induction

Suppose that we are given some n0 Z and m N, then


a strong induction proof consists of two steps:
Basis step: show that P (n0 ), P (n0 + 1), , P (n0 + m) are true.
Induction step: show that for all k N with k n0 + m,
the truth of all of P (n0 ), P (n0 + 1), , P (k) implies the truth of
P (k + 1) via:
Let k N with k n0 + m.
Suppose that all of P (n0 ), P (n0 + 1), . . . , P (k) are true.
(This is called the induction hypothesis.)
..
.
Hence P (k + 1) is also true.
The proof then ends with a conclusion:
Hence by (strong) induction, P (n) is true for all n N.

9
Example. Suppose the sequence {un } has the properties

u0 = 2, u1 = 6, un+2 = 6un+1 8un for all n 0.

Then for all n 0 we have un = 4n + 2n .


Proof. Let P (n) be the predicate un = 4n + 2n .
Basis:
Letting n = 0 and n = 1 we get 2 = 1 + 1 and 6 = 4 + 2 respectively; so both
P (0) and P (1) are true.
Induction: Let k N.
Assume that P (k) and P (k + 1) are both true, that is,
uk = 4k + 2k and uk+1 = 4k+1 + 2k+1 .

We must deduce that


uk+2 = 4k+2 + 2k+2 .
Now we are given that

LHS = uk+2 = 6uk+1 8uk


and substituting the assumed equalities for k and k + 1 gives,

LHS = 6 (4k+1 + 2k+1 ) 8 (4k + 2k )


= (6 4 8)4k + (6 2 8)2k
= 42 4k + 22 2k
= RHS.

This means that P (k + 2) is true.


Hence we have shown that for all k N, the truth of both P (k) and P (k + 1)
implies the truth of P (k + 2).

Conclusion
By (strong) induction, the formula is true for all n 0.

Note that we varied the induction slightly to get P (k + 2) from P (k) and
P (k + 1) as the flow of the proof is better.
Here we used n0 = 0, m = 1 in the strong induction and only needed to assume
two of the previous P ( ... ) instead of all of them.

10
Exercise. The Fibonacci numbers 0, 1, 1, 2, 3, 5, 8, 13, . . . are defined by the recur-
rence relation

F0 = 0, F1 = 1, and Fn = Fn1 + Fn2 for all n 2.

Prove by induction that


h n  n i
Fn = 1 1+ 5
1 5
for all n N.
5 2 2

We will leave this as an exercise see Problem Sheet 3 Question 35.

Here we also use n0 = 0, m = 1 and only two of the previous cases.

In the next example we will use n0 = 2, m = 0 and have to assume all the
previous cases even though we only use two of them as we do not know
which two we will use.
Example. Prove that any integer n 2 can be written as a product of primes.
Proof. (Informal)
Basis:
Since 2 is a product of one prime, the result is true for n = 2.
Induction:
Suppose k is an integer and k 2. Suppose that the result is true for all
n = 2, 3, . . . , k. We want to prove that the result is also true for n = k + 1, that
is, we want to show that k + 1 can be written as a product of primes.

There are two cases to consider: either k + 1 is prime or k + 1 is composite.


If k + 1 is prime, then it is a product of one prime.
If k + 1 is composite, then we can write k + 1 = ab for some integers 2 a, b k.
By the induction hypothesis, both a and b can be written as products of primes,
and thus n + 1 = ab can be written as a product of primes.
Hence k + 1 can be written as the product of primes.
Conclusion:
Hence by (strong) induction, we conclude that any integer greater than or equal to
2 can be written as a product of primes.

11
Exercise. Prove by induction that postage of 24 cents or more can be achieved by
using 5-cent stamps and 7-cent stamps.

12
Here we used n0 = 24, m = 4 in the strong induction, and used the last five of
P (24), , P (k) to get P (k + 1).
Note that we have also proved that for all natural numbers n 24

5x + 7y = n

has a solution with x, y N.

You might like to reflect on conditions on a, b, n0 such that:


for every n n0
ax + by = n
has solutions with x, y N.

Example.
Let
= 3.14159 = d0 .d1 d2 d3 (di are the digits of )
(and define a sequence {un } by u0 = 1 and

un+1 = d0 un + d1 un1 + + dn u0

for n 0. Then for n 1


un 9 10n1 .

Proof. Let P (n) be the predicate un 9 10n1 .

Basis:
Now P (1) is true since u1 = 3 9.

Induction: Let k N with k 1


Assume that P (1), P (2), , P (k) are true. We shall deduce that P (k + 1) is true,
that is
uk+1 9 10k .

13
Now
LHS = d0 uk + d1 uk1 + + dk1 u1 + dk u0
9 (uk + uk1 + + u1 + u0 )
9 (9 10k1 + 9 10k2 + + 9 + 1)

by the induction hypothesis. Hence

LHS 9 (99 99} +1) = 9 10k ,


| {z
k digits

which is what we had to show and so P (k + 1) is true.


Hence we have deduced that for any k N with k 1, that the truth of all of
P (1), P (2), , P (k) implies the truth of P (k + 1).
Conclusion:
By strong induction P (n) is true for all n 1.

Here we had n0 = 1, m = 0 and had to use ALL of P (1), , P (k) to get


P (k + 1). What role, if any, did have in the proof?

Some different kinds of induction problems


Exercise. Prove by induction that for any positive integer n 3, the sum of the
interior angles of a convex n-gon is 180(n 2) degrees.

14
Exercise. Let n be a positive integer. Prove by induction that any 2n 2n checker-
board with one corner square removed can be tiled using L-shaped pieces formed
by three 1 1 squares. (These pieces are called L-triominos or right triominos.)
The L-triominoes look like this:
b b

b b b

b b b

Exercise. Large dots are drawn on the circumference of a circle and lines are drawn
joining the dots in pairs so that every dot is joined to every other dot by a line.
Prove by induction that for every positive integer n 2, if n dots are drawn then
they will be joined in pairs by 12 n(n 1) lines.

Exercise. Straight lines are drawn right across an A4 sheet of paper in such a way
that each pair of lines intersect and no three or more lines intersect at the same
point. Prove by induction that when n such lines are drawn, they divide the sheet
of paper into 12 (n2 + n + 2) regions.

15
The Well-ordering Principle for the natural numbers says:
Every non-empty subset S of N contains a least element.

This is an alternate Axiom to the Principle of Induction.


In fact it is not too hard to show by suitably setting up predicates or subsets
that:
The Principle of Induction, the Strong Principle of Induction and the
Well-ordering Principle for the natural numbers are logically equivalent to
one another, meaning: assume one of them and you can deduce the other two.
Moreover, they are all equivalent to Fermats Method of Descent, which
was the form in which induction first appeared in the 17th century.
Fermats Method of Descent is obtained from induction using the ideas of
contrapositive/contradiction:
To show that P (n) is true for all n n0 , show
for all n n0 + 1, P (n) false implies P (n 1) is false
but P (n0 ) is true.

Example. (Hard) (Historically one of the earliest uses of induction)


Show that any natural number of the form 4n (8m + 7) for some n, m N cannot
be written as the sum of three squares of integers. (Call this P (n).)
Proof.
Using Fermats Method of Descent

Descent:
Let n 1. Assume that P (n) is false, so that
4n (8m + 7) = x2 + y 2 + z 2 , for some x, y, z Z.
Then clearly 4 | x2 + y 2 + z 2 .
A simple proof by cases mod 4 (detail omitted) shows that 4 | x2 + y 2 + z 2 can
only occur when all of x, y, z are even.
So, let x = 2X, y = 2Y, z = 2Z where X, Y, Z Z. Now
4n (8m + 7) = (2X)2 + (2Y )2 + (2Z)2 .
so that on dividing by 4 we get
4n1 (8m + 7) = X 2 + Y 2 + Z 2 ,

16
which says that P (n 1) is false.
Hence we have proved that (P (n) false) implies (P (n 1) false).

Basis: But P (0) is true, since a proof by cases mod 8 (detail omitted) shows that
x2 + y 2 + z 2 6 7 (mod 8) for all x, y, z Z.

Conclusion:
Hence we have proved by Fermats Method of Descent that P (n) is true for all
n 0.

Note that Fermats Method of Descent is sometimes a nice approach with


negative statements like the ones in this theorem.
Fermats Method of Descent and the Principle of Well-Ordering of N are NOT
DIRECTLY EXAMINED.
However, Well-Ordering is sometimes used for example in Problem Set 2,
Question 11, where it was used without comment.

Exercise. (Quite Hard leave until after the exam)

Show that for all n Z+ that



3(( 3 + 1)2n1 + ( 3 1)2n1 )

is an integer and is divisible by 2n .


Show for the Fibonacci Numbers Fn that for all n Z+
2
F2n1 = Fn1 + Fn2
F2n = 2Fn1 Fn + Fn2 .

17
3.3 Symbolic Logic
This section consists of taking what we did with proofs and induction and making
it move formal and symbolic.
Some parts are repeated and some done quickly as we have already covered them.

A proposition (or statement) is a sentence or clause that is unambiguously


true or false.

Example.
Canberra is the capital of Australia is a proposition which is true.
1 is a prime number is a proposition which is false.
2 + 2 = 4 is a proposition which is true.
x + y = 1 is not a proposition, because it can be either true or false
depending on the values of x and y.

Exercise. Is the sentence This sentence is false a proposition?

We use lower case letters (e.g. p, q, or r) to denote a proposition.


A compound proposition (or compound statement) is denoted by upper case
letters (e.g. P , Q, or R) and is a sentence or clause that contains one or more
simpler propositions combined using logical operators:
negating a proposition using negation:
p (or p) not p p is not true
p is false it is not the case that p
conjunction
p q p and q p but q
p moreover q p however q
p though q p nonetheless q
p furthermore q p even so q
p yet q p despite q
p still q
disjunction (this is the inclusive or, like with union)
p q p or q p and/or q
p or q or both either p or q

18
implication or conditional
p q p implies q q if p
if p then q q in case p
p only if q q provided that p
p therefore q q follows from p
not p unless q q whenever p
p is a sufficient condition for q
q is a necessary condition for p
biconditional
p q p if and only if q p precisely when q
p is equivalent to q p just when q
p iff q p just in case q
p if q and q if p p exactly when q
if p then q and conversely
p is a necessary and sufficient condition for q
Note:
p unless q, p except when q mean p if not q and translate as q p.
neither p nor q translates as (p q) or p q.

Exercise. Let h = It is hot and s = It is sunny. Write each of the following


sentences in symbolic form.
(a) It is not hot but it is sunny.
(b) It is not both hot and sunny.
(c) It is neither hot nor sunny.

Exercise. Let p = You work hard, q = You skip lectures, and r = You pass
this course. Translate (p q) r into plain English.

Exercise. Express the following compound proposition in symbolic form.


I will go surfing only if there are good waves or I have nothing better to do.

19
We denote the truth value of a proposition by the upper case letter T (true)
or F (false).
Truth tables for , , , , and :
p p
T F p is true when p is false, and it is false when p is true.
F T
p q pq p q pq p q pq p q pq
T T T T T T T T T T T T
T F F T F T T F F T F F
F T F F T T F T T F T F
F F F F F F F F T F F T
p q is true when both p and q are true, and it is false otherwise.
p q is false when both p and q are false, and it is true otherwise.
p q is false when p is true and q is false, and it is true otherwise.
p q is true when p and q have the same truth value, and it is false
otherwise.

Precedence of logical operators:


(1) (2) , (3) ,

p q means ( p) q, not (p q).


p q r means (p q) r, not p (q r).
p q r is ambiguous since ...
... (p q) r is different from p (q r)
If in doubt, use parentheses.

We use a truth table to deduce the truth value of a compound proposition.


A compound proposition is a
tautology iff all entries in its truth table are T.
contradiction iff all entries in its truth table are F.
contingency iff it is neither a tautology nor a contradiction.

20
Example. The compound proposition p p is a tautology. The compound
proposition p p is a contradiction.

p p p p p p
T F T F
F T T F

Example. Is the compound proposition p(p q) q a tautology, contradiction,


or contingency?

p q pq p (p q) p (p q) q
T T T T T
T F F F T
F T T F T
F F T F T

Since all entries of p (p q) q in the truth table are T, we conclude that


p (p q) q is a tautology.

Exercise. Is the compound proposition (p q) (p r) r a tautology,


contradiction, or contingency?

p q r pq r p r (p q) (p r) (p q) (p r)
r
T T T
T T F
T F T
T F F
F T T
F T F
F F T
F F F

21
If P and Q are two compound propositions such that P Q is a tautology,
then we say that P logically implies Q, and we write P Q.
If P and Q are two compound propositions such that P Q is a tautology,
then we say that P is logically equivalent to Q, and we write P Q or
P Q.
Two compound propositions are logically equivalent iff they always have
the same truth values in a truth table.

Example. We construct a truth table to show that (p q) q p.

p q pq q (p q) q p (p q) q p
T T T F F F T
T F F T F F T
F T T F F T T
F F T T T T T

Since (p q) q p is a tautology, we conclude that (p q) q p.

Exercise. Construct a truth table to show that p q (p q) (q p).

p q pq pq qp (p q) (q p)
T T
T F
F T
F F

22
Recall that the conditional proposition p q is false when p is true and q is
false, and it is true otherwise.
The contrapositive of p q is q p.
The converse of p q is q p.
The inverse of p q is p q.

Notes.

1. p q is not the same as q p.


For example, If I live in Sydney then I live in Australia is a true statement,
but If I live in Australia then I live in Sydney is clearly wrong.

2. The fact that p q is true when p is false (no matter what truth value q
has) may seem strange at first, but it does make sense...
For example, if p is It is fine and q is You will go to the beach, then
p q is If it is fine, then you will go to the beach. Now if it is not fine,
would you go to the beach? Maybe... Maybe not...

3. If p then q is the same as p only if q in logic, but this is not always clear
in daily English.
For example, in mathematics, it is clear that If x > 2 then x2 > 4 is the
same as x > 2 only if x2 > 4, meaning x cannot be greater than 2 if x2 is
not greater than 4.
BUT
In daily language, If you want to pass this course then you must work hard
during the session doesnt sound the same as You want to pass this course
only if you work hard during the session.
If it is fine then you will go to the beach is understandable while It is fine
only if you go to the beach is hard to understand.
Similarly, If I am free this weekend then I will visit my parents is clear,
but I am free this weekend only if I visit my parents is unclear in ordinary
language.

23
Example. Construct a truth table to show that
A conditional proposition and its contrapositive are logically equivalent, i.e.,
p q q p.
A conditional proposition and its converse are NOT logically equivalent.
A conditional proposition and its inverse are NOT logically equivalent.
The converse and inverse of a conditional proposition are logically equivalent.
conditional contrapositive converse inverse
p q p q pq q p qp p q
T T F F T T T T
T F F T F F T T
F T T F T T F F
F F T T T T T T

p q and q p have the same truth values.


Thus (p q) ( q p) is a tautology.
Hence (p q) ( q p).
Similarly, we have (q p) ( p q).

Exercise. Construct a truth table to show that

p q p q and (p q) p q.

Notice that the negation of an implication is not another implication.

p q p pq p q q (p q) p q
T T
T F
F T
F F

24
Recall that the biconditional p q is true when p and q have the same truth
value, and it is false otherwise.

Notes.

1. p q is logically equivalent to (p q) (q p).

2. A mathematical definition is by default a biconditional proposition even though


we often do not state the only if direction explicitly.
For example, to give the definition of subset by
A set S is a subset of T if every element of S is an element of T
would be wrong and it should really be
A set S is a subset of T if and only if every element of S is an element of
T . This was done correctly in Topic 1.

3. Ordinary language seldom uses if and only if even though the meaning
commonly is this. In daily language, when one direction of if and only if is
obvious, it is often not stated explicitly.

For example, If you finish your homework then you can watch TV also
usually means If you do not finish your homework then you are not allowed
to watch TV although this is logically its inverse.
You can watch TV only if you finish your homework also commonly means
a reward together with the meaning If you finish your homework, then you
will be allowed to watch TV even though this is actually its converse.
In logic it should be said as You can watch TV if and only if you finish your
homework.

25
De Morgans laws:
(p q) p q and (p q) p q

Exercise. Construct a truth table to prove De Morgans laws.

p q p q p q (p q) p q p q (p q) p q
T T
T F
F T
F F

Exercise.
(a) What is the negation of Peter is tall and thin?
(b) What is the negation of 2 x < 5?
(c) Given that You can vote in the next election if (and only if) you are an
Australian citizen and you are 18 years or over, complete the sentence You
cannot vote in the next election if .
(d) Given that You can apply for this position if (and only if) you graduated in
mathematics or you are in your final year of study in mathematics, complete
the sentence You cannot apply for this position if .

26
Standard logical equivalences:
(Denote a tautology by T and a contradiction by F):
Commutative laws pq qp
pq qp
Associative laws p (q r) (p q) r
p (q r) (p q) r
Distributive laws p (q r) (p q) (p r)
p (q r) (p q) (p r)
Absorption laws p (p q) p
p (p q) p

Identity laws pFp pTp


Domination or universal bound laws pTT pFF
Idempotent laws ppp ppp
Negation laws p p T p p F
Double negation law ( p) p

Negations of T and F T F F T
De Morgans laws
(p q) p q
(p q) p q
Logical equivalences involving
p q q p ... contrapositive
p q p q ... alternative form for implication
(p q) p q
p q (p q) (q p)

Notice that the Rules for Logical Equivalences (except the last ones) and their
names are essentially the same as the Rules for Set Algebra. Such systems are
called Boolean Algebras.

27
Example. Use standard logical equivalences to simplify (p q) (p q).

(p q) (p q) (p q) ( p q) De Morgans law
(p p) q Commut and Distrib laws
F q Negation law
q Identity law

Exercise. Use standard logical equivalences to show that

(p q) (q r) q (p r).

28
Rules of Inference
An argument is a finite sequence of compound propositions, written in the
form
P1
P2
..
.
Pn
Q

P1 , P2 , . . . , Pn are called premises, hypothesis, or assumptions.


Q is called the conclusion.
The symbol reads therefore.
The argument is said to be valid if P1 P2 Pn Q, otherwise it
is said to be invalid.

Certain valid arguments are called rules of inference.

Example.
The following are valid arguments:
If Socrates is a man, then Socrates is mortal.
Socrates is a man.
Socrates is mortal.
If Zeus is human, then Zeus is mortal.
Zeus is not mortal.
Zeus is not human.
John is a trouble maker.
(more generally) John is a trouble maker or John is crazy.
Jane loves shopping and Jane loves cooking.
(in particular) Jane loves cooking.
If x is divisible by 9, then x is divisible by 3.
If x is divisible by 3, then the sum of the digits of x is divisible by 3.
If x is divisible by 9, then the sum of the digits of x is divisible by 3.

29
x is positive or x is negative.
If x is positive, then x2 > 0.
If x is negative, then x2 > 0.
x2 > 0.
The following are invalid arguments:
(converse error )
If the program is correct, then it will process the test data correctly.
It processed the test data correctly.
The program is correct.
(inverse error )
If x > 2, then x2 > 4.
y 2 (the negation of y > 2).
y 2 4 (the negation of y 2 > 4).

Note also that there is a difference between a valid argument and a true conclusion,
as is seen in the following examples.
(A false premise, valid argument, but false conclusion)
If x is divisible by 3, then x is divisible by 9.
6 is divisible by 3.
6 is divisible by 9.
(A false premise, valid argument, but true conclusion)
If x is divisible by 3, then x is divisible by 9.
18 is divisible by 3.
18 is divisible by 9.
(A false premise, invalid argument, but true conclusion)
If x is divisible by 3, then x is divisible by 9.
18 is divisible by 9.
18 is divisible by 3.
(True premise, invalid argument, but true conclusion)
If x is divisible by 9, then x is divisible by 3.
18 is divisible by 3.
18 is divisible by 9.

30
Important rules of inference:
Modus ponens (Latin for method of affirming)
pq
p
q
Modus tollens (Latin for method of denying)
pq
q
p
Conjunctive addition (or conjunction)
p
q
pq
Disjunctive addition (or generalization)
p q
pq pq

Conjunctive simplification (or specialization)


pq pq
p q
Disjunctive syllogism (or elimination)
pq pq
q p
p q
Hypothetical syllogism (or transitivity )
pq
qr
pr

Proof by cases Proof by contradiction


pq p F
pr p
qr
r where F is a contradiction

31
Example. (from Epp) You are looking for your glasses, and you say to yourself...
(1) If my glasses are on the kitchen table, then I saw them at breakfast.
(2) I was reading the newspaper in the living room or I was reading the newspaper
in the kitchen.
(3) If I was reading the newspaper in the living room, then my glasses are on
the coffee table.
(4) I did not see my glasses at breakfast.
(5) If I was reading my book in bed, then my glasses are on the bedside table.
(6) If I was reading the newspaper in the kitchen, then my glasses are on the
kitchen table.
Where are the glasses?
Let p = My glasses are on the kitchen table
q = I saw my glasses at breakfast
r = I was reading the newspaper in the living room
s = I was reading the newspaper in the kitchen
t = My glasses are on the coffee table
u = I was reading my book in bed
v = My glasses are on the bedside table

(1) pq
(2) rs
(3) rt
(4) q
(5) uv
(6) sp

(7) sq Transitivity, (6) and (1)


(8) s Modus tollens, (7) and (4)
(9) r Elimination, (2) and (8)
(10) t Modus ponens, (3) and (9)
The glasses are on the coffee table.

Note that u, v and (5) were not used, so are redundant.


Also note that you could do this as a truth table, but it would have 25 = 32 lines
even after omiting the redundant variables.

32
Example. Given the following information about a computer program, find the
bug in the program.
(1) There is an undeclared variable or there is a syntax error.
(2) If there is a syntax error, then there is a missing semicolon or a variable name
is misspelled.
(3) There is not a missing semicolon.
(4) There is not a misspelled variable name.

Let p = There is an undeclared variable


q = There is a syntax error
r = There is a missing semicolon
s = A variable name is misspelled

(1) pq (5) r s Conjunction, (3) and (4)


(2) q rs (6) (r s) De Morgans law, (5)
(3) r (7) q Modus tollens, (2) and (6)
(4) s (8) p Elimination, (1) and (7)
There is an undeclared variable.

Exercise. Deduce the conclusion from the given premises.


(1) p q
(2) r s
(3) s t
(4) q s
(5) s
(6) p r u
(7) w t
uw

33
Some Fallacies (invalid inferences):
Converse fallacy
pq
q
p
Inverse fallacy
pq
p
q

Both of these are invalid inference and must be avoided, but they are often used in
common English expression.
Example.
Suppose you say If its fine, Ill go to the beach.

If you went to the beach and your friend concludes that it must have been fine,
then

If it was not fine, and your friend concludes that you did not go to the beach,
then

Of course if you really meant I will go to the beach if and only if it is fine, then

34
Many Mathematics students also fall for these fallacies, often without realising.
Example.
To show that Expression 1 = Expression 2, many students write (wrongly)
Expression 1 = Expression 2
() Expression 3 = Expression 4
() etc
() Expression A = Expression B
(which is clearly true)
Hence Expression 1 = Expression 2

Often the symbol is not actually there, but is implicit.


Note that in Mathematics, if you write one line under another, there is an implicit
therefore, unless you specifically say something else like if and only if.

Similarly the which is clearly true is often not there but is implicit.

Example. (Hard - You will NOT get any like this)


Suppose that the following statements are true:
(1) If Fred is a serial killer then he is bad.
(2) If Fred is not a serial killer then he is a liar.
(3) If Fred is not bad then he is not a liar.
We wish to determine whether or not Fred is bad.
Let s = Fred is a serial killer, b = Fred is bad, and = Fred is a liar.
Then we have

(1) s b
(2) s
(3) b

Now we have to make an assumption to get anywhere.


This is boxed to show its scope and is followed by the true deduction.

35
(4) b Assumption
(5) Modus ponens, (3) and (4)
(6) ( s) Modus tollens, (2) and (5)
(7) s Double negation law, (6)
(8) b Modus ponens, (1) and (7)
(9) b b Conjunction, (8) and (4)
(10) F Negation law, (9)
(11) b F Implication, (4)(10)
(12) b Proof by contradiction, (11)

Hence we conclude that Fred is bad.

NOTE that we will NOT give you any problems like this, but some did appear in
exams many years ago.

The Principle of Mathematical Induction on N for a predicate P (n) can now


be written very formally as

P (0) (k N, P (k) P (k + 1)) (n N, P (n)).

Strong induction is very long if written as formally as this.

THE REST OF THESE NOTES ARE NO LONGER EXAMINED IN THE


SYMBOLIC LOGIC SECTION BUT ARE INCLUDED FOR COMPLETNESS.
SOME OF THESE IDEAS HAVE ALREADY APPEARED IN THE PROOFS
SECTION AND WILL BE EXAMINED THERE.

YOU MAY SKIP THE REST OF THIS DOCUMENT.

36
Recall that a proposition is a sentence which is either true or false but not
both.
A predicate is a sentence involving one or more free variables that becomes a
proposition when each free variable is assigned a defined value.
We use upper case letters for predicates and lower case letters for the free
variables, e.g., P (x) or Q(x, y).
The set of values that each free variable can take is referred to as the domain
of disclosure. Sometimes the domain of disclosure is not given explicitly, but
it can often be deduced from the context.

Example. Let P (x) be the predicate x2 > x. Then


P (3) is the proposition 32 > 3 which is true.
P (1) is the proposition 12 > 1 which is false.
P (0.5) is the proposition (0.5)2 > 0.5 which is false.
In this case, the domain of disclosure is the set of all real numbers.
Example. Let P (x, y) be the predicate x loves y. Then P (Mary, shopping) is
the proposition Mary loves shopping, which is either true or false.
Another way to turn a predicate into a proposition is by quantifying each free
variable.
Universal quantifier for all, for every, for each, for any, for
arbitrary, given any, etc.
Existential quantifier there exists, there is at least one, there is
a, we can find a, for some, for at least one, etc.
x D, P (x) x D, P (x)
True when P (x) is true for every x P (x) is true for at least
in D one x in D
False when P (x) is false for at least P (x) is false for every x
one x in D in D
Here D is the domain of disclosure.
Negations of quantified statements:
(x, P (x)) x, P (x)
The negation of all are is some are not.
(x, P (x)) x, P (x)
The negation of some are is all are not.

37
Example. Let Q(x) be the predicate x is crazy and let D denote the set of all
cats. Then
x D, Q(x) means All cats are crazy.
x D, Q(x) means There is at least one cat that is crazy.
x D, Q(x) is the same as y D, Q(y).
x D, Q(x) is the same as z D, Q(z).
The name of the free variable is irrelevant.
If P (x) is the predicate x is a cat, then
x D, Q(x) is the same as x, P (x) Q(x).
x D, Q(x) is the same as x, P (x) Q(x).
In both cases, the domain of disclosure is left for interpretation (e.g. the set
of all animals).

Example.
The negation of Everyone owns a car is Not everyone owns a car, which
is logically equivalent to Some people do not own a car.
The negation of Somebody likes me is Nobody likes me, which is logically
equivalent to Everybody dislikes me.
Exercise. Write the following statements in symbolic form.
(a) All triangles have three sides.
(b) Some apples are green.
(c) If a number is an integer, then it is a rational number.
Answer.
(a) Let Q(x) = x has three sides and T = the set of all triangles.
The statement is x T, Q(x).
Or x, P (x) Q(x), where P (x) = x is a triangle.
(b) Let Q(x) = x is green and A = the set of all apples.
The statement is x A, Q(x).
Or x, P (x) Q(x), where P (x) = x is an apple.
(c) Let P (x) = x is an integer and Q(x) = x is a rational number.
The statement is x, P (x) Q(x).
This is an example of implicit quantification in daily language.

38
Exercise. Write All politicians are liars in symbolic form, then write down its
negation in symbolic form, and finally write down its negation in words.
Answer.
Let P (x) = x is a politician and Q(x) = x is a liar.
Original: x, P (x) Q(x)
Negation:
(x, P (x) Q(x)) x, (P (x) Q(x)) x, P (x) Q(x)
There is at least one politician who is not a liar.

We have used the logical equivalence (p q) p q.

Exercise. Write No dogs have wings in symbolic form.


Answer.
Let P (x) = x is a dog and Q(x) = x has wings.
(x, P (x) Q(x)) x, (P (x) Q(x)) x, P (x) Q(x)
x, P (x) Q(x)

We have used De Morgans law (p q) p q


and the logical equivalence p q p q.

When multiple quantifiers are present:


The order in which quantifiers of different type occur is important.
e.g. x y, P (x, y) is different from y x, P (x, y).
The order does not matter for quantifiers of the same type.
e.g. x y, P (x, y) is the same as y x, P (x, y).
x y, P (x, y) is the same as y x, P (x, y).
Negation of statements with multiple quantifiers:
take the negation of each quantifier step by step (or do it all at once)
e.g. (x y z, P (x, y, z)) x, (y z, P (x, y, z))
x y, (z, P (x, y, z))
x y z, P (x, y, z)

Example.
x R y R, x > y is a proposition which is true. The statement says
For every real number there exists a smaller real number.
y R x R, x > y is a proposition which is false. The statement says
There is a real number which is smaller than all other real numbers.

39
Exercise. Write down the negation of the statement y R, x R, x > y,
and simplify it so that the negation symbol does not appear.
Answer.
(y R x R, x > y) y R, (x R, x > y)
y R x R, (x > y)
y R x R, x y

Exercise. The definition of lim f (x) = is


xa

> 0 > 0 x R, (|x a| < ) (|f (x) | < )


Write down the negation of the above statement (that is, lim f (x) 6= or limit
xa
does not exist), and simplify it so that the negation symbol does not appear.
Answer.
[ > 0 > 0 x R, (|x a| < ) (|f (x) | < )]
> 0 > 0 x R, [(|x a| < ) (|f (x) | < )]
> 0 > 0 x R, (|x a| < ) (|f (x) | < )
> 0 > 0 x R, (|x a| < ) (|f (x) | )

Exercise. Given the following proposition:


If a real number x is smaller in magnitude than every positive real number, then
x = 0.
(a) Write the original proposition, the converse, the contrapositive, the inverse
and the negation of the proposition in logic notation.
(b) Prove or disprove each of the five propositions.
Answer.
Original: x R, ( > 0, |x| < ) (x = 0)
Converse: x R, (x = 0) ( > 0, |x| < )
Contrapositive: x R, (x = 0) ( > 0, |x| < )
x R, (x =
6 0) ( > 0, |x| )
Inverse: x R, ( > 0, |x| < ) (x = 0)
x R, ( > 0, |x| ) (x 6= 0)
Negation: x R, [( > 0, |x| < ) (x = 0)]
x R, ( > 0, |x| < ) (x 6= 0)

40
The converse is clearly true, so the inverse is also true as it is logically equivalent
to the converse.
We prove that the contrapositive is true. For any real number x 6= 0, we can take

|x|
= .
2
Then |x| 2 > as required.
Hence the contrapositive is true.
The original proposition is true, since it is logically equivalent to its contrapositive.

The negation is therefore false.

Arguments involving quantifiers:


Example. The following are valid arguments:

All dogs are happy. Tabby catches mice.


Fido is a dog. Tabby is a cat. All pigs are fat.
Fido is happy. Some cats catch mice. Some pigs are fat.

Example. The following are invalid arguments:

Fido is happy. Some cats catch mice.


Fido is a dog. Tabby is a cat. Some pigs are fat.
All dogs are happy. Tabby catches mice. All pigs are fat.

Example. Analyze the following argument and show that it is valid.


(1) Athletes must be healthy.
(2) People with bad lungs are not healthy.
(3) No one who smokes has good lungs.
Athletes must not smoke.

41
Let A(x) = x is an athlete
H(x) = x is healthy
G(x) = x has good lungs
S(x) = x smokes
(1) x A(x) H(x)
(2) x G(x) H(x)
(3) (x S(x) G(x))
x A(x) S(x)

(4) x H(x) G(x) Contrapositive, (2)


(5) x A(x) G(x) Transitivity, (1) and (4)
(6) x (S(x) G(x)) Negation of existential quantifier, (3)
(7) x S(x) G(x) De Morgans law, (6)
(8) x G(x) S(x) Commutative law, (7)
(9) x G(x) S(x) Alternative form of implication, (8)
(10) x A(x) S(x) Transitivity, (5) and (9)

42

You might also like