Lecture Notes on DISCRETE MATHEMATICS. Eusebius Doedel

Similar documents
LECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel

LECTURE NOTES DISCRETE MATHEMATICS. Eusebius Doedel

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

COMP 182 Algorithmic Thinking. Proofs. Luay Nakhleh Computer Science Rice University

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes

MACM 101 Discrete Mathematics I. Exercises on Predicates and Quantifiers. Due: Tuesday, October 13th (at the beginning of the class)

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

Lecture Notes 1 Basic Concepts of Mathematics MATH 352

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

Proofs. Chapter 2 P P Q Q

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

Undergraduate Notes in Mathematics. Arkansas Tech University Department of Mathematics. Introductory Notes in Discrete Mathematics Solution Guide

CSE 1400 Applied Discrete Mathematics Proofs

Review 1. Andreas Klappenecker

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

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

Proofs. Chapter 2 P P Q Q

Chapter 1 : The language of mathematics.

DISCRETE MATH: FINAL REVIEW

Logic and Proof. Aiichiro Nakano

WUCT121. Discrete Mathematics. Logic. Tutorial Exercises

Topics in Logic and Proofs

Propositional Logic, Predicates, and Equivalence

0 Sets and Induction. Sets

Math 13, Spring 2013, Lecture B: Midterm

Discrete Mathematics Logics and Proofs. Liangfeng Zhang School of Information Science and Technology ShanghaiTech University

MTH 299 In Class and Recitation Problems SUMMER 2016

At least one of us is a knave. What are A and B?

Mathematics Review for Business PhD Students

Contribution of Problems

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

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

Intro to Logic and Proofs

MATH 2200 Final Review

Sample Problems for all sections of CMSC250, Midterm 1 Fall 2014

Mathematics Review for Business PhD Students Lecture Notes

Mathematical Reasoning & Proofs

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

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

MATH 2200 Final LC Review

Do not start until you are given the green signal

Tools for reasoning: Logic. Ch. 1: Introduction to Propositional Logic Truth values, truth tables Boolean logic: Implications:

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

HANDOUT AND SET THEORY. Ariyadi Wijaya

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

Chapter 1 Elementary Logic

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

Logic, Sets, and Proofs

1 The Foundation: Logic and Proofs

Foundations of Mathematics

software design & management Gachon University Chulyun Kim

Proofs. Introduction II. Notes. Notes. Notes. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry. Fall 2007

Proofs: A General How To II. Rules of Inference. Rules of Inference Modus Ponens. Rules of Inference Addition. Rules of Inference Conjunction

University of Ottawa CSI 2101 Midterm Test Instructor: Lucia Moura. March 1, :00 pm Duration: 1:15 hs

Department of Computer Science University at Albany, State University of New York Solutions to Sample Discrete Mathematics Examination II (Fall 2007)

PRACTICE PROBLEMS: SET 1

CSC 125 :: Final Exam May 3 & 5, 2010

MATH 3330 ABSTRACT ALGEBRA SPRING Definition. A statement is a declarative sentence that is either true or false.

AN INTRODUCTION TO MATHEMATICAL PROOFS NOTES FOR MATH Jimmy T. Arnold

PUTNAM TRAINING NUMBER THEORY. Exercises 1. Show that the sum of two consecutive primes is never twice a prime.

Predicate Logic. Andreas Klappenecker

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

Math 10850, fall 2017, University of Notre Dame

Packet #1: Logic & Proofs. Applied Discrete Mathematics

Wollongong College Australia

Today. Proof using contrapositive. Compound Propositions. Manipulating Propositions. Tautology

ECOM Discrete Mathematics

Contribution of Problems

A Guide to Proof-Writing

First order Logic ( Predicate Logic) and Methods of Proof

Logic Synthesis and Verification

CS 250/251 Discrete Structures I and II Section 005 Fall/Winter Professor York

Discrete Mathematical Structures: Theory and Applications

CSE 20 DISCRETE MATH WINTER

CSE 20 DISCRETE MATH SPRING

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.

Supplementary Logic Notes CSE 321 Winter 2009

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

2. The Logic of Compound Statements Summary. Aaron Tan August 2017

1 Predicates and Quantifiers

CSC Discrete Math I, Spring Propositional Logic

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

A Semester Course in Basic Abstract Algebra

Discrete Mathematics

1. Given the public RSA encryption key (e, n) = (5, 35), find the corresponding decryption key (d, n).

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

Logic. Facts (with proofs) CHAPTER 1. Definitions

Mathematical Preliminaries. Sipser pages 1-28

CSCE 222 Discrete Structures for Computing. Review for the Final. Hyunyoung Lee

Chapter 1. Sets and Numbers

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

Mathematical Reasoning Rules of Inference & Mathematical Induction. 1. Assign propositional variables to the component propositional argument.

MATH1240 Definitions and Theorems

CITS2211 Discrete Structures Proofs

Handout on Logic, Axiomatic Methods, and Proofs MATH Spring David C. Royster UNC Charlotte

Automata Theory and Formal Grammars: Lecture 1

Practice Midterm Exam Solutions

Introduction to Abstract Mathematics

Logic. Definition [1] A logic is a formal language that comes with rules for deducing the truth of one proposition from the truth of another.

WORKSHEET MATH 215, FALL 15, WHYTE. We begin our course with the natural numbers:

Transcription:

Lecture Notes on DISCRETE MATHEMATICS Eusebius Doedel c Eusebius J. Doedel, 009

Contents Logic. Introduction............................................................................... Basic logical operators.........................................................................3 Logical expressions...........................................................................4 Proofs using laws of logic...................................................................... 7.5 Predicate Calculus.......................................................................... 8.6 Equivalences involving quantifiers...................................................................7 Review Exercises........................................................................... 3 Mathematical Proofs 5. Introduction.............................................................................. 5. Direct Proofs............................................................................. 5.3 Proving the contrapositive...................................................................... 6.4 Proof by contradiction........................................................................ 7.5 Proof by cases............................................................................. 8.6 Existence proofs........................................................................... 9.7 Review Exercises........................................................................... 0 i

CONTENTS CONTENTS 3 Set Theory 3. Basic definitions........................................................................... 3. Venn diagrams............................................................................ 3.3 Subsets................................................................................ 3 3.4 Basic set theoretic identities..................................................................... 3 3.5 Review Exercises........................................................................... 4 4 Functions 5 4. Definitions............................................................................... 5 4. Inverses................................................................................ 7 4.3 Review Exercises........................................................................... 3 5 Division and Factorization 33 5. The Division Theorem........................................................................ 33 5. The Factorization Theorem..................................................................... 35 5.3 The Euclidean Theorem....................................................................... 37 5.4 Review Exercises........................................................................... 38 6 The Principle of Induction 39 6. Standard Induction.......................................................................... 39 6. Variations on the Principle of Induction.............................................................. 44 6.3 Review Exercises........................................................................... 46 ii 3-Oct-00, 3:39 pm

