Equivalence Relations & Partial Orders

How equivalence relations collapse interchangeable representations into quotient objects, while partial orders preserve distinction and expose dependency, bounds, lattices, and linear extensions.

An equivalence relation says that several representations should count as the same abstract object. A partial order says that distinct objects can be no greater than one another without requiring every pair to be comparable. Quotients, dependency graphs, version constraints, inheritance, dataflow, and state-space reduction all depend on knowing which of those two structures is actually present.

Property names are quantified contracts #

Let R⊆A×AR\subseteq A\times A. The variables below range over all of AA; they are not assumed distinct.

Property Contract
reflexive ∀x  xRx\forall x\;xRx
irreflexive ∀x  ¬xRx\forall x\;\neg xRx
symmetric ∀x,y  (xRy⇒yRx)\forall x,y\;(xRy\Rightarrow yRx)
asymmetric ∀x,y  (xRy⇒¬yRx)\forall x,y\;(xRy\Rightarrow\neg yRx)
antisymmetric ∀x,y  (xRy∧yRx⇒x=y)\forall x,y\;(xRy\land yRx\Rightarrow x=y)
transitive ∀x,y,z  (xRy∧yRz⇒xRz)\forall x,y,z\;(xRy\land yRz\Rightarrow xRz)
total / connected ∀x,y  (xRy∨yRx)\forall x,y\;(xRy\lor yRx), often required only for x≠yx\ne y when RR is strict

These words are not interchangeable:

  • “not reflexive” means ∃x  ¬xRx\exists x\;\neg xRx; irreflexive means no element relates to itself.
  • Antisymmetric does not mean “not symmetric.” Equality is both symmetric and antisymmetric. The subset relation ⊆\subseteq is antisymmetric but not symmetric.
  • An asymmetric relation is automatically irreflexive. A strict order such as << is asymmetric; a non-strict order such as ≤\le is reflexive and antisymmetric.
  • Transitivity never requires x,y,zx,y,z to be different. Adding that restriction produces a weaker, nonstandard property.

Equivalence relations turn representations into classes #

Reflexivity puts aa in its own class. Symmetry makes class membership direction-independent. Transitivity makes overlap collapse into equality:

a∼b  ⟺  [a]=[b].a\sim b \iff [a]=[b].

For the forward direction, if x∈[a]x\in[a], then x∼ax\sim a and a∼ba\sim b, so x∼bx\sim b and x∈[b]x\in[b]; reverse the roles for the other inclusion. For the reverse direction, a∈[a]=[b]a\in[a]=[b], so a∼ba\sim b.

The equivalence–partition theorem #

Every equivalence relation produces the partition

A/∼={[a]:a∈A}.A/{\sim}=\{[a]:a\in A\}.

The proof has three invariants:

  1. [a][a] is nonempty because a∼aa\sim a.
  2. The classes cover AA because every aa lies in [a][a].
  3. If [a][a] and [b][b] overlap at xx, then a∼x∼ba\sim x\sim b, so a∼ba\sim b and the classes are equal. Thus unequal classes are disjoint.

Conversely, a partition P\mathcal P defines

x∼Py  ⟺  ∃P∈P  (x∈P∧y∈P).x\sim_{\mathcal P}y \iff \exists P\in\mathcal P\;(x\in P\land y\in P).

Coverage and disjointness give each element a unique block. “Same block” is immediately reflexive, symmetric, and transitive. The two constructions undo each other, which is why formal libraries can move between setoids and partitions; Mathlib exposes this correspondence through its setoid/partition API.

The quotient forgets which representative was used but retains the class. That is useful only if later operations cannot observe the discarded difference.

Kernels, fibers, and canonical abstraction #

Every function f:A→Bf:A\to B induces an equivalence relation

x∼fy  ⟺  f(x)=f(y).x\sim_f y \iff f(x)=f(y).

Reflexivity, symmetry, and transitivity come directly from equality. Its classes are exactly the nonempty fibers f−1[{b}]f^{-1}[\{b\}]. The map factors as

A→qA/∼f→fˉran(f),A\xrightarrow{q}A/{\sim_f}\xrightarrow{\bar f}\mathop{\mathrm{ran}}(f),

where q(a)=[a]q(a)=[a] and fˉ([a])=f(a)\bar f([a])=f(a). The second map is bijective:

  • it is well-defined because all representatives in [a][a] have the same ff-value;
  • it is injective because equal outputs mean equal classes;
  • it is surjective by the definition of the range.

