330 likes | 544 Views
EE1J2 – Discrete Maths Lecture 8. Equivalence relations on sets Function between sets Types of function. 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 }
E N D
EE1J2 – Discrete Maths Lecture 8 • Equivalence relations on sets • Function between sets • Types of function
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 Ais a subset of RA A
Equivalence relations • A relation ~ is an equivalence relation on a set S if and only if: • a ~ a for every aS (~ reflexive) • If a~b then b~aa,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
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
Partitions • Suppose A is a set. A partitionP of A is a set of subsets of A,P = {P1,…,PN} such that: • PnPm= if nm • P1P2…PN = A
P3 P3 P1 P1 P2 P2 P3 P1 P2 Partitions - example {P1,P2,P3} is a partition of S S {P1,P2,P3} not a partition – P2 P3 {P1,P2,P3} is not a partition – P1 P2 P3 S
Partitions & Equivalence Relations (1) • Let ~ be an equivalence relation on A • For aA, let Pabe 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
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 Pfor some • ~ is an equivalence relation on A
Partitions & Equivalence Relations (3) • So, for a set A there is a one-to-one correspondence between: • Equivalence relations on A • Partitions of A
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 by R-1={(b,a): (a,b)R}
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
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
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?
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 ℝ}
Function – more examples • Some functions require more care. • f(x)=log(x) only defined for x > 0 • f = {(x, f(x)): x ℝ,x>0 }
Examples continued • f(x)=1/x • Not defined when x = 1 • f = {(x, f(x)): x ℝ,x 0}
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
Functions • A functionf from a set Ato a set Bis 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 uniquebrange(f) such that (a,b)f • In this case we normally write f(a)=b
Functions • If f is a function from A to B and A=dom(f) then we write: f : A B
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
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)
A B A B f onto but not 1-1 f not 1-1 or onto f 1-1 but not onto f 1-1 and onto - bijection Special Types of Function
f 1-1 and onto - bijection Isomorphism • If f:AB is a bijection, then A and B are basically the same set • Mathematicians say that A and B are isomorphic
Examples • Let A = {0,1,2,3} and B = {a,b,c,d} • The function f :AB 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
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
A B X f(X) 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 f
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 f-1 X=f-1(Y) f(X)=Y
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 –1to be a function, if (b,a)f –1 and (b,c)f –1 then a=c • i.e. if (a,b)fand (c,b)f then a=c • i.e f must be 1-1
Inverse Functions • In other words, if f:AB, then theinverse 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 existsif and only if f is a bijection • In this case, f –1 is also a bijection, and A and B are isomorphic
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 twoinfinite sets A and B are isomorphic, then surely |A|=|B|
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