Set s and Funct ions Set s and Funct ions Reading f or COMP 364 - - PowerPoint PPT Presentation

set s and funct ions set s and funct ions
SMART_READER_LITE
LIVE PREVIEW

Set s and Funct ions Set s and Funct ions Reading f or COMP 364 - - PowerPoint PPT Presentation

Set s and Funct ions Set s and Funct ions Reading f or COMP 364 and CSI T571 Reading f or COMP 364 and CSI T571 Cunsheng Ding Depart ment of Comput er Science HKUST, Kowloon, CHI NA Acknowledgments: Materials from Prof. Sanjain Jain at


slide-1
SLIDE 1

Discrete Math. Reading Materials 1

Set s and Funct ions Set s and Funct ions

Reading f or COMP 364 and CSI T571 Reading f or COMP 364 and CSI T571

Cunsheng Ding Depart ment of Comput er Science HKUST, Kowloon, CHI NA

Acknowledgments: Materials from Prof. Sanjain Jain at NUS

slide-2
SLIDE 2

Discrete Math. Reading Materials 2

Set s and Funct ions f or Crypt ography Set s and Funct ions f or Crypt ography

G Set s and f unct ions are basic building blocks of

crypt ographic syst ems. There is no way t o learn crypt ography and comput er securit y wit hout t he knowledge of set s and f unct ions.

G Set s and f unct ions are covered in school mat h.,

and also in any universit y course on discret e mat h.

G Every st udent should read t his mat erial as you may

have f orgot t en set s and f unct ions even if you learnt t hem as people do f orget .

slide-3
SLIDE 3

Discrete Math. Reading Materials 3

Lecture Topics Lecture Topics

G Sets and Members, Equality of Sets G Set Notation G The Empty Set and Sets of Numbers G Subsets and Power Sets G Equality of Sets by Mutual Inclusion G Universal Sets, Venn Diagrams G Set Operations G Set Identities G Proving Set Identities

slide-4
SLIDE 4

Discrete Math. Reading Materials 4

Sets Sets

G A set is a collection of (distinct) objects. G For example,

1 2 3 a b

slide-5
SLIDE 5

Discrete Math. Reading Materials 5

Members, Elements Members, Elements

G The objects that make up a set are called members

  • r elements of the set.

G An object can be anything that is “meaningful”. For

example,

I a number I an equation I a person I another set

slide-6
SLIDE 6

Discrete Math. Reading Materials 6

Equality of Sets Equality of Sets

G Two sets are equal iff they have the same members.

I That is, a set is completely determined by its

members.

G This is known as the principle of extension.

slide-7
SLIDE 7

Discrete Math. Reading Materials 7

Pause and Think ... Pause and Think ...

G Does the statement “a set is a collection of objects”

define what a set is?

G Let

I the members of set A be -1 and 1, I the members of set B be the roots of the equation

x2 - 1 = 0.

I Are sets A and B equal?

slide-8
SLIDE 8

Discrete Math. Reading Materials 8

Lecture Topics Lecture Topics

G Sets and Members, Equality of Sets G Set Notation G The Empty Set and Sets of Numbers G Subsets and Power Sets G Equality of Sets by Mutual Inclusion G Universal Sets, Venn Diagrams G Set Operations G Set Identities G Proving Set Identities

slide-9
SLIDE 9

Discrete Math. Reading Materials 9

The Notation { The Notation { … … } Describes a Set } Describes a Set

G A set can be described by listing the comma

separated members of the set within a pair of curly braces.

G An example

I Let S = { 1, 3, 9 }. I S is a set. I The members of S are 1, 3, 9.

slide-10
SLIDE 10

Discrete Math. Reading Materials 10

Order and Repetition Do Not Matter in Order and Repetition Do Not Matter in { { … … } }

G By the principle of extension, a set is determined by

its members.

G For example, the following expressions are

equivalent

I { 1, 3, 9 } I { 9, 1, 3 } I { 1, 1, 9, 9, 3, 3, 9, 1 } I They denote the set whose members are 1, 3, 9.

slide-11
SLIDE 11

Discrete Math. Reading Materials 11

The Membership Symbol The Membership Symbol ∈ ∈

G The fact that x is a member of S can be expressed as

I x ∈ S

G The membership symbol ∈ can be read as

I is in, is a member of, belongs to

G An Example

I S = { 7, 13, 21, 47 } I 7 ∈ S, 13 ∈ S, 21 ∈ S, 47 ∈ S

G The negation of ∈ is written ∉.

slide-12
SLIDE 12

Discrete Math. Reading Materials 12

Defining a Set by Membership Properties Defining a Set by Membership Properties

G Notation

I

S = { x ∈ T | P(x) }

I The members of S are members of a already

known set T that satisfy property P.

G An example

I Let Z be the set of integers. I Let Z+ be the set of positive integers. I Z+ = { x ∈ Z | x > 0 }

slide-13
SLIDE 13

Discrete Math. Reading Materials 13

Pause and Think ... Pause and Think ...

G Can you simplify the following expression?

I { {2,2}, { {2} }, {1,1,1}, 1 , { 1 } , 2, 2 }

G What does the following expression say?

I X = { X }

G Find an expression equivalent to S = { . . . , x , . . . }.

slide-14
SLIDE 14

Discrete Math. Reading Materials 14

Lecture Topics Lecture Topics

G Sets and Members, Equality of Sets G Set Notation G The Empty Set and Sets of Numbers G Subsets and Power Sets G Equality of Sets by Mutual Inclusion G Universal Sets, Venn Diagrams G Set Operations G Set Identities G Proving Set Identities

slide-15
SLIDE 15

Discrete Math. Reading Materials 15

The Empty Set The Empty Set

G The empty set is also called the null set. G It is the set that has no members. G It is denoted as ∅. G Clearly, ∅ = { }. G For any object x, x ∉ ∅.

slide-16
SLIDE 16

Discrete Math. Reading Materials 16

The Sets of Positive, Negative, and All The Sets of Positive, Negative, and All Integers Integers

G Z = The set of (all) integers

I Z = { . . . , -2, -1, 0, 1, 2, . . . }

G Z+ = The set of (all) positive integers

I Z+ = { 1, 2, 3, … } I Z+ = { x ∈ Z | x > 0 }

G Z- = The set of (all) negative integers

I Z- = { . . . , -3, -2, -1 } = { -1, -2, -3, … } I Z- = { x ∈ Z | x < 0 }

slide-17
SLIDE 17

Discrete Math. Reading Materials 17

The Set of Real Numbers The Set of Real Numbers

G R = The set of (all) real numbers

slide-18
SLIDE 18

Discrete Math. Reading Materials 18

The Set of Rational Numbers The Set of Rational Numbers

G Q = The set of (all) rational numbers. G Q = { x ∈ R | x = p/q; p,q ∈ Z; q ≠ 0 }

slide-19
SLIDE 19

Discrete Math. Reading Materials 19

Pause and Think ... Pause and Think ...

G What is the set of natural numbers?

slide-20
SLIDE 20

Discrete Math. Reading Materials 20

Lecture Topics Lecture Topics

G Sets and Members, Equality of Sets G Set Notation G The Empty Set and Sets of Numbers G Subsets and Power Sets G Equality of Sets by Mutual Inclusion G Universal Sets, Venn Diagrams G Set Operations G Set Identities G Proving Set Identities

slide-21
SLIDE 21

Discrete Math. Reading Materials 21

Subsets Subsets

