Fact-checked by Grok 2 weeks ago

Partial equivalence relation

A partial equivalence relation on a set is a that is symmetric (if x is related to y, then y is related to x) and transitive (if x is related to y and y is related to z, then x is related to z), but not necessarily reflexive (some elements may not be related to themselves). The of the can be partitioned into the where it is reflexive, on which it behaves exactly like a full , and the remaining elements that are unrelated to anything, including themselves. Partial equivalence relations, often abbreviated as PERs, arise naturally in mathematical logic and computer science, particularly in the semantics of type theories. In the PER model of intensional Martin-Löf type theory, types are interpreted as partial equivalence relations on the set of closed terms, where two terms are related if they are computationally equivalent up to a certain extent, allowing for partial definitions and undefined computations. This framework, pioneered in works like Allen's semantics for Constructive Type Theory, connects to Russell-style type definitions and supports extensional reasoning in otherwise intensional systems. Beyond type theory, PERs appear in categorical constructions, such as localizations of categories and PROPs for algebraic structures, where they model partial symmetries or equivalences in relational settings. They also relate to difunctional relations, though not all difunctional relations are partial equivalences, and find applications in formal verification and programming language semantics for handling polymorphism and computability.

Definition and Properties

Formal Definition

A partial equivalence relation on a set X is a R \subseteq X \times X that satisfies the properties of and , but is not required to be reflexive. Specifically, means that for all x, y \in X, if x \, R \, y, then y \, R \, x; means that for all x, y, z \in X, if x \, R \, y and y \, R \, z, then x \, R \, z. In logical notation, these axioms are expressed as \forall x \forall y \, (x \, [R](/page/R) \, y \to y \, [R](/page/R) \, x) and \forall x \forall y \forall z \, ((x \, [R](/page/R) \, y \land y \, [R](/page/R) \, z) \to x \, [R](/page/R) \, z). The domain of R, denoted \dom(R) = \{ x \in X \mid x \, R \, x \}, is the of X on which R is reflexive, and R restricted to \dom(R) forms a full that partitions \dom(R) into equivalence classes. Partial equivalence relations are often denoted using symbols such as \sim or \equiv. This contrasts with standard equivalence relations, which additionally require reflexivity on the entire set X.

Key Properties

A partial equivalence relation R on a set X is reflexive precisely on its D = \{ x \in X \mid x \, R \, x \}. For every x \in D, x \, R \, x holds by , while for x \notin D, no self-relation exists. This reflexivity on the domain arises from the and axioms: if x \, R \, y for some y \in X, then symmetry yields y \, R \, x, and transitivity implies x \, R \, x, placing x in D. The restriction of R to its domain D forms a full on D, as it satisfies reflexivity (on D), symmetry, and by construction. This equivalence relation partitions D into disjoint equivalence classes _R = \{ y \in D \mid x \, R \, y \} for x \in D, where each class groups elements indistinguishable under R. Under relational \circ, a partial equivalence relation R is idempotent, satisfying R \circ R = R. ensures R \circ R \subseteq R, as x \, R \, y and y \, R \, z imply x \, R \, z. For the reverse inclusion, if x \, R \, z, then x \in D implies x \, R \, x (reflexivity on ), so there exists y = x with x \, R \, y and y \, R \, z, yielding x \, (R \circ R) \, z; similarly supports this on the domain. The set D / \sim_R, consisting of the classes _R, captures the induced by R on its . If the ambient set X carries additional operations or compatible with R, these may induce well-defined operations on the , such as in algebraic or categorical contexts.

Relation to Other Relations

Comparison with Equivalence Relations

A partial equivalence relation on a set X is symmetric and transitive, but reflexive only on its , the of X where elements are related to themselves. In contrast, an on X is a partial equivalence relation that is total, meaning its equals X and it is reflexive everywhere on the set. This totality ensures that every element is partitioned into classes, whereas a partial equivalence relation induces equivalence classes only on its , leaving elements outside unrelated and effectively "undefined" with respect to the relation. The partial nature of such relations allows for flexible generalizations of relations, particularly useful in scenarios involving incomplete or restricted definitions, such as when modeling partial functions or domains in logic where not all elements require classification. For instance, elements outside the domain need not participate in the or properties, enabling applications where the full set X includes irrelevant or exceptional cases. The concept of partial equivalence relations emerged in the 1970s within the literature of logic and , notably in the development of by , as a means to generalize equivalences in constructive and . This terminology facilitated models where types are interpreted as partial equivalence relations on terms, bridging set-theoretic and computational perspectives. One key implication of this partiality is that partial equivalence relations do not necessarily extend to a total without imposing additional structure, such as choices for relating undefined elements, unlike the canonical compatibility of full equivalence relations with preorder extensions via constructions. Furthermore, partial equivalences are not inherently compatible with orders, as their restricted may conflict with the reflexivity required for preorders or partial orders on the entire set, necessitating supplementary conditions for such integrations.

Connection to Preorders and Partial Orders

A partial equivalence relation (PER) on a set can be derived from a by extracting its symmetric component. Specifically, given a \leq on a set X, define the relation \sim by x \sim y x \leq y and y \leq x; this \sim is symmetric and transitive, and due to the reflexivity of the , x \sim x holds for all x \in X, making \sim an on the entire set. This construction highlights how equivalence relations capture the "equivalence-like" behavior inherent in the mutual comparability within , while the itself may exhibit outside these pairs. The connection extends to partial orders by considering the relaxation of antisymmetry. A partial order is an antisymmetric preorder, so its symmetric closure—defined analogously as above—yields the equality relation on the entire set, which is a total equivalence relation rather than a proper PER. However, if antisymmetry is relaxed to form a general , the resulting symmetric part becomes a non-trivial equivalence relation on the entire set. Furthermore, given such a \leq and its induced equivalence relation \sim, the quotient set X / \sim inherits a well-defined partial order via \leq if and only if x \leq y for representatives x, y; this induced relation is antisymmetric because any symmetry in the quotient would contradict the preorder's structure modulo \sim. In , PERs arise as certain symmetric relations or profunctors in relational categories like Rel, where a from A to B is a of A \times B satisfying and when A = B. More abstractly, in bicategories such as the bicategory of relations PERel, objects are sets and morphisms are PERs on disjoint unions, with defined by the minimal PER extending the relational composition; this structure models partial maps and equivalences in a way that aligns with realizability and domain-theoretic semantics. Unlike full preorders, which permit asymmetric relations and thus directedness without reciprocity, PERs enforce , restricting them to undirected equivalence clusters within potentially larger ordered structures.

Examples

Kernels of Partial Functions

A partial equivalence relation can arise as the kernel of a partial function f: X \rightrightarrows Y between sets, defined by the relation \sim_f on X where x \sim_f y if and only if both x and y are in the domain of f (denoted f(x) \downarrow and f(y) \downarrow) and f(x) = f(y). Formally, x \sim_f y \iff f(x) \downarrow \land f(y) \downarrow \land f(x) = f(y). This relation holds only on the domain \operatorname{dom}(f) = \{x \in X \mid f(x) \downarrow\}, making \sim_f partial in the sense that it is undefined or non-reflexive outside this subset. The kernel \sim_f is a partial equivalence relation because it satisfies symmetry and transitivity on \operatorname{dom}(f). For symmetry, if x \sim_f y, then f(x) = f(y) with both defined, so y \sim_f x follows from the symmetry of equality. For transitivity, if x \sim_f y and y \sim_f z, then f(x) = f(y) = f(z) with all defined, so x \sim_f z by transitivity of equality. Reflexivity holds on \operatorname{dom}(f) since f(x) = f(x) whenever f(x) \downarrow. Thus, \sim_f restricts to an equivalence relation on \operatorname{dom}(f). Consider a partial function f: \mathbb{N} \rightrightarrows \mathbb{R} defined only on numbers, where f(2k+1) = \sqrt{2k+1} for k \in \mathbb{N}. The \sim_f equates distinct s $2k+1 \sim_f 2m+1 if \sqrt{2k+1} = \sqrt{2m+1}, which occurs only if k = m, so each is in its own class; evens are unrelated to anything, including themselves. This illustrates how the kernel partitions the into classes based on distinct images, while leaving the complement unrelated. In general, every partial equivalence relation \sim on X is the kernel of its quotient map q: X \rightrightarrows X/{\sim}, where the codomain is the set of equivalence classes on \operatorname{dom}(\sim) = \{x \in X \mid x \sim x\}, and q(x) = (the class of x) if x \in \operatorname{dom}(\sim), undefined otherwise. Then x \sim y if and only if both are defined under q and q(x) = q(y). This construction shows that partial equivalence relations are precisely the kernels of partial functions to quotient sets.

Functions Respecting Equivalence Relations

