Logic Proof Notes

59
i AN INTRODUCTION TO LOGIC and PROOF TECHNIQUES Michael A. Henning School of Mathematical Sciences University of KwaZulu-Natal

Transcript of Logic Proof Notes

Page 1: Logic Proof Notes

i

AN INTRODUCTION TO

LOGIC

and

PROOF TECHNIQUES

Michael A. Henning

School of Mathematical Sciences

University of KwaZulu-Natal

Page 2: Logic Proof Notes

ii

Page 3: Logic Proof Notes

Contents

1 Logic 1

1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

1.2 Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

1.3 Negation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

1.4 Conjunction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

1.5 Disjunction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

1.6 The Implication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

1.7 The converse, inverse and contrapositive of an implication . . . . . . . . . . 9

1.8 Compound Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

1.9 The Biconditional . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

1.10 Tautologies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

1.11 Contradictions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

1.12 Logical Equivalence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

1.13 Negation of a Conditional Statement . . . . . . . . . . . . . . . . . . . . . . 20

1.14 The Contrapositive of a Conditional Statement . . . . . . . . . . . . . . . . 20

1.15 Quantified Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

1.16 The Universal Quantifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

1.17 The Existential Quantifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

1.18 Negation of Quantified Statements . . . . . . . . . . . . . . . . . . . . . . . 24

1.19 Universal Conditional Statements . . . . . . . . . . . . . . . . . . . . . . . . 26

1.20 Review of Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

iii

Page 4: Logic Proof Notes

iv CONTENTS

2 Proof Techniques 29

2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

2.2 Trivial Proofs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

2.3 Vacuous Proofs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

2.4 Direct Proofs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

2.5 Proof by Contrapositive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

2.6 Proof by Cases and the Quotient-Remainder Theorem . . . . . . . . . . . . 37

2.7 Proof by Contradiction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

2.8 Existence Proofs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

2.9 Disproof by Counterexample . . . . . . . . . . . . . . . . . . . . . . . . . . 45

2.10 Proof by Mathematical Induction . . . . . . . . . . . . . . . . . . . . . . . . 46

Page 5: Logic Proof Notes

Chapter 1

Logic

1.1 Introduction

In this chapter we introduce the student to the principles of logic that are essential forproblem solving in mathematics. The ability to reason using the principles of logic is keyto seek the truth which is our goal in mathematics.

Before we explore and study logic, let us start by spending some time motivating thistopic. Mathematicians reduce problems to the manipulation of symbols using a set of rules.As an illustration, let us consider the following problem:

Example 1.1 Joe is 7 years older than Themba. Five years from now Joe will be twiceThemba’s age. How old are Joe and Themba?

Solution. To answer the above question, we reduce the problem using symbolic formula-tion. We let Themba’s age be x. Then Joe’s age is x + 7. We are given that five years fromnow Joe will be twice Themba’s age. In symbols, (x+7)+5 = 2(x+5). Solving for x yieldsx = 2. Therefore, Themba is 2 years old and Joe is 9.

Our objective is to reduce the process of mathematical reasoning, i.e., logic, to themanipulation of symbols using a set of rules. The central concept of deductive logicis the concept of argument form. An argument is a sequence of statements aimed atdemonstrating the truth of an assertion (a “claim”). Consider the following two arguments.

Argument 1. If x is a real number such that x < −2 or x > 2, then x2 > 4. Therefore,if x2 ≤ 4, then x ≥ −2 and x ≤ 2.

Argument 2. If it is raining or I am sick, then I stay at home. Therefore, if I do notstay at home, then it is not raining and I am not sick.

Although the content of the above two arguments is very different, their logical form isthe same. To illustrate the logical form of these arguments, we use letters of the alphabet(such as p, q and r) to represent the component sentences and the expression “not p” torefer to the sentence “It is not the case that p.” Then the common logical form of both the

1

Page 6: Logic Proof Notes

2 CHAPTER 1. LOGIC

arguments above is as follows:

If p or q, then r. Therefore, if not r, then not p and not q.

We start by identify and giving names to the building blocks which make up an argument.In Arguments 1 and 2, we identified the building blocks as follows:

Argument 1. If x is a real number such that x < −2︸ ︷︷ ︸p

or x > 2︸ ︷︷ ︸q

, then x2 > 4︸ ︷︷ ︸r

.

Therefore, if x2 ≤ 4︸ ︷︷ ︸not r

, then x ≥ −2︸ ︷︷ ︸not p

and x ≤ 2︸ ︷︷ ︸not q

.

Argument 2. If it is raining (p) or I am sick (q), then I stay at home (r).Therefore, if I do not stay at home (not r), then it is not raining (not p)and I am not sick (not q).

1.2 Statements

In mathematics, we are constantly dealing with statements. By a statement we shall meanthe following:

Definition. A statement (or proposition) is a declarativesentence that is true or false, but not both.

Example 1.2 In this example, we consider the following sentences.

(i) One plus one equals two.(ii) One plus one equals three.(iii) He is a university student.

Sentences (i) and (ii) are both statements (only the first of which is true). On the otherhand, sentence (iii) is neither true nor false (the truth or falsity depends on the referencefor the pronoun he. For some values of he the sentence is true; for others it is false), and soit is not a statement.

Every statement has a truth value, namely true (denoted by T ) or false (denoted byF ). We often use p, q and r to denote statements, or perhaps p1, p2, . . . , pn if there areseveral statements involved. For example, we might write

p : One plus one equals two.q : One plus one equals three.

Page 7: Logic Proof Notes

1.3. NEGATION 3

We have seen that p and q are statements, where p has truth value T and q has truthvalue F .

The possible truth values of a statement are often given in a table, called a truth table.The truth values for two statements p and q are given in Figure 1.1. Since there are twopossible truth values for each of p and q, there are four possible combinations of truth valuesfor p and q. It is customary to consider the four combinations of truth values in the orderof TT, TF, FT, FF from top to bottom as shown in Figure 1.1.

p qT TT FF TF F

Figure 1.1 A truth table for two statements p and q.

Exercises

1.1 Which of the following are statements? For those that are, indicate their truth value.

(a)√

2 is an integer.(b) Pietermaritzburg is the capital of KwaZulu-Natal.(c) Why should we study mathematics?(d) 3x + 1 is an odd integer.(e) Please be quiet.(f) Camels can fly.

We now introduce four symbols, called logical connectives, used to build more compli-cated logical expressions out of simpler ones. We begin with the negation of a statement.

1.3 Negation

Definition. Given a statement p, the negation of p is thestatement “not p” or “It is not the case that p” and isdenoted by ∼ p.

Page 8: Logic Proof Notes

4 CHAPTER 1. LOGIC

The negation of statement p has the opposite truth value from p: if p is true, then ∼ p isfalse; if p is false, then ∼ p is true. The truth table for ∼ p (in terms of the possible truthvalues of p) is given in Figure 1.2.

p ∼ pT FF T

Figure 1.2 A truth table for negation.

For example, consider the statement

p : The integer 2 is even.

Then the negation of p is the statement

∼ p : It is not the case that the integer 2 is even.

It would be better to write

∼ p : The integer 2 is not even.

Or better yet to write∼ p : The integer 2 is odd.

Exercises

1.2 State the negation of each of the following statements.

(a) 5 is an even integer.(b) 0 is not an odd integer.(c) It is cold.

1.3 Write the statement “It is not the case that 0 is an odd integer” in symbolic form anddetermine the truth value of the statement.

1.4 Conjunction

Next we consider the conjunction of two statements.

Page 9: Logic Proof Notes

1.4. CONJUNCTION 5

Definition. Given two statements p and q, the conjunctionof p and q is the statement “p and q” and is denoted by p ∧ q.

The conjunction p ∧ q is true only if both p and q are true; otherwise, p ∧ q is false. Forexample, consider the statements

p : The integer 2 is even.q : 4 is less than 3.

The conjunction of p and q, namely,

p ∧ q : The integer 2 is even and 4 is less than 3.

is a false statement since q is false (even though p is true). The truth table for the conjunc-tion of two statements is shown in Figure 1.3. (As before, we write the truth values for pand q in the order of TT, TF, FT, FF from top to bottom in the table.) This truth tabledescribes precisely when p ∧ q is true (or false).

p q p ∧ q

T T TT F FF T FF F F

Figure 1.3 A truth table for conjunction.

Exercises

1.4 Write each of the following statements in symbolic form and determine their truthvalue.

(a) 1 < 2 and 2/3 is a rational number.(b) 3 is a prime number and 3 > 4.

1.5 Let p and q be the statements

p : 1 is an odd integer.q : 1 < 2.

Write each of the following sentences in terms of p, q and logical connectives, and findthe truth values of the given statements.

(a) 1 is an odd integer and 1 < 2.(b) 1 is not an odd integer and 1 < 2.(c) 1 is not an odd integer and 1 ≮ 2.

Page 10: Logic Proof Notes

6 CHAPTER 1. LOGIC

1.5 Disjunction

Definition. Given two statements p and q, the disjunctionof p and q is the statement “p or q” and is denoted by p∨ q.

The disjunction p ∨ q is true if at least one of p and q is true; otherwise, p ∨ q is false.Therefore, p ∨ q is true if exactly one of p and q is true or if both p and q are true. Thusfor the statements p and q described earlier, the disjunction of p and q, namely,

p ∨ q : The integer 2 is even or 4 is less than 3.

is a true statement since at least one of p and q is true (in this case, p is true). The truthtable for the disjunction of two statements is shown in Figure 1.3.

p q p ∨ q

T T TT F TF T TF F F

Figure 1.4 A truth table for disjunction.

Exercises

1.6 Write each of the following statements in symbolic form and determine their truthvalue.

(a) 1 < 2 or 2/3 is a rational number.(b) 3 is a prime number or 3 > 4.

1.7 Let p and q be the statements

p : 1 is an odd integer.q : 1 < 2.

Write each of the following sentences in terms of p, q and logical connectives, and findthe truth values of the given statements.

(a) 1 is an odd integer or 1 < 2.(b) 1 is not an odd integer or 1 < 2.(c) 1 is not an odd integer or 1 ≮ 2.

Page 11: Logic Proof Notes

1.6. THE IMPLICATION 7

1.6 The Implication

Of special importance to us will be a connective called the implication (also called theconditional).

Definition. Given two statements p and q, the implication of p andq is the statement “If p, then q” and is denoted by p → q. We call pthe hypothesis of the implication and q the conclusion.

The implication p → q can be expressed in words in several ways in addition to thewording “If p, then q”, namely:

If p, then q.p implies q.q if p.p only if q.p is sufficient for q.q is necessary for p.

The truth table for the implication p → q is shown in Figure 1.5.

p q p → q

T T TT F FF T TF F T

Figure 1.5 A truth table for implication.

Notice that the only situation for which the implication p → q is false is when p is trueand q is false. The truth table for p → q is actually a definition, but let us convince ourselveswith an example that the truth values in this truth table are indeed justified.

Example 1.3 Suppose your boss makes you the following promise:

“If you meet the month-end deadline, then you will get a bonus.”

Under what circumstances are you justified in saying that your boss spoke falsely?

Solution. The answer is: You do meet the month-end deadline and you do not get abonus. Your boss’s promise only says you will get a bonus if a certain condition (you meet

Page 12: Logic Proof Notes

8 CHAPTER 1. LOGIC

the month-end deadline) is met; it says nothing about what will happen if the condition isnot met. So if the condition is not met, your boss did not lie (your boss promised nothingif you did not meet the month-end deadline); so your boss told the truth in this case. Areyou convinced? Good! If not, let us then check the truth and falseness of the implicationbased on the various combinations of the truth values of the statements

p : You meet the month-end deadline.q : You get a bonus.

The given statement can be written as p → q. Suppose first that p is true and q is true.That is, you meet the month-end deadline and you do get a bonus. Did your boss tell thetruth? Yes, indeed. So if p and q are both true, then so too is p → q, which agrees with thefirst row of the truth table of Figure 1.5.

Second, suppose that p is true and q is false. That is, you meet the month-end deadlineand you did not get a bonus. Then your boss did not do as he/she promised. What yourboss said was false, which agrees with the second row of the truth table of Figure 1.5.