G A is a subset of B, or B is a superset of A iff every

member of A is a member of B.

G Notationally,

I A ⊆ B iff ∀ x, if x ∈ A, then x ∈ B.

G An example

I { -2, 0, 8 } ⊆ { -3, -2, -1, 0, 2, 4, 6, 8, 10 }

slide-22
SLIDE 22

Discrete Math. Reading Materials 22

Negation of Negation of ⊆ ⊆

G A is not a subset of B, or B is not a superset of A iff

there is a member of A that is not a member of B.

G Notationally

I A ⊄ B iff ∃x, x ∈ A and x ∉ B.

G Example

I { 2, 4 } ⊄ { 2, 3 }

slide-23
SLIDE 23

Discrete Math. Reading Materials 23

Obvious Subsets Obvious Subsets

G S ⊆ S G ∅ ⊆ S G Vacuously true

I The implication “if x ∈ ∅ , then x ∈ S” is true

G By contradiction,

I If ∅ ⊄ S, then ∃x, x ∈ ∅ and x ∉ S.

slide-24
SLIDE 24

Discrete Math. Reading Materials 24

Proper Subsets Proper Subsets

G A is a proper subset of B, or B is a proper superset

  • f A iff A is a subset of B and A is not equal to B.

G Notationally

I A ⊂ B iff A ⊆ B and A ≠ B

G Examples

I If S ≠ ∅, then ∅ ⊂ S. I Z+ ⊂ Z ⊂ Q ⊂ R

slide-25
SLIDE 25

Discrete Math. Reading Materials 25

Power Sets Power Sets

G The set of all subsets of a set is called the power set

  • f the set.

G The power set of S is P(S). G Examples

I P( ∅ ) = { ∅ } I P( { 1, 2 } ) = { ∅, { 1 }, { 2 }, { 1, 2 } } I P( S ) = { ∅, … , S }

slide-26
SLIDE 26

Discrete Math. Reading Materials 26

∈ ∈ and and ⊆ ⊆ are Different. are Different.

G Examples

I 1 ∈ { 1 } is true I 1 ⊆ { 1 } is false I { 1 } ⊆ { 1 } is true

slide-27
SLIDE 27

Discrete Math. Reading Materials 27

Pause and Think ... Pause and Think ...

G Which of the following statements is true?

I S ⊆ P(S) I S ∈ P(S)

G What is P( { 1, 2, 3 } )?

slide-28
SLIDE 28

Discrete Math. Reading Materials 28

Lecture Topics Lecture Topics

G Sets and Members, Equality of Sets G Set Notation G The Empty Set and Sets of Numbers G Subsets and Power Sets G Equality of Sets by Mutual Inclusion G Universal Sets, Venn Diagrams G Set Operations G Set Identities G Proving Set Identities

slide-29
SLIDE 29

Discrete Math. Reading Materials 29

Mutual Inclusion Mutual Inclusion

G Sets A and B have the same members iff they

mutually include

I A ⊆ B and B ⊆ A

G That is, A = B iff A ⊆ B and B ⊆ A.

slide-30
SLIDE 30

Discrete Math. Reading Materials 30

Equality by Mutual Inclusion Equality by Mutual Inclusion

G Mutual inclusion is very useful for proving the equality

  • f two sets.

G To prove an equality, we prove two subset

relationships.

slide-31
SLIDE 31

Discrete Math. Reading Materials 31

An Example Showing the Equality of Sets An Example Showing the Equality of Sets

G Recall that Z = The set of (all) integers. G Let A = { x ∈ Z | x = 2 m for some m ∈ Z } G Let B = { y ∈ Z | y = 2 n - 2 for some n ∈ Z } G To show A ⊆ B, note that

I 2m = 2(m+1) - 2 = 2n-2

G To show B ⊆ A, note that

I 2n-2 = 2(n-1) = 2m

G That is, A = B. G In fact, A, B both denote the set of even integers.

slide-32
SLIDE 32

Discrete Math. Reading Materials 32

Pause and Think ... Pause and Think ...

G Let

I A = { x ∈ Z | x2 - 1 = 0 } I B = { x ∈ Z | 2 x3 - x2 - 2 x + 1 = 0 } I Show that A = B by the method of mutual

inclusion.

slide-33
SLIDE 33

Discrete Math. Reading Materials 33

Lecture Topics Lecture Topics

G Sets and Members, Equality of Sets G Set Notation G The Empty Set and Sets of Numbers G Subsets and Power Sets G Equality of Sets by Mutual Inclusion G Universal Sets, Venn Diagrams G Set Operations G Set Identities G Proving Set Identities

slide-34
SLIDE 34

Discrete Math. Reading Materials 34

Universal Sets Universal Sets

G Depending on the context of discussion,

I define a set U such that all sets of interest are

subsets of U.

I The set U is known as a universal set.

G For example,

I when dealing with integers, U may be Z I when dealing with plane geometry, U may be the

set of all points in the plane

slide-35
SLIDE 35

Discrete Math. Reading Materials 35

Venn Diagrams Venn Diagrams

G To visualise relationships among some sets G Each subset (of U) is represented by a circle inside

the rectangle

slide-36
SLIDE 36

Discrete Math. Reading Materials 36

Pause and Think ... Pause and Think ...

G If Z is a universal set, can we replace Z by R as the

universal set?

slide-37
SLIDE 37

Discrete Math. Reading Materials 37

Lecture Topics Lecture Topics

G Sets and Members, Equality of Sets G Set Notation G The Empty Set and Sets of Numbers G Subsets and Power Sets G Equality of Sets by Mutual Inclusion G Universal Sets, Venn Diagrams G Set Operations G Set Identities G Proving Set Identities

slide-38
SLIDE 38

Discrete Math. Reading Materials 38

Set Operations Set Operations

G Let A, B be subsets of some universal set U. G The following set operations create new sets from A

and B.

G Union

I A ∪ B = { x ∈ U | x ∈ A or x ∈ B }

G Intersection

I A ∩ B = { x ∈ U | x ∈ A and x ∈ B }

G Difference

I A - B = A \ B = { x ∈ U | x ∈ A and x ∉ B }

G Complement

I Ac = U - A = { x ∈ U | x ∉ A }

slide-39
SLIDE 39

Discrete Math. Reading Materials 39

Set Union Set Union

G An example

I { 1, 2, 3 } ∪ { 2, 3, 4, 5 } = { 1, 2, 3, 4, 5 }

G the Venn diagram

1 2 3 4 5

slide-40
SLIDE 40

Discrete Math. Reading Materials 40

Set Intersection Set Intersection

G An example

I { 1, 2, 3 } ∩ { 2, 3, 4, 5 } = { 2, 3 }

G the Venn diagram

1 2 3 4 5

slide-41
SLIDE 41

Discrete Math. Reading Materials 41

Set Difference Set Difference

G An example

I { 1, 2, 3 } - { 2, 3, 4, 5 } = { 1 }

G the Venn diagram

1 2 3 4 5

slide-42
SLIDE 42

Discrete Math. Reading Materials 42

Set Complement Set Complement

G The Venn diagram

slide-43
SLIDE 43

Discrete Math. Reading Materials 43

Pause and Think ... Pause and Think ...

G Let A ⊆ B.

I What is A - B? I What is B - A?

G If A, B ⊆ C, what can you say about A ∪ B and C? G If C ⊆ A, B, what can you say about C and A ∩ B?

slide-44
SLIDE 44

Discrete Math. Reading Materials 44