A partial equivalence relation can be constructed from an existing on a set by incorporating the of a . Specifically, let X be a set equipped with an \sim, and let g: X \rightharpoonup Z be a to another set Z. Define the relation \sim' on X by x \sim' y if and only if x \sim y, both x and y are in the of g, and g(x) = g(y). This relation \sim' is the of \sim with the of g, where the \ker g consists of pairs (x, y) such that g is defined at both and g(x) = g(y). Since the of an with another (or partial equivalence relation in the case of \ker g) yields a partial equivalence relation, \sim' satisfies and , with reflexivity holding on its (the of X with \dom g \times \dom g). The partial equivalence relation \sim' refines the original equivalence \sim restricted to the domain of g, meaning \sim' \subseteq \sim \cap (\dom g \times \dom g), resulting in a finer partition of that subdomain. If g respects \sim—that is, x \sim y implies g(x) = g(y) whenever both are defined—then \ker g \supseteq \sim, so \sim' coincides with the restriction of \sim to \dom g. Otherwise, \sim' properly refines \sim by imposing the additional condition from g, splitting some equivalence classes of \sim. This construction allows for modular refinement of partitions while preserving compatibility with the underlying structure of \sim. In group theory, consider the equivalence \sim on a group G induced by a H \leq G, where x \sim y if and only if x^{-1}y \in H (i.e., y \in xH). A g: G \to Z (possibly partial) can be used to define a finer partial equivalence relation \sim' via the above construction, intersecting \sim with \ker g. Homomorphisms that respect \sim—meaning g is constant on cosets of H and thus factors through the G/H—yield \sim' equivalent to the coset relation restricted to \dom g. This approach refines the coset , for instance, when g identifies elements within cosets based on additional homomorphic images, useful in studying quotient structures and subgroups. Unlike the standalone kernel of a , which induces a partial equivalence relation solely from in the (effectively refining the on the ), this construction builds upon a pre-existing \sim rather than starting from alone.

Equality of IEEE Floating Point Values

In floating-point arithmetic, the operator (=) defines a partial equivalence relation on the set of representable floating-point values, where Not a Number () values introduce partiality by failing to satisfy reflexivity. Specifically, every NaN compares as unordered (and thus unequal) to every value, including itself, such that NaN = NaN evaluates to false, while comparisons involving NaNs and other values also yield false for . The of this partial equivalence relation excludes and consists of all finite floating-point numbers along with positive and negative (±∞), on which the operator behaves as a standard . Within this , is reflexive (x = x holds for all x), symmetric (if x = y then y = x), and transitive (if x = y and y = z then x = z), mirroring the properties of in the real numbers but adapted to the discrete floating-point representation. However, the presence of NaNs outside the domain renders the relation partial overall, as not every pair of floating-point values is comparable under . For example, the equality 1.0 = 1.0 returns true, placing both representations in the same , whereas NaN = NaN returns false, excluding NaNs from any equivalence class. Equivalence classes within the domain are thus formed by values that compare equal, such as +0 and -0, which are considered identical under equality despite their differing signs. This design for handling NaNs was introduced in the original standard to represent results of undefined or exceptional operations—such as or of a —without causing program termination or requiring explicit error checking in every arithmetic operation. The standard's rationale emphasized propagating such exceptions through computations while allowing orderly comparisons, thereby supporting robust numerical software in computing systems.

Applications

In Set Theory and Logic

In set theory, partial equivalence relations (PERs) provide a framework for modeling extensional quotients in ill-founded sets and hypersets, particularly under Aczel's anti-foundation axiom (AFA), which posits that every set graph admits a unique decoration. This axiom, introduced in , allows the construction of non-well-founded sets by equating structures via bisimulation, where a PER captures the largest such relation on transition systems or set graphs, enabling the representation of infinite descending membership chains without violating other ZF axioms. In , PERs serve as models for partial inductive definitions and feature prominently in realizability semantics, originating from Kreisel's work in the and developed through his modified realizability interpretations in the and . These semantics interpret and by associating proofs with realizers in a partial computable functional, where a PER on the set of natural numbers or terms defines classes of realizers that validate the same propositions, accommodating partiality in non-constructive proofs. For instance, in ZF without the axiom of foundation, PERs define up to bisimulation for infinite structures, such as hypersets representing cyclic or infinitely branching graphs, by quotienting the universe under the largest bisimulation , which aligns set membership with structural . PERs also connect to Scott's , where they classify continuous functions between domains by modeling the logical relations that preserve approximations in cpos (complete partial orders), facilitating the semantics of recursive and higher-order functions in a denotational framework. A distinctive aspect of PERs is their allowance for partial membership in equivalence classes, where elements may lack a to themselves or others, which is crucial for constructing non-well-founded models that capture self-referential or infinite processes without requiring total reflexivity.

In Computer Science and Programming