Third, suppose that p is false and q is true. That is, you did not meet the month-enddeadline and you did get a bonus. Your boss (who was most generous) did not lie (yourboss promised nothing if you did not meet the month-end deadline); so he/she told thetruth. This agrees with the third row of the truth table of Figure 1.5.

Finally, suppose that p and q are both false. That is, you did not meet the month-enddeadline and you did not get a bonus. Your boss did not lie here either. Your boss onlypromised you a bonus if you met the month-end deadline. So your boss told the truth. Thisagrees with the fourth row of the truth table of Figure 1.5.

In summary, the implication p → q is false only when p is true and q is false. A conditional(or implication) statement that is true by virtue of the fact that its hypothesis is false issaid to be vacuously true or true by default. Thus the statement: “If you meet themonth-end deadline, then you will get a bonus” is vacuously true if you do not meet themonth-end deadline!

Exercises

1.8 Write each of the following statements in symbolic form and determine their truthvalue.

(a) If 0 is an odd integer, then South Africa will win the World Cup Soccer in 2010.(b) If Mtunzini is the capital of KwaZulu-Natal, then 2 is an even integer.

1.9 Let p and q be the statements

p : 1 is an odd integer.q : 1 < 2.

Page 13: Logic Proof Notes

1.7. THE CONVERSE, INVERSE AND CONTRAPOSITIVE OF AN IMPLICATION 9

Write each of the following sentences in terms of p, q and logical connectives, and findthe truth values of the given statements.

(a) If 1 is not an odd integer, then 1 ≮ 2.(b) If 1 is an odd integer, then 1 ≮ 2.

1.10 Suppose that p and q are statements so that p → q is false. Find the truth values ofeach of the following:(a) ∼p → q (b) p ∨ q (c) q → p.

1.7 The converse, inverse and contrapositive of an implica-tion

Definition. Let p and q be two statements.The statement q → p is called the converse of the implication p → q.The statement ∼ p →∼ q is called the inverse of the implication p → q.The statement ∼ q →∼ p is called the contrapositive of the implication p → q.

Example 1.4 Write the converse, inverse and contrapositive of the statement in Exam-ple 1.3.

Solution. Recall that the given statement can be written as p → q where p and q are thestatements

p : You meet the month-end deadline.q : You get a bonus.

The converse of this implication is q → p, which is

q → p : If you get a bonus, then you have met the month-end deadline.

The inverse of this implication is ∼ p →∼ q, which is

∼ p →∼ q : If you do not meet the month-end deadline, then you will not get a bonus.

The contrapositive of this implication is ∼ q →∼ p, which is

∼ q →∼ p : If you do not get a bonus, then you will not have met the month-end deadline.

Example 1.5 Write the converse, inverse and contrapositive of the following statements:“If today is Saturday, then I will go for a 10km run.”

Solution. Let p and q be the following statements:

p : Today is Saturday.q : I will go for a 10km run.

Page 14: Logic Proof Notes

10 CHAPTER 1. LOGIC

Then the given statement can be written as p → q. The converse of this implication isq → p, which is

q → p : If I go for a 10km run, then today is Saturday.

The inverse of this implication is ∼ p →∼ q, which is

∼ p →∼ q : If today is not Saturday, then I will not go for a 10km run.

The contrapositive of this implication is ∼ q →∼ p, which is

∼ q →∼ p : If I do not go for a 10km run, then today is not Saturday.

Exercises

1.11 Write the converse, inverse and contrapositive of each of the following statements.

(a) If 0 is an odd integer, then South Africa will win the World Cup Soccer in 2010.(b) If Mtunzini is the capital of KwaZulu-Natal, then 2 is an even integer.

1.8 Compound Statements

The symbols ∼, ∧, ∨ and → are sometimes referred to as logical connectives. From givenstatements, we can use these logical connectives to form more intricate statements, calledcompound statements.

Definition. A compound statement (or statement form or for-mula) is a statement made up of one or more statements with statementvariables (such as p, q, and r) and at least one logical connective (suchas ∼, ∧, ∨ and →). The truth table for a given statement form displaysthe truth values that correspond to the different combinations of truthvalues for the variables.

For example, for given statements p and q, the conjunction p∧q is a compound statement.For a slightly more complex example, consider the compound statement given by

((∼ p)∨ ∼ (q ∧ r)) ∨ (∼ (s ∧ (q ∨ (∼ t)))).

In compound statements, we avoid the use of many parentheses when no confusionarises. We often omit the outer pair of parentheses in a compound statement. For example,we write ∼ p rather than (∼ p). In expressions using the logical connectives ∼, ∧, ∨ and→, we adopt the following order of operation:

Page 15: Logic Proof Notes

1.8. COMPOUND STATEMENTS 11

∼ performed first,∧, ∨ performed second,→ performed third.

For example,∼ p ∧ q = (∼ p) ∧ q.

As in ordinary algebra, however, the order of operation can be overridden by the use ofparentheses. Thus,

∼ (p ∨ q)

represents the negation of the disjunction of p and q. Notice that the symbols ∧ and ∨are coequal in order of operation. Therefore an expression such as p ∧ q ∨ r is consideredambiguous. It should be written as either

(p ∧ q) ∨ r or p ∧ (q ∨ r).

Example 1.6 Write each of the following sentences symbolically, letting p and q be thestatements:

p : It is hot.q : It is sunny.

(a) It is not hot and it is sunny.(b) It is not hot and it is not sunny.

Solution. (a) (∼ p) ∧ q.(b) (∼ p) ∧ (∼ q).

Example 1.6 Construct the truth table for the compound statement

(p → q) ∧ (q → p).

Solution. Set up columns labelled p, q, p → q, q → p, and (p → q)∧(q → p). Complete thep and q columns with all four possible combinations of truth values for p and q (in the orderof TT, TF, FT, FF from top to bottom). Then use the truth tables for → (see Figure 1.5)to fill in the p → q and q → p columns. Finally, using the truth table for ∧ (see Figure 1.3),fill in the (p → q) ∧ (q → p) column. The resulting truth table is given in Figure 1.6.

p q p → q q → p (p → q) ∧ (q → p)T T T T TT F F T FF T T F FF F T T T

Figure 1.6 A truth table for (p → q) ∧ (q → q).

Page 16: Logic Proof Notes

12 CHAPTER 1. LOGIC

Example 1.7 Construct the truth table for the compound statement

(∼ (p ∨ q)) → (q ∧ p).

Solution. Set up columns labelled p, q, p ∨ q, ∼ (p ∨ q), q ∧ p and (∼ (p ∨ q)) → (q ∧ p).Complete the p and q columns with all four possible combinations of truth values for p andq. Then use the truth tables for ∨ (see Figure 1.4) and ∧ (see Figure 1.3) to write the truthvalues in the columns of p∨ q and q ∧ p. Next, using the truth table for ∼ (see Figure 1.2),fill in the column of ∼ (p ∨ q). Finally, using the truth table for → (see Figure 1.5), fill inthe column for (∼ (p ∨ q)) → (q ∧ p). The resulting truth table is given in Figure 1.7.

p q p ∨ q ∼ (p ∨ q) q ∧ p (∼ (p ∨ q)) → (q ∧ p)T T T F T TT F T F F TF T T F F TF F F T F F

Figure 1.7 A truth table for (∼ (p ∨ q)) → (q ∧ p).

Exercises

1.12 Construct truth tables for the compound statement:

(a) p ∧ (q → ∼p).(b) (p ∧ ∼q) → r.

1.9 The Biconditional

For statements p and q, we are often interested in both the implication p → q and itsconverse q → p.

Definition. Given two statements p and q, the conjunction

(p → q) ∧ (q → p)

of the implication p → q and its converse q → p is calledthe biconditional of p and q and is denoted by p ↔ q. Thebiconditional p ↔ q is often stated as “p if and only if q.”or “p is equivalent to q”.

Page 17: Logic Proof Notes

1.10. TAUTOLOGIES 13

The truth table for the biconditional p ↔ q is shown in Figure 1.8.

p q p ↔ q

T T TT F FF T FF F T

Figure 1.8 A truth table for a biconditional.

Recall that p ↔ q represents the compound statement (p → q) ∧ (q → p) whose truthtable we established earlier (see Figure 1.6). As mentioned earlier (in Section 1.6), theimplication q → p can be expressed in words as “p is necessary for q”, while p → q canbe expressed as “p is sufficient for q”. Therefore, p ↔ q can be expressed in words as p isnecessary for q and p is sufficient for q. Another way to say this is

p is necessary and sufficient for q.

We remark that the phrase “if and only if” occurs often in mathematics. Many math-ematicians abbreviate this phrase by writing “iff”. Although “iff” is informal and not aword, its use is common and you should be familiar with it.

1.10 Tautologies

Definition. A compound statement S is called a tautologyif the truth value of S is true for any assignment of truthvalues to the statement variables occurring in S.

Example 1.8 Show that the compound statement p ∨ (∼ p) is a tautology.

Solution. The truth table (see Figure 1.9) for p∨(∼ p) shows that this statement is alwaystrue regardless of the truth value of p. Hence, p ∨ (∼ p) is a tautology.

p ∼ p p ∨ (∼ p)T F TF T T

Figure 1.9 A truth table for p ∨ (∼ p).

Page 18: Logic Proof Notes

14 CHAPTER 1. LOGIC

Example 1.9 Show that the compound statement (∼ p) ∨ (q → p) is a tautology.

Solution. The truth table (see Figure 1.10) for (∼ p) ∨ (q → p) shows that this statementis always true regardless of the truth values of p and q. Hence, this statement is a tautology.

p q ∼ p q → p (∼ p) ∨ (q → p)T T F T TT F F T TF T T F TF F T T T

Figure 1.10 A truth table for p ∨ (∼ p).

Exercises

1.13 Show using truth tables that the following statements are tautologies:

(a) ∼(∼p ∧ q) ∨ q.(b) (∼p ∨ q) ∨ (p ∧ ∼q).

1.11 Contradictions

Definition. A compound statement S is called a contradictionif the truth value of S is false for any assignment of truth valuesto the statement variables occurring in S.

Example 1.10 Show that the compound statement p ∧ (∼ p) is a contradiction.

Solution. The truth table (see Figure 1.11) for p ∧ (∼ p) shows that this statement isalways false regardless of the truth value of p. Hence, this statement is a contradiction.

p ∼ p p ∧ (∼ p)T F FF T F

Figure 1.11 A truth table for p ∧ (∼ p).

Page 19: Logic Proof Notes

1.12. LOGICAL EQUIVALENCE 15

Example 1.11 Show that the compound statement (p ∧ q) ∧ (q →∼ p) is a contradiction.

Solution. The truth table (see Figure 1.12) for (p ∧ q) ∧ (q →∼ p) shows that thisstatement is always false regardless of the truth values of p and q. Hence, this statement isa contradiction.

p q p ∧ q ∼ p q →∼ p (p ∧ q) ∧ (q →∼ p)T T T F F FT F F F T FF T F T T FF F F T T F

Figure 1.12 A truth table for (p ∧ q) ∧ (q →∼ p).

Exercises

1.14 Show using truth tables that the following statements are contradictions:

(a) (∼p ∨ q) ∧ (p ∧ ∼q). (b) (p ∧ q) ∧ (p ∧ ∼q).

1.12 Logical Equivalence

Definition. Two statements R and S are logically equiv-alent if they have the same truth values for all combinationsof truth values of the statement variables occurring in R andS. We denote the logical equivalence of R and S by R ≡ S.

Example 1.12 Show that p ∧ q ≡ q ∧ p .

Solution. The logical equivalence of p ∧ q and q ∧ p is verified in the truth table shown inFigure 1.13 since the corresponding columns of these two statements are identical.

p q p ∧ q q ∧ p

T T T TT F F FF T F FF F F F

Figure 1.13 p ∧ q and q ∧ p are logically equivalent.

Page 20: Logic Proof Notes

16 CHAPTER 1. LOGIC

Example 1.13 Show that p → q ≡ (∼ p) ∨ q .

Solution. The logical equivalence of p → q and (∼ p) ∨ q is verified in the truth tableshown in Figure 1.14 since the corresponding columns of these two statements are identical.

