Relations Binary Relation Let A and B be sets. A (binary) relation from A to B is a subset of A B. Notation Let R A B be a relation from A to B. If (a, b) R, we write a R b. 1
Binary Relation Example: Consider the sets A = {2, 3, 5, 7} and B = {4, 6, 8, 9, 10}. Let R be the relation from A to B defined by a R b iff b is divisible by a. Then R consists of the ordered pairs {(2, 4), (2, 6), (2, 8), (2, 10), (3, 6), (3, 9), (5, 10)}. 2
Domain and Range The domain of a relation R from A to B is the set Dom(R) = {x A y (y B and x R y)}. The range of the relation R from A to B is the set Rng(R) = {y B x (x A and x R y)}. 3
Domain and Range Example: Consider the sets A = {2, 3, 5, 7} and B = {4, 6, 8, 9, 10}. Let R be the relation from A to B defined by a R b iff b is divisible by a. Then R consists of the ordered pairs {(2, 4), (2, 6), (2, 8), (2, 10), (3, 6), (3, 9), (5, 10)}.
Domain and Range Example: Consider the sets A = {2, 3, 5, 7} and B = {4, 6, 8, 9, 10}. Let R be the relation from A to B defined by a R b iff b is divisible by a. Then R consists of the ordered pairs {(2, 4), (2, 6), (2, 8), (2, 10), (3, 6), (3, 9), (5, 10)}. Dom(R) = {2, 3, 5} Rng(R) = {4, 6, 8, 9, 10} 4
Domain and Range Example: Let X = Y = R, and consider the relation R from X to Y defined by x R y iff x 2 16 + y2 9 1. That is, R = { (x, y) R R x 2 } 16 + y2 9 1. 5
Domain and Range Example: Let X = Y = R, and consider the relation R from X to Y defined by x R y iff x 2 16 + y2 9 1. That is, R = { (x, y) R R x 2 } 16 + y2 9 1. Dom(R) = [ 4, 4] Rng(R) = [ 3, 3] 6
Binary Relation on a Set A (binary) relation on a set S is a relation from the set S to S. 7
Binary Relation on a Set Examples: Let S = R. The following are examples of binary relations on S. R 1 = {(x, y) x = y}, R 2 = {(x, y) x < y}, R 3 = {(x, y) x y}, R 4 = {(x, y) x > y}, R 5 = {(x, y) x y}, R 6 = {(x, y) x = y or x = y}, R 7 = {(x, y) x = y + 1}, R 8 = {(x, y) x + y 3}. 8
Identity Relation The identity relation on S is the relation from S to itself given by I S = {(x, x) x S}. Example: Let S = {a, b, c}. The identity relation on S is the relation I S = {(a, a), (b, b), (c, c)} 9
Inverse Relation If R is a relation from A to B, then the inverse of R, denoted R 1, is the relation R 1 = {(y, x) (x, y) R} Example: Consider the relation R = {(2, 4), (2, 6), (2, 8), (2, 10), (3, 6), (3, 9), (5, 10)}. The inverse of R is the relation R 1 = {(4, 2), (6, 2), (8, 2), (10, 2), (6, 3), (9, 3), (10, 5)}. 10
Inverse Relation Theorem: If R is a relation from A to B, then (a) Rng(R 1 ) = Dom(R). (b) Dom(R 1 ) = Rng(R). 11
Proof:
Inverse Relation Example Let R be the relation on R given by x R y iff y = e x. The inverse of R is the relation given by x R 1 y iff x = e y iff y = ln x. 12
Inverse Relation Example Let R be the relation on R given by x R y iff y = e x. The inverse of R is the relation given by x R 1 y iff x = e y iff y = ln x. The previous theorem gives Dom(R 1 ) = Rng(R) = (0, ). Rng(R 1 ) = Dom(R) = (, ). 13
Composition of Relations Let R be a relation from A to B, and let S be a relation from B to C. The composition of R and S, denoted S R, is a relation from A to C defined by S R = {(a, c) b B ( (a, b) R and (b, c) S )} 14
Composition of Relations Example: Consider the sets A = {1, 2, 3, 4, 5} B = {p, q, r, s, t} C = {x, y, z, w} Let R be the relation from A to B given by R = {(1, p), (1, q), (2, q), (3, r), (4, s)}. Let S be the relation from B to C given by S = {(p, x), (q, x), (q, y), (s, z), (t, z)}. 15
Composition of Relations Example: Consider the sets A = {1, 2, 3, 4, 5} B = {p, q, r, s, t} C = {x, y, z, w} Let R be the relation from A to B given by R = {(1, p), (1, q), (2, q), (3, r), (4, s)}. Let S be the relation from B to C given by S = {(p, x), (q, x), (q, y), (s, z), (t, z)}. The composition S R is the relation from A to C given by S R = {(1, x), (1, y), (2, x), (2, y), (4, z)}. 16
Composition of Relations Example: Consider the relations R = {(x, y) R R y = x + 1} S = {(x, y) R R y = x 2 }. Determine the following: S R = R S = 17
Composition of Relations Theorem: Suppose A, B, C, and D are sets. Let R be a relation from A to B, S be a relation from B to C, and T be a relation from C to D. (a) (R 1 ) 1 = R. (b) T (S R) = (T S) R. (c) I B R = R and R I A = R. (d) (S R) 1 = R 1 S 1 18
Equivalence Relations Reflexive Property Let R be a relation on A. We say that R is reflexive if and only if x R x for all x A. 1
Reflexive Property Examples: Let A = {a, b, c}. In each case, decide if the given relation is reflexive. R = {(a, b), (b, a), (c, c)}. R = {(a, a), (a, c), (c, b), (a, b), (c, c)}. R = {(a, b), (b, b), (b, c)}. R = {(a, a), (a, b), (b, b), (b, a), (c, c)}. R = {(a, b), (a, c), (b, a), (b, c), (c, a), (c, b)}. R = {(a, a), (b, b), (c, c)}. 2
Symmetric Property Let R be a relation on A. We say that R is symmetric if and only if x R y y R x for all x, y A. 3
Symmetric Property Examples: Let A = {a, b, c}. In each case, decide if the given relation is symmetric. R = {(a, b), (b, a), (c, c)}. R = {(a, a), (a, c), (c, b), (a, b), (c, c)}. R = {(a, b), (b, b), (b, c)}. R = {(a, a), (a, b), (b, b), (b, a), (c, c)}. R = {(a, b), (a, c), (b, a), (b, c), (c, a), (c, b)}. R = {(a, a), (b, b), (c, c)}. 4
Transitive Property Let R be a relation on A. We say that R is transitive if and only if (x R y y R z) x R z for all x, y, z A. 5
Transitive Property Examples: Let A = {a, b, c}. In each case, decide if the given relation is transitive. R = {(a, b), (b, a), (c, c)}. R = {(a, a), (a, c), (c, b), (a, b), (c, c)}. R = {(a, b), (b, b), (b, c)}. R = {(a, a), (a, b), (b, b), (b, a), (c, c)}. R = {(a, b), (a, c), (b, a), (b, c), (c, a), (c, b)}. R = {(a, a), (b, b), (c, c)}. 6
Equivalence Relation Let R be a relation on A. We say that R is an equivalence relation if and only if R is reflexive, symmetric, and transitive. That is, R is an equivalence relation iff 1. (Reflexivity) x R x, for all x A. 2. (Symmetry) if x R y, then y R x. 3. (Transitivity) if x R y and y R z, then x R z. 7
Equivalence Relation Example: Let A = {a, b, c}. List all equivalence relations on A. R = {(a, a), (b, b), (c, c)} R = {(a, a), (b, b), (c, c), (a, b), (b, a)} R = {(a, a), (b, b), (c, c), (b, c), (c, b)} R = {(a, a), (b, b), (c, c), (a, c), (c, a)} R = {(a, a), (b, b), (c, c), (a, b), (b, a) (a, c), (c, a), (b, c), (c, b)} 9
Equivalence Relation Definition Let n be a fixed positive integer. Given x, y Z, we say that x is congruent to y modulo n if x y is divisible to n, and we write x y (mod n) The number n is called the modulus of the congruence. 10
Equivalence Relation Example: Let R be the relation on Z defined by x R y iff x y (mod n) where n is a fixed positive integer. Prove that R is an equivalence relation. 11
Proof: Recall that x y (mod n) if and only if x y = nk for some integer k. (Reflexivity) (i) x R x, since x x = 0 = n 0. (Symmetry) (ii) Assume x R y. Then, x y = nk for some integer k. Therefore, y x = n( k), where k is an integer. Therefore, y R x. (Transitivity) (iii) Assume x R y and y R z. Then, x y = nk for some integer k, and y z = nj for some integer j. Then, x z = (x y) + (y z) = nk + nj That is, x z = n(k + j) where k + j is an integer. Therefore, x R z.