Context
Type theory
Equality and Equivalence
equivalence
-
equality (definitional, propositional, computational, judgemental, extensional, intensional, decidable)
-
identity type, equivalence in homotopy type theory
-
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 any type theory, judgmental equality is the notion of equality which is defined to be a judgment. Judgmental equality is most commonly used in single-level type theories like Martin-Löf type theory or higher observational type theory for making inductive definitions, but it is also used 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 general, there are two different kinds of judgmental equalities
-
strict judgmental equalities, where judgmental equalities behave like the strict equality of a set and is preserved throughout the type theory as congruences
-
weak judgmental equalities, where judgmental equalities are judgmental representations for identifications between terms of a type or equivalences of types; i.e. where is formally a shorthand for and similarly is shorthand for
Strict judgmental equalities are used in most dependent type theories. Weak judgmental equalities can be used in weak type theories, where a direct translation of the inference rules of the types in Martin-Löf type theory results in a weak version of Martin-Löf type theory.
Judgmental equality can be contrasted with propositional equality, where equality is a proposition, and typal equality, where equality is a type.
Judgments
In the model of dependent type theory which uses judgmental equality for definitional equality, judgmental equality of types, terms, and contexts are given by the following judgments:
- - and are judgementally equal well-typed types in context .
- - and are judgementally equal well-typed terms of type in context .
- - and are judgementally equal contexts.
Inference rules for judgmental equality
Weak judgmental equality
Weak judgmental equality of terms is simply given by a reflection rule into the identity type:
Weak judgmental equality of types is given by one of the two sets of structural rules:
- The variable conversion rule for judgmentally equal types:
or
- Rules for isomorphisms between judgmentally equal types:
In the first case, one could construct isomorphisms from the variable conversion rule, other structural rules, and the rules for function types:
From the generic term rule and the variable conversion rule for judgmentally equal types we have and , whereby from the introduction and computation rules for function types we have functions and such that
making both functions and isomorphisms.
Strict judgmental equality
Strict judgmental equality of terms has congruence rules for substitution, the principle of substitution:
- Principle of substitution for judgmentally equal terms:
This implies the reflection rule of weak judgmental equalities because one could derive the following rule:
In addition to the variable conversion rule, there are reflexivity, symmetry, and transitivity rules making strict judgmental equality for both terms and types an equivalence relation:
- Reflexivity of judgmental equality
Congruence rules for judgmental equality
In addition, strict 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
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:
- Uniqueness rules for negative dependent sum types:
- Computation rules for identity types:
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)