Discrete Mathematics

Similar documents
Chapter 1 : The language of mathematics.

586 Index. vertex, 369 disjoint, 236 pairwise, 272, 395 disjoint sets, 236 disjunction, 33, 36 distributive laws

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes

Lecture Notes 1 Basic Concepts of Mathematics MATH 352

Theorem. For every positive integer n, the sum of the positive integers from 1 to n is n(n+1)

Cartesian Products and Relations

Notes for Math 290 using Introduction to Mathematical Proofs by Charles E. Roberts, Jr.

Foundations of Mathematics

1.1 Statements and Compound Statements

Mathematics Course 111: Algebra I Part I: Algebraic Structures, Sets and Permutations

Sets. We discuss an informal (naive) set theory as needed in Computer Science. It was introduced by G. Cantor in the second half of the nineteenth

Sets and Functions. (As we will see, in describing a set the order in which elements are listed is irrelevant).

Section 0. Sets and Relations

Final Exam Review. 2. Let A = {, { }}. What is the cardinality of A? Is

Sets are one of the basic building blocks for the types of objects considered in discrete mathematics.

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

Introduction to Proofs

INFINITY: CARDINAL NUMBERS

Notation Index. gcd(a, b) (greatest common divisor) NT-16

1. Consider the conditional E = p q r. Use de Morgan s laws to write simplified versions of the following : The negation of E : 5 points

Logic, Sets, and Proofs

Mathematics Review for Business PhD Students Lecture Notes

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

Mathematics Review for Business PhD Students

Lecture Notes on DISCRETE MATHEMATICS. Eusebius Doedel

Week Some Warm-up Questions

POL502: Foundations. Kosuke Imai Department of Politics, Princeton University. October 10, 2005

0 Sets and Induction. Sets

LECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel

n Empty Set:, or { }, subset of all sets n Cardinality: V = {a, e, i, o, u}, so V = 5 n Subset: A B, all elements in A are in B

ABOUT THE CLASS AND NOTES ON SET THEORY

MATH 220 (all sections) Homework #12 not to be turned in posted Friday, November 24, 2017

A Guide to Proof-Writing

Mathematical Reasoning & Proofs

In N we can do addition, but in order to do subtraction we need to extend N to the integers

Chapter 1. Sets and Mappings

In N we can do addition, but in order to do subtraction we need to extend N to the integers

SETS AND FUNCTIONS JOSHUA BALLEW

Foundations Revision Notes

HANDOUT AND SET THEORY. Ariyadi Wijaya

Review CHAPTER. 2.1 Definitions in Chapter Sample Exam Questions. 2.1 Set; Element; Member; Universal Set Partition. 2.

Chapter 1. Sets and Numbers

LECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel

FOUNDATIONS & PROOF LECTURE NOTES by Dr Lynne Walling

Math 13, Spring 2013, Lecture B: Midterm

MAT115A-21 COMPLETE LECTURE NOTES

Analysis I. Classroom Notes. H.-D. Alber

CSCE 222 Discrete Structures for Computing. Review for Exam 1. Dr. Hyunyoung Lee !!!

3. Abstract Boolean Algebras

2 Lecture 2: Logical statements and proof by contradiction Lecture 10: More on Permutations, Group Homomorphisms 31

Discrete Mathematics: Lectures 6 and 7 Sets, Relations, Functions and Counting Instructor: Arijit Bishnu Date: August 4 and 6, 2009

Part IA Numbers and Sets

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

3 The language of proof

3. Only sequences that were formed by using finitely many applications of rules 1 and 2, are propositional formulas.

Analysis 1. Lecture Notes 2013/2014. The original version of these Notes was written by. Vitali Liskevich

Chapter Summary. Sets The Language of Sets Set Operations Set Identities Functions Types of Functions Operations on Functions Computability

MTH 299 In Class and Recitation Problems SUMMER 2016

4.1 Real-valued functions of a real variable

UNIVERSITY OF CALICUT SCHOOL OF DISTANCE EDUCATION B Sc (MATHEMATICS) I Semester Core Course. FOUNDATIONS OF MATHEMATICS (MODULE I & ii) QUESTION BANK

Topology. Xiaolong Han. Department of Mathematics, California State University, Northridge, CA 91330, USA address:

Introduction to Proofs in Analysis. updated December 5, By Edoh Y. Amiran Following the outline of notes by Donald Chalice INTRODUCTION

CSE 1400 Applied Discrete Mathematics Proofs

5 Set Operations, Functions, and Counting

Set theory. Math 304 Spring 2007

Automata Theory and Formal Grammars: Lecture 1

Review 1. Andreas Klappenecker

SOLUTIONS TO EXERCISES FOR. MATHEMATICS 205A Part 1. I. Foundational material

Boolean Algebra CHAPTER 15

Seminaar Abstrakte Wiskunde Seminar in Abstract Mathematics Lecture notes in progress (27 March 2010)

Economics 204 Summer/Fall 2017 Lecture 1 Monday July 17, 2017

Copyright c 2007 Jason Underdown Some rights reserved. statement. sentential connectives. negation. conjunction. disjunction

Propositional Logic, Predicates, and Equivalence

Contribution of Problems

CHAPTER 0: BACKGROUND (SPRING 2009 DRAFT)

CS2742 midterm test 2 study sheet. Boolean circuits: Predicate logic:

About This Document. MTH299 - Examples Weeks 1-6; updated on January 5, 2018

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products

Definitions. Notations. Injective, Surjective and Bijective. Divides. Cartesian Product. Relations. Equivalence Relations

MATH 2200 Final LC Review

Chapter 1 Elementary Logic