CONTENTS CONTENTS 7 Relations 47 7. Binary Relations........................................................................... 47 7. The Directed Graph of a Relation................................................................. 47 7.3 Composition of Relations...................................................................... 48 7.4 The Matrix of a Relation...................................................................... 5 7.5 The Inverse of a Relation...................................................................... 5 7.6 Properties of Relations........................................................................ 53 7.7 Equivalence Classes.......................................................................... 54 7.8 Closures of Relations......................................................................... 55 7.9 Powers of Relations.......................................................................... 59 8 Review Problems 6 BIBLIOGRAPHY 64 INDEX 65 iii 3-Oct-00, 3:39 pm

Chapter Logic. Introduction First we introduce some basic concepts needed in our discussion of logic. These will be covered in more detail later. A set is a collection of objects or elements. Examples. the infinite set of all integers : Z {...,,, 0,,, 3,... }. the infinite set of all positive integers : Z + {,, 3,... }. the infinite set R of all real numbers. the finite set { T, F }, where T denotes True and F False. the finite set of alphabetic characters : { a, b, c,..., z }. the infinite set P n of all polynomial functions px of degree n or less with integer coefficients. A function or map, or operator is a rule that associates to every element of a set one element in another set. Examples. If S = { a, b, c } and S = {, } then the associations a, b, c define a function f from S to S. We write f : S S. Similarly fn n defines a function f : Z + Z +. fn n can also be viewed as a function f : Z Z. The derivative operator D restricted to elements of P n can be viewed as a function from P n to P n, D : P n P n, For example, if px x 3 + x, then i.e., D : p dp dx. D : x 3 + x 3x +, Dx 3 + x 3x +. We can also define functions of several variables, e.g., fx, y x + y, can be viewed as a function from Z + cross Z + into Z +. We write f : Z + Z + Z +.

.3. LOGICAL EXPRESSIONS CHAPTER. LOGIC. Basic logical operators The basic logical operators.3 Logical expressions A logical expression or proposition Pp, q,... is a function and conjunction or disjunction not negation For example, P : B B B B. P p, q p q and P p, q, r p q r are defined in the tables below : are logical expressions. Here P : B B B, p p T F F T p q p q T T T T F T F T T F F F p q p q T T T T F F F T F F F F and P : B B B B. The values of a logical expression can be listed in a truth table. Let B { T, F }. Then we can view,, and, as functions : B B, : B B B, : B B B. We can also view the arithmetic operators, +, and, as functions : Z Z, + : Z Z Z, : Z Z Z, defined by value tables, for example, x x.. 0 0.. p q q p q T T F T T F T T F T F F F F T T Analogously, arithmetic expressions such as A x, y x + y and A x, y, z x y + z can be considered as functions or, equivalently, A : R R R, and A : R R R R, A : R R, and A : R 3 R. Two propositions are equivalent if they always have the same values. 3-Oct-00, 3:39 pm

.3. LOGICAL EXPRESSIONS CHAPTER. LOGIC p q is equivalent to p q, one of De Morgan s laws, as can be seen in the table below : In arithmetic i.e., we do not have 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 x + y is equivalent to x + y, x + y is equivalent to x y. Thus the analogy between logic and arithmetic is limited. The three basic logical operators,, and, are all we need. However, it is convenient to introduce some additional operators, much like in arithmetic, where we write x 3 to denote x x x. Three such additional operators are defined as : exclusive or conditional, if then biconditional, if and only if, iff p q p q p q p q T T F T T T F T F F F T T T F F F F T T Application. Suppose two persons, P and Q, are suspected of committing a crime. Let P denote the statement by P that Q did it, or we did it together. Let Q denote the statement by Q that P did it, or if I did it then we did it together. Suppose we know P always tells the truth and Q always lies. Who committed the crime? Let p denote P did it and let q denote Q did it. Then p and q are logical variables. We are given that the value of the logical expression is true, and that the value of is false. q p q p q p q Equivalently we have that the value of the logical expression p q p q q p q is true. Our problem is to find for what values of p and q this is the case. As an analogy from arithmetic, consider the problem of finding the values of x and y so that and such that the value of the arithmetic expression x + y is 5, the value of x + y is 3, i.e., we want to find all solutions of the the simultaneous equations x + y = 5, x + y = 3. How many solutions are there? 3 3-Oct-00, 3:39 pm

.3. LOGICAL EXPRESSIONS CHAPTER. LOGIC We have the truth table p q p q p q q p q T T F T T T F T T T F F T T F F F F F T T F F F T T F F F F T T F F F F 6 5 4 3 9 8 7 The order of evaluation has been indicated at the bottom of the table. The values of the entire expression are in column 9. We observe that the expression is True only if p = F and q = T. Therefore Q was involved in the crime, but P was not. Exercise: Consider the values of the logical expression, as listed in the column labeled 9 of the preceding crime truth table. Can you find a much simpler logical expression that is equivalent to the given one? Thus you are asked to find a simple logical expression involving the logical variables p and q, whose values are precisely the same as those listed in the column labeled 9. Exercise: Suppose three persons, P, Q, and R, are suspects in a crime. P states that Q or R, or both, were involved. Q states that P or R, or both, were involved. R states that P or Q, but not both, were involved. Suppose P and Q always tell the truth, while R always lies. Who were involved in the crime? NOTE: there may be more than one solution... Exercise: Construct a truth table for the logical expression p p q p q. Based on the truth table can you find a much simpler logical expression that is equivalent to the one given above? A contradiction is a logical expression whose value is always False. For example p p is a contradiction : p p p p T F F F T F A tautology is a logical expression that is always true. For example p p is a tautology : p p p p T F T F T T A logical expression that is neither a tautology nor a contradiction is called a contingency. Exercise: Verify by truth tables that the following expressions are tautologies: p q p q, Notation. p q q p. We use the symbol = to indicate that a conditional statement is a tautology. For example, from the above exercise we have p q p = q, modus tollens, p q q = p, modus ponens. 4 3-Oct-00, 3:39 pm

.3. LOGICAL EXPRESSIONS CHAPTER. LOGIC As another example we show that p q p r q r = r. p q r p q p r q r r T T T T T F T T T T T T T F T T F T F F T F T F T F F F T F T T T T F F F F F T F T T F F T T T T T T T T T T F T F T F T F F F T F F F T T T T T T T T T F F F T F T F F T T F 3 5 96 7 0 8 4 The last column consists of True values only. Therefore p q p r q r r is a tautology. Here we illustrate another technique that can sometimes be used to show that a conditional statement is a tautology. Consider again the logical expression We want to show that i.e., that NOTE: We need only show that: Pp, q, r p q p r q r. Pp, q, r = r, Pp, q, r r always has value T. We can t have that Pp, q, r is True, while r is False. Suppose Pp, q, r is True, while r is False. Thus all three of have value True. a p q b p F and c q F c can only have value True if q = F. b can only have value True if p = F, i.e., if p = T. But then a becomes T F which has value F. So indeed, not all three, a, b, and c can have value True. QED! quod erat demonstrandum : which was to be shown NOTE: This was an example of a proof by contradiction. We will give more examples later... Exercise: Use a proof by contradiction to prove the following: p q p = q, Already done by truth table. Notation. p q q = p. From the definition of the operator we see that logical expressions are equivalent if and only if is a tautology. In this case we write P p, q,... and P p, q,... P p, q,... P p, q,... P p, q,... P p, q,.... We must show that this cannot happen. 5 3-Oct-00, 3:39 pm

