discrete mathematics - loyola university...

49
Discrete Mathematics W. Ethan Duckworth Fall 2017, Loyola University Maryland

Upload: others

Post on 01-Jun-2020

24 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

Discrete Mathematics

W. Ethan Duckworth

Fall 2017, Loyola University Maryland

Page 2: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

Contents

1 Introduction 41.1 Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41.2 Constructing Direct Proofs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

2 Logical Reasoning 112.1 Logical Combinations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.2 Boolean Algebra . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.3 Introduction to Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152.4 Quantifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

3 Constructing and Writing Proofs in Mathematics 213.1 Divides and more direct proofs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213.2 More methods of proof . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213.3 Proof by Contradiction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

4 Induction 234.1 Ordinary Induction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234.2 Variations on proof by induction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

5 Properties of Sets 265.1 Operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265.2 Algebraic properties of set operations . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

6 Functions 326.1 Basic Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326.2 Injections, Surjections, Bijections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35

7 Relations 397.1 Relations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397.2 Partial Orders and Equivalence Relations . . . . . . . . . . . . . . . . . . . . . . . . 41

8 Cardinality 438.1 Basic properties and Countable Sets . . . . . . . . . . . . . . . . . . . . . . . . . . . 438.2 Unions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448.3 Rational Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44

2

Page 3: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

CONTENTS 3

8.4 Uncountable Infinities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45

Page 4: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

Chapter 1

Fundamentals, aka the language ofmathematics

1.1 Statements, Exploring and Establishing Truth, Condi-tional Statements, Number Systems and Closure

1.1.1 Statements

Example 1. For each of the following, is it a statement?(a) There exists a real number x such that x2 = 50

(b) Let x = 3±√

47(c) Solve the equation 2x2 − 3x− 5 = 0

1.1.2 Exploring and Establishing Truth

Example 2. Describe how to explore the following statements(a) If x and y are odd integers, then x+ y is an even integer.(b) For all real numbers x, we have sin(2x) = 2 sin(x).

1.1.3 Conditional Statements

Definition 1.1.1. The statement

“If P , then Q.”

is a conditional statement. We assume that P and Q are statements as well.

Example 3. Suppose I tell a student “If you get 100% on the final exam, then you will get an Ain the class.” Now, consider the following situations, and decide if I told the truth or was a liar:

The student got an 80% on the final, and I gave them an A.The student got an 80% on the final, and I gave them a B.The student got a 100% on the final, and I gave them an A.The student got a 100% on the final, and I gave them a B.

4

Page 5: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

CHAPTER 1. INTRODUCTION 5

I hope you’ll agree with me that there would be only one situation in which I was a liar: the last.If we define two statements

P : student gets an 100% on the final

Q : I give the student an A in the class

then “If P , then Q” is false only when P is true and Q is false. In all other situations “If P , thenQ” is true.

Definition 1.1.2. If P and Q are mathematical statements, then the new statement “If P , thenQ” has truth value defined by the following:

P Q If P, then QT T TT F FF T TF F T

We call P the hypothesis and Q the conclusion1 As shown here, when P is false, we have that“if P , then Q” is true. We call this the vacuous case, or say that “if P , then Q” is vacuouslytrue. This terminology is meant to suggest that there is no interesting property in this case, orcontent, or need to prove anything.

Definition 1.1.3. The following are synonyms for “If P , then Q”:• P =⇒ Q ,• P implies Q,• P is sufficient for Q,• Q is necessary for P ,• P only if Q,• Q if P ,• If P , Q.

This is where we ended on Friday, September 8

Example 4. The following are conditional statements (they happen to all be true as well). In allcases, we assume that x is an integer.

(a) If x is even, then x2 is even.(b) If x2 is even, then x is even.(c) If x2 − 4 = 0, then x = ±2.

1The American Heritage Dictionary gives the following definition of hypothesis.

1. A tentative explanation that accounts for a set of facts and can be tested by further investigation;a theory. 2. Something taken to be true for the purpose of argument or investigation; an assumption.3. The antecedent of a conditional statement.

Definition (1) shows that in science and the world at large, a hypothesis is often something you’re trying prove, andyou’ll be done when you prove it. This is contrary to the way it’s used in mathematics. Here, a hypothesis is whatyou start with, what you get to assume, in order to prove something else.

Page 6: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

CHAPTER 1. INTRODUCTION 6

1.1.4 Number Systems: Defining Properties

Pseudo-definition. We assume that the reader knows what the natural numbers are:

1, 2, 3, 4, . . .

The number 1 is a natural number, and for any natural number n, we also have n+ 1 is a naturalnumber such that n+1 6= n, and ever natural number equals some finite combination of 1+1+· · ·+1.

We abbreviate the set of all natural numbers with the symbol N.

Pseudo-definition. We assume that the reader knows what the integers are: the natural num-bers, the negatives of these numbers, and 0. Here are some of them, together with dots indicatingthe others:

. . . ,−4,−3,−2,−1, 0, 1, 2, 3, 4, . . . .

We abbreviate the set of all integers with the symbol Z.

Definition 1.1.4. We assume that the reader knows what the rational numbers are: for eachpair of integers, a, and b, when b 6= 0, we define a rational number

a

b. For each integer n we define

n =n

1and in this way view every integer as also being a rational number.

We abbreviate the set of all rational numbers with the symbol Q.

Pseudo-definition. We assume that the reader feels like they know what the real numbers are.They can be modeled or visualized as all the points on a line, they can be modeled as decimalnumbers (including both infinite and finite ones). We view every rational number as a real number.

We abbreviate the set of all real numbers with the symbol R.

Definition 1.1.5. The set of irrational numbers is the set of those real numbers that are notrational.

Definition 1.1.6. The set of real numbers R has operations + (addition) and × (multiplication)defined on it, as well as relations = (equals) and < (less than) defined on it, as well as elements 0and 1 such that the following hold:

1. Trichotomy: For all real numbers a and b either

a < b or a = b or b > a

holds, and not more than one of these relations holds.2. Transitivity: For all real numbers a, b and c

if a < b and b < c then a < c

3. Identities: For all real numbers a, we have

0 + a = a (additive identity property)

and1× a = a (multiplicative identity property).

Page 7: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

CHAPTER 1. INTRODUCTION 7

4. Inverses: For each real number a there exists a number −a such that

a+ (−a) = 0 (additive inverse property)

and, if a 6= 0, then there exists a number1

asuch that

a× 1

a= 1 (multiplicative inverse property).

5. Commutative, Associative, Distributive Laws: For all real numbers a, b and c we have(a) a+ b = b+ a (additive commutative property)(b) a× b = b× a (multiplicative commutative property)(c) a+ (b+ c) = (a+ b) + c (additive associative property)(d) a× (b× c) = (a× b)× c (multiplicative associative property)(e) a× (b+ c) = a× b+ a× c (distributive property)

6. Ordered Field: For all real numbers a, b, c(a) if a = b then a+ c = b+ c and a× c = b× c(b) if a < b then a+ c < b+ c(c) if a < b and c > 0 then a× c < b× c

7. Rationals are Dense: For every real number a and every real number ε > 0, there exists arational number q such that |a− q| < ε.

We abbreviate some of the above notation:• a ≤ b means a < b or a = b• a > b means b < a• ab and a · b both mean a× b• a− b means a+ (−b)• a−1 means

1

a• a÷ b means ab−1

Definition 1.1.7. Let X is any of the number systems we described above (natural numbers,integers, rational numbers, real numbers, irrational numbers). Let � be any of the standard fourarithmetic operations defined above (+, −, ×, ÷). If the following is true:

for all a, b ∈ X we have a� b ∈ X;

then we say that X is closed under �. If we apply this definition to the case where � = ÷, then weadd the extra detail that b 6= 0, so then the definition reads “for all a, b ∈ X with b 6= 0, we havea÷ b ∈ X”.

Example 5. (a) Z is closed under addition: if a and b are integers, then so is a+ b.

(b) Z is not closed under division: a = 5 and b = 2 are integers, but5

2is not.

Page 8: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

CHAPTER 1. INTRODUCTION 8

Example 6. Fill in the following table with “C” (for closed) or “N” (for not closed)

+ − × ÷

N

Z

Q

R

irrationals

1.1.5 Number Systems: Basic Propositions

Theorem 1.1.8 (Algebraic Properties of R). The following properties hold for any a, b, c ∈ R:(a) If a+ b = a then b = 0.(b) If a+ b = a+ c then b = c.(c) 0× a = a× 0 = 0.(d) −(−a) = a.(e) −a = −1× a.(f) a× (−b) = (−a)× b = −(a× b).(g) (−a)× (−b) = a× b.(h) a× (b− c) = a× b− a× c.(i) If a× b = a× c, and a 6= 0, then b = c.(j) If ab = 0 then a = 0 or b = 0.(k) 1 > 0.(l) If a > b > 0 then a2 > b2.

(m) If a < b, and c < 0 then a× c > b× c.(n) If a < 0 and b > 0 then a× b < 0. If a < 0 and b < 0 then a× b > 0.(o) If a ∈ Z then there is no integer d ∈ Z such that a < d < a+ 1.(p) There exists some n ∈ Z such that n× b > a.

Definition 1.1.9. Let n be an integer. We say that n is even if there exists an integer k such thatn = 2k. We say that n is odd if there exists an integer k such that n = 2k + 1.

Theorem 1.1.10 (Parity Results).1. Every integer is either even or odd, and is not both.2. The following hold:

even + even = even even× even = even

even + odd = odd even× odd = even

odd + odd = even odd× odd = odd

