Math 2001: Introduction to Discrete Mathematics [version 24 Jun 2019 ed.]

  • Commentary
  • Downloaded from the net; no longer available

Table of contents :
Monday, January 17 : First Day of Class......Page 7
Sets and Subsets......Page 8
Subsets......Page 10
Russell's Paradox......Page 11
Cardinality, informally......Page 13
The Cartesian Product......Page 14
Note on the empty set......Page 17
Power Set......Page 18
Intersections, Unions, Difference and Complements......Page 19
Venn Diagrams......Page 21
Index Sets......Page 22
Statements......Page 26
And, Or......Page 28
Not......Page 29
LaTeX......Page 31
Conditional Statements......Page 32
The Converse......Page 36
The Contrapositive......Page 37
Biconditional Statements......Page 38
Negating statements......Page 39
Friday, February 9......Page 41
Quantifyers......Page 42
Logical Inference......Page 45
Broad Strokes for the Topic of Proofs......Page 47
Friday, February 16......Page 49
Monday, February 19......Page 50
Preliminaries......Page 51
Examples of Direct and Contrapositive Proofs......Page 52
Wednesday, February 21......Page 53
Cases......Page 54
Without Loss of Generality......Page 55
Without Loss of generality continued......Page 57
Proof by Contradiction......Page 58
Proof by Contradiction Continued......Page 60
Congruence of Integers......Page 61
If and only if, and the following are equivalent.......Page 62
Friday, March 2......Page 64
Monday, March 5......Page 65
The following are equivalent (TFAE)......Page 66
Existence Proofs......Page 68
Existence and Uniqueness Proofs......Page 69
Proving xX......Page 71
Proving X Y......Page 72
Proving X Y......Page 73
Proving X = Y......Page 74
(Weak) Mathematical Induction......Page 77
Strong Mathematical Induction Continued......Page 82
Friday, March 23......Page 86
Relations......Page 87
Equivalence Relations......Page 88
Equivalence classes......Page 90
Friday, April 6......Page 93
Partitions......Page 94
Partitions, continued......Page 96
Integers modulo n......Page 97
Integers modulo n finished......Page 99
Functions......Page 100
Functions continued......Page 102
Injectivity and Surjectivity......Page 103
Injectivity and Surjectivity......Page 105
Friday, April 20......Page 107
The Pigeon-Hole Principle......Page 108
Image and Preimage......Page 110
Composition......Page 111
Inverses......Page 113
Cardinality......Page 114
Cardinality Continued......Page 116
Cardinality Continued......Page 118
Review......Page 123

Citation preview

