EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 8 Equivalence relations on sets Function between...
-
date post
21-Dec-2015 -
Category
Documents
-
view
217 -
download
0
Transcript of EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 8 Equivalence relations on sets Function between...
EE1J2 - Slide 1
EE1J2 – Discrete Maths Lecture 8
Equivalence relations on sets Function between sets Types of function
EE1J2 - Slide 2
Relations Suppose A = {0,1,2,3}. An example of a relation on A is ‘<’ This relation is defined by the set
R = {0<1, 0<2, 0<3, 1<2, 1<3, 2<3}
or, equivalently
R = {(0,1), (0,2), (0,3), (1,2), (1,3), (2,3)} AA So, a relation on A is a subset of R A A
EE1J2 - Slide 3
Equivalence relations
A relation ~ is an equivalence relation on a set S if and only if: a ~ a for every a S (~ reflexive) If a~b then b~a a,b S (~ symmetric) If a~b and b~c then a~c (~ transitive) a,b,c S
If ~ is an equivalence relation and a~b, then we can say that a is equivalent to b
EE1J2 - Slide 4
Examples S is the set of all people in the UK R1: x,y S, x~y if and only if x and y are the same
age. This is an equivalence relation on S R2: x,y S, x~y if and only if x and y own a copy of
the same book. This is not an equivalence relation. Why?
R3: x,y S, x~y if and only if x and y both own a copy of ‘War and Peace’. This is an equivalence relation on S
EE1J2 - Slide 5
Partitions
Suppose A is a set. A partition P of A is a set of subsets of A, P = {P1,…,PN} such
that: PnPm= if nm
P1P2…PN = A
EE1J2 - Slide 6
Partitions - example
SP1
P2
P3
{P1,P2,P3} is a partition of S
P1 P2
P3
{P1,P2,P3} is not a partition – P1 P2 P3 S
P1P2
P3 {P1,P2,P3} not a partition – P2 P3
EE1J2 - Slide 7
Partitions & Equivalence Relations (1)
Let ~ be an equivalence relation on A
For aA, let Pa be the set of elements of A
which are equivalent to a
I.e. Pa= {bA: b~a}
P = {Pa:aA} is a partition of A
EE1J2 - Slide 8
Partitions & Equivalence Relations (2)
Let P={P} be a partition of A
Define an equivalence relation ~ on A by
a~b if and only if both a and b belong to P
for some
~ is an equivalence relation on A
EE1J2 - Slide 9
Partitions & Equivalence Relations (3)
So, for a set A there is a one-to-one correspondence between: Equivalence relations on A Partitions of A
EE1J2 - Slide 10
Relations - More Terminology Let A be a set, R a relation on A The domain of R, dom(A), is the set:
dom(A)={a: b((a,b)R)}
The range of R, range(A), is the set:range(A)={b: a((a,b)R)}
If R is a relation on A then the inverse relation R-1 is given byR-1={(b,a): (a,b)R}
EE1J2 - Slide 11
Example
Let S be the set of all people in the world Define a relation R on S by:
If x,yS, then (x,y) R if and only if x and y are siblings
The domain of R is the set of all people who have brothers or sisters
The range of R is the same as its domain
EE1J2 - Slide 12
Example 2
Let S be the set of all people in the world Define a relation R on S by:
If x,yS, then (x,y) R if and only if x is y’s younger sibling
The domain of R is the set of all people who have an older brother or sister
The range of R is the set of all people who have a younger brother or sister
EE1J2 - Slide 13
Example 3
S = {1,4,7,9} Define a relation R on S by:
If x,y S, then (x,y) R if and only if x < y The domain of R is {1,4,7} The range of R is {4,7,9}
Is R an equivalence relation?
EE1J2 - Slide 14
Functions You probably have pre-conceived ideas of what a
function is – f(x)=x2+2x+2, f(x)=sin(x), f(x)=exp(x),…
These are all functions which associate a member x of ℝ unambiguously with another member f(x) of ℝ
They can all be written in set-theoretic notation as f = {(x,f(x)): x ℝ}
EE1J2 - Slide 15
Function – more examples Some functions require more care.
f(x)=log(x) only defined for x > 0 f = {(x, f(x)): x ℝ, x>0 }
-7
-6
-5
-4
-3
-2
-1
0
1
0 0.5 1 1.5 2 2.5 3
x
log(x)
EE1J2 - Slide 16
Examples continued
f(x)=1/x Not defined when x = 1 f = {(x, f(x)): x ℝ, x 0}
-100
-80
-60
-40
-20
0
20
40
60
80
100
-6 -4 -2 0 2 4 6
x
1/x
EE1J2 - Slide 17
Functions
Also, x and f(x) need not be members of the same set. For example consider the function (positive square root) If x>0, then f is a real-valued function Otherwise f is a complex-valued function
xxf )(
EE1J2 - Slide 18
Functions A function f from a set A to a set B is a subset of
P(AB) such that if (a1,b1)f and (a2,b2)f then a1a2
This ensures that f is well-defined. As before dom(f)={a: b((a,b)f)} range(A)={b: a((a,b)R)}
If adom(f), then there is a unique brange(f) such that (a,b)f
In this case we normally write f(a)=b
EE1J2 - Slide 19
Functions
If f is a function from A to B and A=dom(f) then we write:
f : A B
EE1J2 - Slide 20
Functions In formal mathematics it is important to
take care with this notation –in particular to be sure about the domain and range in the definition of a function: f:ℝℝ, is not well-defined f:[0,) ℝ, (positive root) is a well-
defined function f:ℝ ℂ , is a well-defined function, and is
different from either of the previous functions
xxf )(
xxf )(
xxf )(
EE1J2 - Slide 21
Special Types of Function
Let f:AB be a function f is called a surjection (or f is onto) if
b(bB)a((aA)(f(a)=b)) f is called an injection (or f is 1-1 “one-to-
one”) if (f(a1)=b)(f(a2)=b)a1=a2
f is a bijection if and only if f is 1-1 and onto (f is a surjection and an injection)
EE1J2 - Slide 22
Special Types of Function
f not 1-1 or onto f onto but not 1-1
f 1-1 and onto - bijection f 1-1 but not onto
A B A B
EE1J2 - Slide 23
Isomorphism If f:AB is a bijection,
then A and B are basically the same set
Mathematicians say that A and B are isomorphic
f 1-1 and onto - bijection
EE1J2 - Slide 24
Examples
Let A = {0,1,2,3} and B = {a,b,c,d} The function f :A B defined by {(0,a),
(1,b),(2,c),(3,d)} is a bijection The sets A and B are isomorphic. B is just a ‘re-labelled’ version of A
EE1J2 - Slide 25
More examples Well defined? Injection? Surjection?
Bijection? f : ℝ ℝ, f(x) = cos(x) f : ℝ [-1,1], f(x) = sin(x) f : [-,] [-1,1], f(x) = sin(x) f : ℝ ℝ, f(x) = log(x) f : ℝ ℝ, f(x) = 1/x if x 0, f(0) = 0. f : ℕ , ℤ f(n) = n/2 if n is even, f(n)=-(n+1)/2 if n is odd
EE1J2 - Slide 26
The Image of a Subset
A and B sets, f:A B be a function. Suppose X A (X is a subset of A) Then f(X) is the subset of B defined by
f(X)={b:f(x)=b for some xX}, called the image of X under f
A B
X f(X) f
EE1J2 - Slide 27
The Inverse-Image of a Subset
A and B sets, f:A B a function. Suppose Y B (Y is a subset of B) Then f -1(Y) is the subset of A defined by
f -1(Y)={a:f(a)=y for some yY}Called the inverse-image of Y under f
A B
X=f-1(Y) f(X)=Y f-1
EE1J2 - Slide 28
Inverse Functions
A, B sets, f:A B a function
f = {(a,b): b=f(a), aA} Is f –1 ={(b,a): b=f(a), aA}a function? In order for f –1 to be a function, if
(b,a) f –1 and (b,c) f –1 then a=c i.e. if (a,b) f and (c,b) f then a=c i.e f must be 1-1
EE1J2 - Slide 29
Inverse Functions
In other words, if f:AB, then the inverse function f –1:f(A)A exists if and only if f is 1-1
If f(A)=B, and f is 1-1, then f –1:BA exists In other words, f –1:BA exists if and only if f
is a bijection In this case, f –1 is also a bijection, and A and B
are isomorphic
EE1J2 - Slide 30
Cardinality Revisited Recall that for a finite set A={a1,…,an}, the
cardinality of A is simply the number of members which A has.
In this case |A|=n For infinite sets the notion of cardinality is more
complex. But, if two infinite sets A and B are isomorphic,
then surely |A|=|B|
EE1J2 - Slide 31
Summary of Lecture 8
Relations on sets Equivalence relations and partitions Introduction to functions
Injections (or 1-1 functions) Surjections (or ‘onto’ functions) Bijections
Cardinality revisited