Lecture Topics Lecture Topics

G Sets and Members, Equality of Sets G Set Notation G The Empty Set and Sets of Numbers G Subsets and Power Sets G Equality of Sets by Mutual Inclusion G Universal Sets, Venn Diagrams G Set Operations G Set Identities G Proving Set Identities

slide-45
SLIDE 45

Discrete Math. Reading Materials 45

Basic Set Identities Basic Set Identities

G Commutative laws

I A ∪ B = B ∪ A I A ∩ B = B ∩ A

G Associative laws

I (A ∪ B) ∪ C = A ∪ (B ∪ C) I (A ∩ B) ∩ C = A ∩ (B ∩ C)

G Distributive laws

I A ∪ (B ∩ C) = (A ∪ B) ∩ (A ∪ C) I A ∩ (B ∪ C) = (A ∩ B) ∪ (A ∩ C)

slide-46
SLIDE 46

Discrete Math. Reading Materials 46

Basic Set Identities (continued) Basic Set Identities (continued)

G ∅ is the identity for union

I ∅ ∪ A = A ∪ ∅ = A

G U is the identity for intersection

I

A ∩ U = U ∩ A = A

G Double complement law

I (Ac)c = A

G Idempotent laws

I A ∪ A = A I A ∩ A = A

slide-47
SLIDE 47

Discrete Math. Reading Materials 47

Basic Set Identities (continued) Basic Set Identities (continued)

G De Morgan’s laws

I (A ∪ B)c = Ac ∩ Bc I (A ∩ B)c = Ac ∪ Bc

slide-48
SLIDE 48

Discrete Math. Reading Materials 48

Pause and Think ... Pause and Think ...

G What is

I (A∩B) ∩ (A∪B)?

G What is

I (A∪B) ∪ (A∩B)?

slide-49
SLIDE 49

Discrete Math. Reading Materials 49

Lecture Topics Lecture Topics

G Sets and Members, Equality of Sets G Set Notation G The Empty Set and Sets of Numbers G Subsets and Power Sets G Equality of Sets by Mutual Inclusion G Universal Sets, Venn Diagrams G Set Operations G Set Identities G Proving Set Identities

slide-50
SLIDE 50

Discrete Math. Reading Materials 50

Proof Methods Proof Methods

G There are many ways to prove set identities. G The methods include

I applying existing identities, I building a membership table, I using mutual inclusion.

slide-51
SLIDE 51

Discrete Math. Reading Materials 51

A Proof by Mutual Inclusion A Proof by Mutual Inclusion

G Prove that (A ∩ B)∩ C = A∩ (B ∩ C). G First show that (A ∩ B)∩ C ⊆ A ∩ (B ∩ C). G Let x ∈ (A ∩ B)∩ C,

I x ∈ (A ∩ B) and x ∈ C I x ∈ A and x ∈ B and x ∈ C I x ∈ A and x ∈ ( B ∩ C ) I x ∈ A ∩ (B ∩ C)

G Then show that A∩ (B ∩ C) ⊆ (A ∩ B) ∩ C.

slide-52
SLIDE 52

Discrete Math. Reading Materials 52

Pause and Think ... Pause and Think ...

G To prove that A ∪ Ac = U by mutual inclusion, do you

have to prove the inclusion A U Ac ⊆ U?

G To prove that A ∩ Ac = ∅ by mutual inclusion, do you

have to prove the inclusion ∅ ⊆ A ∩ Ac?

slide-53
SLIDE 53

Discrete Math. Reading Materials 53

Lecture Topics Lecture Topics

G From “High School” Functions to “General” Functions G Function Notation G Values, images, inverse images, pre-images G Codomains, Domains, Ranges G Sets of Images and Pre-Images G Equality of Functions G Some Special Functions G Unary and Binary Operations as Functions G The Composition of Two Functions is a Function G The Values of Function Composition

slide-54
SLIDE 54

Discrete Math. Reading Materials 54

“ “High School High School” ” Functions Functions

G Functions are usually given by formulas. G Examples

I f(x) = sin(x) I f(x) = ex I f(x) = xn I f(x) = log x

G A function is a computation rule that changes one

value to another value.

G Effectively, a function associates, or relates, one

value to another value.

slide-55
SLIDE 55

Discrete Math. Reading Materials 55

“ “General General” ” Functions Functions

G Since a function relates one value to another, we can

think of a function as relating one object to another

  • bject. Objects need not be numbers.

G In the previous examples, the function f relates the

  • bject x to the object f(x).

G Usually we want to be able to relate each object of

interest to only one object.

G That is, a function is a single-valued and exhaustive

relation.

slide-56
SLIDE 56

Discrete Math. Reading Materials 56

Functions Functions

G A relation f from A to B is a function from A to B iff

I for every x ∈ A, there exists a unique y ∈ B such

that x f y, or equivalently, (x,y) ∈ f.

G Functions are also known as transformations, maps,

and mappings.

slide-57
SLIDE 57

Discrete Math. Reading Materials 57

Example 1 Example 1

G Let A = { 1, 2, 3 } and B = { a, b }. G R = { (1,a), (2,a), (3,b) } is a function from A to B.

1 2 3 a b

slide-58
SLIDE 58

Discrete Math. Reading Materials 58

Example 2 Example 2

G Let A = { 1, 2, 3 } and B = { a, b }. G S = { (1,a), (1,b), (2,a), (3,b) } is not a function from A

to B. 1 2 3 a b

slide-59
SLIDE 59

Discrete Math. Reading Materials 59

Example 3 Example 3

G Let A = { 1, 2, 3 } and B = { a, b }. G T = { (1,a), (3,b) } is not a function from A to B.

1 2 3 a b

slide-60
SLIDE 60

Discrete Math. Reading Materials 60

Pause and Think ... Pause and Think ...

G Is A x { a }, where a ∈ A, a function from A to A?

slide-61
SLIDE 61

Discrete Math. Reading Materials 61

Lecture Topics Lecture Topics

G From “High School” Functions to “General” Functions G Function Notation G Values, images, inverse images, pre-images G Codomains, Domains, Ranges G Sets of Images and Pre-Images G Equality of Functions G Some Special Functions G Unary and Binary Operations as Functions G The Composition of Two Functions is a Function G The Values of Function Composition

slide-62
SLIDE 62

Discrete Math. Reading Materials 62

Function Notation Function Notation

G Let f be a relation from A to B. That is, f ⊆ AxB. G If the relation f is a function,

I we write f : A → B. I If (x,y) ∈ f, we write y = f(x).

G Usually we use f, g, h, … to denote relations that are

functions.

slide-63
SLIDE 63

Discrete Math. Reading Materials 63

Notational Convention Notational Convention

G Sometimes functions are given by stating the rule of

transformation, for example, f(x) = x+1.

G This should be taken to mean

I f = { (x,f(x)) ∈ AxB | x ∈ A } I where A and B are some understood sets.

slide-64
SLIDE 64

Discrete Math. Reading Materials 64

Pause and Think ... Pause and Think ...

G Let f ⊆ A x B be a relation and (x,y) ∈ f. G Does the expression f(x) = y make sense?

slide-65
SLIDE 65

Discrete Math. Reading Materials 65

Lecture Topics Lecture Topics

G From “High School” Functions to “General” Functions G Function Notation G Values, images, inverse images, pre-images G Codomains, Domains, Ranges G Sets of Images and Pre-Images G Equality of Functions G Some Special Functions G Unary and Binary Operations as Functions G The Composition of Two Functions is a Function G The Values of Function Composition

slide-66
SLIDE 66

Discrete Math. Reading Materials 66

Values, Images Values, Images

G Let f : A → B. G Let y = f(x).

I That is, x f y, equivalently, (x,y) ∈ f.

G The object y is called

I the image of x under the function f, or I the value of f at x.

slide-67
SLIDE 67

Discrete Math. Reading Materials 67

Inverse Images, Pre Inverse Images, Pre-

  • images

images

G Let f : A → B and y ∈ B. G Define

I f -1(y) = { x ∈ A | f(x) = y }

G The set f -1(y) is called the inverse image, or pre-

image of y under f.

slide-68
SLIDE 68

Discrete Math. Reading Materials 68

Images and Pre Images and Pre-

  • images of Subsets

images of Subsets

G Let f : A → B and X ⊆ A and Y ⊆ B. G We define

I f(X) = { f(x) ∈ B | x ∈ X } I f -1(Y) = { x ∈ A | f(x) ∈ Y }

slide-69
SLIDE 69

Discrete Math. Reading Materials 69

Examples Examples

G Let f : A → B be given as follows G f( {1,3} ) = { c, d } G f -1( { a, d } ) = { 3 }

1 2 3 a b c d e

slide-70
SLIDE 70

Discrete Math. Reading Materials 70

Some Properties Some Properties

G Let f : A → B and X ⊆ A and Y ⊆ B. G Clearly we have

I f(A) ⊆ B I f -1(B) = A because every element of A has an

image in B

slide-71
SLIDE 71

Discrete Math. Reading Materials 71

Pause and Think ... Pause and Think ...

G Let f : A → B and X ⊆ A and Y ⊆ B. G If there are n elements in X, how many elements are

there in f(X)?

G If there are n elements in Y, how many elements are

there in f -1 (Y)?

slide-72
SLIDE 72

Discrete Math. Reading Materials 72

Lecture Topics Lecture Topics

G From “High School” Functions to “General” Functions G Function Notation G Values, images, inverse images, pre-images G Codomains, Domains, Ranges G Sets of Images and Pre-Images G Equality of Functions G Some Special Functions G Unary and Binary Operations as Functions G The Composition of Two Functions is a Function G The Values of Function Composition

slide-73
SLIDE 73

Discrete Math. Reading Materials 73

Domains Domains

G Let f : A → B. G The domain of function f is the set A.

slide-74
SLIDE 74

Discrete Math. Reading Materials 74

Codomains Codomains and Ranges and Ranges

G Let f : A → B. G The codomain of function f is the set B. G The range of function f is the set of images of f.

I Clearly, the range of f is f(A).

slide-75
SLIDE 75

Discrete Math. Reading Materials 75

Example 1 Example 1

G The domain is { 1, 2, 3 }. G The codomain is { p, q, r, s }. G The range is { p, r }.

1 2 3 p q r s f

slide-76
SLIDE 76

Discrete Math. Reading Materials 76

Example 2 Example 2

G Consider exp : R → R. That is, exp(x) = ex. G The domain and codomain of exp are both R. G The range of exp is R+, the set of positive real

numbers.

slide-77
SLIDE 77

Discrete Math. Reading Materials 77

Pause and Think ... Pause and Think ...

G Consider cos : R → R. G What are the domain, codomain, and range of cos?

slide-78
SLIDE 78

Discrete Math. Reading Materials 78

Lecture Topics Lecture Topics

G From “High School” Functions to “General” Functions G Function Notation G Values, images, inverse images, pre-images G Codomains, Domains, Ranges G Sets of Images and Pre-Images G Equality of Functions G Some Special Functions G Unary and Binary Operations as Functions G The Composition of Two Functions is a Function G The Values of Function Composition

slide-79
SLIDE 79

Discrete Math. Reading Materials 79

Images and Pre Images and Pre-

  • images of Subsets

images of Subsets

G Let f : A → B. G Let X, X’ ⊆ A and Y, Y’ ⊆ B. G We shall call f(X) the image of X instead of the set of

images of members of X. Similarly, we shall simply call f -1(Y) the preimage of Y.

G We have

I f( f -1 (Y)) ⊆ Y and X ⊆ f -1 (f(X)) I f(X ∪ X’) = f(X) ∪ f(X’), f(X ∩ X’) ⊆ f(X) ∩ f(X’) I f -1 (Y ∪ Y’) = f -1 (Y) ∪ f -1 (Y’) I f -1 (Y ∩ Y’) = f -1 (Y) ∩ f -1 (Y’)

slide-80
SLIDE 80

Discrete Math. Reading Materials 80

f( f f( f-

  • 1

1 (Y))

(Y)) ⊆ ⊆ Y Y

G It is possible to have strict inclusion.

I When the range of f is a proper subset of its

codomain, we may take Y = B to obtain

I f( f -1 (B)) = f( A ) ⊂ B

G To show inclusion,

I let y ∈ f( f -1 (Y)). I ∃ x ∈ f -1 (Y) such that f(x) = y. I We have f(x) ∈Y. I That is, y ∈ Y

slide-81
SLIDE 81

Discrete Math. Reading Materials 81

f(X f(X ∪ ∪ X X’ ’) = f(X) ) = f(X) ∪ ∪ f(X f(X’ ’) )

G We can easily show that

I f(X ∪ X’) ⊇ f(X) ∪ f(X’).

G This is because X ∪ X’ ⊇ X, so

I f(X ∪ X’) ⊇ f(X).

G Similarly, we have f(X ∪ X’) ⊇ f(X’). G Consequently, f(X ∪ X’) ⊇ f(X) ∪ f(X’).

slide-82
SLIDE 82

Discrete Math. Reading Materials 82

f(X f(X ∪ ∪ X X’ ’) = f(X) ) = f(X) ∪ ∪ f(X f(X’ ’) )

G To show f(X ∪ X’) ⊆ f(X) ∪ f(X’),

I let y ∈ f(X ∪ X’).

G ∃ x ∈ X ∪ X’ such that f(x) = y. G If x ∈ X, then y ∈ f(X); otherwise, y ∈ f(X’). This

means y ∈ f(X) ∪ f(X’).

G That is, f(X ∪ X’) ⊆ f(X) ∪ f(X’).

slide-83
SLIDE 83

Discrete Math. Reading Materials 83

Pause and Think ... Pause and Think ...

G What do the given set expressions become when f is

the identity function?

slide-84
SLIDE 84

Discrete Math. Reading Materials 84

Lecture Topics Lecture Topics

G From “High School” Functions to “General” Functions G Function Notation G Values, images, inverse images, pre-images G Codomains, Domains, Ranges G Sets of Images and Pre-Images G Equality of Functions G Some Special Functions G Unary and Binary Operations as Functions G The Composition of Two Functions is a Function G The Values of Function Composition

slide-85
SLIDE 85

Discrete Math. Reading Materials 85

Equality of Functions Equality of Functions

G Let f : A → B and g : C → D. G We define function f = function g iff

I set f = set g

G Note that this forces A = C but allows B ≠ D.

I Some require B = D as well.

slide-86
SLIDE 86

Discrete Math. Reading Materials 86

A Proof that Set f = Set g Implies Domain A Proof that Set f = Set g Implies Domain f = Domain g f = Domain g

G Let f : A → B and g : C → D and set f = set g. G Let x ∈ A.

I (x,f(x)) ∈ f I But f = g as sets I (x,f(x)) ∈ g I That is x ∈ C. I Consequently, A ⊆ C.

G Similarly, we have C ⊆ A. G That is, A = C.

slide-87
SLIDE 87

Discrete Math. Reading Materials 87

A Proof that Set f = Set g Implies f(x) = A Proof that Set f = Set g Implies f(x) = g(x) for all x g(x) for all x ∈ ∈ A A

G Let f, g : A → B and set f = set g. G Let x ∈ A.

I (x,f(x)) ∈ f I But f = g as sets I (x,f(x)) ∈ g I That is (x,f(x)), (x,g(x)) ∈ g. I Since g is a function, so f(x) = g(x).

slide-88
SLIDE 88

Discrete Math. Reading Materials 88

Example Example

G We consider

I exp : R → R and I exp : [0,1] → R I as two different functions though the computation

rule is the same --- exp(x) = ex.

slide-89
SLIDE 89

Discrete Math. Reading Materials 89

Pause and Think ... Pause and Think ...

G Let f and g be functions such that f(x) = g(x) on some

set A. Can we conclude that function f = function g?

slide-90
SLIDE 90

Discrete Math. Reading Materials 90

Lecture Topics Lecture Topics

G From “High School” Functions to “General” Functions G Function Notation G Values, images, inverse images, pre-images G Codomains, Domains, Ranges G Sets of Images and Pre-Images G Equality of Functions G Some Special Functions G Unary and Binary Operations as Functions G The Composition of Two Functions is a Function G The Values of Function Composition

slide-91
SLIDE 91

Discrete Math. Reading Materials 91

Identity Functions Identity Functions

G Consider the identity relation IA on the set A. G Clearly, for every x ∈ A, IA relates x to an unique

element of A that is itself.

G Consequently, we have IA : A → A . G

IA is also called the identity function on A.

slide-92
SLIDE 92

Discrete Math. Reading Materials 92

Constant Functions Constant Functions

G Let f : A → B. G If f(A) = { y } for some y ∈ B, f is called a constant

function of value y. . . . y f . . . . . .

slide-93
SLIDE 93

Discrete Math. Reading Materials 93

Characteristics Functions Characteristics Functions

G Consider some universal set U. G Let A ⊆ U. G The function χA : U → { 0, 1 } defined by

I χA(x) = 1, if x ∈ A, I χA(x) = 0, if x ∈ Ac; I is called the characteristic function of A.

slide-94
SLIDE 94

Discrete Math. Reading Materials 94

Pause and Think ... Pause and Think ...

G Let f : R → R.

I If f is a constant function, what does its graph on

the Cartesian X-Y plane look like?

I If f is the identity function, what does its graph on

the Cartesian X-Y plane look like?

slide-95
SLIDE 95

Discrete Math. Reading Materials 95

Lecture Topics Lecture Topics

G From “High School” Functions to “General” Functions G Function Notation G Values, images, inverse images, pre-images G Codomains, Domains, Ranges G Sets of Images and Pre-Images G Equality of Functions G Some Special Functions G Unary and Binary Operations as Functions G The Composition of Two Functions is a Function G The Values of Function Composition

slide-96
SLIDE 96

Discrete Math. Reading Materials 96

Unary Operations Unary Operations

G A unary operation on a set A acts on an element of A

and produces another element of A.

G Clearly, a unary operation uop can be thought of as a

function f : A → A with f(x) = uop( x ).

G Conversely, a function from A to A can be regarded

as a unary operation on A.

slide-97
SLIDE 97

Discrete Math. Reading Materials 97

Example 1 Example 1

G Let U be some universal set. G The complement operation on P(U) can be

represented as a function

I f: P(U)→ P(U) with f(A) = Ac.

slide-98
SLIDE 98

Discrete Math. Reading Materials 98

Binary Operations Binary Operations

G A binary operation on a set A acts on two elements of

A and produces another element of A.

G Clearly, a binary operation bop can be represented

as a function

I f : AxA → A with f((a,b)) = a bop b. I We write f(a,b) instead of f((a,b)).

G Conversely, a function from AxA to A can be

regarded as a binary operation on A.

slide-99
SLIDE 99

Discrete Math. Reading Materials 99

Example 1 Example 1

G Let U be some universal set. G The union operation on P(U) can be represented as a

function f: P(U)xP(U)→ P(U) with f(A,B) = A∪B.

slide-100
SLIDE 100

Discrete Math. Reading Materials 100

Pause and Think ... Pause and Think ...

G Let U = { 0, 1 }. G Give the set representations of the functions for

unary complement operation and the binary intersection operation.

slide-101
SLIDE 101

Discrete Math. Reading Materials 101

Lecture Topics Lecture Topics

G From “High School” Functions to “General” Functions G Function Notation G Values, images, inverse images, pre-images G Codomains, Domains, Ranges G Sets of Images and Pre-Images G Equality of Functions G Some Special Functions G Unary and Binary Operations as Functions G The Composition of Two Functions is a Function G The Values of Function Composition

slide-102
SLIDE 102

Discrete Math. Reading Materials 102

Function Composition Function Composition

G Let f : A → B and g : B → C. G Since relations can be composed and functions are

relations, so functions can be composed like relation composition.

G So relations f and g can be composed and their

composition is gf.

G Clearly gf is a relation from A to C. G But is gf a function?

slide-103
SLIDE 103

Discrete Math. Reading Materials 103

Function Composition Gives a Function Function Composition Gives a Function

G Let f : A → B and g : B → C. G We want to show that gf : A → C.

I That is, the composition of two functions is again a

function.

G We have to show for any x ∈ A, there is a unique z ∈

C, such that (x,z) ∈ gf.

slide-104
SLIDE 104

Discrete Math. Reading Materials 104

Existency Existency Proof Proof

G Let x ∈ A. G Since f is a function from A to B, there is a unique

y ∈ B such that (x,y) ∈ f.

G For this y ∈ B, there is a unique z ∈ C such that

(y,z) ∈g because g is a function from B to C.

G That is, (x,z) ∈ gf.

slide-105
SLIDE 105

Discrete Math. Reading Materials 105

Uniqueness Proof Uniqueness Proof

G Let (x,z), (x,z’) ∈ gf. G There exist y, y’ ∈ B such that

I (x,y) ∈ f, (y,z) ∈ g I (x,y’) ∈ f, (y’,z’) ∈ g

G But f is a function, so y = y’. G Now we have (y,z), (y,z’) ∈g. G But g is a function, so z = z’.

slide-106
SLIDE 106

Discrete Math. Reading Materials 106

Pause and Think ... Pause and Think ...

G Can you compose cos and log to obtain the

composition (log cos)?

G Can you compose log and exp to obtain the

composition (exp log)?

slide-107
SLIDE 107

Discrete Math. Reading Materials 107

Lecture Topics Lecture Topics

G From “High School” Functions to “General” Functions G Function Notation G Values, images, inverse images, pre-images G Codomains, Domains, Ranges G Sets of Images and Pre-Images G Equality of Functions G Some Special Functions G Unary and Binary Operations as Functions G The Composition of Two Functions is a Function G The Values of Function Composition

slide-108
SLIDE 108

Discrete Math. Reading Materials 108

The Values of Function Composition The Values of Function Composition

G Let f : A → B and g : B → C. G Since gf : A → C, for any x ∈ A, there is a z ∈ C,

such that (gf)(x) = z.

G That is, (x,z) ∈ gf. G By the definition of function composition, there is a

