300 likes | 351 Views
Equivalence Relations. Lecture 45 Section 10.3 Fri, Apr 8, 2005. Equivalence Relations. An equivalence relation on a set A is a relation on A that is reflexive, symmetric, and transitive. We often use the symbol ~ as a generic symbol for an equivalence relation.
E N D
Equivalence Relations Lecture 45 Section 10.3 Fri, Apr 8, 2005
Equivalence Relations • An equivalence relation on a set A is a relation on A that is reflexive, symmetric, and transitive. • We often use the symbol ~ as a generic symbol for an equivalence relation.
Examples of Equivalence Relations • Which of the following are equivalence relations? • ab, on Z+. • gcd(a, b) > 1, on Z+. • A B, on (U). • pq, on a set of statements. • p q, on a set of statements. • a b (mod 10), on Z.
Examples of Equivalence Relations • Which of the following are equivalence relations? • pq = p, on a set of statements. • gcd(a, b) = 1, on Z+. • gcd(a, b) = a, on Z+. • A B = , on (U). • A= B, on (U).
Examples of Equivalence Relations • Which of the following are equivalence relations? • RR, on R. • , on R.
Equivalence Classes • Let ~ be an equivalence relation on a set A and let aA. • The equivalence class of a is [a] = {xAx ~ a}.
Examples: Equivalence Classes • Describe the equivalence classes of each of the following equivalence relations. • a b (mod 10), on Z. • A= B, on (U). • p q, on a set of statements. • RR, on R.
Equivalence Classes and Partitions • Theorem: Let ~ be an equivalence relation on a set A. The equivalence classes of ~ form a partition of A. • Proof: • We must show that • The equivalence classes are pairwise disjoint, • The union of the equivalence classes equals A.
Equivalence Classes and Partitions • Proof that the equivalence classes are pairwise disjoint. • Let [a] and [b] be two distinct equivalence classes. • Suppose [a] [b] . • Let x [a] [b]. • Then x ~ a and x ~ b. • Therefore, a ~ x and x ~ b.
Equivalence Classes and Partitions • By transitivity, a ~ b. • Now let y [a]. • Then y ~ a. • By transitivity, y ~ b. • So y [b]. • Therefore, [a] [b]. • By a similar argument, [b] [a].
Equivalence Classes and Partitions • Thus, [a] = [b], which is a contradiction • Therefore, [a] [b] = . • Thus, the equivalence classes are pairwise disjoint.
Equivalence Classes and Partitions • Proof that the union of the equivalence classes is A. • Let aA. • Then a [a] since a ~ a. • Therefore, a is in the union of the equivalence classes. • So, A is a subset of the union of the equivalence classes.
Equivalence Classes and Partitions • On the other hand, every equivalence class is a subset of A. • Therefore, the union of the equivalence classes is a subset of A. • Therefore, the union of the equivalence classes equals A. • Therefore, the equivalence classes form a partition of A.
Example • Let F be the set of all functions f : RR. • For f, gF, define f ~ g to mean that f is (g).
Example • Theorem: ~ is an equivalence relation on F. • Proof: • Reflexivity • Obviously, f ~ f for all fF.
Example • Symmetry • Suppose that f ~ g for some f, gF. • Then f(x) is (g(x)). • There exist positive constants M1, M2, and x0 such that M1g(x) f(x) M2g(x), for all x > x0.
Example • It follows that (1/M2)f(x) g(x) (1/M1)f(x), for all x > x0. • Therefore, g(x) is (f(x)).
Example • Transitivity • Let f, g, hF and suppose that f ~ g and g ~ h. • Then there exist constants M1 and x1 and M2 and x2 such that f(x) M1g(x) for all x x1 and
Example g(x) M2h(x) for all x x2. • Let x0 = max(x1, x2). • Then for all xx0, f(x) M1g(x) M1 M2h(x) • Therefore, f(x) is O(h(x)).
Example • Similarly, we can show that h(x) is O(f(x)). • Therefore, f(x) is (h(x)). • Therefore, f ~ h. • Therefore, ~ is an equivalence relation on F.
Example • The equivalence class of f is the set [f] of all functions with the same growth rate as f. • The most important equivalence classes are • [xa], aR, a > 0. • [bx], bR, b > 1. • [xa logbx], aR, a > 0, b > 1.
Example • Furthermore, • [xa] [xb] if a b. • [ax] [bx] if a b. • However, • [logax] = [logbx] for all a, b > 1.
The Equivalence Relation Induced by a Partition • Let A be a set and let {Ai}iI be a partition of A. • Define a relation ~ on A as x ~ yx, yAi for some iI.
The Equivalence Relation Induced by a Partition • Theorem: The relation ~ defined above is an equivalence relation on A.
The Equivalence Relation Induced by a Partition • Proof: • We must prove that ~ is reflexive, symmetric, and transitive. • Proof that ~ is reflexive. • Let aA. • Then a is in Ai for some iI. • So a ~ a.
The Equivalence Relation Induced by a Partition • Proof that ~ is symmetric. • Let a, bA and suppose that a ~ b. • Then a, bAi for some iI. • So b, aAi for some iI. • Therefore b ~ a.
The Equivalence Relation Induced by a Partition • Proof that ~ is transitive. • Let a, b, cA and suppose a ~ b and b ~ c. • Then a, bAi for some iI and b, cAj for some jI. • That means that bAi Aj. • This is possible only if Ai = Aj. • Therefore, a, cAi. • So, a ~ c.
Example • Consider the set P of all computer programs. • Partition P into subsets by putting in the same subset any two programs that always produce identical output for the same input.
Example • This partition determines an equivalence relation on P. • Let p1 and p2 be two computer programs. • Then p1 p2 if p1 and p2 always produce identical output for the same input.
Example • Let A be the set of all people on Earth. • Let R be the relation defined by xRy if x and y have ever shaken hands. • Is R reflexive? Symmetric? Transitive? • Let R* be the reflexive-transitive closure of R. • Is R* an equivalence relation? • What are the equivalence classes of R*?