This article is about the notion of equality as a proposition or predicate. For equality as a judgment, see judgmental equality. For equality as a type, see typal equality. For other notions of equality, see equality.
natural deduction metalanguage, practical foundations
type theory (dependent, intensional, observational type theory, homotopy type theory)
computational trinitarianism =
propositions as types +programs as proofs +relation type theory/category theory
equality (definitional, propositional, computational, judgemental, extensional, intensional, decidable)
identity type, equivalence of types, definitional isomorphism
isomorphism, weak equivalence, homotopy equivalence, weak homotopy equivalence, equivalence in an (∞,1)-category
Examples.
The usual notion of equality in mathematics as a proposition or a predicate, and the notion of equality of elements in a set. This notion of equality can be formalized in predicate logic over type theory and in dependent type theory.
Propositional equality is most commonly used in set theories like ZFC and ETCS and dependently sorted set theories, as well as in set-level type theories where all identity types are propositions.
Propositional equality can be contrasted with judgmental equality, where equality is a judgment, and typal equality, where equality is a type.
In any two-layer type theory with a layer of types and a layer of propositions, or equivalently a first order logic over type theory or a first-order theory, every type has a binary relation according to which two elements and of are related if and only if they are equal; in this case we write . Since relations are propositions in the context of a term variable judgment in the type layer, this is called propositional equality. The formation and introduction rules for propositional equality is as follows
Then we have the elimination rules for propositional equality:
Something similar occurs in untyped first-order logic, where the domain of discourse has a binary relation according to which two elements and are related if and only if they are equal; in this case we write . Since relations are propositions in the context of a term variable judgment in the type layer, this is similarly called propositional equality. The formation and introduction rules for propositional equality is as follows
Then we have the elimination rules for propositional equality:
The introduction rule of propositional equality says that propositional equality is reflexive.
We can show that propositional equality is symmetric, that for all and such that , we have . By the introduction rule, we have that for all , we have that , and because all propositions imply themselves, we have that implies . Thus, by the elimination rules for propositional equality, for all and such that , we have .
We can also show that propositional equality is transitive, that for all , , and such that , implies that . By the introduction rule, we have that for all and , we have that , and because all propositions imply themselves, we have that implies , and because true propositions imply true propositions, we have that implies that implies . Thus, by the elimination rules for propositional equality, for all , , and such that , implies that .
Thus, propositional equality is an equivalence relation.
For all function and elements and such that , :
This is because for all functions , by the introduction rule for propositional equality, for all elements , , and the elimination rule for propositional equality states that if for all elements , , then for all elements and such that , .
The extensionality principle for function types (function extensionality) states that for all functions and , if and only if for all and such that ,
Constructive mathematics is mathematics in which the law of excluded middle does not necessarily hold for propositions, subsingletons, or h-propositions. Classical mathematics is mathematics in which the law of excluded middle does hold for propositions, subsingletons, or h-propositions.
In classical mathematics, propositional equality of sets is a stable equivalence relation, and denial inequality of sets is a tight apartness relation. However, in constructive mathematics, propositional equality cannot be proven to be stable for all sets, and denial inequality cannot be proven to be a tight apartness relation for all sets. Instead, one could distinguish between 4 different notions of propositional equality and inequality:
tight apartness relations. However, not all sets have tight apartness relations.
propositional equality, which is an equivalence relation; set with tight apartness relations have stable equality.
denial inequality, which can only be proven to be a weakly tight irreflexive symmetric relation. However, all statements in classical mathematics involving only denial inequalities hold in constructive mathematics, by the double negation translation and the property that for any proposition , if and only if .
the double negation of propositional equality, which can only be proven to be a stable reflexive symmetric relation. However, all statements in classical mathematics involving only equality hold in constructive mathematics with the equality replaced by its double negation, by the double negation translation.
The sets in which propositional equality and inequality behaves as it does in classical mathematics are the classical sets, the sets with an apartness relation such that every pair of elements are either equal or apart from each other.
As a result, in constructive mathematics, sometimes one takes sets with tight apartness relations instead of general sets to be the foundational primitive concept. In classical mathematics, this is unnecessary, because every set has a tight apartness relation.
In dependent type theory, the term propositional equality is used to describe a notion of equality type different from that of judgmental equality.
More specifically, there are two interpretations of propositions and logic in dependent type theory:
The propositions as types interpretation, which says that all types are propositions. The term propositional equality is used as a synonym of typal equality in referring to identifications or identity types.
The propositions as some types interpretation, which says that only the subsingletons or h-propositions are propositions. The term propositional equality in this interpretation is not a synonym of typal equality and only refers to the unique identifications or the h-proposition valued identity types.
However, in any set-level type theory, typal equality and propositional equality are the same, since any axiom of set truncation implies that all identity types are valued in h-propositions. As a result, this distinction between typal equality and propositional equality only matters in dependent type theories which are not set-level type theories.
Most homotopy type theorists use the propositions as types interpretation of propositional equality as a synonym of typal equality, even by those who use the propositions as some types interpretation for everything else. Kevin Buzzard in Buzzard 2024 has used this fact and how that contradicts the interpretation of propositional equality elsewhere in mathematics as an argument for adopting a set-level type theory instead of homotopy type theory.
By Buzzard’s argument, homotopy type theorists should not be using the term “equality” to refer to arbitrary identifications or identity types, whether in its bare form or as “propositional equality” or “typal equality”, instead restricting the use of equality / propositional equality for only the unique identifications and the h-proposition valued identity types, and using a suitable alternative for “typal equality”, such as “identification” and “identified” and “identity type”.
Indeed, since a contractible type is equivalently a pointed proposition, propositional equality can be defined in terms of unique identifications by the equivalence of types
We say that two elements and are
propositionally equal if the identity type is a pointed proposition.
uniquely identified if the identity type is a contractible type in the usual sense.
Expanding out the definitions,
a witness of propositional equality consists of an identification and a family of contractions showing that every identification is a center of contraction of the identity type.
a witness of unique identification consists of an identification and a contraction showing that the identification is the center of contraction of the identity type.
The type family is always a binary relation, because isContr is always a proposition in dependent type theory. In fact, if all identifications in an identity type are unique (i.e. there is a function ), then the identity type is an h-proposition, and if the identity type is an h-proposition, then all identifications in the identity type are unique. Thus, unique identifications and propositional equalities are the same, which justifies the use of for .
An h-set is then precisely a type where all identifications are unique, and the uniqueness of identity proofs can then be represented by a propositional analogue of equality reflection for extensional type theory:
making typal equality and propositional equality synonyms of each other again, because then all identity types are propositions and all identifications are unique.
Propositional equality defined in this manner is similar to the preset and setoid approaches to foundations of mathematics.
Propositional equality satisfies the principle of substitution by transport of the unique identification across predicates, and satisifes the identity of indiscernibles because propositional equality is always a proposition, and so we have:
The identity of indiscernibles doesn’t work for arbitrary identity types of a type because the type on the right hand side of the equivalence of types is always a proposition, and so if it were true, it would imply that is an h-set; hence the necessity to restrict to identity types with a unique identification.
However, propositional equality defined in this manner is not an equivalence relation because it is not a reflexive relation: for any loop space type which is not a contractible type, the proposition is an empty type. The only such types with a reflexive propositional equality are thus those that satisfy axiom K: the h-sets, thus making non-set types presets. However, one can consider the maximal subset of a type, given by the subtype , where propositional equality is reflexive.
Furthermore, the type-theoretic functions are prefunctions with respect to propositional equality. While functions do preserve identifications, they do not preserve propositional equality in the sense of the uniqueness of identifications. Any identification is given by a function out of the interval type , and the inductively generated identification in the interval type is unique in , but not all identifications are unique in the absence of uniqueness of identity proofs. One can define an extensional function as one that does preserve the uniqueness of identifications, and prove that functions between h-sets preserve the uniqueness of identifications, and that h-sets are precisely the types between which all functions preserve uniqueness of identifications. To say that all functions are extensional along the lines of the preset approach to set theory is equivalent to the uniqueness of identity proofs that implies that all types are h-sets.
In logic over dependent type theory, there are two notions of propositional equality
the usual internal notion of propositional equality of dependent type theory as an identity type or a h-proposition valued identity type
the external notion of propositional equality, which is the equality judged to be a proposition; i.e. .
External propositional equality is used as an alternative of judgmental equality for definitional equality in logic over dependent type theory, and thus is used in the computation rules and uniqueness rules of types:
Also, if there is no external propositional equality for types, then the principle of substitution is given by explicit transport functions for external propositional equality . One can show that and are definitional isomorphisms of each other.
The heterogeneous external propositional equality is given by the logically equivalent relations
Relations and propositional equality could be internalized in any set theory: the internal propositional equality in set theory is the smallest internal reflexive relation on , and it is in fact an internal equivalence relation; it is the only internal equivalence relation on that is also a partial order (although that fact is somewhat circular). This relation is often called the identity relation on , either because ‘identity’ can mean ‘equality’ or because it is the identity for composition of relations.
In the category of reflexive relations on , the equality relation on is an initial reflexive relation; when the equality relation is a type family instead of a family of propositions, then the equality relation is the initial type generated by reflexivity or the first law of thought.
As a subset of , the equality relation is often called the diagonal and written or similarly. As an abstract set, this subset is isomorphic to itself, so one also sees the diagonal as a map, the diagonal function , which maps to ; note that . This is in Set; analogous diagonal morphisms exist in any cartesian monoidal category.
The usual notion of equality as a proposition is discussed in
Wikipedia, Equality (mathematics)
Kevin Buzzard, Grothendieck’s use of equality (arXiv:2405.10387)
Last revised on June 16, 2025 at 12:40:21. See the history of this page for a list of all contributions to it.