Chapter Summary. Sets (2.1) Set Operations (2.2) Functions (2.3) Sequences and Summations (2.4) Cardinality of Sets (2.5) Matrices (2.

Review 3. Andreas Klappenecker

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

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

1. From Lewis Carroll: extract a pair of premises and finish the conclusion.

Chapter 1 The Real Numbers

Name (print): Question 4. exercise 1.24 (compute the union, then the intersection of two sets)

A Logician s Toolbox

ADVANCED CALCULUS - MTH433 LECTURE 4 - FINITE AND INFINITE SETS

Discrete Mathematics. Thomas Goller. January 2013

Chapter 1. Logic and Proof

A Semester Course in Basic Abstract Algebra

Notes on ordinals and cardinals

Contribution of Problems

Intro to Logic and Proofs

Topics in Logic and Proofs

Fundamentals of Pure Mathematics - Problem Sheet

Finite and Infinite Sets

Numbers, sets, and functions

Transcription:

Discrete Mathematics Dr. Thomas Baird January 7, 2013 Contents 1 Logic 2 1.1 Statements.................................... 2 1.1.1 And, Or, Not.............................. 2 1.1.2 Implication............................... 3 1.1.3 Quantifiers................................ 3 1.2 Truth Tables.................................. 4 1.3 Theorems and Proofs.............................. 6 1.3.1 Direct Proof............................... 6 1.3.2 What can I assume?.......................... 6 1.3.3 Proof by Example/Counterexample.................. 7 1.3.4 Proof by Cases............................. 7 1.3.5 Proving the Contrapositive....................... 8 1.3.6 Proof by Contradiction......................... 8 1.4 Boolean Algebra................................ 9 1.5 Logical Arguments using Boolean Algebra.................. 13 2 Sets and Relations 16 2.1 Operations on Sets............................... 18 2.1.1 Unions and Intersections........................ 18 2.1.2 Set Differences and Complements................... 19 2.1.3 Cartesian Products........................... 21 2.2 Relations..................................... 21 2.2.1 Equivalence Relations......................... 22 2.2.2 Partial Orders.............................. 24 3 Functions 25 3.1 Composition and Inverses........................... 28 3.1.1 Inverses................................. 28 3.1.2 Composition............................... 30 3.2 One-to-one correspondence and Cardinality.................. 32 3.2.1 Countable infinity............................ 34 3.2.2 Uncountable infinity.......................... 35 1

4 The Integers 38 4.1 The Division Algorithm............................ 39 4.1.1 Presenting natural numbers in various bases............. 41 4.2 Divisibility and the Euclidean Algorithm................... 43 4.2.1 Greatest Common Divisor....................... 45 4.3 Prime Numbers................................. 49 4.4 Congruence and Modular Arithmetic..................... 51 4.4.1 Error correcting codes......................... 56 4.4.2 The ring Z n............................... 56 5 Mathematical Induction 58 5.0.3 Mathematical induction and the well-ordering principle....... 59 1 Logic 1.1 Statements A (mathematical) statement or proposition is an ordinary English statement of fact that can be assigned a truth value: it can be either true or false. Some examples: Green is not a colour. 5 is greater than 3. 1 + 1 = 3. All birds have feathers. 1.1.1 And, Or, Not Statements can be combined in various ways to form compound statements. For instance, the statement The sky is blue and the grass is green is true if and only if both the sky is blue is true and the grass is green is true. It is convenient use symbols called variables to represent statements. We typically use variables p, q or r. Definition 1. Let p, q both be statements. The compound statement p and q is true if both p and q are true; it is false if either p is false or q is false (or they are both false). Another way to combine statements is to use or. For example x is less than zero or x is greater than one is a compound statement. The word or is somewhat ambiguous in common usage. In mathematics, we adopt the convention that or is meant inclusively, in the following sense. Definition 2. Let p, q both be statements. The compound statement p or q is true if either p or q is true, or they are both true; it is false only when p and q are both false. 2

Definition 3. Let p be a statement. Then not p is a statement that is true if p is false, and false if p is true. We call not p the negation of p. Later, when we study the algebra of propositions it will be convenient to have symbolic notation for and, or and not. We list this here for later reference. p q means p and q p q means p or q p means not p. 1.1.2 Implication Another important kind of compound statement are implications. This is a statement of the form If p, then q or p implies q. We write this symbolically as p q. Definition 4. Let p and q be statements. Then the implication p q is statement that is true if p is false, or if p is true and q is true; it is false only when p is false and q is true. In this implication p is called the hypothesis and q is called the conclusion. A simple example of a true implication is If x = 4, then x is even. Definition 5. The converse of the implication p q is the implication q p. For example the converse of If x = 4, then x is even is If x is even, then x = 4. We see from this example that the converse of a true implication may be false. Definition 6. A double implication p q is a short hand for the statement p q and q p. The double implication p q is true if p and q have the same truth value: either p and q are both true or both false. A double implication can also be written p if and only if q. An example of a true double implication is x = 0 x 2 = 0, where x is a real number. Definition 7. The contrapositive of an implication p q is the implication q p. Equivalently, the contrapositive of If p, then q is If not q, then not p. The value in this concept is the following fact: An implication is logically equivalent to its contrapositive: One is true if and only if the other is. For example, If x = 4, then x is even is equivalent to If x is not even, then x does not equal 4. 1.1.3 Quantifiers It often occurs in mathematics that we make statements about a whole class of objects rather than a particular object (in fact we have been doing this implicitly above). To do this we use quantifiers for all or there exists. Some examples. For all real numbers x, x 1 if and only if x 2 1. 3

There exists a real number x such that x 2 = 1. All dogs have four legs. Quantifiers have an interesting property under negation. For example, consider the statement For all real numbers x, x 2 0. The negation of the statement is There exists a real number x, such that x 2 is not greater than or equal to 0. There is standard notation for quantifiers means for all means there exists, but we will not use this notation in this course. 1.2 Truth Tables The definitions of compound statements in the previous section are somewhat clumsy, because the definitions made use of the words we are trying to define! Truth tables are an alternative way to present the meaning of compound statements. Consider the following table explaining the meaning of and, or and not (,, respectively). p q p q p q p T T T T F T F F T F F T F T T F F F F T In this table the first two columns show all possible truth values of p and q, and the remaining values show the truth value of the compound statement. We can produce a similar table for implications p q p q q p p q T T T T T T F F T F F T T F F F F T T T Truth tables are a convenient way to present the truth values of compound statements that can be confusing to state in words. They also provide a way to systematically determine the meaning of compound statements. Consider the contrapositive implication q p. p q p q q p p q T T F F T T T F F T F F F T T F T T F F T T T T 4

Here we determined the truth values for q p step by step, first determining the truth values for the simpler statements p and q. Observe that the truth values for the last columns q p and p q are identical. When two columns of a truth table are identical, we call the corresponding compound statements logically equivalent. We have thus demonstrated that: an implication is logically equivalent to its contrapositive. PROBLEM: Show that p q is logically equivalent to p q. Solution: p q p p q p q T T F T T T F F F F F T T T T F F T T T Remark 1. The equivalence of p q with p q means that the implies operation is redundant. In fact, every compound statement is logically equivalent to one composed only of the operations, and. However, the concept of implies comes up so often in mathematics that we tend to think of it as a basic operation. PROBLEM: Construct a truth table for (p q) ( p r). Solution: p q r p p q p r (p q) ( p r) T T T F T T T T T F F T F F T F T F T T T T F F F T F F F T T T T T T F T F T T T T F F T T F T T F F F T F T T Remark 2. One application of compound statements (a.k.a. Boolean logic) is to the design of the digital logic gates that underly all digital electronics. In this application, the truth values of the variables (which we may think of as a string of 0s and 1s) are the input, and the truth value of the compound statement is the output. Definition 8. A compound statement that is always true, regardless of the truth value of its variables, is called a tautology. A compound statement that is always false, regardless of the truth value of its variables, is called a contradiction. 5

For example, consider the truth table p p p ( p) p ( p) T F T F F T T F so the statement p ( p) (a.k.a. p or not p ) is a tautology, while p ( p) (a.k.a. p and not p ) is a contradiction. 1.3 Theorems and Proofs A proof of a statement is a convincing logical argument that demonstrates that the statement is true. A theorem is a statement that has been proven to be true. Theorems are most often stated in the form of an implication p q. In this case, we call p a sufficient condition for q and call q is a necessary condition for p. Consider the following theorem (that we will prove shortly) Theorem 1.1. Let x be a real number. If 0 < x < 2, then x 2 < 4. In this case, 0 < x < 2 is a sufficient condition for x 2 < 4, and x 2 < 4 is a necessary condition for 0 < x < 2. 1.3.1 Direct Proof There are several different basic approaches to proving a theorem. The most straightforward is called a direct proof. A direct proof of an implication p q begins by assuming that p is true, and then uses logical arguments to show that q must also be true. Consider the following example Proof of Theorem 1.1. Suppose that 0 < x < 2. Since x > 0 is positive, it follows that x 2 < 2x because multiplying the inequality x < 2 by the positive number x preserves the inequality. Similarly, multiplying 2 by x < 2 we deduce 2x < 4. Because x 2 < 2x and 2x < 4, we conclude that x 2 < 4. 1.3.2 What can I assume? Observe that in the course of proving Theorem 1.1 we used some facts about inequalities. This leads to the question: What facts are we permitted to use in the course of proving a theorem? The answer is that it is really a judgement call that depends on context and on the audience for whom the proof is intended. For the purposes of this course, the student is free to apply standard facts learned in high school about the algebra of real numbers, fractions and integers, as well as the following list of facts. 6

The product of nonzero real numbers is nonzero. The square of a nonzero real number is a positive number. An even integer is one of the form 2k for some integer k; an odd integer is one of the form 2k + 1 for some integer k. The product of two even integers is even; the product of two odd integers is odd; the product of an odd integer and an even integer is even. A real number is rational if it is a common fraction, that is, the quotient m n integers m and n with n 0. of A real number is irrational if it is not rational. An irrational number has a decimal expansion that neither repeats, nor terminates. A prime is a positive integer p > 1 that is divisible only by ±1 and ±p, for example 2, 3, 5, 7,... 1.3.3 Proof by Example/Counterexample If a statement involves a there exists quantifier, then it may often be proven by producing an example. PROBLEM: Prove that there exists a real number x such that x 2 9 = 0. Solution: 3 is a real number and 3 2 9 = 9 9 = 0. The phrase disprove a statement to mean prove the negation of a statement. example disproving a statement is called a counterexample. An PROBLEM: Prove or disprove that for all prime numbers p, the number 2 p 1 is prime. Solution: We can check the first few primes p. 2 2 1 = 3 is prime, 2 3 1 = 7 is prime, 2 5 1 = 31 is prime, 2 7 1 = 127 is prime, but 2 11 1 = 2047 = 23 x 89 is not prime. Thus p = 11 is a counterexample and the statement has been disproven. 1.3.4 Proof by Cases Sometimes it is best to break a statement into cases and prove each case separately. PROBLEM: Prove that for all integers n, the number 5n 2 + 3n 4 is even. Solution: The number n can be either even or odd. We consider these cases in turn. 7

First consider the case that n is even, so n = 2k for some integer k. Then 5n 2 + 3n 4 = 5(2k) 2 + 3(2k) 4 = 20k 2 + 6k 4 = 2(10k 2 + 3k 2) is even. Now consider the case that n is odd, so n = 2k + 1 for some integer k. Then is also even. 5n 2 + 3n 4 = 5(2k + 1) 2 + 3(2k + 1) 4 1.3.5 Proving the Contrapositive = 5(4k 2 + 4k + 1) + 6k + 3 4 = 20k 2 + 26k + 4 = 2(10k 2 + 13k + 2) Recall that an implication p q is logically equivalent to the contrapositive q p. Thus we can prove p q by proving q p. PROBLEM: Show that if four distinct integers have an average of 6, then one of the integers is greater than 7 Solution: The contrapositive statement is If four distinct integers are less than or equal than 7, then their average is not 6. Let a, b, c, d be four distinct integers arranged so 7 a > b > c > d. Then b a 1 6, c b 1 a 2 5, and similarly, d 4. Thus the average a + b + c + d 4 proving the contrapositive statement. 1.3.6 Proof by Contradiction 7 + 6 + 5 + 4 4 = 22 4 < 6, Another way to prove that a statement is true is to assume that it is false and show that this leads logically to an absurdity. PROBLEM: Prove that 2 is irrational. Solution: Suppose that 2 is rational. Then 2 = m for some non-zero integers m n and n without a common factor. In particular, m and n aren t both even. Thus 2n 2 = m 2. If m were odd, then m 2 would be odd. But 2n 2 = m 2 is even, so m must be even. Let m = 2k for some integer k. Then 2n 2 = (2k) 2 = 4k 2, so n 2 = 2k 2 and we deduce that n must be even. But this is a contradiction. PROBLEM: Prove that there are infinitely many prime numbers. Solution: Suppose that there are only finitely many primes, p 1,..., p n for some positive integer n. Consider the number k = p 1 p 2...p n 1 p n + 1. Then k is not divisible by any 8

prime number p 1,..., p n because dividing leaves a remainder 1. But this is a contradiction, because every integer greater than 1 is either prime or divisible by a prime. Thus there must be infinitely many primes. 1.4 Boolean Algebra In this section, we develop an algebraic approach to statements. This is called Boolean algebra after 19th century logician George Boole. Let A and B be two compound statements. We write A B if A and B are logically equivalent. Here are some basic logical equivalences. 1. Idempotence: (p p) p (p p) p 2. Commutativity: (p q) (q p) (p q) (q p) 3. Associativity: ((p q) r) (p (q r)) ((p q) r) (p (q r)) 4. Distributivity: (p (q r)) (p q) (p r) (p (q r)) (p q) (p r) 5. Double Negation: ( p) p 6. De Morgan s Laws: (p q) p q (p q) p q Equivalences 1,2,3 and 5 are pretty clear. Equivalence 4 (distribution) is not so obvious, but we will leave its verification as an exercise. It is interesting to note that equivalences 2,3.4,5 have familiar analogues in arithmetic. For real numbers a, b, c we have a + b = b + a (Commutativity) a + (b + c) = (a + b) + c (Associativity) a(b + c) = ab + ac (Distributativity) 9

( a) = a (Double Negation) De Morgan s Law has no obvious analogue in arithmetic though. We verify De Morgan s first law using a truth table. p q p q (p q) p q p q T T T F F F F T F T F F T F F T T F T F F F F F T T T T Comparing columns gives (p q) p q. To get de Morgan s second law, substitute p and q in place of p and q and use double negation: and then negate both sides to get ( p q) ( ( p)) ( ( q)) p q p q (p q). In this calculation, we have used the following important fact about Boolean algebra. Theorem 1.2. Let A and B be logically equivalent statements with variables p 1,..., p n, and C 1,..., C n be compound statements. If, in A and B, we replace the variables p 1,..., p n with C 1,..., C n, then the resulting statements will be logically equivalent. For example, De Morgan s Law (p q) p q implies that (C 1 C 2 ) ( C 1 ) ( C 2 ). For instance, if C 1 = (p q) ( r) and C 2 = ( q r), then (((p q) ( r)) ( q r)) ((p q) ( r)) ( q r) Problem: Using the previously proven logical equivalence (p q) ( p) q and the basic logical equivalences above, prove that p q is logically equivalent to its contrapositive ( q) ( p). Solution: p q ( p) q ( p) ( q) (Double Negation) ( q) ( p) (Commutativity) q p 10

There is another set of basic identities involving tautologies and contradiction. Denote by 1 a tautology (a statement that is always true) and by 0 a contradiction (a statement that is always false). Then the following logical equivalences are easily verifiable. 1. (p 1) 1 2. (p 1) p 3. (p 0) p 4. (p 0) 0 5. (p p) 0 6. (p p) 1 7. 0 = 1 8. 1 = 0 Problem: Prove the logical equivalence [(p q) ((q r) (p r))] [( p) ( q)] Solution: (p q) ((q r) (p r)) [(p q) (q r)] [(p q) (p r)] (Distributivity) [p q r)] [p q r)] (Ass., Comm., Idem.) (p q) ( r r) (Distributivity) (p q) 0 (p q) ( p q) (De Morgan) Problem: Simplify the statement [ (p q)] [( p) q]. Solution: [ (p q)] [( p) q] [( p) ( q)] [( p) q] (De Morgan) ( p) ( q q) (Distributivity) ( p) 1 p 11