We interpret the above “formulas” as follows: if we add two even numbers, the result is aneven number; if we multiply two odd numbers, the result is an odd number, etc.

Page 9: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

CHAPTER 1. INTRODUCTION 9

1.2 Constructing Direct Proofs

Example 1. Translate each of the following statements into an if-then statement.(a) “the product of two odd integers is odd”.

(b) “√

2 is irrational.”

This is where we ended on Monday, September 11

Template. Template for finding a direct proof.0. Translate what you’ve been given into an if-then format. (You do not have to write this step

down, but it should help clarify things.)1. Write the first sentence(s) of your proof by stating the hypothesis of your if-then, label any

quantities you need and explicitly state what you’re assuming about them.2. Write the last sentence of your proof by stating the conclusion you’re trying to reach.3. Working either forwards or backwards, add sentences in the middle. Almost every sentence

should be a mathematical statement, along with some justification for why that statement istrue. Sentences that are not mathematical statements should be concise aids for the readerto help them understand the proof, or that define, introduce, or fix a term or symbol.

4. Keep going until you have a chain of links from the beginning to the end.

Template. Know-show table1. State what you know in the first line of the table. The justification for this statement is that

it’s the hypothesis.2. State your conclusion in the last line of the table.3. Work from the beginning to the middle, and from the end to the middle, by applying (un-

raveling) definitions, simplifications, restatements, previous results, algebra, etc. Label eachstep and provide a justification for each step.

4. Keep going until you have a link from the beginning to the end. You may need to try morethan one possibility at a time, until you find one statement to connect to the other.

Step # Statement Justification

Know −→ P . . . Given

P1 . . . . . .

. . . . . . . . .

Q1 . . . . . .

Show −→ Q . . . . . .

The labels P1, P2, etc. represent forward steps and the labels Q1, Q2, etc. represent backwardssteps.

Naming things

Pseudo-definition. A theorem is a mathematical statement that has been proven true.

Page 10: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

CHAPTER 1. INTRODUCTION 10

1.2.1 A lengthy example

Proposition 1.2.1. 0 · x = 0.

Proposition 1.2.2. 0 is the only number that acts like the additive identity.

Proposition 1.2.3. −(−a) = a.

Page 11: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

Chapter 2

Logical Reasoning

2.1 Logical Combinations

And, Or, Not

Definition 2.1.1. If P and Q are mathematical statements, then new statement “P and Q” hastruth value defined by the following:

P Q P and QT T TT F FF T FF F F

There’s a symbolic way of writing “and”,

P ∧Q means P and Q

We call “and” or ∧ conjunction

Example 1.

P : rocks are hard

J : fish have legs

P and J : rocks are hard and fish have legs

Definition 2.1.2. If P is a mathematical statement, then the new statement “not P” is definedby the following:

P not PT FF T

There’s a symbolic way of writing “not”,

¬P means not P

Finally, “not” and “¬” are both also called “negation”.

11

Page 12: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

CHAPTER 2. LOGICAL REASONING 12

Example 2.

P not P (suitably rewritten)rocks are hard rocks are not hard

3 + 4 = 7 3 + 4 6= 7

Definition 2.1.3. If P and Q are mathematical statements, then the new statement “P or Q” hastruth value defined by the following

P Q P or QT T TT F TF T TF F F

There’s a symbolic way of writing “or”,

P ∨Q means P or Q

We call “or” or ∨ disjunction

Example 3.

P : Linnane is Loyola’s President

J : Duckworth is Superbowl MVP

P or J : Linnane is Loyola’s President or Duckworth is Superbowl MVP

Exclusive Or and Truth Tables

Example 4. We have decided to let “∨” represent inclusive or. There is no universal standardsymbol for exclusive or, but the following is used fairly often: ∨. Fill in the following.

P Q P ∨QT T FT F TF T TF F F

Example 5. Come up with a symbolic formula for exclusive or, and verify that it gives the sametruth table as the exclusive or in the previous example.

The example we used for exclusive or was “soup or salad”. To make it extra clear, we addedthe phrase “but not both”. Thus, you can think of exclusive or as being the inclusive or, togetherwith the phrase “and not both”.

soup or saladsoup or salad, but not bothsoup or salad, and not both

soup or salad and not (soup and salad)P or L and not (P and L)

(P ∨ L) ∧ ¬(P ∧ L)

Page 13: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

CHAPTER 2. LOGICAL REASONING 13

To figure out the truth table for (P ∨ L) ∧ ¬(P ∧ L) make a table starting with P and Q, thenadd a column for each piece of the whole formula (start with the smallest pieces, then the nextsmallest, etc., finishing with the largest).

P L P ∨ L P ∧ L ¬(P ∧ L) (P ∨ L) ∧ ¬(P ∧ L)T T T T F FT F T F T TF T T F T TF F F F T F

This is where we ended on Friday, September 15

If and only if

Definition 2.1.4. If P and Q are mathematical statements, then the new statement “P if andonly if Q” means both of the following: “if P , then Q” and “if Q, then P .”

Proposition 2.1.5. The truth value of “P if and only if Q” is shown below:

P Q P, if and only if QT T TT F FF T FF F T

One way to think about “P if and only if Q” is that for this to be true, P and Q need to havethe same truth value.

Definition 2.1.6. The following are synonyms for “P if and only if Q”:1. P ⇐⇒ Q2. P iff Q3. P is necessary and sufficient for Q4. P is equivalent to Q5. P is true exactly when Q is true.

2.2 Boolean Algebra

Definition 2.2.1. Two expressions in Boolean algebra are logically equivalent if they have thesame truth value for all possible combinations of truth values of these variables. If X and Y aretwo logically equivalent statements then we can write this symbolically as (X ⇐⇒ Y ) = T. Wetypically will abbreviate this as X ≡ Y .

Example 1. Show that X =⇒ Y and (¬X) ∨ Y are logically equivalent.

Example 2. Go back and re-read the algebraic properties of the real numbers: identities, inverses,commutativity, associativity, distributive law. In each case see if you can imagine an analogousstatement for statements made of truth values. For the moment, don’t worry about whether thestatement is true or false, just see if you can imagine what it would even look like.

Page 14: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

CHAPTER 2. LOGICAL REASONING 14

This is where we ended on Monday, September 18

Theorem 2.2.2. If X, Y and Z are any Boolean variables, the following properties hold:• X ∧ TRUE = X and X ∨ FALSE = X (Identity elements)• X ∧ (¬X) = FALSE and X ∨ (¬X) = TRUE (Inverses)• X ∧ Y = Y ∧X and X ∨ Y = Y ∨X (Commutative laws)• X ∧ (Y ∧ Z) = (X ∧ Y ) ∧ Z and X ∨ (Y ∨ Z) = (X ∨ Y ) ∨ Z (Associative laws)• X ∧ (Y ∨Z) = (X ∧ Y ) ∨ (X ∧Z) and X ∨ (Y ∧Z) = (X ∨ Y ) ∧ (X ∨Z) (Distributive laws)

There are a few algebraic properties for boolean algebra that are not analogues of the algebraicproperties of the real numbers. We state the most important ones here.

Theorem 2.2.3. For all boolean variables X, Y and Z, we have• ¬(¬X) = X and X ∧X = X and X ∨X = X (Idempotence)• ¬(X ∧ Y ) = (¬X) ∨ (¬Y ) and ¬(X ∨ Y ) = (¬X) ∧ (¬Y ) (De Morgan’s Laws)

Converse and Contrapositive

Definition 2.2.4. Let P and Q be any statements, and form P =⇒ Q. The converse ofP =⇒ Q is Q =⇒ P . The contrapositive of P =⇒ Q is ¬Q =⇒ ¬P .

Example 3. Consider the following statements

X : If x = 3, then x2 = 9

Y : If x2 = 9, then x = 3

Z : If x2 6= 9, then x 6= 3

W : If x 6= 3, then x2 6= 9

(a) Find the truth value for each of X, Y , Z and W .(b) Which of Y , Z and W is the contrapositive of X? Which is the converse?

Proposition 2.2.5. Let P and Q be two logical statements. The following are equivalent:1. P =⇒ Q2. ¬Q =⇒ ¬P3. (¬P ) ∨Q

Definition 2.2.6. Let P and Q be two logical statements. The contrapositive of the statement“if P , then Q” is the statement “if (not Q), then (not P ).”

Template. Proof by contrapositiveTo prove “if P , then Q” by contrapositive, do the following.• Clearly state “We assume (not Q)” (or some synonym).• Fill in the rest of the steps of a direct proof of “if (not Q), then (not P ).”

◦ Label any quantities you need and explicitly state what you’re assuming about them.◦ Write the last sentence of your proof: “Therefore we have (not P )” (or some synonym).◦ Work from the beginning to the middle, and from the end to the middle, by unraveling

definitions, simplifying, etc.◦ Keep going until you have a link from the beginning to the end.

Page 15: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

CHAPTER 2. LOGICAL REASONING 15

Example 4. Discuss how one would prove the following statement directly, and by contrapositive

“ Every student at Loyola University is under 8 feet tall.”This is where we ended on Wednesday, September 20

Example 5. Prove the following statement: Let n be an integer. If n2 is even, then n is even.(You can assume only our statements about numbers in Section 1.1.4, the definition of even and

odd integers, the fact that every integer is either even or odd, and your homework problem about.)

Example 6. Prove the following: Let x and y be real numbers. Then xy = 0 if and only if x = 0or y = 0.

(You can assume only our statements about numbers in Section 1.1.4, and Theorem 1.1.8parts (c), (e) and (m))

