Basic Logic and Proof Techniques

Similar documents
Some Review Problems for Exam 1: Solutions

Introducing Proof 1. hsn.uk.net. Contents

Logic. Def. A Proposition is a statement that is either true or false.

Conjunction: p q is true if both p, q are true, and false if at least one of p, q is false. The truth table for conjunction is as follows.

1. Propositions: Contrapositives and Converses

Before you get started, make sure you ve read Chapter 1, which sets the tone for the work we will begin doing here.

3 The language of proof

The Process of Mathematical Proof

Foundations of Discrete Mathematics

Section 1.3. Let I be a set. When I is used in the following context,

Chapter 2: The Logic of Quantified Statements

Logical Operators. Conjunction Disjunction Negation Exclusive Or Implication Biconditional

Section 2.3: Statements Containing Multiple Quantifiers

THE LOGIC OF QUANTIFIED STATEMENTS. Predicates and Quantified Statements I. Predicates and Quantified Statements I CHAPTER 3 SECTION 3.

Logic and Propositional Calculus

MA103 STATEMENTS, PROOF, LOGIC

Note: The area of logic that deals with propositions is called the propositional calculus or propositional logic.

Foundation of proofs. Jim Hefferon.

Math 38: Graph Theory Spring 2004 Dartmouth College. On Writing Proofs. 1 Introduction. 2 Finding A Solution

Writing Mathematical Proofs

Math Real Analysis

2/2/2018. CS 103 Discrete Structures. Chapter 1. Propositional Logic. Chapter 1.1. Propositional Logic

LECTURE 1. Logic and Proofs

Chapter 2: The Logic of Quantified Statements. January 22, 2010

Section 3.1: Direct Proof and Counterexample 1

Your quiz in recitation on Tuesday will cover 3.1: Arguments and inference. Your also have an online quiz, covering 3.1, due by 11:59 p.m., Tuesday.

Lecture 2. Logic Compound Statements Conditional Statements Valid & Invalid Arguments Digital Logic Circuits. Reading (Epp s textbook)

Today s Topic: Propositional Logic

The following techniques for methods of proofs are discussed in our text: - Vacuous proof - Trivial proof

1.1 Language and Logic

COT 2104 Homework Assignment 1 (Answers)

More examples of mathematical. Lecture 4 ICOM 4075

STRATEGIES OF PROBLEM SOLVING

MATH10040: Chapter 0 Mathematics, Logic and Reasoning

Discrete Mathematics & Mathematical Reasoning Predicates, Quantifiers and Proof Techniques

Section 2.1: Introduction to the Logic of Quantified Statements

Recall that the expression x > 3 is not a proposition. Why?

Chapter 1, Part I: Propositional Logic. With Question/Answer Animations

3/29/2017. Logic. Propositions and logical operations. Main concepts: propositions truth values propositional variables logical operations

1.1 Statements and Compound Statements

1.1 Language and Logic

Topics in Logic and Proofs

Mat 243 Exam 1 Review

2-4: The Use of Quantifiers

Section 1.1: Logical Form and Logical Equivalence

Sets and Logic Linear Algebra, Spring 2012

The statement calculus and logic

Writing proofs for MATH 61CM, 61DM Week 1: basic logic, proof by contradiction, proof by induction

Packet #2: Set Theory & Predicate Calculus. Applied Discrete Mathematics

MCS-236: Graph Theory Handout #A4 San Skulrattanakulchai Gustavus Adolphus College Sep 15, Methods of Proof

Mathematical Reasoning (Part I) 1

First order Logic ( Predicate Logic) and Methods of Proof

MATH 135 Fall 2006 Proofs, Part IV

Proofs. Chapter 2 P P Q Q

Meaning of Proof Methods of Proof

Connectives Name Symbol OR Disjunction And Conjunction If then Implication/ conditional If and only if Bi-implication / biconditional

Logic Overview, I. and T T T T F F F T F F F F

Proofs. Joe Patten August 10, 2018

Discrete Structures for Computer Science

Contribution of Problems

Quantifiers. P. Danziger

