Equivalence Relation and Equivalence Class Calculator

Enter a finite set and binary relation to test whether the relation is reflexive, symmetric, and transitive. When all three properties hold, the calculator finds every equivalence class, the induced partition, and the class of an optional chosen element—all locally in your browser.

Enter the set and relation

Separate elements with commas, semicolons, or lines.6 unique elements
Use (a,b), a,b, or a -> b.12 lines
Enter one element from A to highlight its class, such as 4.

Private by design: the set, relation, and selected element are processed on this device. They are not uploaded, saved, or added to the page URL.

Equivalence analysis

The sample relation is analyzed below.

Advertisement

Equivalence relation and equivalence class definitions

A binary relation R on A is an equivalence relation exactly when it has all three properties below. Missing even one property means its related-element sets cannot be treated as equivalence classes.

Reflexive

∀a ∈ A, aRa

Every element is related to itself, so every diagonal pair (a,a) is present.

Symmetric

aRb ⇒ bRa

Whenever (a,b) is present, the reverse pair (b,a) is present.

Transitive

aRb ∧ bRc ⇒ aRc

Whenever two relation steps form a chain, the direct concluding pair is present.

For an equivalence relation, the equivalence class of a is [a] = {x ∈ A : aRx}. Symmetry makes the alternative convention {x ∈ A : xRa} produce the same class.

Why equivalence classes form a partition

Every element is covered

Reflexivity gives a ∈ [a], so each element belongs to at least one class.

Classes do not partly overlap

If two equivalence classes share an element, symmetry and transitivity imply that the classes are identical. Distinct classes are therefore disjoint.

Representatives are interchangeable

If aRb, then [a] = [b]. Any element shown in a class can serve as its representative.

The quotient set

The set of distinct classes is written A/R or A/∼. Its size is the number of blocks in the partition.

Worked equivalence-class example: congruence modulo 3

On A = {0,1,2,3,4,5}, relate two elements when they have the same remainder after division by 3. Restricting that relation to A gives the 12 ordered pairs loaded in the calculator.

ClassMembersReason
[0] = [3]{0, 3}Both have remainder 0 modulo 3.
[1] = [4]{1, 4}Both have remainder 1 modulo 3.
[2] = [5]{2, 5}Both have remainder 2 modulo 3.

The quotient set has three classes: A/R = {{0,3},{1,4},{2,5}}. Choosing 4 highlights [4] = {1,4}.

Input rules, assumptions, and limits

Set elements are case-sensitive text labels. Separate elements of A with commas, semicolons, or line breaks. Put one ordered pair on each relation line. Accepted pair styles are (a,b), [a,b], a,b, a -> b, and a → b. Whitespace around labels is ignored; internal spaces are retained.

Every endpoint in R and the optional class element must already appear in A. Duplicate set elements and duplicate ordered pairs are ignored and reported. Commas, semicolons, arrows, parentheses, square brackets, and line breaks are reserved separators and cannot be part of an element label.

The empty set and empty relation are supported. The empty relation on the empty set is an equivalence relation by vacuous truth and induces the empty partition. On a nonempty set, the empty relation fails reflexivity.

The calculator supports up to 200 set elements and 40,000 nonempty relation lines. It exhaustively checks the finite relation and lists up to eight witnesses per failed property in the on-page summary; the copied report includes all distinct missing pairs.

Definitions and the partition theorem follow Mathematics LibreTexts, “Equivalence Classes”.

Calculation note: the tool checks reflexivity over every element, symmetry over every entered pair, and transitivity over every two-step chain. Classes are generated only after all three tests pass. Last reviewed: .

Equivalence relation and class FAQ

What makes a relation an equivalence relation?

A binary relation on a set is an equivalence relation exactly when it is reflexive, symmetric, and transitive. All three tests must pass.

How do you find the equivalence class of an element?

For a ∈ A, collect every x ∈ A for which aRx. This set is [a]. Enter a in the optional field to highlight that class.

Do equivalence classes overlap?

Distinct equivalence classes do not overlap. Two classes are either exactly equal or disjoint, so the collection of distinct classes partitions the carrier set.

Can different elements represent the same equivalence class?

Yes. If aRb, then [a] = [b]. Every member of a class is a valid representative of that same class.

Is the empty relation an equivalence relation?

It is an equivalence relation on the empty set because reflexivity, symmetry, and transitivity all hold vacuously. On a nonempty set, it fails reflexivity because the diagonal pairs are missing.

Why are no classes shown for a non-equivalence relation?

For an arbitrary relation, sets of related elements may overlap without being equal, omit elements, or change with the chosen representative. The calculator shows property failures rather than calling those sets equivalence classes.

Does this calculator store my relation?

No. Parsing, analysis, copying, and CSV creation happen locally in your browser. The tool does not transmit or save your input.

Explore more tools