.3. LOGICAL EXPRESSIONS CHAPTER. LOGIC p q is equivalent to p q, i.e., p q p q, as seen in the truth table Thus we can write p q p q p q, p q q p, p q q p p q. The operators p q p q p q T T F T T F F F T F T F T F T T F T T F T T T F F F T F T T T T,, and, can be expressed in terms of the basic operators as verified below :,, and, p q p q p q p q T T F T T F F T T F T T T T T F F T T T T T T F F F F T F F T F p q p q q p T T T T T F T F F T F F F T T T T T F F T T T T p q p q q p p q T T T T T F T T F T F F T F F F T T F T F T T T F F F F F T T T T T T T It also follows that Basic logical equivalences. p q p q q p. The fundamental logical equivalences laws are : p q q p p q q p commutative laws p q r p q p r p q r p q p r distributive laws p F p p T p identity laws p p T p p F complement laws Some useful additional laws are : T F F T negation laws p p p p p p idempotent laws p T T p F F domination laws p p q p p p q p absorption laws 6 3-Oct-00, 3:39 pm

.4. PROOFS USING LAWS OF LOGIC CHAPTER. LOGIC p q r p q r p q r p q r associative laws p q p q p q p q De Morgan s laws Simplification of logical expressions. It is useful to simplify logical expressions as much as possible. This is much like in arithmetic where, for example, the expression x 3 + 3x y + 3xy + y 3 p p double negation is equivalent to x + y 3. p q q p contrapositive Reconsider the logical expression p q p q q p q.4 Proofs using laws of logic All laws of logic can be proved using truth tables. However, to illustrate the axiomatic nature of the fundamental laws, we now prove an additional law using only the fundamental laws. At every step the fundamental law used will be indicated. Once proved, an additional law may be used in further proofs. Proof of the idempotent law p p p. p p F identity law p p p complement law p p p p distributive law p p T complement law p p identity law from the crime example. It is equivalent to the much simpler logical expression p q because it has the same truth table values : p q p p q T T F F T F F F F T T T F F T F One way to simplify a logical expression is by using - the fundamental laws of logic, - known additional laws, - the definitions of the additional logical operators. NOTE: Proving additional laws, using only the fundamental laws, is not as easy as one might expect, because we have very few tools available. However after proving some of these additional equivalences we have a more powerful set of laws. 7 3-Oct-00, 3:39 pm

