Redirected from "judgmental equality of types".
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 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.
There are two different kinds of judgmental equalities
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 isomorphism or some notion of equivalence of types 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 .
There are two different notions of judgmental equality of terms which could be distinguished:
Strict judgmental equalities of terms are used in most dependent type theories. Weak judgmental equalities of terms 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 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.
Weak judgmental equality
Weak judgmental equality of terms is simply given by a reflection rule into the identity type:
Strict judgmental equality
Strict judgmental equality is an equivalence relation:
- Reflexivity of judgmental equality
In addition, strict 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 weak judgmental equalities 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 weak judgmental equalities 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 .
There are two different notions of judgmental equality of types which could be distinguished:
-
Weak judgmental equality of types is just a shorthand for equivalence of types
-
Strict 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.
In either case, judgmental equality of types is primarily used for definitional equality of types.
Weak judgmental equality
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
In addition to the variable conversion rule, there are reflexivity, symmetry, and transitivity rules making strict judgmental equality for types an equivalence relation:
- Reflexivity of judgmental equality
Congruence rules for judgmental equality of types
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
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.
In addition to the variable conversion rule, there are reflexivity, symmetry, and transitivity rules making judgmental equality for contexts an equivalence relation:
- Reflexivity of judgmental equality
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)