* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Logic and Sets
Gödel's incompleteness theorems wikipedia , lookup
Modal logic wikipedia , lookup
Infinitesimal wikipedia , lookup
Mathematical logic wikipedia , lookup
Intuitionistic logic wikipedia , lookup
Foundations of mathematics wikipedia , lookup
Non-standard analysis wikipedia , lookup
Sequent calculus wikipedia , lookup
Boolean satisfiability problem wikipedia , lookup
Non-standard calculus wikipedia , lookup
Propositional formula wikipedia , lookup
Law of thought wikipedia , lookup
Interpretation (logic) wikipedia , lookup
Natural deduction wikipedia , lookup
Hyperreal number wikipedia , lookup
Propositional calculus wikipedia , lookup
Naive set theory wikipedia , lookup
Truth-bearer wikipedia , lookup
Laws of Form wikipedia , lookup
Accessibility relation wikipedia , lookup
Chapter One Logic and Sets 1.1 INTRODUCTION Given positive integers m and n, we say that m is a factor of n provided n = mq for some positive integer q. In particular, n is a factor of itself, since n = n · 1. If m is a factor of n and m < n, then m is called a proper factor of n. For example, the proper factors of 6 are 1, 2, and 3, and the proper factors of 50 are 1, 2, 5, 10, and 25. The integer 6 has the interesting property that it is equal to the sum of its proper factors, that is, 6 = 1 + 2 + 3. Numbers having this property are called perfect numbers. In fact, 6 is the smallest perfect number. Are there any others? Recall that a positive integer p > 1 is said to be a prime number if 1 is its only proper factor. The ten smallest prime numbers are 2, 3, 5, 7, 11, 13, 17, 19, 23, and 29. Note that no prime number p can be perfect, since the only proper factor of p is 1, and 1 < p. In general, a positive integer n is called deficient provided it is greater than the sum of its proper factors; thus, every prime is deficient. What about a positive integer n that is the product of two distinct primes, such as 6 = 2 · 3, 10 = 2 · 5, and 15 = 3 · 5? We see that 6 is perfect, but that both 10 and 15 are deficient. In general, if n = p1 p2 , where p1 and p2 are distinct primes with p1 < p2 , then the proper factors of n are 1, p1 , and p2 , and 1 + p1 + p2 < p1 p2 , unless p1 = 2 and p2 = 3. Thus, except for 6, any n that is the product of two distinct primes is deficient. Another easy result is that any number that is the square of a prime, such as 4, 9, 25, and 49, is deficient. In fact, we can state the following more general result, whose proof is left to Exercise 4. Theorem 1.1: Any power of any prime is deficient; that is, if n = pk for some prime p and some positive integer k, then n is deficient. It follows from what we have said so far that, of the numbers less than 30, each of the following is deficient: 2, 3, 4, 5, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 19, 21, 22, 23, 25, 26, 27, 29 (It probably also makes sense to classify 1 as deficient, since 1 has no proper factors.) So now, let’s check the numbers between 1 and 30 not on the above list, besides 6, which we know is perfect. First of all, for 12, we see that its proper factors are 1, 2, 3, 4, and 6, and that 1 + 2 + 3 + 4 + 6 = 16 > 12. 2 Chapter 1 Logic and Sets So 12 falls into a third category — numbers which are less than the sum of their proper factors. Such numbers are said to be abundant. Next, for 18, its proper factors are 1, 2, 3, 6, and 9, and 1 + 2 + 3 + 6 + 9 = 21 > 18. Hence, 18 is abundant. Similarly, 20 and 24 are abundant. Next comes 28. Its proper factors are 1, 2, 4, 7, and 14, and 1 + 2 + 4 + 7 + 14 = 28. Therefore, 28 is the second smallest perfect number! One could, perhaps with the aid of a computer, continue to search for perfect numbers. This has been done, with the following results: (1) 28 is the only 2-digit perfect number; (2) 496 is the only 3-digit perfect number; (3) 8128 is the only 4-digit perfect number; (4) there are no k-digit perfect numbers for k = 5, 6, 7; in fact, the next perfect number after 8128 is 33550336. So perfect numbers are rare indeed! Perfect numbers have been studied at least since the time of the Greek mathematician Pythagoras and his followers in the sixth century B.C. They thought that such numbers had magical properties, and certainly must have wondered whether there are infinitely many perfect numbers. In other words, is there a largest perfect number, or does the list of perfect numbers go on forever? This is an example of the kind of question with which mathematicians are concerned. Questions such as this may arise during seminars with colleagues or from reading journal articles. Often, questions arise from attempts to settle other questions, perhaps in the context of some application. As with any science, mathematicians use experimental evidence to help them form and test questions. Let’s look at the four smallest perfect numbers and see if we can find any pattern to them. An obvious thing to try (for a mathematician!) is to factor each perfect number as a product of primes, since it can be shown that all of a number’s proper factors are determined from its prime factors. Here’s what we get: 6 = 21 · 3 28 = 22 · 7 496 = 24 · 31 8128 = 26 · 127 We see that each of these perfect numbers is the product of a power of 2 and a prime. Furthermore, focusing on the primes 3, 7, 31, and 127, we see that each of these is one less than a power of two; that is: 6 = 21 (22 − 1) 28 = 22 (23 − 1) 496 = 24 (25 − 1) 8128 = 26 (27 − 1) The above pattern was observed by the Greek mathematician Euclid [ca. 300 BC], and he is credited with the following result. Theorem 1.2: For a positive integer k, if 2k − 1 is prime, then n = 2k−1(2k − 1) is a perfect number. This result is not difficult to verify and is left to Exercise 10. About 2000 years later, the great Swiss mathematician Leonhard Euler (1707-1783) proved the following related result. 3 1.1 Introduction Theorem 1.3: If n is an even perfect number, then n = 2k−1 (2k − 1) for some positive integer k, with 2k − 1 a prime. In view of the above theorems, the search for even perfect numbers reduces to the search for prime numbers of the form 2k − 1. Such primes are called Mersenne primes, after the French number theorist and friar, Marin Mersenne (1588-1638). Mersenne knew that, in order for 2k − 1 to be prime, it is necessary that k be prime (see Exercise 6). In a book that he wrote he stated without proof that 2k − 1 is prime for the following values of k: 2, 3, 5, 7, 13, 17, 19, 31, 67, 127, 257 — and that these were the only values of k ≤ 257 for which 2k − 1 is prime. It turns out that Mersenne made five errors (remember, he had to do all of his calculations by hand!): 261 − 1 is prime; 267 − 1 is not prime; 289 − 1 is prime; 2107 − 1 is prime; 2257 − 1 is not prime. Thus, before computers, only twelve Mersenne primes, and hence only twelve even perfect numbers, were known. Then, in 1952, five more perfect numbers were found, corresponding to the Mersenne primes 2521 − 1, 2607 − 1, 21279 − 1, 22203 − 1, 22281 − 1 Another was found in 1957, and two more in 1961, using an IBM 7090 mainframe computer. In 1997, Englishman Gordon Spence, using an algorithm developed by George Woltman, a 39-year-old programmer from Florida, found the Mersenne prime 22976221 − 1 This prime has 895932 digits; if printed, it would fill a 450-page paperback book! According to Wikipedia, as of August 2007, there were 44 known Mersenne primes, and hence a total of 44 known even perfect numbers. The largest known prime number is a Mersenne prime, namely 232582657 − 1 It was discovered via the Great Internet Mersenne Prime Search (GIMPS), a distributed computing project on the Internet that anyone with a computer can participate in. If you’re interested, check out www.mersenne.org/works.htm What about odd perfect numbers? Well, so far, none have been found. Through a combination of theory and computation, it is known that there are no odd perfect numbers having less than 300 digits! When a mathematical assertion is thought to be true, and when the evidence supports this belief, then the assertion is called a conjecture. For example, it is conjectured that there are infinitely many Mersenne primes, and hence that there are infinitely many even perfect numbers. Also, it is conjectured that there are no odd perfect numbers. We would like to state the conjecture about Mersenne primes more precisely in order to facilitate our discussion of it. Conjecture 1.4: For every positive integer n, there exists a Mersenne prime greater than n. Suppose this conjecture has been checked for all values of n up to n = 10100, or even up to n = 101000. Does this mean it is true? Not to a mathematician, and this is what separates 4 Chapter 1 Logic and Sets mathematics from the other sciences. In order for a conjecture to be accepted as true, namely, for it to attain the higher status of a theorem, the statement must be deduced logically from basic assumptions and other accepted facts. That is, theorems must be proved. Logic furnishes a set of ground rules for analyzing mathematical assertions and for determining whether a proposed proof of an assertion is valid. These rules are one aspect of proof that can be learned; much of the business of proof involves intuition, creativity, imagination, and instinct. The deductive method is important in computer science, as well, where logic is applied to the process of designing, coding, and testing software systems, with the aim of ensuring that such systems perform as specified. There is also a relatively new programming methodology, called logic programming, that explicitly embodies the ideas of mathematical logic; one popular language for logic programming is called Prolog. It has been used to program expert systems — programs that simulate the deductive analysis of the human expert in some narrow domain, such as that of medical diagnosis. As logic is introduced in this chapter, emphasis will be placed on certain common forms of exposition and reasoning, apart from any particular applications. Students who learn these well will find it easier to follow the development of this and subsequent courses in the mathematical sciences. Knowing the rules of logic — the rules of the mathematical game — allows students to focus on the content of courses and not be thrown off track or distracted by the logical forms being applied. Hereafter, the term argument is used in its mathematical sense, as a logical discussion that establishes the validity of some mathematical fact. We ask, then, What is the logic of an argument? Roughly speaking, the logic of an argument is what is left over when the particular meaning of the argument is ignored. In other words, the logic of an argument is its form or syntax. As an example, let us return to Conjecture 1.4. This statement has the form For every n, P (n). where P (n) represents the statement There exists a Mersenne prime greater than n. This P (n) is an example of a propositional function, and the variable n is allowed to have any value from some set of permissible values, in this case from the set of positive integers. Lots of other statements have this same logical form. For instance, an instructor returning an examination to a class might make the following statement: Every student missed the third question. This statement again has the form For every n, P (n). where P (n) represents the statement n missed the third question. Here the variable n may be replaced by (the name of) any student in the class. What would it mean for a statement of this form to be false? Let’s take the instructor’s statement first. The assertion that every student missed the third question on the exam is false provided one or more students got the question right. Namely, the statement Every student missed the third question. is false provided the statement There is some student who got the third question right. 5 1.1 Introduction is true. We say that the two statements are logical negations of each other. In general, as will be discussed later in this chapter, the statement For every n, P (n). is false provided the statement There is some n such that P (n). is true, where the notation P (n) denotes the logical negation of P (n). Returning to Conjecture 1.4, recall that it also has the logical form For every n, P (n). Thus, Conjecture 1.4 is false provided the statement There is some n such that P (n). is true. In this case it can be determined that P (n) is the statement It is not the case that there exists a Mersenne prime greater than n. Again using techniques to be developed later in this chapter, we can simplify P (n) as follows: Every Mersenne prime is less than or equal to n. Putting this all together, we have determined that the negation of the Conjecture 1.4 is the following statement: There is some positive integer n such that every Mersenne prime is less than or equal to n. which is just a long-winded way of saying that there are only finitely many Mersenne primes. The point to be made from the above discussion is that the abstract logical form of a mathematical statement or argument is independent of its particular content. The rules of logic provide a means for analyzing statements and for determining whether mathematical arguments are valid or not. It is important to understand the meaning of the term statement, as it is used in symbolic logic. Sentences such as Everyone will pass this class. or The number 72 is positive. are “declarative sentences” — each makes an assertion. On the other hand, the question Is 437 a prime number? or the exclamation Holy cow! are not declarative sentences. For purposes of mathematical logic, our interest is in declarative sentences that are either true or false; these are called statements or propositions. If a statement is true, then its truth-value is denoted T, whereas the truth-value of a false statement is denoted F. 6 Chapter 1 Logic and Sets For instance, each of the sentences The quotient obtained when 7 is divided by 3 is an odd integer. and The integer 6 is a factor of the product of 117 and 118. is a statement. In fact, the first is false and the second is true. Next, consider the sentences The number x is positive. and He is a baseball pitcher. These are not statements because, as they are presented, we cannot determine the truth-value of either one. If we replace x by −3 in the first sentence, then we obtain the (false) statement The number − 3 is positive. Similarly, we may replace “He” in the second sentence by “Josh Beckett” to obtain the (true) statement Josh Beckett is a baseball pitcher. Symbols like x in the example above are called variables; such symbols are used to represent any one of a number of permissible values. Later on we will say more about sentences with variables that become statements when the variables are given particular values. Lest the reader be misled, it should be pointed out that some sentences with variables are statements. For instance, the sentence For every real number x, if x > 2, then x3 > 8. is a (true) statement. We also accept as statements sentences like The billionth digit in the decimal expansion of √ 2 is 7. or Every even integer greater than 2 can be expressed as the sum of two primes. We take the attitude that such sentences are either true or false, although we may not know the truth-value at the present time. The truth-value of the first sentence can, at least in theory, be computed. The second sentence is another example of a mathematical conjecture; it is called the Goldbach conjecture. There exists a great deal of empirical evidence for its truth, but as yet it has not been proven. We have said that an understanding of logic is central to the process of doing mathematics. Another central idea that we shall use throughout is that of a set. A set can be thought of as a collection of objects. The Greek alphabet, a baseball team, and the Euclidean plane are all examples of sets. The Greek alphabet consists of letters, a baseball team is composed of its players, and the Euclidean plane is made up of points. In general, the objects that make up a set are referred to as its elements or members. It is common practice to think of the terms set and member as undefined or primitive notions. Most of us have an intuitive understanding (based on examples like those just given) of what these terms mean. 7 1.1 Introduction Sets are the building blocks for most mathematical structures. For example, Euclidean plane geometry is based on the interpretation of the Euclidean plane as a set of points. Other important examples arise in the field of abstract algebra, which studies the properties of sets on which one or more “binary operations” are defined. For example, ordinary addition is a binary operation on the set of positive integers. Certain special sets of numbers are used frequently in mathematics, so some special notation has been developed for them. The numbers 1, 2, 3, . . . are called the positive integers, and the notation Z+ is used to denote the set of positive integers. The positive integers, together with the number 0 and the negative integers −1, −2, −3, . . . form the set of integers; this set is denoted by Z. A rational number is any number expressible in the form m/n, where m and n are integers and n 6= 0. For example, 2/3, −5/11, 17 = 17/1, and √ .222 √ . . . = 2/9 are rational numbers. The set of rational numbers is denoted by Q. The numbers 2, 3 5, and π are not rational; in general, such numbers are called irrational numbers. The rational numbers and the irrational numbers together make up the set of real numbers, which is denoted R. To repeat, then, we adopt the following notational conventions: Z+ = the set of positive integers Z = the set of integers Q = the set of rational numbers R = the set of real numbers Another notation that is commonly used is N to denote the set of natural numbers. Unfortunately, mathematical scientists are not in agreement as to what this set is. To some, the set of natural numbers is the same as the set of positive integers; that is, the natural numbers are the counting numbers 1, 2, 3 . . . . Others want to include 0 as a natural number. For example, in the Ada programming language there is a predefined type NATURAL (actually, a subtype of the type INTEGER) whose domain is the set 0, 1, 2, 3, . . . . Our approach in this book is to simply avoid using the notation N and the terminology “natural number.” But we do want to alert you to the potential confusion with this terminology. The basic relationship between an element x and a set A is that of membership. If x is an element of A, then√we write x ∈√A, and if x is not an element of A we write x ∈ / A. For instance, −3 ∈ Z, −3 ∈ / Z+ , 2 ∈ R, and 2 ∈ / Q. Except for certain special sets like R, sets are denoted in this book by upper case italic letters such as A, B, C and elements by lower case italic letters such as a, b, c. If a set A consists of a small number of elements, then we can exhibit A by explicitly listing its elements between braces. For example, if A is the set of odd positive integers less than 16, then we write A = {1, 3, 5, 7, 9, 11, 13, 15} However, some sets contain too many elements to be listed in this way. In many such cases, the “three-dot” (or ellipsis) notation is used to mean “and so on” or “and so on up to,” depending on the context. For instance, the set Z+ can be exhibited as Z+ = {1, 2, 3, . . .} the set Z as Z = {. . . , −3, −2, −1, 0, 1, 2, 3, . . .} and the set B of integers between 17 and 93 as B = {17, 18, 19, . . . , 93} 8 Chapter 1 Logic and Sets Often a set A is described as consisting of those elements x in some set B that satisfy a specified property. As an example, let E be the set of even integers. Then we may write E = {. . . , −4, −2, 0, 2, 4, . . .} This set can also be described in the form E = {m ∈ Z | m is even} We read {m ∈ Z | m is even} as “the set of all m in the set Z such that m is even.” Here, the symbol | translates as “such that” or “for which.” Note that every positive integer is an integer, every integer is a rational number, and every rational number is a real number. In general, for two sets A and B, it is possible that each element of A is also an element of B. Definition 1.1: For sets A and B, A is called a subset of B, denoted A ⊆ B, provided every element of A is also an element of B. Given a subset S of the set of real numbers, it is frequently useful to be able to denote the set of positive elements of S, the set of negative elements of S, and the set of nonzero elements of S. For this we adopt the following notation: S + = {x ∈ S | x > 0} S − = {x ∈ S | x < 0} S ∗ = {x ∈ S | x 6= 0} Thus, for example, we use Z+ to denote the set of positive integers, Q+ to denote the set of positive rational numbers, R− to denote the set of negative real numbers, and R∗ to denote the set of nonzero real numbers. Also, given a subset S of the real numbers and a real number c, we adopt the following useful notation: c + S = {c + x | x ∈ S} cS = {cx | x ∈ S} So, for example, 2Z = 2 {. . . , −3, −2, −1, 0, 1, 2, 3, . . .} = {. . . , −6, −4, −2, 0, 2, 4, 6, . . .} denotes the set of even integers, and 1 + 2Z = 1 + {. . . , −6, −4, −2, 0, 2, 4, 6, . . .} = {. . . , −5, −3, −1, 1, 3, 5, 7, . . .} denotes the set of odd integers. Notice then that an integer m is even provided m = 2q for some integer q. Similarly, an integer m is odd provided m = 2k + 1 for some integer k. In your previous courses in mathematics, you have already encountered the special subsets of R called intervals. These are used frequently in this book and we review the standard notation for them here. Let a and b be real numbers with a < b. Then 9 1.1 Introduction (a, b) = {x ∈ R | a < x < b} a, b = {x ∈ R | a ≤ x ≤ b} (a, b = {x ∈ R | a < x ≤ b} a, b) = {x ∈ R | a ≤ x < b} The interval (a, b) is called an open interval , a, b is called a closed interval , and both (a, b and a, b) are called half-open intervals. In each case a and b are called the endpoints of the interval. Intervals can also be unbounded; the possible forms (where the symbol ∞ denotes “infinity”) are (a, ∞) = {x ∈ R | a < x} a, ∞) = {x ∈ R | a ≤ x} (−∞, b) = {x ∈ R | x < b} (−∞, b = {x ∈ R | x ≤ b} (−∞, ∞) = R In a particular mathematical discussion involving sets, it is usually assumed or understood that all sets under consideration are subsets of some specified set U. This set U is called a universal set. In a calculus class, for instance, it may be that U is the set of real numbers, whereas in a combinatorics lecture it may be that U is the set of integers. Exercise Set 1.1 1. Indicate which of the following are statements. (a) The integer 24 is even. (b) Is the integer 315 − 1 even? (c) The product of 2 and 3 is 7. (d) The sum of x and y is 3. (e) If the integer x is odd, is x2 odd? (f) It is not possible for 315 − 1 to be both even and odd. (g) The product of x2 and x3 is x6 . (h) The integer 2524287 − 1 is prime. 2. Verify that the following formula holds for any number r 6= 1 and any positive integer k: 1 + r + r 2 + · · · + r k−1 = rk − 1 r−1 (Hint: Let s denote the sum on the left-hand side of the formula, and consider rs − s.) 3. Write each of the sets by listing its elements. (a) A = {m ∈ Z | −4 < m < 5} (c) C = {x ∈ R | x3 − x2 − 2x = 0} (b) B = {n ∈ Z+ | −4 < n < 5} (d) D = {x ∈ Q | x4 − 6x2 + 8 = 0} 4. Prove Theorem 1.1. (Hint: Use the result of Exercise 2.) 5. Write each of the sets in the form {m ∈ Z | p(m)}, where p(m) is some property of the integer m; for example, {. . . , −4, −2, 0, 2, 4, . . .} = {m ∈ Z | m is even}. 10 Chapter 1 Logic and Sets (a) {. . . , −3, −2, −1} (b) {0, 1, 4, 9, 16, . . .} (c) {. . . , −27, −8, −1, 0, 1, 8, 27, . . .} (d) {. . . , −8, −4, 0, 4, 8, . . .} (e) {. . . , −15, −9, −3, 3, 9, 15, . . . } 6. Let x denote a real number and let a, b, d, and k denote positive integers. (a) Apply the result of Exercise 2 to show that xd − 1 = (x − 1)(xd−1 + xd−2 + · · · + x + 1) (b) Use the result of part (a) to verify that 2ab − 1 = (2a − 1)(2a(b−1) + 2a(b−2) + · · · + 2a + 1) (c) Use the result of part (b) to show that, if k is not prime, then 2k − 1 is not prime. 7. Write each of the sets using the notations S + , S − , cS, and/or c + S. (a) {. . . , −3, −2, −1} (b) {2, 4, 6, 8, . . .} (c) {. . . , −9, −4, 1, 6, 11, . . .} (d) {. . . , −8, −4, 0, 4, 8, . . .} (e) {. . . , −15, −9, −3, 3, 9, 15, . . . } 8. Verify that 496 is perfect as follows. First, (use the result of Exercise 2 to) find the sum s1 of the factors of 496 that are powers of 2. Second, find the sum s2 of the factors of 496 that have the form of a power of 2 times 31 (including 496 itself). Third, verify that s1 + s2 = 2(496) = 992. 9. Write each of the following subsets of Z by listing the elements. (a) {m ∈ Z | m ∈ −3, 3 } (b) {m ∈ Z | m ∈ −3, 3)} (c) {m ∈ Z | m ∈ (−3, ∞)} (d) {m ∈ Z | m ∈ (−∞, 3 } 10. Prove Theorem 1.2: If m = 2k − 1 is prime, then n = m(m + 1)/2 is a perfect number. To do this, generalize the procedure used in Exercise 8 for the special case k = 5. 11. Write each of the sets in an alternate, yet equivalent, form. (a) 3 + Z+ (c) πZ (b) 1 + Z (d) 2Q 12. Verify that 211 − 1 is not prime. 13. Write each of the following subsets of R using interval notation. (a) {x | −2 < x < 3} (b) {x | 4 < x ≤ 9} (c) {x | −1 ≤ x ≤ 5} (d) {x | 1 < x} (e) {x | x < 0} 14. Find, explicitly, the 7 smallest perfect numbers. 11 1.2 Logical Connectives 1.2 LOGICAL CONNECTIVES In research seminars, in classrooms, or at roadside pubs, mathematicians and their students (and perhaps other people, as well) are frequently interested in determining the truth-value of some given mathematical statement. Many mathematical statements are formed by using the words not, or , and , if — then —, and if and only if to combine simpler statements. These are called the logical connectives (or simply connectives) and are defined in this section. In this chapter, lower-case italic letters, such as p, q, r, or subscripted versions of these letters, such as p1 , q2 , r3 , are used to denote or represent statements; these are called propositional variables. There are two types of statements which one deals with in logic. A simple (or primitive) statement is any statement which contains neither logical connectives nor any other statement as a constituent part. Statements which are not simple are called compound statements; in other words, a compound statement is one which contains either logical connectives or at least two simple statements. The symbolic representation of a primitive or compound statement is called a formula . Definition 1.2: Let p and q be formulas. 1. The disjunction of p and q is the compound statement p or q It is true provided at least one of p or q is true; otherwise it is false. We denote the disjunction of p and q by p∨q 2. The conjunction of p and q is the compound statement p and q It is true provided both p and q are true; otherwise it is false. We denote the conjunction of p and q by p∧q 3. The negation of p is the statement not p It has truth-value opposite that of p and is denoted by p. (Two alternate notations for p are ∼ p and p0 .) The truth-value of a given statement is determined from the truth-values of the simple statements of which it is composed. We will demonstrate how a truth table is used to examine a given statement. Such a table contains a column for each propositional variable in the statement and a column for the whole statement. The table has a row corresponding to each possible combination of truth-values for the propositional variables involved. If the statement is particularly complex, additional propositional variables may be introduced to represent parts of it, and then the table contains a column for each of these as well. 12 Chapter 1 Logic and Sets Tables 1.1 (a), (b), and (c) show the truth tables for disjunction, conjunction, and negation. Note that there are four possible combinations for the truth-values of two propositional variables p and q. (a) p T T F F q T F T F p∨q T T T F (b) p T T F F q T F T F p∧q T F F F (c) p T F p F T Tables 1.1 Truth tables for p or q, p and q, and for not p Example 1.1: For which integers m is the condition m > −2 and m < 3 satisfied? Solution: The condition m > −2 is satisfied by the integers −1, 0, 1, 2, 3, 4, . . ., while the condition m < 3 is satisfied by . . ., −3, −2, −1, 0, 1, 2. We want those integers that satisfy both conditions, namely, those that are both greater than −2 and less than 3. There are four such values of m: −1, 0, 1, and 2. Example 1.2: The Boston Red Sox, Cleveland Indians, Detroit Tigers, and New York Yankees are professional baseball teams. Suppose on a given night the Red Sox play the Yankees and the Indians play the Tigers. Both games are completed, and the next morning someone makes the statement The Tigers or the Red Sox won last night. Find the negation of this compound statement. Solution: The given compound statement is of the form p ∨ q, where p represents the statement The Tigers won last night. and q represents the statement The Red Sox won last night. According to its definition, p ∨ q is false provided p is false and q is false. Thus, the negation of p ∨ q is true provided both p and q are false, that is, provided both p and q are true. It follows that the negation of the given compound statement is Both the Tigers and the Red Sox lost last night. In the next section we show that, in general, the negation of the formula p ∨ q is the formula p ∧ q. 13 1.2 Logical Connectives Consider next the compound statement If p, then q. How is the truth-value of such a statement determined from the truth-values of the statements p and q? An example should help to clarify the situation and motivate the general definition. Example 1.3: Consider the statement If you score 70 or better on the final exam, then you will pass the course. which an instructor might make to a student. We let p represent the statement The student scored 70 or better on the final exam. and q represent the statement The student passed the course. Then the instructor’s statement (in its past-tense form) is represented by the formula If p, then q. Let us analyze this statement for each of the four possible truth-value combinations of p and q. (Assume the semester is over and the student’s final exam score and course grade are known.) Case 1 : Both p and q are true. In this case the student scored 70 or better on the final exam and did pass the course, just as the instructor promised. Certainly the instructor’s statement is true in this case. Case 2 : p is true and q is false. Here, the student scored 70 or better on the final exam, but for some reason did not pass. Perhaps the instructor made an error in recording the grade. At any rate, based on the evidence, we must conclude that the instructor’s statement is false. Case 3 : p is false and q is true. The student scored less than 70 on the final exam but passed anyway. Perhaps the student got a 69 and the instructor, being in a generous mood, decided to give the student a break. The point is that the facts do not contradict the instructor’s statement. In a sense, the statement has not been tested. (The instructor did not say what would happen if the student scored less than 70 on the final.) Thus we take the instructor’s statement to be true. Case 4 : Both p and q are false. The student scored less than 70 on the final and did not pass the course. This is much like the previous case, in that the instructor’s statement has not been tested. So we take the instructor’s statement to be true. We see in this example that the only case in which the formula If p, then q. is false is when p is true and q is false. Examples like this one serve to motivate the next definition. Definition 1.3: Let p and q be propositional variables. The formula If p, then q. 14 Chapter 1 Logic and Sets is called the implication of q by p and is denoted by p → q. It is false only when p is true and q is false, and is true otherwise. It is common to read p → q as “p implies q,” and to refer to a statement with this logical form as a conditional statement or simply as an implication. In such a statement, p is called the hypothesis and q the conclusion. The truth table for the implication is shown in Table 1.2. p T T F F q T F T F p→q T F T T Table 1.2 Truth table for p → q Next, consider the following statements: (a) If the Buffalo Bills scored more than 20 points, then they won the game. (b) If the Buffalo Bills won the game, then they scored more than 20 points. which someone might utter before hearing the score of a football game played earlier that day. It is clear that these statements are different yet related. They might or might not have the same truthvalue, depending on the truth values of the two simple statements of which they are composed. For example, if the Bills scored 24 points and won the game, then both (a) and (b) are true; if the Bills scored 17 points and won, then (a) is true and (b) is false. Consider also the following statement: (c) If the Buffalo Bills lost the game, then they scored 20 points or less. As will be seen in the next section, statements (a) and (c) must have the same truth-value. Note that these three statements, taken together, have the following logical forms: (a) If p, then q. (b) If q, then p. (c) If not q, then not p. Definition 1.4: Let p and q be propositional variables and let u represent the formula If p, then q. The implication If q, then p. is called the converse of u, and the implication If not q, then not p. is called the contrapositive of u. 15 1.2 Logical Connectives It happens frequently in mathematics that we need to examine a statement with the logical form (p → q) ∧ (q → p) that is, we need to examine the conjunction of an implication and its converse. connective is used for just this situation. A special logical Definition 1.5: Let p and q be propositional variables. The formula (p → q) ∧ (q → p) is called the biconditional , and it is denoted by p ↔ q. A statement with this form is read p if and only if q and is often written using the shorthand form p iff q The truth table for the biconditional, shown in Table 1.3, is not difficult to obtain from the truth tables for the conjunction and the implication. Note that p ↔ q is true only when p and q have the same truth-value. p T T F F q T F T F p→q T F T T q→p T T F T p↔q T F F T Table 1.3 Truth table for p ↔ q This is a good spot to discuss the use of parentheses in a formula. For example, consider the formula not p or q Does it mean p ∨q or does it mean p ∨ q ? In fact, convention has it that the first formula p ∨q is the correct interpretation. A similar problem occurs with the formula p or q and r (even if we express it symbolically as p∨ q ∧ r). Do we want the disjunction of p with the conjunction of q and r, that is, p ∨ (q ∧ r), or do we want the conjunction of the disjunction of p and q with r, that is, (p ∨ q) ∧ r? Difficulties of this sort can be resolved by employing parentheses. For example, in the formula (p ∨ q) ∧ r the “or” is to be applied first, and then the “and.” Another common approach is to adopt some basic precedence rules that will allow many formulas to be written without parentheses. 16 Chapter 1 Logic and Sets Precedence Rules for the Logical Connectives: In a parenthesis-free formula, the logical connectives are to be applied in the following order: Connective not and or implies iff Precedence first second third fourth fourth We say that negation (not ) has higher precedence than both conjunction (and) and disjunction (or ), and that conjunction has higher precedence than disjunction. The connective or has higher precedence than both the implication (implies) and the biconditional (iff ), and these latter two connectives have the same (lowest) precedence level. Thus, if a formula involves both implies and iff, then parentheses must be used to make the formula unambiguous. Example 1.4: We use the precedence rules to write several formulas. (a) (b) (c) (d) (e) Formula (not p) or q (p and q) or r (not q) → (not p) (p → q) ↔ (p ∨ q) (p ∧ q) → (p ↔ q) Written Using the Precedence Rules not p or q p and q or r not q → not p (p → q) ↔ p ∨ q p ∧ q → (p ↔ q) Exercise Set 1.2 1. Let p, q, and r represent the following statements: p: Ralph read the New York Times. q: Ralph watched the Daily Show. r: Ralph jogged 3 miles. Give a formula for each of these statements. (Use the symbols for the logical connectives.) (a) Ralph read the New York Times and watched the Daily Show. (b) Ralph read the New York Times or jogged 3 miles. (c) If Ralph read the New York Times, then he did not watch the Daily Show. (d) Ralph read the New York Times if and only if he jogged 3 miles. (e) It is not the case that if Ralph jogged 3 miles then he read the New York Times. (f) Ralph watched the Daily Show or jogged 3 miles, but not both. 2. Define the propositional variables p, q, and r as in Exercise 1. Write out the statement corresponding to each of these formulas. 17 1.2 Logical Connectives (a) p ∧ r (c) (p ∧ q) ∨ r (e) p → q (b) q ∨ r (d) p ∨ q (f) q ↔ r 3. Consider the following statements p and q: p: Roger Clemens had a sore arm in 1995. q: The Red Sox won the 1995 World Series. The statement p is true. Represent each of these statements by a formula. What is the statement’s truth-value if q is true? What if q is false? (a) Roger Clemens had a sore arm in 1995 or the Red Sox won the 1995 World Series. (b) Roger Clemens had a sore arm in 1995 and the Red Sox won the 1995 World Series. (c) If Roger Clemens had a sore arm in 1995, then the Red Sox did not win the 1995 World Series. (d) If the Red Sox did not win the 1995 World Series, then Roger Clemens had a sore arm that year. (e) The Red Sox won the 1995 World Series if and only if Roger Clemens did not have a sore arm that year. 4. For each of these compound statements, first identify the simple statements p, q, r, and so on, of which it is composed. Then represent the statement by a formula. √ √ √ (a) If 2709 is an integer, then either 2709 is even or 2709 is odd. (b) If 53 √ √ √ is prime and 53 is greater than 2, then 53 is odd. (c) If 3 7 is not negative and its square is less than 4, then either 3 7 = 0 or 3 7 is positive and less than 2. (d) If 26 is even and 26 is greater than 2, then 26 is not prime. 5. Express each of these compound statements symbolically. (a) If triangle ABC is equilateral, then it is isosceles. (b) The integer n = 3 if and only if 3n − 4 = 5. (c) If π π is a real number, then either π π is rational or π π is irrational. (d) The √ product xy = 0 if and only if either √ x = 0 or y = 0. (e) If 47089 is greater than 200, then, if 47089 is prime it is greater than 210. (f) If line k is perpendicular to line m and line m is parallel to line n, then line k is perpendicular to line n. (g) If x3 − 3x2 + x − 3 = 0, then either x is positive or x is negative or x = 0. (h) If 7 and 23 are integers and 23 6= 0, then 7/23 is a rational number. 6. In mathematics, the connective or is used inclusively, meaning “one or the other or both.” However, in everyday language, or is often used in the exclusive sense, as in the sentence With your order you may have french fries or potato salad. Used in this way, the or is interpreted as “one or the other, but not both.” Using the symbol 5 to represent the connective “exclusive or,” construct the truth table for the formula p 5 q. 18 Chapter 1 Logic and Sets 7. In racquetball, it is important to know which player is serving, because a player scores a point only if that player is serving and wins a volley. If the serving player loses the volley, then the other player gets to serve. Thus, to keep score in a racquetball game between players A and B, it may be useful to define propositional variables p and q, where p is true if player A is serving and false if player B is serving, while q is true if player A wins the current volley and false if player B wins it. (a) Give a formula that is true if player A scores a point and is false otherwise. (b) Give a formula that is true if player B scores a point and is false otherwise. (c) Give a formula that is true if the serving player loses the current volley and is false otherwise. (d) What should happen to the value of p in order to change the serving player? 8. The implication If not p, then not q. is called the inverse of the implication p → q. Let p represent the statement The Buffalo Bills scored more than 20 points. and let q represent the statement The Buffalo Bills won the game. Find the truth-value of both p → q and its inverse p → q in each of these cases. (a) p is true and q is true (c) p is false and q is true (b) p is true and q is false (d) p is false and q is false 9. Let the propositional variable p represent some statement, and let the variable p1 represent the statement p is true. Show that p and p1 have the same truth value. (Sometimes the phrase “is true” is appended to a statement for emphasis; for example, we might say “p implies q is true” instead of just “p implies q.”) 1.3 LOGICAL EQUIVALENCE In mathematics, as in other subjects, there may be several different ways to say the same thing. In this section we formally define what this means for logical statements. Definition 1.6: Let u and v be formulas. We say that u is logically equivalent to v, denoted u ≡ v, provided u and v have the same truth-value for every possible choice of truth-values for the propositional variables involved. The two examples of logical equivalence that follow are important in that both are used often in mathematics. 19 1.3 Logical Equivalence Example 1.5: To show that p ∨ q and p ∧ q are logically equivalent, we construct a truth table and compare the columns labeled by these two formulas. This truth table is shown in Table 1.4. Since the columns headed by p ∨ q and p ∧ q agree in each row, these formulas are logically equivalent. p T T F F q T F T F p F F T T p∨q T T T F q F T F T p ∨q F F F T p∧q F F F T Table 1.4 Example 1.6: Use a truth table to verify that p → q ≡ p ∨ q. Solution: See Table 1.5. p T T F F q T F T F p F F T T p→q T F T T p∨q T F T T Table 1.5 Example 1.7: Recall that the contrapositive of the implication p → q is the implication q → p. In words, the contrapositive states If not q, then not p. We wish to show that an implication and its contrapositive are logically equivalent. A truth table can be used for this, but it is instructive to do it without a truth table. We need several facts. First, if u, v, and w are formulas with u ≡ v and v ≡ w, then clearly u ≡ w (in words, we say that logical equivalence is transitive). Second, from Example 1.6 we have that s → t ≡ s∨t (1) It is also not difficult to see that s∨t ≡ t∨s (2) s≡s (3) and that (We use the propositional variables s and t here to avoid confusion with the variables p and q, which appear in the logical equivalence we are trying to establish.) Now, by (1), p→ q ≡p∨q 20 Chapter 1 Logic and Sets Next, by (2), p∨q ≡q∨p Finally, the hard step — by (1), with s replaced by q and t replaced by p, we have q∨p ≡q →p Finally by (3), q ≡ q, so we obtain q∨p ≡q →p Thus it follows that p→q≡q→p Some formulas have the property that they are always true, namely, they are logically equivalent to the constant truth-value T. Definition 1.7: A formula that is true for all possible truth-values of its constituent propositional variables is called a tautology and is denoted by the constant formula T. A formula that is false for all possible truth-values of its constituent propositional variables is called a contradiction and is denoted by the constant formula F. Example 1.8: Table 1.6 shows the truth table for the formula p∧q →p∨q Since this formula is always true, it is a tautology. p T T F F q T F T F p∧q T F F F p∨q T T T F p∧q →p∨q T T T T Table 1.6 Truth table showing that p ∧ q → p ∨ q is a tautology Example 1.9: Verify that the following formula is a tautology: (p ∧ q) → r → r → (p ∨ q) Solution: Here, we have our first instance of a formula that involves three propositional variables. As illustrated by Table 1.7, there are eight possible truth-value combinations that must be considered. For convenience, we let u and v denote the formulas (p ∧ q) → r and r → (p ∨ q), respectively. Alternate Solution: It is also possible to verify that u → v is a tautology by discussing what might be called the important or essential cases. We know that u → v is true when u is false or 21 1.3 Logical Equivalence when v is true. In other words, the only case in which u → v is false is when u is true and v is false; we want to show that this can’t happen. Suppose that v is false; then it must be that r is true and p ∨ q is false. Thus, it must be that r is false and p and q are both true; that is, r is false and p ∧ q is true. Therefore, u is false. So whenever v is false, u is also false. It follows that u → v is a tautology. p T T T T F F F F q T T F F T T F F r T F T F T F T F p F F F F T T T T q F F T T F F T T r F T F T F T F T p∧q T T F F F F F F p∨q F F T T T T T T u T F T T T T T T v T F T T T T T T u→v T T T T T T T T Table 1.7 Truth table showing that [(p ∧ q) → r] → [r → (p ∨ q)] is a tautology Example 1.10: Express the formula p → q as a conjunction. Solution: From Example 1.6, we recall that p→ q ≡p∨q It follows that p →q ≡p∨q ≡p∧q ≡p∧q (by Example 1.5) Note that in the last step that the equivalence p ≡ p is used again. A note about logical equivalence at this point. In a later section we discuss what it means to prove a mathematical statement or theorem. The notion of logical equivalence will turn out to be useful in this regard. For suppose u and v are formulas representing mathematical statements and we wish to prove u. If u ≡ v, then it suffices to prove v. For example, suppose we want to prove a mathematical statement whose form is the implication p → q. Since p → q is logically equivalent to its contrapositive q → p, we may instead prove q → p. This technique, called “proof by contrapositive,” is a standard proof technique in mathematics, and we explore it further in Section 1.6. Here is a list of some of the important properties of logical equivalence that are frequently encountered and used in mathematics. 22 Chapter 1 Logic and Sets Properties of Logical Equivalence: 1. The commutative properties: (a) p ∨ q ≡ q ∨ p 2. The associative properties: (a) (p ∨ q) ∨ r ≡ p ∨ (q ∨ r) 3. The distributive properties: (a) p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r) (b) p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r) 4. The idempotent laws: (a) p ∨ p ≡ p 5. DeMorgan’s laws: (a) p ∧ q ≡ p ∨ q (b) p ∧ q ≡ q ∧ p (b) (p ∧ q) ∧ r ≡ p ∧ (q ∧ r) (b) p ∧ p ≡ p (b) p ∧ q ≡ p ∨ q 6. Law of the excluded middle: (a) p ∨ p is a tautology. (b) p ∧ p is a contradiction. 7. An implication and its contrapositive are logically equivalent: p→q≡q→p 8. The converse and inverse of the implication p → q are logically equivalent: q→p≡p→q 9. Let T denote any tautology and F denote any contradiction. Then: (a) p ∨ T ≡ T (b) p ∧ T ≡ p (c) p ∨ F ≡ p (d) p ∧ F ≡ F 10. An implication can be expressed as a disjunction, and the negation of an implication can be expressed as a conjunction: (a) p → q ≡ p ∨ q (b) p → q ≡ p ∧ q A brief comment concerning formulas such as (p ∧ q) ∧ r or ((p ∧ q) ∧ r) ∧ s. In view of the fact that (p ∧ q) ∧ r ≡ p ∧ (q ∧ r), it makes good sense to define p ∧ q ∧ r to be (p ∧ q) ∧ r. It follows that p ∧ q ∧ r ≡ p ∧ (q ∧ r), so we can insert parentheses into p ∧ q ∧ r in both valid ways without loss of meaning. Similarly, there are five meaningful ways to parenthesize the formula p ∧ q ∧ r ∧ s and, since all the resulting formulas are logically equivalent, we agree to let p ∧ q ∧ r ∧ s denote any one of them. Analogous remarks apply for disjunction. Example 1.11: Suppose we know the following statements are true: (a) π is an irrational number. (b) If π is an irrational number, then π + 4 is an irrational number. 23 1.3 Logical Equivalence Then we should be able to conclude that the statement π + 4 is an irrational number is true. We can combine statements (a) and (b) and the conclusion drawn from them into the following single statement: If both π is an irrational number and π is an irrational number implies π + 4 is an irrational number, then π + 4 is an irrational number. The general form of this last statement is (p ∧ (p → q)) → q This formula has a Latin name: modus ponens. It represents any statement of the form If both p and p implies q, then q. Use properties of logical equivalence to show that modus ponens is a tautology. Solution: We apply the properties as indicated: (p ∧ (p → q)) → q ≡ p ∧ (p → q) ∨ q ≡ (p ∨ p → q) ∨ q ≡ (p ∨ (p ∧ q)) ∨ q ≡ ((p ∨ p) ∧ (p ∨ q)) ∨ q ≡ (T ∧ (p ∨ q)) ∨ q) ≡ (p ∨ q) ∨ q ≡ p ∨ (q ∨ q) ≡p∨T ≡T 10(a) 5(b) 10(b) 3(a) 6(a),1(a) 9(b),1(b) 2(a) 6(a) 9(a) Frequently used in mathematical discussions are different (yet still equivalent) forms of the implication and biconditional. We next discuss these alternate forms. The implication p → q has two interpretations in words thus far: If p, then q. and p implies q. We know that p → q is logically equivalent to its contrapositive q → p, which is read If not q, then not p. Assume p → q is true. Then q → p is also true, which means that if q is false, then p must also be false. Thus, p is true only under the condition that q is true. This last statement is written p only if q. 24 Chapter 1 Logic and Sets and it is another way of saying p implies q. Another common phrase in mathematics is p is sufficient for q. It states that the condition that p holds is enough to guarantee that q holds. Hence, it is just another way of saying that p implies q. Finally, one last phrase equivalent to p → q is q is necessary for p. This says that in order for p to be true, q must be true, so that q being false implies that p is false, again giving us the contrapositive q → p. To summarize, then, the following statements are equivalent: If p, then q. p implies q. p only if q. p is sufficient for q. q is necessary for p. Example 1.12: Consider the following statement from calculus: In order that the derivative of a function f is 0, it is necessary that the function f is a constant. Rewrite this statement in four equivalent ways. Solution: The given statement is of the form q is necessary for p. where q represents the statement The function f is a constant. and p represents the statement The derivative of the function f is 0. Hence the given statement is equivalent to each of the following: If the derivative of the function f is 0, then the function f is constant. That the derivative of the function f is 0 implies that the function f is constant. The derivative of the function f is 0 only if the function f is constant. That the derivative of the function f is 0 is sufficient for the function f to be constant. Now consider the biconditional p if and only if q. Recall that this is, by definition, a shorthand for (p → q) ∧ (q → p) 25 1.3 Logical Equivalence One way to read the above formula is p is sufficient for q and p is necessary for q. This last statement is usually shortened to p is necessary and sufficient for q. and is an alternative way of saying p if and only if q. For instance, the statements The derivative of the function f is 0 if and only if f is constant. and The derivative of the function f is 0 is necessary and sufficient for f to be constant. are equivalent. In view of the fact that p ↔ q and q ↔ p are equivalent, this last statement could be rephrased as The function f is a constant is necessary and sufficient for the derivative of f to be 0. Exercise Set 1.3 1. Use a truth table to verify DeMorgan’s law 5(b). 2. Use truth tables to verify the associative properties 2(a) and 2(b). 3. Verify property 8 that the inverse and converse of the implication p → q are logically equivalent. Try to do this in three different ways: (a) using a truth table (b) using property 10(a) (c) using property 7 4. Each implication given concerns integers x and y. Find (i) its converse, (ii) its contrapositive, (iii) its inverse, and (iv) its negation. (a) If x = 2, then x4 = 16. (b) If y > 0, then y 6= −3. (c) If x is odd and y is odd, then xy is odd. (d) If x2 = x, then either x = 0 or x = 1. (e) If x = 17 or x3 = 8, then x is prime. (f) If xy 6= 0, then both x 6= 0 and y 6= 0. 5. Find (i) the converse, and (ii) the contrapositive of each of the following implications. (a) If quadrilateral ABCD is a rectangle, then ABCD is a parallelogram. (b) If triangle ABC is isosceles and contains an angle of 45 degrees, then ABC is a right triangle. (c) If quadrilateral ABCD is a square, then it is both a rectangle and a rhombus. (d) If quadrilateral ABCD has two sides of equal length, then it is a rectangle or a rhombus. (e) If polygon P has the property that P is equiangular if and only if P is equilateral, then P is a triangle. 26 Chapter 1 Logic and Sets 6. The formula [(p ∨ q) ∧ p] → q is known as the disjunctive syllogism. (a) Express the formula in words. (b) Show that the disjunctive syllogism is a tautology. A truth table may be used for part (b), of course, but try instead to use the properties of logical equivalence. 7. The formula [(p → q) ∧ q] → p is called modus tollens. (a) Express the formula in words. (b) Show (using properties of logical equivalence) that modus tollens is a tautology. 8. Give a truth table for each formula. Which are tautologies? Which are contradictions? (a) (p ∧ q) → p (c) (p → q) ∧ (p → q) (e) (p → q) → r (b) p ↔ p (d) (p → q) ∨ (q → p) (f) p ∧ q ∧ (p → q) 9. Use truth tables to verify the distributive properties 3(a) and 3(b). 10. Verify these logical equivalences. (Again, truth tables may be used, but try instead to use the properties of logical equivalence.) (a) (p → q) ∧ (p → r) ≡ p ∧ (q ∨ r) (b) (p ∧ q) ↔ p ≡ p → q (c) (p ∧ q) → r ≡ p → (q ∨ r) (d) p → (q ∨ r) ≡ q → (p ∨ r) (e) p ↔ q ≡ q ↔ p 11. Determine whether formulas u and v are logically equivalent. (Try to use a truth-table only when the formula involves the biconditional.) (a) u : (p → q) ∧ (p → q) (b) u : p → q (c) u : p ↔ q (d) u : (p → q) → r (e) u : (p ↔ q) ↔ r (f) u : p → (q → r) (g) u : p → (q ∨ r) (h) u : p ∨ (q → r) v v v v v v v v : p :q→p : q↔p : p → (q → r) : p ↔ (q ↔ r) : (p → q) → (p → r) : (p → q) ∨ (p → r) : (p ∨ q) → (p ∨ r) 12. Given that the formula (q ∨ r) → p is false and q is false, determine the truth-values of r and p. 13. Identify the form of each implication as one of the following: (i) If p, then q. (ii) p implies q. (iii) p only if q. (iv) p is sufficient for q. (v) q is necessary for p. Then rewrite the implication in each of the other four forms. 27 1.4 Logical Quantifiers (a) If x = −2, then x3 = −8. (b) Being intelligent is necessary for Randy to pass this course. (c) Working hard is sufficient for Susan to pass this course. (d) 11111 is prime only if 11111 is not a multiple of 7. (e) In order for triangle ABC to be a right triangle, it is necessary that the side lengths satisfy the Pythagorean theorem. (f) That Susan is √ a good student implies that Susan studies hard. (g) In order for 3 to be rational, it is sufficient that its decimal expansion repeats. (h) Randy passed the course if Randy passed the final exam. (i) Randy passed the course only if Randy passed the final exam. 14. Verify that the formula (p → q) ↔ (p ∨ q) is a tautology. Compare this result with that of Example 1.6. 15. Rewrite each statement in an equivalent way. (a) x3 − x2 + x − 1 = 0 is necessary and sufficient for x = 1. (b) Randy passed the final exam if and only if Susan helped him study. 1.4 LOGICAL QUANTIFIERS Consider the sentence x is prime and x > 17 (A prime number is an integer n > 1 whose only positive factors are itself and 1. Prime numbers are discussed in Chapter 2.) This sentence is not a statement, for if x = 19, it is true, whereas if x = 24, it is false. Until the variable x is given a specific value, the truth-value of the sentence cannot be determined. This sentence is an example of a “propositional function.” Definition 1.8: A propositional function in the variable x is a sentence about x that becomes a statement when x is given a particular value (or meaning). Propositional functions in one variable x are denoted p(x), q(x), r(x), and so on. Consider the sentence If x is prime, then x is not a multiple of 4. This sentence has the logical form p(x) → q(x). On the other hand, sentences such as There exists an x such that x is prime and x + 10 is prime. and For all x, if x is prime, then x2 + 5 is not prime. cannot be represented using the logical connectives presented thus far. The reason for this is the presence of the phrases “there exists an x” and “for all x.” The phrases “for all” and “there exists” are called logical quantifiers, and are used often enough in mathematics to warrant symbolic representation. 28 Chapter 1 Logic and Sets Definition 1.9: The statement There exists an x such that p(x). is symbolized by the formula ∃x 3 p(x) The phrase “there exists” is called the existential quantifier and the symbol ∃ is used to denote it. Some other common phrases for ∃ are “for some” and “there is some.” The symbol 3 is read “such that,” and the words “such that” are often replaced by “for which” or “satisfying.” The statement ∃x 3 p(x) is true provided there is at least one value of the variable x which makes p(x) a true statement. Since the symbol 3 for “such that” and the symbol ∈ for set membership are easy to confuse with each other, some mathematicians prefer to abbreviate “such that” as “s.t.” as in ∃x s.t. x is prime and x + 10 is prime Definition 1.10: The statement For all x, p(x). is symbolized by the formula ∀x, p(x) The phrase “for all” is called the universal quantifier and the symbol ∀ is used to denote it. Other common phrases for ∀ are “for each” and “for every” and “given any.” The statement ∀x, p(x) is true provided p(x) is true for every value of x. The quantifiers ∃ and ∀, together with the logical connectives, are collectively referred to as the logical symbols. Example 1.13: Consider the following statements about a real number x: (a) ∃x 3 x2 = 2 (b) ∃x 3√x2 < 0 (c) ∀x, x + 1 > x (d) ∀x, x2 = x √ √ Statement (a) is true, since it holds when x = 2 and when x = − 2. Statement (b) is false, since every real number x has the property that x2 ≥ 0. Statement (c) is clearly true, whereas statement (d) is false; see what happens when x is negative! 29 1.4 Logical Quantifiers Notice that the statement There is some x such that x2 = 2. √ √ is false if we are considering only rational numbers x (since 2 and − 2 are irrational numbers), but is true if x is allowed to be a real number. This is why the permitted values of the variable x in such a statement must be made clear. This can be done by stating the permissible set of values for x in advance of making one or more statements (as was done in Example 1.13). Alternately, if the set of permissible values for x is not assumed in advance of making a statement, then the set can be specified as part of the statement. For example, the statement in Example 1.13(a) can be stated as There exists a real number x such that x2 = 2. and is written symbolically as ∃x ∈ R 3 x2 = 2 In this case, we say that we are using a restricted form of the quantifier ∃. In general, if we wish to state that there is some x in the set S that makes the propositional function p(x) true, then we can use the restricted form of the existential quantifier as follows: ∃x ∈ S 3 p(x) We remark that the preceding statement is equivalent to the unrestricted form ∃x 3 x ∈ S ∧ p(x) That is, saying that there is some x in the set S such that p(x) is true is equivalent to saying that there is some x such that both x belongs to the set S and p(x) is true. Next, suppose we wish to state that the inequality m2 − 3m + 2 ≥ 0 holds for every integer m. In this case we use a restricted form of the quantifier ∀ as follows: ∀m ∈ Z , m2 − 3m + 2 ≥ 0 This statement is, in fact, true. On the other hand, the statement ∀x ∈ Q, x2 − 3x + 2 ≥ 0 which states that the inequality x2 − 3x + 2 ≥ 0 holds for every rational number x, is false, since the inequality fails, for example, when x = 3/2. In general, if we wish to assert that the propositional function p(x) is true for every x in the set S, then we can use the restricted form of the universal quantifier as follows: ∀x ∈ S, p(x) We remark that the preceding statement is equivalent to the unrestricted form ∀x, x ∈ S → p(x) That is, saying that p(x) is true for every x in S is equivalent to saying that the implication x ∈ S → p(x) holds for every x. Example 1.14: Express each of the following statements in symbolic form and determine its truth-value. 30 Chapter 1 Logic and Sets (a) For every positive integer n, either n is prime or n2 + 1 is prime. (b) There is some positive integer n such that both n2 + 5 is prime and n is a perfect square. Solution: Statement (a) is represented by the formula ∀n ∈ Z+ , n is prime ∨ n2 + 1 is prime This statement is false; for example, the propositional function n is prime or n2 + 1 is prime becomes a false statement when n = 9. Statement (b) is written as ∃n ∈ Z+ 3 n2 + 5 is prime ∧ n is a perfect square or, even more symbolically, as ∃n ∈ Z+ 3 n2 + 5 is prime ∧ ∃k ∈ Z+ 3 n = k 2 This statement is true; try n = 36. Some statements involve more than one quantifier, and statements may also contain several propositional variables. Consider the following two statements: (a) There exists an integer x such that for every integer y, x + y = 4. (b) For every integer y there exists an integer x such that x + y = 4. These statements are represented by the following formulas: (a) ∃x ∈ Z 3 ∀y ∈ Z , p(x, y) (b) ∀y ∈ Z , ∃x ∈ Z 3 p(x, y) Here we have used the two-variable propositional function, p(x, y), to represent the sentence x+y = 4. What can we say about the truth-values of statements (a) and (b)? Statement (a) asserts the existence of an integer x such that, no matter what integer y is chosen, x + y = 4. This statement is clearly false, for once y is chosen, x = 4 − y is uniquely determined. Statement (b), on the other hand, states that for any integer y, there is some integer x such that x + y = 4. This statement is true since, once y is chosen, we can let x = 4 − y Example 1.15: For each statement, give a formula that represents it. (a) For every positive integer n there exists a prime p such that p > n. (b) There exist two primes p and q whose sum is also prime. (c) For all rational numbers x and y, the sum x + y is also rational. (d) Every even integer n > 2 is the sum of two primes p and q. 31 1.4 Logical Quantifiers Solution: Let P denote the set of primes. The statement is (a) is represented by ∀n ∈ Z+ , ∃p ∈ P 3 p > n For (b), we have ∃p ∈ P 3 ∃q ∈ P 3 p + q ∈ P or, more concisely ∃p, q ∈ P 3 p + q ∈ P Statement (c) is represented by ∀x ∈ Q, ∀y ∈ Q, x + y ∈ Q Again, we allow the more concise form ∀x, y ∈ Q, x + y ∈ Q Finally, the statement in (d) is represented by ∀n ∈ 2Z, n > 2 → ∃p, q ∈ P 3 n = p + q This statement is a famous conjecture known as Goldbach’s conjecture; in words, it says that any even integer greater than 2 can be expressed as the sum of two primes. What is the negation of the statement ∃x 3 p(x)? The statement ∃x 3 p(x) is true provided there is some x (in the set of permissible values) such that p(x) is true. If this is not the case, then it must be that p(x) is false for every x. In other words, it must be that p(x) is true for every x. Thus, we see that ∃x 3 p(x) ≡ ∀x, p(x) Similarly, the negation of the statement ∀x, p(x) would be It is not the case that p(x) is true for every x. Equivalently, we can write this as There exists an x such that p(x) is false. Thus, we see that ∀x, p(x) ≡ ∃x 3 p(x) What about negating the restricted forms of the quantifiers? permissible values, it is straightforward to argue that ∃x ∈ S 3 p(x) ≡ ∀x ∈ S, p(x) and that ∀x ∈ S, p(x) ≡ ∃x ∈ S 3 p(x) Letting S denote the set of 32 Chapter 1 Logic and Sets Example 1.16: Find the negation of each formula. (a) ∀x ∈ Z+ , x is prime→ x2 + 1 is even (b) ∃x ∈ Q 3 x > 1 ∧ x3 = 2 (c) ∃x 3 ∀y, xy = y (d) ∀x, y, x < y → ∃z 3 x < z ∧ z < y Solution: Formula (a) is of the type ∀x ∈ Z+ , p(x) → q(x) The negation of such a formula is determined as follows: ∀x ∈ Z+ , p(x) → q(x) ≡ ∃x ∈ Z+ 3 p(x) → q(x) ≡ ∃x ∈ Z+ 3 p(x) ∧ q(x) So the negation of formula (a) is ∃x ∈ Z+ 3 that x is prime ∧ x2 + 1 is odd Formula (b) is of the type ∃x ∈ Q 3 p(x) ∧ q(x) We determine the negation as follows: ∃x ∈ Q 3 p(x) ∧ q(x) ≡ ∀x ∈ Q, p(x) ∧ q(x) ≡ ∀x ∈ Q, p(x) ∨ q(x) Thus, the negation of formula (b) is ∀x ∈ Q, x ≤ 1 ∨ x3 6= 2 Recalling that p → q ≡ p ∨ q, it may be preferable to rewrite this last statement in the form ∀x ∈ Q, x > 1 → x3 6= 2 Formula (c) is of the type ∃x 3 ∀y, p(x, y) where p(x, y) represents the propositional function xy = y. We determine the negation as follows: ∃x 3 ∀y, p(x, y) ≡ ∀x, ∀y (p(x, y) ≡ ∀x, ∃y 3 p(x, y) So the negation of formula (c) is ∀x, ∃y 3 xy 6= y The form of (d) is ∀x, y, p(x, y) → ∃z 3 q(x, z) ∧ r(y, z) It is left for you to work out that the negation has the form ∃x, y 3 p(x, y) ∧ ∀z, q(x, z) ∨ r(y, z) so that the negation of formula (d) is ∃x, y 3 x < y ∧ ∀z, x ≥ z ∨ z ≥ y or, equivalently, ∃x, y 3 x < y ∧ ∀z, x < z → z ≥ y 33 1.4 Logical Quantifiers Exercise Set 1.4 1. Let n be a positive integer and define the following propositional functions: p(n): n is prime q(n): n is even r(n): n > 2 Write out these statements. (a) ∃n 3 p(n) (c) ∃n 3 p(n) ∧ q(n) (e) ∃n 3 p(n) ∧ (q(n) ∨ r(n)) (b) ∀n, r(n) (d) ∀n, r(n) → (p(n) ∨ q(n)) (f) ∀n, (p(n) ∧ q(n)) → r(n) 2. Give a formula for each statement. (a) For every even integer n there exists an integer m such that n = 2m. (b) Every even perfect number ends in the digit 6 or 8. (This is a true statement!) (c) There exists a right triangle T that is an isosceles triangle. (d) Given any quadrilateral Q, if Q is a parallelogram and Q has two adjacent sides that are perpendicular, then Q is a rectangle. (e) There exists an even prime integer. (f) There exist integers s and t such that 1 < s < t < 187 and st = 187. (g) There is an integer m such that both m/2 is an integer and, for every integer k > 1, m/(2k) is not an integer. (h) Given any real numbers x and y, 2x2 − xy + 5 > 0. (i) For every positive integer n, there exists an even perfect number m such that m > n. 3. Find the negation (in simplest form) of each formula. (a) ∀x, p(x) ∨ q(x) (c) ∀x, ∃y 3 p(x, y) → q(x, y) (e) ∀x, ∃y 3 p(x, y) → ∃y 3 q(x, y) (b) ∀x, y, p(x, y) → q(x, y) (d) ∃x 3 ∀y, p(x, y) → q(x, y) ∧ ∃z 3 r(x, z) 4. For each statement, (i) represent it as a formula, (ii) find the negation (in simplest form) of this formula, and then (iii) express the negation in words. (a) For every x and y, x + y = y + x. (b) For every x there exists y such that y2 = x. (c) There exists y such that, for every x, 2x2 + 1 > x2 y. (d) There exist x1 and x2 such that x1 < x2 and x31 − x1 > x32 − x2 . (e) For all x and y there exists z such that 2z = x + y. (f) For every x1 and x2 , if x31 + x1 − 2 = x32 + x2 − 2, then x1 = x2 . 5. Let m represent an integer. Use the propositional functions p(m): m is even q(m): m is odd r(m): m2 < 0 to show that formulas u and v are not, in general, logically equivalent. 34 Chapter 1 Logic and Sets (a) u : ∀m, p(m) ∨ q(m) (b) u : ∃m, p(m) ∧ q(m) (c) u : ∀m, p(m) → q(m) (d) u : ∃m, p(m) → r(m) v v v v : ∀m, p(m) ∨ ∀m, q(m) : ∃m, p(m) ∧ ∃m, q(m) : ∀m, p(m) → ∀m, q(m) : ∃m, p(m) → ∃m, r(m) 6. Let S be a set. Argue that formulas u and v are logically equivalent. (a) u : ∃x ∈ S 3 p(x) ∨ q(x) (b) u : ∀x ∈ S, p(x) ∧ q(x) (c) u : ∃x ∈ S 3 p(x) → q(x) v : ∃x ∈ S 3 p(x) ∨ ∃x ∈ S 3 q(x) v : ∀x ∈ S, p(x) ∧ ∀x ∈ S, q(x) v : ∀x ∈ S, p(x) → ∃x ∈ S 3 q(x) 7. A finite sequence of objects is sometimes called a list. Consider the list L of ten numbers (x0 , x1 , . . . , x9 ) and let D = {0, 1, 2, . . ., 9} be the set of subscripts on the elements of L. Give a formula representing each statement about L. (For example, the formula ∀ i ∈ D, xi > 0 represents the statement that every element of L is positive.) (a) There is some element of L that is equal to 0. (b) Every element of L is equal to 0. (c) The elements of L are distinct. (d) There exist two elements of L that sum to 0. (e) For each element of L there is another element that differs from it by exactly 3. (f) The list L has a unique largest element. (g) Each element of L (from the second element on) is greater than its predecessor. (h) Any element with an even subscript is greater than every element with an odd subscript. 8. For each formula obtained in Exercise 2, determine its logical negation and then state the negation in words. 1.5 OPERATIONS ON SETS In Section 1.1, we introduced the notion of the universal set, U. This is the set of all elements under consideration for a particular mathematical discussion. There is another special set that is often encountered in any mathematics course; this is the set with no elements. It is aptly named the empty set and is denoted by { } or by the special symbol ∅. Unlike U, the empty set is unique, although there are numerous examples of it. For example, consider the set of female presidents of the United States prior to 2008, or the set of integers m such that m2 is negative. A set A is called finite provided it consists of n elements for some nonnegative integer n; in this case n is called the cardinality of A and we write |A| = n. In particular, the empty set is finite, as is the set {1, 2, . . . , n} of positive integers less than or equal to a given positive integer n. Sets that are not finite are called infinite; in particular, the sets Z+ , Z, Q, and R are infinite. Perhaps the most fundamental relation that can exist between two sets is that of equality. Definition 1.11: Two sets X and Y (both subsets of some universal set U) are called equal , written X = Y , provided they consist of the same elements. Symbolically, X = Y ↔ ∀u ∈ U, u ∈ X ↔ u ∈ Y If X and Y are not equal, we write X 6= Y . 35 1.5 Operations on Sets Recall that, for sets X and Y , X is a subset of Y if and only if every element of X is also an element of Y ; symbolically, X ⊆ Y ↔ ∀u ∈ U, u ∈ X → u ∈ Y Thus, set equality may be restated as follows: Sets X and Y are equal if and only if both X is a subset of Y and Y is a subset of X. Often we have two sets X and Y and wish to prove they are equal. It is common practice to divide such a proof into two parts: first, we show that X ⊆ Y ; second, we show that Y ⊆ X. Alternately, we may apply Definition 1.11 directly and show, for an arbitrary element u ∈ U, that u ∈ X if and only if u ∈ Y We shall consider several examples of such proofs later in this section. As mentioned above, for sets X and Y , if X = Y , then X is a subset of Y . If X is a subset of Y and X 6= Y (that is, X ⊆ Y and there is an element y such that y ∈ Y and y ∈ / X), then X is called a proper subset of Y and we write X ⊂ Y . Given a set X, we are often interested in the collection of all subsets of X. Definition 1.12: The set consisting of all subsets of a given set X is called the power set of X and is denoted P(X). Example 1.17: Find the power set of each set. (a) the empty set ∅ (c) {1, 2} (b) {1} (d) P(∅) Solution: For part (a), we remark that the empty set is a subset of any set (Why?); in particular, the empty set is a subset of itself. Moreover, the empty set is the only subset of itself. Thus, P(∅) = {∅} In words, this says that the power set of the empty set is a set with one element, that element being the empty set. Be careful here — {∅} is not the same as the empty set ∅. The set {∅} has cardinality 1, whereas ∅ is the unique set with cardinality 0. For part (b), we remark that any set is a subset of itself. Thus, {1} has at least two subsets, the empty set and itself. Since these are the only two subsets, we see that P({1}) = {∅, {1}} For part (c), we see that, in addition to the empty set and itself, the power set of {1, 2} includes two nonempty proper subsets, namely, {1} and {2}. Thus, P({1, 2}) = {∅, {1}, {2}, {1, 2}} In part (d) we are asked to find P(P(∅)). Using the result of part (a), we can say that P(P(∅)) = P({∅}) 36 Chapter 1 Logic and Sets Hence, we need to figure out P({∅}). This looks to be difficult, at first, until we realize that we’re simply being asked to find the power set of a set with one element, that element being the empty set. Let’s think more carefully about our solution for part (b). There we are also asked to find the power set of a set with one element; in that case the element was 1. If we generalize the argument used in part (b), we can say that, in general, any set with one element has exactly two subsets, the empty set and itself. Using x to denote the one element, this result can be expressed symbolically as follows: P({x}) = {∅, {x}} In particular, if we replace x by 1, then we obtain the result of part (b). And, if we replace x by the empty set ∅, then we obtain the following solution for part (d): P({∅}) = {∅, {∅}} Two important properties of power sets to be remembered are that, for any set X, both ∅ ∈ P(X) and X ∈ P(X). We next turn to some common operations on sets; these are intersection, union, and difference. Definition 1.13: Let X and Y be subsets of some universal set U. The set operations of intersection, union, and difference are defined as follows: 1. The intersection of X and Y is the set X ∩ Y defined by X ∩ Y = {u | u ∈ X and u ∈ Y } 2. The union of X and Y is the set X ∪ Y defined by X ∪ Y = {u | u ∈ X or u ∈ Y } 3. The difference set, X − Y , is defined by X − Y = {u | u ∈ X and u ∈ / Y} The set X − Y is also called the relative complement of Y in X. It is important to realize that, in general, X − Y 6= Y − X. The relative complement of X in the universal set U is called the complement of X and is denoted by X. That is, X =U −X = {u | u ∈ / X} Example 1.18: Let U = {0, 1, 2, 3, . . ., 9}, A = {1, 3, 5, 7, 9}, B = {2, 3, 5, 7}, and C = {0, 1, 2, 5, 8}. Find: (a) A ∩ B (c) A − B (e) A (b) A ∪ B (d) B − A (f) C 37 1.5 Operations on Sets Solution: We employ Definition 1.13 to obtain the following answers: A ∩ B = {3, 5, 7} A ∪ B = {1, 2, 3, 5, 7, 9} A − B = {1, 9} B − A = {2} A = {0, 2, 4, 6, 8} C = {3, 4, 6, 7, 9} Example 1.19: Given U = Z+ , A = {1, 3, 5, 7, . . .}, P = {p ∈ Z+ | p is prime}, and T = {3, 6, 9, 12, . . .}, find: (a) A (c) A ∩ P (e) P − A (g) A ∪ T (b) P (d) A − P (f) A ∩ T (h) A ∩ T Solution: Note that A is the set of odd positive integers, P = {2, 3, 5, 7, 11, 13, 17, 19, . . .}, and T is the set 3Z+ of positive multiples of 3. Thus: (a) A = {2, 4, 6, . . .} is the set 2Z+ of even positive integers. (b) P = {n ∈ Z+ | n is not prime} = {1, 4, 6, 8, 9, 10, 12, 14, 15, 18, . . .}. (c) The set A ∩ P is the set of odd primes: A ∩ P = {3, 5, 7, 11, 13, 17, 19, . . .} = P − {2}. (d) The set of odd positive integers that are not prime is A − P = {1, 9, 15, 21, 25, 27, . . .}. (e) P − A is the set of primes that are not odd, namely, P − A = {2}. (f) A ∩ T consists of those elements of T that are even, so A ∩ T = {6, 12, 18, 24, . . .} = 6Z+ . (g) A ∪ T includes any positive integer that is either odd or is not a multiple of 3, so A ∪ T = {1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 13, . . .} (h) Here we find, using the result of part (f), that A ∩ T = {6, 12, 18, 24, . . . } = {1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 13, . . .} = A ∪ T Example 1.20: Let U, A, B, and C be defined as in Example 1.18. Find and compare each pair of sets. (a) A ∩ (B ∪ C) and (A ∩ B) ∪ (A ∩ C) (b) A ∪ (B ∩ C) and (A ∪ B) ∩ (A ∪ C) (c) A ∪ B and A ∩ B (d) A ∩ B and A ∪ B 38 Chapter 1 Logic and Sets Solution: For part (a), we find that A ∩ (B ∪ C) = {1,3,5,7,9} ∩ {0, 1, 2, 3, 5, 7, 8} = {1, 3, 5, 7} and (A ∩ B) ∪ (A ∩ C) = {3, 5, 7} ∪ {1, 5} = {1, 3, 5, 7} Note that A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C). In (b), we find that A ∪ (B ∩ C) = {1, 2, 3, 5, 7, 9} = (A ∪ B) ∩ (A ∪ C) For part (c), we have that A ∪ B = {1, 2, 3, 5, 7, 9} = {0, 4, 6, 8} and A ∩ B = {0, 2, 4, 6, 8} ∩ {0, 1, 4, 6, 8, 9} = {0, 4, 6, 8} so again the two sets are equal. Similarly, for part (d), note that A ∩ B = {0, 1, 2, 4, 6, 8, 9} = A ∪ B Example 1.20 illustrates some general properties of the set operations that are among those presented in the next two theorems. Theorem 1.5: The following properties hold for any subsets X, Y , and Z of a universal set U: 1. Commutative properties: (a) X ∪ Y = Y ∪ X (b) 2. Associative properties: (a) (X ∪ Y ) ∪ Z = X ∪ (Y ∪ Z) (b) 3. Distributive properties: (a) X ∪ (Y ∩ Z) = (X ∪ Y ) ∩ (X ∪ Z) (b) X ∩ (Y ∪ Z) = (X ∩ Y ) ∪ (X ∩ Z) 4. Idempotent laws: (a) X ∪ X = X (b) 5. De Morgan’s laws: (a) X ∪ Y = X ∩ Y (b) 6. Law of the excluded middle: (a) X ∪ X = U (b) 7. X ⊆ Y if and only if Y ⊆ X X ∩Y =Y ∩X (X ∩ Y ) ∩ Z = X ∩ (Y ∩ Z) X ∩X =X X ∩Y =X∪Y X ∩X =∅ 39 1.5 Operations on Sets 8. (a) X ∪ U = U (c) X ∪ ∅ = X (b) X ∩ U = X (d) X ∩ ∅ = ∅ In order to prove the various parts of Theorem 1.5, we need to be able to prove that two sets are equal. Recall that sets A and B are equal provided the following statement is true: ∀u ∈ U, u ∈ A ↔ u ∈ B To prove such a statement, we let u denote an arbitrary element of U and verify the biconditional u ∈ A ↔ u ∈ B. Now then, recall that this biconditional is equivalent to the conjunction of two implications: u ∈ A ↔ u ∈ B ≡ (u ∈ A → u ∈ B) ∧ (u ∈ B → u ∈ A) Thus, one way to proceed is to break such a proof into two parts: First, show that u ∈ A → u ∈ B, and second, show that u ∈ B → u ∈ A. One way to prove the implication p → q is to use what is called the direct method . Recall that p → q is false only when p is true and q is false, so we need to be concerned only with this case. We must show that if p is true, then q must be true, also. The basic outline of the direct method is the following: Problem: Direct Method: Prove p → q. (a) Assume p is true. (b) Show that q is true. Usually, the fact that q is true will not follow immediately from the assumption that p is true; we must use a form of argument called syllogistic reasoning. Suppose the assumption that p is true implies that some statement r is true, and this fact in turn implies that q is true. It then follows that p → q is true, the form of the argument being the basic syllogism: (p → r) ∧ (r → q) → (p → q) It is easy to verify that the syllogism is a tautology; see Exercise 4. Normally, a direct proof will use a more general form of syllogism as follows: (p → s1 ) ∧ (s1 → s2 ) ∧ · · · ∧ (sn−1 → sn ) ∧ (sn → q) → (p → q) That is, the assumption that p is true will imply that some statement s1 holds, which in turn will imply that some statement s2 holds, and so on, until finally we will have shown that some statement sn holds, and this will imply that q holds and we’ll be done. Symbolically, such a direct proof has the following layout: p → s1 → s2 .. . → sn−1 → sn →q 40 Chapter 1 Logic and Sets Proof of Theorem 1.5: We prove here parts 2(b), 3(a), and 5(b). You are asked to prove the remaining parts in Exercise 2. For part 2(b), let u be an arbitrary element (of U). Following the above outline, we first need to prove (directly) the implication u ∈ (X ∩ Y ) ∩ Z → u ∈ X ∩ (Y ∩ Z) So, assume u ∈ (X ∩ Y ) ∩ Z. Then u ∈ X ∩ Y and u ∈ Z. Since u ∈ X ∩ Y , we have that both u ∈ X and u ∈ Y . Now, since u ∈ Y and u ∈ Z, we have that u ∈ Y ∩ Z. Finally then, since u ∈ X and u ∈ Y ∩ Z, we obtain that u ∈ X ∩ (Y ∩ Z), as was to be shown. The symbolic form of the preceding argument is the following: u ∈ (X ∩ Y ) ∩ Z → (u ∈ X ∩ Y ) and u ∈ Z → (u ∈ X and u ∈ Y ) and u ∈ Z → u ∈ X and (u ∈ Y and u ∈ Z) → u ∈ X and u ∈ Y ∩ Z → u ∈ X ∩ (Y ∩ Z) Note how the associative property of the logical connective and is used in the argument. The fact that the associative property of and is used in proving the associative property of the intersection operation is no accident! In fact, you should compare Theorem 1.5 with the list of properties for the logical connectives given in Section 1.3. Secondly, we need to prove the implication u ∈ X ∩ (Y ∩ Z) → u ∈ (X ∩ Y ) ∩ Z Here we give the argument in symbolic form only: u ∈ X ∩ (Y ∩ Z) → u ∈ X and u ∈ Y ∩ Z →u∈X → (u ∈ X → (u ∈ X → u ∈ (X and (u ∈ Y and u ∈ Z) and u ∈ Y ) and u ∈ Z ∩ Y ) and u ∈ Z ∩Y)∩Z Therefore, we have completed the proof that (X ∩ Y ) ∩ Z = X ∩ (Y ∩ Z). A comment on the preceding proof. Note that the steps used to prove the implication u ∈ (X ∩ Y ) ∩ Z → u ∈ X ∩ (Y ∩ Z) are just the reverse of those used to prove u ∈ X ∩ (Y ∩ Z) → u ∈ (X ∩ Y ) ∩ Z When this happens, we can simplify the proof by using a single string of biconditionals, as follows: u ∈ (X ∩ Y ) ∩ Z ↔ (u ∈ X ∩ Y ) and u ∈ Z ↔ (u ∈ X and u ∈ Y ) and u ∈ Z ↔ u ∈ X and (u ∈ Y and u ∈ Z) ↔ u ∈ X and u ∈ Y ∩ Z ↔ u ∈ X ∩ (Y ∩ Z) 41 1.5 Operations on Sets In general, to prove the biconditional p ↔ q, we can either prove separately both p → q and q → p, or we can use a string of biconditionals as follows: p ↔ s1 ↔ s2 .. . ↔ sn−1 ↔ sn ↔q Such an argument is based on the fact that the following formula is a tautology (See Exercise 6): (p ↔ r) ∧ (r ↔ q) → (p ↔ q) On to the proof of part 3(a). We have, for an arbitrary u ∈ U, u ∈ X ∪ (Y ∩ Z) ↔ u ∈ X or u ∈ Y ∩ Z ↔ u ∈ X or (u ∈ Y and u ∈ Z) ↔ (u ∈ X or u ∈ Y ) and (u ∈ X or u ∈ Z) ↔ (u ∈ X ∪ Y ) and (u ∈ X ∪ Z) ↔ u ∈ (X ∪ Y ) ∩ (X ∪ Z) Therefore, X ∪ (Y ∩ Z) = (X ∪ Y ) ∩ (X ∪ Z). (Note how the distributive property p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r) is used in the preceding argument.) Finally, for the proof of 5(b) we have, for an arbitrary u ∈ U, u ∈X ∩Y ↔u ∈ / X ∩Y ↔u ∈X ∩Y ↔ u ∈ X and u ∈ Y ↔ u ∈ X or u ∈ Y ↔u∈ / X or u ∈ /Y ↔ u ∈ X or u ∈ Y ↔u ∈X ∪Y Therefore, X ∩ Y = X ∪ Y . argument.) (Note how DeMorgan’s law p ∧ q ≡ p ∨ q is used in the preceding Another way to express DeMorgan’s law Y ∩ Z = Y ∪ Z is U − (Y ∩ Z) = (U − Y ) ∪ (U − Z) Given subsets X, Y , and Z of U, the above expression can be generalized by considering those elements of X that are not in Y ∩ Z, namely, X − (Y ∩ Z). A similar expression arises from considering X − (Y ∪ Z). The resulting properties are called the generalized DeMorgan laws. 42 Chapter 1 Logic and Sets Theorem 1.6 (Generalized DeMorgan Laws): The following two properties hold for any subsets X, Y , and Z of a universal set U. 1. X − (Y ∪ Z) = (X − Y ) ∩ (X − Z) 2. X − (Y ∩ Z) = (X − Y ) ∪ (X − Z) Proof: We prove part 1 here. You are asked to prove part 2 in Exercise 8. For an arbitrary u ∈ U, u ∈ X − (Y ∪ Z) ↔ u ∈ X and u ∈ / Y ∪Z ↔ u ∈ X and u ∈ Y ∪ Z ↔ u ∈ X and u ∈ Y or u ∈ Z ↔ u ∈ X and (u ∈ / Y and u ∈ / Z) ↔ (u ∈ X and u ∈ X) and (u ∈ / Y and u ∈ / Z) ↔ (u ∈ X and u ∈ / Y ) and (u ∈ X and u ∈ / Z) ↔ u ∈ X − Y and u ∈ X − Z ↔ u ∈ (X − Y ) ∩ (X − Z) Therefore, X − (Y ∪ Z) = (X − Y ) ∩ (X − Z). In the preceding statements of definitions and theorems we have exercised care by using qualifying phrases such as, “Let X, Y , and Z be subsets of a universal set U.” Henceforth, unless the situation demands it, we will omit explicit reference to U and implicitly assume that all sets in a given discussion are subsets of some universal set. Thus, for example, in place of the above phrase, we will write, “Let X, Y , and Z be any sets.” The order in which the elements of a set are listed is of no importance in the definition of a set; for example, it is clear that {1, 2} = {2, 1}. Thus, it really makes no sense to speak of the “first element” of a set. In many cases, however, it is important to distinguish the order of appearance of two elements. This leads to the notion of an ordered pair of two elements x and y, written (x, y), where x is the first element and y is the second element. In a formal treatment of set theory, the ordered pair (x, y) is defined as the set {{x}, {x, y}} so that (x, y) is in fact a set in which x and y play different roles. It then turns out that (x1 , y1 ) = (x2 , y2 ) if and only if both x1 = x2 and y1 = y2 . We will not to dwell on the formal definition of ordered pairs; instead, we rely on your intuition and past experience using this concept. Definition 1.14: Given two sets X and Y , the Cartesian product (or simply product) of X with Y is the set X × Y defined by X × Y = {(x, y) | x ∈ X and y ∈ Y } 43 1.5 Operations on Sets Example 1.21: Given X = {0, 1, 2} and Y = {1, 3}, find X × Y and Y × X. Solution: Using Definition 1.14, we find that X × Y = {(0, 1), (0, 3), (1, 1), (1, 3), (2, 1), (2, 3)} and Y × X = {(1, 0), (1, 1), (1, 2), (3, 0), (3, 1), (3, 2)} Note that X × Y 6= Y × X, although both sets have cardinality 6. We see in Example 1.21 that the product operation does not obey a commutative law. The next theorem presents several distributive laws that are satisfied when the product operation is combined with the operations of union, intersection, and difference. Theorem 1.7: For any sets X, Y , and Z, the following properties are satisfied. 1. X × (Y ∪ Z) = (X × Y ) ∪ (X × Z) 2. X × (Y ∩ Z) = (X × Y ) ∩ (X × Z) 3. X × (Y − Z) = (X × Y ) − (X × Z) Proof: We prove property 1. You are asked to prove properties 2 and 3 in Exercise 10. For any u and v, (u, v) ∈ X × (Y ∪ Z) ↔ u ∈ X and v ∈ Y ∪ Z ↔ u ∈ X and (v ∈ Y or v ∈ Z) ↔ (u ∈ X and v ∈ Y ) or (u ∈ X and v ∈ Z) ↔ (u, v) ∈ X × Y or (u, v) ∈ X × Z ↔ (u, v) ∈ (X × Y ) ∪ (X × Z) Therefore, X × (Y ∪ Z) = (X × Y ) ∪ (X × Z). The idea of an ordered pair can be extended to more than two elements. Given k elements x1 , x2 , . . . , xk , k ≥ 2, we define the ordered k-tuple (x1 , x2 , . . . , xk ), in which x1 is the first element (or first coordinate), x2 is the second element, and so on, and xk is the k th element. It is then possible to generalize the definition of the product operation. Definition 1.15: Given any k sets X1 , X2 , . . . , Xk , k ≥ 2, their (k-fold) product is the set X1 × X2 × · · · × Xk defined by X1 × X2 × · · · × Xk = {(x1 , x2 , . . . , xk ) | xi ∈ Xi for each i, 1 ≤ i ≤ k} 44 Chapter 1 Logic and Sets We remark that (x1 , x2 , . . . , xk ) = (y1 , y2 , . . . , yk ) if and only if xi = yi for each i, 1 ≤ i ≤ k. Example 1.22: Let B = {0, 1}. Then B × B × B = {(0, 0, 0), (0, 0, 1), (0, 1, 0), (0, 1, 1), (1, 0, 0), (1, 0, 1), (1, 1, 0), (1, 1, 1)} In Example 1.22, if we think of B as the set of binary digits, then B × B × B can be thought of as the set of binary strings (or words) of length three. In general, an alphabet is a nonempty set of characters, for example, the ASCII character set or the set {0, 1} of binary digits. Given an alphabet A, a string over A is any finite sequence (x1 , x2, . . . , xn ) of characters from A. We usually denote the string (x1 , x2, . . . , xn ) by “x1 x2 · · · xn ” or, more simply, by x1 x2 · · · xn when there is no confusion. The length of a string is the number of characters it contains, so that the string x1 x2 · · · xn has length n. There is a unique string of length 0, the empty string, and it is denoted by . Definition 1.16: Two sets X and Y are called disjoint provided X ∩ Y = ∅. Example 1.23: Let A = {1, 2, 3}, B = {2, 3, 5}, and C = {0, 4}. Then A and B are not disjoint, but A and C are disjoint, as are B and C. Note that, whereas the sets A and B in Example 1.23 are not disjoint, A − B = {1} and A ∩ B = {2, 3} are disjoint and A = (A − B) ∪ (A ∩ B). This relation holds in general and turns out to be quite useful. It is stated as Theorem 1.8, with the proof left to Exercise 12. Theorem 1.8: For any sets X and Y , the sets X − Y and X ∩ Y are disjoint and X = (X − Y ) ∪ (X ∩ Y ) It is sometimes helpful to picture sets using what are called Venn diagrams. Figure 1.1(a) shows a Venn diagram for two general sets X and Y . The universal set is thought of as the set of points inside the rectangle, X is the set of points in the leftmost disk, and Y is the set of points in the rightmost disk. We can use a Venn diagram to give an indication of a result such as that of Theorem 1.8. Figure 1.1(b) also shows a Venn diagram for two sets X and Y ; here, the sets X − Y , X ∩ Y , and Y − X have been shaded in different ways. We can see that the shaded parts of the diagram corresponding to the sets X − Y and X ∩ Y are disjoint and together make up all of X. It should be emphasized that such a diagram does not constitute a proof; rather, it is merely an indication that the result holds. 45 1.5 Operations on Sets (a) (b) Figure 1.1 Venn diagrams 46 Chapter 1 Logic and Sets Exercise Set 1.5 1. Determine which of the following assertions are true and which are false. (a) ∅ ∈ ∅ (c) {1, 2} = {2, 1} (e) ∅ ⊂ {∅} (g) {1} ⊂ {1, 2} (b) 1 ∈ {1} (d) ∅ = {∅} (f) 1 ⊆ {1} (h) ∅ ∈ {∅} 2. Prove the remaining parts of Theorem 1.5: (a) parts 1(a) and (b) (c) part 3(b) (e) part 5(a) (g) part 7 (b) part 2(a) (d) part 4 (f) parts 6(a) and (b) (h) parts 8(a), (b), (c), and (d) 3. Find the power set of each of the following sets: (a) {x, y} (c) P({∅}) = {∅, {∅}} (e) {1, 2, 3} 4. Verify that the syllogism is a tautology. (b) {1, 2} (d) {x, y, z} (f) {∅, {1}, {2, 3}} (p → r) ∧ (r → q) → (p → q) 5. Find each of these power sets. (a) P({a, b, c, d}) (b) P(P(P(P(∅)))) 6. Verify that the following formula is a tautology: (p ↔ r) ∧ (r ↔ q) → (p ↔ q) 7. Given that X is a finite set with cardinality n, what is the cardinality of P(X)? Use the results of Exercises 3 and 5 to make a conjecture. 8. Prove Theorem 1.6, part 2. 9. Given U = Z, A = 2Z, B = 3Z, and C = 4Z, find the following sets. (a) A ∩ B (c) A − C (e) C − A (g) (A ∪ B) ∩ C (b) B − A (d) A ∩ C (f) B ∪ C (h) (A ∪ B) − C 10. Prove the following parts of Theorem 1.7: (a) part 2 (b) part 3 11. Let A = {−1, 1}, B = {0, 1}, and C = {−1, 0, 1}. Find the following sets. (a) A × B (c) A × B × C (e) A × (B × C) (g) P(B × B) (b) B × C (d) (A × B) × C (f) B × B × B × B (h) P(B) × P(B) 47 1.5 Operations on Sets 12. Let X and Y be any two sets. (a) Prove that X ∩ Y ⊆ X. (b) Prove that X ⊆ X ∪ Y . (c) It follows from parts (a) and (b) and the result of Exercise 19 that X ∩ Y ⊆ X ∪ Y . Under what condition does X ∩ Y = X ∪ Y ? (d) Prove that X − Y = X ∩ Y . (e) Prove that X − Y and X ∩ Y are disjoint. (f) Prove that X = (X − Y ) ∪ (X ∩ Y ). Note the parts (e) and (f) prove Theorem 1.8. 13. Give examples of sets A, B, and C such that: (a) A ∈ B and B ∈ C and A ∈ /C (b) A ∈ B and B ∈ C and A ∈ C (c) A ∈ B and A ⊂ B 14. Symbolically, X = Y ↔ ∀u ∈ U, u ∈ X ↔ u ∈ Y Negate the formula on the right-hand side above to obtain a necessary and sufficient condition for X 6= Y . 15. Each of the following statements concerns arbitrary sets X and Y . Complete the statement to make it true. (a) X ⊆ Y ↔ X ∩ Y = (b) X ⊆ Y ↔ X ∪ Y = (c) X ⊆ Y ↔ X − Y = (d) X ⊂ Y ↔ (X − Y = (e) X ⊂ Y ↔ (X ∩ Y = (f) X − Y = Y − X ↔ and Y − X 6= and X ∩ Y 6= ) ) 16. Prove each of the following statements for arbitrary sets X, Y , and Z. (a) If Z ⊆ X and Z ⊆ Y , then Z ⊆ X ∩ Y . (b) If X ⊆ Z and Y ⊆ Z, then X ∪ Y ⊆ Z. 17. Let X and Y be arbitrary nonempty sets. (a) Under what condition does X × Y = Y × X ? (b) Under what condition is (X × Y ) ∩ (Y × X) empty? 18. Let X, Y , and Z be arbitrary sets. Prove: If Y ⊆ Z, then X × Y ⊆ X × Z. 19. For any sets X, Y , and Z, prove: If X ⊆ Y and Y ⊆ Z, then X ⊆ Z. 20. For arbitrary nonempty sets X1 , X2 , Y1 , and Y2 , prove: If X1 ⊆ X2 and Y1 ⊆ Y2 , then X1 × Y1 ⊆ X2 × Y2 . What about the converse of this result? 21. Let X1 , X2 , Y1 , and Y2 be any sets. Prove: If X1 ⊆ X2 and Y1 ⊆ Y2 , then: (a) X1 ∩ Y1 ⊆ X2 ∩ Y2 (b) X1 ∪ Y1 ⊆ X2 ∪ Y2 (c) X1 − Y2 ⊆ X2 − Y1 48 Chapter 1 Logic and Sets 22. Let X, Y , and Z be sets and consider the sets X × Y × Z and (X × Y ) × Z. Explain why, according to the definition of product, these two sets are not equal. (Although the sets (X × Y ) × Z, X × (Y × Z), and X × Y × Z are not formally equal, they are usually treated as being essentially the same.) 1.6 DIRECT AND INDIRECT PROOFS It may be said that the discipline of mathematics is uniquely characterized by the practice known as proof. To quote from The Mathematical Experience by Phillip Davis and Reuben Hersh: Mathematics, then, is the subject in which there are proofs. Traditionally, proof was first met in Euclid, and millions of hours have been spent in class after class, in country after country, in generation after generation, proving and reproving the theorems in Euclid. After the introduction of the “new math” in the mid-nineteen fifties, proof spread to other high school mathematics such as algebra, and subjects such as set theory were deliberately introduced so as to be a vehicle for the axiomatic method and proof. In college, a typical lecture in advanced mathematics, especially a lecture given by an instructor with “pure“ interests, consists entirely of definition, theorem, proof, definition, theorem, proof, in solemn and unrelieved concatenation. Why is this? If, as claimed, proof is validation and certification, then one might think that once a proof has been accepted by a competent group of scholars, the rest of the scholarly world would be glad to take their word for it and to go on. Why do mathematicians and their students find it worthwhile to prove again and yet again the Pythagorean theorem or the theorems of Lebesgue or Wiener or Kolmogoroff? Proof serves many purposes simultaneously. In being exposed to the scrutiny and judgment of a new audience, the proof is subject to a constant process of criticism and revalidation. Errors, ambiguities, and misunderstandings are cleared up by constant exposure. Proof is respectability. Proof is the seal of authority. Proof, in its best instances, increases understanding by revealing the heart of the matter. Proof suggests new mathematics. The novice who studies proofs gets closer to the creation of new mathematics. Proof is mathematical power, the electric voltage of the subject which vitalizes the static assertions of the theorems. Finally, proof is ritual, and a celebration of the power of pure reason. Such an exercise in reassurance may be very necessary in view of all the messes that clear thinking clearly gets us into. Any mathematical discussion begins, sometimes implicitly, with a set of basic assumptions, or axioms. A theorem is a true mathematical statement that follows logically from the axioms, and a proof is a logical argument that verifies the truth of the theorem. Writing clear and correct proofs involves an ability to think creatively, reason logically, and write intelligibly. In a sense it is an art, and to become good at it takes much practice. One of the purposes of this textbook is to help you become proficient at writing proofs. We hope to do this by providing examples of proofs, and also by providing you with many opportunities to test and improve your skills. Initially, however, it is important to understand the proofs given in this and other courses. And to understand a proof, it is necessary to understand the method of proof being used. In this section we discuss the two basic strategies of proof; these are the direct method and the indirect 49 1.6 Direct and Indirect Proofs method. Then, in the next section, an important method of proof known as mathematical induction is discussed. Since a proof is a logical argument, a proof is valid provided the logical form of the argument is a tautology. In the preceding section we learned about the direct method of proving a statement having the form of an implication p → q. Here, the hypothesis p is assumed to hold, and then syllogistic reasoning is used to show that the conclusion q must hold, also. Recall that such an argument has the form (p → s1 ) ∧ (s1 → s2 ) ∧ · · · ∧ (sn−1 → sn ) ∧ (sn → q) In order for a proof with this form to be correct, each step (implication) in the above “chain” of reasoning must be valid. Consider the second step s1 → s2 , for instance. That this step is valid might follow from a theorem that has already been established, or it might be that s2 is an axiom — a basic assumption of the subject at hand — and therefore something that is assumed to hold. Before moving on to consider indirect methods of proof, let’s review the basic outline of the direct method and give another example of its application. We recall that the formula p → q is false, by definition, only when the hypothesis p is true and the conclusion q is false. Thus, the problem of proving a statement whose form is p → q is reduced to showing that, if p is true, then q must also be true. So the basic outline of the direct method is the following: Problem: Direct Method: Prove p → q. (a) Assume p is true. (b) Show that q is true. Example 1.24: We give a direct proof that the following statement holds for any real number x: If x3 − 2x2 + x = 2, then x = 2. Proof: Assume x3 − 2x2 + x = 2. Then (by subtracting 2 from both sides) we obtain x3 − 2x2 + x − 2 = 0. Factoring the polynomial on the left-hand side then yields that (x2 + 1)(x − 2) = 0. Next, by dividing both sides by x2 + 1 (note that this is never zero!), it follows that 0 x−2 = 2 =0 x +1 Finally, adding 2 to both sides yields the desired result that x = 2. Symbolically, the proof looks like this: x3 − 2x2 + x = 2 → x3 − 2x2 + x − 2 = 0 → (x2 + 1)(x − 2) = 0 0 → x−2 = 2 x +1 → x−2 = 0 →x=2 Essentially, basic algebra was used in all five steps. The second step involved factoring and the third step involved dividing both sides of an equation by x2 + 1; this is a valid operation to perform because x2 + 1 cannot be zero. 50 Chapter 1 Logic and Sets The general form of the statement proved in the preceding example is ∀x ∈ S, p(x) → q(x) In the example, S = R, p(x) is the statement x3 − 2x2 + x = 2, and q(x) is the statement x = 2. Suppose you want to prove that a statement with the same general form is false. For example, consider the statement ∀k ∈ Z+ , k is prime → 2k − 1 is prime To prove that such a statement is false, we must show that its negation is true. general form of the statement is negated: Recall how the ∀x ∈ S, p(x) → q(x) ≡ ∃x ∈ S 3 p(x) → q(x) ≡ ∃x ∈ S 3 p(x) ∧ q(x) Thus, to show that the given statement is false, it must be shown that the following statement is true: ∃k ∈ Z+ 3 k is prime ∧ 2k − 1 is not prime To show this, it suffices to show the existence of a single positive integer k0 such that k0 is prime and 2k0 − 1 is not prime. Such an integer k0 is called a counterexample to the assertion ∀k ∈ Z+ , k is prime → 2k − 1 is prime Do you know of a counterexample to the above assertion? You may have seen it already. Look back at Exercise 12 of Exercise Set 1.1; you will find that k0 = 11 works. In fact, 211 − 1 = 2047 = 23 · 89. In general, to disprove a statement with the logical form ∀x ∈ S, p(x) we must prove its negation ∃x ∈ S 3 p(x) To do this, it suffices to exhibit a single value x0 ∈ S such that p(x0 ) is true (and hence such that p(x0 ) is false); such an x0 is called a counterexample to the assertion ∀x ∈ S, p(x) There are two methods of proof that we refer to as indirect methods. The first indirect method is called proof by contrapositive. The second is called proof by contradiction, and in logic is also known by its Latin name “reductio ad absurdum,” meaning, “reduction to an absurdity.” The method of proof by contrapositive is actually quite easy to understand. It is used to prove a statement with the form of an implication p → q. Recall that such an implication is logically equivalent to its contrapositive q → p. Thus, to prove p → q indirectly, we can give a direct proof of its contrapositive q → p. We summarize this method as follows: Problem: Method of Proof by Contrapositive: Prove p → q. (a) Identify the contrapositive q → p of the given statement. (b) Use a direct proof to show that q implies p. (Namely, assume q is true and show that p is true.) 51 1.6 Direct and Indirect Proofs Example 1.25: We wish to prove that the following implication holds for any integer m: If m2 is even, then m is even. 2 2 If we try to prove this directly, we √ run into difficulty right away. For, if√m is even, then m = 2q for some integer q, and so m = 2q; however, it’s not at all clear that 2q is a whole number, let alone an even one! So let’s try a proof by contrapositive. The contrapositive of the given implication is the following statement: If m is odd, then m2 is odd. Recall that an integer m is odd provided m = 2q + 1 for some integer q. Thus, we can give the proof of the preceding statement in symbolic form as follows: m ∈ 1 + 2Z → m = 1 + 2q 2 2 → m = (1 + 2q) for some q ∈ Z → m2 = 1 + 4q + 4q 2 → m2 = 1 + 2(2q + 2q 2 ) → m2 ∈ 1 + 2Z since 2q + 2q 2 ∈ Z This completes the proof of the contrapositive of the given implication, and hence the given implication is true. In view of Example 1.25 it should be remarked that, whenever a theorem of the form ∀x ∈ S, p(x) → q(x) has been established, one automatically obtains (by contrapositive) the corresponding result ∀x ∈ S, q(x) → p(x) Generally, in a mathematics textbook or course, only one of these two results will be explicitly stated. Thus, we suggest you develop the habit of explicitly writing down the other one. Example 1.26: Let’s return to the (contrapositive of the) result of Exercise 6(c) of Exercise Set 1.1. We wish to prove that the following implication holds for any positive integer k > 1: If 2k − 1 is prime, then k is prime. Solution: At first (and second) glance, you will be hard put to come up with an idea for proving this directly. So let’s proceed with a proof by contrapositive. The contrapositive of the given implication is given by: If k is not prime, then 2k − 1 is not prime. or, equivalently, If k is composite, then 2k − 1 is composite. 52 Chapter 1 Logic and Sets If k is composite, then we have that k = ab for some integers a and b with 1 < a ≤ b < k. Hence, 2k − 1 = 2ab − 1. Then, by the result of Exercise 6(b) of Exercise Set 1.1, we have that 2ab − 1 = (2a − 1)(2a(b−1) + 2a(b−2) + · · · + 2a + 1) Note that both 2a − 1 > 1 and 2a(b−1) + 2a(b−2) + · · · + 2a + 1 > 1. Thus, 2k − 1 is composite. To motivate our next example, we need to recall a couple of well-known properties of the real numbers; these are the cancellation laws. The cancellation law of addition states the following: For any real numbers x and y, if x + z = y + z for some real number z, then x = y. One thinks of “canceling” z from both sides of the relation x + z = y + z to obtain x = y. Similarly, the cancellation law of multiplication states that, for any real numbers x and y, if xz = yz for some nonzero real number z, then x = y. Symbolically, these two properties are stated as follows (where it is assumed that x, y, and z are real numbers): ∀x, y, ∃z 3 x + z = y + z → x = y ∀x, y, ∃z 3 z 6= 0 ∧ xz = yz → x = y Now let’s move from the realm of real numbers to the realm of sets (where all sets under discussion are assumed to be subsets of some specified universal set), with the operations of addition and multiplication replaced by the operations of union and intersection, respectively. What statement corresponds to the cancellation law of addition? Well, this would be the following statement: For any sets X and Y, if X ∪ Z = Y ∪ Z for some set Z, then X = Y. In symbolic form this would be: ∀X, Y, ∃Z 3 X ∪ Z = Y ∪ Z → X = Y and its negation would be ∃X, Y 3 ∃Z 3 X ∪ Z = Y ∪ Z ∧ X 6= Y Hence, for a counterexample to such a “law,” we need only exhibit a pair of unequal sets X and Y and a third set Z such that X ∪ Z = Y ∪ Z. Such examples are easy to construct. For instance, take any sets X and Y with X 6= Y and let Z be any set for which both X ⊆ Z and Y ⊆ Z. Then X ∪ Z = Z = Y ∪ Z. Similarly, it can be shown that a so-called “cancellation law of intersection:” ∀X, Y, Z 3 Z 6= ∅ and X ∩ Z = Y ∩ Z → X = Y also fails to hold; see Exercise 10. In light of the above discussion, and yet still desiring to find some analog of the cancellation laws for sets, we might try to make the hypothesis stronger. A natural thing to try might be the following statement: For any sets X and Y , if both X ∪ Z = Y ∪ Z and X ∩ Z = Y ∩ Z for some set Z, then X = Y. 53 1.6 Direct and Indirect Proofs Example 1.27: Use the method of proof by contrapositive to prove that the following implication holds for any sets X and Y : If both X ∪ Z = Y ∪ Z and X ∩ Z = Y ∩ Z for some set Z, then X = Y. Solution: The contrapositive of the given implication is the following: If X 6= Y , then, for any set Z, either X ∪ Z 6= Y ∪ Z or X ∩ Z 6= Y ∩ Z. Assume X 6= Y . Then we may assume, without loss of generality, that there is an element x ∈ X − Y , namely, there is an element x such that x ∈ X and x ∈ / Y. (Since X 6= Y , either X − Y or Y − X is nonempty, and because the given statement is symmetric in X and Y (interchanging X and Y in the statement results in exactly the same statement), the argument in the latter case is analogous to that in the former.) Let Z be any set; we now consider two cases depending on whether x ∈ Z or x ∈ / Z. Case 1 : x ∈ Z. Then (since x ∈ X and x ∈ / Y ) we have x ∈ X ∩ Z and x ∈ / Y ∩ Z. Hence, X ∩ Z 6= Y ∩ Z in this case. Case 2 : x ∈ / Z. Then we have x ∈ X ∪ Z and x ∈ / Y ∪ Z. Hence, X ∪ Z 6= Y ∪ Z in this case. This shows that either X ∪ Z 6= Y ∪ Z or X ∩ Z 6= Y ∩ Z, and so the proof is complete. The method of proof by contradiction has a more complicated logical form than either the direct method or the method of proof by contrapositive. It is based on the law of the excluded middle. Recall from Section 1.3 that this law states that r ∧r is a contradiction for any statement r. Suppose we wish to prove some statement t, that is, to show t is true. To do this by the method of proof by contradiction, we suppose that t is false, and then argue to a contradiction r ∧ r for some statement r. If the argument is valid (a syllogism, for example) then it can be concluded that t → (r ∧ r) is true. But, since r ∧ r is false, the only way this implication can be true is for t to be false. Thus, t is true, as we wished to prove. We summarize the method of proof by contradiction as follows: Problem: Method of Proof by Contradiction: Prove t. (a) Suppose, to the contrary, that t is false. (b) Argue to a contradiction r ∧ r for some statement r. We remark that the contradiction obtained is often a statement r, where r is an axiom (and thus true by assumption) or some theorem that has been established previously. √ √ In the opening section it was stated that √2, 3 5, √and π are irrational numbers. The proof that π is irrational is somewhat advanced, but 2 and 3 5 can easily be proved irrational, and such proofs provide nice examples of proofs by contradiction. Actually, the discovery of irrational numbers has an interesting history. As a young man, the Greek mathematician Pythagoras (circa 550 B.C.) ventured to the seaport of Cratona, in what is now southern Italy, and there founded his famous school of philosophy, mathematics, and natural science. The Pythagoreans were primarily interested in the study of numbers, and it is to them 54 Chapter 1 Logic and Sets that we credit the discovery of irrational numbers. This discovery must have come as quite a shock and surprise to the Pythagoreans, for much of their mathematics had been based on the assumption that any number is rational — that it can be expressed as the ratio of two integers. In fact, many historians of mathematics regard the discovery of irrational numbers as an extremely important event, for it showed the danger of relying solely on empirical evidence, and it showed the power of the deductive method to set matters straight. √ √ In the next example we give a proof that 2 is irrational. Note that 2 is the length of the diagonal of a unit square, so it occurs quite naturally in the study of plane geometry. Example 1.28: Use the method of proof by contradiction to show that number. √ 2 is an irrational √ Solution: We proceed by contradiction and suppose, to the contrary, that 2 is rational. This √ would mean that 2 can be expressed as a fraction, namely, that there exist positive integers m and n such that √ m 2= n Of course, the representation of a rational number as a fraction is not unique; for √ example −2/(−5) = 2/5 = 4/10 = 40/100. However, among all such representations of 2 we may assume, without loss of generality, that we’ve chosen above the one with the smallest possible positive denominator, namely, that n is as small √ as possible. (One way to do this is to take any fraction with a positive denominator equal to 2 and simplify it by writing it in “lowest terms.”) Then we obtain the following string of implications: √ √ m 2= →n 2=m n → 2n2 = m2 → m2 is even → m is even √ So we have shown that, if 2 can be expressed as the fraction m/n, then the numerator m must be even. Thus, m = 2m1 for some positive integer m1 . We then obtain the following string of implications: √ √ m 2= and m = 2m1 → n 2 = 2m1 n → 2n2 = 4m21 → n2 = 2m21 → n2 is even → n is even √ Thus we have shown that, if 2 can be expressed as the fraction m/n, then the denominator n must be even. Hence, n = 2n1 for some positive integer n1 . But then we have √ m 2m1 m1 2= = = n 2n1 n1 √ and n1 < n, contradicting our assumption that 2 had been √ expressed as that fraction m/n whose denominator n was as small as possible. It follows that 2 is irrational. 55 1.6 Direct and Indirect Proofs The method of proof by contradiction is often applied to prove a statement with the form of an implication p → q. To obtain the outline for the method in this case, we simply replace t by p → q in the outline preceding Example 1.28. Problem: Method of Proof by Contradiction: Prove p → q. (a) Suppose, to the contrary, that p → q is false; that is, suppose p is true and q is false. (b) Argue to a contradiction r ∧ r for some statement r. Example 1.29: Use the method of proof by contradiction to prove that the following implication holds for any integer m: If m is odd, then m3 is odd. Solution: We proceed by contradiction and suppose, to the contrary, that m is odd and m3 is even. Then m = 1 + 2q for some integer q and m3 = 2k for some integer k. We then have the following string of implications: m3 = 2k → (1 + 2q)3 = 2k → 1 + 2q + 4q 2 + 8q 3 = 2k → 1 = 2k − (2q + 4q 2 + 8q 3 ) → 1 = 2(k − q − 2q 2 − 4q 3 ) → 1 is even which is clearly a contradiction. The result follows. In this section we have discussed three basic strategies for proving a mathematical statement of the form p → q: the direct method, proof by contrapositive, and proof by contradiction. It is often the case that more than one of the three methods will work. If one is faced with the problem of proving p → q and does not see which method to use, then it might be advisable to try a proof by contradiction first. The reason for this is that such a strategy provides the optimum starting assumption, in that both p and q are assumed to hold, whereas a direct proof would begin with only the assumption that p holds, and a proof by contrapositive would begin with only the assumption that q holds. However, having completed a proof by contradiction, the form of the proof should be considered carefully. Sometimes a proof by contradiction will turn out to have the following form: (p ∧ q) → s1 → s2 → · · · → sn → q Here it has been shown that q is true, contradicting the assumption that q is false. If the proof is correct, then a review of it will show that no use was made of the assumption that q is false. Hence, the proof is actually a direct proof in disguise, and can easily (and should) be rewritten as such. Similarly, sometimes a review of a (correct) proof by contradiction will reveal that it has the following form: (p ∧ q) → s1 → s2 → · · · → sn → p 56 Chapter 1 Logic and Sets Here it has been shown that p is false, contradicting the assumption that p is true. In this case it will turn out that the assumption that p is true was not used, and so the proof is actually a proof by contrapositive and should be rewritten as such. Example 1.30: We prove that the following statement holds for any composite positive integer n: If n is a three-digit number, then n has a prime factor less than or equal to 31. We make use of the following result that is proved later in the text: Any positive integer greater than 1 has a prime factor. Solution: Let n be a composite positive integer. To prove the given result, we proceed by contradiction, supposing that n has three digits (namely, 100 ≤ n ≤ 999) and n has no prime factor less than or equal to 31. Since n is composite, n = ab, where 1 < a ≤ b < n. Let p be any prime factor of a and let q be any prime factor of b. Then both p and q are prime factors of n, and hence p ≥ 37 and q ≥ 37 (since n is assumed to have no prime factor less than or equal to 31, and 37 is the next prime after 31). But then we have n = ab ≥ pq ≥ 37 · 37 = 1369 This states that n is at least a four-digit number, contradicting our assumption that n is a three-digit number. Therefore, the supposition that n has no prime factor less than or equal to 31 leads to a contradiction, and so the given result is established. Discussion: We note that the preceding proof has the logical form (p ∧ q) → · · · → p Hence the proof may be rewritten as a proof by contrapositive as follows. Let n be a composite positive integer. Assume n has no prime factor less than or equal to 31. Since n is composite, n = ab, where 1 < a ≤ b < n. Let p be any prime factor of a and let q be any prime factor of b. Then both p and q are prime factors of n, and hence p ≥ 37 and q ≥ 37. Thus, n = ab ≥ pq ≥ 37 · 37 = 1369 Therefore, n is not a three-digit number. What about the problem of proving a mathematical statement whose form is the biconditional p ↔ q? Recall that the biconditional is defined as the conjunction of two implications: p ↔ q ≡ (p → q) ∧ (q → p) Therefore, the problem of proving p ↔ q reduces to that of proving separately the implications p → q and q → p. Of course, each of these can be done either directly or indirectly. Alternatively, as mentioned in the preceding section, we can also prove p ↔ q by arguing through a string of biconditionals: (p ↔ s1 ) ∧ (s1 ↔ s2 ) ∧ · · · ∧ (sn−1 ↔ sn ) ∧ (sn ↔ q) 1.6 Direct and Indirect Proofs 57 Exercise Set 1.6 1. In this exercise, m denotes an arbitrary integer. We say that m is a multiple of 3 provided m = 3q for some integer q. In other words, m is a multiple of 3 if and only if m ∈ 3Z. Note that every integer belongs to exactly one of the sets 3Z, 1 + 3Z, or 2 + 3Z. Thus, m is not a multiple of 3 if and only if m = r + 3q for some integer q and r = 1 or 2. (a) Express each of the sets 3Z, 1 + 3Z, and 2 + 3Z in the form {. . . , a, b, r, c, d, . . .}, where r = 0 or 1 or 2, and observe that Z = 3Z ∪ (1 + 3Z) ∪ (2 + 3Z). (b) Prove directly: If m is a multiple of 3, then m2 is a multiple of 3. (c) What is the contrapositive of the result in part (b)? (d) Prove directly: If m is not a multiple of 3, then m2 is not a multiple of 3. (e) What is the contrapositive of the result in part (d)? (f) Prove the result of part (e) by contradiction. √ / Q. (g) Use the method of proof by contradiction to prove that 3 ∈ 2. Again in this exercise, m denotes an arbitrary integer. Note that every integer belongs to exactly one of the sets 5Z, 1 + 5Z, 2 + 5Z, 3 + 5Z, or 4 + 5Z. (Express each of these sets in the form {. . . , a, b, c, r, d, e, f, . . .}, where r ∈ {0, 1, 2, 3, 4}.) We say that m is a multiple of 5 provided m = 5q for some integer q; thus, m is not a multiple of 5 if and only if m = r + 5q for some integer q and r ∈ {1, 2, 3, 4}. (a) Prove directly: If m is a multiple of 5, then m3 is a multiple of 5. (b) What is the contrapositive of the result in part (a)? (c) Prove directly: If m is not a multiple of 5, then m3 is not a multiple of 5. (d) What is the contrapositive of the result in part (c)? (e) Prove the result of part (d) by contradiction. √ (f) Use the method of proof by contradiction to prove that 3 5 ∈ / Q. 3. Let m denote an arbitrary integer. (a) Prove directly: If m is odd, then m4 is odd. (b) A corollary is a result that follows immediately from some other result. Derive the result of 4 part (a) as a corollary to the result of Example 1.25. (Hint: m√ = (m2 )2 .) (c) Use the method of proof by contradiction to prove that 4 2 ∈ / Q. 4. Let x denote an arbitrary real number. √ (a) Prove by contrapositive: If x is irrational, then x is irrational. (b) Obtain the result of Exercise 3, part (c) as a corollary to the result of part (a) of this exercise and to that of Example 1.28. Here’s a hint: q √ √ 4 2= 2 5. Give a counterexample to the following assertion: For any nonnegative integer n, the number n2 + n + 41 is prime. 6. Prove directly that the following implication holds for any real number x: If x3 − 5x2 + 3x = 15, then x = 5. 58 Chapter 1 Logic and Sets 7. Provide a counterexample to the following assertion: For any positive integer n, if n is an odd prime, then n2 + 4 is prime. 8. Use the method of proof by contradiction to prove the result of Exercise 6. (Hint: Derive that x2 = −3, contradicting the fact that x2 can’t be negative.) 9. Consider the following result concerning a real number x: If x3 − x2 + x = 1, then x = 1. (a) Give a direct proof of this result. (b) Prove the result by contrapositive. 10. Provide a counterexample (better yet, an infinite collection of counterexamples) to the so-called “cancellation law of intersection:” ∀X, Y, ∃Z 3 Z 6= ∅ and X ∩ Z = Y ∩ Z → X = Y 11. Prove or disprove each of the following statements concerning subsets X, Y , and Z of some universal set U. (If the statement is true, then prove it; if it is false, give a counterexample.) (a) ∀X, Y, Z, (X − Y ) − Z = X − (Y − Z) (b) ∀X, Y, Z, (X − Y ) − Z ⊆ X − (Y − Z) (c) ∀X, Y, Z, (X − Y ) − Z = (X − Z) − Y (d) ∀X, Y, Z, (X − Y ) − Z = (X − Z) − (Y − Z) 12. Prove or disprove each of the following statements about arbitrary sets X and Y . (a) If both X ∪ Z = Y ∪ Z and X − Z = Y − Z for some set Z, then X = Y . (b) If both X ∩ Z = Y ∩ Z and X − Z = Y − Z for some set Z, then X = Y . Exercises 13, 14, 15, and 16 concern (Euclidean) plane geometry. 13. Prove directly that the following implication holds for any triangle ABC: If the perpendicular from vertex A to side BC bisects BC, then triangle ABC is isosceles. (Hint: Let D be the point where the perpendicular from vertex A to side BC meets BC; argue that, by side-angle-side, triangles ADB and ADC are congruent.) 14. Give a direct proof that the following implication holds for any triangle ABC: If sides AB and AC have the same length, then angles ABC and ACB have the same measure. 15. Use the method of proof by contradiction to prove that the following implication holds for any two distinct lines α and β: If α and β intersect, then their intersection consists of exactly one point. (Hint: Derive a contradiction to the axiom which says that two distinct points determine a unique line; namely, given any two distinct points A and B, there is a unique line containing them both.) 16. Let α, β, and γ be three distinct lines. Use the method of proof by contradiction to prove the following result: If α is parallel to β and β is parallel to γ, then α is parallel to γ. (Hint: Derive a contradiction to the “fifth postulate” (axiom) which says that, given any line β and any point P not on β, there is a unique line α through P parallel to β.) 17. Prove that the only pair of positive integers (a, b) for which a + b = ab is (2, 2). 59 1.7 Mathematical Induction 1.7 MATHEMATICAL INDUCTION Consider the problem of finding a formula for the the sum Sn of the first n odd positive integers. Let’s compute Sn for the first several values of n and see if we notice a pattern: n = 1: S1 = 1 n = 2: S2 = 1 + 3 = 4 n = 3: S3 = 1 + 3 + 5 = 9 n = 4: S4 = 1 + 3 + 5 + 7 = 16 What do you conjecture for the value of Sn ? Here’s a hint: S1 = 1 = 12 S2 = 4 = 22 S3 = 9 = 32 S4 = 16 = 42 It seems reasonable to conjecture that, in general, Sn = n2 . Now that we have a conjecture, how should we go about proving it? The statement that we wish to prove is the following: For every positive integer n, the sum of the first n odd positive integers is n2 . or, equivalently, For every n ∈ Z+ , 1 + 3 + · · · + (2n − 1) = n2 . Note that the statement above falls into the following general category: For every n ∈ Z+ , P (n). That is, we want to prove that some propositional function P (n) is true for every positive integer n. This type of problem occurs very often in mathematics. Indeed, many examples of such situations are contained throughout this book, and you will encounter others in subsequent courses in the mathematical sciences. The most common proof technique used to handle such problems is called the mathematical induction, and is discussed in this section. Let P (n) be a statement about an arbitrary positive integer n. Suppose we can prove that the following two properties hold: 1. P (1) is true. 2. For any k ∈ Z+ , if P (k) is true, then P (k + 1) is true. How do these two properties help us prove that P (n) is true for every n ∈ Z+ ? Property 1 tells us that P (1) is true. Hence, property 2, applied with k = 1, states that P (2) is true. Then, since P (2) is true, we may apply property 2 again, this time with k = 2, to yield that P (3) is true. Since P (3) is true, P (4) is true, and so on. It seems reasonable to conclude that P (n) is true for every n ∈ Z+ . This is exactly what the principle of mathematical induction allows us to do. 60 Chapter 1 Logic and Sets Principle of Mathematical Induction: Let P (n) be a propositional function about an arbitrary positive integer n such that the following two properties are satisfied: 1. P (1) is true. 2. For any k ∈ Z+ , if P (k) is true, then P (k + 1) is true. Then P (n) is true for every positive integer n. Later in this section, we will state the principle of well-ordering. The principle of well-ordering and the principle of mathematical induction are logically equivalent. That is, either one follows as a consequence of the other. Hence, if we wanted to be completely rigorous we could, for example, accept the principle of well-ordering as an axiom and then prove the principle of mathematical induction as a theorem. To apply the principle of mathematical induction to prove that some statement P (n) is true for all n ∈ Z+ , it is common to divide the proof into two steps. The first step is to verify that P (1) is true. This step is commonly called the anchor step or basis step. Once it has been shown that P (1) holds, we say that the induction has been “anchored.” Next, we let k represent an arbitrary positive integer, and attempt to prove the implication P (k) → P (k + 1) This step is called the inductive step. Often, this implication is proved directly. Thus, the inductive step is often partitioned into two smaller steps: (1) Assume that P (k) holds; (2) Show that P (k + 1) holds. Specifically, the assumption that P (k) holds is called the induction hypothesis. It is crucial that we carefully and clearly identify the induction hypothesis. Sometimes, the implication P (k) → P (k + 1) is proved using a proof by contradiction; in this case, the inductive step will begin by assuming that P (k) is true but that P (k + 1) is false, and will then proceed to derive a contradiction. In any case, we summarize the induction technique as follows: Problem: Method of Proof by Mathematical Induction: Prove that P (n) is true for every n ∈ Z+ . 1. (Anchor Step) Show that P (1) is true. 2. (Induction Step) Show that the implication P (k) → P (k + 1) holds for every positive integer k as follows: (a) State the induction hypothesis; that is, let k represent an arbitrary positive integer and assume P (k) holds. (b) If using a direct proof, show that P (k + 1) holds. (c) If using a proof by contradiction, suppose that P (k + 1) is false and argue to a contradiction. Following the above outline, once it has been shown that P (k + 1) is true, it may then be concluded that P (n) is true for every positive integer n, by the principle of mathematical induction. We next consider several examples that illustrate the power and usefulness of mathematical induction as a proof technique. Example 1.31: Use mathematical induction to prove that the following formula P (n) holds for every n ∈ Z+ : n X n(n + 1)(4n + 5) i(2i + 1) = 6 i=1 61 1.7 Mathematical Induction Here the sigma notation is used to indicate a sum. In general, if a1 , a2 , . . . , an are any n numbers, then the notation n X ai i=1 denotes the sum a1 + a2 + · · · + an . Thus, in our example, n X i=1 i(2i + 1) = 1(3) + 2(5) + · · · + n(2n + 1) Solution: We proceed by induction on n. 1. (Anchor Step) Since 1(3) = 3 = 1(1 + 1)(4 + 5) 6 we see that P (1) is true. 2(a). (Induction Hypothesis) Let k represent an arbitrary positive integer and assume that P (k) holds; explicitly, the induction hypothesis is that k X i(2i + 1) = i=1 k(k + 1)(4k + 5) 6 (IH) (Notice that this is simply the statement one obtains by replacing n by k in the general formula P (n).) Writing this without the sigma notation, our induction hypothesis is that 1(3) + 2(5) + · · · + k(2k + 1) = k(k + 1)(4k + 5) 6 (IH) 2(b). Note that, if n = k + 1, then (k + 1) (k + 1) + 1 4(k + 1) + 5 n(n + 1)(4n + 5) (k + 1)(k + 2)(4k + 9) = = 6 6 6 Thus, to show that P (k + 1) holds, we must show that k+1 X i=1 i(2i + 1) = (k + 1)(k + 2)(4k + 9) 6 Writing this without the sigma notation, we must show that 1(3) + 2(5) + · · · + k(2k + 1) + (k + 1)(2k + 3) = (k + 1)(k + 2)(4k + 9) 6 Before proceeding to show that P (k + 1) is true, let us verify the implication P (k) → P (k + 1) for a specific value of k. This may help us understand the argument in the general case. Take k = 99, for example. If we assume that P (99) is true, can we somehow use this fact to show that P (100) is true? Well, P (99) is the statement that 1(3) + 2(5) + · · · + 99(199) = 99(100)(401) 6 (1) 62 Chapter 1 Logic and Sets Assume that the above identity holds. How can we use the fact that this holds to show that P (100) holds? Note that P (100) is the statement 1(3) + 2(5) + · · · + 99(199) + 100(201) = 100(101)(405) 6 (2) Comparing the left-hand sides of (1) and (2) above, we note that we can get the left-hand side of (2) by adding 100(201) to the left-hand side of (1). Thus, let’s begin with relation (1), which we are assuming is true, and let’s add 100(201) to both sides. Then, let’s simplify the resulting right-hand side, reducing it, hopefully, to the right-hand side of (2). Here goes: 1(3) + 2(5) + · · · + 99(199) + 100(201) = = = = = 99(100)(401) + 100(201) 6 99(100)(401) 6(100)(201) + 6 6 100 99(401) + 6(201) 6 100(40905) 6 100(101)(405) 6 by (1) Success! Now that we know how to prove the implication P (99) → P (100), let’s try a similar approach to prove the implication P (k) → P (k + 1) for an arbitrary, but fixed, positive integer k. Proceeding, let’s begin with relation (IH), which is assumed to hold, and let’s add (k + 1)(2k + 3) to both sides. Then, let’s simplify the resulting right-hand side to show that it equals the right-hand side of P (k + 1). Here goes: k(k + 1)(4k + 5) + (k + 1)(2k + 3) 6 k(k + 1)(4k + 5) 6(k + 1)(2k + 3) + = 6 6 (k + 1) k(4k + 5) + 6(2k + 3) = 6 (k + 1)(4k 2 + 17k + 18) = 6 1(3) + 2(5) + · · · + k(2k + 1) + (k + 1)(2k + 3) = = by IH (k + 1)(k + 2)(4k + 9) 6 This shows that P (k + 1) is true. Therefore, by the principle of mathematical induction, we may conclude that P (n) is true for every positive integer n. As already mentioned, the implication P (k) → P (k + 1) in an induction proof may be established using an indirect method. For example, if the method of proof by contradiction is used, then we assume P (k) and P (k + 1) (namely, we assume P (k) is true 63 1.7 Mathematical Induction and P (k + 1) is false) and attempt to derive a contradiction. This technique is illustrated in the next example. Example 1.32: Use mathematical induction to prove that the following inequality P (n) holds for every n ∈ Z+ : n X √ 1 √ ≤2 n−1 i i=1 Note that, written without the sigma notation, the left-hand side of the inequality P (n) is 1 1 1 √ + √ + ···+ √ n 1 2 Solution: We proceed by induction on n. 1. (Anchor Step) Since √ 1 √ = 1 ≤ 1 = 2( 1) − 1 1 we have that P (1) is true. 2(a). (Induction Hypothesis) Let k represent an arbitrary positive integer and assume P (k) holds; explicitly, the induction hypothesis is that √ 1 1 1 √ + √ +···+ √ ≤ 2 k −1 1 2 k (IH) 2(b). We must show that P (k + 1) holds, namely, that √ 1 1 1 1 √ + √ + ···+ √ + √ ≤ 2 k+1−1 1 2 k+1 k Again, before proceeding to prove the general implication P (k) → P (k + 1), let’s prove it in a special case; say, when k = 53. So, we will assume that P (53) holds, namely, that √ 1 1 1 √ + √ + · · · + √ ≤ 2 53 − 1 1 2 53 we want to verify that P (54) holds, namely, that √ 1 1 1 1 √ + √ + · · · + √ + √ ≤ 2 54 − 1 1 2 53 54 To do this, we will proceed by contradiction, supposing to the contrary that P (54) is false: √ 1 1 1 1 √ + √ + · · · + √ + √ > 2 54 − 1 1 2 53 54 It then follows that √ √ 1 1 1 1 1 1 1 √ + √ +···+ √ + √ − √ + √ +···+ √ > 2 54 − 1 − 2 53 − 1 1 2 53 54 1 2 53 64 Chapter 1 Logic and Sets or, equivalently, that Multiplying both sides by √ √ √ 1 √ > 2 54 − 2 53 54 54, we see that the above inequality holds if and only if p 1 > 2 54 − 53(54) which, in turn, is equivalent to 2 Squaring both sides then yields p 53(54) > 107 4(53)(54) > 1072 However, this is false, since 4(53)(54) = 11448, whereas 1072 = 11449. Thus, we have obtained a contradiction, and we may therefore conclude that P (54) is true. Likewise, to handle the inductive step in the general case, we proceed by contradiction, supposing that P (k + 1) is false, namely, that √ 1 1 1 1 √ + √ + ···+ √ + √ > 2 k+1−1 k+1 1 2 k Using the induction hypothesis (IH), it follows that √ √ √ 1 > 2 k+1−2 k k+1 (To obtain this last inequality, note that P (k) has the form A ≤ B and P (k + 1) has the form C > D. It follows that C − A > D − B.) We then proceed as follows: √ √ √ √ √ 1 k+1 √ √ √ > 2 k+1−2 k → > k+1 2 k +1−2 k k+1 k+1 p → 1 > 2(k + 1) − 2 k(k + 1) p → 2 k(k + 1) > 2k + 1 → 4k(k + 1) > (2k + 1)2 → 4k 2 + 4k > 4k 2 + 4k + 1 →0>1 This is a contradiction. Thus, P (k + 1) must be true. Therefore, P (n) is true for every positive integer n by the principle of mathematical induction. Example 1.33: Use mathematical induction to prove that the following assertion holds for every n ∈ Z+ : 21 | (4n+1 + 52n−1) Here, the symbol “|” means “divides (evenly)” or “is a factor of.” For integers a and b, we say that a is a factor of b provided there is an integer q such that b = aq. For example, 21 is a factor of 63, since 63 = 21(3). 65 1.7 Mathematical Induction Solution: We proceed by induction on n, letting P (n) denote the assertion that 21 | (4n+1 + 52n−1) 1. (Anchor Step) Since 41+1 + 52(1)−1 = 42 + 51 = 16 + 5 = 21, and 21 is a factor of 21, we have that P (1) holds. 2(a). (Induction Hypothesis) Let k denote an arbitrary positive integer and assume that P (k) holds; explicitly, the induction hypothesis is that 21 | (4k+1 + 52k−1) (IH) Remember what this statement means — it means that there is a positive integer q such that 4k+1 + 52k−1 = 21q. 2(b). To show that P (k + 1) holds, we must show that 21 | (4(k+1)+1 + 52(k+1)−1), that is, that 21 | (4k+2 + 52k+1 ) Comparing this to (IH), note that 4k+2 = 41 · 4k+1 = 4(4k+1 ) and 52k+1 = 52 · 52k−1 = 25(52k−1) Thus, we proceed as follows: 4k+2 + 52k+1 = 4(4k+1 ) + 25(52k−1) = 4(4k+1 ) + 4(52k−1) + 21(52k−1) = 4 4k+1 + 52k−1 + 21(52k−1) = 4(21q) + 21(52k−1) by IH = 21(4q + 52k−1) This shows that 21 is a factor of 4k+2 + 52k+1 , and hence that P (k + 1) holds. Therefore, by the principle of mathematical induction, P (n) is true for every positive integer n. Sometimes we want to prove that an assertion P (n) is true for all integers n ≥ n0 , where n0 is some given fixed integer. For instance, we may wish to prove n2 ≤ 2n for every integer n ≥ 4. (Note that this inequality fails for n = 3.) In such cases, the following corollary to the principle of mathematical induction provides the necessary proof technique; you are asked to prove this corollary in Exercise 6. Corollary 1.9: Let n0 be a fixed integer and let P (n) be a statement satisfying the following two properties: 1. P (n0 ) is true. 2. For any k ≥ n0 , if P (k) is true, then P (k + 1) is true. Then P (n) is true for every n ≥ n0 . Example 1.34: Use Corollary 1.9 to prove that the inequality n2 ≤ 2 n holds for every integer n ≥ 4. 66 Chapter 1 Logic and Sets Solution: We proceed by induction on n. For n ≥ 4, let P (n) represent the inequality n2 ≤ 2n . 1. (Anchor Step) Since 42 = 16 ≤ 16 = 24 , it follows that P (4) holds. 2(a). (Induction Hypothesis) Let k be an arbitrary integer, k ≥ 4, and assume P (k) holds. Explicitly, the induction hypothesis is that k 2 ≤ 2k 2(b). To complete the proof, we must show P (k + 1) holds, namely, that (k + 1)2 ≤ 2k+1 We proceed as follows: (k + 1)2 = k 2 + 2k + 1 ≤ k 2 + k 2 = 2k 2 ≤ 2(2k ) = 2k+1 (Note that the above uses the inequality 2k + 1 ≤ k 2 , which holds for k ≥ 3; this can be verified by simple algebra.) Thus, it follows by Corollary 1.9 that P (n) is true for every n ≥ 4. To get to our next application, we define a sequence of numbers attributed to Leonardo of Pisa, who was more commonly known as Fibonacci. Fibonacci was born in the 12th century and his mathematical work continued well into the 13th century. The sequence that bears his name, the Fibonacci sequence, comes from a problem that Fibonacci gave in his book, the Liber Abaci : A man put one pair of rabbits in a certain place entirely surrounded by a wall. How many pairs of rabbits can be produced from that pair in a year, if the nature of these rabbits is such that every month each pair bears a new pair which from the second month on becomes productive? We leave this specific problem as an exercise. For now, we want to define the Fibonacci sequence and consider some associated problems. For a given nonnegative integer n, define the n th number, F (n), in the Fibonacci sequence as follows: F (0) = 1, F (1) = 1, F (2) = 2, F (3) = 3, F (4) = 5, F (5) = 8, F (6) = 13, ... In looking at the above sequence of terms, you should notice a pattern, that is, how a given term after F (1) is obtained from the preceding terms. In fact, you should be able to determine F (7). The relation you should observe is that, for each n ≥ 2, F (n) = F (n − 2) + F (n − 1) in words, that a given term is the sum of the preceding two terms. In fact, the sequence is completely determined by the following two properties: 1. F (0) = F (1) = 1; 2. F (n) = F (n − 2) + F (n − 1), n ≥ 2 Given just these two properties, can one determine the value of F (n) for any specific value of n? We see that the values F (0) = 1 and F (1) = 1 are given explicitly by property 1. Moreover, the 67 1.7 Mathematical Induction relation in property 2 can be used to compute F (n) for any n ≥ 2. For example, suppose we want to know F (4). We proceed as follows: F (2) = F (0) + F (1) = 1 + 1 = 2 F (3) = F (1) + F (2) = 1 + 2 = 3 F (4) = F (2) + F (3) = 2 + 3 = 5 Thus, F (4) = 5. The function F is an example of a recursively-defined function. Property 1 gives the initial values of F , and property 2 gives the recurrence relation for F . We will encounter other examples of recursively-defined functions in later chapters. Definition 1.17: A function f with domain the set {0, 1, 2, 3, . . .} of nonnegative integers is said to be recursively-defined provided: 1. For some nonnegative integer n0 , the values f(0), f(1), . . . , f(n0 ) are explicitly given. 2. For n > n0 , f(n) is defined in terms of f(0), f(1), . . . , f(n − 1). We call f(0), f(1), . . ., f(n0 ) the initial values of f and refer to the identity that defines f(n) in terms of f(0), f(1), . . ., f(n − 1) as the recurrence relation (or recurrence formula ) for f. Example 1.35: For n ∈ Z+ , n-factorial, denoted n!, is defined as the product of the integers between 1 and n, inclusive, namely: n! = 1 · 2 · 3 · · · · · n A shorthand notation for this product is given by n! = n Y k k=1 Here we are using the product notation Q n Y k=1 — given real numbers a1 , a2 , . . . , an , define ak = a1 · a2 · · · · · an Getting back to n!, we see that 1! = 1, 2! = 2, 3! = 6, 4! = 24, and so on. It is also a standard convention to define 0-factorial to be 1; that is, 0! = 1. Given this information, we can define n-factorial recursively, as follows: 1. 0! = 1 2. n! = n · (n − 1)!, n≥1 In some cases, the method of induction we’ve employed in previous examples cannot be applied so easily. To see this, consider again the Fibonacci sequence, defined recursively by: 1. F (0) = F (1) = 1; 2. F (n) = F (n − 2) + F (n − 1), n≥2 68 Chapter 1 Logic and Sets Suppose we wish to prove that F (n) > (4/3)n for every n ≥ 2. The statement of the problem suggests using induction; let’s see what happens. As usual, we let P (n) denote the general inequality F (n) > (4/3)n . It is easy to check that P (2) is true. Next, we let k be an arbitrary integer, k ≥ 2, and assume P (k) holds; explicitly, our induction hypothesis is that F (k) > (4/3)k . To complete the proof, it must be shown that P (k + 1) holds, namely, that F (k +1) > (4/3)k+1 . What we do know is that the relation F (k +1) = F (k −1)+F (k) holds for k ≥ 1. However, it appears we have a slight problem, as we have no direct information concerning F (k−1). In particular, the induction hypothesis does not tell us that F (k−1) > (4/3)k−1. Problems such as this can be handled by using an alternate form of mathematical induction. This form is called the strong form of induction, because it allows the use of a stronger induction hypothesis than does the form of induction we have already mentioned. Sometimes we call that first form the weak form of induction. Like the weak form of induction, the strong form of induction is equivalent to the principle of well-ordering; the proof of this result is left to Exercise 8. Principle of Mathematical Induction — Strong Form: Let P (n) be a statement about the positive integer n satisfying the following two properties: 1. P (1) is true. 2. For any k ∈ Z+ , if P (n) is true for all n such that 1 ≤ n ≤ k, then P (k + 1) is true. Then P (n) is true for every positive integer n. Just as with the weak form of induction, there is a version of the strong form allowing one to anchor the induction at an arbitrary integer n0 (see Corollary 1.9). We state it as a corollary. Corollary 1.10: Let n0 be a fixed integer and let P (n) be a statement about the integer n satisfying the following two properties: 1. P (n0 ) is true. 2. For any k ≥ n0 , if P (n) is true for all integers n such that n0 ≤ n ≤ k, then P (k + 1) is true. Then P (n) is true for every n ≥ n0 . Example 1.36: Consider again the Fibonacci sequence as defined above, namely: 1. F (0) = F (1) = 1; 2. F (n) = F (n − 2) + F (n − 1), n≥2 We use the strong form of induction (Corollary 1.10) to prove that the inequality n 4 F (n) > 3 holds for all n ≥ 2. To set things up, let P (n) represent the inequality F (n) > (4/3)n . 69 1.7 Mathematical Induction To anchor the induction, note that 16 = 9 4 3 2 64 F (3) = 3 > = 27 4 3 3 F (2) = 2 > and Hence, P (2) is true and P (3) is true. (The reason for anchoring the induction for both n = 2 and n = 3 is that we need to have k ≥ 3 in the inductive step. It is typical that a proof using the strong form of induction must anchor the induction for several values. It’s a trade-off — in exchange for having a stronger induction hypothesis, we must do some extra work in the anchor step.) Next, let k represent an arbitrary integer, k ≥ 3, and assume P (n) holds for every n, 2 ≤ n ≤ k; explicitly, the induction hypothesis is that the inequality n 4 F (n) > 3 holds for every integer n between 2 and k, inclusive. To complete the proof, we must show that P (k + 1) holds, namely, that F (k + 1) > (4/3)k+1 . We proceed as follows: F (k + 1) = F (k − 1) + F (k) k−1 k 4 4 > + 3 3 4 k−1 4 = 1+ 3 3 7 4 k−1 = 3 3 16 4 k−1 > 9 3 2 4 k−1 4 = 3 3 4 k+1 = 3 Thus, P (k + 1) holds, and it follows by Corollary 1.10 that P (n) is true for every n ≥ 2. Note that, in the first step above, we used the recurrence relation F (k +1) = F (k −1)+F (k). In order for this to be valid we must have k + 1 ≥ 2, that is, k ≥ 1. This we have. In the second step above, we employed the induction hypothesis to say that F (k − 1) > (4/3)k−1 and F (k) > (4/3)k . In order for this to be valid, it is necessary to have k − 1 ≥ 2, that is, k ≥ 3. Now it becomes clear why we need to have k ≥ 3 in the inductive step, and thus why it is necessary to anchor the induction for both n = 2 and n = 3. We have already mentioned that both forms of induction are equivalent to the principle of wellordering. Hence, any proof that can be done by induction can also be done using the principle of well-ordering. Which method to employ is mostly a matter of convenience and personal preference. We now state the principle of well-ordering and then illustrate its use with a couple of examples. 70 Chapter 1 Logic and Sets Principle of Well-Ordering: Any nonempty subset of the set of positive integers has a smallest element. Similarly, every nonempty subset of the set of nonnegative integers has a smallest element. Example 1.37: For the sake of comparison, we redo Example 1.36 using the principle of well-ordering (PWO). Our goal is to prove that the inequality P (n): F (n) > 4 3 n holds for n ≥ 2. Just as in Example 1.36, we first “anchor” the proof by verifying that P (2) and P (3) hold. Now, suppose that it is not the case that P (n) holds for every integer n ≥ 2. Then the set S = {n | n ≥ 2 and P (n) is false} is a nonempty subset of the set of positive integers. It follows by PWO that S contains a smallest element; denote this by b n. Given our anchor step and the fact that n b is the smallest element of S, we have that: 1. n b≥4 2. P (2), P (3), . . ., P (b n − 1) are all true Now then: F (b n) = F (b n − 2) + F (b n − 1) bn−2 nb−1 4 4 > + 3 3 4 nb−2 4 = 1+ 3 3 7 4 nb−2 = 3 3 16 4 bn−2 > 9 3 2 4 4 nb−2 = 3 3 4 bn = 3 Thus, P (b n) is true, contradicting the fact that n b ∈ S. It follows that the set S is empty; thus, P (n) holds for every n ≥ 2. Example 1.38: The mythical country of Fibonacci has 3-cent coins, called “trickles,” and 5-cent coins, called “nickles.” For any n ≥ 8, show that it is possible to make a total of n cents using trickles and nickels. 71 1.7 Mathematical Induction Solution: Let P (n) represent the statement that a total of n cents can be made using trickles and nickels. Note that 8=3+5 9 = 3+3+3 10 = 5 + 5 so that P (8), P (9), and P (10) are all true. Suppose it is not the case that P (n) holds for every integer n ≥ 8. Then the set S = {n | n ≥ 8 and P (n) is false} is a nonempty subset of the set of positive integers. It follows by PWO that S contains a smallest element; denote this by b n. Given our anchor step and the fact that n b is the smallest element of S, we have that: 1. n b ≥ 11 2. P (8), P (9), P (10), . . . , P (b n − 1) are all true Now then, note that n b − 3 ≥ 8 and n b−3<n b. It follows that P (b n − 3) is true; namely, it is possible to make a total of n b − 3 cents using trickels and nickels. Adding one more trickle yields a total of n b cents. Therefore, P (b n) is true, a contradiction. It follows that the set S is empty, and so P (n) is indeed true for every n ≥ 8. Exercise Set 1.7 1. Use mathematical induction to prove that the relation 1 + 3 + · · · + (2n − 1) = n2 holds for every n ∈ Z+ . 2. Use mathematical induction (Corollary 1.9) to prove that 6 is a factor of n3 + 5n for every nonnegative integer n. 3. Use mathematical induction to prove that the following formulas hold for all n ∈ Z+ . (a) 1 + 2 + · · · + n = n(n + 1)/2 (b) 12 + 22 + · · · + n2 = n(n + 1)(2n + 1)/6 (c) 13 + 23 + · · · + n3 = n2 (n + 1)2 /4 4. Let N denote the set of nonnegative integers. For n ∈ N, let P1 (n) be the assertion that n2 + n + 11 is prime and let P2 (n) be the assertion that 3 is a factor of 3n + 2. (a) Note that P1 (0), P1(1), . . . , P1 (9) are all true. Is P1 (n) true for every n ∈ N? (b) Note that the implication P2 (k) → P2 (k + 1) holds for every k ∈ N. Can we conclude that P2 (n) is true for every n ∈ N? Why or why not? 5. Use mathematical induction to prove that the following inequalities hold for all n ∈ Z+ . 72 Chapter 1 Logic and Sets (a) 1+ (b) 2+ 1 1 1 +···+ 2 ≤ 2− 4 n n 1 1 1 √ + √ +···+ √ n 1 2 √ >2 n+1 6. Prove that Corollary 1.9 follows from the principle of mathematical induction. 7. Use induction to prove that the inequality n! > 2n holds for every integer n ≥ 4. 8. Prove that the strong form of induction follows from the principle of well-ordering. 9. For the Fibonacci sequence, prove that the inequality F (n) < 2n holds for every n ∈ Z+ . 10. Use induction to prove that these formulas hold for any nonnegative integer n. (a) 1 1 1 3 + +···+ n = 1 3 3 2 1− 1 3n+1 (b) a(r n+1 − 1) r−1 where a and r are real numbers and r 6= 1. (Note that, since a is a factor of both sides of the formula, it suffices to prove it for the case a = 1.) a + ar + · · · + ar n = 11. Use induction to prove that the following formula holds for every positive integer n: n X i=1 n 1 = (2i − 1)(2i + 1) 2n + 1 12. Use induction to prove that the following inequality holds for every positive integer n: 1 1 1 2 1+ +···+ 3 ≤ 3− 2 8 n n 13. Use induction to prove that each of the following relations holds for every positive integer n. (a) 8 | (52n + 7) (c) 5 | (n5 − n) (b) 5 | (33n+1 + 2n+1 ) (d) 15 | (24n − 1) 14. A professional football team may score a field goal for 3 points or a touchdown (with conversion) for 7 points. (A safety, for 2 points, a touchdown without conversion, for 6 points, and a touchdown with two-point conversion, for 8 points, are also possible, but rarely occur.) Use PWO or the strong form of induction to prove that, theoretically, it is possible for a football team to score some number of field goals and some number of touchdowns totaling n points for any integer n ≥ 12. 15. Use PWO or the strong form of induction to prove that any integer n ≥ 24 can be expressed as n = 5x + 7y, where x and y are nonnegative integers. 16. The function g is defined recursively on the set of positive integers as follows: g(1) = 2, g(2) = 4; g(n) = 2g(n − 1) + 3g(n − 2), n≥3 73 Chapter Problems (a) Find g(3), g(4), and g(5). (b) Use PWO or the strong form of induction to prove that the following inequality holds for every integer n ≥ 4: n 5 g(n) > 2 17. The function h is defined recursively on the set of positive integers as follows: h(1) = 2, h(2) = 5, h(3) = 10; h(n) = h(n − 1) + 3h(n − 3), n ≥ 4 (a) Find h(4), h(5), h(6), and h(7). (b) Use PWO or the strong form of induction to prove that the inequality h(n) < 2n holds for every integer n ≥ 5. CHAPTER PROBLEMS 1. The statements p: Ralph read the New York Times. q: Ralph watched the Daily Show. r: Ralph jogged three miles. are those of Exercise 1 in Exercise Set 1.2. Express each formula in words. (a) (p ∧ q) → r (c) p ∧ q → r (e) p → (q ∨ r) (g) p ∧ q ∧ r (b) p ↔ q (d) (p ∨ q) → r (f) r → p → q (h) (p → q) → r 2. For each statement, (i) represent it as a formula, (ii) find the negation of the formula, and (iii) express the negation in words. (a) The function f(x) = x3 − x is both one-to-one and onto. (b) The number (((22 )3 )4 )5 − 1 is prime or even. (c) Knowing that the graph G is hamiltonian is sufficient to say that G is connected. (d) If 6 is related to 18 and 18 is related to 72, then 6 is related to 72. (e) The function f(x) = 2x is one-to-one if and only if it is onto. 3. Find and simplify the negation of each formula. (a) p ∧ q ∧ r (c) p → (q → r) (e) p ∧ (p → q) ∧ (q → r) (g) p ∧ (q → r) ∨ (q ∧ p) (b) p ↔ q (d) p ∧ (q ∨ r) (f) p ∧ (q → p) (h) p → (q ∨ r) 4. In both parts, verify that the formulas u and v are logically equivalent. (Try to use properties of logical equivalence.) Indicate how each logical equivalence provides a strategy for proving an implication that has a compound hypothesis. 74 Chapter 1 Logic and Sets (a) u : (p ∧ q) → r (b) u : (p ∨ q) → r v : p → (q → r) v : (p → r) ∧ (q → r) 5. In both parts, verify that the formulas u and v are logically equivalent. (Try to use properties of logical equivalence.) Indicate how each logical equivalence provides a strategy for proving an implication that has a compound conclusion. (a) u : p → (q ∧ r) (b) u : p → (q ∨ r) v : (p → q) ∧ (p → r) v : (p ∧ q) → r 6. Frequently in mathematics we wish to prove that a statement with the logical form (p ↔ q) ∧ (q ↔ r) ∧ (r ↔ p) is true; in this case we say that the statements p, q, and r are equivalent. To show that p, q, and r are equivalent, show that it suffices to prove the following: (p → q) ∧ (q → r) ∧ (r → p) 7. For each formula, find a formula involving only conjunction and negation that is logically equivalent to it (a) p ∨ q (c) p ↔ q (b) p → q (d) p ∨ (q → r) . 8. The nand operator, denoted by |, is defined as follows: p| q ≡p∧q (hence the acronym “nand” for “not and”). (a) Give the truth table for p | q. (b) Show that p ≡ p | p. For the formulas in parts (c) and (d), find a formula that is logically equivalent to it and uses only the nand operator. (c) p ∧ q (d) p ∨ q (This problem shows that any formula involving the logical connectives may be expressed using nand only.) 9. Find (i) the inverse, (ii) the converse, and (iii) the contrapositive of each implication. (a) If 113 is odd, then (113 )2 is odd. (b) 242 is even only if 24 is even. (c) That f(x) = sin x is differentiable is sufficient for it to be continuous. (d) 112 = (−11)2 implies 11 = −11. (e) For the function f(x) = (x + 1)/(x − 1) to be defined at x = 1 it is necessary that f be continuous at x = 1. (f) Being connected and either having no cycles or having its order be one greater than its size are together sufficient conditions for the graph G to be a tree. 75 Chapter Problems 10. Consider the connective 5 (exclusive or), as defined in Exercise 6 of Exercise Set 1.2. (a) Show that p 5 q ≡ (p ∧ q) ∨ (p ∧ q). (b) Show that p 5 q ≡ p ↔ q. 11. Use logical symbols to express each statement as a formula. (a) Given any real numbers x1 and x2 , 2x1 = 2x2 if and only if x1 = x2 . (b) If 7 is the greatest common divisor of 119 and 154, then there exist integers s and t such that 7 = 119s + 154t. (c) For every positive integer n, either n = 1 or n is prime or there exist integers s and t such that 1 < s ≤ t < n and n = st. (d) There is a function f such that both f is one-to-one and f has the property that f(x) 6= x for every real number x. 12. The implications (p ∧ r) → q and (r ∧ q) → p are called partial contrapositives of the implication (p ∧ q) → r. (a) Show that (p ∧ q) → r ≡ (p ∧ r) → q. (b) Show that (p ∧ q) → r ≡ (r ∧ q) → p. Find both partial contrapositives of each implication. (c) If both X ∪ Z = Y ∪ Z and X ∩ Z = Y ∩ Z for some set Z, then X = Y . (d) If the derivative of the function f(x) is 2x + 1 and f(0) = 3, then f(x) = x2 + x + 3. 13. For each truth table in Tables 1.8, find a formula u that has that truth table. (a) (d) p T T F F q T F T F u F F F T p T T T T F F F F q T T F F T T F F r T F T F T F T F (b) u F T F T F F F F (e) p T T F F q T F T F u F T T F p T T T T F F F F q T T F F T T F F r T F T F T F T F (c) u T F T F T T T F Tables 1.8 (f) p T T F F q T F T F u F T F T p T T T T F F F F q T T F F T T F F r T F T F T F T F u F T T T T T T F 76 Chapter 1 Logic and Sets 14. Prove directly the following implication concerning arbitrary integers m and n: If m and n are both odd, then m + n is even. What is the contrapositive of the above implication? 15. Each part gives a pair of statements concerning positive real numbers x and y. Represent the statements symbolically as formulas and note the difference between them. Also determine each statement’s truth-value. (a) For every x there exists y such that y < x. There exists y such that, for every x, y < x. (b) For every x there exists y such that xy = 1. There exists y such that, for every x, xy = 1. 16. Prove the result of Problem 14 by contradiction. (Hint: Derive that 1 is even.) 17. Let x, y, and z be real numbers and let n be a positive integer. Find and simplify the negation of each of the following formulas. (a) ∃y 3 ∀x, xy ≥ 3 (c) ∀x, x > 0 → x2 ≥ x (e) ∃x 3 x ∈ Q ∧ ∀y, y ∈ / Q → x+y ∈ /Q (f) ∀x, y, x > 0 ∧ y > 0 → ∃n 3 nx > y (b) ∀x, ∃y 3 ∀z, x + y = z (d) ∀x, ∃z 3 x < z ∧ 2x ≥ 2z (g) ∀y, y > 0 → ∃x 3log x > y 18. Prove by contrapositive the following implication concerning integers m and n: If mn is odd, then both m and n are odd. 19. For each statement, (i) represent it symbolically as a formula, (ii) negate this formula, and then (iii) write out the negation in words. (a) There exist real numbers x and y such that x2 + y2 = −1. (b) There exists a positive integer n such that, for every real number x, if x 6= 1, then n > 1/(x − 1). (c) Given any real numbers x and y, 2x2 − xy + 5 > 0. (d) For every real number x there is some positive integer n such that xn is rational. (e) For every integer m, if m is a multiple of 6, then there exist integers s and t such that m = 12s + 18t. (f) For every positive real number , there is some positive real number δ such that, if |x − 2| < δ, then |x2 − 4| < . 20. Each part gives an implication concerning arbitrary real numbers x and y. Use the method of proof by contradiction to prove it. (a) If x is rational and y is irrational, then x + y is irrational. (b) If x is rational, x 6= 0, and y is irrational, then is irrational. √ xy √ √ (c) If x and y are both positive, then x + y 6= x + y. 77 Chapter Problems 21. Find the contrapositive of each implication. (a) If, for all u and v in the set V , the relation A has the property that u is related to v implies v is related to u, then A is symmetric. (b) If 7 is the greatest common divisor of 119 and 154, then there exist integers s and t such that 7 = 119s + 154t. (c) In order for the function log x to be onto, it is necessary that, given any real number b, there is some positive real number a such that log a = b. (d) If the relation A on the set V is transitive, then, for all u, v, w ∈ V , the condition that both u is related to v and v is related to w is sufficient for u is related to w. 22. Prove the following implication about an arbitrary nonzero real number x (a) by contrapositive and (b) by contradiction: If x > 0, then x + 1 ≥ 2. x 23. In separate Venn diagrams like the one shown in Figure 1.2, shade the region corresponding to the given set. (a) A ∩ B (b) B ∩ C ∩ D (c) (A ∪ B) ∩ D (d) (A ∩ B) ∪ (C ∩ D) (e) A ∪ B ∪ C ∪ D (f) (A ∪ B) ∩ C Figure 1.2 78 Chapter 1 Logic and Sets 24. Prove the following implication concerning arbitrary sets X and Y by “partial contrapositive;” that is, prove (directly) one of its partial contrapositives (see Problem 12): If both X ∪ Z = Y ∪ Z and X ∩ Z = Y ∩ Z for some set Z, then X = Y. 25. Let the universal set U be the set of people who voted in the 2004 U.S. presidential election. Define the following subsets of U: D = {x ∈ U | x registered as a Democrat} R = {x ∈ U | x voted for Bush} W = {x ∈ U | x belonged to a union} Describe each of the following subsets of U in terms of D, R, and W and draw an appropriate Venn diagram for each. (a) people who did not vote for Bush (b) union members who voted for Bush (c) registered Democrats who voted for Bush but did not belong to a union (d) union members who either were not registered as Democrats or voted for Bush (e) people who voted for Bush and were not registered as Democrats and were not union members (f) people who were either registered as Democrats, were union members, or did not vote for Bush 26. Prove each of the following assertions concerning arbitrary sets X, Y , and Z. (a) X − (Y − Z) = X ∩ (Y ∪ Z) (b) (X − Y ) − Z = X − (Y ∪ Z) 27. An insurance company classifies its set U of policyholders by using the following sets: A = {x | x drives a subcompact car} B = {x | x drives a car that is more than 5 years old} C = {x | x is married} D = {x | x is over 20 years of age} E = {x | x is male} Express each of the following subsets of U in terms of A, B, C, D, and E. (a) female policyholders over 20 years of age (b) policyholders who are male or drive cars more than 5 years old (c) female policyholders over 20 years of age who drive subcompact cars (d) male policyholders who are either married or over 20 years of age and do not drive subcompact cars 28. Prove or disprove each of the following assertions concerning arbitrary sets X and Y . (a) P(X ∩ Y ) = P(X) ∩ P(Y ) (b) P(X ∪ Y ) = P(X) ∪ P(Y ) (c) P(X − Y ) = P(X) − P(Y ) 79 Chapter Problems Figure 1.3 29. Let A, B, and C be subsets of a universal set U, as shown in the Venn diagram of Figure 1.3. Express each of regions numbered 1 through 8 in terms of A, B, and C. 30. Let X and Y be arbitrary nonempty subsets of a universal set U. Prove or disprove each of the following assertions. (a) (U × U) − (X × Y ) = (U − X) × (U − Y ) (b) X × X = X (c) X × U = U (d) X × ∅ = ∅ 31. Prove that, for any sets X, Y , and Z, (X ∩ Y ) − (X ∩ Z) = X ∩ Y ∩ Z 32. For arbitrary sets X and Y , the condition X = Y is both necessary and sufficient for X − Y = Y − X. (See Exercise 15, part (f), of Exercise Set 1.5.) Sufficiency is obvious; use the method of proof by contrapositive to prove necessity. 33. For sets X and Y , the symmetric difference of X and Y is the set X ∗ Y defined by X ∗ Y = (X − Y ) ∪ (Y − X) Prove: 80 Chapter 1 Logic and Sets (a) X ∗ Y = Y ∗ X (c) X ∗ Y = (X ∪ Y ) − (X ∩ Y ) (e) X ∩ Y = ∅ ↔ X ∗ Y = X ∪ Y (b) (X ∗ Y ) ∗ Z = X ∗ (Y ∗ Z) (d) X ∩ (Y ∗ Z) = (X ∩ Y ) ∗ (X ∩ Z) (f) X ∗ X = ∅ 34. For arbitrary nonempty sets X and Y , prove that the condition that X and Y are disjoint is both necessary and sufficient for X × Y and Y × X to be disjoint. (See Exercise 17, part (b), of Exercise Set 1.5.) 35. Prove or disprove the following statement about arbitrary sets X and Y : If both X ∩ Z = Y ∩ Z and Z − X = Z − Y for some set Z, then X = Y. 36. Consider a round-robin tournament involving n players (that is, a tournament in which each player plays every other player exactly once), and assume no match ends in a tie. Use induction on n to prove that, after the tournament has been completed, the players may be numbered 1, 2, . . . , n such that the player numbered i beat the player numbered i + 1 for each i, 1 ≤ i < n. 37. Use mathematical induction to prove that the following statements hold for all n ∈ Z+ : (a) 1 · 1! + 2 · 2! + 3 · 3! + · · · + n · n! = (n + 1)! − 1 (b) (2n )2 − 1 is a multiple of 3. (c) 12 − 22 + · · · + (−1)n+1 n2 = (d) (e) (−1)n+1 n(n + 1) 2 1 1 1 n + +···+ = 1·2 2·3 n(n + 1) n+1 n(n + 1)(n + 2) 3 38. Use induction on n to prove the following DeMorgan’s law for n sets X1 , X2 , . . . , Xn : 1(2) + 2(3) + · · · + n(n + 1) = X1 ∩ X2 ∩ · · · ∩ Xn = X1 ∪ X2 ∪ · · · ∪ Xn 39. Use induction to prove that the following inequality holds for every positive integer n: 1 1 1 2 + +···+ ≥ log2 (n + 2) 1 2 n 40. Let a and d be real numbers. Use induction to prove the following formula for the sum of a finite arithmetic series: (n + 1)(2a + nd) a + (a + d) + (a + 2d) + · · · + (a + nd) = 2 41. The sequence t(1), t(2), t(3), . . . is defined recursively on the set of positive integers as follows: t(1) = 1, t(2) = 2, t(3) = 3; t(n) = t(n − 3) + t(n − 2) + t(n − 1), n≥4 Use PWO or the strong form of induction to prove that the inequality t(n) < (13/7)n holds for every n ∈ Z+ . 42. The following argument purports to prove that for any nonempty finite set S of stars, all the stars in S have the same number of planets. The argument is by induction on n = |S|. What is the flaw in the argument? Chapter Problems 81 Clearly the result holds when n = 1. Let k represent an arbitrary positive integer and assume the result holds when n = k; explicitly, the induction hypothesis is that for any set S 0 of k stars, all the stars in S 0 have the same number of planets. To complete the proof, let S be a arbitrary set of k + 1 stars; it must be shown that all the stars in S have the same number of planets. To show this, choose subsets S1 and S2 of S such that |S1 | = |S2 | = k, S1 ∪ S2 = S, and S1 ∩ S2 6= ∅. Let s ∈ S1 ∩ S2 . Then, by the induction hypothesis, every star in S1 has the same number of planets as s does. Similarly, every star in S2 has the same number of planets as s does. It follows that every star in S = S1 ∪ S2 has the same number of planets as s does, and this completes the proof. 43. Suppose you have an infinite supply of 8-cent and 13-cent stamps. Use the strong form of induction to prove that you can make any amount of postage greater than 83 cents. 44. Consider the problem of tiling an n by n chessboard with any one square deleted with L-shaped tiles, each of which can cover exactly 3 squares. (a) There is a fairly obvious necessary condition on n (in terms of n mod 3) for such a tiling to exist. What is it? (Hint: There are n2 − 1 squares to be covered; in a tiling, each tile covers exactly 3 squares and each square is covered by exactly one tile.) (b) Show that the condition that n be a power of 2 is sufficient for such a tiling to exist. (Hint: Use induction on m where n = 2m .) (c) Show that the 5 by 5 board with one square removed can be tiled if and only if the removed square is one of the four corner squares, the middle square, or the middle square on one of the four sides of the board. (d) Prove (using the strong form of induction on n) that the necessary condition found in part (a) is sufficient, as well, except for the case n = 5.