Redirected from "definitional equality".
This article is about the notion of equality as a judgment. For equality as a proposition or predicate, see propositional equality. For equality as a type, see typal equality. For other notions of equality, see equality.
Context
Type theory
Equality and Equivalence
equivalence
-
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
-
natural equivalence, natural isomorphism
-
gauge equivalence
-
Examples.
principle of equivalence
equation
-
fiber product, pullback
-
homotopy pullback
-
Examples.
-
linear equation, differential equation, ordinary differential equation, critical locus
-
Euler-Lagrange equation, Einstein equation, wave equation
-
Schrödinger equation, Knizhnik-Zamolodchikov equation, Maurer-Cartan equation, quantum master equation, Euler-Arnold equation, Fuchsian equation, Fokker-Planck equation, Lax equation
Contents
Idea
In logic and type theory, there are two related notions of equality, judgmental equality and definitional equality.
According to PML (1980), p. 31:
Definitional equality is intensional equality, or equality of meaning (synonymy). [] It is a relation between linguistic expressions [] Definitional equality is the equivalence relation generated by abbreviatory definitions, changes of bound variables and the principle of substituting equals for equals. [] Definitional equality can be used to rewrite expressions [].
on p. 60:
… intensional (sameness of meaning) …
In a similar manner to the usual implicit notion of meta-theoretic conversion and explicit conversion in dependent type theory, as well as the usual implicit notion of meta-theoretic parametricity and explicit parametricity in parametric dependent type theory, dependent type theories can be distinguished between those with
-
explicit definitional equality, which have a separate equality to explicitly represent definitional equality in the syntax of the theory itself. The vast majority of dependent type theories have explicit definitional equality.
-
meta-theoretic definitional equality, which do not have a separate equality for definitional equality. Examples of such dependent type theories include some flavors of objective type theory.
Explicit definitional equality is also used in single-level type theories like Martin-Löf type theory or higher observational type theory for the conversion rules of some inductive types and in cubical type theory and simplicial type theory to define probe shapes for (infinity,1)-categorical types which could not be coherently defined in vanilla dependent type theory.
In dependent type theory, there are different kinds of judgmental equalities
Judgmental equality of terms is additional structure on types which gives every type the structure of a set in addition to the -groupoidal structure on a type from the identity type.
Judgmental equality of types could be thought of as making explicit the implicit coercion of equivalent types as subtypes, and is preserved throughout the type theory as congruences.
Judgmental equality of types is not necessary for dependent type theory with a separate type judgment. It behaves similarly to the equality between sets in structural set theory, and the equality between sets is not necessary for structural set theory since one could simply work with bijections or one-to-one correspondences between sets. Similarly, in dependent type theory, one could just work with definitional isomorphisms instead of judgmental equality of types.
Judgmental equality of terms
Judgmental equality of terms is given by the following judgment:
- - and are judgmentally equal well-typed terms of type in context .
Judgmental equality of terms can be contrasted with propositional equality of terms, where equality is a proposition in the sense of first-order logic, and typal equality of terms, where equality is a type.
Inference rules
Judgmental equality is an equivalence relation:
- Reflexivity of judgmental equality
In addition, judgmental equality of terms has congruence rules for substitution, the principle of substitution:
- Principle of substitution for judgmentally equal terms:
If there is a separate type judgment, then there is also a separate rule for the principle of substitution into type families.
If one has judgmental equality of types, then the principle of substitution into type families is given by
This implies the reflection rule of the equality judgment as shorthand for typal equality because one could derive the following rule:
Otherwise, the principle of substitution into type families is given by definitional transport across judgmental equality as explicit conversion:
where is the definitional isomorphism type defined using natural deduction inference rules. If one doesn’t have a type of definitional isomorphisms, one could define it by components
This shows that transport across judgmental equality forms a groupoid.
Either way, this also implies the reflection rule of the equality judgment as shorthand for typal equality because one could derive the following rule
Similarly, for a term dependent upon , if one has judgmental equality of types, then the principle of substitution across is given by the rule:
Otherwise, it is given by a judgmental version of function application to identifications:
In computation and uniqueness rules
Judgmental equality of terms can be used in the computation rules and uniqueness rules of types:
- Computation rules for dependent product types:
- Uniqueness rules for dependent product types:
- Computation rules for negative dependent sum types:
If one does not have judgmental equality of types, then one would have to use transport across judgmental equality for the second computation rule:
- Uniqueness rules for negative dependent sum types:
- Computation rules for identity types:
Judgmental equality of types
In dependent type theory with a separate type judgment, judgmental equality of types is given by the following judgment:
- - and are judgmentally equal well-typed types in context .
Inference rules
The variable conversion rule for judgmentally equal types:
In addition to the variable conversion rule, there are reflexivity, symmetry, and transitivity rules making judgmental equality for types an equivalence relation:
- Reflexivity of judgmental equality
Congruence rules for judgmental equality of types
In addition, judgmental equalities have congruence rules for every type in the type theory.
- Congruence rules for dependent function types
- Congruence rules for dependent pair types:
- Congruence rules for identity types:
- Congruence rules for the empty type:
- Congruence rules for the type of booleans:
- Congruence rules for the natural numbers type:
Similarly, we have congruence rules for every axiom in the dependent type theory, such as
Judgmental equality of contexts
In some dependent type theories, there is also judgmental equality of contexts, which is given by the following judgment:
- - and are judgmentally equal contexts.
There are reflexivity, symmetry, and transitivity rules making judgmental equality for contexts an equivalence relation:
- Reflexivity of judgmental equality
History
The notion of judgmental or definitional equality was introduced first in AUTOMATH. The following paper presents a suggestive explanation of this notion and how proof-checking was designed in this system (especially section 10):
On the roles of types in mathematics
The notion of judgmental or definitional equality was later introduced by Per Martin-Löf, first in the context of normalization proofs for higher-order logic in the paper Hauptsatz for Intuitionistic Simple Type Theory and generalized in Type Theory. He discusses this notion in the paper About Models for Intuitionistic Type Theory and The notion of Definitional Equality.
The extension from AUTOMATH is that one adds the notion of data type (natural number), of constructors (zero and successor) and primitive recursion as definitional equality. The motivation is that one can consider the schema of primitive recursion as a definition of a function.
This was also influenced by natural deduction, where constructors correspond to introduction rules and the work of Gödel on system T.
With this extension, one obtains a programming language with dependent types and where computations correspond to unfolding of definitions (that can be primitive recursive definitions). This programming language has the feature that all computations terminate. This has been also considered in functional programming, see e.g. the discussion in this paper.
A description of the evaluation algorithm using techniques from functional programming can be found in this work of Gregoire and Leroy.
See also
References
-
Robin Adams, Pure type systems with judgemental equality, Journal of Functional Programming, Volume 16 Issue 2(2006) (web)
-
Vincent Siles, Hugo Herbelin, Equality is typable in semi-full pure type systems (pdf)
-
Egbert Rijke, Introduction to Homotopy Type Theory, Cambridge Studies in Advanced Mathematics, Cambridge University Press (pdf) (478 pages)
The first paper to mention intensional equality (and the fact that it should be decidable) may be:
- Kurt Gödel, Über eine bisher noch nicht benützte Erweiterung des finiten Standpunktes. Dialectica (1958), pp. 280–287,
The distinction between definitional equality and “book” equality:
The notion of definitional equality in the context of (dependent) type theory:
specifically in the Coq proof assistant: