CMPSCI 250: Introduction To Computation: Lecture #11: Equivalence Relations David Mix Barrington 15 February 2012
CMPSCI 250: Introduction To Computation: Lecture #11: Equivalence Relations David Mix Barrington 15 February 2012
• Equivalence Classes
• Recall the definitions: R is reflexive if ∀x: R(x, x), R is symmetric if ∀x: ∀y:
R(x, y) → R(y, x)), and R is transitive if ∀x: ∀y: ∀z: (R(x, y) ∧ R(y, z)) → R(x, z).
• The always false relation ¬U is symmetric and transitive but not reflexive.
• Any relation of the form “x and y are the same in this respect” will normally be
reflexive, symmetric, and transitive, and thus an equivalence relation.
The Graph of an Equivalence Relation
• If we have a set of points that have some connection from each point to each
other point, transitivity forces us to have all possible direct connections
among those points. A graph with all possible undirected edges is called a
complete graph on its points. The graph of an equivalence relation has a
complete graph for each connected component.
• Let’s prove that this characterization of the graph is correct -- we will need a
new definition.
• Let P = {S1, S2,..., Sk} be a partition of A and let SS be its same set relation.
• For transitivity, we let x, y, and z be arbitrary and assume SS(x, y) and SS(y, z).
From the definition we know that x and y are both in some Si and that y and z
are both in some Sj. But since y is in both Si and Sj, and the sets are pairwise
set, the sets Si and Sj are the same, and this single set contains both x and z.
So SS(x, z) is true, and we have proved that SS is transitive.
Equivalence Classes
• The universal relation U has a single equivalence class consisting of all the
elements. The equality relation has a separate equivalence class for each
element.
• In the parity relation, the set of even numbers forms one equivalence class
and the set of odd numbers forms another.
• If we let A be the set of people in the USA, and define R(x, y) to mean “x and
y are legal residents of the same state”, we get fifty equivalence classes, one
for each state. One of them is {x: x is a legal resident of Massachusetts}.
The Classes Form a Partition
• To finish the proof of the Partition Theorem, we must prove that if R is any
equivalence relation on A, the set of equivalence classes forms a partition.
• Note that in the set of classes, we only count a class once even if it has
multiple definitions. So if [x] and [y] are the same set, it is just one set of the
partition.
• Recall our three conditions for a set of sets to be a partition. Condition (1)
says that each set is a subset of A, which is clearly true for the classes.
• Condition (2) says that the sets union together to give A, which is true for the
classes because each element is in at least one class, its own.
• We still have to show (3) for the classes, that they are pairwise disjoint.
Finishing the Proof
• Let [x] and [y] be the equivalence classes of two arbitrary elements x and y of
A. (This gives us two arbitrary equivalence classes, which might or might not
be equal as sets.)
• We must show that ([x] ≠ [y]) → ([x] ∩ [y] = ∅). We’ll do this by contrapositive,
showing (∃z: z ∈ [x] ∩ [y]) → ([x] = [y]).
• Assume that an element z of [x] ∩ [y] exists and name it z. We must show that
[x] = [y], which means ∀w: (w ∈ [x]) (w ∈ [y]). By the definition of
equivalence classes, this means ∀w: R(x, w) R(y, w). So let w be arbitrary.
• We know that R(x, z) and R(y, z). Assume R(x, w). We have R(z, x) by
symmetry, and then R(y, z), R(z, x), and R(x, w) give us R(y, w) by transitivity.
• The argument that R(y, w) → R(x, w) is exactly the same as R(x, w) → R(y, w).