3.6. Disproving Quantified Statements Disproving Existential Statements

Steinhardt School of Culture, Education, and Human Development Department of Teaching and Learning. Mathematical Proof and Proving (MPP)

WUCT121. Discrete Mathematics. Logic. Tutorial Exercises

For all For every For each For any There exists at least one There exists There is Some

2 Truth Tables, Equivalences and the Contrapositive

CSC Discrete Math I, Spring Propositional Logic

Proofs. Chapter 2 P P Q Q

Logic and Proofs. (A brief summary)

ECOM Discrete Mathematics

Definitions Chapter 1 Proof Technique (Pg.1): Proof (Pg.2): Statement (Pg.2): Conditional Statement/Implication (Pg3.): Hypothesis(Pg.

Section Summary. Section 1.5 9/9/2014

5. Use a truth table to determine whether the two statements are equivalent. Let t be a tautology and c be a contradiction.

Chapter 2. Mathematical Reasoning. 2.1 Mathematical Models

Sequences of Real Numbers

2/18/14. What is logic? Proposi0onal Logic. Logic? Propositional Logic, Truth Tables, and Predicate Logic (Rosen, Sections 1.1, 1.2, 1.

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes

Chapter 1 Elementary Logic

Math 10850, fall 2017, University of Notre Dame

Elementary Linear Algebra, Second Edition, by Spence, Insel, and Friedberg. ISBN Pearson Education, Inc., Upper Saddle River, NJ.

Logic, Sets, and Proofs

Day 6. Tuesday May 29, We continue our look at basic proofs. We will do a few examples of different methods of proving.

1 The Foundation: Logic and Proofs

Logic and Propositional Calculus

Discrete Structures for Computer Science

CS100: DISCRETE STRUCTURES. Lecture 5: Logic (Ch1)

Compound Propositions

Chapter Summary. Propositional Logic. Predicate Logic. Proofs. The Language of Propositions (1.1) Applications (1.2) Logical Equivalences (1.

Counting Methods. CSE 191, Class Note 05: Counting Methods Computer Sci & Eng Dept SUNY Buffalo

2 Arithmetic. 2.1 Greatest common divisors. This chapter is about properties of the integers Z = {..., 2, 1, 0, 1, 2,...}.

Exercise Set 1 Solutions Math 2020 Due: January 30, Find the truth tables of each of the following compound statements.

Mathematical Reasoning & Proofs

1 Predicates and Quantifiers

FORMAL PROOFS DONU ARAPURA

Foundations of Advanced Mathematics, version 0.8. Jonathan J. White

Proof Techniques (Review of Math 271)

THE LOGIC OF QUANTIFIED STATEMENTS

Contradiction MATH Contradiction. Benjamin V.C. Collins, James A. Swenson MATH 2730

What is Logic? Introduction to Logic. Simple Statements. Which one is statement?

1 The Foundation: Logic and Proofs

Transcription:

Chapter 3 Basic Logic and Proof Techniques Now that we have introduced a number of mathematical objects to study and have a few proof techniques at our disposal, we pause to look a little more closely at basic logic. 3.1 Logical Statements and Truth Tables 3.1.1 Statements and their negations Outside of mathematics, we use the word statement as a synonym for declarative sentence. Thus in ordinary English, Today is Tuesday Mozart is the greatest composer are both statements. In logic and mathematics, a statement must have a truth value. Thus Today is Tuesday is a valid logical statement because it is either true or false, but Mozart is the greatest composer can not be assigned a truth value - it is an opinion. For a given statement p, we define its negation to be the statement with the opposite truth value. We denote the negation of p by p. Forming the negation of a simple statement is often very easy. For example, for the statement the negation is p: Today is Tuesday, p: Today is not Tuesday. As another example, let n N and consider q: n 3 > 0. 1

2 CHAPTER 3. BASIC LOGIC AND PROOF TECHNIQUES Its negation is q: n 3 0. 3.1.2 Combining statements Given statements p and q, we can combine them to form the new statements p q (p and q) and p q (p or q). The former is true only if both p is true and q is true. The latter is true if p is true, if q is true, or if both are true. Because such verbal descriptions can be cumbersome and confusing, we often use a truth table instead. Let s look first at the truth table for p q. The first two columns give all possible combinations of truth values for p and q. The final column for p q indicates the truth value of p q given the truth values for p and q in that row. p q p q T T T T F F F T F F F F Next, we show the truth table for p q. p q p q T T T T F T F T T F F F Remark 1. In English, the word or can be used in two different ways - as an exclusive or or as an inclusive or. To understand the difference, consider the following statements: All dinners are served with soup or salad. Everyone in this class has taken either Linear Algebra or Calculus III. You probably understand the first sentence to mean that you may have soup with your dinner or you may have salad with your dinner, but you may not have both. On the other hand, you would not consider the second sentence to be false if there were a student who has taken both courses. Whether the or in an English sentence is to be interpreted as an exclusive or inclusive or depends on the context, and this can be a source of confusion. To avoid this confusion in mathematics we agree that we will use the inclusive or. Example 3.1.1. We make a truth table for the statement p q. The truth table only needs to have three columns - one for p, one for q, and one showing how the truth value of p q depends on the truth value of p and q. We find it useful, however, to include an intermediate column for q.

3.1. LOGICAL STATEMENTS AND TRUTH TABLES 3 p q q p q T T F F T F T T F T F F F F T F Exercise 3.1.1. Make a truth table for each statement: (a) (p q) (b) (p q) (c) p q (d) p q. Look at the final columns. What do you observe? 3.1.3 Implications Next we discuss one of the most important logical relations between two statements, namely the implication p q, read p implies q or if p, then q. For example, for the statements the statement p q is p: Today is Monday q: The cafeteria is serving pizza for lunch, If today is Monday, then the cafeteria is serving pizza for lunch. The truth table for p q follows. p q p q T T T T F F F T T F F T In the implication p q, we call p the hypothesis and q the conclusion. Note that p q is only false when the hypothesis p is true but the conclusion q is false. In terms of our example, p q is true if it is indeed Monday and the cafeteria is serving pizza. If it is Monday, but the cafeteria is not serving pizza, p q is false. This much seems to be common sense. But what truth value should we attach to p q if the hypothesis p is false, that is, if it is not Monday? We agree that if the hypothesis is false, we will interpret p q as true. Given an implication p q, we can form three related implications. Definition 3.1.1. Let p and q be statements. The converse of p q is the implication q p, the inverse of p q is p = q, and the contrapositive of p q is q p.

4 CHAPTER 3. BASIC LOGIC AND PROOF TECHNIQUES For example, the converse of If it is Monday, then the cafeteria is serving pizza for lunch is If the cafeteria is serving pizza for lunch, then it is Monday. Two logical statements are called equivalent if one is true precisely when the other is true, i.e., if their truth tables are identical. It is intuitively clear from this example that a statement and its converse are not equivalent; the fact that if it is Monday the cafeteria is serving pizza does not mean that the cafeteria only serves pizza on Monday. To see in general that a statement and its converse are not logically equivalent, let s look at the truth tables for both. p q p q q p T T T T T F F T F T T F F F T T For some choices of statements p and q, both of the implications p q and q p are true. In this case, we write p q, read p if and only if q. For our example, the inverse of If it is Monday, then the cafeteria is serving pizza is If it is not Monday, then the cafeteria is not serving pizza. Again, our intuition tells us that the inverse of an implication is not logically equivalent to the implication. The truth tables confirm this intuition. We add some intermediate columns for p and q to make filling in the final column easier. p q p q p q p q T T F F T T T F F T F T F T T F T F F F T T T T The contrapositive of the implication If it is Monday, then the cafeteria is serving pizza is If the cafeteria is not serving pizza, then it is not Monday. The contrapositive is indeed logically equivalent to the original statement, as the truth tables show. p q p q p q q p T T F F T T T F F T F F F T T F T T F F T T T T

3.2. QUANTIFIED STATEMENTS AND THEIR NEGATIONS 5 Exercise 3.1.2. For each of the implications below, identify the hypothesis p and the conclusion q. Then form the converse, inverse, and contrapositive of each implication. 1. Let n be an integer. If n 1, then n 2 1. 2. Let m and n be integers. If m > 0 and n > 0, then mn > 0. 3. If a person was born in the United States, then that person is a United States citizen. Exercise 3.1.3. Show that (p q) is equivalent to p q by making the truth tables. 3.2 Quantified Statements and Their Negations Universally quantified statements are statements about all elements of a set, such as For any triangle, the angle measures sum to 180 For every integer n, n 2 > 0 All leopards have spots. Generally, universally quantified statements can be written in the form For all x S, p, where p is a statement. Sometimes, in place of for all we use the symbol and write x S, p. We will not always use precisely this wording. Phrases like for all, for every, for any, and for each are synonymous. A universally quantified statement can even have the form of the last statement, All leopards have spots, which could be (pedantically) rewritten as Let S be the set of leopards. For all x S, x has spots. Existentially quantified statements are statements about the existence of an element of a set with a certain property, such as There exists a rational number r such that r 2 = 144 There exists a continuous function f : (0, 1) R that is unbounded There exists a leopard with no spots. Sometimes, in place of there exists we use the symbol. Generally, an existentially quantified statement has the form x S such that p,

6 CHAPTER 3. BASIC LOGIC AND PROOF TECHNIQUES where p is a statement. Example 3.2.1. Some statements are very complicated, involving several quantifiers, such as or For every a R with a > 0, there exists a real number x such that x 2 = a, For every ε > 0, there exists N N such that, for all n N, 2 n < ε. For every mathematical statement, it is either true or its negation is true. Thus when you are trying to do mathematics, you are often simultaneously considering a statement and its negation, trying to determine which one is true. It is therefore very important to be able to negate even very complicated mathematical statements. How do we form the negation of a universally quantified statement? Consider, for example, the statement All leopards have spots. In order for this statement to be false (and its negation true), it need not be the case that no leopard has spots; the statement will be false if there is a single leopard without spots. Thus the negation is Similarly, the negation of is There exists a leopard with no spots. For every integer n, n 2 > 0 There exists an integer n such that n 2 0. In general, the negation of the universally quantified statement x S, p is the existentially quantified statement x S such that p. On the other hand, the negation of the existentially quantified statement is the universally quantified statement x S such that p x S, p. Of course we can negate a complicated statement with nested quantifiers. Example 3.2.2. Let us negate the second statement in Example 3.2.1, namely For every ε > 0, there exists N N such that, for all n N, 2 n < ε.

3.2. QUANTIFIED STATEMENTS AND THEIR NEGATIONS 7 Note that this statement is of the form where p is the statement Thus the negation is For every ε > 0, p, p: There exists N N such that, for all n N, 2 n < ε. There exists ε > 0 such that p. Our task is now to negate p, which is itself a quantified statement of the form where q is the statement Thus the negation of p is Finally, we need to negate q: p: There exists N N such that q, q: For all n N, 2 n < ε. p: For all N N, q. q: There exists n N such that 2 n ε. Putting the pieces together gives the negation of the original statement: There exists ε > 0 such that, for all N N, there exists n N such that 2 n ε. Exercise 3.2.1. Negate each of the following statements. (a) All students take calculus (b) There exists a natural number n for which n > n 2. (c) There exists M N such that, for every n N, a n M. 3.2.1 Writing implications as quantified statements Consider the following statement about an integer n: If n is an integer, then n 2 > 0. This statement is written in the form of an implication p q where p is the statement n is an integer and q is the statement n 2 > 0. We could also write p q as a universally quantified statement: For all n Z, n 2 > 0.

8 CHAPTER 3. BASIC LOGIC AND PROOF TECHNIQUES Rewriting the implication as a universally quantified statement may make it clearer to us what we must do to prove that it is false; we must prove its negation: There exists n Z such that n 2 0. Exercise 3.2.2. Write each implication as a universally-quantified statement. Then negate the statement. Finally, determine whether each statement is true or false. 1. If n is an even integer, n 2 is divisible by 4. 2. If x, y R, x 3 + y 3 + 1 1. 3. Let x R. If x 2 < 1 100, x2 4 < 1 20. 3.3 Proof Techniques 3.3.1 Direct Proof The most obvious way to prove that p implies q is to assume that p is true and to show that q follows. Such a proof is called a direct proof. Proposition 3.3.1. Let m, n Z. If m and n are odd, then m + n is even. Proof. Because m and n are odd, there exist integers j and k such that m = 2j + 1 and n = 2k + 1. Then, m + n = (2j + 1) + (2k + 1) = 2j + 2k + 2 = 2(j + k + 1). Because j + k + 1 is an integer, m + n is indeed divisible by 2. That is, m + n is even. Exercise 3.3.1. Let n Z. Give a direct proof of the proposition: If n is odd, n 2 is odd. 3.3.2 Proof by contradiction Here s the idea: we want to prove statement p, but we can t find a direct proof. We thus suppose instead that p is false and show that this assumption implies some other statement we know to be false. We may then conclude that p is true. We illustrate with a simple example. Proposition 3.3.2. There is no smallest positive rational number.

3.3. PROOF TECHNIQUES 9 Proof. The proof is by contradiction. Thus suppose there is a smallest positive rational number r. Consider a = 1 2r. Because the rational numbers are closed under multiplication, a is rational. Furthermore, because 0 < 1 2 < 1 and r > 0, 0 < 1 2r < r, or, equivalently, 0 < a < r. Thus we have found a positive rational number smaller than r. Because r was assumed to be the smallest positive rational number, we have a contradiction. We conclude that there is no smallest positive rational number. Exercise 3.3.2. Let p be prime and let a = p! + 1. Prove by contradiction that, for all integers 2 k p, k does not divide a. Let s use the last exercise to do another classic proof by contradiction. Proposition 3.3.3. The set of prime natural numbers has infinitely many elements. Proof. The proof is by contradiction. Thus suppose the set of primes has only finitely many elements. Then there is a largest prime p. Let a = p! + 1 and note that a > p. By Exercise 3.3.2, a is not divisible by any integer k with 2 k p. Thus either a is itself prime or a is divisible by some prime larger than p. In either case, this contradicts the assumption that p is the largest prime. We may therefore conclude that the set of primes has infinitely many elements. 3.3.3 Proof by contraposition Recall that if p and q are statements, the implication p q is equivalent to its contrapositive, q p. Thus we may always prove an implication by instead proving its contrapositive. We illustrate with an example. Recall that two integers have the same parity if either both are even or both are odd. Proposition 3.3.4. If m, n Z and if m + n is even, then m and n have the same parity. Proof. We prove the contrapositive; that is, we prove that if m and n do not have the same parity, then m + n is not even. Because m and n do not have the same parity, one of them is even and the other is odd. We may assume without loss of generality that m is even and n is odd. Thus there exist integers j and k such that m = 2j and n = 2k + 1. Then m + n = 2j + (2k + 1) = 2(j + k) + 1. Because j + k is an integer, we see that m + n is odd, as desired. Remark 2. We said, We may assume without loss of generality that m is even and n is odd. Such an assumption is valid because we know that one of the integers is even and the other is odd. Were it the case that m is odd and n is even, we could simply rename our integers, calling the even one m and the odd one n. Such an assumption in a proof avoids having to separately treat two cases that are really identical except for the names of the objects.

10 CHAPTER 3. BASIC LOGIC AND PROOF TECHNIQUES Exercise 3.3.3. Let n Z. Consider the proposition: If n 2 is even, then n is even. Prove this proposition by proving its contrapositive. 3.3.4 The art of the counterexample Suppose you are presented with a statement that you believe to be false. How do you prove it? Because every statement must be true or false and because a statement and its negation can not have the same truth value, to prove that a statement is false, you must prove that its negation is true. Doing so may be a lot of work. Consider the statement There exists a purple cow. This statement is existentially quantified. We could write it very formally as follows: Let C be the set of all cows. Then there exists c C such that c is purple. Its negation is universally quantified: For all c C, c is not purple. Proving this statement would be hard, for it would require that we examine all cows. Suppose, on the other hand, we are given a universally quantified statement that we believe to be false: All roses are red. Formally, Its negation is Let R be the set of all roses. For all r R, r is red. There exists r R such that r is not red. To prove the negation, all we need do is exhibit a rose that is not red, i.e., to provide a counterexample to the original statement. Of course, counterexamples may be hard to come by; even if All clovers have three leaves is false, it may be difficult to find a four-leafed clover. Finding good counterexamples is a bit of an art. Consider the statement For every x, y R, (x + y) 3 = x 3 + y 3. Our experience suggests to us that this statement is false. Let us analyze two possible arguments. First Argument. The distributive law gives (x + y) 3 = (x + y)(x + y)(x + y) = x 3 + 3x 2 y + 3xy 2 + y 3. Thus the original statement is true if and only if, for all x, y R, x 3 + 3x 2 y + 3xy 2 + y 3 = x 3 + y 3. This statement is, in turn, true if and only if, for all x, y R, 3xy(x + y) = 0.

3.4. PROBLEMS 11 If x, y 0, this last equality holds only if x + y = 0, i.e., only if x = y. Therefore equality will not hold if, for example, x = y = 1. Thus the original statement does not hold for arbitrary x, y R. Second Argument. Consider x = y = 1. Then (x + y) 3 = (1 + 1) 3 = 2 3 = 8, but x 3 + y 3 = 1 3 + 1 3 = 2. Thus the original statement is false. Both arguments are valid, but they differ greatly. The first may initially seem better because it begins by finding another expression equal to (x + y) 3. But it then leaves us with the new problem of determining whether x 3 +3x 2 y+3xy 2 +y 3 does or does not equal x 3 + y 3, or, equivalently, whether 3x 2 y + 3xy 2 = 0 for all x, y R. Our experience suggests that the latter statement is false, but, again, we need a proof. In this case, we are able to obtain such a proof. But imagine how much harder this approach would be were we to try to use it to prove that the statement (x + y) 7 = x 7 + y 7 is false. At some point we would be forced to do what we do right away in the second argument - find specific values of x and y for which some statement fails. Our second argument above is more satisfying; the two expressions are unequal for most values of x and y, and so it is a simple matter to find values that are easy to substitute to illustrate that the expressions on the left and right are unequal. 3.4 Problems 1. Consider the following two statements: For every x R, there exists y R such that y 2 x 2 = 1. There exists y R such that, for every x R, y 2 x 2 = 1. (a) Explain carefully the difference between the two statements. both true? (b) Negate the above statements. Is either of the negations true? Are 2. Let m, n Z. Determine whether each of the following statements is true or false. Then form the converse of each and determine whether it is true or false. In each case, if the statement is true, give a proof, and if it is false, give a counterexample. (a) If mn is even, then m and n are even. (b) If n and m are both divisible by 3, then m + n is divisible by 3. (c) If m < n, m 2 < n 2. 3. Consider the following statements about n N. p: n is divisible by 3. q: The sum of the digits in the base 10 representation of n is divisible by 3.

12 CHAPTER 3. BASIC LOGIC AND PROOF TECHNIQUES Does p imply q? Does q imply p? 4. Recall that a sequence {a n } is bounded if there exists M such that, for all n N, a n M. Negate the italicized statement to obtain the definition of a sequence {a n } that is not bounded. Then prove that the sequence with n-th term given by { 0 if n is even a n = 1 2n if n is odd is not bounded. 5. Let {a n } and {b n } be sequences of real numbers. Determine whether each of the following statements is true or false. As usual, if the statement is true, prove it; if it is false, give a counterexample. (a) If {a n } and {b n } are bounded, then {a n b n } is bounded. (b) If {a n b n } is bounded, then {a n } and {b n } are bounded. (c) If {a n + b n } is bounded, then {a n } and {b n } are bounded.