Math 2001 – Introduction to Discrete Mathematics Agn`es Beaudry June 24, 2019

Contents 1 Sets 1.1 Monday, January 17 : First Day of Class . . . . . . . . . . 1.1.1 Sets and Subsets . . . . . . . . . . . . . . . . . . . 1.2 Friday, January 19 . . . . . . . . . . . . . . . . . . . . . . 1.2.1 Subsets . . . . . . . . . . . . . . . . . . . . . . . . 1.2.2 Russell’s Paradox . . . . . . . . . . . . . . . . . . . 1.3 Monday, January 22 . . . . . . . . . . . . . . . . . . . . . 1.3.1 Set-builder notation . . . . . . . . . . . . . . . . . 1.3.2 Cardinality, informally . . . . . . . . . . . . . . . . 1.3.3 The Cartesian Product . . . . . . . . . . . . . . . . 1.4 Wednesday, January 24 . . . . . . . . . . . . . . . . . . . . 1.4.1 Cardinality Continued . . . . . . . . . . . . . . . . 1.4.2 Note on the empty set . . . . . . . . . . . . . . . . 1.4.3 Power Set . . . . . . . . . . . . . . . . . . . . . . . 1.5 Friday, January 26 . . . . . . . . . . . . . . . . . . . . . . 1.5.1 Intersections, Unions, Difference and Complements 1.5.2 Venn Diagrams . . . . . . . . . . . . . . . . . . . . 1.6 Monday, January 29 . . . . . . . . . . . . . . . . . . . . . 1.6.1 Index Sets . . . . . . . . . . . . . . . . . . . . . . . 2 Logic 2.1 Wednesday, January 31 2.1.1 Statements . . 2.1.2 And, Or . . . . 2.1.3 Not . . . . . . . 2.2 Friday, February 2 . . 2.2.1 LaTeX . . . . . 2.3 Monday, February 5 .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . . 1

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . .

. . . . . . . . . . . . . . . . . .

. . . . . . .

. . . . . . . . . . . . . . . . . .

6 6 7 9 9 10 12 12 12 13 16 16 16 17 18 18 20 21 21

. . . . . . .

25 25 25 27 28 30 30 31

2.4

2.5 2.6

2.7 2.8 2.9

2.10

2.11

2.12

2.13 2.14 2.15 2.16

2.17

2.3.1 Conditional Statements . . . . . . . . . . . . . . Wednesday, February 7 . . . . . . . . . . . . . . . . . . 2.4.1 The Converse . . . . . . . . . . . . . . . . . . . 2.4.2 The Contrapositive . . . . . . . . . . . . . . . . 2.4.3 Biconditional Statements . . . . . . . . . . . . . 2.4.4 Negating statements . . . . . . . . . . . . . . . Friday, February 9 . . . . . . . . . . . . . . . . . . . . Monday, February 12 . . . . . . . . . . . . . . . . . . . 2.6.1 Intervals . . . . . . . . . . . . . . . . . . . . . . 2.6.2 Quantifyers . . . . . . . . . . . . . . . . . . . . 2.6.3 Logical Inference . . . . . . . . . . . . . . . . . Wednesday, February 14 . . . . . . . . . . . . . . . . . 2.7.1 Broad Strokes for the Topic of Proofs . . . . . . Friday, February 16 . . . . . . . . . . . . . . . . . . . . Monday, February 19 . . . . . . . . . . . . . . . . . . . 2.9.1 Preliminaries . . . . . . . . . . . . . . . . . . . 2.9.2 Examples of Direct and Contrapositive Proofs . Wednesday, February 21 . . . . . . . . . . . . . . . . . 2.10.1 Cases . . . . . . . . . . . . . . . . . . . . . . . . 2.10.2 Without Loss of Generality . . . . . . . . . . . Friday, February 23 . . . . . . . . . . . . . . . . . . . . 2.11.1 Without Loss of generality continued . . . . . . 2.11.2 Proof by Contradiction . . . . . . . . . . . . . . Monday, February 26 . . . . . . . . . . . . . . . . . . . 2.12.1 Proof by Contradiction Continued . . . . . . . . 2.12.2 Congruence of Integers . . . . . . . . . . . . . . Wednesday, February 28 . . . . . . . . . . . . . . . . . 2.13.1 If and only if, and the following are equivalent. . Friday, March 2 . . . . . . . . . . . . . . . . . . . . . . Monday, March 5 . . . . . . . . . . . . . . . . . . . . . Wednesday, March 7 . . . . . . . . . . . . . . . . . . . 2.16.1 The following are equivalent (TFAE) . . . . . . 2.16.2 Existence Proofs . . . . . . . . . . . . . . . . . 2.16.3 Existence and Uniqueness Proofs . . . . . . . . Friday, March 9 . . . . . . . . . . . . . . . . . . . . . . 2.17.1 Proofs with sets . . . . . . . . . . . . . . . . . . 2.17.2 Proving x ∈ X . . . . . . . . . . . . . . . . . . 2.17.3 Proving X ⊆ Y . . . . . . . . . . . . . . . . . . 2

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

31 35 35 36 37 38 40 41 41 41 44 46 46 48 49 50 51 52 53 54 56 56 57 59 59 60 61 61 63 64 65 65 67 68 70 70 70 71

2.18 2.19

2.20 2.21 2.22 2.23 2.24

2.25 2.26 2.27 2.28

2.29 2.30 2.31

2.32 2.33 2.34

2.35

2.17.4 Proving X 6⊆ Y . . . . . . . . . . . . . . . 2.17.5 Proving X = Y . . . . . . . . . . . . . . . Monday, March 12 . . . . . . . . . . . . . . . . . 2.18.1 (Weak) Mathematical Induction . . . . . . Wednesday, March 14 . . . . . . . . . . . . . . . . 2.19.1 Weak Induction Continued . . . . . . . . . 2.19.2 Strong Mathematical Induction Continued Friday, March 16 . . . . . . . . . . . . . . . . . . Monday, March 19 . . . . . . . . . . . . . . . . . Wednesday, March 21 . . . . . . . . . . . . . . . . Friday, March 23 . . . . . . . . . . . . . . . . . . Monday, April 2 . . . . . . . . . . . . . . . . . . . 2.24.1 Relations . . . . . . . . . . . . . . . . . . 2.24.2 Equivalence Relations . . . . . . . . . . . Wednesday, April 4 . . . . . . . . . . . . . . . . . 2.25.1 Equivalence classes . . . . . . . . . . . . . Friday, April 6 . . . . . . . . . . . . . . . . . . . . Monday, April 9 . . . . . . . . . . . . . . . . . . . 2.27.1 Partitions . . . . . . . . . . . . . . . . . . Wednesday, April 11 . . . . . . . . . . . . . . . . 2.28.1 Partitions, continued . . . . . . . . . . . . 2.28.2 Integers modulo n . . . . . . . . . . . . . . Friday, April 13 . . . . . . . . . . . . . . . . . . . 2.29.1 Integers modulo n finished . . . . . . . . . Functions . . . . . . . . . . . . . . . . . . . . . . Monday, April 16 . . . . . . . . . . . . . . . . . . 2.31.1 Functions continued . . . . . . . . . . . . 2.31.2 Injectivity and Surjectivity . . . . . . . . . Wednesday, April 18 . . . . . . . . . . . . . . . . 2.32.1 Injectivity and Surjectivity . . . . . . . . . Friday, April 20 . . . . . . . . . . . . . . . . . . . 2.33.1 The Pigeon-Hole Principle . . . . . . . . . Monday, April 23 . . . . . . . . . . . . . . . . . . 2.34.1 Image and Preimage . . . . . . . . . . . . 2.34.2 Composition . . . . . . . . . . . . . . . . . Wednesday, April 25 . . . . . . . . . . . . . . . . 2.35.1 Inverses . . . . . . . . . . . . . . . . . . . 2.35.2 Cardinality . . . . . . . . . . . . . . . . . 3

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

72 73 76 76 81 81 81 85 85 85 85 86 86 87 89 89 92 93 93 95 95 96 98 98 99 101 101 102 104 104 106 107 109 109 110 112 112 113

2.36 Friday, April 27 . . . . . . . . 2.36.1 Cardinality Continued 2.37 Monday, April 30 . . . . . . . 2.37.1 Cardinality Continued 2.38 Wednesday, May 2 . . . . . . 2.38.1 Review . . . . . . . . .

4

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

. . . . . .

115 115 117 117 122 122

Disclaimer. The following notes are my course notes, and may contains mistakes and typos. They are shamelessly based on book for the course: • Book of Proof by Richard Hammack

5

Chapter 1 Sets 1.1

Monday, January 17 : First Day of Class Intro to discrete mathematics is a class designed to teach you the language of higher mathematics. Sometimes, it may be more like a language class than a math class. We will learn the rules of logic, how to make mathematical statements and how to prove them. We will answer questions like: what does it mean to do mathematics? What does it mean to prove something? You will learn about some open problems and various areas.

Textbook: The primary source will distributed electronically on the website as the course progresses. The official textbook is • Book of Proof , by Richard Hammack which available for free online. Topics: Below is a list of the topics we will cover : 6

• Basic Set Theory • Basic Logic • Mathematical Proofs • Mathematical Induction • Counting Techniques • Relations and Functions • Cardinality

1.1.1

Sets and Subsets

Definition 1.1 (Cantor’s Na¨ıve definition, 1882). “A set is a gathering together into a whole of definite, distinct objects of our perception or of our thought — which are called elements of the set.” So, a set is a “bunch of things”. Notation. If A is a set and x is an element of A, we write x∈A

or

A 3 x.

If x is not an element of the set A, we write x 6∈ A

or

A 63 x.

The symbols { and } are used to denote a set. For example {a, b, c} is a set containing three elements called a, b and c. Example 1.2.

• {0, 1} 7

• N = {1, 2, 3, . . .} • Z = {0, 1, −1, 2, −2, . . .} • X = {A,B,C,. . . , X,Y,Z} • ∅ = { }. This is the set with no elements, called the empty set. Definition 1.3. Suppose that A and B are sets. We say that A = B if the elements of A are the same as the elements of B. Warning 1.4. Sets don’t have repetitions and are not ordered. • {a, b, c} = {c, b, a} • {1, 1, 2, 3} = {1, 2, 3} = {2, 3, 1} Question 1.5. Is {0, 1} equal to {0, {1}}? Answer. No, these sets do not contain the same elements. Although they both contain 0, the first set contains 1 while the second set contains the “set containing 1”. Here is an imperfect analogy: 1 is to {1} as a dog is to a picture of a dog.

8

1.2 1.2.1

Friday, January 19 Subsets

Definition 1.6. A set A is a subset of B if all of the elements of A are also elements of B. Notation. If A is a subset of B, we write A ⊆ B. If A ⊆ B but A 6= B, then sometimes write A ( B. If A is not a subset of B, we write A 6⊆ B. Example 1.7.

• {a, b} ⊆ {a, b, c}

• {a, b} ( {a, b, c} • {a, b, c} ⊆ {a, b, c} • N⊆Z • N(Z • {z} 6⊆ {a, b, c} We ended last class with the question of whether or not the set {0, 1} is equal to {0, {1}}. And this brought up another good question. Question 1.8. Are elements of a set always also subsets of that set? We came to the conclusion that the answer to both questions was NO. Intuitively, a rock and a box containing a rock are different. One is a rock, the other is something that contains a rock, but they are not the same thing. Remark 1.9. Saying that the answer to Question 1.8 is NO does not mean that there cannot be examples when this happens: Question 1.10. Are there elements of the set {1, {1}} which are also subsets of that set? 9

Answer. Yes, since {1} is an element of {1, {1}} and {1} is a subset of {1, {1}} . Question 1.11. Are there elements of the set B = {2, {1}} which are also subsets of that set? Answer. No. The previous argument does not work since {1} is no longer a subset of B since 1 6∈ B. Question 1.12. Are there elements of the set C = {1, {{1}}} which are also subsets of that set? Answer. No. Although {1} is a subset of C, now it is not an element of C since {1} = 6 {{1}}.

1.2.2

Russell’s Paradox

Sets can contain other sets. So it’s possible to conceive the following set: Question 1.13 (Russell’s Paradox, 1901). Consider the set A whose elements are those sets X which are not element of themselves, A = {X is a set and X 6∈ X}. Such a set can be conceived, so according to our definition, it exists. Is A ∈ A? Answer. To clarify the question, let’s make a function from sets to truth values: P (X) = X 6∈ X. We can plug a set into P and it will spit out true if X 6∈ X and false if X ∈ X. A set X is in A if P (X) is true. 10

• If A ∈ A, then P (A) is false, so A 6∈ A. This is a contradiction. So it must have been that our assumption was wrong and A 6∈ A. However, • if A 6∈ A, then P (A) is true, so A ∈ A. This is a contradiction. This is a paradox! This question brought to light a contradiction in the na¨ıve approach to set theory. This led to the axiomatization of the set theory by ZermeloFraenkel (ZF) in 1908. The axioms of ZF do not imply that the set A exists, therefore do not lead to the contradiction of Russell’s paradox. To do set theory axiomatically, we would need to know the basics of first order logic. We will learn some of it later on, but for our treatment of set theory, we will be satisfied to know that this contradiction has been solved.

11

1.3

Monday, January 22

1.3.1

Set-builder notation

If B is a set, we can form the set: A = {x ∈ B : a condition on x}. This reads as A is the set that contains the elements x of the set B such that the condition on x is true. Example 1.14.

• If B is the set containing all dogs, {x ∈ B : x is a black dog}.

• {x ∈ R : x2 ∈ Z} Remark 1.15. There can be many different ways to represent the same set. For example, sets X = {x ∈ Z : x > 0} and N = {1, 2, 3, . . .} are equal since they have the same elements. That is, X = N.

1.3.2

Cardinality, informally

Some sets are bigger than other in the sense that they contain more elements. This is easy to comprehend for sets that have a finite number of elements. It is harder to compare the size of two sets when they both have infinitely many elements. We will revisit this later on, but for now we will be informal. Definition 1.16. The cardinality of a set A is the number of elements in A and is denoted |A|. If A has infinitely many elements, we will write |A| = ∞. Example 1.17.

• |{a, b, c}| = 3 12

• |N| = ∞ • |∅| = 0. Warning 1.18. Cardinality |X| can look like absolute value. This is an instance when the same notation is used to mean two things. Question 1.19. Let X = {x ∈ Z : |x| < 2}

Y = {A ⊆ N : |A| < 2}

What is |X|? What is |Y |? Answer. Here, we have to guess the meaning of the symbols | · | from the context. For X, the question is asking, how many elements of Z have absolute value less than 2? We have X = {−1, 0, 1} so |X| = 3. For Y , the question is asking how many subset of N have cardinality less than 2? We have Y = {∅, {1}, {2}, . . .} so |Y | = ∞.

1.3.3

The Cartesian Product

Definition 1.20. An ordered pair is a list (a, b) of two things a and b. An ordered n-tuple is a list (a1 , . . . , an ) of n things a1 , ... an .

13

Example 1.21. A coordinate (x, y) in the cartesian plane R2 is an ordered pair of real numbers. A coordinate (x, y, z) is an ordered triple in R3 . Question 1.22. Is (a, b) equal to (b, a)? Answer. The order matters, so these are not equal unless a = b, in which case we have (a, a) = (a, a). Example 1.23. The points (0, 1) and (1, 0) are not the same points in the cartesian plane R2 . Fact 1.1. Two ordered pairs (a, b) and (c, d) are equal if and only if a = c and b = d. Definition 1.24. Let A1 , . . . , An be sets. The cartesian product of A1 , . . . , An is the set of ordered n-tuples (a1 , . . . , an ) where ai ∈ A for 1 ≤ i ≤ n: A1 × . . . × An = {(a1 , . . . , an ) : ai ∈ Ai for 1 ≤ i ≤ n}. If A1 = . . . = An , we write An = A1 × . . . × An . Example 1.25.

• The cartesian plane R × R = R2

• The euclidean n-plane is Rn • {0, 1} × {a, b, c} = {(0, a), (0, b), (0, c), (1, a), (1, b), (1, c)} • {0, 1} × {0, 1} × {0, 1} is {(0, 0, 0), (0, 1, 0), (0, 1, 1), (0, 0, 1), (1, 0, 0), (1, 0, 1), (1, 1, 0), (1, 1, 1)} Question 1.26. Let A be a set What is A × ∅? 14

Answer. It is ∅. There are not ordered pair (a, b) with a ∈ A and b ∈ ∅ since there is no b ∈ ∅.

15

1.4 1.4.1

Wednesday, January 24 Cardinality Continued

Question 1.27. What is |A × B|? Answer. Let |A| = n and |B| = m. There are n-choices for the first coordinate of a pair (−, −). For each choice a ∈ A, there are m choices for the second coordinate. So, there are nm different ordered pairs. Therefore, |A × B| = |A| × |B| Fact 1.2. |A1 × . . . × An | = |A1 | × . . . × |An | Question 1.28. Is A × B = B × A? Answer. Not necessarily. These sets do not have the same elements. Fact 1.3. Let A and B be sets. Then A × B = B × A if and only if one of the following is true • A=B • A=∅ • B=∅

1.4.2

Note on the empty set

Recall that A is a subset of B if, for all x, if x ∈ A, then x ∈ B. In particular, Fact 1.4. Let A and B be sets. Then A is a not a subset of B if there exists a b such that b ∈ B and b 6∈ A. The element b is a witness to the fact that B is not a subset of A. Question 1.29. When is ∅ ⊆ A? 16

Answer. Always. There are not elements in ∅, so no element b such that b ∈ ∅ and b 6∈ A. There can be no witness!

1.4.3

Power Set

Definition 1.30. Let A be a set. The power set of A, denoted P(A), is the set P(A) = {X : X ⊆ A}. Example 1.31.

• If A = {0, 1}. Then P(A) = {∅, {0}, {1}, {0, 1}}.

• If B = {a, b, c}, then P(B) = {∅, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, {a, b, c}}. Question 1.32. What is P(∅)? Answer. The only subset of the empty set is itself, so P(∅) has one element, namely ∅. Therefore, P(∅) = {∅}. Question 1.33. If X has n elements, then what is the cardinality of P(X)? Answer. If X has n elements, then P(X) has 2n elements. To see this, let X = {x1 , . . . , xn }. Then to determine a subset Y , you need to specify which elements are in Y . For each 1 ≤ i ≤ n, there are two possibilities, either xi ∈ Y or xi 6∈ Y . So, there are a total of 2n possibilities.

17

1.5 1.5.1

Friday, January 26 Intersections, Unions, Difference and Complements

Definition 1.34. Let A and B be sets. • The intersection of A and B, denoted A ∩ B, is the set A ∩ B = {x : x ∈ A and x ∈ B }.

• The union of A and B, denoted A ∪ B, is the set A ∪ B = {x : x ∈ A or x ∈ B }.

• The difference of A and B, denoted A − B, is the set A − B = {x : x ∈ A and x 6∈ B}.

Example 1.35. Let A = {1, 2, 3} and B = {a, b, c} and C = {1, a} • A ∪ B = {1, 2, 3, a, b, c} • A ∪ C = {1, 2, 3, a} • A∩B =∅ • A ∩ C = {1} • A−B =A • A − C = {2, 3} 18

Question 1.36. Let A be any set. What is A ∪ ∅? What is A ∩ ∅? What is A − ∅? What is ∅ − A? Definition 1.37. Suppose that A ⊆ U . The complement (of A is U ), denoted A or Ac , is the set A = U − A = {x ∈ U : x 6∈ A}. Remark 1.38. Often, U is understood from the context in the sense that all the sets being considered are subsets of an ambient set. A common example is U = R, or U = R2 . In this case, we call U the universe or universal set. Example 1.39.

• Let U = N and A be the set of odd natural numbers.

Then A is the set of even natural numbers. • Let U = R2 and A = {(x, y) : x ≥ 0}. Then A = {(x, y) : x < 0} is the lower half plane which does not contain the x-axis.

A

B

C U

Figure 1.1: A Venn Diagram

19

1.5.2

Venn Diagrams

A Venn diagram is a picture used to illustrate the set operations. Question 1.40. What is A ∩ B? What is A ∪ B? What about C − (A ∩ B) and C − (A ∪ B)? Answer. The solution is given by DeMorgan’s Laws, but involves understanding the meaning of “not (P and Q)” and that of “not (P or Q)”. Theorem 1.41 (DeMorgan’s Laws). Let A, B and C be sets. • C − (A ∩ B) = (C − A) ∪ (C − B), and • C − (A ∪ B) = (C − A) ∩ (C − B).

20

1.6

Monday, January 29

1.6.1

Index Sets

It is useful to have flexible notation for the various set operation. For example, if A1 , . . . , An are sets, then we abbreviate n [

Ai = {x : x ∈ Ai for some i such that 1 ≤ i ≤ n} = A1 ∪ . . . ∪ An

i=1

and n \

Ai = {x : x ∈ Ai for all i such that 1 ≤ i ≤ n} = A1 ∩ . . . ∩ An .

i=1

Example 1.42. If A1 = {1, 2, 3}, A2 = {2, 3, 4} and A3 = {3, 4, 5} then 3 [

Ai = {1, 2, 3, 4, 5}

i=1

and

3 \

Ai = {3}.

i=1

This can also be done with an infinite number of sets A1 , A2 , . . ..

∞ [ i=1 ∞ \

Ai = {x : there exists i ∈ N such that x ∈ Ai } Ai = {x : for all i ∈ N, x ∈ Ai }

i=1

21

Example 1.43. Suppose that Ai = {i, i + 1} for n ∈ N. Then ∞ [

∞ \

Ai = N

i=1

Ai = ∅

i=1

In this case, we also use the following notation [

Ai = {x : there exists i ∈ N such that x ∈ Ai }

i∈N

\

Ai = {x : for all i ∈ N, x ∈ Ai }

i∈N

and call N the index set. In general, indexed sets are used to deal with collections of sets in a more flexible way. Definition 1.44. Let I be a set. A collection of sets indexed by I is a set which contains a set Ai for each i ∈ I. We denote this by {Ai : i ∈ I} or {Ai }i∈I . If {Ai }i∈I is a collection of sets indexed by I, then [

= {x : there exists i ∈ I such that x ∈ Ai .}

i∈I

\

= {x : for all i ∈ I, x ∈ Ai .}.

i∈I

Example 1.45.

• If A1 , . . . , An are sets, then we can let the index set

be I = {1, . . . , n} and form the collection {Ai : i ∈ {1, . . . , n}} = {A1 , . . . , An }. • If A1 , A2 , . . ., then we can let the index set be I = N and form the collection {Ai : i ∈ N}. 22

• Let I = R. Then Ax = (x, x + 1) = {y ∈ R : x < y < x + 1} is a collection of sets indexed by R. [

=R

x∈R

\

= ∅.

x∈R

• Let I = R2 . Let P(a,b) = {(x, y, z) ∈ R3 : ax + by = 0}. Then {P(a,b) : (a, b) ∈ R2 } is a collection indexed by R2 . The sets P(a,b) are vertical planes in R3 if (a, b) 6= (0, 0), and all of R3 if (a, b) = (0, 0). So [

= R3

(a,b)∈R2

and \

= {(x, y, z) ∈ R3 : x = y = 0} = z-axis.

(a,b)∈R2

Definition 1.46. If J ⊆ I, then {Aj : j ∈ J} is a subcollection indexed by J. Example 1.47. If I = R2 and J = {(a, b) ∈ R2 : b = 1, −1 ≤ a ≤ 1}. Then

23

letting X = {(x, y) ∈ R2 : x ≥ 0, y ≤ x and −x ≤ y} ∪ {(x, y) ∈ R2 : x ≤ 0, x ≤ y and y ≤ −x} we have [

P(a,b) = {(x, y, z) ∈ R3 : (x, y) ∈ X}.

(a,b)∈J

Question 1.48. Let U be a universe and let Ai ⊆ U be a collection indexed S by a set I. Then J = ∅ ⊆ I. What should be i∈∅ Ai ? What should be T i∈∅ Ai ? Answer. Let’s look at the definition closely: [

Ai = {x ∈ U : there exists i ∈ J such that x ∈ Ai .}

i∈J

\

Ai = {x ∈ U : for all i ∈ J, x ∈ Ai .}.

i∈J

For the union, since J = ∅, there is no i ∈ J, so

S

i∈J

Ai = ∅. However, for

the intersection, the condition “for all i ∈ J, x ∈ Ai ” should be read as “for all i, if i ∈ J, then x ∈ Ai ” Since J = ∅, this holds true for all x and so,

24

T

i∈J

Ai = U .

Chapter 2 Logic 2.1 2.1.1

Wednesday, January 31 Statements

Definition 2.1. A statement is a sentence which is either true or false. Definition 2.2. The truth value of a statement true, abbreviated T if the statement is true, and false, abbreviated F, if the statement is false. Question 2.3. Which of the following phrases are statements, and what is their truth value: • N⊆Z • 2 is odd. • x is even. • Earth orbits around the sun. • Venus orbits around Mars. 25

• y is a brown dog. • If an integer x is a multiple of 6, then x is even. • If an integer x is a multiple of 3, then x is odd. • If a real number x is rational, then x is an integer. If a phrase is a statement, we often abbreviate it with a letter P or Q. For example, P = 2 is odd. or Q=N⊆Z Then P is false and Q is true. Some of the phrases above are not statements since their truth value depends on a variable x or y. We record this dependence as: P (x) = x is even. or Q(y) = y is a brown dog. These are called open sentences or predicate. For each specific value of a, P (a) becomes a statement. For example, for P (x) as above, P (2) is a true statement and P (3) is a false statement. We could let S(x) = x is an integer which is a multiple of 6 and use this to construct phrases that can then be statements: 26

If S(x), then P (x). This now is just the statement “If an integer x is a multiple of 6, then x is even.” that we considered above.

2.1.2

And, Or

Statements can be combined to form new statements using logical connectives such as and and or. More precisely, if P and Q are statements, then P and Q

P or Q

are also statements. The truth value of the new statements depends on that of P and that of Q. Example 2.4.

• N ⊆ Z and 2 is even.

• N ⊆ Z and 2 is odd. • 3 is even and 2 is odd. • 3 is even and 2 is even. • N ⊆ Z or 2 is even. • N ⊆ Z or 2 is odd. • 3 is even or 2 is odd. • 3 is even or 2 is even. The logic symbol ∧ is used to denote “and”. The logic symbol ∨ is used to denote “or”. So“P ∧ Q” means “P and Q”, and “P ∨ Q” means “P or Q” . To specify when statements such as “P and Q” and “P or Q” are true depending on the truth of P and the truth of Q, we use truth tables. 27

P

Q P ∧Q

P

Q P ∨Q

T

T

T

T

T

T

P

∼P

T

F

F

T

F

T

T

F

F

T

F

F

T

T

F

T

F

F

F

F

F

F

Question 2.5. Determine the truth value of P ∧Q and P ∨Q for the following statements P and Q: • P : Earth orbits around the sun. Q: Venus orbits around Mars. • P : Earth orbits around the sun. Q: If an integer x is a multiple of 6, then x is even. • P : If an integer x is a multiple of 3, then x is odd. Q: If an integer x is a multiple of 6, then x is even. • P : If an integer x is a multiple of 3, then x is odd. Q: If a real number x is rational, then x is an integer.

2.1.3

Not

Another logical connective is negation. If P is a statement, then “not P ” is a new statement, which means “it is not true that P ”. In English, we phrase negation using various sentence structures. Example 2.6.

• Let Q be the statement “2 divides 5”. Then “It is not

true that 2 divides 5” means “not Q”. However, we also phrase this in english as “2 does not divide 5”. • Let P be the statement “2 is even”. Then “It is not true that 2 is even” is the statement “not P ”. We also phrase this as“2 is not even”. 28

Further, this also is equivalent to “2 is odd”, since an integer is odd, by definition, if it is not even. Question 2.7. Determine the truth value of ∼ P for the following statements: • N⊆Z • 2 is odd. • Earth orbits around the sun. • Venus orbits around Mars. • If an integer x is a multiple of 6, then x is even. • If an integer x is a multiple of 3, then x is odd. • If a real number x is rational, then x is an integer. The logical for negation is ∼. So ∼ P means “not P ”. Some also use ¬ instead of ∼.

29

2.2 2.2.1

Friday, February 2 LaTeX

See online resources.

30

2.3

Monday, February 5

2.3.1

Conditional Statements

Definition 2.8. Given two statements P and Q, we can form the conditional statement “if P , then Q”, denoted P ⇒ Q using symbols. For example, let P : it rains outside Q : I bring my umbrella to work P ⇒ Q : If it rains outside, then I bring my umbrella to work. Let’s use this example to study the truth table of P ⇒ Q: P

Q

P ⇒Q

T

T

T

T

F

F

F

T

T

F

F

T

To understand the last two lines of the truth table, we consider the scenarios: • It didn’t rain outside and I brought my umbrella to work. • It didn’t rain outside and I didn’t bring my umbrella to work. In neither cases I did not lie by saying “if it rains outside, then I bring my umbrella to work” since I made no promise as to whether or not I bring my umbrella when it doesn’t rain outside. The only case when that sentence would be false is if it rains and I don’t bring my umbrella. Therefore, the 31

sentence “if P , then Q” is only false in one situation: when the truth value of P is T and that or Q is F . Definition 2.9. If P and Q are statements, the statement “if P , then Q” is said to be vacuously true if the statement P is false. Example 2.10. Decide the truth value of P ⇒ Q in the following examples: • P : 2 is even, Q : 3 is odd • P : 2 is even, Q : 3 is even • P : 2 is odd, Q : 3 is odd • P : 2 is odd, Q : 3 is even • P : 12 is a multiple of 6, Q : 12 is even • P : 36 is a multiple of 6, Q : 36 is even • P : 13 is a multiple of 6, Q : 13 is even • P : 2 is a multiple of 6, Q : 2 is even • P : 10 is a multiple of 6, Q : 10 is even • P : 2 is a multiple of 6, Q : 2 is odd • P : 13 is a multiple of 6, Q : 13 is odd Remark 2.11. We use other kinds of phrasing to talk about conditional statements. Some examples are • Whenever P , then Q • P is a sufficient condition for Q 32

• Q if P • P only if Q • Q is a necessary condition for P We often combine open sentences P (x) and Q(x) and form statements “if P (x), then Q(x)”. For example, P (x) : x is an integer which is a multiple of 6 Q(x) : x is an even integer P (x) ⇒ Q(x) : If x is an integer which is a multiple of 6, then x is an even integer. We recognize this as a statement, and in fact, we recognize this to be a true statement. Why is that? Looking at the truth table of P ⇒ Q, we see that to verify that P (x) ⇒ Q(x) is true, all we need to know is that in all the cases when P (x) is true, then Q(x) is forced to also be true. In other words, what we recognize as a true statement is: For all x, if x is an integer which is a multiple of 6, then x is an even integer. We usually omit the “For all x” and treat it as being understood from context. Definition 2.12. An element a ∈ Z is even if there is an element b ∈ Z such that a = 2b. Proposition 2.13. If x is an even integer, then x2 is an even integer. Proof. Suppose that x is even. Then there is an element y ∈ Z such that x = 2y. So, x2 = (2y)2 = 4y 2 = 2(2y 2 ). 33

So x2 is of the form 2b for the integer b = 2y 2 . Therefore, x2 is even.

34

2.4 2.4.1

Wednesday, February 7 The Converse

Example 2.14. Let x be an integer. P : x is a multiple of 6 Q : x is even P ⇒ Q : If x is a multiple of 6, then x is even. Q ⇒ P : If x is even, then x is a multiple of 6. In this example, P ⇒ Q is true, but Q ⇒ P is false. It’s important to see that these statements are not the same. Definition 2.15. If P and Q are statements, the statement “if Q, then P ” is called the converse of the statement “if P , then Q”. Example 2.16. Sometimes, both conditionals are true: P : x2 is an even integer Q : x is an even integer P ⇒ Q : If x is an even integer, then x2 is an even integer Q ⇒ P : If x2 is an even integer, then x is an even integer. We already proved, if P ⇒ Q. We will prove later that Q ⇒ P is also true. So in this case, both the implication P ⇒ Q and its converse Q ⇒ P are true.

35

2.4.2

The Contrapositive

Remark 2.17. Another way to say “if P , then Q” is to say that “Q is a necessary condition for P ”. This makes sense if we look at the true table. The statement “if P , then Q” entails that P cannot be true without Q also being true. Therefore, Q must hold for P to hold, and so we say that “Q is a necessary condition for P ”. In other words, saying “if P , then Q” is the same as saying “if not Q, then not P ”. (P ⇒ Q) = ((∼ Q) ⇒ (∼ P )) Definition 2.18. Two statements are logically equivalent if they have the same truth table, that is, are true exactly at the same time and false exactly at the same time. P

Q ∼P

∼Q P ⇒Q

(∼ Q) ⇒ (∼ P )

T

T

F

F

T

T

T

F

F

T

F

F

F

T

T

F

T

T

F

F

T

T

T

T

Example 2.19. Let x be an integer. P : x is is a multiple of 6 Q : x is even P ⇒ Q : If x is a multiple of 6, then x is even. (∼ Q) ⇒ (∼ P ) : If x is not even, then x is not a multiple of 6.

36

2.4.3

Biconditional Statements

Definition 2.20. If P and Q are statements, the biconditional “P if and only if Q”, denoted P ⇔ Q, is the statement which is true precisely when P and Q are both true, or P and Q are both false. P

Q

P ⇔Q

T

T

T

T

F

F

F

T

F

F

F

T

P

Q P ⇒Q

Q⇒P

P ⇔ Q (Q ⇒ P ) ∨ (P ⇔ Q)

T

T

T

T

T

T

T

F

F

T

F

F

F

T

T

F

F

F

F

F

T

T

T

T

Remark 2.21. The biconditional “P if and only if Q” is logically equivalent to “if P , then Q, and, if Q, then P ”, that is (Q ⇒ P ) ∨ (P ⇔ Q). Example 2.22. Sometimes, both conditionals are true: P : x is an even integer Q : x + 1 is an odd integer P ⇔ Q : If x is an even integer if and only if x + 1 is an odd integer.

We already proved, if P ⇒ Q. We will prove later that Q ⇒ P is also true. 37

So in this case, both the implication P ⇒ Q and its converse Q ⇒ P are true. Remark 2.23. Other phrasings for the biconditional are: • P iff Q, • P is necessary and sufficient for Q, • if P , then Q, and conversely. Remark 2.24. The statements P ⇔ Q and (∼ P ) ⇔ (∼ Q) are logically equivalent since they have the same truth table.

2.4.4

Negating statements

We defined ∼ P to mean that “It is not true that P ”. If a statement is obtained from other statements using logical connectives, then the negation of that statement depends on the truth value of the inputs. Theorem 2.25 (De Morgan’s Laws). The statement “it is not true that P and Q” is logically equivalent to the statement “it is not true that P or it is not true that Q”. The statement “it is not true that P or Q” is logically equivalent to the statement “it is not true that P and it is not true that Q”. • ∼ (Q ∨ P ) = (∼ P ) ∧ (∼ Q) • ∼ (Q ∧ P ) = (∼ P ) ∨ (∼ Q)

P

Q

∼P

∼Q

P ∨Q

∼ (Q ∨ P )

(∼ P ) ∧ (∼ Q)

P ∧Q

∼ (Q ∧ P )

(∼ P ) ∨ (∼ Q)

T

T

F

F

T

F

F

T

F

F

T

F

F

T

T

F

F

F

T

T

F

T

T

F

T

F

F

F

T

T

F

F

T

T

F

T

T

F

T

T

38

Remark 2.26. The negation of “if P , then Q” is the statement “P and not Q”. (∼ (P ⇒ Q)) = (P ∧ (∼ Q)) P

Q ∼P

∼Q

P ⇒ Q ∼ (P ⇒ Q) P ∧ (∼ Q)

T

T

F

F

T

T

F

T

F

F

T

F

F

T

F

T

T

F

T

T

F

F

F

T

T

T

T

F

39

2.5

Friday, February 9

Activity on truth tables. See worksheet.

40

2.6

Monday, February 12

2.6.1

Intervals

Definition 2.27. A subset of I of R is an interval if, whenever a, b ∈ I with a < b, then x ∈ I for every x such that a ≤ x ≤ b. We use the following notation: • (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} • [a, ∞) = {x ∈ R : a ≤ x} • (a, ∞) = {x ∈ R : a < x} • (∞, a] = {x ∈ R : x ≤ a} • (∞, a) = {x ∈ R : x < a}

2.6.2

Quantifyers

There are two quantifyers, • the universal quantifyer, denoted ∀ and read as “for all” or “for every”. If S is a set and P (x) is an open sentence about x ∈ S, then we write ∀x ∈ S, P (x)

41

• the existential quantifyer, denoted ∃ and read as “there exists” or “for some”. If S is a set and P (x) is an open sentence about x ∈ S, then we write ∃x ∈ S, P (x) Exercise 2.28. Write the following english sentences using logical symbols and decide which of the following statements are true? (1) For all x ∈ R, x2 ≥ 0. ∀x ∈ R, x2 ≥ 0 (2) For some x ∈ R, x2 ≥ 0. ∃x ∈ R, x2 ≥ 0 (3) For every x ∈ R, sin(x) ∈ [−1, 1]. (4) There exists x ∈ R, sin(x) ∈ [−1, 1]. (5) x is even for all x ∈ Z. (6) x is even for some x ∈ Z. (7) For every x ∈ R, ex ≥ 1. (8) For some x ∈ R, ex ≥ 1. (9) For all x ∈ Z, x2 = 3. (10) There exist x ∈ Z, x2 = 3. (11) For all A ⊆ N, |A| is finite.

42

(12) There is some A ⊆ N, such that |A| is finite. (13) For all x ∈ ∅, x ∈ R. (14) For some x ∈ ∅, x ∈ R. (15) All integers are even. (16) Some real numbers are negative. Example 2.29. The order of quantifyers matters. Consider the following two sentences: • For every x ∈ R, there is some y ∈ N such that x ≤ y. ∀x ∈ R, ∃y ∈ N, x ≤ y • There exists some y ∈ N such that x ≤ y for every x ∈ R. ∃y ∈ N, ∀x ∈ R, x ≤ y Exercise 2.30. Write the following sentences in logical symbols using both quantifyers: (1) For every a, b ∈ R with a < b, there is some x ∈ R such that x ∈ (a, b). (2) Every polynomial has a root in R. (3) There is a subset of the integers containing only even integers. (4) Every positive real number has a square root.

43

The negation of the quantifyers satisfies the following identities: ∼ (∀x ∈ S, P (x)) = ∃x ∈ S, ∼ P (x) ∼ (∃x ∈ S, P (x)) = ∀x ∈ S, ∼ P (x)

Exercise 2.31. Rewrite the following negations using the appropriate quantifyers. (1) It is not true that, for all x ∈ R, x2 ≥ 0. (2) It is not true that there exists x ∈ R such that sin(x) ∈ [−1, 1]. (3) Not all integers are even. (4) There is no x ∈ Z such that x2 = 3. (5) It is not true that for every x ∈ R, there is some y ∈ N such that x ≤ y. Exercise 2.32. Negate the statements (1-16) in Exercise 2.28 and (1-4) in Exercise 2.30.

2.6.3

Logical Inference

Logical inference is the process of inferring statements other statements. For example, given P ⇒ Q is true and P , then one can infer that Q is true. This can be read off a truth table. Since we know that both P ⇒ Q and P are true, there is only one possibility: that Q be true also. This is written as P ⇒Q P Q 44

Other examples are P ∧Q Q and P Q P ∧Q

45

2.7

Wednesday, February 14

2.7.1

Broad Strokes for the Topic of Proofs

• Definition: an explanation of the meaning of a mathematical term or symbol. • Axiom: a mathematical statement assumed to be true. • Conjecture: a mathematical statement which is not known to be true or false (but believed to be true by the one who states it). • Theorem: a mathematical statement which has been proved. • Proposition: a mathematical statement which has been proved. Usually perceived as less difficult or of less consequence than a theorem. • Lemma: mathematical statement which has been proved, usually used as a stepping stone to prove a theorem. • Corollary: mathematical statement which has been proved, usually a consequence of a theorem. • Proof: a demonstration using definitions, axioms and previously proved statements that a mathematical statement is true. The symbols  or QED (Quod Erat Demonstrandum) indicates that the demonstration is finished. Some examples: Definition 2.33. A sequence (an )∞ n=1 is bounded if there is a real number M ∈ R such that |an | < M for all n ∈ N.

46

Definition 2.34. A sequence (an )∞ n=1 is increasing if an ≤ an+1 . Lemma 2.35. Every convergent sequence is bounded. Theorem 2.36. An increasing sequence converges if and only if it is bounded above. Corollary 2.37. The sequence

1+

  1 n ∞ n n=1

47

converges.

2.8

Friday, February 16

First midterm.

48

2.9

Monday, February 19

There are many different approaches to proving a statement and we will see various approaches: • Direct Proof: the proof of a statement of the form “if P , then Q” done by assuming that P holds and directly deducing Q using definitions, axioms and previously proved statements. An example may look like

Theorem. If P , then Q. Proof. Assume that P . ... Therefore Q. • Contrapositive Proof: the proof of a statement of the form “if P , then Q” by giving a direct proof of the contrapositive “if ∼ Q, then ∼ P ”.

Theorem. If P , then Q. Proof. Suppose that ∼ Q.. ... It follows that ∼ P . • Proof by Contradiction: the proof of any statement by assuming that the statement does not hold and deriving a contradiction. For example,

Theorem. P 49

Proof. Assume that ∼ P . ... Therefore, ⊥, which is a contradiction. So P must hold.

Theorem. If P , then Q. Proof. Assume that P and ∼ Q. ... Therefore, ⊥, which is a contradiction. So P must hold.

2.9.1

Preliminaries

Definition 2.38. Let a and b be integers. We say that a divides b if there exists an integer n such that b = an. In this case, we write a|b. We also say that b is a multiple of a and that a is a divisor of b or a factor of b. Definition 2.39. An natural number p is prime if it has exactly two positive factors, 1 and p itself. Definition 2.40. Let a and b be integers. The greatest common divisor of a and b is the largest integer that divides a and divides b. It is denoted by gcd(a, b). The least common multiple of a and b is the smallest integer which is a multiple of both a and b. It is denoted by lcm(a, b). We accept the following theorem without proof. Theorem 2.41 (The Division Algorithm). Let a and b be integers and suppose that b > 0. There exists unique integers q and r such that a = qb + r and 0 ≤ r < b.

50

2.9.2

Examples of Direct and Contrapositive Proofs

Proposition 2.42. Let a, b and c be integers. If a|b and b|c, then a|c. Proof. Suppose that a|b and b|c. Since a|b, there exists n ∈ Z such that an = b. Since b|c, there exists m ∈ Z such that bm = c. So, c = bm = (an)m = a(nm). Since nm ∈ Z and c = a(nm), it follows that a|c. Definition 2.43. If x ∈ R,



√ x is a positive real number such that ( x)2 = x.

51

2.10

Wednesday, February 21

We will assume the following theorem: Theorem 2.44. If x ∈ R and x ≥ 0, then



x exists and is unique.

We start with a small lemma which we will prove by contradiction. Lemma 2.45. Let x ∈ R. If x > 0, then Proof. Suppose that x > 0 and that √ that x = 0. So,





x > 0.

x ≤ 0. Since



x ≥ 0, this implies

√ 0 = 02 = ( x)2 = x.

This is a contradiction since x > 0. So, it must be the case that if x > 0, √ x > 0. Proposition 2.46. Let x and y be positive real numbers. If x ≤ y, then √ √ x ≤ y. Proof. Let x, y ∈ R be positive and suppose that x ≤ y. Then 0 ≤ y − x. √ √ By definition, we have ( x)2 = x and ( y)2 = y, so √ √ √ √ √ √ 0 ≤ x − y = ( y)2 − ( x)2 = ( y − x)( y + x). √ x > 0. For the product to √ √ be greater or equal to zero, it must be the case that y − x ≥ 0. It follows √ √ that x ≤ y. Since



x > 0 and



y > 0, we have that



y+

Now, we do prove the same statement using the contrapositive. Proposition 2.47. Let x and y be positive real numbers. If x ≤ y, then √ √ x ≤ y. 52

√ √ √ √ Proof. Let x, y ∈ R be positive and suppose that x > y. Then x− y > √ √ √ √ 0. Since x > 0 and y > 0, then y + x > 0. Since the product of two positive integers is positive, it must be the case that √ √ √ √ 0 < ( x − y)( x + y) = x − y. Therefore, x < y.

2.10.1

Cases

Sometimes, it helps to divide a proof into different cases. Here is an example: Proposition 2.48. If n ∈ N, then 1 + (−1)n (2n − 1) is a multiple of 4. Proof. Case 1. Suppose that n is even. Then n = 2k for some k ∈ N and (−1)n = 1. So 1 + (−1)n (2n − 1) = 1 + (2(2k) − 1) = 1 + 4k − 1 = 4k. So, in this case, n is a multiple of 4. Case 2. Suppose that n is odd. Then n = 2k + 1 for some k ∈ N and

53

(−1)n = −1. So 1 + (−1)n (2n − 1) = 1 + (−1)(2(2k + 1) − 1) = 1 − (4k + 2 − 1) = 1 − (4k + 1) = 4k So, in this case, n is a multiple of 4. If you give a case by case proof, you must make sure that you cover all possible cases, otherwise, your argument will be incomplete.

2.10.2

Without Loss of Generality

Proposition 2.49. If two integers have opposite parity, then their sum is odd. Proof. Suppose that m and n are integers with opposite parity. Case 1. Suppose that m is odd and n is even. Then m = 2k + 1 for an integer k and n = 2h for an integer h. Then, m + n = (2k + 1) + 2h = 2(k + h) + 1. So, m + n is odd. Case 2. Suppose that m is even and n is odd. Then m = 2k for an integer

54

k and n = 2h + 1 for an integer h. Then, m + n = 2k + (2h + 1) = 2(k + h) + 1. So, m + n is odd. In this proof, the variables m and n were arbitrary. We could equally call the even integer m and the odd integer n, or vice versa. In such a situation, mathematicians use the phrase “without loss of generality”: Proof. Suppose that m and n are integers with opposite parity. Without loss of generality, suppose that m is odd and that n is even. Then m = 2k + 1 for an integer k and n = 2h for an integer h. Then, m + n = (2k + 1) + 2h = 2(k + h) + 1. So, m + n is odd. The sentence Suppose that m and n are integers with opposite parity. Without loss of generality, suppose that m is odd and that n is even. is equivalent to Suppose that we have two integers with opposite parity. Call the odd integer m is odd and and the even integer n.

55

2.11

Friday, February 23

2.11.1

Without Loss of generality continued

Here is a wrong kind of use of “without loss of generality”: Proposition 2.50 (Wrong proof). If n ∈ N, then 1 + (−1)n (2n − 1) is a multiple of 4. Proof. Without loss of generality, suppose that n is even. Then n = 2k for some k ∈ N and (−1)n = 1. So 1 + (−1)n (2n − 1) = 1 + (2(2k) − 1) = 1 + 4k − 1 = 4k. So, in this case, n is a multiple of 4. This proof is incorrect since by supposing that n is even, we do loose generality since we are treating a specific case: not all integers are even. Sometimes, when the proof for different cases look very much a like but are cannot simply be dealt with the phrase “without loss of generality”, mathematicians will use the word similarly, or similar. However, technically, such a proof is incomplete, since all cases have not been treated. Proposition 2.51 (Incomplete Proof). If x is an integer, then x2 has the same parity as x. Proof. We will suppose that x is even. The proof when x is odd is similar. . . . (you’ve seen this proof already).

56

2.11.2

Proof by Contradiction

Axioms (Axioms of Order). Let a, b, c ∈ Z. • (Transitivity) If a < b and b < c, then a < c. • (Monotony) If a < b, then a + c < b + c. If a < b and 0 < c, then a·c a. Since d|a, there exists an integer n such that dn = a. Furhter, since a > 0 and d > 0, n > 0. So, n ≥ 1 since there are no integers between 0 and 1. Therefore, d = d · 1 ≤ d · n = a. So, d ≤ a. This is a contradiction we assumed that d > a. Therefore, it follows that if d|a and for positive integers a and d, then d ≤ a. Remark 2.57. This is a situation when a direct proof would have been preferable. Note, if we simply remove the red part, we are left with a shorter direct proof of what we wanted to show. 58

2.12

Monday, February 26

2.12.1

Proof by Contradiction Continued

Proofs can mix different methods too. Here is an example: Theorem 2.58 (Cancellation for multiplication). Let a, b, c ∈ Z with a 6= 0. If ab = ac, then b = c. Proof. Suppose that ab = ac and that b 6= c. Then b − c 6= 0. Therefore, either b < c or c < b. Without loss of generality, we assume that b < c. Further, since a 6= 0, either a < 0 or 0 < a. Case 1. 0 < a. Since b < c and 0 < a, ab < ac. This is a contradiction since ab = ac. Case 2. a < 0. Then 0 < (−a) Since b < c and 0 < (−a), −ab < −ac so that ac < ab. This is a contradiction since ab = ac. So, in all cases, we reach a contradiction, so it must be the case that b = c. Definition 2.59. Two integers a and b are coprime if they have no common prime factors. Definition 2.60. A real number x is rational if there are coprime integers a and b with b 6= 0 such that bx = a. In this case, we write x = ab . A real number x is irrational if it is not rational. √ Theorem 2.61. The real number 2 is irrational. √ Proof. Suppose for the sake of contradiction that 2 is rational. Let a and √ √ b be coprime integers such that 2 = ab . Then, 2b = a so that, squaring 59

both sides, we get 2b2 = a2 . Therefore, 2|a2 . Since 2 is prime, 2|a and hence, there is an integer n such that 2n = a. Therefore, 4n2 = a2 . So, 4n2 = 2b2 . By cancellation, this implies that 2n2 = b2 , so that 2|b2 . Since 2 is prime, 2|b. However, this is a contradiction since a and b are coprime.

2.12.2

Congruence of Integers

Definition 2.62. Let n ∈ N. Two integers a and b are congruent modulo n if n|(a − b). We write a ≡ b mod n. If a and b are not congruent modulo n, we write a 6≡ b mod n. Example 2.63.

• 9 ≡ 1 mod 4

• 9 6≡ 2 mod 4 • 9 ≡ 0 mod 3 • 3 ≡ 1 mod 2 • a ≡ a mod n for any a ∈ Z • a ≡ b mod 1 for any a, b ∈ Z

60

2.13

Wednesday, February 28

Proposition 2.64. Let n ∈ N. Let a, b, c, d be integers. If a ≡ c mod n and b ≡ d mod n, then a + b ≡ c + d mod n. Proof. Suppose that a ≡ c mod n and b ≡ d mod n. Then there exists k and h in Z such that a − c = kn and b − d = hn. Therefore, a + b − (c + d) = (a − c) + (b − d) = kn + hn = (k + h)n. So, (k + h)|(a + b − (c + d)) and a + b ≡ c + d mod n. Exercise 2.65. Prove the following statement: (a) Let n ∈ N. For integers a and b, a ≡ b mod n if and only if b ≡ a mod n. (b) Let n ∈ N. Let a, b, c, d be integers. If a ≡ c mod n and b ≡ d mod n, then a · b ≡ c · d mod n. Recall the statement of the division algorithm: If a and n are integers and n > 0, then there exists unique integers q and r such that a = nq + r and 0 ≤ r < n. (c) Let a and a0 be integers. Let q and r be the unique integers such that a = nq + r with 0 ≤ r < n. Let q 0 and r0 be the unique integers such that a0 = nq 0 + r0 with 0 ≤ r0 < n. Then a ≡ a0 mod n if and only if r ≡ r0 mod n.

2.13.1

If and only if, and the following are equivalent.

Some theorems state that a list of statements are equivalent. The simplest example is the proof of a statement of the form “P if and only if Q. 61

Theorem. P if and only if Q Proof. Step 1. Prove “if P , then Q”. Step 1. Prove “if Q, then P ”.

Theorem 2.66 (A special case of the Chinese Remainder Theorem). Let p and q be distinct prime numbers. Then n ≡ m mod pq if and only if n ≡ m mod p and n ≡ m mod q. Proof. First, we prove that if n ≡ m mod pq, then n ≡ m mod p and n ≡ m mod q. Suppose that n ≡ m mod pq. By definition, pq|(n − m). However, p|pq. Since for any integers a, b, c, if a|b and b|c, then a|c, this implies that p|(n − m). By definition, n ≡ m mod p. Also, q|pq, so q|(n − m), so n ≡ m mod q. Next, we prove that if n ≡ m mod p and n ≡ m mod q, then n ≡ m mod pq. Suppose that n ≡ m mod p and n ≡ m mod q. Since n ≡ m mod p, there exists k ∈ Z such that n − m = kp. Since n ≡ m mod q, then q|(n − m) an so q|kp. Since q is prime, q|p or q|k. However, q and p are distinct primes, so q - p. Therefore, q|k and there exists h such that qh = k. We thus have n − m = kp = qhp = h(pq). So, pq|(n − m) and n ≡ m mod (pq).

62

2.14

Friday, March 2

Activity on Axioms in the Integers - Part I - Arithmetic

63

2.15

Monday, March 5

Activity on Axioms in the Integers - Part II - Order

64

2.16

Wednesday, March 7

2.16.1

The following are equivalent (TFAE)

More generally, one might want to show that a list of statements are equivalent: Theorem. The following are equivalent: • P1 • P2 • ... • Pn This theorem states that the statement “Pi if and only if Pj ” is a true statement for any 1 ≤ i, j ≤ n. Here are examples of ways you can go above proving such a statement: • P1 ⇒ P2 ⇒ . . . ⇒ Pn ⇒ P 1 . • P1 ⇔ P2 and P2 ⇒ . . . ⇒ Pn ⇒ P2 . • P1 ⇒ P2 ⇒ P3 ⇒ P1 and P4 ⇒ . . . ⇒ Pn ⇒ P4 and P3 ⇔ P4 . • etc. Definition 2.67. Let a ∈ R. The absolute value of a, written |a| is defined by |a| =

  a

a≥0

 −a a < 0. 65

Lemma 2.68. Let  ∈ R be such that  > 0. Let a, b ∈ R. The following are equivalent: (a) |a − b| <  (b) − < a − b <  (c) a ∈ (b − , b + ) Proof. We show that (a) implies (b). First, suppose that |a − b| < . If a − b ≥ 0, this implies that a − b = |a − b| < . In this case, − < 0 ≤ a − b <  and the claim holds. If a − b < 0, then |a − b| = b − a < . So, − < a − b < 0 <  and the claim holds again. Since − < a − b <  in all cases, (a) implies (b). We show that (b) implies (c). Suppose that − < a − b < . Then, adding b to both inequalities, b −  < a < b + . So, By definition, (b − , b + ) = {x ∈ R : b −  < x < +}, so a ∈ (b − , b + ). We show that (c) implies (a). Suppose that a ∈ (b − , b + ). If a − b > 0, then |a − b| = a − b. Since a ∈ (b − , b + ), a < b + . So a − b <  and it follows that |a − b| = a − b < . If a − b < 0, then |a − b| = b − a. Since a ∈ (b − , b + ), b −  < a, so b − a <  and hence |a − b| = b − a < . In both cases, |a − b| <  and so (c) implies (a).

66

Figure 2.1: https://xkcd.com/1856/ Remark 2.69. For this proof one could have also shown (a) ⇔ (b), and (b) ⇔ (c)

2.16.2

Existence Proofs

An existence statement is one of the form There exists x ∈ S such that P (x). A statement of this form can be proved by simply constructing an example. This is called a constructive proof. One can also prove that an example must exist without constructing one explicitly. This is called a non-constructive proof. Lemma 2.70. There exists a prime of the form 2n − 1 for some n ∈ N. Constructive proof. Let n = 3 and note that 23 − 1 = 8 − 1 = 7 is a prime number, which proves the claim.

67

Remark 2.71. Primes of the form 2n − 1 are called Mersenne Primes. It is not known if there are infinitely many of them, although we are still finding new ones via the Great Internet Mersenne Prime Search. Proposition 2.72. There exists irrational real numbers x and y such that xy is rational. √ √2 Proof. Non-constructive proof.] Consider a = 2 . If a is rational, we can √ √ let y = x = 2. So suppose that a is irrational. Then let x = a and y = 2. In that case,

√ √2 √2 √ √ √ √ 2 x = ( 2 ) = ( 2) 2· 2 = 2 = 2 y

which is rational. Remark 2.73. One can prove that





2

2

is in fact an irrational number,

but this is a hard result called the Gelfond-Schneider Theorem, and solved Hilbert’s seventh problem. However, there is a constructive proof for this particular statement that uses different examples of x and y. See the book, p.128.

2.16.3

Existence and Uniqueness Proofs

Sometimes, we not only want to prove that x exists, but also want to know that x is unique. In other words, we want to prove There exists x such that P (x), and if P (x) and P (x0 ), then x = x0 . Lemma 2.74. There exists a natural number n ∈ N such that n2 = 4. Proof. Proving Existence Since 22 = 4, we know that there exists some n ∈ N such that n2 = 2, namely, n = 2. 68

Proving Uniqueness Suppose that m ∈ N is a natural number such that m2 = 4. Then m2 = 22 and so (m − 2)(m + 2) = 0. Since m and 2 are both positive, then m + 2 > 0 so in particular, m + 2 6= 0. By cancellation for multiplication, it follows that (m − 2) = 0, so that m = 2.

69

2.17

Friday, March 9

2.17.1

Proofs with sets

Now that we’ve developed multiple methods of proof, we return to sets and revisit proofs involving statements about sets.

2.17.2

Proving x ∈ X

To prove that an element x is in a set X, you must prove that x satisfies the conditions that define the elements of X.

Theorem. Let A = {x : P (x)}. Then a ∈ A. Proof. Prove that P (a). or

Theorem. Let X = {y ∈ S : P (y)}. Then x ∈ X. Proof. Prove that x ∈ S and that prove that P (x). For example: Lemma 2.75. Let A = {n ∈ N : n is an odd square.}. The natural number 25 is in A. 70

Proof. Since 25 > 0 25 ∈ N. Further, 25 is odd and 25 = 52 , it follows that 25 ∈ A.

2.17.3

Proving X ⊆ Y

To prove that a set X is a subset of a set Y , you have to show that “if z ∈ X, then z ∈ Y ”. Here is a template:

Theorem. X ⊆ Y Proof. Suppose that z ∈ X. ... Therefore, z ∈ Y . For example: Lemma 2.76. Let P = {(x, y) ∈ R2 : y > 0} G = {(x, y) ∈ R2 : y = x2 + 1}. Then G ⊆ P . Proof. Let (x, y) ∈ G so that y = x2 + 1. Since x2 ≥ 0 for any x ∈ R, and 1 > 0, then x2 + 1 > 0. Therefore, y = x2 + 1 > 0, and so (x, y) ∈ P . Proposition 2.77. Let A and B be sets. Then P(A) ∪ P(B) ⊆ P(A ∪ B).

71

Proof. Let X ∈ P(A) ∪ P(B). Then X ∈ P(A) or X ∈ P(B). If X ∈ P(A), then X ⊆ A. Further, since X ⊆ A and A ⊆ A ∪ B, X ⊆ A ∪ B. So, X ∈ P(A ∪ B). Similarly, if X ∈ P(B), then X ⊆ B, and so X ⊆ A ∪ B. Therefore, X ∈ P(A ∪ B). In all cases, X ∈ P(A ∪ B). So, we have shown that P(A) ∪ P(B) ⊆ P(A ∪ B).

2.17.4

Proving X 6⊆ Y

To prove that a set X is not a subset of a set Y , you have to show that “There exists x0 ∈ X such that x0 6∈ Y .” For example, one could show this by doing a constructive proof. Here is a template:

Theorem. X 6⊆ Z Proof. Consider x0 ∈ X (for a specific x0 ). ... Therefore, x0 6∈ Y . Lemma 2.78. Let P = {(x, y) ∈ R2 : y > 0} G = {(x, y) ∈ R2 : y = x2 − 1}. Then G 6⊆ P .

72

Proof. Consider (x, y) = (1, 0). Then p ∈ G since y = 0 = 12 − 1 = x2 − 1. However, since y = 0, (x, y) 6∈ P .

2.17.5

Proving X = Y

To prove that two sets X and Y are equal, you have to prove the statement “z ∈ X if and only if z ∈ Y ”. That is, you have to show that both the statements X ⊆ Y and Y ⊆ X are true. Here is a template:

Theorem. X = Y Proof. First, suppose that z ∈ X. ... It follows that, z ∈ Y .

Now, suppose that z ∈ Y . ... Therefore, z ∈ X. Proposition 2.79. Given sets A, B and C and D (A × B) − (C × D) = ((A − C) × B) ∪ (A × (B − D))

73

Proof. First, we show that (A × B) − (C × D) ⊆ ((A − C) × B) ∪ (A × (B − D)).

(2.1)

Let p ∈ (A × B) − (C × D). Then p ∈ A × B and p 6∈ (C × D). Therefore, p = (a, b) for a ∈ A and b ∈ B, but a 6∈ D or b 6∈ D. If a 6∈ C, then (a, b) ∈ (A − C) × B. If b 6∈ D, then (a, b) ∈ (A × (B − D)). So, either (a, b) ∈ (A − C) × B or (a, b) ∈ (A × (B − D). That is, p = (a, b) ∈ ((A − C) × B) ∪ (A × (B − D)) which proves that (2.1). Next, we show that ((A − C) × B) ∪ (A × (B − D)) ⊆ (A × B) − (C × D).

(2.2)

Let p ∈ ((A − C) × B) ∪ (A × (B − D)). Then either p ∈ (A − C) × B or p ∈ A×(B −D). If p ∈ (A−C)×B, then p = (a, b) for some a ∈ A such that a 6∈ C and some b ∈ B. Since a ∈ A and b ∈ B, (a, b) ∈ A × B. However, since a 6∈ C, (a, b) 6∈ C × D. So, p = (a, b) ∈ (A × B) − (C × D). Now, suppose that p ∈ A × (B − D). Then p = (a, b) for some a ∈ A and some b ∈ B such that b 6∈ D. Since a ∈ A and b ∈ B, (a, b) ∈ A × B. However, since b 6∈ D, (a, b) 6∈ C × D. So, p = (a, b) ∈ (A × B) − (C × D)

74

which proves that (2.2). Since we have shown both (2.1) and (2.2), we can conclude that (A × B) − (C × D) = ((A − C) × B) ∪ (A × (B − D)).

75

2.18

Monday, March 12

2.18.1

(Weak) Mathematical Induction

Mathematical induction is a method that allows one to prove a family of statements {P (n)}n∈N . For example, consider the statement P (n) : 1 + 2 + . . . + n =

n(n + 1) . 2

For example, 1(1 + 1) 2 2(2 + 1) P (2) : 1 + 2 = 2 3(3 + 1) P (3) : 1 + 2 + 3 = 2 P (1) : 1 =

which we observe are all true. Now, suppose for a moment that P (k) was known true for some k ∈ N. In other words, let’s assume that 1 + 2 + ... + k =

76

k(k + 1) 2

and let’s try to see what that tells us about P (k + 1). By our assumption, we have that k(k + 1) + (k + 1) 2 k(k + 1) + 2(k + 1) = 2 k 2 + k + 2k + 2 = 2 k 2 + 3k + 2 = . 2

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

Now, note that (k + 1)((k + 1) + 1) (k + 1)(k + 2) = 2 2

=

k 2 + 3k + 2 . 2

Therefore, 1 + 2 + . . . + k + (k + 1) =

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

which is P (k + 1). So, it follows that P (k) implies P (k + 1). Now, we’ve shown (1) (Base Case) P (1) is true. (2) (Inductive Step) P (k) implies P (k + 1) for k ≥ 1. That is, we have shown the following statement: P (1) ∧ P (1) ⇒ P (2) ⇒ P (3) ⇒ . . . ⇒ P (k) ⇒ P (k + 1) ⇒ . . . Since (Q ∧ (Q ⇒ R)) ⇒ R 77



is a true statement, we can deduce that P (n) is true for every n ∈ N. Now, these are heuristics, but the following theorem follows from the axioms for the integers and the Well-Ordering Principal: Theorem 2.80 ((Weak) Mathematical Induction). Let {P (n)}n≥N be a family of statements such that (1) P (1) is true. (2) For k ≥ 1, if P (k) is true, then P (k + 1) is true. Then, P (n) is true for all n ∈ N. The principle of mathematical induction is used in proofs as follows:

Theorem. For all n ∈ N, P (n). Proof. Base Case. Prove that P (1) holds true.

Induction Step. Let k ≥ 1 and assume that P (k) is true. This is called the inductive hypothesis. Prove P (k + 1).

Conclusion. By the principle of mathematical Induction, P (n) holds for all n ∈ N. Let’s do our first example formally. Proposition 2.81. For all n ∈ N,

Pn

i=1

78

i = 1 + 2 + ... + n =

n(n+1) 2

Proof. First, consider the case when n = 1. Since 2 2

P1

i=1

i = 1 and

1(1+1) 2

=

= 1, the claim holds in this case. Next, assume that k ≥ 1 and that

Pk

i=1

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

i=

k(k+1) . 2

Then

k(k + 1) + (k + 1) 2 k(k + 1) + 2(k + 1) 2 2 k + k + 2k + 2 2 k 2 + 3k + 2 2 (k + 1)(k + 2) 2 (k + 1)((k + 1) + 1) . 2

Therefore, the claim for n = k implies the claim for n = k + 1. P for all n ∈ By the principle of mathematical Induction, ni=1 i = n(n+1) 2 N. Another example of this kind: Proposition 2.82. Let n ∈ N. Then

Pn

i=1 (2i

− 1) = n2 .

Proof. For n = 1, the sum has one term, namely

P1

i=1 (2i − 1)

On the other hand, 12 = 1, so the claim holds in this case.

79

= 2 · 1 − 1 = 1.

Let k ≥ 1 and assume that

Pk

i=1 (2i

− 1) = k 2 . Then

k+1 k X X (2i − 1) = (2i − 1) + 2(k + 1) − 1 i=1

i=1

= k 2 + 2(k + 1) − 1 = k 2 + 2k + 1 = (k + 1)2 . So, the claim for k implies the claim for k + 1. By the principle of mathematical induction,

Pn

i=1 (2i

− 1) = n2 for all

n ∈ N. Mathematical induction can be modified to prove that a family of statement {P (n) : n ∈ N} is true for all n ≥ n0 where n0 need not be 1. In that case, the base case is P (n0 ) rather than P (1).

80

2.19

Wednesday, March 14

2.19.1

Weak Induction Continued

Theorem 2.83. Let p be a prime number. Suppose that for any n integers a1 , . . . , an with n ≥ 2, if p|a1 . . . an , then p|ai for some i such that 1 ≤ i ≤ n Proof. First, let n = 2. We’ve already shown that if p is prime and p|ab, then p|a or p|b, so the base case holds. Let k ≥ 1 and suppose that if p divides the product of k integers, then it divides at least one of them. Suppose that p|a1 . . . ak+1 . Then, note that a1 . . . ak+1 = (a1 . . . ak ) · ak+1 . By the base case, p|(a1 . . . ak ) or p|ak+1 . If p|(a1 . . . ak ), then by the inductive hypothesis, p|ai for some i such that 1 ≤ i ≤ k. Otherwise, p|ak+1 and so, p|ai at least one i such that 1 ≤ i ≤ k + 1. By the principle of mathematical induction, the claim holds for all n ∈ N, n ≥ 2.

2.19.2

Strong Mathematical Induction Continued

Theorem 2.84 (Strong Mathematical Induction). Let {P (n)}n≥N be a family of statements such that (1) P (1) is true. (2) For k ≥ 1, if P (i) is true for 1 ≤ i ≤ k, then P (k + 1) is true. Then, P (n) is true for all n ∈ N. Strong induction in used in proofs as follows: 81

Theorem. For all n ∈ N, P (n). Proof. Base Case. Prove that P (1) holds true.

Induction Step. Let k ≥ 1 and assume that P (k) is true for 1 ≤ i ≤ k. This is called the inductive hypothesis. Prove P (k + 1).

Conclusion. By induction, P (n) holds for all n ∈ N. Proposition 2.85. Any natural number n > 1 can expressed as a product p1 . . . ps where pi is a prime number for 1 ≤ i ≤ s. Proof. If n = 2, then taking s = 1 and p1 = 2 proves the claim. Let k > 1 and suppose that any natural number 2 ≤ m ≤ k can expressed as a product of prime numbers. Consider k+1. We’ve proved that any natural number has a prime divisor. So let p1 be such that p1 |k +1 and choose m ∈ N such that k + 1 = p1 m. If m = 1, then we are done. If m > 1, then since p1 > 1, m < k + 1. That is, 2 ≤ m ≤ k. So, m can be expeessed as a product of primes, m = p2 . . . ps . And so, k + 1 = p1 p2 . . . ps . By induction, the claim holds for all n ∈ N.

82

Let’s do an interesting example. A simple graph G is a set V of vertices and a subset E ⊆ {X : X ⊆ V, |X| = 2}. If x and y are vertices in G, then a path from v0 to v1 is a collection of vertices v0 = w0 , w1 , . . . , wk−1 , wk = v1 and edges ei = {wi , wi+1 } for 0 ≤ i ≤ k − 1. Here, if v0 = v1 , we allow the path which contains no edges and only the vertex v0 = w0 . The path is called simple if there are no repeated edges. A graph is called connected if there is a path between any two vertices and a connected graph is called a tree if for any two vertices v0 , v1 ∈ V there is a unique simple path from x to y. Exercise 2.86. Let T be a tree with vertices V and edges E. If e ∈ T , then the graph obtained from T by removing e is the disjoint union of two trees T1 and T2 such that the vertices and edge V1 and E1 of T1 and V2 and E2 of T2 have the following properties : • V1 ∩ V2 = ∅ • V1 ∪ V2 = V • E1 ∩ E2 = ∅ • E1 ∪ E2 = E − {e} Proposition 2.87. A tree with n vertices has n − 1 edges. Proof. A tree with one vertex has zero edges, so the claim holds when n = 1. Let k ≥ 1 and suppose that for all i such that 1 ≤ i ≤ k, a tree with i vertices has i − 1 edges. Suppose T is a tree k + 1 edges and let V be its set of 83

vertices. Choose an edge e = {v1 , v2 } ∈ T and consider the graph obtained from T by removing e. Then T is the disjoint union of two trees T1 and T2 with vertices and edges V1 and E1 , and V2 and E2 respectively. Both T1 and T2 have at least one less vertex then T since v1 6∈ T2 and v2 6∈ T1 . By the inductive hypothesis, • |E1 | = |V1 | − 1 • |E2 | = |V2 | − 1 Therefore, |E1 ∪ E2 | = |E1 | + |E2 | = |V1 | + |V2 | − 2. However, since E = E1 ∪ E2 ∪ {e}, |E| = |E1 | + |E2 | + 1 so, |E| = |E1 | + |E2 | + 1 = |V1 | + |V2 | − 1 = |V1 ∪ V2 | − 1 = (k + 1) − 1. Therefore, the claim holds when n = k + 1. By induction, the claim holds for all n ∈ N.

84

2.20

Friday, March 16

2.21

Monday, March 19

2.22

Wednesday, March 21

2.23

Friday, March 23

Worksheet on Induction and Counting

85

2.24

Monday, April 2

2.24.1

Relations

Definition 2.88. Let X and Y be sets. (a) A relation is a subset of X × Y . (b) A relation on X is a subset of X × X. Remark 2.89. If R ⊆ X × Y is a relation and (x, y) ∈ R, we often use notation such as x ∼ y or x ≡ y, or other methods to indicate that x and y are related. The book uses xRy. Example 2.90. (a) Equality is a relation. We can think of = as the set = = {(x, x) | x ∈ X}.

(b) Given any function f : R → R, we get a relation f = {(x, f (x)) | x ∈ R} ⊆ R × R. This is often called the graph of f . In fact, we will see that the definition of a function is that of a relation satisfying special conditions. (c) The ordering on the integers is an example of a relation: < = {(a, b) ∈ Z × Z | a is (strictly) less than b}. (d) Let n ∈ N. Then ≡ = {(a, b) ∈ Z × Z | a ≡ b mod n }. 86

is a relation.

2.24.2

Equivalence Relations

In mathematics, it is often useful to forget certain differences between mathematical objects. For example, we often only consider triangles up to similarity, forgetting their size and only remembering their shape. Or if two real numbers represent the same angle. When we take the floor of a number, we are treating all real numbers in the interval [n, n + 1) as being the same. Different field of mathematics define themselves by the amount of information they decide to forget or not forget. To make this process rigorous, mathematicians use equivalence relations and equivalence classes. Definition 2.91. Let ∼⊆ X × X be a relation on X. Then ∼ is an equivalence relation if ∼ satisfies the following properties: (a) (Reflexivity) For all a ∈ X, a ∼ a. (b) (Symmetry) If a ∼ b then b ∼ a. (c) (Transitivity) If a ∼ b and b ∼ c, then a ∼ c. Example 2.92. (1) =, the subset {(x, x) | x ∈ X} ⊆ X × X is an equivalence relation. (2) < is not an equivalence relation. It fails reflexivity and symmetry. ≤ fails symmetry. Exercise 2.93. Let Z × Z6=0 = {(a, b) | a, b ∈ Z and b 6= 0}. 87

Say that (a, b) ∼ (c, d) if and only if ad = bc. Then ∼ is an equivalence relation on Z × Z6=0 . In fact, this example gives rise to Q as we will see. Example 2.94. Let n ∈ N. Then equivalence modulo n is an equivalence relation on Z. (a) (Reflexivity) Since n|(a − a), a ≡ a mod n. (b) (Symmetry) Suppose that a ≡ b mod n. Then n|(a − b). So there exists k ∈ Z such that nk = a − b. It follows that n(−k) = b − a, so that n|(b − a). That is, b ≡ a mod n. (c) (Transitivity) Suppose that a ≡ b mod n and that b ≡ c mod n. Then there are k, h ∈ Z such that nk = a − b and nh = b − c. So, n(k + h) = nk + nh = (a − b) + (b − c) = a − c, hence, n|(a − b). Therefore, a ≡ c mod n.

88

2.25

Wednesday, April 4

Recall from last time: Definition 2.95. Let ∼⊆ X × X be a relation on X, where we write a ∼ b if (a, b) ∈∼. Then ∼ is an equivalence relation if ∼ satisfies the following properties for all a, b, c ∈ X: (a) (Reflexivity) a ∼ a (b) (Symmetry) If a ∼ b then b ∼ a. (c) (Transitivity) If a ∼ b and b ∼ c, then a ∼ c.

2.25.1

Equivalence classes

Definition 2.96. Let X be any set and ∼ be an equivalence relation on X. If x ∈ X, then the set [x] = {y ∈ X | y ∼ x} ⊆ X is called the equivalence class of x in X. We often write X/∼ = {[x] : x ∈ X} for the set of equivalence classes. The elements of X/∼ are subsets of X. Question 2.97. Let X = {1, 2, 3} and consider the equivalence relation R = {(1, 1), (2, 2), (3, 3), (1, 2), (2, 1)}. What are the sets [1], [2] and [3]? 89

Answer. We have [1] = {1, 2}, [2] = {1, 2} and [3] = {3}. Example 2.98. Consider equivalence modulo 2 on Z. Then [0] = {x ∈ Z : x ≡ 0

mod 2} = {x ∈ Z : x is even}

[1] = {x ∈ Z : x ≡ 1

mod 2} = {x ∈ Z : x is odd}

and

And, if n ∈ Z, we have

[n] =

  {x ∈ Z : x is even} n even  {x ∈ Z : x is odd}

n odd.

Example 2.99. Consider a set X and the equivalence relation given by equality. Then [x] = {x ∈ X : x = x} = {x}. So each equivalence classes in this case contains only one element. Example 2.100. Let Z × Z6=0 = {(a, b) | a, b ∈ Z and b 6= 0}. Say that (a, b) ∼ (c, d) if and only if ad = bc. Then ∼ is an equivalence relation on Z × Z6=0 . (Exercise!) Now, we let a := [(a, b)] = {(c, d) ∈ Z × Z6=0 | ad = bc}. b

90

The rational numbers Q are the equivalence classes in Z × Z6=0 for ∼. That is Q = (Z × Z6=0 )/∼. Lemma 2.101. If ∼ is an equivalence relation on X, then [x] = [y] if and only if x ∼ y. Proof. Suppose that [x] = [y]. Since x ∼ x, x ∈ [x]. So, since [x] = [y], we have x ∈ [y]. Therefore, x ∼ y. Conversely, suppose that x ∼ y. Suppose that a ∈ [x]. Then a ∼ x. By transitivity, a ∼ y, so a ∈ [y]. Therefore, [x] ⊆ [y]. Suppose that b ∈ [y]. So b ∼ y. By symmetry, we have that y ∼ b. So, by transitivity, x ∼ b. Finally, by symmetry again, b ∼ x. So, b ∈ [x]. Therefore, [y] ⊆ [x]. It follows that [x] = [y].

91

2.26

Friday, April 6

Midterm 2

92

2.27

Monday, April 9

2.27.1

Partitions

Last time, we proved: Lemma 2.102. If ∼ is an equivalence relation on X, then [x] = [y] if and only if x ∼ y. Lemma 2.103. Let ∼ be an equivalence relation on X. Then exactly one of the following holds. • [x] ∩ [y] = ∅ • [x] = [y] Proof. First, note that x ∈ [x] so [x] 6= ∅. So, if [x] = [y], then [x] ∩ [y] = [x] 6= ∅. So only one of the two claims can be true. To prove [x] ∩ [y] = ∅ or [x] = [y], we show that if [x] ∩ [y] 6= ∅, then [x] = [y]. Suppose that [x] ∩ [y] 6= ∅ and let a ∈ [x] ∩ [y]. Then a ∼ x and a ∼ y. By symmetry, x ∼ a and by transitivity, this implies that x ∼ y. By the previous lemma, [x] = [y]. Lemma 2.104. Let ∼ be an equivalence relation on X. The union of all the equivalence classes is the set X. That is, [

[x] = X

x∈X

(Note, there can be repetition among the sets listed in the union 93

S

x∈X [x]!)

Proof. Let x ∈ X. Then x ∈ [x]. So, x ∈ [x] ⊆

[

[x].

x∈X

This implies that X ⊆

S

x∈X [x].

However, since [x] ⊆ X for all x ∈ X, we also have that [

[x] ⊆ X,

x∈X

which proves the claim. Definition 2.105. Let X be a set. A partition of X is a set P ⊆ P(X) of pairwise disjoint non-empty subsets of X whose union is X. Example 2.106. Let E ⊆ Z be the set of even integers and O ⊆ Z be the set of odd integers. Then {E, O} is a partition of Z. Example 2.107. Let X = {1, 2, 3}. Then P = {{1, 2}, {3}} is a partition of X. Example 2.108. The set P = {{n, n + 1} : n ∈ Z, n is even} is a partition of Z. Example 2.109. The set P = {[n, n + 1) :∈ Z} is a partition of R. Combining Lemma 2.104 and Lemma 2.103 above proves that if ∼ is an equivalence relation on X, the set of equivalence classes is a partition of X. Indeed, the union of the sets in X/∼ is X and these sets are pairwise disjoint. That is: Proposition 2.110. Let X be a set and ∼ be an equivalence relation on X. Then X/∼ is a partition of X. 94

2.28

Wednesday, April 11

2.28.1

Partitions, continued

Recall from last time: Definition 2.111. Let X be a set. A partition of X is a set P ⊆ P(X) of pairwise disjoint non-empty subsets of X whose union is X. We showed that the set of equivalence classes forms a partition of X. Conversely, the following result shows that a partition also gives rise to an equivalence relation. You will prove the following in your homework: Proposition 2.112. Let X be any set and P = {Xi }i∈I be a partition of X. Let x ∼P y if and only if there is an i such that x and y are both in Xi . This is an equivalence relation on X. In fact, partitions and equivalence relations go hand in hand: Theorem 2.113. Let ∼ is be an equivalence relation and consider P = X/∼ as a partition of X. Then the equivalence relation ∼P is equal to ∼. Similarly, P is a partition of X and ∼P the associated equivalence relation, then X/∼P = P . Proof. First we show that ∼P is equal to ∼ by showing that x ∼ y if and only if x ∼P y. Suppose that x ∼P y. Then there exists [z] ∈ X/ ∼ such that x and y are in [z]. Then x ∼ z and y ∼ z. By symmetry z ∼ y, so by transitivity, x ∼ y. Conversely, if x ∼ y, then [x] = [y]. So both x and y are in [x] ∈ X/ ∼. Therefore, x ∼P y. Now, suppose that P = {Xi : i ∈ I} is a partition and ∼P is the associated equivalence relation. We prove that X/∼P = P . 95

Let [x] ∈ X/∼P and choose i such that x ∈ Xi . Then [x] = {y ∈ X : y ∼ x} = {y ∈ X : y and x are both in Xi .}

= {y ∈ X : y ∈ Xi } = Xi

So, Xi ∈ P and hence, X/ ∼⊆ P . Now, let Xi ∈ P . Since Xi 6= ∅, we can choose x ∈ Xi . Then, Xi = {y ∈ X : y ∈ Xi } = {y ∈ X : x, y ∈ Xi } = {y ∈ X : y ∼P x} = [x]. So, Xi ∈ X/∼ and this proves that P ⊆ X/∼. We conclude that P = X/∼.

2.28.2

Integers modulo n

Lemma 2.114. Let n ∈ N and a, b ∈ Z. Then b ≡ a mod n if and only if they have the same remainder with respect to division by n. Proof. Suppose that b ≡ a mod n. Let q, r, h, s ∈ Z be such that a ≡ nq + r

0≤r r or r > s. Since n|(b−a),

96

n divides (hn + s) − (qn + r) = n(h − q) + s − r. So, n divides s − r. It then also divides r − s. Recall that if n > 0 divides an integer x > 0, then n ≤ x. Case 1. If s > r, then s − r > 0 and since n|(s − r), we have that 0 < n ≤ s − r. But, then n ≤ n + r ≤ s, a contradiction since s < n. Case 2. If r > s, then n ≤ r − s, so, n ≤ n + s ≤ r, a contradiction since r < n. So, it must be the case that r = s. Conversely, suppose that r = s. Then b − a = (nh + s) − (nq + r) = n(h − q), so n|(b − a) and hence b ≡ a mod n

97

2.29

Friday, April 13

2.29.1

Integers modulo n finished

Last time, we ended discussing: Lemma 2.115. Let n ∈ N and a, b ∈ Z. Then b ≡ a mod n if and only if they have the same remainder with respect to division by n. Let n ∈ N and consider congruence modulo n on Z. Since [a] = [b] if and only if a ≡ b mod n, we deduce that [a] = [b] if and only if a and b have the same remainder after division by n. Since the remainder r satisfies 0 ≤ r < n, there n equivalence classes, namely: Zn := Z/(≡n ) = {[0], [1], . . . , [n − 1]}. Suppose that [a] = [b] and [c] = [d]. We’ve shown: • [a + b] = [c + d] (in class) • [a · b] = [c · d] (homework) So it makes sense to define: [a] + [b] := [a + b] and [a] · [b] := [a · b]. Therefore, there is an addition and a multiplication on Zn . These are called the integers modulo n.

98

2.30

Functions

Definition 2.116. Let A and B be sets. A function f is a relation from A to B (that is, a subset f ⊆ A × B) such that, for all a ∈ A, there exists a unique b ∈ B such that (a, b) ∈ f . The domain of f is the set A. The codomain of f is the set B. Notation. Let f ⊆ A × B be a function. For (a, b) ∈ f , we let f (a) := b. We write f : A → B, a 7→ f (a) Example 2.117.

• f = {(1, a), (2, b), (3, d)} ⊆ X×A where X = {1, 2, 3}

and A = {a, b, c, d} is a function. We can denote it f: X →A 1 7→ a 2 7→ b 3 7→ d, or simply write f: X →A f (1) = a f (2) = b f (3) = d.

• {(1, a), (2, a), (3, a)} ⊆ X × A where X = {1, 2, 3} and A = {a, b, c, d} 99

is a function. • {(1, a), (1, b), (2, b), (3, d)} ⊆ X × A where X = {1, 2, 3} and A = {a, b, c, d} is a not function. • {(1, a), (3, d)} ⊆ X × A where X = {1, 2, 3} and A = {a, b, c, d} is a not function.

100

2.31

Monday, April 16

2.31.1

Functions continued

Recall that Definition 2.118. Let A and B be sets. A function f is a relation from A to B (that is, a subset f ⊆ A × B) such that, for all a ∈ A, there exists a unique b ∈ B such that (a, b) ∈ f . The domain of f is the set A. The codomain of f is the set B. Example 2.119.

• f = {(x, y) ∈ R × R : y 2 = x} ⊆ R × R is not a

function from R to itself since (1, −1) ∈ f and (1, 1) ∈ f . Further, there is not pair (−1, a) ∈ f . However, F : R≥0 → R, F = {(x, y) ∈ R × R : y 2 = x, y ≥ 0} is a function. In fact, this is the square root function, F : R≥0 → R x 7→ F (x) =

√ x.

• p : Z → Zn , defined by p(a) = [a]. • Non-example: q : Zn → Z defined by q([a]) = a. This is not a function since both ([a], a) ∈ q and ([a + n], a + n) ∈ q, but [a] = [a + n], while a 6= a + n Lemma 2.120. Let f, g : A → B be functions. Then f = g if and only if f (a) = g(a) for all a ∈ A. 101

Proof. Recall that (x, y) = (w, z) if and only if x = w and y = z. Suppose that f, g : A → B are equal. Then f = g as subsets of A × B. Let a ∈ A. Since f = g, (a, f (a)) ∈ g and (a, g(a)) ∈ f . Since there is a unique element of the form (a, b) in f and similarly for g, we have that (a, f (a)) = (a, g(a)) so that f (a) = g(a). Conversely, if f (a) = g(a) for all a ∈ A, we have f = {(a, f (a)) ∈ A × B : a ∈ A)} = {(a, g(a)) ∈ A × B : a ∈ A} = g. so f = g.

2.31.2

Injectivity and Surjectivity

Definition 2.121. Let f : A → B be a function. Then f is injective or oneto-one if, for all a1 , a2 ∈ A, if f (a1 ) = f (a2 ), then a1 = a2 . (Equivalently, if a1 6= a2 , then f (a1 ) 6= f (a2 ).) Definition 2.122. Let f : A → B be a function. The image of f is the following subset of B: f (A) = {f (a) ∈ B : a ∈ A} = {b ∈ B : there exists a ∈ A s.t. f (a) = b}. Lemma 2.123. The function h : Z → Z, h(a) = 1 + 2a is injective. Proof. Suppose that h(a1 ) = h(a2 ) for a1 and a2 in Z (the domain). We must

102

prove that a1 = a2 . We have 1 + 2a1 = h(a1 ) = h(a2 ) = 1 + 2a2 . Hence, 1 + 2a1 = 1 + 2a2 . By cancellation for addition, 2a1 = 2a2 . Since 2 6= 0, cancellation for multiplication implies that a1 = a2 . Therefore, h is injective.

103

2.32

Wednesday, April 18

2.32.1

Injectivity and Surjectivity

Definition 2.124. Let f : A → B be a function. Then f is injective or oneto-one if, for all a1 , a2 ∈ A, if f (a1 ) = f (a2 ), then a1 = a2 . (Equivalently, if a1 6= a2 , then f (a1 ) 6= f (a2 ).) Definition 2.125. Let f : A → B be a function. Then f is surjective or onto if for every b ∈ B, there exists a ∈ A such that f (a) = b. Definition 2.126. A function f : A → B is bijective if it is injective and surjective. Remark 2.127. A function f : A → B is bijective if and only if for every b in B, there is a unique a ∈ A such that f (a) = b. Example 2.128. (a) f = {(1, a), (2, b), (3, d)} ⊆ X × A where X = {1, 2, 3} and A = {a, b, c, d} is a injective but not surjective. (b) f = {(1, a), (2, a), (3, a)} ⊆ X × A where X = {1, 2, 3} and A = {a, b, c, d} is a neither injective nor surjective. (c) f = {(1, a), (2, b), (3, c), (4, c)} ⊆ X × A where X = {1, 2, 3, 4} and A = {a, b, c} is surjective but not injective. (d) f = {(1, a), (2, b), (3, c)} ⊆ X × A where X = {1, 2, 3} and A = {a, b, c} is surjective and injective. (e) f : Z → Z, a 7→ |a| is not surjective and not injective. (f) g : Z → N ∪ {0}, a 7→ |a| is surjective but not injective.

104

(g) k : Q → Q, a 7→ 2a is injective and surjective, so it is bijective. Lemma 2.129. The function f : R → R, f (a) = 2a is surjective. Proof. Let y ∈ R (the codomain). We must show that there exists x ∈ R (the domain) such that f (x) = y. Choose x = y/2. Then f (x) = 2x = 2(y/2) = y. So, for every y ∈ R, there exists x ∈ R such that f (x) = y. Therefore, f is surjective. Lemma 2.130. The function h : Z → Z, h(a) = a2 is not injective. Proof. Consider a1 = 2 and a2 = −2. Then h(a1 ) = 22 = 4 and h(a2 ) = (−2)2 = 4. So, h(a1 ) = h(a2 ). However, a1 6= a2 , so h is not injective. Lemma 2.131. The function h : Z → Z, h(a) = 2a + 1 is not surjective. Proof. Let b = 2. If there exists a ∈ Z such that h(a) = b, then 2a + 1 = 2. Therefore, 2a = 1. Since 2 > 0 and 1 > 0, we must have that 0 < a < 1. This is a contradiction since there are no integers between 0 and 1. Therefore, h is not surjective there is not a ∈ Z such that h(a) = 2.

105

2.33

Friday, April 20

Lemma 2.132. The function f : R − {2} → R − {5} given by f (x) =

5x+1 x−2

is bijective. Proof. First, we prove that f is injective. Suppose that f (x1 ) = f (x2 ), so that 5x2 + 1 5x1 + 1 = . x1 − 2 x2 − 2 Then, we have that (x2 − 2)(5x1 + 1) = (5x2 + 1)(x1 − 2) that is, 5x1 x2 + x2 − 10x1 − 2 = 5x1 x2 + x1 − 10x2 − 2. This implies that x2 − 10x1 = x1 − 10x2 , so that 11x2 = 11x1 . So, x1 = x2 . Next, we prove that f is surjective. Let y ∈ R − {5}. If y 6= 5, then x=

2y+1 y−5

∈ R. Further,

2y+1 y−5

6= 2 since otherwise, we would have 2y + 1 = 2(y − 5)

106

which would imply that 1 = −10, a contradiction. So x ∈ R − {2}. Further,  f

2y + 1 y−5

5

 =

= =



2y+1 y−5



+1

2y+1 −2 y−5 5(2y+1)+y−5 y−5 2y+1−2y+10 y−5

11y 11

=y So f is surjective. Since f is injective and surjective, it is bijective.

2.33.1

The Pigeon-Hole Principle

Theorem 2.133 (Pigeon-Hole Principle). Let A and B be finite sets and f : A → B be a function. (1) If |A| > |B|, then f is not injective. (2) If |A| < |B|, then f is not surjective. Proposition 2.134. Suppose that m > n. Given m integers, at least two of them have the same remainder when divided by n. Proof. Let A be the set containing the chosen m integers. Then we can define the function p : A → Zn which sends a ∈ A to the equivalence class of [a] ∈ Zn . The cardinality of Zn is n. The cardinality of A is m. So, |A| > |Zn |. So p is not injective. Therefore, there exists a1 , a2 ∈ A such that [a1 ] = [a2 ] and a1 6=2 . We have shown that this is equivalent to a1 and a2 having the same remainder modulo n. 107

Question 2.135. Given five points on a sphere, at least four are contained in one hemisphere.

108

2.34

Monday, April 23

2.34.1

Image and Preimage

Definition 2.136. Let f : A → B be a function. (a) If X ⊆ A is a subset, then the image of X in B under f is f (X) = {f (a) ∈ B : a ∈ A} ⊆ B.

(b) If Y ⊆ B, then the preimage of Y is f −1 (Y ) = {a ∈ A | f (a) ∈ Y } ⊆ B. Warning 2.137. The preimage is a set! In general, there is no function f −1 . When you see f −1 (B), where B is a set, think of the f −1 as glued to the (B). Example 2.138. For the following functions, determine the image of X = {1, 2} and the preimage of Y = {a, b}. (a) Let A = {1, 2, 3} and B = {a, b, c, d}. Let f : A → B be given by f (1) = a, f (2) = b, f (3) = d. (b) Let A = {1, 2, 3} and B = {a, b, c, d}. Let f : A → B be given by f (1) = a, f (2) = a, f (3) = a. (c) Let A = {1, 2, 3, 4} and B = {a, b, c}. Let f : A → B be given by f (1) = a, f (2) = b, f (3) = c and f (4) = c. (d) Let A = {1, 2, 3} and B = {a, b, c}. Let f : A → B be given by f (1) = a, f (2) = b, f (3) = c. 109

Warning 2.139. f −1 (Y ) is a subset of A. If f −1 (Y ) = X, you can check that f (X) = f (f −1 (Y )) is a subset of Y , which may or may not be equal to Y !!! For example, consider f : N → Z, f (n) = 2n. Let Y = {. . . , −2, 0, 2, 4}, that is, all the even integers less then or equal to 4. Then f −1 (Y ) = {1, 2} Let X = f −1 (Y ) f (X) = f (f −1 (Y )) = {2, 4} = 6 Y. Lemma 2.140. Let B1 , B2 ⊆ B. Then f −1 (B1 ∪ B2 ) ⊆ f −1 (B1 ) ∪ f −1 (B2 ). Proof. Let a ∈ f −1 (B1 ∪ B2 ). Then f (a) ∈ B1 ∪ B2 . Hence f (a) ∈ B1 or f (a) ∈ B2 . Therefore, a ∈ f −1 (B1 ) or a ∈ f −1 (B2 ), so that a ∈ f −1 (B1 ) ∪ f −1 (B2 ).

2.34.2

Composition

Definition 2.141. Let f : A → B and g : B → C. Then the composite of f and g, denote g ◦ f is the function g◦f :A→C (g ◦ f )(a) = g(f (a)). Example 2.142. Let f, g, h be as above. 1. h ◦ f : Z → Z is a 7→ 1 + 2|a|.

110

2. f ◦ h : Z → Z is a 7→ |1 + 2a|. So h ◦ f 6= f ◦ h.

Warning 2.143. In general, even if g ◦ f makes sense, f ◦ g may not make any sense. For example, if A 6= C, I can’t apply f to g(b). Even when they do make sense, it may not be the case that f ◦g is equal to g ◦f . Composition of functions is not commutative.

111

2.35

Wednesday, April 25

2.35.1

Inverses

Definition 2.144. For any set A, the function idA : A → A, where idA (a) = a is called the identity of A. If f : A → B and g : C → A are functions, then idA ◦ g = g and f ◦ idA = f. Definition 2.145. Suppose that f : A → B is a function. An inverse for f is a function g : B → A such that f ◦ g = idA and f ◦ g = idB The function g, if it exists, if often denoted by f −1 . Warning 2.146. We will prove next that f has an inverse if and only if it is bijective!!! So in general, f −1 doesn’t exists. However, if f : A → B is a function and Y ⊆ B, the set f −1 (Y ) is always defined. Be careful, the notation is super confusing! Theorem 2.147. Suppose that f : A → B is a function. Then f has an inverse if and only if f is bijective. Proof. Suppose that f : A → B is a bijection. Consider the relation from B to A given by the pairs g = {(b, a) ∈ B × A : a ∈ A, b ∈ B, b = f (a)}. 112

Since f is a bijection, for every b ∈ B, there exists a unique a ∈ A such that f (a) = a. So, g satisfies the conditions for being a function g : B → A. So we just need to check that it’s an inverse for f . By definition, g(b) = a for a such that f (a) = b. We have f ◦ g(b) = f (g(b)) = f (a)

for a such that f (a) = b

=b and g ◦ f (a) = g(f (a)) =a So, g is an inverse for f . Conversely, suppose that f has an inverse g. For b ∈ B, f (g(b)) = b, so f is surjective. Suppose that f (a1 ) = f (a2 ). Then a1 = g(f (a1 )) = g(f (a2 )) = a2 . So f is injective. Therefore, f is a bijection.

2.35.2

Cardinality

Now, we revisit the notion of cardinality. Definition 2.148. Sets A and B are in bijective correspondence if there exists a bijection f : A → B.

113

Exercise 2.149. Bijective correspondence is symmetric, transitive and reflexive. Definition 2.150. Two sets A and B have the same cardinality, denoted by |A| = |B| if they are in bijective correspondence. Otherwise, we say that A and B do not have the same cardinality, denoted by |A| = 6 |B|. Example 2.151. If A = {1, 2, 3, 4} and B = {a, b, c, d}, then |A| = |B| Theorem 2.152. The sets Z and N have the same cardinality. Proof. Let n ∈ N. Write n = 2k + 1 for k ≥ 0. Define f: N→Z by f (n) =

  −k

n = 2k + 1

 k

n = 2k.

First, we prove that f is surjective. Let k ∈ Z. First, note that f (1) = 0. If k < 0, then f (2|k| + 1) = k and if k > 0, then f (2k) = k, so f is surjective. Suppose that f (n) = f (m). Then, either f (n), f (m) > 0 or f (n), f (m) ≤ 0. In the first case, m and n are both even and m = 2(f (m)) = 2(f ((n)) = n. In the second case, m and n are both odd, and m = 2|f (m)| + 1 = 2|f (n)| + 1 = n. So, in all cases, m = n and so f is injective. 114

2.36

Friday, April 27

2.36.1

Cardinality Continued

Definition 2.153. Let A and B be sets. (1) |A| = |B| if A and B are in bijective correspondence. (2) |A| < |B| if there is an injection A → B and no surjection A → B. (3) |A| ≤ |B| if |A| = |B| or |A| < |B|. Last time, we saw that |Z| = |N|. Today, we will discuss how |R| = 6 |N|. Lemma 2.154. Let Y 6= ∅ and Y ⊆ B. Suppose that there is no surjection from A to Y , then there is no surjection from A to B. Proof. Suppose that there is a surjection f : A → B. Let b0 ∈ Y and g : B → Y be given by g(b) =

  b

b∈Y

 b0

b 6∈ Y.

Then g is surjective. So, g ◦ f : A → Y is surjective, a contradiction. Theorem 2.155. There is no surjection f : N → R, and so |N| < |R|. Proof. The argument in this proof is called Cantor’s diagonal argument. Let Y ⊆ R be the set of real numbers in [0, 1) whose decimal expansion contains only 0’s and 1’s. So, the elements of Y have the form ∞ X yn 0.y1 y2 y3 . . . = 10n n=1

with yi ∈ {0, 1}. 115

We prove that there is no surjection from N → Y . This implies that there is no surjection from N → R. Suppose that f : N → Y is surjective. Let x = 0.x1 x2 x3 . . . be given by: xn =

  0 the nth digit of f (n) is 1  1 the nth digit of f (n) is 0.

Since f is surjective, there is an m ∈ N such that f (m) = x. However, if f (m) = 0.y1 y2 y3 xm =

  0 ym = 1  1 ym = 0

so xm 6= ym and hence x 6= f (m). A contradiction.

116

2.37

Monday, April 30

2.37.1

Cardinality Continued

Recall: Definition 2.156. Let A and B be sets. (1) |A| = |B| if A and B are in bijective correspondence. (2) |A| < |B| if there is an injection A → B and no surjection A → B. (3) |A| ≤ |B| if |A| = |B| or |A| < |B|. Definition 2.157. (a) We say that |A| = 0 if A is the empty set ∅. If A is in bijection with {1, . . . , n} for some n ∈ N, we say that |A| = n. If one of these cases hold, we say that A is finite. (b) A set A is countably infinite if |A| = |N|. In this case, we say that |A| = ℵ0 . (c) A set A is countable if it is it is finite or countably infinite. A set is uncountable if it is not countable. (d) If |A| = |R|, we say that |A| = ℵ1 . Remark 2.158. 0 < 1 < . . . < n < . . . < ℵ0 < ℵ1 Conjecture 2.159 (Continuum Hypothesis). There is no set A whose cardinality satisfies ℵ0 < |A| < ℵ1 . Theorem 2.160. The set N × N is countable.

117

Proof. We won’t write down an explicit bijection, but rather describe the idea by a picture. (1, 1)

/ (1, 2)

(1, 3) ;

(2, 2) ;

...

/

...

{

(2, 1) 

(3, 1)

...

...

Corollary 2.161. Let X and Y be countably infinite, then the cartesian product X × Y is countably infinite. Proof. Let f : N → X and g : N → Y be bijections. Then F : N×N → X ×Y given by F (n, m) = (f (n), g(m)) is a bijection. Theorem 2.162. (a) An infinite subset of a countably infinite set is countably infinite. (b) If a set A contains an uncountable subset U , then A is uncountable. Before proving this, we explore a consequence: Theorem 2.163. The set Q is countably infinite. Proof. For each q ∈ Q, choose exactly on pair of integers (a, b), b 6= 0 such that a/b = q. Let f : Q → Z × Z be given by f (q) = (a, b). Then f is 118

injective, so Q is in bijection with f (Q) ⊆ Z × Z. Since Z × Z is countably infinite and f (Q) is infinite, f (Q) is countable infinite, hence so is Q. Proof of Theorem 2.162. Part (b) follows from part A: If A is countable, then so are all its subsets. So any set with an uncountable subset must be uncountable. To prove part (a): let A be a countably infinite set and X ⊆ A be an infinite subset. Let f : A → N be a bijection. Then X is in bijection with Y = f (X). It suffices to show that Y ⊆ N is countably infinite. Define: g: N → Y as follows. We let g(1) be the least element of Y . Suppose that g(1), . . . , g(n − 1) have been defined. We let g(n) be the least element of Y − {g(1), . . . , g(n − 1)}. Note that by construction, g(1) < g(2) < . . . < g(n) < . . .. First, we show that g is injective. If n 6= m, we assume without loss of generality that n < m. Then, g(m) ∈ Y − {g(1), . . . , g(n), . . . , g(m − 1)}, so g(m) 6= g(n). Next, g is surjective. If not, let b be the least element of Y which is not in the image of g. Let X = {a ∈ Y : a < b} ⊆ {1, 2, . . . , b − 1}.

119

The set X is a finite subset of N whose elements are all in the image of g. Let g(m) be the greatest element of X. Then X = {g(1), . . . , g(m)} and g(m+1) is the least element of Y − X, which is b, so g(m + 1) = b. A contradiction. So g is surjective. Theorem 2.164. If A is a set, then |A| < |P(A)|. Proof. First, note that f : A → P(A) given by f (a) = {a} is an injection from A to P(A). So we must show that there is no surjection from A → P(A). Suppose that g : A → P(A) is a surjection. Consider the set X = {a ∈ A : a 6∈ g(a)} ⊆ A. Then X ∈ P(A). Since g is surjective, there exists a ∈ A such that g(a) = X. We prove that this is a contradiction by showing both a ∈ X and a 6∈ X are contradictory. Case 1. Suppose that a ∈ X. Then by the definition of X, a ∈ A and a 6∈ g(a). However, g(a) = X so this means that a 6∈ X. This is a contradiction. Case 1. Suppose that a 6∈ X. Since g(a) = X, this means that a ∈ A and a 6∈ g(a). By the definition of X, this implies that a ∈ X. This is a contradiction. So, this is a contradiction and there cannot be a surjection from A to P(A).

120

So, we have ℵ0 = |N| < |P(N)| < |P(P(N))| < . . . Theorem 2.165 (Cantor-Bernstein-Schr¨oder). If there are injections g : A → B and h : B → A, then A and B are in bijective correspondence. Remark 2.166. In fact, using the Cantor-Bernstein-Schr¨oder Theorem, one can show that ℵ1 = |R| = |P(N)|. Remark 2.167. For any set A and B, the statement that one of |A| ≤ |B| or |B| ≤ |A| holds is equivalent to the axiom of choice. This together with Cantor-Bernstein-Schr¨oder Theorem implies that this relation on sets behaves like the usual order you know in R or Z.

121

2.38

Wednesday, May 2

2.38.1

Review

Logic Negate the following statements. If they are conditional statements, give their contrapositive and converse. 1. If X and Y be countable sets, then the cartesian product X × Y is countable. 2. Let A, B and C be sets. If B 6= ∅ and A × B ⊆ C × B, then A ⊆ C. 3. If A is a subset of B and B is a subset of C, then A is a subset of B. 4. If f and g are surjective functions, then so is g ◦ f . 5. For all integers a and b, a < b or a ≤ b. 6. Let p and q be distinct prime numbers. For all integers n and m, n ≡ m mod pq if and only if n ≡ m mod p and n ≡ m mod q. 7. There exists a set A such that |A| > |P(A)|. Induction Theorem 2.168 (Weak Mathematical Induction). Let {P (n)}n≥N be a family of statements such that (1) P (1) is true. (2) For k ≥ 1, if P (k) is true, then P (k + 1) is true. Then, P (n) is true for all n ∈ N. 122

Question 2.169. If n ∈ N, then 2 n 1 1 + + ... + =1− 2! 3! (n + 1)! (n + 1)! Answer. Base Case. Let n = 1. Since

1 2!

=

1 2

and 1 −

1 (1+1)!

= 1−

1 2

= 21 , the base

case holds. Inductive Hypothesis. Assume that for some k ∈ N, 1 2 k 1 + + ... + =1− 2! 3! (k + 1)! (k + 1)!

Induction Step. Then 2 k+1 1 2 k k+1 1 + + ... + = + + ... + + 2! 3! ((k + 1) + 1)! 2! 3! (k + 1)! (k + 2)! 1 k+1 =1− + (k + 1)! (k + 2)! (k + 2) − (k + 1) =1− (k + 2)! 1 1 =1− =1− . (k + 2)! ((k + 1) + 1)! Therefore, if the claim holds for n = k, then it holds for n = k + 1. By induction, the claim holds for all n ∈ N. Functions Question 2.170. Let f : A → B and A1 , A2 ⊆ A. Prove that f (A1 ∩ A2 ) ⊆ f (A1 ) ∩ f (A2 ). 123

Answer. Let b ∈ f (A1 ∩ A2 ). Then there exists a ∈ A1 ∩ A2 such that f (a) = b. Since a ∈ A1 and f (a) = b, b ∈ f (A1 ). Since a ∈ A2 and f (a) = b, b ∈ f (A2 ). So, b ∈ f (A1 ) ∩ f (A2 ). Therefore, f (A1 ∩ A2 ) ⊆ f (A1 ) ∩ f (A2 ). Counting Question 2.171. How many positive 10-digit integers contain no 0’s, no 1’s and exactly four 2’s? Explain your answer, but you do not have to simplify it.  6 Answer. There are 10 · 7 such integers. 4  10 There are 4 choices for the position of the four 2’s. There are 6 positions for the other digits. Since these contain no 0’s, 1’s, and also no 2’s since we’ve already fixed the position of the 2’s allowed, there are 7 choices of digits for each of these six position. That gives 76 possibilities for the remaining digits.  6 So, the total is 10 ·7 . 4 Question 2.172. How many 8-digit binary (consisting of zeros and ones) strings begin in 1 or end in 1 or have exactly four 1s? Explain your answer, but you do not have to simplify it. Answer. Let A be the set of 8-digit binary strings beginning with 1. Let B be the set of 8-digit binary strings ending with 1. Let C be the set of 8-digit binary strings with exactly exactly four 1’s. Then, the question asks for |A ∪ B ∪ C|. By the inclusion-exclusion principle, |A ∪ B ∪ C| = |A| + |B| + |C| − |A ∩ B| − |A ∩ C| − |B ∩ C| + |A ∩ B ∩ C|.

124

We have that |A| = |B| = 27 since, in both cases, it suffices to fill the other 7  entries with 0’s and 1’s. We have that |C| = 84 since this counts the different choices of 4 positions in the string (where we place the 1’s, the remaining entries being filled with 0’s). Next, |A ∩ B| = 26 since now two entries, the first and the last, are specified and it suffices to fill the other 6 entries with  0’s and 1’s. Further, |A ∩ C| = |B ∩ C| = 73 since, in both cases, we already chose the position for one of the 1’s and it remains to choose the other 3  positions among the remaining 7 slots. Finally, |A ∩ B ∩ C| = 62 since now the positions of two of the 1’s are already specified and it remains to choose the other 2 positions among the remaining 6 slots. Therefore,       8 7 6 6 6 |A ∪ B ∪ C| = 2 + 2 + −2 −2 − + . 4 3 2 7

7

125