This is where we ended on Friday, September 22

If and only If Theorems

Template. Direct proof of if-and-only-ifTo prove “P if and only if Q” (i.e. P ⇐⇒ Q)• Prove “if P , then Q” (i.e. prove “⇒”)• Prove “if Q, then P” (i.e. prove “⇐”)

2.3 Introduction to Sets

2.3.1 Open Sentences

Definition 2.3.1. An open sentence is a sentence that involves variables x, y, z, . . . such thatwhen values are assigned to those variables the result is a mathematical statement. Notation:P (x, y, z, . . . ). Synonyms: such a sentence is also called a predicate sentence or propositionalfunction.

Example 1. (a) “3x + 5 = 0” is an open sentence. “If x is a real number, then 3x + 5 = 0” isstatement (a false statement). “There is some real number x such that 3x+ 5 = 0” is also astatement (a true one).

(b) “x2 ≥ 0” is an open sentence. “For all real numbers x, we have x2 ≥ 0” is a statement (atrue one). Also “There is some real number x such that x2 ≥ 0” is a true statement.

2.3.2 Sets

“ The infinite, like no other problem, has always deeply moved the soul of men. Theinfinite, like no other idea, has had a stimulating and fertile influence upon the mind.But the infinite is also more than any other concept, in need of clarification.”

(Hilbert, Uber das Unendliche)

Pseudo-definition.

Page 16: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

CHAPTER 2. LOGICAL REASONING 16

• A set is a collection of objects, with no sense of order or repetition (i.e. we do not assign anymeaning to, or keep track of, what order the objects show up in, or whether or not they arerepeated).

• Objects in a set are called elements or members of the set.• Usual notation for sets: “{ }” or “{ , , , . . . , }”. We often represent a set with a capital

letter such as A, B, C, . . . .• Order and repetitions do not matter. The following are all the same set:

{1, 2, 3}, {3, 2, 1}, {3, 2, 3, 1, 2, 1}.

• Membership in a set is denoted by “∈”. We read this symbol as “is in” or “be in” or somethingsynonymous. Thus, “2 ∈ {1, 2, 3}” reads as “2 is in {1,2,3}” and “let x ∈ A” reads as “letx be in A”. A membership statement is a logical assertion: it is either true or false. Forinstance, 5 ∈ {1, 2, 3} is FALSE. Since this is false, it is true to say that 5 is not a member,which we write this way “5 6∈ {1, 2, 3}”.

Definition 2.3.2 (Roster notation). Roster notation is when we list the elements of a set asexplicitly as possible, sometimes relying upon a pattern for any that are not explicit.

Example 2. (a) In roster notation we would describe N as

N = {1, 2, 3, 4, . . . }

(b) In roster notation, the set of prime numbers between 1 and 25 is

{2, 3, 5, 7, 11, 13, 17, 19, 23}.

Definition 2.3.3 (Set-builder notation). Set-builder notation has the form

{variable | open sentence on the variable}

to describe the set of all objects that satisfy the given condition. One condition is so common thatwe sometimes include it on the left hand side, namely what set the variable can be in. In this case,the notation looks like this

{variable ∈ set | condition on the variable}

In all cases there needs to be an implicit or explicit statement about what the set is that the variableranges over. It is called the universal set for that variable.

If we make the notation a little more symbolic, it looks like this

{x ∈ A | P (x)}

where A is some universal set, and P (x) is an open sentence defined on the variable x.(Note: half the books out there use : instead of | for the divider in the middle between the

variable and the open sentence. It doesn’t matter which one you use, just be aware that you maysee it both ways.)

Example 3. Translate the following into/out of set-builder notation.(a) {x | x ∈ Z, x2 ≤ 9}.

Page 17: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

CHAPTER 2. LOGICAL REASONING 17

(b) {x ∈ R | x2 = −1}.(c) The set of all even numbers that can be written as the sum of two perfect squares.

This is where we ended on Monday, September 25

Definition 2.3.4. We say that two sets are equal if they have exactly the same elements. In otherwords, if A and B are two sets, then

A = B means x ∈ A ⇐⇒ x ∈ B.

We say that A is a subset of B if every element of A is also an element of B. In other words,

A subset B means if x ∈ A then x ∈ B

The notation for “A is a subset of B isA ⊆ B.

Example 4. Let n ∈ Z. We say that 6 divides n if n = 6x for some x ∈ Z. Similarly we say that18 divides n if n = 18x for some x ∈ Z.

Define sets A and B as shown:

A = {x | x ∈ Z and 6 divides x}B = {x | x ∈ Z and 18 divides x}

Prove that B ⊆ A.

Template. Direct proof that a set is a subsetTo show A ⊆ B:1. Let x ∈ A.2. . . .3. . . .4. Therefore x ∈ B.5. Therefore A ⊆ B.

Example 5. Prove that the following two sets are equal:

E = {x ∈ Z | x is even}, and

F = {x ∈ Z | x = a+ b for some a, b ∈ Z, with both a and b odd}.

You can assume standard facts about even and odd numbers.

Template. Direct proof that two sets are equalLet A and B be two sets. Two show that A = B, do the following:• Suppose x ∈ A.• . . .• . . .• Therefore x ∈ B.

• Suppose x ∈ B.• . . .

Page 18: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

CHAPTER 2. LOGICAL REASONING 18

• . . .• Therefore x ∈ A.

• Therefore A = B.

Example 6. Let x be any object and A any set. Prove that x ∈ A if and only if {x} ⊆ A.

This is where we ended on Wednesday, September 26

2.4 Quantifiers

“ The notion of existence is one of the primitive concepts with which we must begin asgiven. It is the clearest concept we have.” Godel (quoted by Wang)

Definition 2.4.1. The symbol “∃” stands for the phrase “there is” or “there exists”. We use it inmaking logical statements as follows

∃x ∈ A, assertions about x.

A logical statement of this form is called an existential statement.The following are synonyms:• ∃x ∈ A, statement P ,• At least one value of x ∈ A makes P true,• P is true for some x ∈ A,• There exists x ∈ A such that P is true.

Example 1. Translate the following into an English sentence using as few symbols as possible

∃x ∈ R, such that x2 = 10

Template. Direct proof of existential statementsTo prove the statement “∃x ∈ A, assertions about x”, do the following:• Let x equal . . . (give an explicit meaning or value: this is the one time where it’s ok to “prove

by example”)• Show that x satisfies the assertions.• Therefore ∃x ∈ A, assertions about x is true.

Example 2. Prove the following: ∃x ∈ R such that x2 − 5x+ 4 = 0.

Definition 2.4.2. The symbol “∀ stands for the phrase “for all” or “for every”. We use it inmaking a logical statement as follows

∀x ∈ A, assertions about x.

A logical statement of this form is called an universal statement.The following are synonyms:• ∀x ∈ A, statement P ,• every value of x ∈ A makes P true,• P holds for all x ∈ A without exception,

Page 19: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

CHAPTER 2. LOGICAL REASONING 19

• for all x ∈ A, property P is true,• if x ∈ X, then P is true.

Example 3. Translate the following into an English sentence using as few symbols as possible

∀n ∈ N, we have (n+ 1)2 ≥ 4.

Example 4. Identify each of the following as true or false, and justify with one sentence.(a) ∃x ∈ R such that x2 − x− 1 = 0,(b) ∀x ∈ R, we have x2 − x− 1 = 0.

Template. Direct proof of universal quantifier statementTo prove the statement “∀x ∈ A, assertions about x” do the following.• Let x ∈ A.• Show that x satisfies the assertions. Assume only that x satisfies the definition of elements ofA. Make no other assumptions about x.

• Therefore “∀x ∈ A, assertions about x” is true.

Example 5. Prove the following:

∀n ∈ N, we have (n+ 1)2 ≥ 4.

Scholium 2.4.3. If a, b ∈ R with a ≥ b ≥ 0 then a2 ≥ b2.

This is where we ended on Friday, September 29

Example 6. (a) Suppose I say “every student in this class will get an A”. What does it take, tomake me a liar? Can you state this in a way that uses a quantifier first, and then a negation?

(b) Suppose I say “there is a student in this class who will win the lottery. What does it take, tomake me wrong? Can you state this in a way that uses a quantifier first, and then a negation?

Fact 2.4.4. The following rules describe the negation of existential and universal quantifier state-ments:

¬(∀x ∈ A, statement P

)= ∃x ∈ A, ¬P ¬

(∃x ∈ A, statement P

)= ∀x ∈ A, ¬P

In words: when you move a “¬” across a quantifier you switch the quantifier.

Example 7. Translate into Math-English (avoid quantifier symbols), the negation of the followingstatements

(a) ∃x ∈ R, x2 + 1 = 0,(b) ∀x ∈ Z, x2 + 1 6= 0.

Example 8. Translate the following into Math-English (avoid quantifier symbols). Which is trueand which is false?

(a) ∀x ∈ R,∀y ∈ R, ln(x2 + y2) is defined.(b) ∃x ∈ R,∃y ∈ R, ln(x2 + y2) is defined.

Logical statements that have two quantifiers of different types are more interesting, and takemore work to understand.

Page 20: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

CHAPTER 2. LOGICAL REASONING 20

∀x,∃y means that first we consider any x, and second we consider the existence of a y, whichmight depend upon what x is. In other words, if we start with a different x, then y mightalso change.

∃x,∀y means that first we fix a single x, which might have special restrictions, and then see if thatx will work for all possible values of y. Here, x cannot depend upon y, nor can y depend uponx.

