An equivalence relation on a set is a relation that is
- reflexive: for all ,
- symmetric: ,
- transitive: and .
These three axioms are exactly what is needed to group elements into clusters of “the same kind.”
Equivalence classes
The equivalence class of is the set of everything related to it:
Any member of a class is a valid representative: . So , , can all name the same class — listing them separately does not create new classes.
The partition theorem
The classes of an equivalence relation partition :
- every lies in some class (its own, by reflexivity), so the classes cover ;
- two classes are either identical or disjoint — if they share even one element they are equal.
Conversely, every partition of comes from a unique equivalence relation (relate iff they sit in the same block). “Equivalence relation” and “partition” are two views of the same object.
How to find the classes
When means “” for some function (a very common konkur setup), the classes are exactly the fibers of — group together all inputs sharing the same output value. Then count the distinct output values: that count is the number of classes.
Mini-example
Define on by (same remainder mod ). Tabulating :
| 0 | 1 | 2 | 3 | 4 | 5 | |
|---|---|---|---|---|---|---|
| 0 | 1 | 2 | 0 | 1 | 2 |
Grouping equal values gives the classes
so there are exactly 3 classes, and — they partition the set.
Exam trick: the number of equivalence classes equals the number of distinct values, not the number of representatives a choice happens to list. A class written as is one class shown three times; counting it three times (or trusting an option that pads the list with duplicate representatives) is the classic trap.