p q ∼ p p → q (∼ p) ∨ q

T T F T TT F F F FF T T T TF F T T T

Figure 1.14 p → q and (∼ p) ∨ q are logically equivalent.

Example 1.14 Show that p ↔ q ≡ (∼p ∨ q) ∧ (∼q ∨ p).

Solution. The logical equivalence of p ↔ q and (∼p ∨ q) ∧ (∼q ∨ p) follows directly fromthe definition of a biconditional and from Example 1.13.

p ↔ q ≡ (p → q) ∧ (q → p) (by definition of biconditional)≡ (∼p ∨ q) ∧ (∼q ∨ p) (by Example 1.13).

The logical equivalence of p → q and (∼ p) ∨ q, and the logical equivalence of p ↔ qand (∼p ∨ q) ∧ (∼q ∨ p), is especially important. Strictly speaking this means that we canactually dispense with the logical connectives “→” and “↔.”

Remark. Any statement form containing → or ↔ is logi-cally equivalent to one containing only ∼,∧, and ∨.

Example 1.15 Show that the statements ∼(p∧q) and ∼p∧∼q are not logically equivalent.

Solution. The statements ∼(p ∧ q) and ∼p ∧∼q have different truth values in rows 2 and3 of in the truth table (shown in Figure 1.15), and are therefore not logically equivalent.

p q ∼p ∼q p ∧ q ∼(p ∧ q) ∼p ∧ ∼q

T T F F T F FT F F T F T 6= FF T T F F T 6= FF F T T F T T

Figure 1.15 ∼(p ∧ q) and ∼p ∧ ∼q are not logically equivalent.

Page 21: Logic Proof Notes

1.12. LOGICAL EQUIVALENCE 17

Example 1.16 Show that ∼(p ∨ q) ≡ (∼p) ∧ (∼q) .

Solution. The logical equivalence of ∼(p ∨ q) and (∼p) ∧ (∼q) is verified in the truthtable shown in Figure 1.16 since the corresponding columns (columns 4 and 7) of these twostatements are identical.

p q p ∨ q ∼(p ∨ q) ∼ p ∼ q (∼p) ∧ (∼q)T T T F F F FT F T F F T FF T T F T F FF F F T T T T

Figure 1.16 ∼(p ∨ q) ≡ (∼p) ∧ (∼q) are logically equivalent.

Example 1.17 Show that p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r) .

Solution. The logical equivalence of p∨ (q ∧ r) and (p∨ q)∧ (p∨ r) is verified in the truthtable shown in Figure 1.17 since the corresponding columns (columns 5 and 8) of these twostatements are identical.

p q r q ∧ r p ∨ (q ∧ r) p ∨ q p ∨ r (p ∨ q) ∧ (p ∨ r)T T T T T T T TT T F F T T T TT F T F T T T TT F F F T T T TF T T T T T T TF T F F F T F FF F T F F F T FF F F F F F F F

Figure 1.17 p → q and (∼ p) ∨ q are logically equivalent.

There are many fundamental logical equivalences that we often encounter. We summarizea number of these in Theorem 1 for future reference.

Theorem 1 Let p, q and r be statements. Then the following logical equivalences hold.

(1) Commutative Laws(i) p ∧ q ≡ q ∧ p(ii) p ∨ q ≡ q ∨ p

(2) Associate Laws(i) (p ∧ q) ∧ r ≡ p ∧ (q ∧ r)(ii) (p ∨ q) ∨ r ≡ p ∨ (q ∨ r)

Page 22: Logic Proof Notes

18 CHAPTER 1. LOGIC

(3) Distributive Laws(i) p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r)(ii) p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r)

(4) De Morgan’s Laws(i) ∼(p ∨ q) ≡ (∼p) ∧ (∼q)(ii) ∼(p ∧ q) ≡ (∼p) ∨ (∼q)

(5) Idempotent Laws(i) p ∧ p ≡ p(ii) p ∨ p ≡ p

(6) Negation Laws(i) p ∨ (∼p) ≡ T(ii) p ∧ (∼p) ≡ F

(7) Universal Bound Laws(i) p ∨ T ≡ T(ii) p ∧ F ≡ F

(8) Identity Laws(i) p ∨ F ≡ p(ii) p ∧ T ≡ p

(9) Double Negation Law∼(∼p) ≡ p

Proof. A proof of the Commutative Law 1(i) was given in Example 1.12, while proofs ofthe Distributive Law 3(i) and De Morgan’s Law 4(i) were given in Examples 1.17 and 1.16,respectively. We leave the proofs of the other Laws as an exercise. 2

We mention that De Morgan’s Laws can be expressed in words as follows:

De Morgan’s Laws.

The negation of an and statement is logically equivalent tothe or statement in which each component is negated, whilethe negation of an or statement is logically equivalent to theand statement in which each component is negated.

From Example 1.16 and the Double Negation Law, we have the logical equivalence

Fact 1.1 p ∨ q ≡ ∼(∼p ∧ ∼q).

Page 23: Logic Proof Notes

1.12. LOGICAL EQUIVALENCE 19

Exercises

1.15 Determine which of the pairs of statement forms listed below are logically equivalent.Justify your answers using truth tables.

(a) p ∧ (p ∨ q) and p.(b) p ∨ (p ∧ q) and p.(c) (∼p) ∨ (∼q) and ∼(p ∨ q).

1.16 Using Theorem 1, supply reasons for each step in the logical equivalence derived in(i) and (ii) below.

(i) (p ∧ ∼q) ∨ (p ∧ q) ≡ p ∧ (∼q ∨ q) (by (a) )≡ p ∧ (q ∨ ∼q) (by (b) )≡ p ∧ T (by (c) )≡ p (by (d) ).

(ii) (p ∨ ∼q) ∧ (∼p ∨ ∼q) ≡ (∼q ∨ p) ∧ (∼q ∨ ∼p) (by (e) )≡ ∼q ∨ (p ∧ ∼p) (by (f) )≡ ∼q ∨ F (by (g) )≡ ∼q (by (h) ).

1.17 Without using truth tables, verify the following logical equivalences using Theorem 1.

(a) p ∨ (p ∧ q) and p.(b) p ∧ (p ∨ q) and p.(c) ∼(p ∨ ∼q) ∨ (∼p ∧ ∼q) and ∼p.(d) ∼(∼p ∧ ∼q) and p ∨ q.

1.18 Use the logical equivalences given in Example 1.13, Example 1.14, and Fact 1.1, torewrite the given compound statements using only the connectives ∧ and ∼.

(a) (p ∧ ∼q) → r.(b) (∼p ∨ q) → (r ∨ ∼q).(c) (p → r) ↔ (q → r).

Page 24: Logic Proof Notes

20 CHAPTER 1. LOGIC

1.13 Negation of a Conditional Statement

Example 1.18 Show that

∼(p → q) ≡ p ∧ ∼q

Solution. We can prove this using truth tables. However, let us prove this without usingtruth tables and rather present a proof using the logical equivalences in Theorem 1. Wehave

∼(p → q) ≡ ∼(∼p ∨ q) (by Example 1.13)≡ ∼(∼p) ∧ (∼q) (by De Morgan’s Laws)≡ p ∧ ∼q (by the Double Negation Law).

The negation of a conditional statement can be expressed in words as follows:

The negation of “if p then q” is logically equivalent to “p and not q”.

1.14 The Contrapositive of a Conditional Statement

Recall that the contrapositive of a conditional statement p → q is the statement ∼ q →∼ p.In this section, we show that:

A conditional statement is logically equivalent to its contrapositive.

Example 1.19 Show that

p → q ≡ ∼q → ∼p

Solution. We can prove this using truth tables. However, let us prove this without usingtruth tables and rather present a proof using the logical equivalences in Theorem 1. Wehave

p → q ≡ ∼p ∨ q (by Example 1.13)≡ q ∨ ∼p (by the Commutative Laws)≡ ∼(∼q) ∨ ∼p (by the Double Negation Law)≡ ∼q → ∼p (by Example 1.13).

Page 25: Logic Proof Notes

1.15. QUANTIFIED STATEMENTS 21

1.15 Quantified Statements

In the previous sections, we defined and discussed basic properties of compound statements.We were interested in whether a particular statement was true or false. This logic is calledpropositional logic or statement logic. However there are many arguments whosevalidity cannot be verified using propositional logic. Consider, for example, the sentence

p : x is an even integer.

This sentence is neither true nor false. The truth or falsity depends on the value of thevariable x. For some values of x the sentence is true; for others it is false. Thus this sentenceis not a statement. However, let us denote this sentence by P (x), i.e.,

P (x) : x is an even integer.

Then, P (4) is true, while P (5) is false. To study the properties of such sentences, we needto extend the framework of propositional logic to what is called first-order logic.

Definition. A predicate or propositional function is a sentence thatcontains a finite number of variables and becomes a statement when spe-cific values are substituted for the variables. The domain of a predicatevariable is the set of all values that may be substituted in place of thevariables.

In our earlier example, the sentence “P (x) :x is an even integer” is a predicate (or propo-sitional function) with domain D the set of integers since for each x ∈ D, P (x) is a statement,i.e., for each x ∈ D, P (x) is true or false, but not both.

Example 1.20 The following are examples of propositional functions:

(a) The sentence “P (x):x+3 is an odd integer” with domain D the set of positive integers.(b) The sentence “P (x):x + 3 is an odd integer” with domain D the set of integers.(c) The sentence “P (x, y, z):x2 + y2 = z2” with domain D the set of positive integers.

Some sets are encountered so often that they are given special names. These are summa-rized below:

symbol for the set ofN natural number (positive integers)Z integersQ rational numbersR real numbers

Page 26: Logic Proof Notes

22 CHAPTER 1. LOGIC

Thus,N = {1, 2, 3, . . .},Z = {. . . ,−2,−1, 0, 1, 2, . . .}, andQ = {a

b | a, b ∈ Z and b 6= 0}.

A real number that is not a rational number is called irrational.

1.16 The Universal Quantifier

Example 1.21 Let P (x) be a predicate with domain D. Then the sentence

Q(x) : for all x, P (x)

is a statement. To see this, notice that either P (x) is true at each value x ∈ D (the notationx ∈ D indicates that x is in the set D, while x /∈ D means that x is not in D) or P (x) isfalse for at least one value x ∈ D. If P (x) is true at each value x ∈ D, then Q(x) is true.However, if P (x) is false for at least one value x ∈ D, then Q(x) is false. Hence, Q(x) is astatement because it is either true or false (but not both).

Definition. Each of the phrases “every”, “for every”, “for each”,and “for all” is referred to as the universal quantifier and isexpressed by the symbol ∀. Let P (x) be a predicate with domainD. A universal statement is a statement of the form

∀x ∈ D, P (x).

It is false if P (x) is false for at least one x ∈ D; otherwise, it istrue.

Example 1.22 Let P (x) be the predicate “P (x) : x2 ≥ x.” Determine whether the followinguniversal statements are true or false.

(a) ∀x ∈ R, P (x);(b) ∀x ∈ Z, P (x).

Solution. (a) Let x = 12 ∈ R. Then, (1

2)2 = 14 < 1

2 , and so P (12) is false. Therefore,

“∀x ∈ R, P (x)” is false.

(b) For all integers x, x2 ≥ x is true, and so P (x) is true for all x ∈ Z. Hence, “∀x ∈Z, P (x)” is true.

Page 27: Logic Proof Notes

1.17. THE EXISTENTIAL QUANTIFIER 23

Exercises

1.19 Symbolize the following by using quantifiers, predicates, and logical connectives.

(a) The square of any real number is nonnegative.(b) All fish can swim.(c) No integer has a square equal to 2.

1.20 Let P (x) be the predicate “x is an odd integer”, Q(x) the predicate “x is a primeinteger” and R(x) the predicate “x2 is an odd integer.” Write the following symbolicstatements in English.

(a) ∀x ∈ Z, P (x) → R(x).(b) ∀x ∈ Z, P (x) ∧Q(x).

1.17 The Existential Quantifier

