# Partial equivalence relation

In mathematics, a partial equivalence relation (often abbreviated as PER, in older literature also called restricted equivalence relation[1]) is a homogeneous binary relation that is symmetric and transitive. If the relation is also reflexive, then the relation is an equivalence relation.

## Definition

Formally, a relation ${\displaystyle R}$ on a set ${\displaystyle X}$ is a PER if it holds for all ${\displaystyle a,b,c\in X}$ that:

1. if ${\displaystyle aRb}$, then ${\displaystyle bRa}$ (symmetry)
2. if ${\displaystyle aRb}$ and ${\displaystyle bRc}$, then ${\displaystyle aRc}$ (transitivity)

Another more intuitive definition is that ${\displaystyle R}$ on a set ${\displaystyle X}$ is a PER if there is some subset ${\displaystyle Y}$ of ${\displaystyle X}$ such that ${\displaystyle R\subseteq Y\times Y}$ and ${\displaystyle R}$ is an equivalence relation on ${\displaystyle Y}$. The two definitions are seen to be equivalent by taking ${\displaystyle Y=\{x\in X\mid x\,R\,x\}}$.[2]

## Properties and applications

The following properties hold for a partial equivalence relation ${\displaystyle R}$ on a set ${\displaystyle X}$:

• ${\displaystyle R}$ is an equivalence relation on the subset ${\displaystyle Y=\{x\in X\mid x\,R\,x\}\subseteq X}$.[note 1]
• difunctional: the relation is the set ${\displaystyle \{(a,b)\mid fa=gb\}}$ for two partial functions ${\displaystyle f,g:X\rightharpoonup Y}$ and some indicator set ${\displaystyle Y}$
• right and left Euclidean: For ${\displaystyle a,b,c\in X}$, ${\displaystyle aRb}$ and ${\displaystyle aRc}$ implies ${\displaystyle bRc}$ and similarly for left Euclideanness ${\displaystyle bRa}$ and ${\displaystyle cRa}$ imply ${\displaystyle bRc}$
• quasi-reflexive: If ${\displaystyle x,y\in X}$ and ${\displaystyle xRy}$, then ${\displaystyle xRx}$ and ${\displaystyle yRy}$.[3][note 2]

None of these properties is sufficient to imply that the relation is a PER.[note 3]

### In non-set-theory settings

In type theory, constructive mathematics and their applications to computer science, constructing analogues of subsets is often problematic[4]—in these contexts PERs are therefore more commonly used, particularly to define setoids, sometimes called partial setoids. Forming a partial setoid from a type and a PER is analogous to forming subsets and quotients in classical set-theoretic mathematics.

The algebraic notion of congruence can also be generalized to partial equivalences, yielding the notion of subcongruence, i.e. a homomorphic relation that is symmetric and transitive, but not necessarily reflexive.[5]

## Examples

A simple example of a PER that is not an equivalence relation is the empty relation ${\displaystyle R=\emptyset }$, if ${\displaystyle X}$ is not empty.

### Kernels of partial functions

If ${\displaystyle f}$ is a partial function on a set ${\displaystyle A}$, then the relation ${\displaystyle \approx }$ defined by

${\displaystyle x\approx y}$ if ${\displaystyle f}$ is defined at ${\displaystyle x}$, ${\displaystyle f}$ is defined at ${\displaystyle y}$, and ${\displaystyle f(x)=f(y)}$

is a partial equivalence relation, since it is clearly symmetric and transitive.

If ${\displaystyle f}$ is undefined on some elements, then ${\displaystyle \approx }$ is not an equivalence relation. It is not reflexive since if ${\displaystyle f(x)}$ is not defined then ${\displaystyle x\not \approx x}$ — in fact, for such an ${\displaystyle x}$ there is no ${\displaystyle y\in A}$ such that ${\displaystyle x\approx y}$. It follows immediately that the largest subset of ${\displaystyle A}$ on which ${\displaystyle \approx }$ is an equivalence relation is precisely the subset on which ${\displaystyle f}$ is defined.

### Functions respecting equivalence relations

Let X and Y be sets equipped with equivalence relations (or PERs) ${\displaystyle \approx _{X},\approx _{Y}}$. For ${\displaystyle f,g:X\to Y}$, define ${\displaystyle f\approx g}$ to mean:

${\displaystyle \forall x_{0}\;x_{1},\quad x_{0}\approx _{X}x_{1}\Rightarrow f(x_{0})\approx _{Y}g(x_{1})}$

then ${\displaystyle f\approx f}$ means that f induces a well-defined function of the quotients ${\displaystyle X/{\approx _{X}}\;\to \;Y/{\approx _{Y}}}$. Thus, the PER ${\displaystyle \approx }$ captures both the idea of definedness on the quotients and of two functions inducing the same function on the quotient.

### Equality of IEEE floating point values

The IEEE 754:2008 floating point standard defines an "EQ" relation for floating point values. This predicate is symmetrical and transitive, but is not reflexive because of the presence of NaN values that are not EQ to themselves.

## Notes

1. ^ By construction, ${\displaystyle R}$ is reflexive on ${\displaystyle Y}$ and therefore an equivalence relation on ${\displaystyle Y}$.
2. ^ This follows since if ${\displaystyle xRy}$, then ${\displaystyle yRx}$ by symmetry, so ${\displaystyle xRx}$ and ${\displaystyle yRy}$ by transitivity. It is also a consequence of the Euclidean properties.
3. ^ For the equivalence relation, consider the set ${\displaystyle E=\{a,b,c,d\}}$ and the relation ${\displaystyle R=\{a,b,c\}^{2}\cup \{(d,a)\}}$. ${\displaystyle R}$ is an equivalence relation on ${\displaystyle \{a,b,c\}}$ but not a PER on ${\displaystyle E}$ since it is neither symmetric (${\displaystyle dRa}$, but not ${\displaystyle aRd}$) nor transitive (${\displaystyle dRa}$ and ${\displaystyle aRb}$, but not ${\displaystyle dRb}$). For Euclideanness, xRy on natural numbers, defined by 0 ≤ xy+1 ≤ 2, is right Euclidean, but neither symmetric (since e.g. 2R1, but not 1R2) nor transitive (since e.g. 2R1 and 1R0, but not 2R0).

## References

1. ^ Scott, Dana (September 1976). "Data Types as Lattices". SIAM Journal on Computing. 5 (3): 560. doi:10.1137/0205037.
2. ^ Mitchell, John C. (1996). Foundations for programming languages. Cambridge, Mass.: MIT Press. pp. 364–365. ISBN 0585037892.
3. ^ Encyclopaedia Britannica (EB); although EB's notion of quasi-reflexivity is Wikipedia's notion of left quasi-reflexivity, they coincide for symmetric relations.
4. ^ Salveson, A.; Smith, J.M. (1988). "The strength of the subset type in Martin-Lof's type theory". [1988] Proceedings. Third Annual Information Symposium on Logic in Computer Science. pp. 384–391. doi:10.1109/LICS.1988.5135. ISBN 0-8186-0853-6. S2CID 15822016.
5. ^ J. Lambek (1996). "The Butterfly and the Serpent". In Aldo Ursini; Paulo Agliano (eds.). Logic and Algebra. CRC Press. pp. 161–180. ISBN 978-0-8247-9606-8.