Upload
hgopalkrishnan
View
216
Download
0
Embed Size (px)
Citation preview
8/2/2019 Disc Math
1/173
Discrete Math. Reading Materials 1
Set s and Funct ionsSet s and Funct ionsReading f or COMP364 and CSI T571Reading f or COMP364 and CSI T571
Cunsheng Ding
Depar t ment of Comput er Science
HKUST, Kowloon, CHI NA
Acknowledgments: Materials from Prof. Sanjain Jain at NUS
8/2/2019 Disc Math
2/173
Discrete Math. Reading Materials 2
Set s and Funct ions f or Cr ypt ogr aphySet s and Funct ions f or Cr ypt ogr aphy
l Set s and f unct ions are basic building blocks of
crypt ogr aphic syst ems. Ther e is no way t o lear ncrypt ogr aphy and comput er secur it y wit hout t he
knowledge of set s and f unct ions.
l Set s and f unct ions ar e cover ed in school mat h.,
and also in any univer sit y course on discret e mat h.
l Every st udent should r ead t his mat er ial as you may
have f or got t en set s and f unct ions even if youlearnt t hem as people do f or get .
8/2/2019 Disc Math
3/173
Discrete Math. Reading Materials 3
Lecture TopicsLecture Topics
l Sets and Members, Equality of Sets
l Set Notation
l The Empty Set and Sets of Numbers
l Subsets and Power Sets
l Equality of Sets by Mutual Inclusion
l Universal Sets, Venn Diagrams
l
Set Operationsl Set Identities
l Proving Set Identities
8/2/2019 Disc Math
4/173
Discrete Math. Reading Materials 4
SetsSets
l A set is a collection of (distinct) objects.
l For example,
1
2
3
ab
8/2/2019 Disc Math
5/173
Discrete Math. Reading Materials 5
Members, ElementsMembers, Elements
l The objects that make up a set are called members
or elements of the set.
l An object can be anything that is meaningful. Forexample,
n a number
n an equation
n a person
n another set
8/2/2019 Disc Math
6/173
Discrete Math. Reading Materials 6
Equality of SetsEquality of Sets
l Two sets are equal iff they have the same members.
n That is, a set is completely determined by its
members.
l This is known as the principle of extension.
8/2/2019 Disc Math
7/173
Discrete Math. Reading Materials 7
Pause and Think ...Pause and Think ...
l Does the statement a set is a collection of objects
define what a set is?
l
Letn the members of set A be -1 and 1,
n the members of set B be the roots of the equation
x2
- 1 = 0.n Are sets A and B equal?
8/2/2019 Disc Math
8/173
Discrete Math. Reading Materials 8
Lecture TopicsLecture Topics
l Sets and Members, Equality of Sets
l Set Notation
l The Empty Set and Sets of Numbers
l Subsets and Power Sets
l Equality of Sets by Mutual Inclusion
l Universal Sets, Venn Diagrams
l
Set Operationsl Set Identities
l Proving Set Identities
8/2/2019 Disc Math
9/173
Discrete Math. Reading Materials 9
The Notation {The Notation { } Describes a Set} Describes a Set
l A set can be described by listing the comma
separated members of the set within a pair of curlybraces.
l An example
n
Let S = { 1, 3, 9 }.n S is a set.
n The members of S are 1, 3, 9.
8/2/2019 Disc Math
10/173
Discrete Math. Reading Materials 10
Order and Repetition Do Not Matter inOrder and Repetition Do Not Matter in
{{ }}l By the principle of extension, a set is determined by
its members.
l For example, the following expressions areequivalent
n { 1, 3, 9 }
n
{ 9, 1, 3 }n { 1, 1, 9, 9, 3, 3, 9, 1 }
n They denote the set whose members are 1, 3, 9.
8/2/2019 Disc Math
11/173
Discrete Math. Reading Materials 11
The Membership SymbolThe Membership Symbol
l The fact that x is a member of S can be expressed as
n x S
l
The membership symbol can be read asn is in, is a member of, belongs to
l An Example
n S = { 7, 13, 21, 47 }
n 7 S, 13 S, 21 S, 47 S
l The negation of is written .
8/2/2019 Disc Math
12/173
Discrete Math. Reading Materials 12
Defining a Set by Membership PropertiesDefining a Set by Membership Properties
l Notation
n S = { x T | P(x) }
n
The members of S are members of a alreadyknown set T that satisfy property P.
l An example
n Let Z be the set of integers.n Let Z+ be the set of positive integers.
n Z+ = { x Z | x > 0 }
8/2/2019 Disc Math
13/173
Discrete Math. Reading Materials 13
Pause and Think ...Pause and Think ...
l Can you simplify the following expression?
n { {2,2}, { {2} }, {1,1,1}, 1 , { 1 } , 2, 2 }
l What does the following expression say?
n X = { X }
l Find an expression equivalent to S = { . . . , x , . . . }.
8/2/2019 Disc Math
14/173
Discrete Math. Reading Materials 14
Lecture TopicsLecture Topics
l Sets and Members, Equality of Sets
l Set Notation
l The Empty Set and Sets of Numbers
l Subsets and Power Sets
l Equality of Sets by Mutual Inclusion
l Universal Sets, Venn Diagrams
l
Set Operationsl Set Identities
l Proving Set Identities
8/2/2019 Disc Math
15/173
Discrete Math. Reading Materials 15
The Empty SetThe Empty Set
l The empty set is also called the null set.
l
It is the set that has no members.
l It is denoted as .
l Clearly, = { }.
l For any object x, x .
8/2/2019 Disc Math
16/173
Discrete Math. Reading Materials 16
The Sets of Positive, Negative, and AllThe Sets of Positive, Negative, and All
IntegersIntegers
l Z = The set of (all) integers
n Z = { . . . , -2, -1, 0, 1, 2, . . . }
l Z+ = The set of (all) positive integers
n Z+ = { 1, 2, 3, }
n Z+ = { x Z | x > 0 }
l Z- = The set of (all) negative integersn Z- = { . . . , -3, -2, -1 } = { -1, -2, -3, }
n Z- = { x Z | x < 0 }
8/2/2019 Disc Math
17/173
Discrete Math. Reading Materials 17
The Set of Real NumbersThe Set of Real Numbers
l R = The set of (all) real numbers
8/2/2019 Disc Math
18/173
Discrete Math. Reading Materials 18
The Set of Rational NumbersThe Set of Rational Numbers
l Q = The set of (all) rational numbers.
l Q= { x
R| x = p/q; p,q
Z; q 0 }
8/2/2019 Disc Math
19/173
Discrete Math. Reading Materials 19
Pause and Think ...Pause and Think ...
l What is the set of natural numbers?
8/2/2019 Disc Math
20/173
Discrete Math. Reading Materials 20
Lecture TopicsLecture Topics
l Sets and Members, Equality of Sets
l Set Notation
l The Empty Set and Sets of Numbers
l Subsets and Power Sets
l Equality of Sets by Mutual Inclusion
l Universal Sets, Venn Diagrams
l
Set Operationsl Set Identities
l Proving Set Identities
8/2/2019 Disc Math
21/173
Discrete Math. Reading Materials 21
SubsetsSubsets
l A is a subset of B, or B is a superset of A iff every
member of A is a member of B.
l Notationally,
n A B iff x, if x A, then x B.
l An example
n { -2, 0, 8 } { -3, -2, -1, 0, 2, 4, 6, 8, 10 }
8/2/2019 Disc Math
22/173
Discrete Math. Reading Materials 22
Negation ofNegation of
l 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.
l Notationally
n A B iff x, x A and x B.
l Examplen { 2, 4 } { 2, 3 }
8/2/2019 Disc Math
23/173
Discrete Math. Reading Materials 23
Obvious SubsetsObvious Subsets
l S S
l S
l Vacuously true
n The implication if x , then x S is true
l By contradiction,
n If S, then x, x and x S.
8/2/2019 Disc Math
24/173
Discrete Math. Reading Materials 24
Proper SubsetsProper Subsets
l A is a proper subset of B, or B is a proper superset
of A iff A is a subset of B and A is not equal to B.
l Notationally
n A B iff A B and A B
l Examples
n If S , then S.
n Z+ Z Q R
8/2/2019 Disc Math
25/173
Discrete Math. Reading Materials 25
Power SetsPower Sets
l The set of all subsets of a set is called the power set
of the set.
l The power set of S is P(S).
l Examples
n P( ) = { }
n P( { 1, 2 } ) = { , { 1 }, { 2 }, { 1, 2 } }
n P( S ) = { , , S }
8/2/2019 Disc Math
26/173
Discrete Math. Reading Materials 26
andand are Different.are Different.
l Examples
n 1 { 1 } is true
n 1 { 1 } is false
n { 1 } { 1 } is true
8/2/2019 Disc Math
27/173
Discrete Math. Reading Materials 27
Pause and Think ...Pause and Think ...
l Which of the following statements is true?
n S P(S)
n S P(S)
l What is P( { 1, 2, 3 } )?
8/2/2019 Disc Math
28/173
Discrete Math. Reading Materials 28
Lecture TopicsLecture Topics
l Sets and Members, Equality of Sets
l Set Notation
l The Empty Set and Sets of Numbers
l Subsets and Power Sets
l Equality of Sets by Mutual Inclusion
l Universal Sets, Venn Diagrams
l Set Operations
l Set Identities
l Proving Set Identities
8/2/2019 Disc Math
29/173
Discrete Math. Reading Materials 29
Mutual InclusionMutual Inclusion
l Sets A and B have the same members iff they
mutually include
n A B and B A
l That is, A = B iff A B and B A.
8/2/2019 Disc Math
30/173
Discrete Math. Reading Materials 30
Equality by Mutual InclusionEquality by Mutual Inclusion
l Mutual inclusion is very useful for proving the equality
of two sets.
l To prove an equality, we prove two subset
relationships.
8/2/2019 Disc Math
31/173
Discrete Math. Reading Materials 31
An Example Showing the Equality of SetsAn Example Showing the Equality of Sets
l Recall that Z = The set of (all) integers.
l Let A = { x Z | x = 2 m for some m Z }
l Let B = { y Z | y = 2 n - 2 for some n Z }l To show A B, note that
n 2m = 2(m+1) - 2 = 2n-2
l To show B A, note that
n 2n-2 = 2(n-1) = 2m
l That is, A = B.
l In fact, A, B both denote the set of even integers.
8/2/2019 Disc Math
32/173
Discrete Math. Reading Materials 32
Pause and Think ...Pause and Think ...
l Let
n A = { x Z | x2 - 1 = 0 }
n B = { x Z | 2 x3 - x2 - 2 x + 1 = 0 }
n Show that A = B by the method of mutual
inclusion.
8/2/2019 Disc Math
33/173
Discrete Math. Reading Materials 33
Lecture TopicsLecture Topics
l Sets and Members, Equality of Sets
l Set Notation
l The Empty Set and Sets of Numbers
l Subsets and Power Sets
l Equality of Sets by Mutual Inclusion
l Universal Sets, Venn Diagrams
l Set Operations
l Set Identities
l Proving Set Identities
8/2/2019 Disc Math
34/173
Discrete Math. Reading Materials 34
Universal SetsUniversal Sets
l Depending on the context of discussion,
n define a set U such that all sets of interest are
subsets of U.
n The set U is known as a universal set.
l For example,
n when dealing with integers, U may be Z
n when dealing with plane geometry, U may be theset of all points in the plane
8/2/2019 Disc Math
35/173
Discrete Math. Reading Materials 35
Venn DiagramsVenn Diagrams
l To visualise relationships among some sets
l Each subset (of U) is represented by a circle inside
the rectangle
8/2/2019 Disc Math
36/173
Discrete Math. Reading Materials 36
Pause and Think ...Pause and Think ...
l If Z is a universal set, can we replace Z by R as the
universal set?
8/2/2019 Disc Math
37/173
Discrete Math. Reading Materials 37
Lecture TopicsLecture Topics
l Sets and Members, Equality of Sets
l Set Notation
l The Empty Set and Sets of Numbers
l Subsets and Power Sets
l Equality of Sets by Mutual Inclusion
l Universal Sets, Venn Diagrams
l Set Operations
l Set Identities
l Proving Set Identities
8/2/2019 Disc Math
38/173
Discrete Math. Reading Materials 38
Set OperationsSet Operations
l Let A, B be subsets of some universal set U.
l The following set operations create new sets from A
and B.
l Union
n A B = { x U | x A or x B }
l Intersection
n A B = { x U | x A and x B }
l Differencen A - B = A \ B = { x U | x A and x B }
l Complement
n Ac = U - A = { x U | x A }
8/2/2019 Disc Math
39/173
Discrete Math. Reading Materials 39
Set UnionSet Union
l An example
n { 1, 2, 3 } { 2, 3, 4, 5 } = { 1, 2, 3, 4, 5 }
l the Venn diagram
1
2
3
4
5
8/2/2019 Disc Math
40/173
Discrete Math. Reading Materials 40
Set IntersectionSet Intersection
l An example
n { 1, 2, 3 } { 2, 3, 4, 5 } = { 2, 3 }
l the Venn diagram
1
2
3
4
5
8/2/2019 Disc Math
41/173
Discrete Math. Reading Materials 41
Set DifferenceSet Difference
l An example
n { 1, 2, 3 } - { 2, 3, 4, 5 } = { 1 }
l
the Venn diagram
1
2
3
4
5
8/2/2019 Disc Math
42/173
Discrete Math. Reading Materials 42
Set ComplementSet Complement
l The Venn diagram
8/2/2019 Disc Math
43/173
Discrete Math. Reading Materials 43
Pause and Think ...Pause and Think ...
l Let A B.
n What is A - B?
n What is B - A?
l If A, B C, what can you say about A B and C?
l If C A, B, what can you say about C and A B?
8/2/2019 Disc Math
44/173
Discrete Math. Reading Materials 44
Lecture TopicsLecture Topics
l Sets and Members, Equality of Sets
l Set Notation
l The Empty Set and Sets of Numbers
l Subsets and Power Sets
l Equality of Sets by Mutual Inclusion
l Universal Sets, Venn Diagrams
l Set Operations
l Set Identities
l Proving Set Identities
8/2/2019 Disc Math
45/173
Discrete Math. Reading Materials 45
Basic Set IdentitiesBasic Set Identities
l Commutative laws
n A B = B A
n A B = B A
l Associative laws
n (A B) C = A (B C)
n (A B) C = A (B C)
l Distributive lawsn A (B C) = (A B) (A C)
n A (B C) = (A B) (A C)
8/2/2019 Disc Math
46/173
Discrete Math. Reading Materials 46
Basic Set Identities (continued)Basic Set Identities (continued)
l is the identity for union
n A = A = A
l U is the identity for intersection
n A U = U A = A
l Double complement law
n (Ac)c = A
l Idempotent lawsn A A = A
n A A = A
8/2/2019 Disc Math
47/173
Discrete Math. Reading Materials 47
Basic Set Identities (continued)Basic Set Identities (continued)
l De Morgans laws
n (A B)c = Ac Bc
n (A B)c = Ac Bc
8/2/2019 Disc Math
48/173
Discrete Math. Reading Materials 48
Pause and Think ...Pause and Think ...
l What is
n (AB) (AB)?
l What is
n (AB) (AB)?
8/2/2019 Disc Math
49/173
Discrete Math. Reading Materials 49
Lecture TopicsLecture Topics
l Sets and Members, Equality of Sets
l Set Notation
l The Empty Set and Sets of Numbers
l Subsets and Power Sets
l Equality of Sets by Mutual Inclusion
l Universal Sets, Venn Diagrams
l Set Operations
l Set Identities
l Proving Set Identities
8/2/2019 Disc Math
50/173
Discrete Math. Reading Materials 50
Proof MethodsProof Methods
l There are many ways to prove set identities.
l The methods include
n applying existing identities,
n building a membership table,
n using mutual inclusion.
8/2/2019 Disc Math
51/173
Discrete Math. Reading Materials 51
A Proof by Mutual InclusionA Proof by Mutual Inclusion
l Prove that (A B) C = A (B C).
l First show that (A B) C A (B C).
l
Let x (A B) C,n x (A B) and x C
n x A and x B and x C
n x A and x ( B C )
n x A (B C)
l Then show that A (B C) (A B) C.
8/2/2019 Disc Math
52/173
Discrete Math. Reading Materials 52
Pause and Think ...Pause and Think ...
l To prove that A Ac = U by mutual inclusion, do you
have to prove the inclusion A U Ac U?
l To prove that A Ac = by mutual inclusion, do youhave to prove the inclusion A Ac?
8/2/2019 Disc Math
53/173
Discrete Math. Reading Materials 53
Lecture TopicsLecture Topics
l From High School Functions to General Functions
l Function Notation
l Values, images, inverse images, pre-images
l Codomains, Domains, Ranges
l Sets of Images and Pre-Images
l Equality of Functions
l Some Special Functions
l Unary and Binary Operations as Functions
l The Composition of Two Functions is a Function
l The Values of Function Composition
8/2/2019 Disc Math
54/173
Discrete Math. Reading Materials 54
High SchoolHigh School FunctionsFunctions
l Functions are usually given by formulas.
l Examples
n f(x) = sin(x)
n f(x) = ex
n f(x) = xn
n f(x) = log x
l A function is a computation rule that changes onevalue to another value.
l Effectively, a function associates, or relates, onevalue to another value.
8/2/2019 Disc Math
55/173
Discrete Math. Reading Materials 55
GeneralGeneral FunctionsFunctions
l Since a function relates one value to another, we can
think of a function as relating one object to anotherobject. Objects need not be numbers.
l In the previous examples, the function f relates theobject x to the object f(x).
l Usually we want to be able to relate each object of
interest to only one object.
l That is, a function is a single-valued and exhaustiverelation.
8/2/2019 Disc Math
56/173
Discrete Math. Reading Materials 56
FunctionsFunctions
l A relation f from A to B is a function from A to B iff
n for every x A, there exists a unique y B such
that x f y, or equivalently, (x,y) f.
l Functions are also known as transformations, maps,and mappings.
8/2/2019 Disc Math
57/173
Discrete Math. Reading Materials 57
Example 1Example 1
l Let A = { 1, 2, 3 } and B = { a, b }.
l R = { (1,a), (2,a), (3,b) } is a function from A to B.
1
2
3
a
b
8/2/2019 Disc Math
58/173
Discrete Math. Reading Materials 58
Example 2Example 2
l Let A = { 1, 2, 3 } and B = { a, b }.
l S = { (1,a), (1,b), (2,a), (3,b) } is not a function from A
to B.
1
2
3
a
b
8/2/2019 Disc Math
59/173
Discrete Math. Reading Materials 59
Example 3Example 3
l Let A = { 1, 2, 3 } and B = { a, b }.
l T = { (1,a), (3,b) } is not a function from A to B.
1
2
3
a
b
8/2/2019 Disc Math
60/173
Discrete Math. Reading Materials 60
Pause and Think ...Pause and Think ...
l Is A x { a }, where a A, a function from A to A?
8/2/2019 Disc Math
61/173
Discrete Math. Reading Materials 61
Lecture TopicsLecture Topics
l From High School Functions to General Functions
l Function Notation
l Values, images, inverse images, pre-images
l Codomains, Domains, Ranges
l Sets of Images and Pre-Images
l Equality of Functions
l Some Special Functions
l Unary and Binary Operations as Functions
l The Composition of Two Functions is a Function
l The Values of Function Composition
8/2/2019 Disc Math
62/173
Discrete Math. Reading Materials 62
Function NotationFunction Notation
l Let f be a relation from A to B. That is, f AxB.
l If the relation f is a function,
n we write f : A B.
n If (x,y) f, we write y = f(x).
l Usually we use f, g, h, to denote relations that arefunctions.
8/2/2019 Disc Math
63/173
Discrete Math. Reading Materials 63
Notational ConventionNotational Convention
l Sometimes functions are given by stating the rule of
transformation, for example, f(x) = x+1.
l This should be taken to mean
n f = { (x,f(x)) AxB | x A }
n where A and B are some understood sets.
8/2/2019 Disc Math
64/173
Discrete Math. Reading Materials 64
Pause and Think ...Pause and Think ...
l Let f A x B be a relation and (x,y) f.
l Does the expression f(x) = y make sense?
8/2/2019 Disc Math
65/173
Discrete Math. Reading Materials 65
Lecture TopicsLecture Topics
l From High School Functions to General Functions
l Function Notation
l Values, images, inverse images, pre-images
l Codomains, Domains, Rangesl Sets of Images and Pre-Images
l Equality of Functions
l Some Special Functions
l Unary and Binary Operations as Functions
l The Composition of Two Functions is a Function
l The Values of Function Composition
8/2/2019 Disc Math
66/173
Discrete Math. Reading Materials 66
Values, ImagesValues, Images
l Let f : A B.
l Let y = f(x).
n That is, x f y, equivalently, (x,y) f.
l The object y is called
n the image of x under the function f, orn the value of f at x.
8/2/2019 Disc Math
67/173
Discrete Math. Reading Materials 67
Inverse Images, PreInverse Images, Pre--imagesimages
l Let f : A B and y B.
l Define
n f -1(y) = { x A | f(x) = y }
l The set f -1(y) is called the inverse image, or pre-
image of y under f.
8/2/2019 Disc Math
68/173
Discrete Math. Reading Materials 68
Images and PreImages and Pre--images of Subsetsimages of Subsets
l Let f : A B and X A and Y B.
l We define
n f(X) = { f(x) B | x X }
n f-1
(Y) = { x A | f(x) Y }
8/2/2019 Disc Math
69/173
Discrete Math. Reading Materials 69
ExamplesExamples
l Let f : A B be given as follows
l f( {1,3} ) = { c, d }
l f -1( { a, d } ) = { 3 }
1
2
3
abcd
e
8/2/2019 Disc Math
70/173
Discrete Math. Reading Materials 70
Some PropertiesSome Properties
l Let f : A B and X A and Y B.
l Clearly we have
n f(A) B
n f-1
(B) = A because every element of A has animage in B
8/2/2019 Disc Math
71/173
Discrete Math. Reading Materials 71
Pause and Think ...Pause and Think ...
l Let f : A B and X A and Y B.
l If there are n elements in X, how many elements are
there in f(X)?
l If there are n elements in Y, how many elements arethere in f -1 (Y)?
8/2/2019 Disc Math
72/173
Discrete Math. Reading Materials 72
Lecture TopicsLecture Topics
l From High School Functions to General Functions
l Function Notation
l Values, images, inverse images, pre-images
l Codomains, Domains, Rangesl Sets of Images and Pre-Images
l Equality of Functions
l Some Special Functions
l Unary and Binary Operations as Functions
l The Composition of Two Functions is a Function
l The Values of Function Composition
8/2/2019 Disc Math
73/173
Discrete Math. Reading Materials 73
DomainsDomains
l Let f : A B.
l The domain of function f is the set A.
8/2/2019 Disc Math
74/173
Discrete Math. Reading Materials 74
CodomainsCodomains and Rangesand Ranges
l Let f : A B.
l The codomain of function f is the set B.
l The range of function f is the set of images of f.
n
Clearly, the range of f is f(A).
8/2/2019 Disc Math
75/173
Discrete Math. Reading Materials 75
Example 1Example 1
l The domain is { 1, 2, 3 }.
l The codomain is { p, q, r, s }.
l The range is { p, r }.
1
2
3
p
q
r
s
f
8/2/2019 Disc Math
76/173
Discrete Math. Reading Materials 76
Example 2Example 2
l Consider exp : R R. That is, exp(x) = ex.
l The domain and codomain of exp are both R.
l The range of exp is R+, the set of positive real
numbers.
8/2/2019 Disc Math
77/173
Discrete Math. Reading Materials 77
Pause and Think ...Pause and Think ...
l Consider cos : R R.
l What are the domain, codomain, and range of cos?
8/2/2019 Disc Math
78/173
Discrete Math. Reading Materials 78
Lecture TopicsLecture Topics
l From High School Functions to General Functions
l Function Notation
l Values, images, inverse images, pre-images
l Codomains, Domains, Rangesl Sets of Images and Pre-Images
l Equality of Functions
l Some Special Functions
l Unary and Binary Operations as Functions
l The Composition of Two Functions is a Function
l The Values of Function Composition
8/2/2019 Disc Math
79/173
Discrete Math. Reading Materials 79
Images and PreImages and Pre--images of Subsetsimages of Subsets
l Let f : A B.
l Let X, X A and Y, Y B.
l We shall call f(X) the image of X instead of the set of
images of members of X. Similarly, we shall simplycall f -1(Y) the preimage of Y.
l We have
n f( f -1 (Y)) Y and X f -1 (f(X))
n f(X X) = f(X) f(X), f(X X) f(X) f(X)
n f -1 (Y Y) = f -1 (Y) f -1 (Y)
n f -1 (Y Y) = f -1 (Y) f -1 (Y)
8/2/2019 Disc Math
80/173
Discrete Math. Reading Materials 80
f( ff( f--11 (Y))(Y)) YY
l It is possible to have strict inclusion.
n When the range of f is a proper subset of its
codomain, we may take Y = B to obtain
n f( f -1 (B)) = f( A ) B
l To show inclusion,
n let y f( f -1 (Y)).
n x f -1 (Y) such that f(x) = y.
n We have f(x) Y.
n That is, y Y
8/2/2019 Disc Math
81/173
Discrete Math. Reading Materials 81
f(Xf(X XX) = f(X)) = f(X) f(Xf(X))
l We can easily show that
n f(X X) f(X) f(X).
l This is because X X X, so
n f(X X) f(X).
l
Similarly, we have f(X X) f(X).
l Consequently, f(X X) f(X) f(X).
8/2/2019 Disc Math
82/173
Discrete Math. Reading Materials 82
f(Xf(X XX) = f(X)) = f(X) f(Xf(X))
l To show f(X X) f(X) f(X),
n let y f(X X).
l x X X such that f(x) = y.
l If x X, then y f(X); otherwise, y f(X). This
means y f(X) f(X).
l That is, f(X X) f(X) f(X).
8/2/2019 Disc Math
83/173
Discrete Math. Reading Materials 83
Pause and Think ...Pause and Think ...
l What do the given set expressions become when f is
the identity function?
8/2/2019 Disc Math
84/173
Discrete Math. Reading Materials 84
Lecture TopicsLecture Topics
l From High School Functions to General Functions
l Function Notation
l Values, images, inverse images, pre-images
l Codomains, Domains, Rangesl Sets of Images and Pre-Images
l Equality of Functions
l Some Special Functions
l Unary and Binary Operations as Functions
l The Composition of Two Functions is a Function
l The Values of Function Composition
8/2/2019 Disc Math
85/173
Discrete Math. Reading Materials 85
Equality of FunctionsEquality of Functions
l Let f : A B and g : C D.
l We define function f = function g iff
n set f = set g
l Note that this forces A = C but allows B D.
n Some require B = D as well.
8/2/2019 Disc Math
86/173
Discrete Math. Reading Materials 86
A Proof that Set f = Set g Implies DomainA Proof that Set f = Set g Implies Domain
f = Domain gf = Domain g
l Let f : A B and g : C D and set f = set g.
l Let x A.
n (x,f(x)) f
n But f = g as sets
n (x,f(x)) g
n That is x C.
n
Consequently, A C.l Similarly, we have C A.
l That is, A = C.
8/2/2019 Disc Math
87/173
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 xg(x) for all x AA
l Let f, g : A B and set f = set g.
l Let x A.
n (x,f(x)) f
n But f = g as sets
n (x,f(x)) g
n That is (x,f(x)), (x,g(x)) g.
n
Since g is a function, so f(x) = g(x).
8/2/2019 Disc Math
88/173
Discrete Math. Reading Materials 88
ExampleExample
l We consider
n exp : R R and
n exp : [0,1] R
n as two different functions though the computation
rule is the same --- exp(x) = ex.
8/2/2019 Disc Math
89/173
Discrete Math. Reading Materials 89
Pause and Think ...Pause and Think ...
l Let f and g be functions such that f(x) = g(x) on some
set A. Can we conclude that function f = function g?
8/2/2019 Disc Math
90/173
Discrete Math. Reading Materials 90
Lecture TopicsLecture Topics
l From High School Functions to General Functions
l Function Notation
l Values, images, inverse images, pre-images
l Codomains, Domains, Rangesl Sets of Images and Pre-Images
l Equality of Functions
l Some Special Functions
l Unary and Binary Operations as Functions
l The Composition of Two Functions is a Function
l The Values of Function Composition
8/2/2019 Disc Math
91/173
Discrete Math. Reading Materials 91
Identity FunctionsIdentity Functions
l Consider the identity relation IA on the set A.
l Clearly, for every x A, IA relates x to an unique
element of A that is itself.
l Consequently, we have IA : A A .
l IA is also called the identity function on A.
8/2/2019 Disc Math
92/173
Discrete Math. Reading Materials 92
Constant FunctionsConstant Functions
l Let f : A B.
l If f(A) = { y } for some y B, f is called a constant
function of value y.
.
.
.y
f.
.
.
.
.
.
8/2/2019 Disc Math
93/173
Discrete Math. Reading Materials 93
Characteristics FunctionsCharacteristics Functions
l Consider some universal set U.
l Let A U.
l The function A : U { 0, 1 } defined by
n A(x) = 1, if x A,
n
A(x) = 0, if x Ac
;n is called the characteristic function of A.
8/2/2019 Disc Math
94/173
Discrete Math. Reading Materials 94
Pause and Think ...Pause and Think ...
l Let f : R R.
n If f is a constant function, what does its graph on
the Cartesian X-Y plane look like?
n If f is the identity function, what does its graph onthe Cartesian X-Y plane look like?
8/2/2019 Disc Math
95/173
Discrete Math. Reading Materials 95
Lecture TopicsLecture Topics
l From High School Functions to General Functions
l Function Notation
l Values, images, inverse images, pre-images
l Codomains, Domains, Rangesl Sets of Images and Pre-Images
l Equality of Functions
l Some Special Functions
l Unary and Binary Operations as Functions
l The Composition of Two Functions is a Function
l The Values of Function Composition
8/2/2019 Disc Math
96/173
Discrete Math. Reading Materials 96
Unary OperationsUnary Operations
l A unary operation on a set A acts on an element of A
and produces another element of A.
l Clearly, a unary operation uop can be thought of as afunction f : A A with f(x) = uop( x ).
l Conversely, a function from A to A can be regarded
as a unary operation on A.
8/2/2019 Disc Math
97/173
Discrete Math. Reading Materials 97
Example 1Example 1
l Let U be some universal set.
l The complement operation on P(U) can be
represented as a function
n f: P(U) P(U) with f(A) = Ac.
8/2/2019 Disc Math
98/173
Discrete Math. Reading Materials 98
Binary OperationsBinary Operations
l A binary operation on a set A acts on two elements of
A and produces another element of A.
l Clearly, a binary operation bop can be representedas a function
n f : AxA A with f((a,b)) = a bop b.
n We write f(a,b) instead of f((a,b)).
l Conversely, a function from AxA to A can beregarded as a binary operation on A.
8/2/2019 Disc Math
99/173
Discrete Math. Reading Materials 99
Example 1Example 1
l Let U be some universal set.
l The union operation on P(U) can be represented as a
function f: P(U)xP(U) P(U) with f(A,B) = AB.
8/2/2019 Disc Math
100/173
Discrete Math. Reading Materials 100
Pause and Think ...Pause and Think ...
l Let U = { 0, 1 }.
l Give the set representations of the functions for
unary complement operation and the binaryintersection operation.
8/2/2019 Disc Math
101/173
Discrete Math. Reading Materials 101
Lecture TopicsLecture Topics
l From High School Functions to General Functions
l Function Notation
l Values, images, inverse images, pre-images
l Codomains, Domains, Rangesl Sets of Images and Pre-Images
l Equality of Functions
l Some Special Functions
l Unary and Binary Operations as Functions
l The Composition of Two Functions is a Function
l The Values of Function Composition
8/2/2019 Disc Math
102/173
Discrete Math. Reading Materials 102
Function CompositionFunction Composition
l Let f : A B and g : B C.
l Since relations can be composed and functions are
relations, so functions can be composed like relation
composition.l So relations f and g can be composed and their
composition is gf.
l Clearly gf is a relation from A to C.
l But is gf a function?
8/2/2019 Disc Math
103/173
Discrete Math. Reading Materials 103
Function Composition Gives a FunctionFunction Composition Gives a Function
l Let f : A B and g : B C.
l We want to show that gf : A C.
n That is, the composition of two functions is again a
function.
l We have to show for any x A, there is a unique z C, such that (x,z) gf.
8/2/2019 Disc Math
104/173
Discrete Math. Reading Materials 104
ExistencyExistency ProofProof
l Let x A.
l Since f is a function from A to B, there is a unique
y B such that (x,y) f.
l For this y B, there is a unique z C such that(y,z) g because g is a function from B to C.
l That is, (x,z) gf.
8/2/2019 Disc Math
105/173
Discrete Math. Reading Materials 105
Uniqueness ProofUniqueness Proof
l Let (x,z), (x,z) gf.
l There exist y, y B such that
n (x,y) f, (y,z) g
n (x,y) f, (y,z) g
l But f is a function, so y = y.
l Now we have (y,z), (y,z) g.
l But g is a function, so z = z.
8/2/2019 Disc Math
106/173
Discrete Math. Reading Materials 106
Pause and Think ...Pause and Think ...
l Can you compose cos and log to obtain the
composition (log cos)?
l Can you compose log and exp to obtain thecomposition (exp log)?
8/2/2019 Disc Math
107/173
Discrete Math. Reading Materials 107
Lecture TopicsLecture Topics
l From High School Functions to General Functions
l Function Notation
l Values, images, inverse images, pre-images
l Codomains, Domains, Rangesl Sets of Images and Pre-Images
l Equality of Functions
l Some Special Functions
l Unary and Binary Operations as Functions
l The Composition of Two Functions is a Function
l The Values of Function Composition
8/2/2019 Disc Math
108/173
8/2/2019 Disc Math
109/173
Discrete Math. Reading Materials 109
The Values of Function CompositionsThe Values of Function Compositions
l Let f : A B, g : B C, h : C D.
l Since relation composition are associative and
functions are relations, we have
n h(gf) = (hg)fl Furthermore, we have
n (h(gf))(x) = h( (gf)(x) ) = h( g ( f(x) ) )
n and
n ((hg)f)(x) = (hg)(f(x)) = h( g ( f(x) ) )
l That is,
n (h(gf))(x) = ((hg)f)(x) = h(g(f(x)))
8/2/2019 Disc Math
110/173
Discrete Math. Reading Materials 110
Pause and Think ...Pause and Think ...
l Let f(x) = x+1, g(x) = x2, and h(x) = 1/(1+x2) be
functions R from to R.
n Is hgf a function?
n If so, what is the value of (hgf)(x)?
8/2/2019 Disc Math
111/173
Discrete Math. Reading Materials 111
Lecture TopicsLecture Topics
l One-To-One (1-1) Functions, Injections
l Composition of Injections
l Onto Functions, Surjections
l Composition of Surjectionsl One-To-One Correspondences, Bijections
l Composition of Bijections
l f is a Bijection Implies f Inverse is a Function.
l f Inverse is a Function Implies f is a Bijection
l Properties of Inverse Functions
l Some Function Composition Properties
8/2/2019 Disc Math
112/173
Discrete Math. Reading Materials 112
OneOne--ToTo--One Functions, InjectionsOne Functions, Injections
l Let f : A B.
l The function f is one-to-one iff
n for any x, x A,
n if f(x) = f(x) then x = x
n Equivalently,
n if x x then f(x) f(x).
l In words, a function is one-to-one iff it maps distinct
elements to distinct images.
l A one-to-one function is also called an injection.
l We abbreviate one-to-one as 1-1.
8/2/2019 Disc Math
113/173
Discrete Math. Reading Materials 113
Example 1Example 1
l Let A = { 1, 2, 3 }.
l Let B = { a, b, c, d, e }
l Let f = { (1,a), (2,b), (3,a) }
l The function f is not 1-1 because
n f(1) = f(3) = a but1 3
123
a
bcd
e
8/2/2019 Disc Math
114/173
Discrete Math. Reading Materials 114
Example 2Example 2
l Let A = { 1, 2, 3 }.
l Let B = { a, b, c, d, e }
l Let f = { (1,e), (2,b), (3,c) }
l The function f is 1-1 because
n if x y, then f(x) f(y)
123
a
bcd
e
8/2/2019 Disc Math
115/173
Discrete Math. Reading Materials 115
Example 3Example 3
l Let f : Z Z with f(x) = x2.
l The function f is not 1-1 because f(x) = f(-x).
l Let g : Z+ Z with g(x) = x2.
l The function g is 1-1 because x2 = y2 implies x = y.
8/2/2019 Disc Math
116/173
Discrete Math. Reading Materials 116
Pause and Think ...Pause and Think ...
l How many 1-1 functions are there from {1,2,3} to
itself?
8/2/2019 Disc Math
117/173
Discrete Math. Reading Materials 117
Lecture TopicsLecture Topics
l One-To-One (1-1) Functions, Injections
l Composition of Injections
l Onto Functions, Surjections
l Composition of Surjectionsl One-To-One Correspondences, Bijections
l Composition of Bijections
l f is a Bijection Implies f Inverse is a Function
l f Inverse is a Function Implies f is a Bijection
l Properties of Inverse Functions
l Some Function Composition Properties
8/2/2019 Disc Math
118/173
Discrete Math. Reading Materials 118
Composition of OneComposition of One--ToTo--One FunctionsOne Functions
l Theorem
n Let f : A B, g : B C.
n If both f and g are 1-1, then g f is also 1-1.
l That is, the composition of 1-1 functions is again 1-1.
8/2/2019 Disc Math
119/173
Discrete Math. Reading Materials 119
ProofProof
l Let (gf)(x) = (gf)(y)
l g(f(x)) = g(f(y))
l Since g is 1-1, f(x) = f(y)
l Since f is 1-1, x = y
l That is, gf is a 1-1 function.
8/2/2019 Disc Math
120/173
Discrete Math. Reading Materials 120
The Converse is Almost TrueThe Converse is Almost True
l Let f : A B, g : B C. Let gf : A C be 1-1.
l Then f is 1-1 but g need not be 1-1.
l
Proofn Let f(x) = f(y)
n Then g(f(x)) = g(f(y))
n (gf)(x) = (gf)(y)
n x = yn That is, f is 1-1.
8/2/2019 Disc Math
121/173
Discrete Math. Reading Materials 121
The Converse is FalseThe Converse is False
l Let f : A B, g : B C. Let gf : A C be 1-1.
l The following is an example that g is not 1-1.
1
a
b2
A B C
f g
8/2/2019 Disc Math
122/173
Discrete Math. Reading Materials 122
Pause and Think ...Pause and Think ...
l Let f : A B, g : B C. Let gf : A C be not 1-1.
n Are f and g both not 1-1?
L T i
8/2/2019 Disc Math
123/173
Discrete Math. Reading Materials 123
Lecture TopicsLecture Topics
l One-To-One (1-1) Functions, Injections
l Composition of Injections
l Onto Functions, Surjections
l Composition of Surjectionsl One-To-One Correspondences, Bijections
l Composition of Bijections
l f is a Bijection Implies f Inverse is a Function
l f Inverse is a Function Implies f is a Bijection
l Properties of Inverse Functions
l Some Function Composition Properties
O F iO F i S j iS j i
8/2/2019 Disc Math
124/173
Discrete Math. Reading Materials 124
Onto Functions,Onto Functions, SurjectionsSurjections
l Let f : A B.
l The function f is onto iff
n for any y B,
n there exists some x A,
n such that f(x) = y.
l In words, a function is onto iff every element in the
codomain has a non-empty pre-image.
l A onto function is also called a surjection.
O M R iO t M R i C d iC d i
8/2/2019 Disc Math
125/173
Discrete Math. Reading Materials 125
Onto Means Range isOnto Means Range is CodomainCodomain
l Let f : A B be onto.
l Onto implies B f(A).
l Proof
n Let y B.
n There exists x A such that f(x) = y.
n y f(A)
n That is, B f(A).
l But f(A) B.
l That is, B = f(A).
E l 1E l 1
8/2/2019 Disc Math
126/173
Discrete Math. Reading Materials 126
Example 1Example 1
l Let A = { 1, 2, 3 } and B = { a, b, c, d, e }
l Let f = { (1,a), (2,a), (3,a) }
l The function f is not onto because there is a b B
without any x A such that f(x) = b.
1
23
a
bcd
e
8/2/2019 Disc Math
127/173
E l 3E l 3
8/2/2019 Disc Math
128/173
Discrete Math. Reading Materials 128
Example 3Example 3
l Let f : Z Z with f(x) = x2.
n The function f is not onto because there is no
integer x such that f(x) = -1.
l Let g : Z Z+ with g(x) = |x| + 1.
n It is not hard to check that g is onto.
P d Thi kP d Thi k
8/2/2019 Disc Math
129/173
Discrete Math. Reading Materials 129
Pause and Think ...Pause and Think ...
l Let g : Z Z+ with g(x) = |x|+2. Is g onto?
L t T iL t T i
8/2/2019 Disc Math
130/173
Discrete Math. Reading Materials 130
Lecture TopicsLecture Topics
l One-To-One (1-1) Functions, Injections
l Composition of Injections
l Onto Functions, Surjections
l Composition of Surjectionsl One-To-One Correspondences, Bijections
l Composition of Bijections
l f is a Bijection Implies f Inverse is a Function
l f Inverse is a Function Implies f is a Bijection
l Properties of Inverse Functions
l Some Function Composition Properties
C iti f O t F tiC m iti f O t F ti
8/2/2019 Disc Math
131/173
Discrete Math. Reading Materials 131
Composition of Onto FunctionsComposition of Onto Functions
l Theorem
n Let f : A B, g : B C.
n If both f and g are onto, then g f is also onto.
l That is, the composition of onto functions is again
onto.
P fProof
8/2/2019 Disc Math
132/173
Discrete Math. Reading Materials 132
ProofProof
l Let z C.
l Since g : B C is onto, there is a y B such that
n g(y) = z.
l
Since f : A B is onto, there is a x A such thatn f(x) = y.
l Combining, we have
n (gf)(x) = g(f(x)) = g(y) = z
l That is, the composition gf is onto.
The Converse is Almost TrueThe Converse is Almost True
8/2/2019 Disc Math
133/173
Discrete Math. Reading Materials 133
The Converse is Almost TrueThe Converse is Almost True
l Let f : A B, g : B C. Let gf : A C be onto.
l Then g is onto but f need not be onto.
l Proof
n
Since gf is onto, for any z
C, there is a x
Asuch that (gf)(x) = z.
n That is g(f(x)) = z.
n But f(x) B.
n So for any z C, there is a y = f(x) B such thatg(y) = x.
n That is, g is onto.
The Converse is FalseThe Converse is False
8/2/2019 Disc Math
134/173
Discrete Math. Reading Materials 134
The Converse is FalseThe Converse is False
l Let f : A B, g : B C. Let gf : A C be onto.
l The following is an example that f is not onto.
1
a
b2
A B C
f g
Pause and ThinkPause and Think
8/2/2019 Disc Math
135/173
Discrete Math. Reading Materials 135
Pause and Think ...Pause and Think ...
l Let f : A B, g : B C. Let gf : A C be not onto.
n Are f and g also not onto?
Lecture TopicsLecture Topics
8/2/2019 Disc Math
136/173
Discrete Math. Reading Materials 136
Lecture TopicsLecture Topics
l One-To-One (1-1) Functions, Injections
l Composition of Injections
l Onto Functions, Surjections
l Composition of Surjectionsl One-To-One Correspondences, Bijections
l Composition of Bijections
l f is a Bijection Implies f Inverse is a Function
l f Inverse is a Function Implies f is a Bijectionl Properties of Inverse Functions
l Some Function Composition Properties
11--11 and Onto Functions,and Onto Functions, BijectionsBijections, 1, 1--11
8/2/2019 Disc Math
137/173
Discrete Math. Reading Materials 137
jj
CorrespondencesCorrespondences
l Let f : A B.
l The function f is a 1-1 correspondence iff f is 1-1 andonto.
l A 1-1 correspondence is also called a bijection.
Example 1Example 1
8/2/2019 Disc Math
138/173
Discrete Math. Reading Materials 138
Example 1Example 1
l Let A = { 1, 2, 3 } and B = { a, b, c }.
l Let f = { (1,b), (2,a), (3,c) }.
l The function f is a 1-1 correspondence because it is
1-1 and onto.
1
23
a
bc
Example 2Example 2
8/2/2019 Disc Math
139/173
Discrete Math. Reading Materials 139
Example 2Example 2
l Let f : Z Z and f(x) = x - 1.
l Since x-1 = y-1 implies x = y, so f is 1-1.
l Since f(y+1) = y, so f is onto.
l The function f is a 1-1 correspondence.
Example 3Example 3
8/2/2019 Disc Math
140/173
Discrete Math. Reading Materials 140
Example 3Example 3
l Let f : Z Z+ and f(x) = |x| + 1.
l Since f(-x) = f(x) but -x x for non-zero x, f is not 1-1.
l When y > 0, we have f(y-1) = y. This shows that f is
onto.
l Since f is onto but not 1-1, so f is not a 1-1correspondence.
Pause and ThinkPause and Think
8/2/2019 Disc Math
141/173
Discrete Math. Reading Materials 141
Pause and Think ...Pause and Think ...
l How many 1-1 correspondences are there from
{1,2,3} to itself?
Lecture TopicsLecture Topics
8/2/2019 Disc Math
142/173
Discrete Math. Reading Materials 142
Lecture TopicsLecture Topics
l One-To-One (1-1) Functions, Injections
l Composition of Injections
l Onto Functions, Surjections
l
Composition of Surjectionsl One-To-One Correspondences, Bijections
l Composition of Bijections
l f is a Bijection Implies f Inverse is a Function
l f Inverse is a Function Implies f is a Bijectionl Properties of Inverse Functions
l Some Function Composition Properties
Composition of 1Composition of 1--1 Correspondences1 Correspondences
8/2/2019 Disc Math
143/173
Discrete Math. Reading Materials 143
Composition of 1Composition of 1--1 Correspondences1 Correspondences
l Theorem
n Let f : A B, g : B C.
n If both f and g are 1-1 correspondences, then g f is
also a 1-1 correspondence.
l That is, the composition of 1-1 correspondences is a1-1 correspondence.
ProofProof
8/2/2019 Disc Math
144/173
Discrete Math. Reading Materials 144
ProofProof
l Since f and g are 1-1, so is gf.
l Since f and g are onto, so is gf.
l Since gf is 1-1 and onto, gf is a 1-1 correspondence.
The Converse is Almost TrueThe Converse is Almost True
8/2/2019 Disc Math
145/173
Discrete Math. Reading Materials 145
The Converse is Almost TrueThe Converse is Almost True
l Since gf is 1-1,
n we have shown that f is 1-1,
n but g need not be 1-1.
l Since gf is onto,
n we have shown that g is onto,
n but f need not be onto.
l That is, f and g need not be 1-1 correspondences.
The Converse is FalseThe Converse is False
8/2/2019 Disc Math
146/173
Discrete Math. Reading Materials 146
The Converse is FalseThe Converse is False
l The following example shows that gf is a 1-1correspondence from A to C, but neither f nor g is a1-1 correspondence.
1
a
b
2
A B C
f g
Making an Injection aMaking an Injection a BijectionBijection
8/2/2019 Disc Math
147/173
Discrete Math. Reading Materials 147
Making an Injection aMaking an Injection a BijectionBijection
l Let f : A B be 1-1.
l Let C = f(B).
l Clearly, f : A C is a bijection.
n Proof:
n f remains 1-1
n f has become onto.
Pause and ThinkPause and Think
8/2/2019 Disc Math
148/173
Discrete Math. Reading Materials 148
Pause and Think ...Pause and Think ...
l Let f : A B, g : B C. If gf : A C is not a
bijection, are f and g also not bijections?
Lecture TopicsLecture Topics
8/2/2019 Disc Math
149/173
Discrete Math. Reading Materials 149
Lecture TopicsLecture Topics
l One-To-One (1-1) Functions, Injections
l Composition of Injections
l Onto Functions, Surjections
l
Composition of Surjectionsl One-To-One Correspondences, Bijections
l Composition of Bijections
l f is a Bijection Implies f Inverse is a Function
l f Inverse is a Function Implies f is a Bijectionl Properties of Inverse Functions
l Some Function Composition Properties
Inverse FunctionsInverse Functions
8/2/2019 Disc Math
150/173
Discrete Math. Reading Materials 150
Inverse FunctionsInverse Functions
l Let A = { 0, 1 }, B = { p, q }, f = { (0,p), (1,p) }.
l Clearly f is a function from A to B.
l Clearly f -1 = { (p,0), (p,1) } is a relation from B to A
but it is not a function from B to A.
l A function is invertible iff its inverse is also a function.
TheoremTheorem
8/2/2019 Disc Math
151/173
Discrete Math. Reading Materials 151
TheoremTheorem
l Let f : A B.
l If f is a 1-1 correspondence then f -1 is a function.
ProofProof
8/2/2019 Disc Math
152/173
Discrete Math. Reading Materials 152
ProofProof
l Let f : A B be 1-1 and onto.
l We want to show f -1 B x A is a function.
l We need to show
n For any y B, there is a x A such that
(y,x) f -1.
n If (y,x), (y,x) f -1, then x = x.
ProofProof ------ Every Member of B Has anEvery Member of B Has an
I U dI U d ff 11
8/2/2019 Disc Math
153/173
Discrete Math. Reading Materials 153
Image UnderImage Under ff --11
l Let y B.
l Since f is onto, there is a x A such that f(x) = y.
l That is, for any y B, there is a x A, such that
n (x,y) f.
l But (x,y) f implies (y,x) f -1.
ProofProof ------ The Image UnderThe Image Under ff --11 is Uniqueis Unique
8/2/2019 Disc Math
154/173
Discrete Math. Reading Materials 154
ProofProof The Image UnderThe Image Under ff is Uniqueis Unique
l Let y B.
l Let (y,x), (y,x) f -1 .
n We have (x,y), (x,y) f.n This gives f(x) = y = f(x).
n But f is 1-1 gives x = x.
8/2/2019 Disc Math
155/173
Lecture TopicsLecture Topics
8/2/2019 Disc Math
156/173
Discrete Math. Reading Materials 156
Lecture TopicsLecture Topics
l One-To-One (1-1) Functions, Injections
l Composition of Injections
l Onto Functions, Surjections
l
Composition of Surjectionsl One-To-One Correspondences, Bijections
l Composition of Bijections
l f is a Bijection Implies f Inverse is a Function
l f Inverse is a Function Implies f is a Bijectionl Properties of Inverse Functions
l Some Function Composition Properties
Inverse FunctionsInverse Functions
8/2/2019 Disc Math
157/173
Discrete Math. Reading Materials 157
Inverse Functionse se u ct o s
l Let f : A B.
l Since f is a function, it is a relation.
l We know f -1 is a relation from B to A.
l If f -1 is a function, what can we say about f ?
TheoremTheorem
8/2/2019 Disc Math
158/173
Discrete Math. Reading Materials 158
eo e
l Let f : A B.
l If f -1 is a function, then f is 1-1 and onto.
ProofProof
8/2/2019 Disc Math
159/173
Discrete Math. Reading Materials 159
l Given f -1 : B A is a function.
l We want to show f : A B is 1-1 and onto.
l We need to show
n If f(x) = f(x), then x = x.
n For any y B, there is a x A such that f(x) = y.
ProofProof ------ f is 1f is 1--11
8/2/2019 Disc Math
160/173
Discrete Math. Reading Materials 160
l Let f(x) = f(x) = y.
l We have (x,y), (x,y) f.
l (y,x), (y,x) f -1
n But f -1 is a function, so the image of y under it is
unique, that is, x = x.
l Since x=x whenever f(x) = f(x), f is 1-1.
ProofProof ------ f is Ontof is Onto
8/2/2019 Disc Math
161/173
Discrete Math. Reading Materials 161
l For any y B, let f -1 (y) = x.
n That is, (y,x) f -1 .
n (x,y) f and thus f(x) = y.
l Since any member of B has a non-empty pre-image
under f, f is onto.
Pause and Think ...Pause and Think ...
8/2/2019 Disc Math
162/173
Discrete Math. Reading Materials 162
l Consider A x B = { 1, 2, 3 } x { a, b, c }.
l Let f = { (1,a), (2,b), (3,c) }.
l Is f a function from A to B?
l Is f -1 a function from B to A?
Lecture TopicsLecture Topics
8/2/2019 Disc Math
163/173
Discrete Math. Reading Materials 163
pp
l One-To-One (1-1) Functions, Injections
l Composition of Injections
l Onto Functions, Surjections
l
Composition of Surjectionsl One-To-One Correspondences, Bijections
l Composition of Bijections
l f is a Bijection Implies f Inverse is a Function
l f Inverse is a Function Implies f is a Bijectionl Properties of Inverse Functions
l Some Function Composition Properties
The Inverse Image and the PreThe Inverse Image and the Pre--ImageImage
8/2/2019 Disc Math
164/173
Discrete Math. Reading Materials 164
gg gg
l Let f : A B and f -1 : B A.
l We have (x,y) f iff (y,x) f -1 .
l Since both f and f -1 are functions, the above can be
written as
n f(x) = y iff f -1(y) = x.
TheoremTheorem
8/2/2019 Disc Math
165/173
Discrete Math. Reading Materials 165
l If the inverse of a function is a function, the inverse
function is a 1-1 correspondence.
l Proofn Let the function be f and f -1 be a function.
n We have (f -1 ) -1 = f is a function.
n Since the inverse of f -1 is a function, by a previous
theorem, f -1 is a 1-1 correspondence.
8/2/2019 Disc Math
166/173
8/2/2019 Disc Math
167/173
Function CompositionFunction Composition
8/2/2019 Disc Math
168/173
Discrete Math. Reading Materials 168
p
l Let f : A B be 1-1 and onto.
l We have f -1 : B A is also 1-1 and onto.
l We want to find
n f f -1
n f -1 f
n f IA , IB f
n IA f-1, f-1 IB
f ff f --11
8/2/2019 Disc Math
169/173
Discrete Math. Reading Materials 169
l We have f -1 : B A, f : A B.
l Let (f f -1)(x) = y.
n f( f -1(x)) = y
n f -1(x) = f -1 (y)n But f -1 is a 1-1 correspondence,
n so x = y
n and f f -1(x) = x.
l That is, f f -1 = IB.
ff --11 ff
8/2/2019 Disc Math
170/173
Discrete Math. Reading Materials 170
l We have f : A B, f -1 : B A.
l Let (f -1 f )(x) = y.
n f -1( f (x)) = y
n f (x) = f (y)n But f is a 1-1 correspondence,
n so x = y
n and f -1 f(x) = x.
l That is, f -1 f = IA.
f If IAA
8/2/2019 Disc Math
171/173
Discrete Math. Reading Materials 171
l We have IA: A A, f : A B.
l Let (f IA)(x) = y.
n f (IA (x)) = yn f (x) = y
n (f IA)(x) = f(x)
l That is, f IA = f.
IIBB ff
8/2/2019 Disc Math
172/173
Discrete Math. Reading Materials 172
l We have f : A B, IB: B B.
l Let (IB f)(x) = y.
n IB ( f (x)) = yn f (x) = y
n (IB f)(x) = f(x)
l That is, IB f = f.
Pause and Think ...Pause and Think ...
8/2/2019 Disc Math
173/173
l What are IA f-1 and f -1 IB?