Definition 9. Let n 1 be an integer, and let p 1,..., p n be variables. A minterm based on these variables is a compound statement of the form a 1... a n, where each a i is p i or p i. A compound statement is said to be in disjunctive normal form if it looks like y 1... y m, where the statements y 1,..., y m are different minterms. To understand why these concepts are useful the truth value for the minterm p q r. p q r p q r T T T F T T F F T F T F T F F T F T T F F T F F F F T F F F F F We see that a minterm is true only for a unique combination of truth values of the variables. Then by combining minterms by using, we can produce any column of a truth table as a compound statement in disjunctive normal form. These means in particular. Theorem 1.3. Every compound statement is logically equivalent to one in disjunctive normal form. Problem: Express the statement p (q r) is disjunctive normal form. Solution: There are two ways to solve this problem. In the first way we construct a truth table. p q r q r p (q r) T T T T T T T F F F T F T F F T F F F F F T T T T F T F F T F F T F T F F F F T So the disjunctive normal form of p (q r) consists of five minterms corresponding to the five Ts occurring the last column. [p (q r)] (p q r) ( p q r) ( p q r) ( p q r) ( p q r) Alternatively, we can simply manipulate the expression p (q r) using our basic logical 12

equivalences. p (q r) ( p) (q r) [( p) (q q)] (q r) ( p q) ( p q) (q r) [( p q) (r r)] [( p q) (r r)] [(p p) (q r)] ( p q r) ( p q r) ( p q r) ( p q r) (p q r) ( p q ( p q r) ( p q r) ( p q r) ( p q r) (p q r) 1.5 Logical Arguments using Boolean Algebra We explained before that a proof of a statement is a logical argument demonstrating that the statement is true. Using the Boolean algebra developed in the previous section, we can formalize this process. A logical argument is a finite collection of statements A,..., A n, called hypotheses, followed by a statement B called a conclusion. We say that the argument is valid if whenever all hypotheses are true, then the conclusion is guaranteed to be true. Using the language of Boolean algebra, an argument is valid if the compound statement A 1 A 2... A n B is a tautology. It is more common however to use alternative notation A 1 A 2... A n B Problem: Show that the following argument is valid. p q r q r p Solution: Form a truth table. 13

p q r q p q r q p T T T F F T F T T F F F T F T F T T T F F T F F T T F F F T T F T T T F T F F T T T F F T T T F T F F F T T T T Observe that it is only in the fifth row where all three hypotheses are true, and in that row the conclusion is also true. Thus the argument is valid. This argument can also be proven to be valid without constructing a truth table as follows. Assume that all the hypotheses are true. Then r is true. Because r implies q, we deduce that q is true. Because q is true and p implies q, it must be that p is false. Thus p is true. A third proof using basic logical equivalences, but it is tricky. [(p q) (r q) r] p [(p q) ( r q) r] p [(p q) (( r r) (q r))] p [(p q) q r] p [( p q) q r] p [(( p q) ( q q)) r] p [ p q r] p 1 Problem: Determine whether the argument is valid. If I like biology, then I will study it I will study biology or I will fail the course If I fail the course, then I do not like biology Solution: Denote the statements p = I like biology, q = I will study biology, r = I will fail the course. Then the argument is p q q r r p Form a truth table. 14

p q r p q q r p r p T T T T T F F T T F T T F T T F T F T F F T F F F F F T F T T T T T T F T F T T T T F F T T T T T F F F T F T T Observe that in the top row both hypotheses are true but the conclusion is false; if I like biology and study biology and still fail the course, this fulfills the two hypotheses without fulfilling the conclusion. Thus the argument is not valid. Here is a list of basic, valid arguments. We call them rules of inference. They have crazy Greek names that you don t have to remember. 1. 2. p p q q p q q p (Modus Ponens) (Modus Tollens) 3. p q p q (Disjunctive Syllogism) 4. 5. p q q r p r p r q ( r) p q (Chain Rule) (Resolution) Problem: Verify Resolution Solution: Form the truth table. 15

p q r p r r q r p q T T T T F T T T T F T T T T T F T T F F T T F F T T T T F T T T F T T F T F F T T T F F T T F F F F F F F T T F The hypotheses are both true in rows 1,2,4 and 5, and the conclusion holds in all these cases. Problem: (p q) (s t) [ (( s) ( t)]] [( r) q] (p q) (r q) Solution: Observe that the second hypothesis, [ (( s) ( t)]] [( r) q] is logically equivalent (using De Morgan s Law and the meaning of implication) to so the argument is equivalent to (p q) (s t) (s t) (r q) (p q) (r q) which is valid due to the chain rule. [s t] [r q] 2 Sets and Relations Now that we have developed a theory of statements, we want some objects to make statements about. In mathematics, we most often make statements about sets. Basically, a set is a collection of things called elements. Some familiar examples include the set of integers Z and the set of real numbers R. There are several ways to construct/define sets. One way is to list the elements inside of a set of curly brackets. {a, b, c} is a set containing elements a, b, c. 16

N := {1, 2, 3,...} is the set of natural numbers. Z := {..., 3, 2, 1, 0, 1, 2...} is the set of integers. The notation := means equal by definition. Another way to define sets uses set builder notation. This has the form {x x has certain properties}, which is read the set of x such that x has certain properties. More generally, we write {some expression the expression has certain properties}. For instance, the set of odd, natural numbers can be written: or as or as {n n is an odd integer, n > 0} {2k 1 k = 1,2,...} {2k 1 k N}. The expression k N is read k is an element of N or k belongs to N. The expression k N reads k is not an element of N. A variation on this notation can be used when the elements of the set are drawn from another set. For example, the even integers may be denoted {n Z n is divisible by 2}. Many important sets have their own symbols. We ve seen already the natural numbers N, the integers Z and the real numbers R. Some other important examples include the rational numbers Q := { m m, n Z, and n 0} n and the complex numbers C := {a + bi a, b R} where i is a number such that i 2 = 1, and the empty set := {} the set containing no elements. A set can contain another set as an element. For example, the set {{a, b}, c} contains two elements, {a, b} and c. Definition 10. Two sets are considered equal if they contain the same elements. For example, {1, 2, 1} = {1, 2} = {2, 1} 17

{x R x 2 1 = 0} = { 1, +1} Observe that { } is not equal to, because { } but. Definition 11. Given two sets A, B, we say that A is a subset of B denoted A B if every element of A is also a subset of B. For example {a, b} {a, b, c} N Z Q R C. A subset A B is called proper if A B and A (note this definition differs slightly from the text). In terms of Boolean algebra notation, we can consider x A as a statement that may be either true or false. Then for sets A, B A B (x A) (x B) and A = B (x A) (x B). Proposition 2.1. If A and B are sets, then A = B if and only if A B and B A. Definition 12. Let A be a set. The power set of A, denoted (A), is the set of all subsets of A. For example If A = {a}, then (A) = {, {a}} If A = {a, b}, then (A) = {, {a}, {b}, {a, b}} If A = {a, b, c}, then (A) = {, {a}, {b}, {a, b}, {c}, {a, c}, {b, c}, {a, b, c}} 2.1 Operations on Sets 2.1.1 Unions and Intersections The union of two sets A and B, written A B, is the set of elements in A or in B. That is x A B (x A) (x B). The intersection of two sets A and B, written A B, is the set of elements in A and in B. That is x A B (x A) (x B). For example, if A = {a, b, c} and B = {a, x, y, b} then A B = {a, b, c, x, y}, A B = {a, b} 18

A { } = {a, b, c, } Observe that for any set A, A = A and A =. The operation of taking unions is associative and commutative in the sense that A (B C) = (A B) C A B = B A. This follows from the fact that is associative and commutative. The union of n elements, A 1, A 2,...,A n is denoted n A 1... A n = A i, represents the set of elements lying in at least one of the sets A i. Similarly, intersections are associative and commutative and we write n A 1... A n = representing the set of elements common to all of the sets A i. Unions and intersections interact according to a distribution law, similar to the interaction of and. In particular, for sets A,B,C, and i=1 i=1 A i A (B C) = (A B) (A C) A (B C) = (A B) (A C). These distribution laws are nicely illustrated using Venn diagrams (done in class). Problem: Prove that A (B C) = (A B) (A C). Solution: Two sets are equal if they contain the same elements. Using the rules of logical equivalence, x A (B C) (x A) ((x B) (x C)) so A (B C) = (A B) (A C). ((x A) (x B)) ((x A) (x C)) x (A B) (A C) 2.1.2 Set Differences and Complements The set difference of two sets A and B, written A \ B is the set of elements contained in A but not contained in B. That is Examples x A \ B (x A) (x B) (x A) (x B). 19

{a, b, c} \ {a, c} = {b} {x, y} \ {y, z} = {x} {a, b, } \ = {a, b, } {a, b, } \ { } = {a, b} An important special case is when A and B are understood to be subsets of common universal set U. In this situation, we may write the set difference U \ A = A c and call it the complement of A. In this situation, we have A \ B = A B c, (A c ) c = A. For example, the complement of the set of even integers is the set of odd integers, when both are regarded as subsets of Z. The complement of the set {x R x > 0} is the set {x R x R}, when both are regarded as subsets of R. Proposition 2.2 (De Morgan s law for sets). Let A and B be subsets of a universal set U. Then (A B) c = A c B c (A B) c = A c B c Proof. We use the corresponding rule in logic. For all x U, we have x (A B) c (x A B) ((x A) (x B)) ( (x A) (x B)) (x A c ) (x B c ) x A c B c To get the other version of De Morgan s rule, substitute A c and B c in place of A and B in the one we ve already proven, (A c B c ) c = (A c ) c (B c ) c = A B and then take complements on both sides to get A c B c = (A B) c Definition 13 (Interval Notation:). If a and b are real numbers with a < b, then define [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 closed interval an open interval a half-open interval a half-open interval 20

We also include half infinite intervals in this notation (a, ) = {x R a < x} (, b) = {x R x < b} Some examples of operations with intervals. 2.1.3 Cartesian Products [0, ) ( 3, 7) = [0, 7) [0, 2) c = (, 0) [2, ) [0, 4] \ [3, 5] = [0, 3) If A and B are sets, the Cartesian product (or simply product) of A and B is the set of ordered pairs A B := {(a, b) a A, b B}. More generally, the product of n 2 sets A 1,..., A n is A 1 A 2... A n = {(a 1,..., a n ) a 1 A 1,..., a n A n } When the sets are all equal, we write the n-fold product A n := A... A. The elements (a, b) are called ordered pairs, because the order is important. In particular (a, b) (b, a) (unless a = b). This means that it is not generally true that A B equals B A. For general n, we call (a 1,..., a n ) an ordered n-tuple, or simply an n-tuple. Examples, {a, b} {x, y, z} = {(a, x), (a, y), (a, z), (b, x), (b, y), (b, z)} A = = A, for any set A. R 2 = R R is the Cartesian plane. 2.2 Relations Definition 14. Let A and B be sets. A relation from A to B is a subset R A B. Example 1. Let A be the set of names of retired NHL hockey players, and let B = Z be the set of integers. We define a relation R := {(a, b) A B player a scored b career goals}. Then R would contain (Wayne Gretzky, 894) and (Gordie Howe, 801) for example. Example 2. Let A be the set of prime numbers and let B := Z be the set of integers. We define the relation R := {(p, n) A B n is divisible by p}. Then R would contain (3, 12) and (5, 25) but would not contain (2, 7). 21

An important special case that we will focus on for the next couple of classes is when A = B so R A A. We call such a relation a binary relation on A or simply a relation on A. Example 3. The relation on R, {(x, y) R R x 2 + y 2 = 1} defines the unit circle in R 2. 2.2.1 Equivalence Relations Definition 15. An equivalence relation on a set A is a binary relation R on A satisfying three properties. 1. R is reflexive, meaning that (x, x) R for all x A. 2. R is symmetric, meaning that (x, y) R if and only if (y, x) R. 3. R is transitive, meaning that if (x, y) R and (y, z) R, then (x, z) R. When working with an equivalence relation, it is common to use notation x y to mean (x, y) R, and we will adopt this convention. In this notation, an equivalence relation must satisfy for all x, y, z A 1. x x 2. x y implies y x 3. x y and y z implies x z. Example 4. On any set A, equality is an equivalence relation, because for all a, b, c A the three properties a = a a = b implies b = a a = b and b = c implies a = c are satisified. Example 5. We say that two integers a, b Z are congruent modulo 3, and write a b if a b is divisible by 3 (that is, there exists k Z such that a b = 3k). This is an equivalence relation because for all a, b, c Z a a = 0 = 3 0, so a a. If a x, then there exists an integer k such that a b = 3k. Thus b a = 3k is divisible by 3, so b a. If a b and b c then there exist integers k, l such that a b = 3k, and b c = 3l. Thus a c = (a b) + (b c) = 3k + 3l = 3(k + l) is divisible by 3 and we conclude that a c. 22

Example 6. Let A be the set of playing cards in a standard deck. For a, b A, the relation a b if a and b have the same suit is an equivalence relation (check this). Definition 16. Given a set A with equivalence relation and x A, the equivalence class of x, denoted x, is the set x := {y A x y}. We denote by A/ the set of equivalence classes. Proposition 2.3. Let A be a set with equivalence relation and let x, y A. Then x y if and only if x = y. Proof. Suppose that x = y. By reflexivity, y y, so y y, hence y x and we conclude that x y. Now suppose conversely that x y. We must prove that x = y. We accomplish this by proving y x and x y. Suppose that a y. This means that y a. But x y so using transitivity it follows that x a, so a x. We conclude that y x. Of course by symmetry, x y implies that y x so by a similar argument, we conclude that x y. Thus x = y. Definition 17. Two sets are called disjoint if their intersection is the empty set. partition of a set A is a collection of disjoint subsets of A whose union is A. Proposition 2.4. Let A be a set with equivalence relation. The equivalence classes form a partition of A. Proof. Let x A. By reflexivity, x x, so x x. Thus every element of A lies in some equivalence class, so the union of equivalence classes is A. It remains to show that any two equivalence classes are either equal or disjoint. Suppose that x and y are not disjoint. Then there exists some element z x y, meaning that x z and y z. Applying Proposition 2.3 this means that x = z and y = z, so x = y completing the proof. Example 7. The equivalence classes determined by the relation equality are the single element subsets of A. Example 8. For the equivalence relation congruence modulo 3, there are three equivalence classes 0 = {3k k Z}, 1 = {3k + 1 k Z} 2 = {3k + 2 k Z}. This is proven using the division algorithm to show that every integer can be uniquely expressed as a multiple of 3 plus a remainder of 0, 1 or 2. We will explore this in greater depth later in the course. Example 9. There are four equivalence classes of playing cards: hearts, clubs, diamonds and spades and these partition cards into subsets. The converse to Proposition 2.4 is also true: the sets in a partition of A are the equivalence classes of an equivalence relation on A (homework problem). This means that an equivalence relation on a set A is equivalent in some sense to a partition of A. 23 A

2.2.2 Partial Orders Another especially important kind of binary relation are partial orders. Definition 18. A partial order on a set A is a binary relation R A A satisfying three properties. We use notation a b to mean (a, b) R. 1. a a (reflexivity). 2. a b and b a implies a = b (anti-symmetry). 3. a b and b c implies a c (transitivity). It is convenient to use notation a b to mean a b and a b. A pair (A, ) consisting of a set A and a partial order is called a partially ordered set, or poset. Example 10. The motivating example is the relation on R. For a, b, c R we have 1. a a 2. a b and b a implies a = b 3. a b and b c implies a c. Example 11. Given a set A, the relation is a partial order on the power set (A) (homework problem). Example 12. Any subset of a poset is a poset under the restricted relation. So for example, the set {A Z A contains at least one even number} is a poset under inclusion. Also, the sets N, Z and Q are all partially ordered by. Example 13. Let (A, ) and (B, ) be two partially ordered sets. The lexicographical ordering, also called the dictionary ordering on A B, is the partial order (a 1, b 1 ) (a 2, b 2 ) if a 1 a 2 or (a 1 = a 2 and b 1 b 2 ) To see that this is a partial order, we check the axioms. Let (a, b), (a, b ), (a, b ) A B. 1. (Reflexivity) (a, b) (a, b) because this implies that a = a and b b. 2. (Anti-symmetry) First observe that if (a, b) (a, b ) then a a or a = a which implies that a a. Now suppose that both (a, b) (a, b ) and (a, b ) (a, b). Then a a and a a so by anti-symmetry a = a. This then implies that b b and b b, so by anti-symmetry b = b. Thus a = a and b = b, so (a, b) = (a, b ). 3. (Transitivity) Suppose that (a, b) (a, b ) (a, b ). From what has already been argued, this implies that a a and a a so by transitivity, a a. If a a, we conclude that (a, b) (a, b ). Otherwise a = a. Because a a, this implies a a and by anti-symmetry this means that a = a = a. It follows then that b b b so by transitivity b b and thus (a, b) (a, b ). 24

The motivating example of a lexicographical ordering is the ordering on two letter words coming from the ordering of letters in the alphabet. Another good example begins with A = B = {x Z x 0}, both equipped with the usual inequality. The lexicographical ordering is then (a, b) (c, d) if a < c or if a = c and b < c. It is common to write a + b in place of (a, b) in this case, so we get 1 2 3... + 1 + 2... 2 2 + 1... Definition 19. An element b in a partially ordered set (A, ) is called maximal if for x A, b x implies that b = x. An element s (A, ) is called minimal if for x X, x s implies x = s. For example (R, ) contains no maximal or minimal elements. (N, ) has no maximal element, but has 1 as a minimal element. ({2, 5, 7}, ) has 2 as a minimal element and 7 as a maximal element. ( (A), ) has as a minimal element and A as a maximal element. ({A Z A contains at least one even number}, ) has Z as a maximal element, and an infinite collection of minimal elements of the form {2k} for each k Z. 3 Functions Along with sets, functions are arguably the most basic objects in mathematics. We give two, complementary definitions. Definition 20. Let A and B be two sets. A function or map f from A to B, denoted f : A B is a rule that associates to every element x A, a unique element f(x) B. Here A is called the domain or source of f, and B is called the codomain or target of f. This concept can be pictured schematically using points and arrows (drawn in class). Example 14. Let f : R R be defined by f(x) = x 2 + 1. Then for example f(3) = 3 2 + 1 = 10. This is an example of a polynomial function. 25

Example 15. Let A be a set and let B A be a subset. We can define a function f : A {0, 1} by the rule for a A, { 1 if a B f(a) := 0 if a B. Example 16. There is a map f : Z {even, odd} defined by f(n) = even if n is even and f(n) = odd if n is odd. Example 17. Any Boolean compound statement determines a function. For example p q defines a function f : {T, F } {T, F } {T, F } by the rule f(p, q) = the truth value of p q. For example f(t, T ) = T T = T and f(f, F ) = F F = F. We remark that two statements are logically equivalent precisely when they define the same function in this fashion. A function can also be defined as a special kind of relation. This is the point of view presented in the text. Definition 21. A function f from A to B determines and is determined by a relation Gr(f) A B, such that for each a A, there is exactly one pair in Gr(f) with first coordinate a. We use notation f(a) to denote the unique element in B for which (a, f(a)) Gr(f). We call Gr(f) the graph of f. Some examples The relation {(1, a), (2, b), (3, a)} defines a function from {1, 2, 3} to {a, b}. {(1, b), (3, a)} does not define a function from {1, 2, 3} to {a, b}, because 2 does not appear as the first coordinate of a pair in the relation. It may however be interpreted as a function from {1, 3} to {a, b}. {(1, b), (2, a), (1, a)} does not define a function from {1, 2, 3} to {a, b}, because 1 appears twice as the first coordinate of a pair in the relation. Relations in R R = R 2 can often be drawn as subsets of the Cartesian plane. We can test whether such a relation is the graph of a function using the vertical line test : the relation defines a function from R to R if every vertical line intersects the subset exactly once. For example the graph of the function f(x) = x 2 + 1 is a parabola satisfying the vertical line test. On the other hand, the relation R := {(x, y) R 2 x 2 + y 2 = 1} is not the graph of a function because (0, 1) and (0, 1) are both elements of R. 26

Definition 22. Two functions f and g are considered equal if the have the same domain and codomain and we have equality for all elements a of the common domain. f(a) = g(a) Example 18. The functions f : R R and g : R R defined by the expressions and f(x) = 1 g(x) = (x 1)2 + 1 1 + (1 x) 2 are equal as functions, because for any x R, f(x) = 1 = g(x). Definition 23. The range or image of a function f : A B is the subset f(a) B defined by f(a) = {f(a) B a A} = {b B b = f(a) for some a A}. We say that that f is onto or surjective if the range f(a) is equal to B. In terms of the graph, Gr(f) A B, the range of f is the set b B occurring as the second coordinate of some ordered pair in Gr(f). Thus f is onto if and only if every element of B occurs at least once as the second coordinate of some pair in Gr(f). Definition 24. A function f : A B is called one-to-one or injective if for all x, y A, x y implies f(x) f(y). In terms of the graph Gr(f) A B, the function f is injective if each element of B occurs at most once as the second coordinate of a pair in Gr(f). Example 19. Consider the function f : {1, 2, 3} {a, b} defined by the graph Gr(f) = {(1, a), (2, b), (3, a)}. Then the range f({1, 2, 3}) = {a, b} because f(1) = a and f(2) = b, so f is onto. On the other hand, f(1) = a = f(3) so f is not one-to-one. Example 20. The function f : R R defined by f(x) = x 2 + 1 has range equal to the half-infinite interval f(r) = [1, ) R. Since f(r) R, this means that f is not surjective. The function is also not injective, because f(1) = 2 = f( 1). PROBLEM: Determine whether the map g : Z Z defined by the equation g(x) = 3x 3 x is one-to-one and onto. 27

Solution: We begin by checking whether g is one-to-one. integers such that g(a) = g(b). Then we get the equation 3a 3 a = 3b 3 b which may be manipulated to yield the equation a b = 3(a 3 b 3 ) = 3(a b)(a 2 + ab + b 2 ) Suppose that a and b are If a b, then a b is non-zero so we can divide both sides of the equation by a b to get or equivalently, 1 = 3(a 2 + ab + b 2 ) a 2 + ab + b 2 = 1 3. But this is impossible, because a and b are integers. We conclude that a = b and that g is injective. Next we consider whether g is surjective. If so, then for every b Z, there exists x Z such that g(x) = 3x 3 x = b. Consider the case b = 1. Then is the a solution to 1 = 3x 3 x? This would imply that 1 can be factored as 1 = x(3x 2 1) where x and 3x 2 1 are integers. But the only integers that divide 1 are 1 and 1, so these are the only possible choices for x. Then we just check, g(1) = 3 1 3 1 = 2 and g( 1) = 3 ( 1) 3 ( 1) = 3 + 1 = 2. So neither g(1) nor g( 1) equal 1 and we conclude that 1 does not lie in the range of g, so g is not surjective. Example 21. In contrast to the preceding problem, the function h : R R defined by h(x) = 3x 3 x is not one-to-one, because for example and f( 1 3 ) = 3( 1 3 ) 3 1 3 = 1 3 1 3 = 0, f(0) = 3(0) 3 0 = 0. It is also the case that h is onto (this uses the intermediate value theorem). This illustrates the fact that specifying the domain and codomain are important parts of defining a function. 3.1 Composition and Inverses 3.1.1 Inverses Definition 25. Let R A B be a relation from A to B. The inverse relation R 1 is the relation from B to A, satisfying R 1 := {(b, a) B A (a, b) A B}. Observe that any relation equals the inverse of its inverse: (R 1 ) 1 = R. 28

Example 22. If a relation from R to R, R R R = R 2 is considered geometrically as a subset of the plane, then the inverse R 1 is obtained by reflection around the line x = y. Suppose our relation is the graph of a function Gr(f) A B. Under what circumstances is the inverse relation also the graph of a function? Proposition 3.1. Let f : A B be a function. The inverse of the graph Gr(f) 1 B A is the graph of a function from B to A if and only if f is one-to-one and onto. In this case, we call the function defined by Gr(f) 1 the inverse function and denote it f 1 : B A. Proof. By Definition 21, the relation Gr(f) 1 defines a function from B to A if and only if every element of B occurs exactly once as the first coordinate of a pair in Gr(f) 1 B A. This is equivalent to the condition that every element of B occurs exactly once as the second coordinate of a pair in Gr(f) A B. But this is equivalent to the condition that every b B occurs at least once (meaning f is onto) and that every b B occurs at most once (meaning f is one-to-one). Observe that the inverse function satisfies the property f(a) = b a = f 1 (b). Example 23. Let f : {a, b, c} {x, y, z} be the function satisfying f(a) = z, f(b) = x, and f(c) = y. Then f is one-to-one and onto. This inverse function f 1 : {x, y, z} {a, b, c} satisfies f 1 (x) = b, f 1 (y) = c, and f 1 (z) = a. Example 24. Let g : R R be defined by g(x) = 3x + 8. Then g is one-to-one and onto. To find the inverse function, consider the equation y = g(x) = 3x + 8 Manipulating to isolate x, we get the equivalent equation so g 1 (y) = 1 (y 8). 3 1 (y 8) = x, 3 29

Example 25. The function f : R R defined by the expression f(x) = e x is one-to-one, but it is not onto, because e x is positive for all x R. On the other hand, if R + := {a R a > 0}, then the map g : R R + defined by the expression g(x) = e x is both one-to-one and onto. The inverse function g 1 : R + R is the natural logarithm g 1 (x) = ln(x). 3.1.2 Composition Definition 26. Let f : A B and g : B C be two functions. The composition, g f is the function g f : A C defined by (g f)(a) = g(f(a)) for all a A. One way to understand this concept is with a commutative diagram (expanded on in class) A f g f B C. g Example 26. Suppose f : {x, y} {1, 2, 3} and g : {1, 2, 3} {a, b} are functions with graphs Gr(f) = {(x, 1), (y, 3)}, Gr(g) = {(1, a), (2, a), (3, b)} then the composition g f : {x, y} {a, b} satisfies so g f has graph g f(x) = g(f(x)) = g(1) = a g f(y) = g(f(y)) = g(3) = b Gr(g f) = {(x, a), (y, b)}. Example 27. Consider f : R R and g : R R be defined by the expressions and f(x) = x 2 2x + 1, g(x) = 2x 1. Then both g f and f g are functions from R to R, satisfying (g f)(x) = g(f(x)) (f g)(x) = f(g(x)) = 2(x 2 2x + 1) + 1 = 2x 2 4x + 2 + 1 = 2x 2 4x + 3 = (2x 1) 2 2(2x 1) + 1 = 4x 2 4x + 1 4x + 2 + 1 = 4x 2 8x + 4. 30

From the preceding example, we see that it is not generally true that f g equals g f. In other words, composition is not a commutative operation. Proposition 3.2. The composition of functions is an associative operation. That is, if f : A B, g : B C and h : C D are functions, then as functions from A to D. (h g) f = h (g f) Proof. Both (h g) f and h (g f) are function from A to D. To show they are equal, we must check that give the same value for each a A. We have ((h g) f)(a) = (h g)(f(a)) = h(g(f(a))) and as desired. (h (g f))(a) = h((g f)(a)) = h(g(f(a))) Example 28. Let f, g, h be functions from R to R defined by the expressions f(x) = sin(x), g(x) = x 2 + 1, h(x) = e x. Then (f g)(x) = f(g(x)) = sin(x 2 + 1) and (g h)(x) = g(h(x)) = e 2x + 1, so ((f g) h)(x) = sin((h(x)) 2 + 1) = sin((e x ) 2 + 1) = sin(e 2x + 1) and (f (g h))(x) = sin((g h)(x)) = sin(e 2x + 1). The concept of an inverse function has a nice interpretation in terms of composition of functions. First a definition: Definition 27. Given a set A, the identity function, Id A : A A is the function satisfying Id A (a) = a for all a A. Proposition 3.3. Suppose that f : A B is a one-to-one and onto function, with inverse f 1 : B A. Then we have equalities f 1 f = Id A f f 1 = Id B. Conversely, if f : A B and g : B A are functions such that f g = Id B and g f = Id A, then both functions are one-to-one and onto and g = f 1, f = g 1.(need to add proof of converse) 31

Proof. The inverse function satisfies the condition that for each a A, f(a) = b a = f 1 (b) so (f 1 f)(a) = f 1 (f(a)) = f 1 (b) = a = Id A (a), and we conclude that f 1 f = Id A. For the other identity, simply observe that (f 1 ) 1 = f so f f 1 = (f 1 ) 1 f 1 = Id B. PROBLEM: Show that the functions f : R (1, ) and g : (1, ) R defined by f(x) = 3 2x + 1 and g(x) = 1 2 log 3(x 1) are inverses. Solution: For any x R we have (g f)(x) = 1 2 log 3((3 2x + 1) 1) = 1 2 log 3(3 2x ) = 1 2 (2x)log 3(3) = x so g f = Id R. For any x (1, ), (f g)(x) = 3 2 1 2 log3(x 1) + 1 = 3 log3(x 1) + 1 = (x 1) + 1 = x so f g = Id (1, ). By Proposition 3.3, this means that f and g are inverse functions. 3.2 One-to-one correspondence and Cardinality In this section, we develop a concept of the size of a set, called its cardinality. Let A and B be two sets. A one-to-one corresondence or bijection between A and B is a function f : A B which is one-to-one and onto. Two sets A and B are said to have the same cardinality, written A = B if there is a one-to-one correspondence between them. 1 1 Cardinality can be considered an even more basic concept than number, because it allows us to compare the sizes of sets without labeling that size with an abstract symbol. For example, a 35,000 year old tally stick with 29 notchs called the Lebombo Bone is believed to have been used for tracking menstrual cycles. It is unlikely that such an early culture had a word for twenty-nine. 32

Example 29. There is a one-to-one correspondence between the sets {a, b, c} and {1, 2, 3} defined by a 1, b 2 and c 3, so {a, b, c} = {1, 2, 3}. The function f : N N {0} sending n to f(n) = n 1 is a one-to-one correspondence, so N and N {0} have the same cardinality. The function g : Z {even integers} defined by g(n) = 2n is a one-to-one correspondence, so Z = {even integers} The function between intervals, h : (0, 1) (0, 2) defined by the expression h(x) = 2x is a one-to-one correspondence, so (0, 1) = (0, 2). The function between intervals φ : (0, 1) (1, ) defined by φ(x) = 1/x is a one-to-one correspondence, so (0, 1) = (1, ) Observe that (as is implicit in the notation) the concept of cardinality has all the properties of an equivalence relation: for any sets A, B and C A = A because Id A : A A is a one-to-one correspondence. A = B implies B = A, because if f : A B is a one-to-one correspondence then f 1 : B A is a one-to-one correspondence If A = B and B = C, then A = C because if f : A B and g : B C are one-to-one correspondences, then g f : A C is a one-to-one correspondence (prove this). Definition 28. A set is called finite if it is empty, or if there exist a one-to-one correspondence to a set of the form {1, 2,..., n} for some natural number n N. A set is called infinte if it is not finite. We say that the cardinality of the empty set is zero and write = 0. If a set A has one-to-one correspondence with the set {1,..., n} then we say that A has cardinality n and write A = n. The concept of cardinality allows us to compare the sizes of infinite sets, as we ve already seen in examples. We will prove shortly that not all infinite sets have the same cardinality, so there are different sizes of infinity. Definition 29. A set A is called countably infinite if it has the same cardinality as N. An set is called uncountably infinite if is infinite, but does not have the cardinality of N. A set is called countable if it is finite or countably infinite. 33

3.2.1 Countable infinity The cardinality of N is often denoted ℵ 0, spoken aleph not, so we may write N = ℵ 0. A countable set is one that can be listed: there is a first, a second element, etc.. PROBLEM: Show that Z is countably infinite. Solution: We construct one-to-one correspondence f : N Z defined by { n/2 if n is even f(n) = (n 1)/2 if n is odd. As a list, this bijection is given by 0, 1, 1, 2, 2, 3, 3,... PROBLEM: Show that the Cartesian product Z Z is countably infinite. Solution: The elements in Z Z can be placed in an ordered list by spiraling around integral points in the plane,... ( 1, 2) (0, 2) (1, 2) (2, 2) ( 1, 1) (0, 1) (1, 1) (2, 1) ( 1, 0) (0, 0) (1, 0) (2, 0) ( 1, 1) (0, 1) (1, 1) (2, 1) determining the list (0, 0), (1, 0), (1, 1), (0, 1), ( 1, 1), ( 1, 0),... We can use the preceding scheme to put the set of rational numbers, Q, into a list as well. Every rational number is of the form a/b where (a, b) Z Z, so we obtain a list of rational numbers from the list above by first removing those ordered pairs with second digit 0... ( 1, 2) (0, 2) (1, 2) (2, 2) ( 1, 1) (0, 1) (1, 1) (2, 1) ( 1, 1) (0, 1) (1, 1) (2, 1) 34