y ∈ B, such that (x,y) ∈ f and (y,z) ∈ g.

G Since f and g are function, we can write f(x) = y and

g(y) = z.

G Substituting y = f(x) in g(y) = z, we have g(f(x))=z. G That is,

I (gf)(x) = g(f(x)).

slide-109
SLIDE 109

Discrete Math. Reading Materials 109

The Values of Function Compositions The Values of Function Compositions

G Let f : A → B, g : B → C, h : C → D. G Since relation composition are associative and

functions are relations, we have

I h(gf) = (hg)f

G Furthermore, we have

I (h(gf))(x) = h( (gf)(x) ) = h( g ( f(x) ) ) I and I ((hg)f)(x) = (hg)(f(x)) = h( g ( f(x) ) )

G That is,

I (h(gf))(x) = ((hg)f)(x) = h(g(f(x)))

slide-110
SLIDE 110

Discrete Math. Reading Materials 110

Pause and Think ... Pause and Think ...

G Let f(x) = x+1, g(x) = x2, and h(x) = 1/(1+x2) be

functions R from to R.

I Is hgf a function? I If so, what is the value of (hgf)(x)?

slide-111
SLIDE 111

Discrete Math. Reading Materials 111

Lecture Topics Lecture Topics

G One-To-One (1-1) Functions, Injections G Composition of Injections G Onto Functions, Surjections G Composition of Surjections G One-To-One Correspondences, Bijections G Composition of Bijections G f is a Bijection Implies f Inverse is a Function. G f Inverse is a Function Implies f is a Bijection G Properties of Inverse Functions G Some Function Composition Properties

slide-112
SLIDE 112

Discrete Math. Reading Materials 112

One One-

  • To

To-

  • One Functions, Injections

One Functions, Injections

G Let f : A → B. G The function f is one-to-one iff

I for any x, x’ ∈ A, I if f(x) = f(x’) then x = x’ I Equivalently, I if x ≠ x’ then f(x) ≠ f(x’).

G In words, a function is one-to-one iff it maps distinct

elements to distinct images.

G A one-to-one function is also called an injection. G We abbreviate one-to-one as 1-1.

slide-113
SLIDE 113

Discrete Math. Reading Materials 113

Example 1 Example 1

G Let A = { 1, 2, 3 }. G Let B = { a, b, c, d, e } G Let f = { (1,a), (2,b), (3,a) } G The function f is not 1-1 because

I f(1) = f(3) = a but1 ≠ 3

1 2 3 a b c d e

slide-114
SLIDE 114

Discrete Math. Reading Materials 114

Example 2 Example 2

G Let A = { 1, 2, 3 }. G Let B = { a, b, c, d, e } G Let f = { (1,e), (2,b), (3,c) } G The function f is 1-1 because

I if x ≠ y, then f(x) ≠ f(y)

1 2 3 a b c d e

slide-115
SLIDE 115

Discrete Math. Reading Materials 115

Example 3 Example 3

G Let f : Z → Z with f(x) = x2. G The function f is not 1-1 because f(x) = f(-x). G Let g : Z+ → Z with g(x) = x2. G The function g is 1-1 because x2 = y2 implies x = y.

slide-116
SLIDE 116

Discrete Math. Reading Materials 116

Pause and Think ... Pause and Think ...

G How many 1-1 functions are there from {1,2,3} to

itself?

slide-117
SLIDE 117

Discrete Math. Reading Materials 117

Lecture Topics Lecture Topics

G One-To-One (1-1) Functions, Injections G Composition of Injections G Onto Functions, Surjections G Composition of Surjections G One-To-One Correspondences, Bijections G Composition of Bijections G f is a Bijection Implies f Inverse is a Function G f Inverse is a Function Implies f is a Bijection G Properties of Inverse Functions G Some Function Composition Properties

slide-118
SLIDE 118

Discrete Math. Reading Materials 118

Composition of One Composition of One-

  • To

To-

  • One Functions

One Functions

G Theorem

I Let f : A → B, g : B → C. I If both f and g are 1-1, then g f is also 1-1.

G That is, the composition of 1-1 functions is again 1-1.

slide-119
SLIDE 119

Discrete Math. Reading Materials 119

Proof Proof

G Let (gf)(x) = (gf)(y) G g(f(x)) = g(f(y)) G Since g is 1-1, f(x) = f(y) G Since f is 1-1, x = y G That is, gf is a 1-1 function.

slide-120
SLIDE 120

Discrete Math. Reading Materials 120

The Converse is Almost True The Converse is Almost True

G Let f : A → B, g : B → C. Let gf : A → C be 1-1. G Then f is 1-1 but g need not be 1-1. G Proof

I Let f(x) = f(y) I Then g(f(x)) = g(f(y)) I (gf)(x) = (gf)(y) I x = y I That is, f is 1-1.

slide-121
SLIDE 121

Discrete Math. Reading Materials 121

The Converse is False The Converse is False

G Let f : A → B, g : B → C. Let gf : A → C be 1-1. G The following is an example that g is not 1-1.

1 a b 2 A B C f g

slide-122
SLIDE 122

Discrete Math. Reading Materials 122

Pause and Think ... Pause and Think ...

G Let f : A → B, g : B → C. Let gf : A → C be not 1-1.

I Are f and g both not 1-1?

slide-123
SLIDE 123

Discrete Math. Reading Materials 123

Lecture Topics Lecture Topics

G One-To-One (1-1) Functions, Injections G Composition of Injections G Onto Functions, Surjections G Composition of Surjections G One-To-One Correspondences, Bijections G Composition of Bijections G f is a Bijection Implies f Inverse is a Function G f Inverse is a Function Implies f is a Bijection G Properties of Inverse Functions G Some Function Composition Properties

slide-124
SLIDE 124

Discrete Math. Reading Materials 124

Onto Functions, Onto Functions, Surjections Surjections

G Let f : A → B. G The function f is onto iff

I for any y ∈ B, I there exists some x ∈ A, I such that f(x) = y.

G In words, a function is onto iff every element in the

codomain has a non-empty pre-image.

G A onto function is also called a surjection.

slide-125
SLIDE 125

Discrete Math. Reading Materials 125

Onto Means Range is Onto Means Range is Codomain Codomain

G Let f : A → B be onto. G Onto implies B ⊆ f(A). G Proof

I Let y ∈ B. I There exists x ∈ A such that f(x) = y. I y ∈ f(A) I That is, B ⊆ f(A).

G But f(A) ⊆ B. G That is, B = f(A).

slide-126
SLIDE 126

Discrete Math. Reading Materials 126

Example 1 Example 1

G Let A = { 1, 2, 3 } and B = { a, b, c, d, e } G Let f = { (1,a), (2,a), (3,a) } G The function f is not onto because there is a b ∈ B

without any x ∈ A such that f(x) = b. 1 2 3 a b c d e

slide-127
SLIDE 127

Discrete Math. Reading Materials 127

Example 2 Example 2

G Let A = { 1, 2, 3 } and B = { a, b } G Let f = { (1,b), (2,b), (3,a) } G The function f is onto because for any y ∈ B there is

a x ∈ A such that f(x) = y. 1 2 3 a b

slide-128
SLIDE 128

Discrete Math. Reading Materials 128

Example 3 Example 3

G Let f : Z → Z with f(x) = x2.

I The function f is not onto because there is no

integer x such that f(x) = -1.

G Let g : Z → Z+ with g(x) = |x| + 1.

I It is not hard to check that g is onto.