Definition. Each of the phrases “there exists”, “there is”, “for some”,and “for at least one” is referred to as the existential quantifier andis denoted in symbols ∃. Let P (x) be a predicate with domain D. Anexistential statement is a statement of the form

∃x ∈ D such that P (x).

It is true if P (x) is true for at least one x ∈ D; otherwise, it is false.

Example 1.23 Let P (x) be the predicate “P (x) : x2 < x.” Determine whether the followingexistential statements are true or false.

(a) ∃x ∈ R, P (x);(b) ∃x ∈ Z, P (x).

Solution.(a) Let x = 1

2 ∈ R. Then, (12)2 = 1

4 < 12 , and so P (1

2) is true. Therefore, “∃x ∈ R, P (x)”is true.

(b) For all integers x, x2 ≥ x is true, and so there is no integer x such that P (x) is true.Hence, “∃x ∈ Z, P (x)” is false.

Page 28: Logic Proof Notes

24 CHAPTER 1. LOGIC

Exercises

1.21 Symbolize the following by using quantifiers, predicates, and logical connectives.

(a) Some rational numbers are integers.(b) Some integers are even.(c) There is an integer x such that x2 = 4.(d) There exists an integer that is odd and prime.(e) Everybody trusts somebody.(f) Somebody trusts everybody.(g) Between every integer and its double there is a prime number.

1.22 Let P (x) be the predicate “x is an odd integer” and Q(x) the predicate “x is a primeinteger.” Write the following symbolic statement in English.

∃x ∈ Z, P (x) ∧Q(x).

1.18 Negation of Quantified Statements

Fact 1.2. The negation of a universal statement of the form

∀x ∈ D, P (x)

is logically equivalent to an existential statement of the form

∃x ∈ D such that ∼P (x).

Symbolically,

∼(∀x ∈ D, P (x)) ≡ ∃x ∈ D such that ∼P (x).

Consider the universal statement

∀x ∈ D, P (x).

It is false if P (x) is false for at least one x ∈ D; otherwise, it is true. Hence it is false ifand only if P (x) is false for at least one x ∈ D if and only if ∼P (x) is true for at least onex ∈ D. Thus the negation of this statement is the statement

∃x ∈ D such that ∼P (x).

Page 29: Logic Proof Notes

1.18. NEGATION OF QUANTIFIED STATEMENTS 25

Example 1.24 What is the negation of the statement “All mathematicians wear glasses”?

Solution. Let us write this statement symbolically. Let D be the set of all mathematiciansand let P (x) be the predicate “x wears glasses” with domain D. The given statement canbe written as

∀x ∈ D, P (x).

The negation is∃x ∈ D such that ∼P (x).

In words, the negation is “There exists a mathematician who does not wear glasses” or“Some mathematicians do not wear glasses”.

Fact 1.3. The negation of an existential statement of the form

∃x ∈ D such that P (x)

is logically equivalent to a universal statement of the form

∀x ∈ D, ∼P (x).

Symbolically,

∼(∃x ∈ D such that P (x)) ≡ ∀x ∈ D, ∼P (x).

Consider the existential statement

∃x ∈ D such that P (x)

It is true if P (x) is true for at least one x ∈ D; otherwise, it is false. Hence it is false ifand only if P (x) is false for all x ∈ D if and only if ∼P (x) is true for all x ∈ D. Thus thenegation of this statement is the statement

∀x ∈ D, ∼P (x).

Example 1.25 What is the negation of the statement “Some politicians are honest”?

Solution. Let us write this statement symbolically. Let D be the set of all politicians andlet P (x) be the predicate “x is honest” with domain D. The given statement can be writtenas

∃x ∈ D such that P (x).

The negation is∀x ∈ D, ∼P (x).

In words, the negation is “All politicians are not honest” or “No politician is honest”.

Page 30: Logic Proof Notes

26 CHAPTER 1. LOGIC

Consider next the negation of a universal conditional statement. By Fact 1.2, we havethat

∼(∀x ∈ D, (P (x) → Q(x))) ≡ ∃x ∈ D such that ∼(P (x) → Q(x)).

But the negation of an “if p then q” statement is logically equivalent to an “p and notq” statement (see Example 1.18). Hence,

∼(P (x) → Q(x)) ≡ P (x) ∧ ∼Q(x).

Therefore we have the following fact:

Fact 1.4. The negation of a universal conditional statement of the form

∀x ∈ D, P (x) → Q(x)

is logically equivalent to a universal statement of the form

∃x ∈ D such that (P (x) ∧ ∼Q(x)).

Symbolically,

∼(∀x ∈ D, P (x) → Q(x)) ≡ ∃x ∈ D such that (P (x) ∧ ∼Q(x)).

Written less symbolically, this becomes

∼(∀x ∈ D, if P (x) then Q(x)) ≡ ∃x ∈ D such that P (x) and ∼Q(x).

1.19 Universal Conditional Statements

Recall from Section 1.7 that a conditional statement has a contrapositive, a converse, andan inverse. These definitions can be extended to universal conditional statements.

Page 31: Logic Proof Notes

1.19. UNIVERSAL CONDITIONAL STATEMENTS 27

Definition. Consider a universal conditional statementof the form

∀x ∈ D, P (x) → Q(x)

1. Its contrapositive is the statement

∀x ∈ D, ∼Q(x) → ∼P (x).

2. Its converse is the statement

∀x ∈ D, Q(x) → P (x).

3. Its inverse is the statement

∀x ∈ D, ∼P (x) → ∼Q(x).

Example 1.26 Write the contrapositive, converse, and inverse of the statement:

“If a real number is greater than 3, then its square is greater than 9”.

Solution. Symbolically, the statement can be written as:

∀x ∈ R, if x > 3 then x2 > 9.

(Here P (x) is the statement “x > 3” and Q(x) the statement “x2 > 9”.)

1. The contrapositive is: ∀x ∈ R, if x2 ≯ 9 then x ≯ 3, or, equivalently,

∀x ∈ R, if x2 ≤ 9 then x ≤ 3.

2. The converse is:∀x ∈ R, if x2 > 9 then x > 3.

(Note that the converse is false; take, for example, x = −4. Then, “(−4)2 > 9” is true but“−4 > 3” is false. Hence the statement “ if (−4)2 > 9 then − 4 > 3” is false. Hence theuniversal statement “∀x ∈ R, if x2 > 9 then x > 3” is false.)

3. The inverse is: ∀x ∈ R, if x ≯ 3 then x2 ≯ 9, or, equivalently,

∀x ∈ R, if x ≤ 3 then x2 ≤ 9.

Page 32: Logic Proof Notes

28 CHAPTER 1. LOGIC

Exercises

1.23 Write the contrapositive, converse, and inverse of the following statements:

(a) If the square of an integer is odd, then the integer is odd.(b) If an integer is divisible by 4, then it is even.(c) ∀x ∈ R, if x(x + 1) > 0 then x > 0 or x < −1.

1.20 Review of Symbols

We close this chapter with a review of the symbols that we have introduced.

∼ negation (not)∨ disjunction (or)∧ conjunction (and)→ implication↔ biconditional∀ universal quantifier (for every)∃ existential quantifier (there exists)

Page 33: Logic Proof Notes

Chapter 2

Proof Techniques

2.1 Introduction

In this chapter, we discuss the topic of mathematical proofs. Our goal is to introduce thestudent to several important proof techniques for verifying mathematical statements. Fora given true mathematical statement, how exactly can we verify that it is true? Findinganswers to mathematical questions is all very well, but we must be certain that we are rightand we must be able to able to convince others, not just ourselves, of this!

A true mathematical statement is called a result. Interesting or significant mathematicalresults are called theorems (or propositions). For example, the mathematical statement“1+1 = 2” is true, but we would not call this a theorem, but rather a result. A corollary isa mathematical result that can be deduced from or is a consequence of some earlier result. Alemma is a mathematical result that is useful in proving another (more interesting) result.A lemma can be thought of as a “helping result” to prove some other result.

Before presenting several proof techniques, we will need some elementary definitions innumber theory.

Definition. An integer n is even if and only if n = 2k for some integer k.An integer n is odd if and only if n = 2k + 1 for some integer k.

Example 2.1(a) The integer 8 is even since 8 = 2 · 4 (i.e., 8 = 2k where k = 4 ∈ Z).(b) The integer −5 is odd since −5 = 2(−3) + 1 (i.e., −5 = 2k + 1 where k = −3 ∈ Z).

We shall show in Section 2.6 (using the so-called quotient-remainder theorem) that everyinteger is either even or odd.

29

Page 34: Logic Proof Notes

30 CHAPTER 2. PROOF TECHNIQUES

Definition. An integer n is prime if and only if n > 1 and for all positiveintegers r and s, if n = r ·s, then r = 1 or s = 1. An integer n is compositeif and only if n = r · s for some positive integers r and s with r 6= 1 ands 6= 1.

Example 2.2(a) The first six prime numbers are 2, 3, 5, 7, 11, 13.(b) The first six composite numbers are 4, 6, 8, 9, 10, 12.(c) Every integer greater than 1 is either prime or composite since the two definitions are

negations of each other (see Section 1.18!).

Definition. Two integers m and n are said to be of the same parityif m and n are both even or are both odd, while m and n are said to beof the opposite parity if one of m and n is even and the other is odd.Two integers are consecutive if one is one more than the other. So if oneinteger is n, the next consecutive integer is n + 1.

Example 2.3(a) The integers 2 and 18 are of the same parity (since they are both even).(b) The integers 7 and 12 are of the opposite parity (one is even, the other odd).

Definition. Let n and d be integers with d 6= 0. Then n is said to bedivisible by d if n = d · k for some integer k. Alternatively, we say that

n is a multiple of d, ord is a factor of n, ord is a divisor of n, ord divides n.

The notation “d | n” is read “d divides n.”

Example 2.4(a) Is 16 divisible by 8? (b) Does 3 divide 21? (c) Is 21 a multiple of 7?(d) Does 5 | 30? (e) Is 7 a factor of 42? (f) Is 8 a factor of −8?

Solution(a) Yes: 16 = 8 · 2. (b) Yes: 21 = 3 · 7. (c) Yes: 21 = 7 · 3.(d) Yes: 30 = 5 · 6. (e) Yes: 42 = 7 · 6. (f) Yes: −8 = 8 · (−1).

Page 35: Logic Proof Notes

2.2. TRIVIAL PROOFS 31

Exercises

2.1 Let m and n be (fixed) integers. Justify your answers to each of the following questions:

(a) Is 4mn + 10n even?(b) Is 8mn + 5 odd?(c) If m and n are positive, is m2 + 2mn + n2 composite?(d) If m ≥ n + 2 ≥ 3, is m2 − n2 composite?

2.2 (a) Is 45 divisible by 9?(b) Is 5k(3k + 6) divisible by 3?(c) Is 24 a multiple of 8?(d) Does 11 | 54?(e) Is −6 a factor of 42?(f) If n = 4k + 3, does 8 divide n2 − 1?

2.2 Trivial Proofs

Trivial proof. Let P (x) and Q(x) be statements with domain D.If Q(x) is true for all every x ∈ D, then the universal statement

∀x ∈ D, P (x) → Q(x)

is true (regardless of the truth value of P (x)).

Recall from the Truth Table 1.5, that if Q(x) is a true statement, then so too is theimplication P (x) → Q(x). Furthermore, the universal statement ∀x ∈ D, P (x) → Q(x)is a true statement provided P (x) → Q(x) is true for every x ∈ D. In particular ifQ(x) is true for all every x ∈ D, then immediately we can deduce that the statement∀x ∈ D, P (x) → Q(x) is true. Such a proof we call a trivial proof.

Result 2.1 For x ∈ R, if x > −5, then x2 + 2 > 0.

Proof. Consider the statements P (x) :x > −5 and Q(x) : x2 + 2 > 0. Since x2 ≥ 0 forevery x ∈ R, it follows that x2 + 2 ≥ 0 + 2 > 0 for every x ∈ R. Hence, Q(x) is true forevery x ∈ R. Thus, P (x) → Q(x) is true for every x ∈ R, i.e., for x ∈ R, if x > −5, thenx2 + 2 > 0. 2

Page 36: Logic Proof Notes