In and proof assistants such as and Agda, partial equivalence relations (PERs) are employed to model setoids, which consist of a carrier type and a PER representing computational . This framework enables the construction of types where equality proofs may be partial, accommodating undefined or unprovable equalities without requiring full reflexivity. For instance, setoids allow heterogeneous equality to be handled via mechanisms, facilitating modular reasoning in constructive . PERs play a key role in univalent foundations, as developed by in the 2010s, where they support the definition of s and higher inductive types in proof assistants. By interpreting types as PERs on terms, this approach aligns intensional with , enabling equivalences between types to be treated computationally. In systems like , PER-based setoids are used for partial proofs in constructions, bridging classical univalence with constructive . In algorithms, union-find data structures often model partitions via PERs, supporting partial unions that leave undefined elements isolated. For example, in proof-producing union-find implementations, the structure maintains a partial equivalence where elements not yet unioned remain unrelated, ensuring and only on the defined . This partiality aids in verifying amortized complexity and correctness in concurrent or incremental settings. In programming, PERs handle partial data for approximate or error-tolerant comparisons, such as in fuzzy matching algorithms where incomplete inputs yield undefined . The operator on floating-point types exemplifies a PER, as values are not reflexive (), allowing symmetric and transitive comparisons while excluding invalid cases. Similarly, in databases, values in relational joins invoke , where with is undefined, modeling a partial that avoids false equivalences in queries. Computing the to extend a into a PER can be achieved using Warshall's algorithm adapted for partial domains, running in O(n³) time on n elements by iteratively propagating relations through intermediate vertices while respecting undefined pairs. This method ensures the resulting PER is minimal and efficient for dense representations in software implementations.

