1 00:00:00,520 --> 00:00:02,740 Equivalence relations are another kind 2 00:00:02,740 --> 00:00:06,210 of binary relation on a set which 3 00:00:06,210 --> 00:00:10,010 play a crucial role in mathematics and in computer 4 00:00:10,010 --> 00:00:11,520 science in particular. 5 00:00:11,520 --> 00:00:15,220 And they can also be explained both in terms of digraphs 6 00:00:15,220 --> 00:00:16,630 and in terms of axioms. 7 00:00:16,630 --> 00:00:19,250 So let's begin with a digraph explanation 8 00:00:19,250 --> 00:00:20,840 of an equivalence relation. 9 00:00:20,840 --> 00:00:24,300 And the kind of relation that's an equivalence relation 10 00:00:24,300 --> 00:00:27,590 is the relation of there being a walk in both directions 11 00:00:27,590 --> 00:00:29,450 between two vertices. 12 00:00:29,450 --> 00:00:32,940 So if there's a walk between vertex u and vertex v 13 00:00:32,940 --> 00:00:37,910 and conversely there's a walk from vertex v back to vertex u, 14 00:00:37,910 --> 00:00:41,710 then u and v are said to be strongly connected, 15 00:00:41,710 --> 00:00:43,420 and strongly connected is going to be 16 00:00:43,420 --> 00:00:45,500 an example of an equivalence relation. 17 00:00:45,500 --> 00:00:48,510 So in terms of the walk relation, 18 00:00:48,510 --> 00:00:52,110 including 0-length walks, the relation we're talking about is 19 00:00:52,110 --> 00:00:56,160 u G* v and v G* u. 20 00:00:56,160 --> 00:00:59,530 Now, as a property of relations, this has a name. 21 00:00:59,530 --> 00:01:01,470 It's called symmetry. 22 00:01:01,470 --> 00:01:05,470 So a relation R on a set A is symmetric if and only if a R 23 00:01:05,470 --> 00:01:08,480 b implies b R a, and the first remark 24 00:01:08,480 --> 00:01:12,870 is that the strongly connected relation is symmetric. 25 00:01:12,870 --> 00:01:16,150 An equivalence relation is a symmetric relation that 26 00:01:16,150 --> 00:01:18,230 is transitive and reflexive. 27 00:01:18,230 --> 00:01:24,820 And again, we have immediately that the walk relation-- 28 00:01:24,820 --> 00:01:28,130 the mutual walk relation, the two-way walk relation 29 00:01:28,130 --> 00:01:30,660 or strongly connected relation in a digraph 30 00:01:30,660 --> 00:01:31,920 is an equivalence relation. 31 00:01:31,920 --> 00:01:35,030 Because clearly if there's two way paths between u and v 32 00:01:35,030 --> 00:01:40,550 and between and v and w, then there's one between u and w 33 00:01:40,550 --> 00:01:43,330 by going for u to v to w and back. 34 00:01:43,330 --> 00:01:45,930 Likewise, there is a length 0 walk 35 00:01:45,930 --> 00:01:47,640 from any element to itself. 36 00:01:47,640 --> 00:01:52,920 And by definition, strong connectedness is symmetric. 37 00:01:52,920 --> 00:01:56,880 So the strong connectedness relation in any digraph 38 00:01:56,880 --> 00:01:58,770 is an equivalence relation. 39 00:01:58,770 --> 00:02:03,800 And the theorem is, conversely, that any equivalence relation, 40 00:02:03,800 --> 00:02:05,800 anything that's an equivalence relation, 41 00:02:05,800 --> 00:02:09,190 is the strongly connected relation of some digraph. 42 00:02:09,190 --> 00:02:10,470 The proof is trivial. 43 00:02:10,470 --> 00:02:14,280 It's the strongly connected relation of itself. 44 00:02:14,280 --> 00:02:15,010 OK. 45 00:02:15,010 --> 00:02:16,780 Some examples of equivalence relations 46 00:02:16,780 --> 00:02:20,395 to see why they're so basic is that the most fundamental one 47 00:02:20,395 --> 00:02:21,660 is equality. 48 00:02:21,660 --> 00:02:25,100 Obviously, equality is symmetric and reflexive and transitive, 49 00:02:25,100 --> 00:02:27,180 and so it's an equivalence relation. 50 00:02:27,180 --> 00:02:30,360 Another one that we've seen is congruence mod n, 51 00:02:30,360 --> 00:02:36,630 which you could also check is symmetric and transitive and 52 00:02:36,630 --> 00:02:37,880 reflexive. 53 00:02:37,880 --> 00:02:39,800 And finally, another relation would 54 00:02:39,800 --> 00:02:42,270 be that two sets are the same size, 55 00:02:42,270 --> 00:02:44,300 providing they're finite sets. 56 00:02:44,300 --> 00:02:47,050 And another example would be a bunch of objects 57 00:02:47,050 --> 00:02:48,110 having the same color. 58 00:02:48,110 --> 00:02:52,860 Two objects have the same color is a relation among objects 59 00:02:52,860 --> 00:02:56,490 that have color that is symmetric and transitive and 60 00:02:56,490 --> 00:02:58,310 reflexive, so it's an equivalence relation. 61 00:03:00,840 --> 00:03:02,980 Let's illustrate some of these axioms 62 00:03:02,980 --> 00:03:05,082 that we have in terms of graphs. 63 00:03:05,082 --> 00:03:06,540 It can be helpful to remember them. 64 00:03:06,540 --> 00:03:09,280 So reflexive means that when you look at a digraph, 65 00:03:09,280 --> 00:03:11,840 it's reflexive when there's a little self loop 66 00:03:11,840 --> 00:03:13,670 from every vertex to itself. 67 00:03:13,670 --> 00:03:18,750 So there's a length 1 path or an edge from vertex to itself 68 00:03:18,750 --> 00:03:21,390 in reflexive graphs. 69 00:03:21,390 --> 00:03:25,670 Transitive means that whenever you have two edges connecting 70 00:03:25,670 --> 00:03:27,290 one vertex to another, there's a path 71 00:03:27,290 --> 00:03:29,490 of length 2 from one place to another 72 00:03:29,490 --> 00:03:32,800 that in fact is an edge from that place to its target. 73 00:03:32,800 --> 00:03:35,410 And of course as we said, once there 74 00:03:35,410 --> 00:03:37,800 is an edge wherever there's a path of length 2, 75 00:03:37,800 --> 00:03:39,300 it follows by induction that there's 76 00:03:39,300 --> 00:03:41,216 an edge wherever there's a path of any length, 77 00:03:41,216 --> 00:03:42,870 and that's what transitive means. 78 00:03:42,870 --> 00:03:44,440 Asymmetric means that whenever you 79 00:03:44,440 --> 00:03:48,850 have an edge from one vertex to another there is no edge back. 80 00:03:48,850 --> 00:03:51,040 So in particular, if I have an edge 81 00:03:51,040 --> 00:03:53,220 from this vertex to that vertex in blue, 82 00:03:53,220 --> 00:03:56,940 there is no edge that goes back in the other direction. 83 00:03:56,940 --> 00:04:02,850 Nor is there ever a self loop in an asymmetric graph. 84 00:04:02,850 --> 00:04:05,590 And finally, in a symmetric graph, 85 00:04:05,590 --> 00:04:07,000 wherever there's an edge, there's 86 00:04:07,000 --> 00:04:09,240 an edge that goes back the other way. 87 00:04:09,240 --> 00:04:11,740 So that can help you maybe remember 88 00:04:11,740 --> 00:04:14,210 what these properties mean. 89 00:04:14,210 --> 00:04:16,380 Now again, equivalence relations, 90 00:04:16,380 --> 00:04:18,089 besides being represented in terms 91 00:04:18,089 --> 00:04:20,930 of the strongly connected relation of a digraph, 92 00:04:20,930 --> 00:04:24,350 can be represented in two other very natural ways that 93 00:04:24,350 --> 00:04:26,235 really explains where they come from 94 00:04:26,235 --> 00:04:28,050 and what their properties are. 95 00:04:28,050 --> 00:04:31,702 So whenever you have a total function f on a set A, 96 00:04:31,702 --> 00:04:35,260 it defines an equivalence relation on the set A. Namely, 97 00:04:35,260 --> 00:04:39,500 if f is a total function from domain A to codomain B, 98 00:04:39,500 --> 00:04:43,320 then we can define a relation we can call equivalence sub f 99 00:04:43,320 --> 00:04:47,190 on the set A by the rule that two elements are equivalents 100 00:04:47,190 --> 00:04:50,431 of f if and only if they have the same image under f-- 101 00:04:50,431 --> 00:04:51,430 they hit the same thing. 102 00:04:51,430 --> 00:04:54,370 That is, A is equivalent sub f to A prime if 103 00:04:54,370 --> 00:04:58,240 and only if f of a is equal to f of a prime. 104 00:04:58,240 --> 00:05:01,110 And again, equivalence sub f immediately 105 00:05:01,110 --> 00:05:03,800 inherits the properties of equality, which makes 106 00:05:03,800 --> 00:05:06,050 it an equivalence relation. 107 00:05:06,050 --> 00:05:09,585 And the theorem that we have is that every relation R on a set 108 00:05:09,585 --> 00:05:14,350 A is an equivalence relation if and only if it in fact 109 00:05:14,350 --> 00:05:19,024 is equal to equivalence sub f for some function f. 110 00:05:19,024 --> 00:05:19,940 Let's illustrate that. 111 00:05:19,940 --> 00:05:22,920 We already remembered that congruence mod n 112 00:05:22,920 --> 00:05:25,210 can be understood as equivalence sub f, 113 00:05:25,210 --> 00:05:28,000 where the mapping is just map things to remainders. 114 00:05:28,000 --> 00:05:31,450 Two numbers are congruent mod n if and only 115 00:05:31,450 --> 00:05:35,200 if they have the same remainder on division by n. 116 00:05:35,200 --> 00:05:39,600 So map a number a to f of k, equal its remainder, 117 00:05:39,600 --> 00:05:42,060 and we have found the equivalence sub f 118 00:05:42,060 --> 00:05:44,570 representation of congruence, which 119 00:05:44,570 --> 00:05:46,670 is another way to verify that congruence 120 00:05:46,670 --> 00:05:49,650 is an equivalence relation. 121 00:05:49,650 --> 00:05:52,426 Finally, whenever you have a partition of a set, 122 00:05:52,426 --> 00:05:54,050 you can define an equivalence relation. 123 00:05:54,050 --> 00:05:57,270 So a partition of a set cuts up the set A 124 00:05:57,270 --> 00:06:01,020 into a bunch of blocks which are nonempty, 125 00:06:01,020 --> 00:06:04,030 and every element is a member of some block, 126 00:06:04,030 --> 00:06:05,890 and the blocks don't overlap. 127 00:06:05,890 --> 00:06:09,620 So in fact, every element is a member of a unique block. 128 00:06:09,620 --> 00:06:14,330 And that enables me to define an equivalence relation on A 129 00:06:14,330 --> 00:06:18,210 by the property that two elements are in the same block. 130 00:06:18,210 --> 00:06:22,220 In fact, that's the proof of the previous representation theorem 131 00:06:22,220 --> 00:06:27,940 in terms of a function that you can map an element to the block 132 00:06:27,940 --> 00:06:31,660 that it's in, in order to see that the block 133 00:06:31,660 --> 00:06:33,980 representation and the equivalence sub f 134 00:06:33,980 --> 00:06:36,150 representation are the same. 135 00:06:36,150 --> 00:06:38,050 The proof in the other direction, 136 00:06:38,050 --> 00:06:42,980 that every equivalence relation can be represented in this way, 137 00:06:42,980 --> 00:06:46,280 is an exercise in axiomatic reasoning, 138 00:06:46,280 --> 00:06:49,770 and elementary one that we're going to leave to a problem 139 00:06:49,770 --> 00:06:53,390 and not do in this presentation. 140 00:06:53,390 --> 00:06:57,490 So the theorem finally is that, again, a relation R on a set 141 00:06:57,490 --> 00:06:59,080 is an equivalence relation if and only 142 00:06:59,080 --> 00:07:02,270 if it is in fact the being in the same block 143 00:07:02,270 --> 00:07:04,620 relation for some partition. 144 00:07:04,620 --> 00:07:08,280 And that is the story and multiple ways of understanding 145 00:07:08,280 --> 00:07:11,650 what equivalence relations are.