32 CHAPTER 2. PROOF TECHNIQUES

The symbol 2 that occurs at the end of the proof of Result 2.1 indicates that the proofis complete. Note that the proof of Result 2.1 does not depend on x > −5. We could have,in fact, replaced x > −5 by any hypothesis and the result would still be true. It would havebeen better to replace the statement of Result 2.1 by “If x ∈ R, then x2 + 2 > 0.”

We remark that the proof of Result 2.1 could be simplified if we do not introduce thestatements P (x) and Q(x):

Proof of Result 2.1. Since x2 ≥ 0 for every x ∈ R, it follows that x2 + 2 ≥ 0 + 2 > 0 forevery x ∈ R. Hence, x2 + 2 > 0. 2

Result 2.2 If n is an odd integer, then 6n3 + 4n + 3 is an odd integer.

Proof. Since 6n3 +4n+3 = 2(3n3 +2n+1)+1 where 3n3 +2n+1 ∈ Z (i.e., 6n3 +4n+3 =2k + 1 where k = 3n3 + 2n + 1 ∈ Z), the integer 6n3 + 4n + 3 is odd for every integer n. 2

Note that in Result 2.2 the fact that 6n3 + 4n + 3 is odd does not depend on n beingodd. It would have been better to replace the statement of Result 2.2 by

If n is an integer, then 6n3 + 4n + 3 is odd.

Exercises

2.3 For x ∈ R, prove that if x < −1, then x2 + 14 > 0.

2.4 Prove that if n is an odd integer, then 4n3 + 6n2 + 12 is an even integer.

2.3 Vacuous Proofs

Vacuous proof. Let P (x) and Q(x) be statements with domainD. If P (x) is false for all every x ∈ D, then the universal statement

∀x ∈ D, P (x) → Q(x)

is true (regardless of the truth value of Q(x)).

Recall from the Truth Table 1.5, that if P (x) is a false statement, then the implicationP (x) → Q(x) is true. Hence if P (x) is false for all every x ∈ D, then we can deduce thatthe statement ∀x ∈ D, P (x) → Q(x) is true. Such a proof we call a vacuous proof.

Page 37: Logic Proof Notes

2.4. DIRECT PROOFS 33

Result 2.3 For x ∈ R, if x2 − 2x + 1 < 0, then x > 4.

Proof. Consider the statements P (x) :x2−2x+1 < 0 and Q(x) :x > 4. Since x2−2x+1 =(x− 1)2 ≥ 0 for every x ∈ R, we have that x2 − 2x + 1 < 0 is false for every x ∈ R. Hence,P (x) is false for every x ∈ R. Thus, P (x) → Q(x) is true for every x ∈ R, i.e., for x ∈ R, ifx2 − 2x + 1 < 0, then x > 4. 2

Note that in the proof of Result 2.3, the truth value of the statement x > 4 plays no rolewhatsoever. We could have, in fact, replaced x > 4 by any conclusion and the result wouldstill be true.

Exercises

2.5 Let x ∈ R. Prove that if 2x2 − 4x + 4 < 0, then x5 ≥ 7.

2.4 Direct Proofs

One of the most important proof techniques is the method of direct proof.

Direct proof. Let P (x) and Q(x) be statements with domain D. IfP (x) → Q(x) is true for all x ∈ D for which P (x) is true, then the universalstatement

∀x ∈ D, P (x) → Q(x)

is true. Such a proof we call a direct proof. Thus to give a direct proofof the above universal statement, we

• assume P (x) is true for some particular but arbitrary element x ∈ D,and then

• show that Q(x) is true for this element x.

Recall that the universal statement ∀x ∈ D, P (x) → Q(x) is true provided P (x) → Q(x)is true for every x ∈ D. If P (x) is a false statement, then the implication P (x) → Q(x) istrue. Hence to show that the universal statement ∀x ∈ D, P (x) → Q(x) is true for everyx ∈ D, we need only show that P (x) → Q(x) is true for all x ∈ D for which P (x) is true.Such a proof we call a direct proof.

Page 38: Logic Proof Notes

34 CHAPTER 2. PROOF TECHNIQUES

Result 2.4 If n is an even integer, then 3n + 5 is an odd integer.

Proof. If we let “P (n):n is even” and “Q(n): 3n + 5 is odd”, then we need to show thatthe universal statement

∀n ∈ Z, P (n) → Q(n)

is true. To do this, we assume P (n) is true for some particular but arbitrary element n ∈ Zand show that Q(n) is true for this element n. Since P (n) is true, n = 2k for some integerk. Hence, 3n + 5 = 3(2k) + 5 = 6k + 5 = 2(3k + 2) + 1 = 2m + 1, where m = 3k + 2.Since k ∈ Z, we must have m ∈ Z (since the product of two integers is an integer, and thesum and difference of two integers is an integer). Hence, 3n + 5 = 2m + 1 for some integerm, whence Q(n) is true. Thus by the method of direct proof, we have proven our desiredresult. 2

We remark that the proof of Result 2.4 could be simplified if we do not introduce thestatements P (x) and Q(x).

Proof of Result 2.4. Assume that n is an even integer. Then, n = 2k for some integer k.Hence,

3n + 5 = 3(2k) + 5 = 6k + 5 = 2(3k + 2) + 1 = 2m + 1,

where m = 3k + 2. Since k ∈ Z, we must have m ∈ Z. Hence, 3n + 5 = 2m + 1 for someinteger m, whence 3n + 5 is an odd integer. 2

Result 2.5 If n is an odd integer, then 5n + 3 is an even integer.

Proof. Assume that n is an odd integer. Then, n = 2k + 1 for some integer k. Hence,

5n + 3 = 5(2k + 1) + 3 = 10k + 8 = 2(5k + 4) = 2m,

where m = 5k +4. Since k ∈ Z, we must have m ∈ Z. Hence, 5n+3 = 2m for some integerm, whence 5n + 3 is an even integer. 2

Result 2.6 If n is an odd integer, then n2 + n is even.

Proof. Assume that n is an odd integer. Then, n = 2k + 1 for some integer k. Hence

n2 + n = (2k + 1)2 + (2k + 1) = 4k2 + 6k + 2 = 2m,

where m = 2k2 + 3k + 1. Since k ∈ Z, we must have m ∈ Z. Hence, n2 + n is even. 2

Result 2.7 If the sum of any two integers is even, then so is their difference.

Proof. Assume that m and n are (particular but arbitrarily chosen) integers such thatm + n is even. (We show that m− n is even.) Then, m + n = 2k for some integer k. Thus,m = 2k − n. Hence,

m− n = (2k − n)− n = 2k − 2n = 2(k − n) = 2`,

Page 39: Logic Proof Notes

2.5. PROOF BY CONTRAPOSITIVE 35

where ` = k−n. Since k, n ∈ Z and the difference between two integers is an integer, ` ∈ Z.Hence, m− n = 2` where ` ∈ Z. Thus, m− n is even. 2

Exercises

2.6 Use the method of direct proof to prove that:

(a) The product of two odd integers is an odd integer.(b) The sum of two even integers is an even integer.(c) If n is an odd integer, then 5n2 + 11 is an even integer.(d) If n is an even integer, then 3n2 − 4n− 5 is an odd integer.(e) If n is an even integer, then 5n3 is an even integer.(f) If n ∈ Z and 7n− 3 is odd, then n is even.

2.7 Find the mistake in the “proof” of the following result, and provide a correct proof.

Result. If m is an even integer and n is an odd integer, then 2m + 3n is an oddinteger.

Proof. Since m is an even integer and n is an odd integer, m = 2k and n = 2k + 1for some integer k. Therefore,

2m + 3n = 2(2k) + 3(2k + 1) = 10k + 3 = 2(5k + 1) + 1 = 2` + 1,

where ` = 5k + 1. Since k ∈ Z, ` ∈ Z. Hence, 2m + 3n = 2` + 1 for some integer `,whence 2m + 3n is an odd integer. 2

2.8 Find the mistake in the “proof ” of the following result, and provide a correct proof.

Result. For all integers n ≥ 1, n2 + 2n + 1 is composite.

Proof. Let n = 4. Then, n2 + 2n + 1 = 42 + 2(4) + 1 = 25 and 25 is composite. 2

2.5 Proof by Contrapositive

Recall that the contrapositive of a conditional statement P (x) → Q(x) is the statement∼Q(x) → ∼P (x). In Section 1.14, we showed that a conditional statement P (x) → Q(x) islogically equivalent to its contrapositive ∼Q(x) → ∼P (x).

Page 40: Logic Proof Notes

36 CHAPTER 2. PROOF TECHNIQUES

Let P (x) and Q(x) be statements with domain D. A proof bycontrapositive of the statement

∀x ∈ D, P (x) → Q(x)

is a direct proof of its contrapositive

∀x ∈ D,∼Q(x) → ∼P (x);

that is, we assume that ∼Q(x) is true for some particular butarbitrary element x ∈ D, and then show that ∼P (x) is true forthis element x.

Result 2.8 Let n ∈ Z. If n2 + 5 is odd, then n is even.

Proof. Let P (n) be the statement “n2 + 5 is odd” and let Q(n) be the statement “n iseven”. Then we need to show that the universal statement

∀n ∈ Z, P (n) → Q(n)

is true. To do this, we use a proof by contrapositive. We give a direct proof to showthat ∼Q(n) → ∼P (n). Hence we assume that ∼Q(n) is true for some particular butarbitrary element n ∈ Z and show that ∼P (n) is true for this element n. Since ∼Q(n)is true, n is not even. Thus, n is odd, and so n = 2k + 1 for some integer k. Hence,n2 + 5 = (2k + 1)2 + 5 = 4k2 + 4k + 6 = 2(k2 + 2k + 3) = 2m, where m = k2 + 2k + 3.Since k ∈ Z, we must have m ∈ Z. Hence, n2 + 5 = 2m for some integer m, and so n2 + 5is even, i.e., n2 + 5 is not an odd integer. Thus, ∼P (n) is true. Therefore by the method ofdirect proof, we have proven that ∼Q(n) → ∼P (n) is true. Hence, P (n) → Q(n) is true.Therefore, ∀n ∈ Z, P (n) → Q(n). 2

We remark that the proof of Result 2.8 could be simplified if we do not introduce thestatements P (x) and Q(x).

Proof of Result 2.8. Assume that n is odd. Then, n = 2k + 1 for some integer k. Hence,n2 + 5 = (2k + 1)2 + 5 = 4k2 + 4k + 6 = 2(k2 + 2k + 3) = 2m, where m = k2 + 2k + 3. Sincek ∈ Z, we must have m ∈ Z. Hence, n2 + 5 = 2m for some integer m, and so n2 + 5 is aneven integer. 2

Result 2.9 Let n ∈ Z. If n2 is even, then n is even.

Proof. We use a proof by contrapositive. Assume that n is odd. Then, n = 2k + 1 forsome integer k. Hence, n2 = (2k + 1)2 = 4k2 + 4k + 1 = 2(k2 + 2k) + 1 = 2m + 1, wherem = k2 + 2k. Since k ∈ Z, we must have m ∈ Z. Hence, n2 = 2m + 1 for some integer m,and so n2 is an odd integer. 2

Page 41: Logic Proof Notes

2.6. PROOF BY CASES AND THE QUOTIENT-REMAINDER THEOREM 37

We remark that the statements of Results 2.8 and 2.9 begin with the sentence “Letn ∈ Z.” We call this the overriding assumption or hypothesis, and so n is assumed tobe an integer throughout the proofs of Results 2.8 and 2.9.

Exercises

2.9 Let n ∈ Z. Prove that if 5n + 3 is odd, then n is even.

2.10 Let x ∈ Z. Prove that if 11x− 3 is even, then x is odd.

2.11 Let n ∈ Z. Prove that if 5n + 3 is odd, then 7n + 4 is even.

2.12 Let n ∈ Z. Prove that if 7n + 4 is even, then 3n− 5 is odd.

2.6 Proof by Cases and the Quotient-Remainder Theorem

Let P (x) be a statement. If x possesses certain properties, andif we can verify that P (x) is true regardless of which of theseproperties x has, then P (x) is true. Such a proof is called a proofby cases.