slide-129
SLIDE 129

Discrete Math. Reading Materials 129

Pause and Think ... Pause and Think ...

G Let g : Z → Z+ with g(x) = |x|+2. Is g onto?

slide-130
SLIDE 130

Discrete Math. Reading Materials 130

Lecture Topics Lecture Topics

G One-To-One (1-1) Functions, Injections G Composition of Injections G Onto Functions, Surjections G Composition of Surjections G One-To-One Correspondences, Bijections G Composition of Bijections G f is a Bijection Implies f Inverse is a Function G f Inverse is a Function Implies f is a Bijection G Properties of Inverse Functions G Some Function Composition Properties

slide-131
SLIDE 131

Discrete Math. Reading Materials 131

Composition of Onto Functions Composition of Onto Functions

G Theorem

I Let f : A → B, g : B → C. I If both f and g are onto, then g f is also onto.

G That is, the composition of onto functions is again

  • nto.
slide-132
SLIDE 132

Discrete Math. Reading Materials 132

Proof Proof

G Let z ∈ C. G Since g : B → C is onto, there is a y ∈ B such that

I g(y) = z.

G Since f : A → B is onto, there is a x ∈ A such that

I f(x) = y.

G Combining, we have

I (gf)(x) = g(f(x)) = g(y) = z

G That is, the composition gf is onto.

slide-133
SLIDE 133

Discrete Math. Reading Materials 133

The Converse is Almost True The Converse is Almost True

G Let f : A → B, g : B → C. Let gf : A → C be onto. G Then g is onto but f need not be onto. G Proof

I Since gf is onto, for any z ∈ C, there is a x ∈ A

such that (gf)(x) = z.

I That is g(f(x)) = z. I But f(x) ∈ B. I So for any z ∈ C, there is a y = f(x) ∈ B such that

g(y) = x.

I That is, g is onto.

slide-134
SLIDE 134

Discrete Math. Reading Materials 134

The Converse is False The Converse is False

G Let f : A → B, g : B → C. Let gf : A → C be onto. G The following is an example that f is not onto.

1 a b 2 A B C f g

slide-135
SLIDE 135

Discrete Math. Reading Materials 135

Pause and Think ... Pause and Think ...

G Let f : A → B, g : B → C. Let gf : A → C be not onto.

I Are f and g also not onto?

slide-136
SLIDE 136

Discrete Math. Reading Materials 136

Lecture Topics Lecture Topics

G One-To-One (1-1) Functions, Injections G Composition of Injections G Onto Functions, Surjections G Composition of Surjections G One-To-One Correspondences, Bijections G Composition of Bijections G f is a Bijection Implies f Inverse is a Function G f Inverse is a Function Implies f is a Bijection G Properties of Inverse Functions G Some Function Composition Properties

slide-137
SLIDE 137

Discrete Math. Reading Materials 137

1 1-

  • 1

1 and Onto Functions, and Onto Functions, Bijections Bijections, 1 , 1-

  • 1

1 Correspondences Correspondences

G Let f : A → B. G The function f is a 1-1 correspondence iff f is 1-1 and

  • nto.

G A 1-1 correspondence is also called a bijection.

slide-138
SLIDE 138

Discrete Math. Reading Materials 138

Example 1 Example 1

G Let A = { 1, 2, 3 } and B = { a, b, c }. G Let f = { (1,b), (2,a), (3,c) }. G The function f is a 1-1 correspondence because it is

1-1 and onto. 1 2 3 a b c

slide-139
SLIDE 139

Discrete Math. Reading Materials 139

Example 2 Example 2

G Let f : Z → Z and f(x) = x - 1. G Since x-1 = y-1 implies x = y, so f is 1-1. G Since f(y+1) = y, so f is onto. G The function f is a 1-1 correspondence.

slide-140
SLIDE 140

Discrete Math. Reading Materials 140

Example 3 Example 3

G Let f : Z → Z+ and f(x) = |x| + 1. G Since f(-x) = f(x) but -x ≠ x for non-zero x, f is not 1-1. G When y > 0, we have f(y-1) = y. This shows that f is

  • nto.

G Since f is onto but not 1-1, so f is not a 1-1

correspondence.

slide-141
SLIDE 141

Discrete Math. Reading Materials 141

Pause and Think ... Pause and Think ...

G How many 1-1 correspondences are there from

{1,2,3} to itself?

slide-142
SLIDE 142

Discrete Math. Reading Materials 142

Lecture Topics Lecture Topics

G One-To-One (1-1) Functions, Injections G Composition of Injections G Onto Functions, Surjections G Composition of Surjections G One-To-One Correspondences, Bijections G Composition of Bijections G f is a Bijection Implies f Inverse is a Function G f Inverse is a Function Implies f is a Bijection G Properties of Inverse Functions G Some Function Composition Properties

slide-143
SLIDE 143

Discrete Math. Reading Materials 143

Composition of 1 Composition of 1-

  • 1 Correspondences

1 Correspondences

G Theorem

I Let f : A → B, g : B → C. I If both f and g are 1-1 correspondences, then g f is

also a 1-1 correspondence.

G That is, the composition of 1-1 correspondences is a

1-1 correspondence.

slide-144
SLIDE 144

Discrete Math. Reading Materials 144

Proof Proof

G Since f and g are 1-1, so is gf. G Since f and g are onto, so is gf. G Since gf is 1-1 and onto, gf is a 1-1 correspondence.

slide-145
SLIDE 145

Discrete Math. Reading Materials 145

The Converse is Almost True The Converse is Almost True

G Since gf is 1-1,

I we have shown that f is 1-1, I but g need not be 1-1.

G Since gf is onto,

I we have shown that g is onto, I but f need not be onto.

G That is, f and g need not be 1-1 correspondences.

slide-146
SLIDE 146

Discrete Math. Reading Materials 146

The Converse is False The Converse is False

G The following example shows that gf is a 1-1

correspondence from A to C, but neither f nor g is a 1-1 correspondence. 1 a b 2 A B C f g

slide-147
SLIDE 147

Discrete Math. Reading Materials 147

Making an Injection a Making an Injection a Bijection Bijection

G Let f : A → B be 1-1. G Let C = f(B). G Clearly, f : A → C is a bijection.

I Proof: I f remains 1-1 I f has become onto.

slide-148
SLIDE 148

Discrete Math. Reading Materials 148

Pause and Think ... Pause and Think ...

G Let f : A → B, g : B → C. If gf : A → C is not a

bijection, are f and g also not bijections?

slide-149
SLIDE 149

Discrete Math. Reading Materials 149

Lecture Topics Lecture Topics

G One-To-One (1-1) Functions, Injections G Composition of Injections G Onto Functions, Surjections G Composition of Surjections G One-To-One Correspondences, Bijections G Composition of Bijections G f is a Bijection Implies f Inverse is a Function G f Inverse is a Function Implies f is a Bijection G Properties of Inverse Functions G Some Function Composition Properties

slide-150
SLIDE 150

Discrete Math. Reading Materials 150

Inverse Functions Inverse Functions

G Let A = { 0, 1 }, B = { p, q }, f = { (0,p), (1,p) }. G Clearly f is a function from A to B. G Clearly f -1 = { (p,0), (p,1) } is a relation from B to A

but it is not a function from B to A.

G A function is invertible iff its inverse is also a function.

slide-151
SLIDE 151

Discrete Math. Reading Materials 151

Theorem Theorem

G Let f : A → B. G If f is a 1-1 correspondence then f -1 is a function.