Well-defined functions on quotients #

Suppose ∼\sim is an equivalence relation on AA, ≈\approx one on BB, and we want

fˉ:A/∼→B/≈,fˉ([a])=[f(a)].\bar f:A/{\sim}\to B/{\approx},\qquad \bar f([a])=[f(a)].

The formula mentions a representative aa, so it defines a function only if changing representatives cannot change the output class:

a∼a′⇒f(a)≈f(a′).a\sim a'\Rightarrow f(a)\approx f(a').

This is the compatibility or well-definedness condition. Proving it is mandatory; writing brackets around a formula does not make it true.

The same test governs quotient automata, normalized paths, case-insensitive identifiers, and values modulo a representation invariant.

Orders keep identity but constrain direction #

Preorder
A reflexive, transitive relation. Distinct elements may satisfy both directions.
Partial order
A preorder that is antisymmetric.
Linear or total order
A partial order in which every pair is comparable.
Strict partial order
An irreflexive, transitive relation. It is automatically asymmetric.

For a partial order ≤\le, define

x<y  ⟺  x≤y∧x≠y.x<y \iff x\le y\land x\ne y.

Conversely, from a strict partial order << define x≤yx\le y iff x=yx=y or x<yx<y. Under the stated axioms these translations recover the corresponding strict/non-strict views. Formal order libraries make the same distinction: a preorder supplies reflexivity and transitivity, while a partial order adds antisymmetry; see Mathlib's partial-order definitions.

Examples clarify what each axiom does:

Carrier and relation Structure Why
subsets of UU under ⊆\subseteq partial order two inclusions force equality; many subsets are incomparable
positive integers under divisibility ∣\mid partial order a∣ba\mid b and b∣ab\mid a force a=ba=b for positive integers
integers under ≤\le linear order every pair is comparable
tasks under “can reach by zero or more dependency steps” preorder cycles create distinct tasks reachable in both directions
strict ancestry in a tree strict partial order no node is its own strict ancestor; ancestry composes

Hasse diagrams show only covers #

In a finite poset, xx is covered by yy when x<yx<y and there is no zz with x<z<yx<z<y. A Hasse diagram draws cover edges upward and omits reflexive loops, arrowheads, and edges implied by transitivity.

This is the divisibility order on the divisors of 1212. The missing edge 1→121\to12 is not a missing relation: transitivity recovers 1∣121\mid12. Nodes 44 and 66 are incomparable because neither divides the other. A Hasse diagram is therefore a transitive reduction of the order, not the complete adjacency relation.

Least, minimal, bounds, meet, and join #

Let SS be a subset of a poset (P,≤)(P,\le).

Concept Quantifier pattern Uniqueness
least element m∈Sm\in S m≤sm\le s for every s∈Ss\in S unique if it exists
minimal element m∈Sm\in S no s∈Ss\in S satisfies s<ms<m may be many
greatest element dual of least unique if it exists
maximal element dual of minimal may be many
lower bound ℓ∈P\ell\in P ℓ≤s\ell\le s for every s∈Ss\in S may lie outside SS
greatest lower bound ⋀S\bigwedge S greatest among lower bounds unique if it exists
least upper bound ⋁S\bigvee S least among upper bounds unique if it exists

In the divisibility poset above:

  • for S={2,3}S=\{2,3\}, both elements are minimal and maximal within SS, but SS has no least or greatest element;
  • the lower bounds of {4,6}\{4,6\} are {1,2}\{1,2\}, so the greatest lower bound is 22;
  • the only upper bound of {4,6}\{4,6\} within the displayed carrier is 1212, so its least upper bound is 1212.

The distinction is not vocabulary trivia. “Pick any minimal dependency” may admit several safe choices; “the least dependency” asserts a unique element below every other one.

Two canonical examples fix the notation:

  • (P(U),⊆)(\mathcal P(U),\subseteq) is a lattice with X∧Y=X∩YX\wedge Y=X\cap Y and X∨Y=X∪YX\vee Y=X\cup Y.
  • Positive divisors of nn, ordered by divisibility, form a lattice with meet gcd⁡\gcd and join lcm\mathop{\mathrm{lcm}}.

Not every poset is a lattice. The subposet {2,3,6}\{2,3,6\} under divisibility has no meet for 22 and 33, because their natural greatest common divisor 11 is outside the carrier.

From dependency graphs to orders #

