# Equivalence class

An **equivalence class** is the subset of a set that collects together all elements related to a given element by an equivalence relation, a relation that is reflexive, symmetric, and transitive. Given an equivalence relation \( \sim \) defined on a set \( A \), the equivalence class \( [a] \) of any \( a \in A \) collects together every element of \( A \) that is equivalent to \( a \).<sup>[1](https://uvicnotes.github.io/MATH-122/notes/2-4-equivalence-relations/)</sup> In symbols, \( [a] = \{ b \in A : b \sim a \} \)<sup>[2](https://terpconnect.umd.edu/~pbrosnan/notes/ugalg/sect0018.html)</sup>. Equivalence classes are the basic device by which mathematics treats distinct objects as interchangeable, and the set of all classes of a relation forms a partition of the underlying set<sup>[1](https://uvicnotes.github.io/MATH-122/notes/2-4-equivalence-relations/)</sup>.

| Key fact | Detail |
|---|---|
| Definition | For an equivalence relation \( \sim \) on \( A \), the class of \( a \) is \( [a] = \{ b \in A : b \sim a \} \)<sup>[2](https://terpconnect.umd.edu/~pbrosnan/notes/ugalg/sect0018.html)</sup> |
| Class equality | \( a \sim b \) if and only if \( [a] = [b] \); otherwise \( [a] \) and \( [b] \) are disjoint<sup>[3](https://www.youtube.com/watch?v=et4YDMbRqiM)</sup> |
| Partition theorem | The equivalence classes of any equivalence relation on \( A \) form a partition of \( A \)<sup>[4](https://people.clas.ufl.edu/pilyugin/files/Book-of-Proof.pdf)</sup> |
| Converse | Every partition \( \{A_n\} \) of \( X \) defines an equivalence relation by \( x \sim y \) iff \( x, y \) lie in the same part, and its classes are exactly the parts<sup>[5](https://webapps.math.uci.edu/~ndonalds/math13/notes.html)</sup> |
| Quotient set | The set \( X/\sim = \{ \hat{x} : x \in X \} \) of all equivalence classes is a subset of the power set \( \mathcal{P}(X) \)<sup>[6](https://webpages.ciencias.ulisboa.pt/~cabarbarosie/topology/textbook/index.shtml)</sup> |
| Canonical projection | \( \pi : X \to X/\sim \), \( \pi(x) = \hat{x} \), is onto, and \( x \sim y \) iff \( \pi(x) = \pi(y) \)<sup>[6](https://webpages.ciencias.ulisboa.pt/~cabarbarosie/topology/textbook/index.shtml)</sup> |
| Standard constructions | The integers, rational numbers, and real numbers are each built as sets of equivalence classes of pairs or sequences<sup>[7](https://lean-lang.org/doc/reference/latest/The-Type-System/Quotients/)</sup> |

## Basic properties

Two facts govern how classes behave. First, every element belongs to a class: since \( \sim \) is reflexive, \( a \in [a] \). Second, two classes either coincide or are disjoint. If \( [a] \) and \( [b] \) share an element \( c \), then \( c \sim a \) and \( c \sim b \), so by symmetry and transitivity \( a \sim b \), and the two classes are equal. This gives the central criterion: two elements are equivalent if and only if their equivalence classes are equal<sup>[3](https://www.youtube.com/watch?v=et4YDMbRqiM)</sup>.

Together these facts prove the partition theorem: the equivalence classes of an equivalence relation on \( A \) form a partition of \( A \), meaning a family of disjoint, nonempty subsets whose union is \( A \)<sup>[4](https://people.clas.ufl.edu/pilyugin/files/Book-of-Proof.pdf)</sup><sup> • </sup><sup>[8](https://www.cse.iitb.ac.in/~nutan/courses/cs207-12/notes/lec7.pdf)</sup>.

## Equivalence relations and partitions

The correspondence runs in both directions, and it is exact. If \( \sim \) is an equivalence relation on \( X \), its classes partition \( X \). Conversely, given a partition \( \{A_n\} \) of \( X \), the relation defined by \( x \sim y \) iff \( x \) and \( y \) lie in the same part \( A_n \) is reflexive, symmetric, and transitive, and its equivalence classes are precisely the distinct parts \( A_n \)<sup>[5](https://webapps.math.uci.edu/~ndonalds/math13/notes.html)</sup>. A small example shows the mechanism: partitioning \( X = \{1, 2, 3, 4, 5\} \) into \( A_1 = \{1, 3\} \), \( A_2 = \{2, 4\} \), and \( A_3 = \{5\} \) yields \( [1] = [3] = A_1 \), \( [2] = [4] = A_2 \), and \( [5] = A_3 \)<sup>[5](https://webapps.math.uci.edu/~ndonalds/math13/notes.html)</sup>.

In short, equivalence relations and partitions are essentially the same thing viewed from two sides: a relation sorts elements into classes, and a class structure determines which pairs count as related<sup>[5](https://webapps.math.uci.edu/~ndonalds/math13/notes.html)</sup>.

## The quotient set

The set of all equivalence classes of \( \sim \) on \( X \) is called the **quotient set**, written \( X/\sim \) or \( X/R \) when the relation is named \( R \). Set-theoretically it is the collection \( \{ \hat{x} : x \in X \} \), a subset of the power set \( \mathcal{P}(X) \)<sup>[6](https://webpages.ciencias.ulisboa.pt/~cabarbarosie/topology/textbook/index.shtml)</sup>. The map \( \pi : X \to X/\sim \) sending each element to its class is the **canonical projection**; it is onto, and choosing \( Y = X/\sim \) and \( f = \pi \) recovers the original relation from the identity \( x \sim y \Leftrightarrow f(x) = f(y) \). More generally, for any equivalence relation there is always an onto function \( f \) with \( x \sim y \Leftrightarrow f(x) = f(y) \)<sup>[6](https://webpages.ciencias.ulisboa.pt/~cabarbarosie/topology/textbook/index.shtml)</sup>.

The quotient set is where equivalence classes earn their keep: it is a new object whose elements are the classes themselves, so statements about it are statements about whole families of equivalent elements at once.

## Defining functions on classes

A function out of a quotient set must be well defined: its value on a class cannot depend on which representative of the class is used. Formally, a function \( f' \) on the underlying set descends to the quotient only if \( x \sim y \) implies \( f'(x) = f'(y) \). This requirement is built into formal proof systems. In the Lean theorem prover, functions from a quotient type must be accompanied by a proof that they respect the equivalence relation, implemented by the operation `Quotient.lift`<sup>[7](https://lean-lang.org/doc/reference/latest/The-Type-System/Quotients/)</sup>.

An alternative is to pick a single canonical representative from each class and work with those instead. When each class has such a representative, the resulting type satisfies the same universal property, and functions out of it need no well-definedness proof. For integers represented as pairs of natural numbers, each class has a canonical representative in which at least one of the two numbers is zero<sup>[7](https://lean-lang.org/doc/reference/latest/The-Type-System/Quotients/)</sup>.

## Number systems as equivalence classes

The standard constructions of the number systems are equivalence-class constructions. The integers are defined as pairs of natural numbers \( (n, k) \) encoding \( n - k \), with \( (n_1, k_1) \) and \( (n_2, k_2) \) declared equal when \( n_1 + k_2 = n_2 + k_1 \)<sup>[7](https://lean-lang.org/doc/reference/latest/The-Type-System/Quotients/)</sup>. The rational numbers are classes of pairs of integers \( (n, d) \) with \( d \neq 0 \), where \( \frac{n_1}{d_1} = \frac{n_2}{d_2} \) exactly when \( n_1 d_2 = n_2 d_1 \)<sup>[7](https://lean-lang.org/doc/reference/latest/The-Type-System/Quotients/)</sup>. Written out, the rational number denoted \( p/q \) in lowest terms is the class \( \{(pk, qk) : k \in \mathbb{Z},\ k \neq 0\} \); the symbol \( \mathbb{Q} \) is an abbreviation for "quotient"<sup>[9](https://pdvpmtasgaon.edu.in/uploads/dptmaths/HIstoryofmathematics.pdf)</sup>. The real numbers can be built from Cauchy sequences, whose representations are not unique; quotienting makes two sequences equal when their difference converges to zero<sup>[7](https://lean-lang.org/doc/reference/latest/The-Type-System/Quotients/)</sup>.

Other familiar relations work the same way. On the positive real numbers, declaring \( x \sim y \) when \( x \) and \( y \) have the same decimal parts is an equivalence relation, and the class \( [x] \) consists of all positive reals sharing \( x \)'s fractional part<sup>[10](https://math.libretexts.org/Courses/Monroe_Community_College/MTH_220_Discrete_Math/6%3A_Relations/6.3%3A_Equivalence_Relations_and_Partitions)</sup>. In the construction of fractions from pairs \( (a, b) \) of integers, the class of \( (a, b) \) is written not \( [(a,b)] \) but \( a/b \)<sup>[11](https://math.dartmouth.edu/~trs/PreTeXtProjects/old/abstract-algebra-refresher-CLI/output/web/section-2.html)</sup>.

## History

The general technique of appealing to equivalence classes appeared around the time of [Richard Dedekind](https://www.edgepedia.org/richard-dedekind), when set theory began to be introduced as a foundation for mathematics, and it took some time to become established. Earlier equivalence-class-style arguments occur in contexts backed by a concrete set, with Gauss's number theory in the *Disquisitiones Arithmeticae* a prominent example<sup>[12](https://link.springer.com/article/10.1007/s11229-018-1674-2)</sup>. Dedekind's Nachlass contains explicit sketches of two now familiar constructions: the integers as equivalence classes of pairs of natural numbers, and the rational numbers as equivalence classes of pairs of integers<sup>[13](https://plato.stanford.edu/entries/dedekind-foundations/)</sup>.

## Formalized mathematics

In Lean and its library Mathlib, quotient types are a primitive of the type system: given an equivalence relation on a type, the quotient type identifies related terms<sup>[14](https://leanprover-community.github.io/papers/mathlib-paper.pdf)</sup>. The equivalence relation is supplied as a `Setoid`, a type paired with a distinguished equivalence relation<sup>[7](https://lean-lang.org/doc/reference/latest/The-Type-System/Quotients/)</sup>. A proof that two elements are related suffices to prove them equal in the quotient, though definitional equality is unaffected: members of the same class are not necessarily definitionally equal<sup>[7](https://lean-lang.org/doc/reference/latest/The-Type-System/Quotients/)</sup>. Since `Quot.lift` has a computation rule built into Lean's definitional equality, the standard library employs quotient types to establish function extensionality, which would otherwise have to be postulated as an axiom.<sup>[7](https://lean-lang.org/doc/reference/latest/The-Type-System/Quotients/)</sup>

## References

1. [Equivalence Relations, MATH 122 notes, University of Victoria](https://uvicnotes.github.io/MATH-122/notes/2-4-equivalence-relations/)
2. [Partitions of sets and equivalence relations, UMD MATH 403 notes](https://terpconnect.umd.edu/~pbrosnan/notes/ugalg/sect0018.html)
3. [Equivalence Classes and Quotient Spaces, math-sup.fr video lecture](https://www.youtube.com/watch?v=et4YDMbRqiM)
4. [Equivalence Classes and Partitions, Book of Proof (University of Florida)](https://people.clas.ufl.edu/pilyugin/files/Book-of-Proof.pdf)
5. [Equivalence relations and equivalence classes, Math 13 notes, UC Irvine](https://webapps.math.uci.edu/~ndonalds/math13/notes.html)
6. [Topology textbook, Universidade de Lisboa](https://webpages.ciencias.ulisboa.pt/~cabarbarosie/topology/textbook/index.shtml)
7. [Quotients, The Lean Reference](https://lean-lang.org/doc/reference/latest/The-Type-System/Quotients/)
8. [CS 207 Discrete Mathematics lecture notes, IIT Bombay](https://www.cse.iitb.ac.in/~nutan/courses/cs207-12/notes/lec7.pdf)
9. [History of Mathematics (chapter on the rational numbers)](https://pdvpmtasgaon.edu.in/uploads/dptmaths/HIstoryofmathematics.pdf)
10. [Equivalence Relations and Partitions, Mathematics LibreTexts](https://math.libretexts.org/Courses/Monroe_Community_College/MTH_220_Discrete_Math/6%3A_Relations/6.3%3A_Equivalence_Relations_and_Partitions)
11. [Partitions and Equivalence Relations, Abstract Algebra Refresher, Dartmouth](https://math.dartmouth.edu/~trs/PreTeXtProjects/old/abstract-algebra-refresher-CLI/output/web/section-2.html)
12. [Equivalence: an attempt at a history of the idea, Synthese](https://link.springer.com/article/10.1007/s11229-018-1674-2)
13. [Dedekind's Contributions to the Foundations of Mathematics, Stanford Encyclopedia of Philosophy](https://plato.stanford.edu/entries/dedekind-foundations/)
14. [The Lean Mathematical Library](https://leanprover-community.github.io/papers/mathlib-paper.pdf)

---
*Topic: Encyclopedia › Physical world and mathematics › Mathematics and statistics › Logic and discrete mathematics › Formal logic and foundations › Set theory › Elementary set theory*

*Initially written Sep 17, 2026 · Reviewed: Sep 30, 2026; Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

*Copyright 2026 EdgeChat AI, a subsidiary of Biostate AI.*

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license