Example 9. An easy metaphoric example helps one understand the difference between ∀x, ∃y and∃y,∀y. Suppose we consider marriage, and to make it a symmetric relation, use “is perfect marriagematerial.”• There exists a person P , who is perfect marriage material for each person Q in the world.• For each person P , there exists a person Q who is perfect marriage material.

The first statement says that one person P , could be a perfect match for everyone; the same personP could be a perfect match for me, and you, and President Obama! The second statement saysthat each person has a perfect match, but it presumably a different perfect match for each person.

Example 10. Analyze the following two statements, and prove or disprove them.(a) ∀x ∈ N,∃y ∈ N, x < y.(b) ∃x ∈ N,∀y ∈ N, x < y.

Example 11. Definition: A function f(x) is continuous at the value x = a if the following istrue

∀ε > 0,∃δ > 0, |x− a| < δ =⇒ |f(x)− f(a)| < ε

Prove that f(x) = 3x+ 2 is continuous at x = 1.

Example 12. (a) Negate the definition of continuous to define the following statement: “Thefunction g(x) is not continuous at x = 1”.

(b) Define a function g(x) as follows:

g(x) =

{x2 if x 6= 1

0 if x = 1

Prove that g(x) is not continuous at x = 1.

This is where we ended on Friday, October 6

Notation 2.4.5. The notation

∃!x ∈ A, statement about x

means

∃x ∈ A, statement about x and x is the only element in A with this property.

In other words, “∃!x” means “there exists a unique x”.

Example 13. We will prove the following assertion: there exists a unique x ∈ Q such that 5x+7 =3.

Example 14. We will prove the following assertion: there exists a unique differentiable functionf satisfying f(0) = 1 and f ′(x) = 2 for all x.

Page 21: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

Chapter 3

Constructing and Writing Proofsin Mathematics

3.1 Divides and more direct proofs

Definition 3.1.1. Let a and b be integers1. If a = bc for some integer c, then we say that b dividesa. As synonyms we have: a is divisible by b, or a is a multiple of b, or b is a factor of a, or b isa divisor of a. The symbol2 for this is b|a.

Example 1. (a) An integer n is even if and only if 2|n.(b) An integer n is a multiple of 3 if and only if 3|n.

Theorem 3.1.2 (Properties of Divides). Fix integers a, b, c. The following hold1. a|a (reflexive property)2. a|b ⇐⇒ a| − b (semi-symmetric property)3. If a|b and b|c then a|c (transitive property)4. If a|b and b|a then a = ±b (semi-anti-symmetric property)5. If ab|ac and a 6= 0 then b|c (cancelation property)6. If a|b then a|bc (multiplicative property)7. If a|b and a|c then a|(b± c) (sum and difference property)8. If a|b and a|c then a|(ib+ jc) for all i, j ∈ Z (linearity property)

This is where we ended on Wednesday, October 11

3.2 More methods of proof

Example 1 (Using logical equivalence). Prove the following: If ab is even then a is even or b iseven.

1By our discussion of “let” above this means that a and b could be any integers. We do not assume anything elseabout them yet, we do not get to choose what they are, etc.

2This is not the same as b/a or b÷a orb

a: all of these are operations. The symbol b|a is read more as an adjective;

it’s not something you are meant to do, not an imperative verb, not like “divide a by b”. Rather it’s giving a nameto a relationship that a and b have together “a and b are related by this property that we call ‘divides’ ”.

21

Page 22: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

CHAPTER 3. CONSTRUCTING AND WRITING PROOFS IN MATHEMATICS 22

Example 2 (Nonconstructive existence). Prove that there is a solution of x + sin(x) = e2. (Youmay use basic facts about calculus.)

3.3 Proof by Contradiction

“ Reductio ad absurdum, which Euclid loved so much, is one of a mathematician’s finestweapons. It is a far finer gambit than any chess gambit: a chess player may offer thesacrifice of a pawn or even a piece, but a mathematician offers the game.”

G.H. Hardy, A Mathematician’s Apology

Example 1. Show that the following are equivalent:

P =⇒ Q and (P ∧ ¬Q) =⇒ F

Example 2. Prove that√

2 is irrational.You may assume the following:

Prop 1 : If n is a natural number, and n2 is even, then a is even.

Prop 2 : Every rational number can be written in the forma

bwhere a and b have no common factors.

The first proposition follows from Section 3.2, Example 1. The second is presumably familiar, butwe have not proven it yet in this course.

Template. Proof by contradictionTo prove “if P , then Q”• Clearly state “We assume for contradiction that P and ¬Q are both true” (or some synonym).• Derive consequences of P and ¬Q until you reach a contradiction (i.e. a statement that is

known to be false), and clearly state “this is a contradiction” or some synonym.• Conclude that ¬Q must be false, i.e. Q is true.

This is where we ended on Monday, October 16

Page 23: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

Chapter 4

Induction

“ The more you approach infinity, the deeper you penetrate terror.”Gustave Flaubert

4.1 Ordinary Induction

It’s possible to combine the Well Ordered Property of the natural numbers with the proof techniqueof smallest counter example into a single proof technique that does not use contradiction. The resultis the Principle of Mathematical Induction.

Theorem 4.1.1 (Mathematical Induction). Let P (n) be an open sentence defined on the naturalnumbers.

Suppose the following statements are true:1. P (1) is true and2. ∀n ∈ N if P (n) is true then P (n+ 1) is true.

Then ∀n ∈ N we have P (n) is true.

Template. Proof by inductionTo prove that every natural number has some property, i.e. to prove

∀n ∈ N, P (n)

• Prove that the result is true for n = 0 (the “basis” or “base case”).• Prove that “if the result is true for k, then it is true for k + 1” (the “inductive step”). I.e.

◦ Suppose that n = k is some natural number that makes the result true (the “inductivehypothesis”).

◦ Use the inductive hypothesis to show that the result is true for n = k + 1.• State “by induction, the result is true for all natural numbers” (or some synonym).

Example 1. Let n be a natural number. Then

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

2.

23

Page 24: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

CHAPTER 4. INDUCTION 24

Example 2. For each natural number n, we have

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

6.

4.2 Variations on proof by induction

Theorem 4.2.1 (Principle of Strong Mathematical Induction). Let P (n) be an open sentencedefined on the natural numbers.

Suppose the following statements are true:1. P (1) is true and2. ∀n ∈ N if P (1), P (2),. . . ,P (n) are true then P (n+ 1) is true.

Then ∀n ∈ N we have P (n) is true.

Template. Proof by strong inductionTo prove that every natural number has some property:• Prove that the result is true for n = 0 (the “basis” or “base case”).• Prove that “if the result is true for 0, 1, . . . , k, then it is true for k+ 1” (the “inductive step”).

I.e.◦ Suppose that the result is true for n = 0, 1, . . . k (the “strong inductive hypothesis”).◦ Use the inductive hypothesis to show that the result is true for n = k + 1.

• State “by induction, the result is true for all natural numbers” (or some synonym).

Example 1. (Scheinermann, #22.18) Recall the Fibonacci numbers. They are defined as follows:

F0 = 1, F1 = 1, F2 = 1 + 1 = 2, F3 = 1 + 2 = 3, F4 = 2 + 3 = 5, . . . , Fn = Fn−1 + Fn−2.

The first 11 Fibonacci numbers are

1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89.

Show that every positive integer is equal to the sum of distinct Fibonacci numbers.

Cauchy Induction

Theorem 4.2.2. Let P (n) be an open sentence. If P (2) is true, and if P (n) =⇒ P (2n), and ifP (n) =⇒ P (n− 1) then P (n) is true for all n ≥ 2.

Example 2. The Arithmetic Mean – Geometric Mean Inequality.

Page 25: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

CHAPTER 4. INDUCTION 25

Exercises

1. For all of the statements below, state whatthe inductive hypothesis would be, andwhat the conclusion of the inductive stepwould be.

Identify for which natural numbers the follow-ing statements are true, and then prove them byinduction.

2. 2n+ 1 ≤ n23. n < 2n

4. n2 ≤ 2n

5. n3 ≤ 2n

6. n! ≤ nn7. nm ≥ n8. If n and m are relatively prime, then an+bm = 1 for some integers a, b ∈ Z.

9. 1 +1

22+ · · ·+ 1

n2≤ 2− 1

n10. cos(nx) equals a polynomial in cos(x)11. A polynomial of degree n has at most n

roots.12. The sum of the first k nth powers is a poly-

nomial in k (induct on n).13. A 2n × 2n grid of unit squares with one

square removed can be covered by trioni-mos. (A trionimo is the shape formed bythree unit squares making an L-shape, i.e.what you get when you start with the 2×2grid and remove one square.)

14. If p is prime and p|ab then p|a or p|b15. If p is prime and p|a1 · a2 · · · an then p|ai

for some i with 1 ≤ i ≤ n.16. If p is prime and p|an then p|a17. Let f1, . . . , fn be differentiable functions.

Then

(f1 · · · · · fn)′ =

n∑i=1

f1 · · · f ′i · · · fn

18. Let f(x) = ex2

. Then

f (n)(x) = some polynomial× ex2

19. limx→∞

xn

ex= 0

20.

∫ ∞0

xne−x dx = n! .

21. Let T be a finite, directed graph that hasno cycles, and let n be the number of ver-tices and e be the number of edges of T .Then n = 1 + e.

22. We can write n = p1 · . . . pk where each piis prime.

23. If Fn is the nth Fibonacci number then

Fn =1√5

(ϕn − (1− ϕ)n)

where ϕ is the golden ratio.24. 1 + 3 + 5 + 7 + . . . (2n− 1) = n2

25. 3|(7n − 4n)26. 3n2 + 3n+ 1 ≤ n327. 1 + 2 + 22 + · · ·+ 2n−1 = 2n − 128. 8|(9n − 1)29. 2 + 4 + 6 + 8 + · · ·+ 2n = n2 + n30. 1 + na2 < (1 + a)n

31. (a+ b)n =

n∑k=0

(n

k

)an−kbk

32.

1 + x+ x2 + · · ·+ xn =1− xn+1

1− x

33. n2 ≤ 5n!34. 9|(10n − 1)35. The sum of the interior angles of a convex

n-gon is 180(n− 2).36. If we write 3n in usual base 10 notation,

then the second from last digit is even.

37. If A =

(1 01 1

)then An =

(1 0n 1

).

38. Strengthen the result we proved earlierabout Fibonacci numbers to the follow-ing: every natural number can be writtenas the sum of distinct, nonconsecutive Fi-bonacci numbers. (It turns out that theFibonacci numbers that appear in this wayare unique. To find out more about thisyou should read about the Zeckendorf The-orem.)

Page 26: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

Chapter 5

Properties of Sets

“ If the doors of perception were cleansed every thing would appear to man as it is,Infinite.”

William Blake, The Marriage of Heaven and Hell

5.1 Operations

In this section we define union, intersection, complement, Venn diagrams, proper subsets, the emptyset, the power set, cardinality of a finite set. In the next section we establish some of the algebraicproperties of these operations.

Definition 5.1.1. Let A and B be any sets.The union of A and B is the set of all elements that are in A or B or both. We write the union

as A ∪B. In other words,A ∪B = {x | x ∈ A or x ∈ B}.

The intersection of A and B is the set of all elements that are in both A and B. We write theintersection as A ∩B. In other words,

A ∩B = {x | x ∈ A and x ∈ B}.

Example 1. Let A be the set of integers that are multiples of 6 and B be the set of multiples of10:

A = {x ∈ Z : 6|x},B = {x ∈ Z : 10|x}.

(We’ve used the alternative set-builder notation “:” for “such that” since visually it’s nice not tomix this up with divides “|”.) Describe the union A ∪B and intersection A ∩B.

This is where we ended on Friday, October 27

Definition 5.1.2. Let A and B be any sets. The relative complement or set difference is

A−B = {x ∈ A | x 6∈ B}

26

Page 27: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

CHAPTER 5. PROPERTIES OF SETS 27

Suppose both A and B are subsets of some fixed, universal set U . If A ⊆ U then we call U −Athe complement of A. We use the notation Ac for the complement:

Ac = U −A.

Example 2. Define the sets A and B as

A = {x ∈ Z | 3|x},B = {x ∈ Z | 5|x}.

The most plausible definition of the universal set here is U = Z, which we will assume.A = 3Z and B = 5Z. Describe A−B.

(a) Define the sets(b) Let U = Z. Describe Ac.

Example 3. Let A = 3Z and B = 5Z and U = Z. Draw the Venn diagram for A ∪ B, A ∩ B,A−B, B −A, Ac, Ac ∩Bc, etc.

Example 4. Make a Venn diagram showing the the Latin, Greek and Cyrillic letters.

5.1.1 The Power Set

Definition 5.1.3. For any set A, the power set of A is the collection (or set) of all subsets of A.The notation for the power set is P(A).

Example 5. Find all the subsets of {4, 5, 6}.

Definition 5.1.4. If A is a finite set, the cardinality of A, written as card(A) is the number ofelements that A has.

Example 6. For the set A = {4, 5, 6} what is card(A) and what is card(P(A))? Care to conjecture?

Theorem 5.1.5. If A is a finite set, with n elements, then the power set of A has exactly 2n

elements. In other wordscard(P(A)) = 2card(A).

This is where we ended on Monday, October 30

Example 7. Prove that if A and B are any sets, then A ∩B = B if and only if B ⊆ A.

Example 8. Prove that if A and B are any sets then A− (A−B) = A ∩B.

Page 28: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

CHAPTER 5. PROPERTIES OF SETS 28

Exercises

1. Let A and B be any sets. Prove that

P(A ∩B) ⊆P(A ∪B)

This is where we ended on Monday, November 6

5.2 Algebraic properties of set operations

5.2.1 Cartesian Products

Definition 5.2.1 (Cartesian Product). Let A and B be any sets. The Cartesian Product of Aand B is a set denoted by A×B defined as shown

A×B = {(a, b) | a ∈ A and b ∈ B}

where (a, b) is defined as follows. The element (a, b) is an ordered list: it contains two elements,and the order they appear in does matter. In particular, by definition,

(a, b) = (c, d) ⇐⇒ the sets {a, b} and {c, d} are equal, andthe order the elements occur in is the same

⇐⇒ a = c and b = d.

We call (a, b) an ordered pair and we call a and b the first coordinate and second coordinaterespectively.

In other words, A×B is the set of all ordered pairs where the first entry comes from A and thesecond entry comes from B.

Example 1. The following are somewhat familiar objects, described as Cartesian Products.(a) The (x, y)-plane is the Cartesian Product R×R where the first entry is the x-coordinate and

the second entry is the y-coordinate. We often use the notation R2 for this plane.(b) The standard view window on the TI-83 calculator is from xmin = −10 to xmax = 10 and

ymin = −10 to ymax = 10. This represents the subset of R2 given by the following CartesianProduct: [−10, 10]×[−10, 10], where the first entry represents the x-coordinate and the secondthe y-coordinate.

(c) Consider the open rectangle (i.e. one that does not contain the points along the edges) withlower left hand corner at (−3,−2) and upper right hand corner at (2, 1):

−3 −2 −1 1 2

−2

−1

1

This set equals the Cartesian product (−3,−2)× (2, 1).

Page 29: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

CHAPTER 5. PROPERTIES OF SETS 29

(d) Let C be the cylinder with base centered at (1, 1, 0), radius 1 and height 2 using a Cartesianproduct:

x

y

z

We want to describe this set as a Cartesian Product. It’s three dimensional, and one of thesets we use will be two dimensional, and one will be one dimensional.

Let C be the circle in the (x, y)-plane with center (1, 1) and radius 1. To describe thecylinder we can take every element in this circle and move it to a height between 0 and 2.This is essentially the description of a Cartesian Product:

C = C × [0, 2]

Example 2. Let A = {−1, 0, 1} and B = {x2, ex, sin(x)}. Find A×B.

Theorems about Set Operations

Theorem 5.2.2. Let A, B and C be any sets and let U be a universal set. The following hold.1. A ∪B = B ∪A and A ∩B = B ∩A (Commutative Laws).2. A ∩ (B ∩ C) = (A ∩B) ∩ C and A ∪ (B ∪ C) = (A ∪B) ∪ C (Associative Laws).3. A ∩ (B ∪C) = (A ∩B) ∪ (A ∩C) and A ∪ (B ∩C) = (A ∪B) ∩ (A ∪C) (Distributive Laws).4. A ∪ ∅ = A and A ∩ ∅ = ∅.5. A ∪ U = U and A ∩ U = A

Proposition 5.2.3 (DeMorgan’s Laws). If A, B and C are any sets in a universal set U , then• (Ac)c = A• A−B = A ∩Bc

• (A ∪B)c = Ac ∩Bc and (A ∩B)c = Ac ∪Bc (De Morgan’s Laws for sets).

Proposition 5.2.4. 1. If A ⊆ C and B ⊆ C then A ∪B ⊆ C.2. If C ⊆ A and C ⊆ B, then C ⊆ A ∩B.3. A ⊆ B if and only if Bc ⊆ Ac

Theorem 5.2.5. Let A, B and C be any sets. The following hold:1. (A ∪B)× C = (A× C) ∪ (B × C)2. (A ∩B)× C = (A× C) ∩ (B × C)3. (A−B)× C = (A× C)− (B × C)

Page 30: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

CHAPTER 5. PROPERTIES OF SETS 30

4. Suppose A and B are nonempty. Then A×B = B ×A ⇐⇒ A = B.5. ∅ ×A = ∅.6. If A1 ⊆ A and B1 ⊆ B then A1 × B1 ⊆ A× B. If A and B each have at least two elements,

then there are subsets of A × B that cannot be written the form A1 × B1 for any subsetsA1 ⊆ A and B1 ⊆ B.

We will prove part 1. As usual, we will start by fixing an element in one set, and then provingthe element is contained in the other set. However, it is common to label the element using whatwe know about the set. Thus, we will not start by saying “Let x ∈ (A ∪ B) × C” but rather “Let(x, y) ∈ (A ∪B)× C” where we implicitly assume that x ∈ A ∪B and y ∈ C.

This is where we ended on Wednesday, November 8

Creating the numbers from sets

Page 31: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

CHAPTER 5. PROPERTIES OF SETS 31

Exercises

1. If A and B are any sets, then we defineA∆B as

A∆B = {x | x ∈ A or x ∈ B, and x ∈ A∩B}.This is called the symmetric difference

of A and B.Prove that A∆B = (A ∪B)− (A ∩B).

2. Prove all the parts of all the theorems andpropositions stated in this section.

Page 32: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

Chapter 6

Functions

“ Meditation is the dissolution of thoughts in Eternal awareness or Pure consciousnesswithout objectification, knowing without thinking, merging finitude in infinity.”

Voltaire

6.1 Basic Definitions

Definition 6.1.1. Let sets A and B be given. We say that f is a function, from A to B, if for allx ∈ A there exists a unique element y ∈ B that we write as y = f(x).

Definition 6.1.2. The following are synonyms for saying f is a function from A to B:1. f is a mapping from A to B.2. f : A→ B

3. Af−→ B

Some of these notations can be extended to describe also the x and y:

f : A−→Bx 7−→ y

or f : A−→Bx 7−→ f(x)

or x 7 f−→ y

Definition 6.1.3. If f : A→ B we call A the domain of f and B the codomain. We abbreviatethe domain of f as dom(f) and the codomain as codom(f).

Definition 6.1.4. Two functions f and g are equal if1. dom f = dom g,2. codom f = codom g,3. for all x ∈ dom f we have f(x) = g(x).

Definition 6.1.5 (Range, Image, and Preimage). Let f : A→ B be a function.1. Given x ∈ A if we let y = f(x), then we call y the image of x under f . We call x a preimage

of y under f .2. We define the range of f as the following set

range f = {y ∈ B | y = f(x) for some x ∈ A}

32

Page 33: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

CHAPTER 6. FUNCTIONS 33

= {f(x) | x ∈ A}.

Note that range f ⊆ B. Also note that the two definitions of range are equivalent. Finally,an alternative name for the range of f is the image of f , written as im(f). We defined imageabove for a single element, but here we are talking about the image of A under f .

Definition 6.1.6. The following are synonyms:• y is the image of x under f• f takes x to y• y is the image of x via f• y is the image of x when we apply f

Definition 6.1.7. Let f be a function defined for some elements of a subset of A. The implieddomain of f is the set dom f = {x ∈ A | f(x) is defined}.

6.1.1 Picturing functions

Example 1. Let f : [0, 1]→ R be defined by f(x) = x2. Describe f the graph of f .

If a function is defined on a finite, somewhat small, list of elements, then there is another wayto picture it’s elements. We can list all the inputs in one column, all the outputs in the second, andthen draw arrows connecting the two.

Example 2. Let f be defined as shown

f

1 7

2 8

3 9

4 10

5 11

6

7

(a) What is dom f? What is range f?(b) Find a preimage of 7. Find a preimage of 8.(c) Write f as an explicit list of equations.

Example 3. Suppose in a Calculus III class we define the function f(x, y) = sin(x2 + y2).(a) What is dom f?(b) What is codom f?(c) What is range f?

Definition 6.1.8 (Applying functions to sets). Let f : A → B be a function. Let U ⊆ A. Wedefine the set f(U) as follows

f(U) = {y ∈ B | y = f(x) for some x ∈ U}= {f(x) | x ∈ U}.

Page 34: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

CHAPTER 6. FUNCTIONS 34

Note that this is exactly the definition we used to define range. In other words, range f = f(A).We call f(U) the image of U under f .

Example 4. Let f : A→ B be a function. Let U, V ⊆ A.(a) Prove that f(U ∪ V ) = f(U) ∪ f(V )(b) Prove that f(U ∩ V ) ⊆ f(U) ∩ f(V ).(c) Find an example that shows f(U ∩ V ) = f(U) ∩ f(V ) is false.

This is where we ended on Friday, November 10

Page 35: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

CHAPTER 6. FUNCTIONS 35

6.2 Injections, Surjections, Bijections

Example 1. Let R≥0 be the real numbers that are greater than or equal to 0. Consider threepossible, alternative, definitions of a function f :

I: f : R−→R≥0x 7−→x2

II: f : R−→Rx 7−→ ex

III: f : R−→Rx 7−→x

.

In each different case, let X = dom f and Y = codom f . Answer each of the following as true orfalse, for each case.

(a) ∀x ∈ X, ∀y ∈ Y, f(x) = y.(b) ∀x ∈ X, ∃y! ∈ Y, f(x) = y.(c) ∀y ∈ Y, ∃x ∈ X, f(x) = y.

6.2.1 Quantifiers and Functions Worksheets

This is where we ended on Monday, November 14

Definition 6.2.1 (Surjective, Injective, Bijective). Let f : X → Y and let R = range f .1. We say that f is injective if it satisfies the following

∀y ∈ R,∃!x ∈ X, f(x) = y.

The key part of the definition here is “unique”2. We say that f is surjective if it satisfies the following:

∀y ∈ Y,∃x ∈ X, f(x) = y.

3. We say that f is bijective if it satisfies the following:

∀y ∈ Y,∃!x ∈ X, f(x) = y.

This is where we ended on Wednesday, November 15

Definition 6.2.2. Synonyms for injective:• if x1 6= x2, then f(x1) 6= f(x2)• if f(x1) = f(x2) then x1 = x2• f is one-to-one.• f is 1:1.• f : X ↪→ Y• The graph of f passes the horizontal line test: every horizontal line intersects the graph of f

at most once. (This only makes sense for functions defined on real numbers.)

Synonyms for surjective:• R = Y , i.e. range f = codom f .• f(X) = Y , i.e. the image of X under f equals Y• f is onto• f : X →→ Y

Synonyms for bijective:

Page 36: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

CHAPTER 6. FUNCTIONS 36

• f is injective and surjective• f is one-to-one and onto• f satisfies a strong horizontal line test: every horizontal line in Y intersects the graph of f

exactly once.

• f : X∼−−→ Y or f : X

∼=−→ Y or f : X ↪→→ Y .

Example 2. Show that the function f : R−→Rx 7−→x2

is neither injective nor surjective.

Example 3. Let E be the set of even integers. Show that f : Z−→Ex 7−→ 2x

is a bijection.

Example 4. Consider again the function f defined in Example 2. This function is not injective,because f(1) = 7 and f(6) = 7, but 1 6= 6. This can be visualized with the fact that two arrowspoint to 7.

This function is also not surjective, because no element maps to 11.

Example 5. Let f be defined as shown

f : R× R× R−→R(x, y, z) 7−→ z(x2 + 4y2 − 2x2y + 4) .

Prove that f is surjective but not injective.

Example 6. Assume that following is a properly defined function1

f : R≥0 × R≤0−→R≥4(x, y) 7−→x2 + 4y2 − 2x2y + 4 .

Show that f is surjective but not bijective.

Example 7. Define f as shown

f : R× R−→R(x, y) 7−→x2 + 4y2 − 2x2y + 4 .

Show that f is surjective.

Example 8. Let U ⊆ R× R be defined as

U = {(x, y) ∈ R× R | y = x− 2}.

and define a function f asf : U −→R

(x, y) 7−→x2 + 4y2 − 2x2y + 4 .

Show that f is injective

Example 9. Suppose f is injective. Prove that f(U ∩ V ) = f(U) ∩ f(V ).

This is where we ended on Monday, November 20

1What does that mean? In all cases we would check that the function is defined on the indicated domain, and thatit takes its values in the indicated codomain. It’s “obvious” in this case that the function is defined on R≥0×R≤0, inother words, we can plug in any of the indicated numbers for x and y and the result will be defined, so the domain isR≥0 ×R≤0. It’s not obvious all the values that f equals are in R≥4. So that is what we have been asked to assume.This is also why we have the funny extra conditons on the domain, that x ≥ 0 and y ≤ 0. See the next example tounderstand why we need these conditions to make the codomain equal to R≥4.

Page 37: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

CHAPTER 6. FUNCTIONS 37

6.2.2 Inverse functions and actions on sets

Definition 6.2.3. Let f : X → Y be a function. For any set B ⊆ Y we define a set, f−1(B), asfollows

f−1(B) = {x ∈ X | f(x) ∈ B

Example 10. Let f : X → Y and let A,B ⊆ Y . Prove that f−1(A ∩B) = f−1(A) ∩ f−1(B).

Definition 6.2.4. Let f : X → Y be bijective. We define a function f−1 : Y → X as follows: Lety ∈ Y , then there exists a unique x ∈ X such that f(x) = y; we define f−1(y) = x.

Example 11. For each formula below, identify domains and codomains where the resulting functionis a bijection, and then describe the domain, codamin, and formula for the inverse function.

(a) f(x) = ex

(b) g(x) = x2

Definition 6.2.5. Let f : A → B and g : B → C. Then we define the function g ◦ f : A → C asfollows

g ◦ f : A−→Cx 7−→ g(f(x))

where f is applied first to take x to f(x), and then g is applied to f(x) to get g(f(x)).

Theorem 6.2.6. Let f : A→ B and g : B → C.1. If f and g are both injective then so is g ◦ f .2. If f and g are both surjective then so is g ◦ f .

Page 38: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

CHAPTER 6. FUNCTIONS 38

Exercises

1. Let f : A→ B. Suppose that there exists afunction g : B → A such that g◦f : A→ Asatisfies g(f(x)) = x for all x ∈ A. Showthat f is injective. (If g exists we call it aleft inverse of f .)

2. Let f : A→ B. Suppose that there exists afunction g : B → A such that f ◦g : B → B

satisfies f(g((x)) = x for all x ∈ B. Showthat f is surjective. (If g exists we call it aright inverse of f .)

3. Let f : A → B. Show that f is a bijec-tion if and only if there exists g : B → Asuch that f(g(x)) = x for all x ∈ B andg(f(x)) = x for all x ∈ A.

Page 39: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

Chapter 7

Relations

“ All existence is co-existence. The world is what I share with others. . . . To be is to berelated.”

Heidegger

7.1 Relations

Definition 7.1.1. Let A and B be any sets. A relation between A to B is a subset of A×B. Inother words, R is a set of ordered pairs with first element in A and second element in B. If A = Bthen we say R is a relation on A. Given (a, b) ∈ R we write aRb.

Example 1. Define the relation R on N by xRy if x = y + z for some z ∈ N. Can you describethis relation in more familiar terms?

This is where we ended on Monday, November 20

Example 2. The following are all relations that that you have probably seen before

=, <,≤, >,≥ all defined on R| (divides) defined on Z

≈ (similar),∼= (congruent) defined on the set of all triangles

Example 3. Let A = {1, 2, 3, 4} and B = {4, 5, 6, 7}. The following are relations:

R = {(1, 1), (2, 2), (3, 3), (4, 4)}S = {(1, 4), (2, 5), (3, 4)}

S−1 = {(4, 1), (5, 2), (4, 3)}

Here are some extra properties that these relations have:(a) R is a relation on A. It defines “=”.(b) S is a relation from A to B. It doesn’t define anything familiar. Note that S doesn’t use all

the elements of A or B.

39

Page 40: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

CHAPTER 7. RELATIONS 40

(c) S−1 is a relation from B to A.

Definition 7.1.2. Let R be a relation on the set A.(a) R is reflexive if for all a ∈ A we have aRa.(b) R is irreflexive or antireflexive if for all a ∈ A we have a�Ra.(c) R is symmetric if for all a, b ∈ A we have aRb ⇐⇒ bRa.(d) R is antisymmetric if for all a, b ∈ A we have (aRb ∧ bRa) =⇒ a = b.(e) R is transitive if for all a, b, c ∈ A we have (aRb ∧ bRc) =⇒ aRc.

Note that parts (d) and (e) are both if–then statements. In each case the property does not assumeor assert that the hypothesis of the if–then necessarily holds. In other words, property (d) says IFaRb and bRa, then a = b. Of course for most elements a, b we won’t have aRb and bRa, and so forthose elements we’ll have the antisymmetric property is vacuously true.

Challenge. Can you think of what anti-transitive means? Can you make up an example, probablyon just a handful of elements arbitrarily put together, like in the example before the definition, ofa relation that is anti-transitive? Can you find any realistic example?

Example 4. Which properties does the relation <, defined on R, satisfy?

Challenge. Let A = {1, 2, 3}. How many possible relations can you define on A? How many ofthem satisfy the various properties listed above?

Challenge. Can you think of a relation on a set that is both reflexive and anti-reflexive? Can youthink of one that is both symmetric and anti-symmetric?

Example 5. Consider the set

{DEUS, PATER, FILIUS, SPIRITUS SANCTUS}

Define a relation “EST” on these four elements by the diagram below1):

DEUS

FILIUSPATER

SPIRITUS

SANCTUS

NON EST

NO

NE

STN

ON

EST

ESTEST

ES

T

1The diagram is called the “Shield of the Trinity” and dates back to at least the 13th century. It appeared invarious manuscripts, books, church decorations, and heraldry. It is a summary of parts of the Athanasian Creed onthe Trinity.

Page 41: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

CHAPTER 7. RELATIONS 41

The phrase “NON EST” indicates that “EST” does not hold.What relation properties does this relation satisfy? (You probably have to assume a little more

than what I’ve told you to answer some of the questions.)

This is where we ended on Monday, November 27

Example 6. Let R be the relation | defined on Z, i.e. aRb if a|b. Which properties does R satisfy?

Example 7. (a) Find an example of a set and a relation on that set that is symmetric andtransitive, but not reflexive.

(b) Proof Evaluation: If R is symmetric and transitive, then R is reflexive.

7.2 Partial Orders and Equivalence Relations

Definition 7.2.1. A partial order is a relation that is reflexive, antisymmetric, and transitive.A total order is a partial order R such that for all a, b in the underlying set we have aRb or bRa.An equivalence relation is a relation that is reflexive, symmetric, and transitive.

Example 1. The relation | defined on the integers is a partial order, as shown in an example fromthe last section.

Example 2. Let U be any universal collection of sets. In other words, we will view U as acollection of sets, and we view all the other sets we’ll talk about as elements of U . For instance,you could imagine U = P(R), i.e. all the possible subsets of R.

View “⊆” as a relation defined on the subsets of U . Show that “⊆” is a partial order on P(U).

Example 3. Let A be the set of all differentiable functions defined on R or on subsets of R. .Define a relation ≡ on A as follows

∀F,G ∈ A, F ≡ G ⇐⇒ F ′ = G′.

Prove that this is an equivalence relation (assuming basic facts from Calculus I).

Definition 7.2.2 (Congruence modulo n). Let n be a positive integer. Define a relation ≡ on theset of integers as follows:

x ≡ y (mod n) ⇐⇒ n|(x− y).

This is where we ended on Friday, December 1

Definition 7.2.3. The following are synonyms:• x ≡ y (mod n),• x is equivalent to y modulo n,• n divides x− y,• x− y = nk for some k ∈ Z,• x and y differ by a multiple of n,• x equals y plus a multiple of n,• x and y have the same remainder when divided by n.

If n is fixed in a certain context we will often drop the notation “mod n” and simply write x ≡ y.

Example 4. Let n = 7.

Page 42: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

CHAPTER 7. RELATIONS 42

(a) 4 ≡ 4 (mod 7) because 7|(4− 4).(b) 31 ≡ 17 (mod 7) because 7|(31− 17).(c) 24 6≡ 4 (mod 7) because 7-(24− 4).

Theorem 7.2.4. If n is any positive integer, then the relation a ≡ b (mod n) defined on integersa, b is an equivalence relation.

Page 43: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

Chapter 8

Cardinality

“ Some infinities are bigger than other infinities. ”John Green, The Fault in Our Stars

8.1 Basic properties and Countable Sets

We talked about cardinality before, but only with finite sets, where it’s hardly necessary. Now wetalk about it for any sets, but in the back of our mind we will be most interested in applying it toinfinite sets.

Theorem 8.1.1. Let U be any universal collection of sets and define a relation on U as follows

A ∼ B ⇐⇒ there exists a bijection f : A→ B.

Then A ∼ B is an equivalence relation.

Definition 8.1.2. In the notation of the Theorem, if A ∼ B, we say that A and B have the samecardinality. We write cardA = cardB.

Example 1. Show that A and B have the same cardinality where A = {3, 6, 9, 12, 15, 18} andB = {α, β, γ, δ, ε, η}.

This is where we ended on Monday, December 4

Example 2. Let E be the set of multiples of eleven. Show that Z and E have the same cardinality,i.e. “the same number of elements”.

Example 3. Show that N and the following set have the same cardinality

B = {−100, 10000, −1000000, 100000000, . . . }.

(We assume that the pattern coninues infinitely: positives and negatives alternate, and the numberof 0s goes up by two each time.)

43

Page 44: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

CHAPTER 8. CARDINALITY 44

Definition 8.1.3. Let A be a set. We say that A is countable if A is finite or card(A) = card(N). Ifwe have to distinguish between the finite case and the infinite case we’ll say the latter is countablyinfinite.

Example 4. Show that Z is countable.

This is where we ended on Wednesday, December 6

8.2 Unions

Example 1. Watch the video about the Hilbert Hotel up to minute 1:18.

Example 2. Let A be a finite set and B be a countably infinite set such that A and B are disjoint.Then A ∪B is countable.

Example 3. Watch the video about the Hilbert Hotel from minute 1:18 to minute 2:15.Note that part of what makes the Hilbert Hotel example easy to understand, is that it forces

our mind to number the rooms rather than the guests and passengers. However, when given sets,what we are actually doing is numbering the elements, i.e. the guests and passengers, and so somesteps are harder. In particular, in the hotel example “a guest in room n goes to room 2n” but wewill have to describe “the nth person after they are all merged together will be either the guestwho was in room n/2 or the passenger who was in seat number bn/2c.”

Example 4. Let A and B be countably infinite and disjoint. Then A ∪B is countable.

Example 5. Watch the video about the Hilbert Hotel from minute 2:15 to the end.What kind of union is the rest of the video talking about? Can you carefully state the result,

not the proof, in terms of sets and unions?

8.3 Rational Numbers

Theorem 8.3.1. A set A is countable if and only if there exists a surjection f : N→ A.

Theorem 8.3.2 (Cantor). The rational numbers are countable.

Here’s a pretty good sketch of the proof: Infinity is bigger than you think (stop it at 3:38) byNumberphile.

A different, and very interesting alternative proof is sketched at Infinite Fractions by Number-phile. This gives a direct construction of the a sequence consisting of all rational numbers with norepeats and all in reduced form!

Page 45: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

CHAPTER 8. CARDINALITY 45

Exercises

1. Describe, implicitly, using a path, a bijec-tion N× N→ N.

2. (Cantor Pairing Function)

(a) Show that the following function isproperly defined, i.e. that f(n,m) ∈N for all (n,m) ∈ N:

f : N× N−→N

(n,m) 7−→ (n+m+ 1)(n+m)

2+m

.

(b) Show that the following function is

properly defined:

g : N−→N× Nn 7−→ (n− b, a+ b− n)

a =

⌊√8n+ 1− 1

2

⌋b =

a2 + a

2

(c) Show that f(g(n)) = n for all n ∈N and g(f(n,m)) = (n,m) for all(n,m) ∈ N×N. Conclude that f andg are bijections.

8.4 Uncountable Infinities

Definition 8.4.1. We say that a set is uncountable if it is not countable.

Definition 8.4.2. Let U be any universal collection of sets and A and B sets in U . We definecard(A) < card(B) to mean that there exists an injection f : A → B but there does not exista bijection. As usual, the notation card(A) ≤ card(B) means card(A) < card(B) or card(A) =card(B).

Lemma 8.4.3. If A is an infinite set then card(A) ≥ card(N).

Example 1. Define the following sets:

poly(Q) = the set of all polynomilas with rational coefficients,

poly(R) = the set of all polynomials with real coefficients,

M2 = the set of all 2× 2 matrices with entries coming from R,Mn = the set of all n× n matrices with entries coming from R,

[0, 1] = the interval from 0 to 1,

C = the complex numbers,

R3 = R× R× RRn = R× R× · · · × R where R appears n times,

RR = the set of all functions from R to R.

Based on earlier examples, arrange the following in a chain of cardinality inequalities if you can:

• N× N,• N,• Q+,

• poly(Q)• R3,• Mn

• [0, 1]• C• Rn

Page 46: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

CHAPTER 8. CARDINALITY 46

• R+,• P(N)• P(R)• P(Mn)

• Q,• R× R,• RR

• poly(R)

• Z,• M3

• R3,

Theorem 8.4.4 (Cantor). The real numbers are uncountable.

To get a quick idea of why this is true, watch the next three and half minutes of Infinity isbigger than you think (stop at 7:04) by Numberphile.

Example 2 (Cantor’s Game). Let’s play a game: you and I will be assigned real numbers. Youget all the rationals, I get all the irrationals. Here’s how we play: you can name any nontrivialclosed interval you want, say [1, 5] or [π, 10π]. I can name any nontrivial closed interval I want, aslong as it’s contained in yours, so I could name [1, 3] or [7π, 8π]. Then we repeat with each personalways having to name an interval contained in the last one named by the other person.

Let’s suppose we take an infinite number of turns (countably infinite, naturally). Then theintersection of all the intervals we eventually name will contain at least one real number (this istrue because the intervals are closed and they are nested, constricting tighter and tighter aroundsome value). I win if it’s irrational, you win if it’s rational. Let’s bet $100 on the outcome. Whathappens?

Example 3. Fill in more of the Example 1, comparing cardinalities above.

“ I see it, but I do not believe it!”Cantor (in a letter to Dedekind about this result)

Theorem 8.4.5 (Cantor). Let [0, 1] be the closed interval of numbers in the real number line.Then

card([0, 1]× [0, 1]) = card([0, 1]).

Example 4. Return to Example 1 and see if we can fill in more steps.

Theorem 8.4.6 (Cantor’s Theorem). Let S be a set and P(S) the power set of S. Then

cardS < card P(S)

There’s a good sketch of this result at Cantor’s Infinities (stop at minute 49) by ProfessorRaymond Flood at Gresham College, United Kingdom.

Like Cantor’s other results, this one has prompted many reactions, from rejection when Cantorfirst published it, to extrapolation to philosophical questions such as the claim that the set of alltruths does not exist (see Patrick Grim, “There Is No Set of All Truths.” Analysis 44, no. 4 (1984),pp.206-08).

Corollary 8.4.7. The following chain of inequalities is true:

cardN < card P(N) < card P(P(N)) < card P(P(P(N))) < . . .

Challenge (Extra Credit: get an A for the course). Answer the following as true or false, witha proof or counter-example: Let A ⊆ R be fixed. Then A is either countable, or there exists abijection f : A→ R.

Page 47: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

CHAPTER 8. CARDINALITY 47

Exercises

1. Let f : X → Y be any function. Sup-pose X = X1 ∪ X2 such that X1 andX2 are disjoint, f(X1) and f(X2) are dis-joint, and the restrictions f : X1 → Y andf : X2 → Y are injective. Prove that f isinjective.

2. Proof evaluation: suppose we apply Can-tor’s diagonalization argument to rationalnumbers. On the one hand, we know that

the rational numbers are countable. Onthe other hand, it appears that if we listthem using decimals, then we can alwaysconstruct one that’s not on the list. Eval-uate what goes wrong.

3. Apply Cantor’s diagonalization argumentto prove directly that

card(N) < card(P(N))

Appendix: Extra Resources

There are lots of fun videos about infinity, some of them do a better job than me in presentingthe material: either because they use time lapse to race through stuff, or because they use moreentertaining pictures, etc. Here’s a roundup of the best ones I found, with a little extra informationabout them to help guide your viewing.• How many kinds of infinity are there? by Vihart.

Pros: covers a lot of material, and I love Vihart’s videos. Cons: a bit long at 14:56, andby 2:00 is mostly about the notation for cardintal and ordinal numbers which is a bit moreconfusing than I would like to do in class.

• Proof some infinities are bigger than other infinities by Vihart.This is a good intro to Cantor’s diagonalization argument. At 10:50, it’s longer than it

needs to be for just the result and proof, so it also has very nice background to thinkingabout this result, including thinking about sequences of numbers, and about sets of numbers,including a lightning fast idea behind the countability of of the rational numbers.

• 9.999... reasons that .9999...=1 by Vihart.This idea comes up in the proof that the unit square has the same cardinality as the unit

interval, but I didn’t really explain anything about it there. I just sort of assumed that peopleknew that 0.9999 · · · = 1 and simlar equalities hold for other infinite repeating sequences of9s. But, if you want to explore this idea, this video is the right resource for you.

• Infinite Trees Are Super Weird by Vihart.More paradoxes of infinity. In this one, Vihart outlines why an infinite tree (in the graph

theoritic sense) will have a countable number of nodes, but an uncountable number of paths.• Doodling in Math Clas: Squiggle Inception by Vihart.

This video gives you a good idea of how to generate a space filling curve. The space fillingcurve, in turn, shows how to imagine a bijection f : [0, 1] → [0, 1] × [0, 1]. Vihart doesn’tquite make this connection in the video, because each time she does an iteration she makesher picture get larger. But just imagine taking her picture, that she draws larger, and thenshrinking it on the photocopier so you get one that has the same overall size as the firs picture,but with lines and squiggles much smaller and denser.

• Space-Filling Curves by Numberphile.This video is much more explicitly about Hilbert’s space filling curve, and gets to appli-

cations of it in coding.• To get a quick idea of why this is true, watch Minute Physics How to Count to Infinity

Page 48: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

CHAPTER 8. CARDINALITY 48

• The Infinite Hotel Paradox by Jeff Dekofsky, TED-Ed.This is nice, 6:00, animation of the thought experiment by David Hilbert that illustrates

seeming paradoxes involving infinty.• How to Count Past Infinity by Vsauce.

This is really good, but longish (23:45), video that explains cardinality of finite sets, andinfinite cardinalities, and then ordinals.

“The essence of mathematics lies in its freedom” Cantor.• Infinity is bigger than you think by Numberphile.

This is a good video explaining the whole thing from counting, to countable infinity, touncountable via diagonalization, in 8:00. Here’s a timeline: 0:00–1:00, the concept of infintyitself; 1:00–2:08, countable infinity including integers; 2:08–3:38, countability of the rationals;3:38–7:04 uncountability of the reals; 7:04–7:59 about Cantor himself, his life, the reaction tohis work.

• Infinity Paradoxes by Numberphile.A quick precise of Hilbert’s hotel (briefer than the one by Minute Physics), then Gabriel’s

Horn, then the probablity of throwing a dart and hitting a specific point, double your moneystrategy.

• Cantor’s Infinities by Professor Raymond Flood at Gresham College, United Kingdom. Thisis an hour long lecture, but done well, some sort of an invited address kind of thing. It includesa picture of Cantor’s memorial, which has some graphical representation of his most famousresults.

Here’s an outline of some of its material:Minute 35: shows that the numbers (0, 1) have the same cardinality as R.Minute 36: explains why the irrationals are not countable.Minute 37: algebraic and transcendental numbers.Minute 40: Starts to talk about greater cardinalities. Mentions the cardinality of the plane

is the same.Minute 41: defines the power set.Minute 42: states Cantor’s theorem, verbally.Mentions “belongs to the club” which reminds me of Groucho Mark’s quote: “I wouldn’t

belong to any club that has me as a member.”Minute 42–49: A good sketch of the proof of Cantor’s Theorem, i.e. the fact that a set

has strictly smaller cardinality than its power set.Minute 50: states the continuum hypothesis.Minute 53: great quote from Cantor about his own theory. I think it alludes to God, but

the speaker doesn’t mention that.• If you want to see how these topics still provoke discussion and disagreement, see these videos

(by nonmathematicians): Cantor’s Paradox by CHistrue and Anger at Stupidity of Cantor’sBigger Infinities Diagonalisation Argument.

Page 49: Discrete Mathematics - Loyola University Marylandevergreen.loyola.edu/educkworth/www/395_Fall_2017/... · CHAPTER 1. INTRODUCTION 9 1.2 Constructing Direct Proofs Example 1. Translate

Index

∃, 33∃!, 39∀, 33=⇒ , 5∨, 21

Boolean algebra, 23

conclusion, 5conjunction, 20continuous, 37contrapositive, 25, 26converse, 25

disjunction, 21divides, 31, 41

properties, 41divisible, 41

elements, 29even, 11Even and Odd, 11existential statement, 33

factor, 41

hypothesis, 5

if and only if, 22If–then, 5integers, 6irrational, 6

members, 29multiple, 41

natural, 6

odd, 11

open sentence, 29

predicate sentence, 29primitive terms, 6propositional function, 29

quantifiers, 34

rational numbers, 6real numbers, 6

defining properties, 8Roster notation, 30

set, 29set equality, 31Set-builder, 30

theorem, 14truth set, 30

universal set, 30universal statement, 33

vacuous, 5vacuously, 5

49