.5. PREDICATE CALCULUS CHAPTER. LOGIC For the crime example this can be done as follows : Exercise: p q p q q p q p q p q q q p commutative law p q p q q absorption law p p q q q equivalence of p p q q q associative law p q q absorption law p q q De Morgan p q q double negation p q q associative law p q idempotent law Use logical equivalences to simplify the logical expression p p q p q. This example was already considered before, using a truth table. Exercise: Use logical equivalences to show that the logical expression p q p r q r r, is a tautology, i.e., show that p q p r q r = r. NOTE: Earlier we proved this with a truth table, as well as with a proof by contradiction..5 Predicate Calculus Let S be a set. A predicate P is a function from S to { T, F } : P : S { T, F } or or P : S S S { T, F } P : S S S n { T, F }. Let Z + denote the set of all positive integers. Define P : Z + { T, F } by Px = We can think of Px as the statement which can be either True or False. { T if x Z + is even, F if x Z + is odd. x is an even integer, What are the values of P, P37, P 3? Let U be a set and S a subset of U. Let Px denote the statement x S, i.e., Then Px x S. P : U { T, F }. Let Px, y denote the statement x + y = 5, i.e., Then we can think of P as a function Px, y x + y = 5. P : Z + Z + { T, F }. 8 3-Oct-00, 3:39 pm

.5. PREDICATE CALCULUS CHAPTER. LOGIC What is the value of P4,? Further notation : What is the value of P, 5? Quantifiers. For a more compact notation we introduce the quantifiers,, and!. DEFINITIONS. Let S be a set and P a predicate. Then we define : x S Px means Px T i.e., Px = T for all x S, x S Px means there exists an x S for which Px = T,!x S Px means there is a unique x S for which Px = T. x, y Px, y and x y Px, y both mean x ypx, y, and similarly for other quantifiers. Let P : Z Z { T, F }, where Px, y denotes x + y = 5. What are the values of the following propositions? x, y Px, y x, y Px, y x!y Px, y x y Px, y If it is clear from the context what S is, then one often simply writes Let P : Z + Z + Z + { T, F }, x Px, x Px,!x Px. If S has a finite number of elements then x Px Px Px Px n, x Px Px Px Px n,!x Px Px Px Px 3 Px n Px Px Px 3 Px n Px Px Px 3 Px n. where Px, y, z denotes the statement x + y = z. What are the values of the following propositions? x, y, z Px, y, z x, y, z Px, y, z x, y z Px, y, z x, z y Px, y, z z x, y Px, y, z 9 3-Oct-00, 3:39 pm

.5. PREDICATE CALCULUS CHAPTER. LOGIC Let where Px denotes the statement and Ex denotes the statement P, E : Z + { T, F }, x is prime, x is even. What are the values of the following propositions? x Px Ex Let Then while P, Q :!x Px Ex x Px Ex {, } { T, F }. x Px Qx P Q P Q, x, y Px Qy P Q P Q P Q P Q. Exercise: from preceding example... Show that is not equivalent to x Px Qx x, y Px Qy Hint: Find specific examples of the predicates P and Q so that one of the above two propositions is True and the other one False. If then while P, Q : {, } { T, F } x Px Qx P Q P Q, x Px Qx P Q P Q As a counterexample take where P Q P Q. xpx xqx x Px Qx P, Q : Z + { T, F }, Px x is even, and Qx x is odd. Then the RHS is True but the LHS is False. Exercise: Show that xpx xqx is not equivalent to x y Px Qy. Hint: Find a counterexample; i.e., an example of predicates P and Q for which one of the above two propositions is True and the other one False. 0 3-Oct-00, 3:39 pm

.6. EQUIVALENCES INVOLVING QUANTIFIERS CHAPTER. LOGIC.6 Equivalences involving quantifiers The equivalences below are valid for any propositions P and Q : xpx x Px Example: Proof of Equivalence 4. xpx xqx x y Px Qy Let L denote the left hand side and R the right hand side. We must show L R, i.e., that L R is always True. 3 xpx xqx xpx xqx x Px Qx x y Px Qy NOTE: L R L R R L L R L R. Thus it suffices to show that 4 xpx xqx x y Px Qy i if L has value True then R also has value True, and ii if L has value False then R has value False. Example: Proof of Equivalence when the set S is finite. Actual proof of 4 : Exercise: xpx Px Px Px n Px Px Px n Px Px Px n Px Px Px n x Px i If L is True then there are two cases: a If xpx is True then clearly R has value True. b Similarly, if xqx is True then R also has value True. ii If L has value False then Px 0 must be False for some x 0, and Qy 0 must be False for some y 0. Then Px 0 Qy 0 is False, so R is False. Exercise: Prove the following equivalence: xpx xqx x y Px Qy Prove Equivalence. Hint: This proof can be done along the lines of the preceding proof. Prove Equivalence 3. 3-Oct-00, 3:39 pm

.6. EQUIVALENCES INVOLVING QUANTIFIERS CHAPTER. LOGIC More equivalences Valid for any propositions P and Q : Example : 5 xpx x Px 6 xpx xqx x Px Qx 7 xpx xqx x y Px Qy 8 xpx xqx x y Px Qy Equivalences 5 8 follow from negating equivalences 4, and replacing P and Q by P and Q, respectively. Example: Proof of Equivalence 6, using Equivalence x y z Px, y, z x y z Px, y, z x y z Px, y, z x y z Px, y, z Example : x Px Qx x Px Qx x Px xqx xpx xqx xpx xqx This step follows from the earlier Equivalence 6. 6 xpx xqx x Px Qx xpx xqx x Px Qx x Px x Qx x Px Qx xpx xqx x Px Qx Example Rosen, problem 6, page 50 : Let Dx denote the statement x is a duck Px,, x is one of my poultry Ox,, x is an officer Wx,, x is willing to waltz Exercise: Prove Equivalence 7 using Equivalence 3. Prove Equivalence 8 using Equivalence 4. 3-Oct-00, 3:39 pm

.7. REVIEW EXERCISES CHAPTER. LOGIC Statement Logic Equivalent Ducks never waltz. x `Dx Wx x `Dx Wx Officers always waltz. x `Ox Wx x `Ox Wx From follows Wz is True. i.e., Wz is False. From, since Wz is False, it follows Oz is False. QED! Example Rosen, problem 60, page 50 : Express each of the following using predicates and quantifiers: All my poultry are ducks. x `Px Dx x `Dx Px All clear explanations are satisfactory. Some excuses are unsatisfactory. My poultry are not officers. x `Px Ox x `Ox Px 3 Some excuses are not clear explanations. Question: Does 3 follow from and? QUESTION: Do the first three statements imply the last one, i.e., is [ x Dx Wx ] [ x Ox Wx ] [ x Px Dx ] a tautology, i.e., do we have [ x Px Ox ] 3 [ x Dx Wx ] [ x Ox Wx ] [ x Px Dx ] Hint: See preceding example..7 Review Exercises Problem. By truth tables check if the operator is associative: p q r p q r. The answer is YES. To prove this, we must show that : = [ x Px Ox ]? 4 Problem. Use logical equivalences to prove that p q r p q r. Problem 3. By contradiction show that the following is a tautology: [ p t p q q r r s s t ] t. if,, and 3 are True then 4 is True. To show 4 is True, we must show : Problem 4. Use logical equivalences to simplify [p q p] p p q. if, for arbitrary z, Pz is True, then, using,, 3, Oz is True. PROOF: Let z be an arbitrary element from our set of objects. Assume Pz is True. We must show that Oz is True, i.e., Oz is False. From 3 it follows Dz is True. 3 3-Oct-00, 3:39 pm

.7. REVIEW EXERCISES CHAPTER. LOGIC Problem 5. Verify the following basic tautologies, known as the laws of inference, which are useful in proofs: What is the truth value of each of the following? P,, y, z x Px, y, z Tautology `p p q = q ` q p q = p `p q q r = p r `p q p = q Name modus ponens modus tollens hypothetical syllogism disjunctive syllogism P0, 7, 0!y, z x Px, y, z x, y, z Px, y, z x, y z Px, y, z x, y, z Px, y, z x y, z Px, y, z Problem 8. Let Px, y, z, n denote the statement x n + y n = z n where x, y, z, n Z +. What is the truth value of each of the following? `p q p r = q r resolution Problem 6. Express the following statements in predicate logic: a There is a unique x for which Px is true. b There is no number that is greater than all other numbers. c x 0 is the smallest x for which Px is true. d Every person has exactly two parents. NOTE: - Let Px, y denote y is a parent of x. - You may use the predicates x y, x > y, and x y. Problem 7. Let Px, y, z denote the statement x y = z, P,,, x, y!z Px, y, z, P3, 4, 5, z x, y Px, y, z, P7, 4, 5, x, y z Px, y, z,!x, y, z Px, y, z, x, y, z Px, y, z, 3 Note: One of the above is very difficult! Problem 9. Give an example that shows that x y Px, y y xpx, y. Problem 0. Prove that x[px Qx] = [ xpx xqx]. Problem. Prove that x y Px Qy xpx xqx. where the universe of discourse of all three variables is the set Z. 4 3-Oct-00, 3:39 pm

Chapter Mathematical Proofs. Introduction We now illustrate some often used basic proof techniques. Several of the examples will be taken from Number Theory. DEFINITIONS. Let n, m Z +. We call n odd if k Z : k 0, n = k +. We call n even if n is not odd. Then n = k for some k Z +. We say m divides n, and write m n, if n = qm for some q Z +. In this case we call m a divisor of n. If m n then we also say that n is divisible by m. We call n a prime number if n and the only positive divisors of n are and n. We call n composite if n and n is not prime. n and m are relatively prime if is their only common divisor.. Direct Proofs Many mathematical statements have the form if P then Q i.e., P = Q, or, more often, x Px Qx, where P and Q represent propositions or predicates. A direct proof consists of assuming that, for arbitrary x, Px is True demonstrating that Qx is then necessarily True also, PROPOSITION.: If n Z + is odd then n is odd. REMARK. This proposition is of the form P = Q or, more specifically, n Z + : Pn Qn, where P and Q are predicates functions P, Q : Z + { T, F }. NOTE. Actually, Qn Pn. PROOF. Assume n Z + is odd i.e., assume Pn = T. Then, by definition, n = k + for some k Z, k 0. By computation we find n = k + = k + k + = m +, 5

.3. PROVING THE CONTRAPOSITIVE CHAPTER. MATHEMATICAL PROOFS where we have defined m k + k. Thus, by definition, n is odd, i.e., Qn = T. PROPOSITION.: If n Z + is odd then 8 n n +. PROOF. If n Z + is odd then we can write Then Clearly n = k + for some integer k, k 0. n n + = n = 4k + 4k = 4kk +. 4 4kk +. Note, however, that either k is even or k + is even, i.e., Thus k or k +. QED 8 4kk +. QED DEFINITION. A perfect number is a number that equals the sum of all of its divisors, except the number itself. For example 6 is perfect : and 8 is perfect : 6 = 3 + +, 8 = 4 + 7 + 4 + +. PROPOSITION.3: Let m Z +, m >. or, using quantifiers, If m is prime, then n m m is perfect, m Z + : m is prime m m is perfect. PROOF. Assume m is prime. Then the divisors of n are,,,..., m, m, m, m, m,..., m m, m m. The last divisor is equal to n so we do not include it in the sum. The sum is then m k=0 m k + m k=0 k = m + m m = m + m m = m + m.3 Proving the contrapositive It is easy to show exercise that The statement i.e., proved earlier is equivalent to i.e., it is equivalent to This equivalence justifies the following : If we must prove = m m = n. QED p q q p. n odd = n odd, n : n odd n odd, n odd = n odd, n even = n even. P = Q, then we may equivalently prove the contrapositive Q = P. Proving the contrapositive is sometimes easier. PROPOSITION.4: Let n Z +, with n. If the sum of the divisors of n is equal to n + then n is prime. 6 3-Oct-00, 3:39 pm

.4. PROOF BY CONTRADICTION CHAPTER. MATHEMATICAL PROOFS PROOF. We prove the contrapositive : If n is not prime then the sum of the divisors can not equal n +. So suppose that n is not prime. Then n has divisors, n, and m, for some m Z +, m, m n, and possibly more. Thus the sum of the divisors is greater than n +. Some Specific Contrapositives p q r r p q p q r r p q xpx q q x Px QED PROPOSITION.6: Let n Z +. Then 5 n = 5 n, i.e., n Z + : 5 n 5 n. PROOF. We prove the contrapositive, i.e., 5 n = 5 n. So suppose 5 n. Then we have the following cases: n = 5k + = n = 5k + 0k + = 55k + k +, n = 5k + = n = 5k + 0k + 4 = 55k + 4k + 4, n = 5k + 3 = n = 5k + 30k + 9 = 55k + 6k + + 4, n = 5k + 4 = n = 5k + 40k + 6 = 55k + 8k + 3 +, xpx q q x Px for some k Z, k 0. This shows that 5 n. QED p xqx x Qx p p xqx x Qx p PROPOSITION.5: Let n Z + with n. Then a, b Z + n a n b n ab = n is prime..4 Proof by contradiction To prove a statement P = Q by contradiction : assume P = T and Q = F, show that these assumptions lead to some impossible conclusion a contradiction. PROOF. The contrapositive is If n is not prime then a, b n a n b n ab. To prove the contrapositive, note that if n is not prime then n = a b for certain integers a and b, both greater than but less than n. Clearly n a, n b, and n ab. QED PROPOSITION.7: If a prime number is the sum of two prime numbers then one of these equals. PROOF. Let p, p, and p be prime numbers, with p + p = p. Suppose that neither p nor p is equal to. Then both p and p must be odd. Hence p = p + p is even, and greater than. This contradicts that p is prime. QED 7 3-Oct-00, 3:39 pm

.5. PROOF BY CASES CHAPTER. MATHEMATICAL PROOFS PROPOSITION.8: is irrational, i.e., if m, n Z + and m and n are relatively prime then m/n. PROOF. Suppose m, n Z + are relatively prime and m/n =. Then However, we know that this sum must equal Hence we have a contradiction. + + 3 + + 0 = 55. QED m = n = m = n = m even = m even proved earlier = k Z + m = k = n = m = k = 4k using above = n = k = n even = n even Thus both n and m are even and therefore both are divisible by. This contradicts that they are relatively prime. NOTATION. The = that opens each line in the proof means that the immediately following statement is implied by the preceding statements. Exercise: Use contradiction to prove that the following are tautologies: p q p r q r r ; p q q r p r. HINT. See a similar example earlier in the Lecture Notes. QED PROPOSITION.9: If the integers,, 3,..., 0 are placed around a circle, in any order, then there exist three integers in consecutive locations around the circle that have a sum greater than or equal to 8. PROOF. Suppose any three integers in consecutive locations around the circle have sum less than 8, that is, less then or equal to 7. Excluding the number, which must be placed somewhere, there remain exactly three groups of three integers in consecutive locations. The total sum is then less than or equal to + 7 + 7 + 7 = 5..5 Proof by cases PROPOSITION.0: Let n Z +. Then 6 nn + n +. PROOF. We always have that n or n +. There remain three cases to be considered: For some k Z +, k 0 : n = 3k : Then 3 n. n = 3k + : Then 3 n +. n = 3k + : Then 3 n +. QED FACT: Any real number x can be uniquely written as x = n + r where n Z and r R, with 0 r <. DEFINITION. We then define the floor of x as x n. Examples. 7 = 7, 7 = 7, π = 3, π = 4. Use a proof by cases to show that x = x + x +. 8 3-Oct-00, 3:39 pm

.6. EXISTENCE PROOFS CHAPTER. MATHEMATICAL PROOFS PROOF. Case, 0 r < / : Then and so that the identity is satisfied. Case, / r < : Then and so that the identity is satisfied..6 Existence proofs 0 r < and r + <, x = n + r = n, x = n + r = n, x + = n + r + = n, r < and r + < +, x = n + r = n +, x = n + r = n, x + = n + r + = n +, QED Mathematical problems often concern the existence, or non-existence, of certain objects. Such problems may arise from the mathematical formulation of problems that arise in other scientific areas. A proof that establishes the existence of a certain object is called an existence proof. For any positive integer n there exists a sequence of n consecutive composite integers, i.e., n Z + m Z + : m + i is composite, i =,...,n. For example, n = : 8,9 are consecutive composite integers m = 7, n = 3: 8,9,0 are 3 three consecutive composite integers m = 7, n = 4: 4,5,6,7 are 4 consecutive composite integers m = 3, n = 5: 3,33,34,35,36 are 5 consecutive composite integers m = 3. PROOF. Let m = n +! +. Then, clearly, the n consecutive integers are composite. NOTE. n +! + +, n +! + +,..., n +! + + n, QED This is a constructive existence proof: we demonstrated the existence of m by showing its value as a function of n. PROPOSITION.: There is an infinite number of prime numbers. PROOF. By contradiction. Suppose the total number of primes is finite, say, Let Clearly N is unequal to any of the p i. p, p,..., p n. N = p p p n +. If N is prime then we have a contradiction. If N is not prime then N must have a prime divisor p, p N. Note that none of p, p,..., p n divide N, since N divided by p i gives a remainder of, i =,, n. Thus p must be an additional prime number. Again we have a contradiction. QED 9 3-Oct-00, 3:39 pm

.7. REVIEW EXERCISES CHAPTER. MATHEMATICAL PROOFS NOTE. This proof is a non-constructive existence proof. We proved the existence of an infinite number of primes without actually showing them. NOTE. There is no general recipe for proving a mathematical statement and often there is more than one correct proof. One generally tries to make a proof as simple as possible, so that others may understand it more easily. Nevertheless, proofs can be very difficult, even for relatively simple statements such as Fermat s Last Theorem : NOTE. x, y, z, n Z +, n > : x n + y n = z n. There are many mathematical statements that are thought to be correct, but that have not yet been proven open problems, e.g., the Goldbach Conjecture : Every even integer greater than is the sum of two prime numbers. Indeed, proving mathematical results is as much an art as it is a science, requiring creativity as much as clarity of thought. An essential first step is always to understand the problem fully. Where possible, experimentation with simple examples may help build intuition and perhaps suggest a possible method of proof..7 Review Exercises Problem. Use a direct proof to show the following: p q q r p s t q u s r = t. Assuming the left-hand-side is True, you must show that t is True. Problem. Let n be a positive integer. Prove the following statement by proving its contrapositive: If n 3 + n + is odd then n is even. Problem 3. Let n be an integer. Show that by proving its contrapositive. Hint: there are two cases to consider. 3 n = 3 n Problem 4. Give a direct proof to show the following: The sum of the squares of any two rational numbers is a rational number. A rational number is a number that can be written in the form p/q, where p and q are integers. Problem 5. Use a proof by contradiction to prove that for all real numbers x: if x is irrational then x is irrational. Problem 6. Use a proof by contradiction to prove the following: If the integers,, 3,..., 7, are placed around a circle, in any order, then there exist two adjacent integers that have a sum greater than or equal to 9. ANOTHER FACT: Any real number x can be uniquely written as where n Z and r R, with 0 r <. x = n r DEFINITION. We then define the ceiling of x as x n. Examples. 7 = 7, 7 = 7, π = 4, π = 3. Problem 7. Is the following equality valid for all positive integers n and m? n + m n m = +. If Yes then give a proof. If No then give a counterexample. 0 3-Oct-00, 3:39 pm

Chapter 3 Set Theory 3. Basic definitions The following are set-valued : Let U be the collection of all objects under consideration. U is sometimes called the universe of objects under consideration. A set is a collection of objects from U. Let A, B and C be sets. x A x is an element a member of A. x / A x A A B { x U : x A x B } union A B { x U : x A x B } intersection A { x U : x / A } complement A B { x U : x A x / B } difference A B x U : x A x B subset A = B A B B A equality The above take values in { T, F }.

3.. VENN DIAGRAMS CHAPTER 3. SET THEORY 3. Venn diagrams Venn diagrams are useful visual aids for proving set theoretic identities. For the two sides of the identity A B C = A B C we have the following Venn diagrams : For the two sides of the identity A B C = A B A C we have the following Venn diagrams : C C C C A B A B The proof of the identity is as follows : A B The actual proof of the identity, using the definitions above and the laws of logic, is as follows : x A B C x A B x / C A x A x B x / C x A x B x / C associative law x A x B C x A B C B x `A B C x A `x / B C x A `x B C x A x B x C x A ` x B x C `x A x A ` x B x C `x A x B `x A x C x A B x A C x A B A C De Morgan idempotent law commut. + assoc. 3-Oct-00, 3:39 pm

3.4. BASIC SET THEORETIC IDENTITIES CHAPTER 3. SET THEORY Prove that 3.4 Basic set theoretic identities A B = A B = A = B. Assume A B = A B. We must show that A = B. A B = B A A B = B A commutative laws This is done in two stages : i show A B and ii show B A. A B C = A B A C A B C = A B A C distributive laws To show i : Let x A. We must show that x B. Since x A it follows that x A B. Since A B = A B it follows that x A B. A = A A U = A identity laws A A = U A A = complement laws Thus x B also. The proof of ii proceeds along the same steps. U = = U 3.3 Subsets S U means S is a subset of a universal set U. The set of all subsets of U is denoted by U or PU, the power set. This name is suggested by the following fact : A A = A A A = A idempotent laws A U = U A = domination laws A A B = A A A B = A absorption laws Let If U has n elements then PU has n elements sets. U = {,, 3 }. A B C = A B C A B C = A B C associative laws Then PU = { { }, { }, { }, { 3 }, {, }, {, 3 }, {, 3 }, {,, 3 } }. A B = A B A B = A B De Morgan s laws We see that PU has 3 = 8 elements. A = A involution law NOTE. The empty set = { } and U itself are included in PU. All the identities above can be proved using the definitions of set theory and the laws of logic. 3 3-Oct-00, 3:39 pm

3.5. REVIEW EXERCISES CHAPTER 3. SET THEORY Note the close correspondence between the identities above and the laws of logic. However, one can also proceed axiomatically by assuming only the existence of a power set PU, where U is a universal set, special elements U and, a unary operator and two binary operators, and, the basic set theoretic identities. Given this setup one can derive all other set theoretic identities. Note the close correspondence between the above axiomatic setup and the axiomatic setup of logic! Prove the idempotent law A A = A using only the basic set theoretic identities : A = A identity law = A A A complement law = A A A A distributive law = A A U complement law = A A identity law Using another approach we prove the absorption law : Thus we must prove A A B = A. x U : x A A B x A, i.e., x U : x A x A B x A, i.e., x U : x A x A x B x A. Define logical predicates ax and bx : ax x A, bx x B. Then we must prove x U : ax ax bx ax. It suffices to prove that, for arbitrary logical variables a and b, a a b a. But this is the absorption law from logic! 3.5 Review Exercises For each of the following, determine whether it is valid or invalid. If valid then give a proof. If invalid then give a counterexample. a A B A = A b A B C = A B C c A B C D = A D C B d A B A B = A e A B C A = A f A B C = A B A C g B C A = C A B A = h A B A B = A = B = 4 3-Oct-00, 3:39 pm

Chapter 4 Functions 4. Definitions Let A and B be sets. Then f is called a function from A to B if to each element of A it associates exactly one element of B. We write f : A B and we call A the domain of f and B the codomain of f. We also define the range of f to be fa { b B : b = fa for some a A }. We say that f is : one-to-one or injective iff a, a A : a a fa fa iff a, a A : fa = fa a = a, onto or surjective iff fa = B iff b B a A : fa = b, bijective iff f is one-to-one and onto. Let A = { a, b, c }, B = {, }, and let f : A B be defined by f : a, f : b, f : c. Then f not one-to-one, but f is onto. A a b c Let A = { a, b }, B = {,, 3 }, and let f : A B be defined by f : a, f : b 3. B 5

4.. DEFINITIONS CHAPTER 4. FUNCTIONS Then f is one-to-one but not onto. A Let A = B = Z +, and let be defined by i.e., a b f : Z + Z + f : n fn = Then f is one-to-one but not onto. PROOF. f is not onto : Here so it seems that f is not onto. nn + nn + fz + = {, 3, 6, 0, 5,,... }, To be precise, we show that fn can never be equal to : fn = nn + / = n + n 4 = 0. But this quadratic equation has no integer roots. f is one-to-one : Assume that fn = fn.., 3 B We must show that n = n : fn = fn n n + / = n n + / n + n = n + n n n = n n n + n n n = n n n = n or n + n =. However n, n Z +. Thus n + n cannot be negative. It follows that n = n. Define or equivalently by f : Z Z Z Z m f : n f : Z Z m + n m n or equivalently, in matrix multiplication notation m m f :. n n Then f is one-to-one, but not onto. PROOF. i One-to-one. Suppose f m m n = f n. Then m + n m n i.e., and =, m + n m n m + n = m + n, m n = m n., QED 6 3-Oct-00, 3:39 pm

4.. INVERSES CHAPTER 4. FUNCTIONS Add and subtract the equations, and divide by to find m m = m and n = n, i.e., = n Thus f is one-to-one. ii Not onto. Let s d Z be arbitrary. Can we solve m s f =, n d m. n Let A = B = C = Z all integers, and define f, g : Z Z by fn n + n, gn n. Let h n f gn. Then h n = fn = n + n = 4n. i.e., can we solve for m, n Z? m + n = s, m n = d, Add and subtract the two equations, and divide by to get m = s + d and n = s d However, m and n need not be integers, e.g., take s =, d =. Thus f is not onto. Given two functions we can compose them : f : A B and g : B C, g fa g fa.. QED Let h n g fn. Then h n = gn + n = n + n = n + 4n 3. Let h 3 n g gn. Then h 3 n = gn = n = 4n 3. 4. Inverses Let f : A B and g : B A Then g is called the inverse of f if a A : g fa = a, f go f g and b B : f gb = b. If f has an inverse g then we say f is invertible a fa gfa and we write f for g. Let f : Z Z be defined by f : n n, i.e., A B C fn = n shift operator. 7 3-Oct-00, 3:39 pm

4.. INVERSES CHAPTER 4. FUNCTIONS f is one-to-one : If fn = fn then n = n, i.e., n = n. f is onto : Given any m Z, can we find n such that fn = m? That is, can we find n such that n = m? Easy: n = m +! It follows that f is invertible, with inverse Check: f m = m +. f f m = fm + = m + = m, f fn = f n = n + = n. Let f : R R be defined by f : x x, i.e., f is one-to-one : fx = x. If fx = fx then x = x, i.e., x = x. f is onto : Given any y R, can we find x such that fx = y? That is, can we find x such that x = y? Easy: x = y/! It follows that f is invertible, with inverse Check: f y = y f f y = f y/ = y/ = y, f fx = f x =. x = x. THEOREM 4.: f : A B is invertible if and only if f is and onto. REMARK. It is not difficult to see that this theorem holds for finite sets. However, the proof below also applies to infinite sets. PROOF. a First we show that if f is invertible then f is. By contradiction: Suppose f is invertible but not. Since f is not there exist a, a A, a a, such that fa = fa b 0. Since f is invertible there is a function g : B A such that g fa = a, a A. In particular g fa = a, and g fa = a, i.e., gb 0 = a, and gb 0 = a. Thus g is not single-valued not a function. Contradiction. b Now we show that if f is invertible then f is onto. By contradiction: Suppose f is invertible but not onto. Since f is not onto there exists b 0 B such that fa b 0, a A. Since f is invertible there is a function g : B A such that f gb = b, b B. In particular f gb 0 = b 0, i.e., fa 0 = b 0, where a 0 gb 0 lies in A. But this contradicts that fa b 0, a A. 8 3-Oct-00, 3:39 pm

4.. INVERSES CHAPTER 4. FUNCTIONS a Next we show that if f is and onto then f is invertible. Define a function g : B A as follows. For any b B we have b = fa for some unique a A, because f is one-to-one and onto. Set gb = a. Then g : B A, and by construction f gb = b. b We still must show that a A : g fa = a. By contradiction: Suppose g fa 0 a 0 for some a 0 A. Let b 0 = fa 0. Then b 0 B and gb 0 a 0. Since f is one-to-one it follows that f gb 0 fa 0, i.e., f gb 0 b 0. But this contradicts the result of a. Define f : Z + Z + by fn = nn n 4 + 4. Then f is not one-to-one; for example, f = f4 = 4 : n 3 4 5 6 7 fn 7 4 4 9 5 09 Using calculus one can show that fn is increasing for n 3. Thus f is not onto; for example, n Z + : fn. QED Now let S = fz + = {, 4, 7, 9, 5, 09,... }, and consider f as a function f : Z + S. Then f is onto, but still not one-to-one, e.g., f = f4 = 4. Finally let D = Z + { }, and consider f as a function f : D S. Now f is one-to-one and onto, and hence invertible. Example: The floor and ceiling functions. Fact: x R! n Z! r R such that 0 r < and x = n + r. We now define the floor function,, as x = n. Examples: π = 3, e =, 3 = 3, 7/ = 4, where e =.788.... Fact: x R! n Z! r R such that 0 r < and x = n r. We now define the ceiling function,, as x = n. Examples: π = 4, e = 3, 3 = 3, 7/ = 3. 9 3-Oct-00, 3:39 pm

4.. INVERSES CHAPTER 4. FUNCTIONS We see that and Questions: : R Z, : R Z. Is one-to-one? onto? invertible? Is one-to-one? onto? invertible? Draw the graphs of and. Example: Let p, k Z +. Then p k < p + k k PROOF. By definition of the ceiling function we can write p p = r, k k where 0 r <. Hence p k Show that the linear function = p k + r < p k + = p + k k f : R R.. QED One-to-one: Exercise! Hint: See the earlier example where this function was considered as Onto: f : Z Z. We can construct the inverse by solving i.e., by solving f x y = s d x + y = s, x y = d, for x, y R : x = s + d, y = s d. Thus the inverse is s s + d s g : or g : d s d d, s. d Check: s s + d f g = f = s + d + s d s d s d s + d = ; s d d x x + y g f = g = x + y + x y x y x y x + y =. x y y defined by or, equivalently, is one-to-one and onto. x f : y x f : y x + y x y x y,, More generally, a function f : R R is linear if it can be written as x a x + a y f = y a x + a y where a ij R, i, j =,. = a a a a x y, 30 3-Oct-00, 3:39 pm

4.3. REVIEW EXERCISES CHAPTER 4. FUNCTIONS This function is invertible if the determinant D a a a a 0. In this case the inverse is given by s f = a a s d D a a d Exercise: Check that x x f f y = y and Now consider the same linear function n a a f = n m a m a but with a ij Z, i, j =,, and as a function Is still the inverse? ANSWER: Not in general! f : Z Z. s s f f =. d d s f = a a s. d D a a d f is now invertible only if the determinant and D = a a a a 0, i, j : D a ij. In this case f is still given by f s = a a s. d D a a d Exercise: Show that n f = m 3 n 4 3 m,. is invertible as a function f : Z Z. What is the inverse? Exercise: Show that n f = m is not invertible as a function f : Z Z. 4.3 Review Exercises Problem. Define by Draw the graph of f. Is f one-to-one? Is f onto? What is f? fx Problem. Consider a function 3 n 4 3 m f : R R { /x if x 0, 0 if x = 0. f : A B. For each of the following, can you find a function f that is i one-to-one ii onto iii one-to-one and onto? A = {,, 3 }, B = {, } A = {, }, B = {,, 3 } A = { all even positive integers }, B = { all odd positive integers }, 3 3-Oct-00, 3:39 pm

4.3. REVIEW EXERCISES CHAPTER 4. FUNCTIONS Problem 3. Consider a function f : A B. For each of the following, can you find a function f that is i one-to-one ii onto iii one-to-one and onto? a A = Z, B = Z + b A = Z +, B = Z Problem 4. Let S n be a finite set of n elements. Show that a function is one-to-one if and only if it is onto. f : S n S n Problem 5. Let f : A B and g : B C be functions. Suppose f and g are one-to-one. Is the composition g f necessarily one-to-one? Suppose the composition g f is one-to-one. Are f and g necessarily one-to-one? Suppose f and g are onto. Is the composition g f necessarily onto? Suppose the composition g f is onto. Are f and g necessarily onto? Justify your answers. Problem 6. Let P denote the set of all polynomials of degree or less, i.e., polynomials of the form px = a x + b x + c, quada, b, c R, x R. Let P denote the set of all polynomials of degree or less, i.e., polynomials of the form px = dx + e, d, e R, x R. Consider the derivative function or derivative operator D : P P. For example, D : 3x + 7x 4 6x + 7, and D : 5x π 5. QUESTIONS: Is D indeed a function from P to P? Is D one-to-one? Is D onto? Does D have an inverse? Problem 7. If A and B are sets, and if f : A B, then for any subset S of A we define the image of S as fs { b B : b = fa for some a S }. Let S and T be subsets of A. Prove that fs T = fs ft, fs T fs ft. Also give an example that shows that in general fs T fs ft. Problem 8. If A and B are sets, and if f : A B, then for any subset S of B we define the pre-image of S as f S { a A : fa S }. NOTE: f S is defined even if f does not have an inverse! Let S and T be subsets of B. Prove that f S T = f S f T, f S T = f S f T. 3 3-Oct-00, 3:39 pm

Chapter 5 Division and Factorization 5. The Division Theorem THEOREM 5.: n Z, d Z +,! q, r Z : 0 r < d, n = qd + r. If n = and d = 8 then n = d + 5. Thus, here q = and r = 5. n is a number, d is called the divisor, q is called the quotient; we write q = n div m, r is called the remainder; we write r = n mod m. Examples. n = 4, d = 5 : 4 = d + 4, so 4 div 5 = and 4 mod 5 = 4. n = 4, d = 5 : 4 = 3 d +, so 4 div 5 = 3 and 4 mod 5 =. Let d Z + and n, q, r Z. From the definitions of div and mod it follows that : PROPERTY : n = n div d d + n mod d. Example : 3 = 3 div 7 7 + 3 mod 7 PROPERTY : If 0 r < d then qd + r mod d = r. Example : 5 7 + 3 mod 7 = 3 PROPERTY 3 : qd + n mod d mod d = n mod d. Example : 5 7 + 3 mod 7 mod 7 = 3 mod 7 PROPERTY 4 : Let a, b Z and d Z +. Then ad + b mod d = b mod d. PROOF. By the Division Theorem b = qd + r, where r = b mod d, with 0 r < d. Thus, using Property ad + b mod d = a + qd + r mod d = r = b mod d. 57 7 + 3 mod 7 = 3 mod 7. QED 33

5.. THE DIVISION THEOREM CHAPTER 5. DIVISION AND FACTORIZATION PROPERTY 5 : Let a Z and d Z +. Then a mod d mod d = a mod d. PROOF. Using Property 3, a mod d mod d = 0 d + a mod d mod d = a mod d. QED 59 mod 7 mod 7 = 59 mod 7. PROPERTY 6 : Let a, b Z and d Z +. Then a + b mod d = a mod d + b mod d mod d. 83 3 mod 6. Note that 83 3 = 5, which is divisible by 6, i.e., 6 83 3. PROPOSITION 5.: Let a, b Z, and d Z +. Then a b mod d if and only if d a b. PROOF. = First, if a b mod d then, by definition, a mod d = b mod d. Hence there exist q a, q b, r Z with 0 r < d such that a = q a d + r and b = q b d + r same remainder. 5 + 8 mod 3 = = 5 mod 3 + 8 mod 3 mod 3. PROOF. By the Division Theorem a = q a d + r a, where r a = a mod d, with 0 r a < d, b = q b d + r b, where r b = b mod d, with 0 r b < d. Thus a + b mod d = q a d + r a + q b d + r b mod d = q a + q b d + r a + r b mod d = r a + r b mod d using Property 4 = a mod d + b mod d mod d. QED DEFINITION. If a, b Z and d Z +, and if It follows that so that d a b. = Conversely, if d a b then i.e., for some q Z. It follows that a b = q a q b d, a b = qd, a = b + qd, a mod d = b + qd mod d = b mod d. PROPOSITION 5.: If a, b Z and c, d Z +, then a b mod d = ac bc mod dc. QED a mod d = b mod d, PROOF. We have a b mod d if and only if d a b, i.e., then we also write and we say a b mod d a is congruent to b modulo d. a b = qd for some q Z. Then ac bc = qdc, so that dc ac bc, i.e., ac bc mod dc. QED 34 3-Oct-00, 3:39 pm

5.. THE FACTORIZATION THEOREM CHAPTER 5. DIVISION AND FACTORIZATION NOTE. We also have that ac bc mod d. PROPOSITION 5.3: Let a, b Z and d Z +. Then a b mod d = a b mod 4d. Let a = 3, b = 7, d = 3. Then 3 7 mod 3, i.e., 3 mod 6 = 7 mod 6, and 3 7 mod 4 3, i.e., 69 mod = 49 mod. Check! PROOF. Suppose a b mod d. Then d a b, i.e., a b = q d, for some q Z. Thus a and b differ by an even number. It follows that a and b must be both even or both odd. Hence a + b must be even, i.e., a + b = c for some c Z. Then a b = a + b a b = c q d = cq 4d. It follows that 4d a b, i.e., a b mod 4d. QED NOTE. Also a b mod d and a b mod d. PROPOSITION 5.4: If n > 3 then not all of n, n +, n + 4, can be primes. PROOF. By contradiction: Assume that n > 3 and that n, n +, and n + 4 are primes. Since n is prime and n > 3 we have n mod 3 = or n mod 3 =. Case : If n mod 3 = then n = 3k + and n + = 3k + 3, i.e., 3 n +. Case : If n mod 3 = then n = 3k + and Contradiction! n + 4 = 3k + 6, i.e., 3 n + 4. 5. The Factorization Theorem THEOREM 5.: n Z + { },! m, { p i } m i=, { n i } m i= : m Z +, i i =,...,m : p i, n i Z +, < p < p < < p m, i i =,...,m : p i is a prime number, n = p n pn p nm m. 5 = 3 7. PROPOSITION 5.5: log 3 is irrational. PROOF. By contradiction: Suppose log 3 is rational, i.e., p, q Z + such that log 3 = p/q. By definition of the log function it follows that p/q = 3, QED 35 3-Oct-00, 3:39 pm

5.. THE FACTORIZATION THEOREM CHAPTER 5. DIVISION AND FACTORIZATION from which p = 3 q. Let n = p. Then n has two different prime factorizations, namely n = p and n = 3 q. This contradicts the Factorization Theorem. QED The prime factorization of p has even powers only. The prime factorization of q has even powers only. The prime factorization of n must have an odd power, otherwise n would be a perfect square. Thus the factorization of nq must have an odd power. Thus p has two distinct factorizations: REMARK. The fact that p 3 q also follows from the facts that p is even and 3 q is odd. DEFINITION. We call n Z + a perfect square if k Z + : n = k. FACT: The factorization of a perfect square has only even powers: If then PROPOSITION 5.6: k = p n p n p nm m, n = k = p n p n p nm m. If n Z + is not a perfect square then n is irrational. one with even powers and one with at least one odd power. This contradicts the uniqueness in the Factorization Theorem. DEFINITION. k Z + is the greatest common divisor of n, m Z +, k = gcdn, m, if k n and k m, no positive integer greater than k divides both n and m. REMARK. One can determine gcdn, m from the minimum exponents in the prime factorizations of n and m. QED PROOF. By contradiction : Suppose n is not a perfect square, but n is rational. Thus i.e., for some p, q Z +. n = p q, p = n q, If then and n = 68, m = 900, n = 3 3 7, m = 3 5, gcd68, 900 = 3 =. 36 3-Oct-00, 3:39 pm