Before we look at examples of a proof by cases, we state 1 the Quotient-RemainderTheorem which says that when any integer n is divided by any positive integer d, the resultis a quotient q and a nonnegative remainder r that is smaller than d.

Theorem 2.10 (Quotient-Remainder Theorem) For every given integer n and positive in-teger d, there exist unique integers q and r such that

n = d · q + r and 0 ≤ r < d.

Example 2.5 For each of the following values of n and d, find integers q and r such thatn = d · q + r and 0 ≤ r < d.

(a) n = 36, d = 7(b) n = −36, d = 7.(c) n = 36, d = 40.1A proof of the existence part of the Quotient-Remainder Theorem follows from the so-called well-ordering

principle for the integers, while a proof of the uniqueness part follows using the greatest common divisor oftwo integers. We omit the proof.

Page 42: Logic Proof Notes

38 CHAPTER 2. PROOF TECHNIQUES

Solution (a) 36 = 7 · 5 + 1 (here q = 5 and r = 1).(b) −36 = 7 · (−6) + 6 (here q = −6 and r = 6).(c) 36 = 40 · 0 + 36 (here q = 0 and r = 36).

Definition. Let n be a nonnegative integer and let d be a positive inte-ger. By the Quotient-Remainder Theorem, there exist unique integersq and r such that

n = d · q + r,

where 0 ≤ r < d. We define

ndiv d = q (read as ”n divided by q”), andnmod d = r (read as ”n modulo q”).

Thus ndiv d and nmod d are the integer quotient and integer remainder,respectively, obtained when n is divided by d.

Observe that given a nonnegative integer n and a positive integer d, we have thatnmod d ∈ {0, . . . , d − 1} (since 0 ≤ r ≤ d − 1) and that nmod d = 0 if and only if nis divisible by d.

Example 2.6 Compute 31 div 7 and 31mod 7.

Solution. Since 31 = 7 · 4 + 3, we have that 31 div 7 = 4 and 31 mod 7 = 3.

Using the Quotient-Remainder Theorem, we can show that every integer is either evenor odd.

Result 2.11 Every integer is either even or odd.

Proof. By the Quotient-Remainder Theorem with d = 2, there exist unique integers q andr such that n = 2 · q + r and 0 ≤ r < 2. Hence, r = 0 or r = 1. Therefore,

n = 2q or n = 2q + 1

for some integer q depending on whether r = 0 or r = 1, respectively. In the case thatn = 2q, the integer n is even. In the remaining case that n = 2q + 1, the integer n is odd.Hence, n is either even or odd. 2

By Result 2.11, every integer has the property that it is either even or odd. This obser-vation is useful when using a proof by cases as is illustrated by the proofs of the next threeresults.

Page 43: Logic Proof Notes

2.6. PROOF BY CASES AND THE QUOTIENT-REMAINDER THEOREM 39

Result 2.12 If n ∈ Z, then n2 + 5n + 3 is an odd integer.

Proof. We use a proof by cases, depending on whether n is even or odd.

Case 1. n is even. Then, n = 2k for some integer k. Thus, n2+5n+3 = (2k)2+5(2k)+3 =4k2 + 10k + 3 = 2(2k2 + 5k + 1) + 1 = 2m + 1, where m = 2k2 + 5k + 1. Since k ∈ Z, wemust have m ∈ Z. Hence, n2 + 5n + 3 = 2m + 1 for some integer m, and so the integern2 + 5n + 3 is odd.

Case 2. n is odd. Then, n = 2k + 1 for some integer k. Thus, n2 + 5n + 3 = (2k + 1)2 +5(2k + 1) + 3 = 4k2 + 14k + 9 = 2(2k2 + 7k + 4) + 1 = 2m + 1, where m = 2k2 + 7k + 4.Since k ∈ Z, we must have m ∈ Z. Hence, n2 + 5n + 3 = 2m + 1 for some integer m, andso the integer n2 + 5n + 3 is odd. 2

Result 2.13 Let m,n ∈ Z. If m and n are of the same parity, then m + n is even.

Proof. We use a proof by cases, depending on whether m and n are both even or bothodd.