References

  1. [1]
    partial equivalence relation in nLab
    Mar 26, 2025 · A partial equivalence relation (sometimes abbreviated PER) is a binary relation satisfying the symmetry and transitivity conditions of an equivalence relation.
  2. [2]
    [PDF] Proof-Relevant Partial Equivalence Relations - Sam Speight
    Jun 18, 2024 · A partial equivalence relation (PER) is an homogeneous binary relation that is symmetric and transitive. PERs are important in semantics of type ...
  3. [3]
    The pro-PER meaning of "proper" - Lysxia's blog
    Apr 7, 2022 · In a partial equivalence relation, some elements are not related to any element, not even themselves. Formally, we simply drop the reflexivity ...<|control11|><|separator|>
  4. [4]
    Nuprl Basics - Types: Ontic, Semantic, and Intensional
    The general semantic form we adopt for types is to associate with each type expression a so-called partial equivalence relation, i.e. a symmetric transitive ...
  5. [5]
    [PDF] A Type Theory with Partial Equivalence Relations as Types - l'IRIF
    Allen gave a semantics of CTT where a type is a Partial Equivalence Relation (PER) on closed terms [1], which is connected to Russell's original definition of a ...
  6. [6]
    Categories of partial equivalence relations as localizations
    If ρ ∈ A ( A × A ) satisfies (sym) and (trans), we call it a partial equivalence relation. If ...
  7. [7]
    [PDF] The Algebra of Partial Equivalence Relations - Radboud Repository
    Keywords: PROP, distributive law, string diagram, partial equivalence relation, Frobenius algebra ... Definition 5.2 The PROP PFr is defined as PMn + PMnop ...
  8. [8]
    Partial equivalence relation - Wikipedia - Index of /
    Jul 15, 2018 · Every partial equivalence relation is a difunctional relation, but the converse does not hold. ... f\approx f means that f induces a well-defined ...
  9. [9]
    [PDF] Constructing Variants of the Category of Partial Equivalence Relations
    Oct 28, 2014 · Much of the application of this category is in providing semantics for programming languages, especially for polymorphism. [1], where there is ...
  10. [10]
    partial equivalence relation in nLab
    ### Formal Definition of Partial Equivalence Relation
  11. [11]
  12. [12]
    [PDF] Deciding 𝛽𝜂-Equivalence for Product and Function Types
    A symmetric and transitive binary relation is called a partial equivalence relation (per). Note that a per is an equivalence relation on its domain, for if ...
  13. [13]
    [PDF] On being the “same” or “different”: Introduction to Apartness
    Aug 7, 2014 · A partial equivalence relation (PER) is any binary relation, E, with the following properties. In fact, there is some redundancy in this ...
  14. [14]
    [PDF] Categories of partial equivalence relations as localizations - arXiv
    Apr 19, 2022 · Notation and Terminology 3.2 (a) If ρ ∈ A(A × A) satisfies (sym) and (trans), we call it a partial equivalence relation. If f : A → B ...
  15. [15]
    [PDF] Quotient Types in Type Theory
    In this case if we simply define a quotient by replacing the underlying partial equivalence relation with a new one R, undefined ele- ments in the base ...
  16. [16]
    [1111.1390] On extension of partial orders to total preorders ... - arXiv
    Nov 6, 2011 · For a partial order \preceq on a set X and an equivalency relation S defined on the same set X we derive a necessary and sufficient condition ...
  17. [17]
    The classification of preordered spaces in terms of monotones
    Aug 25, 2022 · Notice, a preorder \preceq is a partial order on the quotient set X/\mathord {\sim } = \{[x]|x\in X\}, consisting of all equivalence classes ...
  18. [18]
  19. [19]
    [PDF] Slightly Infinite Sets - mimuw
    Nov 30, 2018 · Define the kernel of f to be the partial equivalence relation on An which identifies two tuples if they are both in the domain of f and have ...<|control11|><|separator|>
  20. [20]
    Kernels, in a nutshell - ScienceDirect.com
    ... as an equivalence relation on the source of a partial function: Definition 5. The kernel ker f ⊆ A × A of a partial function f : A B is the set of pairs.
  21. [21]
    [PDF] An Enactivist-Inspired Mathematical Model of Cognition - arXiv
    Jun 10, 2022 · An equivalence relation E is a refinement of equivalence relation E , if. E ⊆ E , also denoted E ≤r E. A labeling function h is a ...
  22. [22]
    Mappings and equivalence
    Not all equivalence relations in a group correspond to homomorphisms. ... respect to a homomorphism. Homomorphic images of ... coset cosets. There is still another ...
  23. [23]
    [PDF] NON-WELL-FOUNDED SETS - Les-Mathematiques.net
    Of course we must relinquish the foundation axiom, but it will turn out that we need drop none of the other axioms of set theory. 1.3 Example: Consider the apg.
  24. [24]
    Non-wellfounded Set Theory - Stanford Encyclopedia of Philosophy
    Apr 16, 2008 · Non-wellfounded set refers to sets which contain themselves as members, and more generally which are part of an infinite sequence of sets.
  25. [25]
    [PDF] Computational interpretation of proofs: An introduction to realizability
    Apr 9, 2014 · 3 Kreisel's modified realizability. 4 Negative translations from LK ... Definition of the realizability relation n A n = Gödel code of a ...<|separator|>
  26. [26]
    [PDF] Notes on realizability | Andrej Bauer
    Feb 21, 2025 · 3 Realizability categories. 50. 6: A partial equivalence relation is a transitive symmetric relation. Because every 𝑥 is realized by ...
  27. [27]
    [PDF] Equilogical Spaces - Mathematics and Computation
    Mar 2, 2001 · x ≈D y =⇒ f(x) ≈E g(y) . We say that a partial equivalence relation ≈D on a domain D is dense when its domain dom(≈D) = ...
  28. [28]
    [PDF] Setoids in type theory
    A partial setoid consists of a type T (the carrier), a binary relation R on T (the book equality) and a proof that R is a partial equivalence relation over T.
  29. [29]
    [PDF] A Type Theory with Partial Equivalence Relations as ... - Vincent Rahli
    ... Partial Equivalence Relation (PER) on closed terms [1], which is connected to Russell's original definition of a type as “the range of significance of a ...
  30. [30]
    [PDF] Verifying the Correctness and Amortized Complexity of a Union-Find ...
    ... partial equivalence relation E in- stead of a domain D and a total function R. Indeed, every function except find can be given a useful specification in ...
  31. [31]
    Understanding Partial Equivalence in Rust's Floating-Point Types
    Sep 30, 2024 · PartialEq: Allows for partial comparison where equivalence might not always hold. This trait is used by types like f32 and f64, where ...
  32. [32]
    Exclude some types (eg floating point types) from Smithy's sets #1072
    Feb 1, 2022 · The EQ relation included in the IEEE standard is explicitly noted as a partial equivalence relation. It is not reflexive as there does not exist ...
  33. [33]
    [PDF] Database Relations with Null Values - UCLA Computer Science
    Null values in database relations, represented by “-”, denote that no information exists on that attribute, acting as a place holder for nonexistent or unknown ...
  34. [34]
    Computing the closure of a relation: Floyd-Warshall Algorithm
    Initial relation: · Find all transitivity relation that uses a node b as intermediary: We look for: Every possible combination (x ⇒ b) (b ⇒ z) · Repeat: for node ...