A directed dependency graph is not automatically a partial order.

  1. Start with a direct-edge relation RR.
  2. Its reflexive-transitive closure R∗R^* means “reachable in zero or more steps” and is always a preorder.
  3. If the graph is acyclic, mutual reachability implies equality, so R∗R^* is antisymmetric and therefore a partial order.
  4. If cycles exist, distinct vertices in one cycle are mutually reachable; antisymmetry fails.

The repair is principled: define

x∼y  ⟺  xR∗y∧yR∗x.x\sim y \iff xR^*y\land yR^*x.

These are the strongly connected components (SCCs). Quotienting by ∼\sim collapses every cycle, and reachability between SCCs is a partial order. The resulting condensation graph is a DAG.

The four-state graph contains two cycles. The boxed SCC quotient has two abstract nodes and one directed order relation. This equivalence-then-order pattern is fundamental in module dependency analysis, automata minimization, build scheduling, and fixed-point computation.

Every preorder has a partial-order quotient #

The SCC construction is a special case. For any preorder ⪯\preceq, define

x∼y  ⟺  x⪯y∧y⪯x.x\sim y \iff x\preceq y\land y\preceq x.

This is an equivalence relation:

  • reflexivity follows from x⪯xx\preceq x;
  • symmetry is built into the conjunction;
  • transitivity follows by composing both directions.

Define [x]≤q[y][x]\le_q[y] iff x⪯yx\preceq y. This is well-defined: if x′∼xx'\sim x and y∼y′y\sim y', then

x′⪯x⪯y⪯y′.x'\preceq x\preceq y\preceq y'.

The quotient relation is reflexive and transitive, and if both [x]≤q[y][x]\le_q[y] and [y]≤q[x][y]\le_q[x], then x∼yx\sim y, hence [x]=[y][x]=[y]. Antisymmetry has been recovered precisely by identifying the pairs that violated it.

Linear extensions and scheduling #

A linear extension of a finite poset is a total order that preserves every original comparison. Orient each Hasse edge from prerequisite to dependent; any topological ordering of that DAG is a linear extension.

The algorithmic invariant is simple: a node with indegree zero has no unplaced predecessor, so choosing it next cannot violate the partial order. Remove it and repeat. Different choices among currently minimal nodes produce different valid schedules.

Equivalence closure versus transitive closure #

Given an arbitrary relation RR:

  • reflexive closure adds all (x,x)(x,x);
  • symmetric closure adds reversed pairs;
  • transitive closure adds positive-length consequences;
  • equivalence closure is the least relation containing RR that is reflexive, symmetric, and transitive.

For a finite undirected edge list, equivalence closure is exactly “belongs to the same connected component,” which disjoint-set union (union–find) maintains efficiently. For a directed relation, ordinary connected components are not enough: direction matters, so use SCCs for mutual reachability or transitive closure for one-way reachability. Mathlib treats these as distinct formal constructions (ReflGen, SymmGen, TransGen, ReflTransGen, and EqvGen) rather than overloading one word “closure.”

Diagnostic checklist #

Before using a relation as an equivalence or order, test the intended meaning:

  1. Are the carrier and relation type fixed? Congruence modulo nn on Z\mathbb Z produces Z/nZ\mathbb Z/n\mathbb Z; silently switching the carrier to N\mathbb N changes the quotient.
  2. Does “same” really satisfy transitivity? “Shares a tag with” is symmetric but need not be transitive.
  3. Are partition blocks nonempty, covering, and pairwise disjoint?
  4. Is every quotient operation independent of representatives?
  5. Does two-way comparability force equality? If not, the structure is a preorder; quotient the mutual pairs.
  6. Are incomparable elements allowed? If yes, do not apply linear-order intuitions.
  7. Is an element least/greatest, merely minimal/maximal, or only a bound outside the subset?
  8. Does a Hasse diagram show cover edges only, with crossings that do not imply junctions?

The decisive habit is to translate each word back into its quantifiers and then search for a smallest counterexample.

Sources

  1. bookSets, Functions, and Relations: Part I — Naïve Set Theorypdfnotes
  2. bookSpecial Sections of Mathematics 1: Discrete Mathematics, Section 1, Topic 1pdfnotes
  3. docsMathlib — Setoids and Partitions
  4. docsMathlib — Partial Orders
  5. docsMathlib — Bounds
  6. docsMathlib — Relations and Relation Closures

Searches titles, aliases, headings, summaries, and full text.↑↓ move ↵ open esc close