Case 1. m and n are both even. Then, m = 2k and n = 2` for some integers k and `.Thus, m + n = 2k + 2` = 2(k + `). Since k + ` ∈ Z, the integer m + n is even.

Case 2. m and n are both odd. Then, m = 2k + 1 and n = 2` + 1 for some integers kand `. Thus, m + n = (2k + 1) + (2` + 1) = 2(k + ` + 1). Since k + ` + 1 ∈ Z, the integerm + n is even. 2

Result 2.14 Let n ∈ Z. If n2 is a multiple of 3, then n is a multiple of 3.

Proof. We shall combine two proof techniques and use both a proof by contrapositive anda proof by cases. Suppose that n is not a multiple of 3. (We wish to show then that n2 isnot a multiple of 3.) By the Quotient-Remainder Theorem with d = 3, there exist uniqueintegers q and r such that n = 3 · q + r and 0 ≤ r < 3. Hence, r ∈ {0, 1, 2}. Therefore,

n = 3q or n = 3q + 1 or n = 3q + 2

for some integer q depending on whether r = 0, 1 or 2, respectively. Since n is not a multipleof 3, either n = 3q + 1 or n = 3q + 2 for some integer q. We consider each case in turn.

Case 1. n = 3q+1 for some integer q. Then, n2 = (3q+1)2 = 9q2+6q+1 = 3(3q2+2q)+1,and so n2 is not a multiple of 3.

Case 2. n = 3q + 2 for some integer q. Then, n2 = (3q + 2)2 = 9q2 + 12q + 4 =3(3q2 + 4q + 1) + 1, and so n2 is not a multiple of 3. 2

Page 44: Logic Proof Notes

40 CHAPTER 2. PROOF TECHNIQUES

Result 2.15 Let n ∈ Z. If n is an odd integer, then n2 = 8m + 1 for some integer m.

Proof. We shall use both a direct proof and a proof by cases. Assume that n is an oddinteger. By the Quotient-Remainder Theorem with d = 4, there exist unique integers q andr such that n = 4 · q + r and 0 ≤ r < 4. Hence, r ∈ {0, 1, 2, 3}. Therefore,

n = 4q or n = 4q + 1 or n = 4q + 2 or n = 4q + 3

for some integer q depending on whether r = 0, 1, 2 or 3, respectively. Since n is odd, andsince 4q and 4q + 2 are both even, either n = 4q + 1 or n = 4q + 3 for some integer q. Weconsider each case in turn.

Case 1. n = 4q + 1 for some integer q. Then, n2 = (4q + 1)2 = 16q2 + 8q + 1 =8(2q2 + q) + 1 = 8m + 1, where m = 2q2 + q. Since q ∈ Z, we must have m ∈ Z. Hence,n2 = 8m + 1 for some integer m.

Case 2. n = 4q + 3 for some integer q. Then, n2 = (4q + 3)2 = 16q2 + 24q + 9 =(16q2 + 24q + 8) + 1 = 8(2q2 + 3q + 1) + 1 = 8m + 1, where m = 2q2 + 3q + 1. Since q ∈ Z,we must have m ∈ Z. Hence, n2 = 8m + 1 for some integer m. 2

We remark that Result 2.15 can be restated as follows:

For every odd integer n, we have n2 mod 8 = 1.

Exercises

2.13 For each of the following values of n and d, find integers q and r such that n = d ·q+rand 0 ≤ r < d.

(a) n = 38, d = 9(b) n = −38, d = 13.(c) n = −45, d = 11.

2.14 Compute 37 div 7 and 37 mod 7.

2.15 Prove that every two consecutive integers have opposite parity.

2.16 Prove that the product of two consecutive integers is an even integer.

2.17 Prove that the square of any integer has the form 3k or 3k + 1 for some integer k.

2.18 Prove that the square of any integer has the form 4k or 4k + 1 for some integer k.

2.19 Prove that every prime number greater than 3 has the form 6k + 1 or 6k + 5 for someinteger k.

Page 45: Logic Proof Notes

2.7. PROOF BY CONTRADICTION 41

2.7 Proof by Contradiction

In this section, we discuss another very important proof technique, called proof by contra-diction.

Proof by contradiction. Let P be a statement. If we assumethat ∼P is a true statement (or, equivalently, that P is false)and, from this assumption, we are able to deduce a contradic-tion, then we can conclude that the statement P is true.

Let P and C be statements, where C is a statement that is a contradiction (see Sec-tion 1.11). Hence, the truth value of C is false for any assignment of truth values to thestatement variables occurring in C. We wish to prove that P is a true statement. Supposewe can prove that ∼P → C is true. Then the truth table for implication (see Table 1.5)tells us that ∼P must be false (since C is false). This implies that P is true, as desired.This proof technique is called proof by contradiction.

Result 2.16 There is no greatest integer.

Proof. Assume, to the contrary, that there is a greatest integer, say N . Then, N ≥ n forevery integer n. Let m = N + 1. Now m is an integer since it is the sum of two integers.Also, m > N . Thus, m is an integer that is greater than the greatest integer, which is acontradiction. Hence our assumption that there is a greatest integer is false. Thus there isno greatest integer. 2

We proceed further by recalling the definition of a rational number.

Definition. A real number r is rational number if r = a/bfor some integers a and b with b 6= 0. A real number that is nota rational number is called an irrational number.

Result 2.17 There is no smallest positive rational number.

Proof. Assume, to the contrary, that there is a least positive rational number x. Then,x ≤ y for every positive rational number y. Consider the number x/2. Since x is a positiverational number, so too is x/2. Multiplying both sides of the inequality 1/2 < 1 by x,which is positive, gives x/2 < x. Hence, x/2 is a positive rational number that is less thanx, which is a contradiction. Hence our assumption that there is a least positive rationalnumber is false. Thus there is no least positive rational number. 2

Page 46: Logic Proof Notes

42 CHAPTER 2. PROOF TECHNIQUES

Result 2.18 The sum of a rational number and an irrational number is irrational.

Proof. Assume, to the contrary, that there exists a rational number r and an irrationalnumber s whose sum is a rational number. Thus, by definition of rational numbers, r = a/band r + s = c/d for some integers a, b, c and d with b 6= 0 and d 6= 0. Hence,

s =c

d− r =

c

d− a

b=

bc− ad

bd.

Now, bc − ad ∈ Z and bd ∈ Z since a, b, c, d ∈ Z. Since b 6= 0 and d 6= 0, bd 6= 0. Hence,s ∈ Q, which is a contradiction. Hence our assumption that there exists a rational numberand an irrational number whose sum is a rational number is false. Thus, the sum of arational number and an irrational number is irrational. 2

To prove an implication P → Q is true using a proof by contradiction, we assume that∼(P → Q) is true and then deduce a contradiction. In Example 1.18, we saw that∼(P → Q)is logically equivalent to P ∧ ∼Q. Thus to prove that P → Q is true by contradiction, weassume that P is true and Q is false, and then deduce a contradiction.

Proof by contradiction. Let P and Q be statements. If weassume that P is true and Q is false and, from this assumption,we are able to deduce a contradiction, then we can concludethat the statement P → Q is true.

Recall that earlier we proved Result 2.9 using a proof by contrapositive. We could havealso used a proof by contradiction. Note that in Result 2.9, we take P to be the statement“n2 is even” and Q to be the statement “n is odd.”

Result 2.9 Let n ∈ Z. If n2 is even, then n is even.

Alternative proof of Result 2.9. We use a proof by contradiction. Assume that n2

is even and n is odd. Then, n = 2k + 1 for some integer k. Hence, n2 = (2k + 1)2 =4k2 + 4k + 1 = 2(k2 + 2k) + 1 = 2m + 1, where m = k2 + 2k. Since k ∈ Z, we must havem ∈ Z. Hence, n2 = 2m+1 for some integer m, and so n2 is an odd integer, a contradiction.We deduce, therefore, that if n2 is even, then n is even. 2

We prove next a classical result that√

2 is irrational.

Result 2.19 The real number√

2 is irrational.

Proof. Assume, to the contrary, that√

2 is rational. Then,√

2 =m

n

Page 47: Logic Proof Notes

2.7. PROOF BY CONTRADICTION 43

where m,n ∈ Z and n 6= 0. By dividing m and n by any common factors, if necessary, wemay further assume that m and n have no common factors, i.e., m/n has been expressedin (or reduced to) lowest terms. Then, 2 = m2/n2, and so

m2 = 2n2.

Thus, m2 is even. Hence by Result 2.9, m is even, and so m = 2k, where k ∈ Z. Substitutingthis into our earlier equation m2 = 2n2, we have (2k)2 = 2n2, and so 4k2 = 2n2. Therefore,

n2 = 2k2.

Thus, n2 is even, and so n is even by Result 2.9. Therefore each of m and n has 2 as afactor, which contradicts our assumption that m/n has been reduced to lowest terms andtherefore that m and n have no common factors. We deduce, therefore, that our assumptionthat

√2 is rational is incorrect. Hence,

√2 is irrational. 2

Exercises

2.20 Prove that there is no greatest negative real number.

2.21 Prove that the real number√

3 is irrational.

2.22 Prove that the product of an irrational number and a nonzero rational number isirrational.

2.23 Prove that 1 + 5√

2 is irrational.

2.24 Prove that√

2 +√

3 is irrational.

2.25 The Three Cheating Students Problem: Three students were caught cheatingin a first year mathematics quiz and sentenced to a relatively light sentence (given theseriousness of the crime) of 20 years in prison with hard labour. But due to overcrowd-ing, one of these three students must be pardoned. A distinguished Persian professorof mathematics devises a scheme to determine which student is to be pardoned. Hetells the three students that he will blindfold them and then paint a red dot or a bluedot on each forehead. After he paints the dots, he will remove the blindfolds, and astudent should raise his hand if he sees a red dot on one of the other two students. Thefirst student to identify the colour of the dot on his own forehead will be pardoned andmay resume his mathematical studies. An incorrect answer would triple his sentence.The professor blindfolds the students, as promised, and then paints a red dot on theforeheads of all three students. He removes the blindfolds and, since each student seesa red dot (in fact two red dots), each student raises his hand. After a considerabletime has passed, one student exclaims, ”I know what colour my dot is! It’s red!” Thestudent is then pardoned and allowed re-entry into first year mathematics. How didthis student correctly identify the colour of the dot painted on his forehead?

Page 48: Logic Proof Notes

44 CHAPTER 2. PROOF TECHNIQUES

2.8 Existence Proofs

Recall that (see Section 1.17) an existential statement is a statement of the form ∃x ∈D such that P (x). It is true if P (x) is true for at least one x ∈ D; otherwise, it is false.Hence to prove this statement, we need only display or find an element x ∈ D that makesP (x) true. Such a proof is called an existence proof.

Example 2.7 Prove the following statements.(a) There are distinct positive integers such that

√a + b =

√a +

√b− 2.

(b) There exists an even integer that can be written as a sum of two prime numbers.(c) There exist positive integers a, b and c such that a2 = b2 + c2.

Solution(a) Take a = 9 and b = 16. Then,

√a + b =

√25 = 5, while

√a+

√b−2 =

√9+

√16−2 = 5.

(b) Take n = 4. Then, n = 2 + 2.(c) Take a = 5, b = 3 and c = 4. Then, a2 = 25 = b2 + c2.

Result 2.20 There exist irrational numbers a and b such that ab is rational.

Proof. Consider the real number√

2√

2. This number is either rational or irrational. We

consider each case in turn.

Case 1.√

2√

2is rational. Let a =

√2 and b =

√2. By Result 2.19, a and b are irrational.

By assumption, ab is rational.

Case 2.√

2√

2is irrational. Let a =

√2√

2and let b =

√2. By assumption, a is irrational,

while by Result 2.19, b is irrational. Moreover,

ab =(√

2√

2)√2

=√

2(√

2·√2)=√

22

= 2,

which is rational.

In both cases, we proved the existence of irrational numbers a and b such that ab isrational, and so we have the desired result. 2

We remark that it has been proven that√

2√

2is rational. Of course, the proof of Re-

sult 2.20 presented above is a perfectly valid proof irrespective of the fact that√

2√

2is

rational.

We close this section with perhaps one of the most famous mathematical assertions. InExample 2.7(c), we showed that if n = 2, then there exist positive integers a, b and c suchthat an = bn + cn. Pierre de Fermat (1601–1665), a famous mathematician, claimed thefollowing assertion:

Theorem 2.21 (Fermat’s Last Theorem) For each integer n ≥ 3, there are no positiveintegers a, b and c such that an = bn + cn.

Page 49: Logic Proof Notes

2.9. DISPROOF BY COUNTEREXAMPLE 45

The above result became known as Fermat’s Last Theorem. Fermat’s assertion wasdiscovered, unproved, in a margin of a book, along with the comment “I have discovereda truly remarkable proof of this theorem which this margin is too small to contain.” Itwas only some 350 years later (in 1993) that a proof to his assertion was finally found bythe British mathematician Andrew Wiles. His proof used very sophisticated mathematicaltechniques that had eluded the greatest mathematical minds of the last few centuries.

Exercises

2.26 Prove that there exists an integer whose cube equals its square.

2.27 Prove that there exists real numbers x and y such that (x + y)2 = x2 + y2.

2.28 Prove that there exists a real number x such that x3 < x < x2.

2.9 Disproof by Counterexample

Some statements may very well be false. To disprove a statement, we use a disproof bycounterexample.

Let P (x) be a statement with domain D. A disproof bycounterexample of the statement

∀x ∈ D, P (x)

is to find an element x ∈ D such that P (x) is false. Such anelement x is called a counterexample of the statement.

If the statement ∀x ∈ D, P (x) is not true, then its negation ∼(∀x ∈ D, P (x)) is true.By Fact 1.2, ∼(∀x ∈ D, P (x)) ≡ ∃x ∈ D such that ∼P (x). Hence we wish to show that∃x ∈ D such that ∼P (x) is true. That is, we wish to show that ∼P (x) is true for someelement x ∈ D. Such a disproof is called a disproof by counterexample.

Example 2.8 Find counterexamples to the following statements.(a) The product of any two irrational numbers is irrational.(b) If a and b are rational numbers, then ab is rational.(c) The sum of any two positive irrational numbers is irrational.

Solution(a) Let a = b =

√2. By Result 2.19, a and b are irrational, but ab = 2 which is rational.

Page 50: Logic Proof Notes

46 CHAPTER 2. PROOF TECHNIQUES

(b) Let a = 2 and b = 1/2. Then, a, b ∈ Q, but ab = 21/2 =√

2, which is irrational.(c) Let a =

√2 and let b = 2−√2. Then both a and b are positive and both are irrational

(by Result 2.18 and Exercise 2.22). However, a + b =√

2 + (2−√2) = 2, which is rational.

Exercises

2.29 Find a counterexample to the statement that the difference of any two irrationalnumbers is irrational.

2.30 Find a counterexample to the statement that for every rational number r and everyirrational number s, we have that r/s is irrational.

2.10 Proof by Mathematical Induction

In this section we discuss a very powerful proof technique called mathematical induction.Before doing so, we introduce a mathematical structure called a sequence. A sequence isinformally a set of elements written in a row. In a sequence

am, am+1, am+2, . . . , ak, . . . , an,

where m and n are integers with m ≤ n, each individual element ak (read “a sub k”) iscalled a term. The term ak is called the kth term. The k in ak is called a subscript orindex. The term am is called the initial term. The notation

am, am+1, am+2, . . .

denotes an infinite sequence. Consider the sequence am, am+1, am+2, . . . , ak, . . . , an. It isconvenient to write the sum of these terms using so-called summation notation definedby

n∑

k=m

ak = am + am+1 + am+2 + · · ·+ an

(read as the “summation from k equals m to n of ak”). We use the capital Greek lettersigma,

∑, to denote the word sum (or summation). We call k the index of the summation,

m the lower limit of the summation, and n the upper limit of the summation. We remarkthat the index of summation is called a dummy variable of summation since it can bereplaced by any other symbol as long as the replacement is made in every location wherethe symbol occurs. For example,

n∑

k=m

ak =n∑

i=m

ai =n∑

j=m

aj = am + am+1 + am+2 + · · ·+ an.

Page 51: Logic Proof Notes

2.10. PROOF BY MATHEMATICAL INDUCTION 47

Example 2.9 If a1 = 3, a2 = −5, a3 = 1 and a4 = 2, then compute the following sums:

(a)4∑

k=1

ak; (b)3∑

k=2

ak.

Solution

(a)4∑

k=1

ak = a1 + a2 + a3 + a4 = 3 + (−5) + 1 + 2 = 1;

(b)3∑

k=2

ak = a2 + a3 = (−5) + 1 = −4.

We now return to discuss the proof technique called mathematical induction.

Theorem 2.22 (The Principle of Mathematical Induction)Let n0 ∈ Z and let P (n) be a statement that is defined for integers nsuch that

(1) P (n0) is true; and

(2) if P (k) is true, where k ∈ Z and k ≥ n0, then P (k + 1) is true.

Then the statement P (n) is true for all integers n ≥ n0.

Thus to show that the statement P (n) is true for every n ≥ n0, we need not show thateach of the statements P (n0), P (n0 + 1), P (n0 + 2), . . . is true individually. We need onlyshow that two statements are true, namely (1) P (n0) and (2) the implication: If P (k) istrue for an arbitrary integer k with k ≥ n0, then P (k+1) is true. This is a two-step process.To prove that P (n0) is true (Step 1) is called the basis step or base case. To prove thatthe implication “if P (k) is true, then P (k + 1) is true” (Step 2) is called the inductivestep. For this purpose, we often use a direct proof and assume that P (k) is true (for anarbitrary integer k with k ≥ n0). This assumption is called the inductive hypothesis orthe induction hypothesis.

To summarize, a proof of a mathematical statement by the principle of mathematicalinduction involves the following steps.

1. Basis step or Base Case: Prove that P (n0) is true.2. Inductive hypothesis: Let k be an arbitrary (but fixed) integer

such that k ≥ n0, and assume that P (k) is true.3. Inductive step: Prove that P (k + 1) is true.

Page 52: Logic Proof Notes

48 CHAPTER 2. PROOF TECHNIQUES

In this introductory course on proof technique, we omit the proof of Theorem 2.22 whichfollows from the so-called Well-Ordering Principle. Rather we will focus our attention onapplications of this powerful theorem, called the principle of mathematical induction.

To visualize the idea of mathematical induction, imagine a ladder that reaches to theheavens constructed in such a way that if we are sitting at any particular but fixed rungof the ladder, then we can always climb one rung higher. The principle of mathematicalinduction then tells us that if we can climb onto the ladder, we can climb as high as we likeon the ladder! To see the connection between this image and the principle of mathematicalinduction, let P (n) denote the statement “We can climb to the nth rung of the ladder”. Itis given that we can climb onto the ladder, i.e., P (1) is true (here “n0 = 1”). This is thebase step. We are also given that for each k ≥ 1, if P (k) is true (i.e., we can climb to thekth rung of the ladder), then P (k + 1) is true (i.e., we can climb to the (k + 1)st rung ofthe ladder). Thus by the principle of mathematical induction, P (n) (i.e., we can climb tothe nth rung of the ladder) is true for every integer n ≥ 1.

We now illustrate the principle of mathematical induction with a few examples.

Result 2.23 For every positive integer n,

1 + 2 + · · ·+ n =n(n + 1)

2.

Proof. We proceed by mathematical induction. For every integer n ≥ 1, let P (n) be thestatement

P (n) : 1 + 2 + · · ·+ n =n(n + 1)

2.

When n = 1, the statement

P (1) : 1 =1(1 + 1)

2

is certainly true since 1(1 + 1)/2 = 2/2 = 1. This establishes the base case when n = 1(here “n0 = 1”). For the inductive hypothesis, let k be an arbitrary (but fixed) integer suchthat k ≥ 1 and assume that P (k) is true; that is, assume that

1 + · · ·+ k =k(k + 1)

2.

For the inductive step, we show that P (k + 1) is true. That is, we show that

1 + 2 + · · ·+ (k + 1) =(k + 1)(k + 2)

2. (2.1)

Page 53: Logic Proof Notes

2.10. PROOF BY MATHEMATICAL INDUCTION 49

Evaluating the left-hand side of this equation, we have

1 + 2 + · · ·+ (k + 1) = (1 + 2 + · · ·+ k) + (k + 1)

=k(k + 1)

2+ (k + 1) (by the inductive hypothesis)

=k(k + 1)

2+

2(k + 1)2

=(k + 1)(k + 2)

2,

thus verifying Equation (2.1); that is, P (k + 1) is true. Hence, by the principle of mathe-matical induction, P (n) is true for all integers n ≥ 1; that is,

1 + 2 + · · ·+ n =n(n + 1)

2

is true for every positive integer n. 2

We remark that in the inductive hypothesis of our proof of Result 2.23, we assume thatP (k) is true for an arbitrary, but fixed, positive integer k. We certainly do not assume thatP (k) is true for all positive integers k, for this is precisely what we wish to prove! It isimportant to understand that our aim is to establish the truth of the implication “If P (k) istrue, then P (k + 1) is true.” which together with the truth of the statement P (1) allows usto conclude that an infinite number of statements (namely, P (1), P (2), P (3), . . .) are true.

Result 2.24 For every positive integer n,

12 + 22 + · · ·+ n2 =n(n + 1)(2n + 1)

6.

Proof. We proceed by mathematical induction. For every integer n ≥ 1, let P (n) be thestatement

P (n) : 12 + 22 + · · ·+ n2 =n(n + 1)(2n + 1)

6.

When n = 1, the statement

P (1) : 1 =1(1 + 1)(2 · 1 + 1)

6

is true since 1(1 + 1)(2 · 1 + 1)/6 = (1 · 2 · 3)/6 = 6/6 = 1. This establishes the base casewhen n = 1. For the inductive hypothesis, let k be an arbitrary (but fixed) integer suchthat k ≥ 1 and assume that P (k) is true; that is, assume that

12 + 22 + · · ·+ k2 =k(k + 1)(2k + 1)

6.

Page 54: Logic Proof Notes

50 CHAPTER 2. PROOF TECHNIQUES

For the inductive step, we show that P (k + 1) is true. That is, we show that

12 + 22 + · · ·+ (k + 1)2 =(k + 1)(k + 2)(2k + 3)

6. (2.2)

Evaluating the left-hand side of this equation, we have

12 + 22 + · · ·+ (k + 1)2 = (12 + 22 + · · ·+ k2) + (k + 1)2

=k(k + 1)(2k + 1)

6+ (k + 1)2 (by the inductive hypothesis)

=k(k + 1)(2k + 1)

6+

6(k + 1)2

6

=(k + 1)[k(2k + 1) + 6(k + 1)]

6

=(k + 1)(2k2 + 7k + 6)

6

=(k + 1)(k + 2)(2k + 3)

6

thus verifying Equation (2.2); that is, P (k + 1) is true. Hence, by the principle of mathe-matical induction, P (n) is true for all integers n ≥ 1; that is,

12 + 22 + · · ·+ n2 =n(n + 1)(2n + 1)

6

is true for every positive integer n. 2

Recall that in a geometric sequence, each term is obtained from the preceding one bymultiplying by a constant factor. If the first term is 1 and the constant factor is r, thenthe sequence is 1, r, r2, r3, . . . , rn, . . .. The sum of the first n terms of this sequence is givenby a simple formula which we shall verify using mathematical induction. We comment thatalthough in the proof of Results 2.23 and 2.24 we defined statements P (n) so that we couldapply Theorem 2.22 it is not actually necessary to do this, even though it is often useful.We illustrate this remark in our next few examples.

Theorem 2.25 (Sum of a Geometric Sequence) For all integers n ≥ 0 and all real numbersr with r 6= 1,

n∑

i=0

ri =rn+1 − 1

r − 1.

Proof. We proceed by mathematical induction. To show that the formula holds for n = 0,we must show that

0∑

i=0

ri =r0+1 − 1

r − 1.

Page 55: Logic Proof Notes

2.10. PROOF BY MATHEMATICAL INDUCTION 51

The left-hand side of this equation is

0∑

i=0

ri = r0 = 1,

while the right-hand side isr0+1 − 1

r − 1=

r − 1r − 1

= 1,

since r 6= 1. Hence the formula holds for n = 0. This establishes the base case when n = 1.For the inductive hypothesis, let k be an arbitrary (but fixed) integer such that k ≥ 0 andassume that

k∑

i=0

ri =rk+1 − 1

r − 1.

For the inductive step, we show that

k+1∑

i=0

ri =rk+2 − 1

r − 1. (2.3)

Evaluating the left-hand side of this equation, we have

k+1∑

i=0

ri =

(k∑

i=0

ri

)+ rk+1 (writing the (k + 1)st term separately)

=rk+1 − 1

r − 1+ rk+1 (by the inductive hypothesis)

=rk+1 − 1

r − 1+

(r − 1)rk+1

r − 1

=rk+1 − 1 + (r − 1)rk+1

r − 1

=rk+2 − 1

r − 1,

thus verifying Equation (2.3). Hence, by the principle of mathematical induction, theformula is true for all integer n ≥ 0. 2

Induction can also be used to solve problems involving divisibility, as the next two exam-ples illustrates.

Page 56: Logic Proof Notes

52 CHAPTER 2. PROOF TECHNIQUES

Result 2.26 For all integers n ≥ 1, 22n − 1 is divisible by 3.

Proof. We proceed by mathematical induction. When n = 1, the result is true since inthis case 22n − 1 = 22 − 1 = 3 and 3 is divisible by 3. Hence, the base case when n = 1 istrue. For the inductive hypothesis, let k be an arbitrary (but fixed) integer such that k ≥ 1and assume that the property holds for n = k, i.e., suppose that 22k − 1 is divisible by 3.For the inductive step, we must show that the property holds for n = k + 1. That is, wemust show that 22(k+1) − 1 is divisible by 3. Since 22k − 1 is divisible by 3, there exists, bydefinition of divisibility, an integer m such that 22k − 1 = 3m, and so 22k = 3m + 1. Now,

22(k+1) − 1 = 22k22 − 1

= 4 · 22k − 1

= 4(3m + 1)− 1

= 12m + 3

= 3(4m + 1).

Since m ∈ Z, we know that 4m + 1 ∈ Z. Hence, 22(k+1) − 1 is an integer multiple of 3;that is, 22(k+1) − 1 is divisible by 3, as desired. Hence, by the principle of mathematicalinduction, the property holds for all integers n ≥ 1. 2

Result 2.27 For all integers n ≥ 2, n3 − n is divisible by 6.

Proof. We proceed by mathematical induction. When n = 2, the result is true since in thiscase n3 − n = 23 − 2 = 8− 2 = 6 and 6 is divisible by 6. Hence, the base case when n = 2is true. For the inductive hypothesis, let k be an arbitrary (but fixed) integer such thatk ≥ 2 and assume that the property holds for n = k, i.e., suppose that k3 − k is divisibleby 6. For the inductive step, we must show that the property holds for n = k + 1. That is,we must show that (k + 1)3 − (k + 1) is divisible by 6. Since k3 − k is divisible by 6, thereexists, by definition of divisibility, an integer r such that k3 − k = 6r. Now, by the laws ofalgebra and the inductive hypothesis, it follows that

(k + 1)3 − (k + 1) = (k3 + 3k2 + 3k + 1)− (k + 1)

= (k3 − k) + 3(k2 + k)

= 6r + 3k(k + 1).

Now, k(k + 1) is a product of two consecutive integers, and is therefore even (see Exer-cise 2.16). Hence, k(k + 1) = 2s for some integer s. Thus, 6r + 3k(k + 1) = 6r + 3(2s) =6(r + s), and so, by substitution,

(k + 1)3 − (k + 1) = 6(r + s),

Page 57: Logic Proof Notes

2.10. PROOF BY MATHEMATICAL INDUCTION 53

which is divisible by 6. Therefore, (k + 1)3− (k + 1) is divisible by 6, as desired. Hence, bythe principle of mathematical induction, the property holds for all integers n ≥ 2. 2

Induction can also be used to verify certain inequalities, as the next two examples illus-trates.

Result 2.28 For all integers n ≥ 3, 2n > 2n + 1.

Proof. We proceed by mathematical induction. When n = 3, the inequality holds since inthis case 2n = 23 = 8 and 2n + 1 = 2 · 3 + 1 = 7, and 8 > 7. Hence, the base case whenn = 3 is true. For the inductive hypothesis, let k be an arbitrary (but fixed) integer suchthat k ≥ 3 and assume that the inequality holds for n = k, i.e., suppose that 2k > 2k + 1.For the inductive step, we must show that the inequality holds for n = k + 1. That is, wemust show that 2k+1 > 2(k + 1) + 1. Now,

2k+1 = 2 · 2k

> 2 · (2k + 1) (by the inductive hypothesis)

= 2(k + 1) + 2k

> 2(k + 1) + 1 (since k ≥ 3),

as desired. Hence, by the principle of mathematical induction, the inequality holds for allintegers n ≥ 3. 2

Result 2.29 For all integers n ≥ 2,

√n <

1√1

+1√2

+ · · ·+ 1√n

.

Proof. We proceed by mathematical induction. To show the inequality holds for n = 2 wemust show that

√2 < 1√

1+ 1√

2. But this inequality is true if and only if 2 <

√2 + 1. And

this is true if and only if 1 <√

2. Since 1 <√

2 is true, so too is√

2 < 1√1

+ 1√2. Hence the

inequality holds for n = 2. This establishes the base case. For the inductive hypothesis, letk be an arbitrary (but fixed) integer such that k ≥ 2 and assume that the inequality holdsfor n = k, i.e., suppose that

√k <

1√1

+1√2

+ · · ·+ 1√k.

For the inductive step, we must show that the inequality holds for n = k + 1. That is, wemust show that

√k + 1 <

1√1

+1√2

+ · · ·+ 1√k

+1√

k + 1.

Page 58: Logic Proof Notes

54 CHAPTER 2. PROOF TECHNIQUES

Since k ≥ 2,√

k <√

k + 1, and so (multiplying both sides by√

k),

k <√

k√

k + 1.

Hence (adding 1 to both sides),

k + 1 <√

k√

k + 1 + 1,

and so (dividing both sides by√

k + 1) we have

√k + 1 <

√k +

1√k + 1

.

Hence, by the inductive hypothesis,

√k + 1 <

(1√1

+1√2

+ · · ·+ 1√k

)+

1√k + 1

,

as desired. Hence, by the principle of mathematical induction, the inequality holds for allintegers n ≥ 2. 2

Exercises

2.31 Prove that for all integers n ≥ 1, 13 + 23 + · · ·+ n3 =(

n(n + 1)2

)2

.

2.32 Prove that for all integers n ≥ 1, 1 · 2 + 2 · 3 + · · ·+ n(n + 1) =n(n + 1)(n + 2)

3.

2.33 Prove that for all integers n ≥ 1,1

1 · 2 +1

2 · 3 + · · ·+ 1n(n + 1)

=n

n + 1.

2.34 Prove that for all integers n ≥ 0, 5n + 3 is divisible by 4.

2.35 Prove that for all integers n ≥ 0, 43n − 1 is divisible by 9.

2.36 Prove that for all integers n ≥ 0, n3 − 7n + 3 is divisible by 3.

2.37 Prove that for all integers n ≥ 5, 2n > n2.

2.38 Prove that for all integers n ≥ 2, n3 > 2n + 1.

Page 59: Logic Proof Notes

Bibliography

[1] Chartrand G., A. D. Polimeni and P. Zang, A Transition to Advanced Mathematics.Addison-Wesley, New York (2002).

[2] Epp S. S., Discrete Mathematics with Applications (Third Edition). ThomsonBrooks/Cole (2004).

[3] Johnsonbaugh R., Discrete Mathematics (Fourth Edition). Prentice Hall, Inc., NewJersey (1997).

[4] Malik D. S. and M. K. Sen, Discrete Mathematical Structures: Theory and ApplicationsThomson Course Technology (2004).

55