slide-152
SLIDE 152

Discrete Math. Reading Materials 152

Proof Proof

G Let f : A → B be 1-1 and onto. G We want to show f -1 ⊆ B x A is a function. G We need to show

I For any y ∈ B, there is a x ∈ A such that

(y,x) ∈ f -1.

I If (y,x), (y,x’) ∈ f -1, then x = x’.

slide-153
SLIDE 153

Discrete Math. Reading Materials 153

Proof Proof ---

  • -- Every Member of B Has an

Every Member of B Has an Image Under Image Under f f -

  • 1

1

G Let y ∈ B. G Since f is onto, there is a x ∈ A such that f(x) = y. G That is, for any y ∈ B, there is a x ∈ A, such that

I (x,y) ∈ f.

G But (x,y) ∈ f implies (y,x) ∈ f -1.

slide-154
SLIDE 154

Discrete Math. Reading Materials 154

Proof Proof ---

  • -- The Image Under

The Image Under f f -

  • 1

1 is Unique

is Unique

G Let y ∈ B. G Let (y,x), (y,x’) ∈ f -1 .

I We have (x,y), (x’,y) ∈ f. I This gives f(x) = y = f(x’). I But f is 1-1 gives x = x’.

slide-155
SLIDE 155

Discrete Math. Reading Materials 155

Pause and Think ... Pause and Think ...

G Consider A x B = { 1, 2, 3 } x { a, b, c }. G Let f = { (1,a), (2,b), (3,a) }. G Is f a function from A to B? G Is f -1 a function from B to A?

slide-156
SLIDE 156

Discrete Math. Reading Materials 156

Lecture Topics Lecture Topics

G One-To-One (1-1) Functions, Injections G Composition of Injections G Onto Functions, Surjections G Composition of Surjections G One-To-One Correspondences, Bijections G Composition of Bijections G f is a Bijection Implies f Inverse is a Function G f Inverse is a Function Implies f is a Bijection G Properties of Inverse Functions G Some Function Composition Properties

slide-157
SLIDE 157

Discrete Math. Reading Materials 157

Inverse Functions Inverse Functions

G Let f : A → B. G Since f is a function, it is a relation. G We know f -1 is a relation from B to A. G If f -1 is a function, what can we say about f ?

slide-158
SLIDE 158

Discrete Math. Reading Materials 158

Theorem Theorem

G Let f : A → B. G If f -1 is a function, then f is 1-1 and onto.

slide-159
SLIDE 159

Discrete Math. Reading Materials 159

Proof Proof

G Given f -1 : B → A is a function. G We want to show f : A → B is 1-1 and onto. G We need to show

I If f(x) = f(x’), then x = x’. I For any y ∈ B, there is a x ∈ A such that f(x) = y.

slide-160
SLIDE 160

Discrete Math. Reading Materials 160

Proof Proof ---

  • -- f is 1

f is 1-

  • 1

1

G Let f(x) = f(x’) = y. G We have (x,y), (x’,y) ∈ f. G (y,x), (y,x’) ∈ f -1

I But f -1 is a function, so the image of y under it is

unique, that is, x = x’.

G Since x=x’ whenever f(x) = f(x’), f is 1-1.

slide-161
SLIDE 161

Discrete Math. Reading Materials 161

Proof Proof ---

  • -- f is Onto

f is Onto

G For any y ∈ B, let f -1 (y) = x.

I That is, (y,x) ∈ f -1 . I (x,y) ∈ f and thus f(x) = y.

G Since any member of B has a non-empty pre-image

under f, f is onto.

slide-162
SLIDE 162

Discrete Math. Reading Materials 162

Pause and Think ... Pause and Think ...

G Consider A x B = { 1, 2, 3 } x { a, b, c }. G Let f = { (1,a), (2,b), (3,c) }. G Is f a function from A to B? G Is f -1 a function from B to A?

slide-163
SLIDE 163

Discrete Math. Reading Materials 163

Lecture Topics Lecture Topics

G One-To-One (1-1) Functions, Injections G Composition of Injections G Onto Functions, Surjections G Composition of Surjections G One-To-One Correspondences, Bijections G Composition of Bijections G f is a Bijection Implies f Inverse is a Function G f Inverse is a Function Implies f is a Bijection G Properties of Inverse Functions G Some Function Composition Properties

slide-164
SLIDE 164

Discrete Math. Reading Materials 164

The Inverse Image and the Pre The Inverse Image and the Pre-

  • Image

Image

G Let f : A → B and f -1 : B → A. G We have (x,y) ∈ f iff (y,x) ∈ f -1 . G Since both f and f -1 are functions, the above can be

written as

I f(x) = y iff f -1(y) = x.

slide-165
SLIDE 165

Discrete Math. Reading Materials 165

Theorem Theorem

G If the inverse of a function is a function, the inverse

function is a 1-1 correspondence.

G Proof

I Let the function be f and f -1 be a function. I We have (f -1 ) -1 = f is a function. I Since the inverse of f -1 is a function, by a previous

theorem, f -1 is a 1-1 correspondence.

slide-166
SLIDE 166

Discrete Math. Reading Materials 166

Pause and Think ... Pause and Think ...

G Let f : A → B. G Let f(x) = y. G Can we write f -1 (y) = x?

slide-167
SLIDE 167

Discrete Math. Reading Materials 167

Lecture Topics Lecture Topics

G One-To-One (1-1) Functions, Injections G Composition of Injections G Onto Functions, Surjections G Composition of Surjections G One-To-One Correspondences, Bijections G Composition of Bijections G f is a Bijection Implies f Inverse is a Function G f Inverse is a Function Implies f is a Bijection G Properties of Inverse Functions G Some Function Composition Properties

slide-168
SLIDE 168

Discrete Math. Reading Materials 168

Function Composition Function Composition

G Let f : A → B be 1-1 and onto. G We have f -1 : B → A is also 1-1 and onto. G We want to find

I f f -1 I f -1 f I f IA , IB f I IA f-1, f-1 IB

slide-169
SLIDE 169

Discrete Math. Reading Materials 169

f f f f -

  • 1

1

G We have f -1 : B → A, f : A → B. G Let (f f -1)(x) = y.

I f( f -1(x)) = y I f -1(x) = f -1 (y) I But f -1 is a 1-1 correspondence, I so x = y I and f f -1(x) = x.

G That is, f f -1 = IB.

slide-170
SLIDE 170

Discrete Math. Reading Materials 170

f f -

  • 1

1 f

f

G We have f : A → B, f -1 : B → A. G Let (f -1 f )(x) = y.

I f -1( f (x)) = y I f (x) = f (y) I But f is a 1-1 correspondence, I so x = y I and f -1 f(x) = x.

G That is, f -1 f = IA.

slide-171
SLIDE 171

Discrete Math. Reading Materials 171

f I f IA

A

G We have IA: A → A, f : A → B. G Let (f IA)(x) = y.

I f (IA (x)) = y I f (x) = y I (f IA)(x) = f(x)

G That is, f IA = f.

slide-172
SLIDE 172

Discrete Math. Reading Materials 172

I IB

B f

f

G We have f : A → B, IB: B → B. G Let (IB f)(x) = y.

I IB ( f (x)) = y I f (x) = y I (IB f)(x) = f(x)

G That is, IB f = f.

slide-173
SLIDE 173

Discrete Math. Reading Materials 173

Pause and Think ... Pause and Think ...

G What are IA f -1 and f -1 IB?