nLab judgmental equality

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

natural deduction metalanguage, practical foundations

  1. type formation rule
  2. term introduction rule
  3. term elimination rule
  4. computation rule

type theory (dependent, intensional, observational type theory, homotopy type theory)

syntax object language

computational trinitarianism =
propositions as types +programs as proofs +relation type theory/category theory

logicset theory (internal logic of)category theorytype theory
propositionsetobjecttype
predicatefamily of setsdisplay morphismdependent type
proofelementgeneralized elementterm/program
cut rulecomposition of classifying morphisms / pullback of display mapssubstitution
introduction rule for implicationcounit for hom-tensor adjunctionlambda
elimination rule for implicationunit for hom-tensor adjunctionapplication
cut elimination for implicationone of the zigzag identities for hom-tensor adjunctionbeta reduction
identity elimination for implicationthe other zigzag identity for hom-tensor adjunctioneta conversion
truesingletonterminal object/(-2)-truncated objecth-level 0-type/unit type
falseempty setinitial objectempty type
proposition, truth valuesubsingletonsubterminal object/(-1)-truncated objecth-proposition, mere proposition
logical conjunctioncartesian productproductproduct type
disjunctiondisjoint union (support of)coproduct ((-1)-truncation of)sum type (bracket type of)
implicationfunction set (into subsingleton)internal hom (into subterminal object)function type (into h-proposition)
negationfunction set into empty setinternal hom into initial objectfunction type into empty type
universal quantificationindexed cartesian product (of family of subsingletons)dependent product (of family of subterminal objects)dependent product type (of family of h-propositions)
existential quantificationindexed disjoint union (support of)dependent sum ((-1)-truncation of)dependent sum type (bracket type of)
logical equivalencebijection setobject of isomorphismsequivalence type
support setsupport object/(-1)-truncationpropositional truncation/bracket type
n-image of morphism into terminal object/n-truncationn-truncation modality
propositional equalitydiagonal function/diagonal subset/diagonal relationpath space objectidentity type/path type
completely presented setsetdiscrete object/0-truncated objecth-level 2-type/set/h-set
setset with equivalence relationinternal 0-groupoidBishop set/setoid with its pseudo-equivalence relation an actual equivalence relation
equivalence class/quotient setquotientquotient type
inductioncolimitinductive type, W-type, M-type
higher inductionhigher colimithigher inductive type
-0-truncated higher colimitquotient inductive type
coinductionlimitcoinductive type
presettype without identity types
set of truth valuessubobject classifiertype of propositions
domain of discourseuniverseobject classifiertype universe
modalityclosure operator, (idempotent) monadmodal type theory, monad (in computer science)
linear logic(symmetric, closed) monoidal categorylinear type theory/quantum computation
proof netstring diagramquantum circuit
(absence of) contraction rule(absence of) diagonalno-cloning theorem
synthetic mathematicsdomain specific embedded programming language

homotopy levels

semantics

Equality and Equivalence

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.

Remark

There are many different ways that one can conceivably represent definitonal equality explicitly in type theory. The most common approach in the literature defines the definitional equality as an equality judgment, hence the name judgmental equality for definitional equality. Other possible approaches to definitional equality include adding a second judgment of propositions to the theory and defining the definitional equality explicitly as a propositional equality in the style of logic over type theory. This article is solely about the first approach of explicitly defining definitional equality using an equality judgment.

Remark

Equality judgments can hypothetically be used in type theory for things other than definitional equality, such as a shorthand for typal equality in a dependent type theory without only meta-theoretic definitional equality, given by a reflection rule into the identity type:

Γaa:AΓδ a,a:a= Aa\frac{\Gamma \vdash a \equiv a':A}{\Gamma \vdash \delta_{a, a'}:a =_A a'}

This article is solely about judgmental equality in dependent type theory in the sense of explicit definitional equality defined in the syntax by an equality judgment.

Remark

One may consider adding material to this article about the use of an equality judgment in untyped theories, such as in Reuben Goodstein’s 1954 formalization of primitive recursive arithmetic without predicate logic. But for the time being, this article is solely about the most common use of an equality judgment in dependent type theory for definitional equality.

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 \infty -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:

  • Γaa:A\Gamma \vdash a \equiv a' : A - aa and aa' are judgmentally equal well-typed terms of type AA in context Γ\Gamma.

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
ΓAtypeΓa:AΓaa:A\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash a:A}{\Gamma \vdash a \equiv a:A}
  • Symmetry of judgmental equality

    ΓAtypeΓab:AΓba:A\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash a \equiv b:A}{\Gamma \vdash b \equiv a:A}
  • Transitivity of judgmental equality

    ΓAtypeΓab:Abc:AΓac:A\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash a \equiv b:A \quad b \equiv c:A }{\Gamma \vdash a \equiv c:A}

In addition, judgmental equality of terms has congruence rules for substitution, the principle of substitution:

  • Principle of substitution for judgmentally equal terms:
    Γab:AΓ,x:A,Δc(x):BΓ,Δ(a)c(a)c(b):B\frac{\Gamma \vdash a \equiv b : A \quad \Gamma, x:A, \Delta \vdash c(x):B}{\Gamma, \Delta(a) \vdash c(a) \equiv c(b): B}

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

ΓAtypeΓab:AΓ,x:A,ΔB(x)typeΓ,Δ(a)B(a)B(b)type\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash a \equiv b : A \quad \Gamma, x:A, \Delta \vdash B(x) \; \mathrm{type}}{\Gamma, \Delta(a) \vdash B(a) \equiv B(b) \; \mathrm{type}}

This implies the reflection rule of the equality judgment as shorthand for typal equality because one could derive the following rule:

Γab:AΓrefl A(a):a= Ab\frac{\Gamma \vdash a \equiv b:A}{\Gamma \vdash \mathrm{refl}_A(a):a =_A b}

Otherwise, the principle of substitution into type families is given by definitional transport across judgmental equality as explicit conversion:

ΓAtypeΓab:AΓ,x:A,ΔB(x)typeΓ,Δ(a)tr B() ab:B(a)B(b)\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash a \equiv b : A \quad \Gamma, x:A, \Delta \vdash B(x) \; \mathrm{type}}{\Gamma, \Delta(a) \vdash \mathrm{tr}_{B(-)}^{a \equiv b}:B(a) \cong B(b)}

where ABA \cong B 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

ΓAtypeΓab:AΓ,x:A,ΔB(x)typeΓ,y:B(a),Δ(a)tr B() ab(y):B(b)\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash a \equiv b : A \quad \Gamma, x:A, \Delta \vdash B(x) \; \mathrm{type}}{\Gamma, y:B(a), \Delta(a) \vdash \mathrm{tr}_{B(-)}^{a \equiv b}(y):B(b)}
ΓAtypeΓa:AΓ,x:A,ΔB(x)typeΓ,y:B(a),Δ(a)tr B() aa(y)y:B(a)\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash a: A \quad \Gamma, x:A, \Delta \vdash B(x) \; \mathrm{type}}{\Gamma, y:B(a), \Delta(a) \vdash \mathrm{tr}_{B(-)}^{a \equiv a}(y) \equiv y:B(a)}
ΓAtypeΓab:AΓ,x:A,ΔB(x)typeΓ,y:B(a),Δ(a)tr B() ba(tr B() ab(y))y:B(a)\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash a \equiv b : A \quad \Gamma, x:A, \Delta \vdash B(x) \; \mathrm{type}}{\Gamma, y:B(a), \Delta(a) \vdash \mathrm{tr}_{B(-)}^{b \equiv a}(\mathrm{tr}_{B(-)}^{a \equiv b}(y)) \equiv y:B(a)}
ΓAtypeΓab:AΓbc:AΓ,x:A,ΔB(x)typeΓ,y:B(a),Δ(a)tr B() bc(tr B() ab(y))tr B() ac(y):B(c)\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash a \equiv b : A \quad \Gamma \vdash b \equiv c : A \quad \Gamma, x:A, \Delta \vdash B(x) \; \mathrm{type}}{\Gamma, y:B(a), \Delta(a) \vdash \mathrm{tr}_{B(-)}^{b \equiv c}(\mathrm{tr}_{B(-)}^{a \equiv b}(y)) \equiv \mathrm{tr}_{B(-)}^{a \equiv c}(y):B(c)}

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

Γab:AΓtr a= A() ab(refl A(a)):a= Ab\frac{\Gamma \vdash a \equiv b:A}{\Gamma \vdash \mathrm{tr}_{a =_A (-)}^{a \equiv b}(\mathrm{refl}_A(a)):a =_A b}

Similarly, for a term c(x):B(x)c(x):B(x) dependent upon x:Ax:A, if one has judgmental equality of types, then the principle of substitution across c(x)c(x) is given by the rule:

ΓAtypeΓab:AΓ,x:A,Δc(x):B(x)Γ,Δ(b)c(a)c(b):B(b)\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash a \equiv b : A \quad \Gamma, x:A, \Delta \vdash c(x):B(x)}{\Gamma, \Delta(b) \vdash c(a) \equiv c(b):B(b)}

Otherwise, it is given by a judgmental version of function application to identifications:

ΓAtypeΓab:AΓ,x:A,Δc(x):B(x)Γ,Δ(b)tr B() ab(c(a))c(b):B(b)\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash a \equiv b : A \quad \Gamma, x:A, \Delta \vdash c(x):B(x)}{\Gamma, \Delta(b) \vdash \mathrm{tr}_{B(-)}^{a \equiv b}(c(a)) \equiv c(b):B(b)}

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:
Γ,x:Ab(x):B(x)Γa:AΓλ(x:A).b(x)(a)b(a):B(a)\frac{\Gamma, x:A \vdash b(x):B(x) \quad \Gamma \vdash a:A}{\Gamma \vdash \lambda(x:A).b(x)(a) \equiv b(a):B(a)}
  • Uniqueness rules for dependent product types:
Γf: x:AB(x)Γfλ(x).f(x): x:AB(x)\frac{\Gamma \vdash f:\prod_{x:A} B(x)}{\Gamma \vdash f \equiv \lambda(x).f(x):\prod_{x:A} B(x)}
  • Computation rules for negative dependent sum types:
Γ,x:AB(x)typeΓa:AΓb:B(a)Γπ 1(a,b)a:AΓ,x:AB(x)typeΓa:AΓb:B(a)Γπ 2(a,b)b:B(a)\frac{\Gamma, x:A \vdash B(x) \; \mathrm{type} \quad \Gamma \vdash a:A \quad \Gamma \vdash b:B(a)}{\Gamma \vdash \pi_1(a, b) \equiv a:A} \qquad \frac{\Gamma, x:A \vdash B(x) \; \mathrm{type} \quad \Gamma \vdash a:A \quad \Gamma \vdash b:B(a)}{\Gamma \vdash \pi_2(a, b) \equiv b:B(a)}

If one does not have judgmental equality of types, then one would have to use transport across judgmental equality for the second computation rule:

Γ,x:AB(x)typeΓa:AΓb:B(a)Γtr B() π 1(a,b)a(π 2(a,b))b:B(a)\frac{\Gamma, x:A \vdash B(x) \; \mathrm{type} \quad \Gamma \vdash a:A \quad \Gamma \vdash b:B(a)}{\Gamma \vdash \mathrm{tr}_{B(-)}^{\pi_1(a, b) \equiv a}(\pi_2(a, b)) \equiv b:B(a)}
  • Uniqueness rules for negative dependent sum types:
Γz: x:AB(x)Γz(π 1(z),π 2(z)): x:AB(x)\frac{\Gamma \vdash z:\sum_{x:A} B(x)}{\Gamma \vdash z \equiv (\pi_1(z), \pi_2(z)):\sum_{x:A} B(x)}
  • Computation rules for identity types:
Γ,a:A,b:A,p:a= AbC(a,b,p)typeΓt: c:AC(c,c,refl A(c))Γ,c:AJ(t,c,c,refl(c))t:C(c,c,refl A(c))\frac{\Gamma, a:A, b:A, p:a =_A b \vdash C(a, b, p) \; \mathrm{type} \quad \Gamma \vdash t:\prod_{c:A} C(c, c, \mathrm{refl}_A(c))}{\Gamma, c:A \vdash J(t, c, c, \mathrm{refl}(c)) \equiv t:C(c, c, \mathrm{refl}_A(c))}

Judgmental equality of types

In dependent type theory with a separate type judgment, judgmental equality of types is given by the following judgment:

  • ΓAAtype\Gamma \vdash A \equiv A' \; \mathrm{type} - AA and AA' are judgmentally equal well-typed types in context Γ\Gamma.

Inference rules

The variable conversion rule for judgmentally equal types:

ΓABtypeΓ,x:A,Δ𝒥Γ,x:B,Δ𝒥\frac{\Gamma \vdash A \equiv B \; \mathrm{type} \quad \Gamma, x:A, \Delta \vdash \mathcal{J}}{\Gamma, x:B, \Delta \vdash \mathcal{J}}

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
ΓAtypeΓAAtype\frac{\Gamma \vdash A \; \mathrm{type}}{\Gamma \vdash A \equiv A \; \mathrm{type}}
  • Symmetry of judgmental equality

    ΓABtypeΓBAtype\frac{\Gamma \vdash A \equiv B \; \mathrm{type}}{\Gamma \vdash B \equiv A \; \mathrm{type}}
  • Transitivity of judgmental equality

    ΓABtypeΓBCtypeΓACtype\frac{\Gamma \vdash A \equiv B \; \mathrm{type} \quad \Gamma \vdash B \equiv C \; \mathrm{type} }{\Gamma \vdash A \equiv C \; \mathrm{type}}

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
ΓAAtypeΓ,x:AB(x)B(x)typeΓ x:AB(x) x:AB(x)type\frac{ \begin{array}{c} \Gamma \vdash A \equiv A' \; \mathrm{type} \quad \Gamma, x:A \vdash B(x) \equiv B'(x) \; \mathrm{type} \end{array} }{\Gamma \vdash \prod_{x:A} B(x) \equiv \prod_{x:A'} B'(x)\; \mathrm{type}}
ΓAtypeΓ,x:AB(x)typeΓ,x:Ab(x):B(x)Γ,x:Ab(x):B(x) Γ,x:Ab(x)b(x):B(x)Γλx:A.b(x)λx:A.b(x): x:A.B(x)\frac{ \begin{array}{c} \Gamma \vdash A \; \mathrm{type} \quad \Gamma, x:A \vdash B(x) \; \mathrm{type} \quad \Gamma, x:A \vdash b(x):B(x) \quad \Gamma, x:A \vdash b'(x):B(x) \\ \Gamma, x:A \vdash b(x) \equiv b'(x):B(x) \end{array} }{\Gamma \vdash \lambda x:A.b(x) \equiv \lambda x:A.b'(x):\prod_{x:A}.B(x)}
ΓAtypeΓ,x:AB(x)typeΓf: x:AB(x)f: x:AB(x) Γff: x:AB(x)Γ,x:Af(x)f(x):B(x)\frac{ \begin{array}{c} \Gamma \vdash A \; \mathrm{type} \quad \Gamma, x:A \vdash B(x) \; \mathrm{type} \quad \Gamma \vdash f:\prod_{x:A} B(x) \quad f':\prod_{x:A} B(x) \\ \Gamma \vdash f \equiv f':\prod_{x:A} B(x) \end{array} }{\Gamma, x:A \vdash f(x) \equiv f'(x):B(x)}
ΓAtypeΓ,x:AB(x)typeΓ,x:Ab(x):B(x)Γ,x:Ab(x):B(x) Γ,x:Ab(x)b(x):B(x)Γβ A,Bx:A.b(x)β A,Bx:A.b(x): x:Ab(x)= B(x)(λx:A.b(x))(x)\frac{ \begin{array}{c} \Gamma \vdash A \; \mathrm{type} \quad \Gamma, x:A \vdash B(x) \; \mathrm{type} \quad \Gamma, x:A \vdash b(x):B(x) \quad \Gamma, x:A \vdash b'(x):B(x) \\ \Gamma, x:A \vdash b(x) \equiv b'(x):B(x) \end{array} }{\Gamma \vdash \beta_{\prod}^{A, B} x:A.b(x) \equiv \beta_{\prod}^{A, B} x:A.b'(x):\prod_{x:A} b(x) =_{B(x)} (\lambda x:A.b(x))(x)}
ΓAtypeΓ,x:AB(x)typeΓ,x:AB(x)type Γ,x:AB(x)B(x)typeΓη A,Bη A,B: f: x:AB(x)f= x:AB(x)λx:A.f(x)\frac{ \begin{array}{c} \Gamma \vdash A \; \mathrm{type} \quad \Gamma, x:A \vdash B(x) \; \mathrm{type} \quad \Gamma, x:A \vdash B'(x) \; \mathrm{type} \\ \Gamma, x:A \vdash B(x) \equiv B'(x) \; \mathrm{type} \end{array} }{\Gamma \vdash \eta_{\prod}^{A, B} \equiv \eta_{\prod}^{A, B'}:\prod_{f:\prod_{x:A} B(x)} f =_{\prod_{x:A} B(x)} \lambda x:A.f(x)}
  • Congruence rules for dependent pair types:
ΓAAtypeΓ,x:AB(x)B(x)typeΓ x:AB(x) x:AB(x)type\frac{ \begin{array}{c} \Gamma \vdash A \equiv A' \; \mathrm{type} \quad \Gamma, x:A \vdash B(x) \equiv B'(x) \; \mathrm{type} \end{array} }{\Gamma \vdash \sum_{x:A} B(x) \equiv \sum_{x:A'} B'(x)\; \mathrm{type}}
ΓAAtypeΓ,x:AB(x)B(x)typeΓ,x:A,y:B(x)pair A,Bpair A,B: x:AB(x)\frac{ \begin{array}{c} \Gamma \vdash A \equiv A' \; \mathrm{type} \quad \Gamma, x:A \vdash B(x) \equiv B'(x) \; \mathrm{type} \end{array} }{\Gamma, x:A, y:B(x) \vdash \mathrm{pair}_{\sum}^{A, B} \equiv \mathrm{pair}_{\sum}^{A', B'}:\sum_{x:A} B(x)}
ΓAAtypeΓ,x:AB(x)B(x)typeΓ,z: x:AB(x)C(z)C(z)typeΓind A,B,Cind A,B,C: g: x:A y:B(x)C(pair A,B(x,y)) z: x:AB(x)C(z)\frac{ \begin{array}{c} \Gamma \vdash A \equiv A' \; \mathrm{type} \quad \Gamma, x:A \vdash B(x) \equiv B'(x) \; \mathrm{type} \quad \Gamma, z:\sum_{x:A} B(x) \vdash C(z) \equiv C'(z) \; \mathrm{type} \end{array} }{\Gamma \vdash \mathrm{ind}_{\sum}^{A, B, C} \equiv \mathrm{ind}_{\sum}^{A', B', C'}:\prod_{g:\prod_{x:A} \prod_{y:B(x)} C(\mathrm{pair}_{\sum}^{A, B}(x, y))} \prod_{z:\sum_{x:A} B(x)} C(z)}
ΓAAtypeΓ,x:AB(x)B(x)typeΓ,z: x:AB(x)C(z)C(z)typeΓβ A,B,Cβ A,B,C: g: x:A y:B(x)C(pair A,B(x,y)) x:A y:B(x)ind A,B,C(g,pair A,B(x,y))= C(pair A,B(x,y))g(x,y)\frac{ \begin{array}{c} \Gamma \vdash A \equiv A' \; \mathrm{type} \quad \Gamma, x:A \vdash B(x) \equiv B'(x) \; \mathrm{type} \quad \Gamma, z:\sum_{x:A} B(x) \vdash C(z) \equiv C'(z) \; \mathrm{type} \end{array} }{\Gamma \vdash \beta_{\sum}^{A, B, C} \equiv \beta_{\sum}^{A', B', C'}:\prod_{g:\prod_{x:A} \prod_{y:B(x)} C(\mathrm{pair}_{\sum}^{A, B}(x, y))} \prod_{x:A} \prod_{y:B(x)} \mathrm{ind}_{\sum}^{A, B, C}(g, \mathrm{pair}_{\sum}^{A, B}(x, y)) =_{C(\mathrm{pair}_{\sum}^{A, B}(x, y))} g(x, y)}
  • Congruence rules for identity types:
ΓAAtypeΓ,x:A,y:Ax= Ayx= Ay\frac{\Gamma \vdash A \equiv A' \; \mathrm{type}}{\Gamma, x:A, y:A \vdash x =_A y \equiv x =_{A'} y}
ΓAAtypeΓrefl Arefl A: x:Ax= Ax\frac{\Gamma \vdash A \equiv A' \; \mathrm{type}}{\Gamma \vdash \mathrm{refl}_A \equiv \mathrm{refl}_{A'}:\prod_{x:A} x =_A x}
ΓAAtypeΓ,x:A,y:A,p:x= AyC(x,y,p)C(x,y,p)typeΓind = A,Cind = A,C: t: x:AC(x,x,refl A(x)) x:A y:A p:x= AyC(x,y,p)\frac{ \begin{array}{c} \Gamma \vdash A \equiv A' \; \mathrm{type} \quad \Gamma, x:A, y:A, p:x =_A y \vdash C(x, y, p) \equiv C'(x, y, p) \; \mathrm{type} \end{array} }{\Gamma \vdash \mathrm{ind}_{=}^{A, C} \equiv \mathrm{ind}_{=}^{A', C'}:\prod_{t:\prod_{x:A} C(x, x, \mathrm{refl}_A(x))} \prod_{x:A} \prod_{y:A} \prod_{p:x =_A y} C(x, y, p)}
ΓAAtypeΓ,x:A,y:A,p:x= AyC(x,y,p)C(x,y,p)typeΓβ ind = A,Cβ ind = A,C: t: x:AC(x,x,refl A(x)) x:Aind = A,C(t,x,x,refl A(x))= C(x,x,refl A(x))t(x)\frac{ \begin{array}{c} \Gamma \vdash A \equiv A' \; \mathrm{type} \quad \Gamma, x:A, y:A, p:x =_A y \vdash C(x, y, p) \equiv C'(x, y, p) \; \mathrm{type} \end{array} }{\Gamma \vdash \beta_{ \mathrm{ind}_=}^{A, C} \equiv \beta_{\mathrm{ind}_=}^{A', C'}:\prod_{t:\prod_{x:A} C(x, x, \mathrm{refl}_A(x))} \prod_{x:A} \mathrm{ind}_{=}^{A, C}(t, x, x, \mathrm{refl}_A(x)) =_{C(x, x, \mathrm{refl}_A(x))} t(x)}
  • Congruence rules for the empty type:
Γ,x:C(x)C(x)typeΓind Cind C: x:C(x)type\frac{\Gamma, x:\emptyset \vdash C(x) \equiv C'(x) \; \mathrm{type}}{\Gamma \vdash \mathrm{ind}_\emptyset^C \equiv \mathrm{ind}_\emptyset^{C'}:\prod_{x:\emptyset} C(x) \; \mathrm{type}}
  • Congruence rules for the type of booleans:
Γ,x:𝟚C(x)C(x)typeΓind 𝟚 Cind 𝟚 C: a:C(0) b:C(1) x:𝟚C(x)\frac{\Gamma, x:\mathbb{2} \vdash C(x) \equiv C'(x) \; \mathrm{type}}{\Gamma \vdash \mathrm{ind}_\mathbb{2}^C \equiv \mathrm{ind}_\mathbb{2}^{C'}:\prod_{a:C(0)} \prod_{b:C(1)} \prod_{x:\mathbb{2}} C(x)}
Γ,x:𝟚C(x)C(x)typeΓβ 𝟚 0,Cβ 𝟚 0,C: a:C(0) b:C(1)ind 𝟚 C(a,b,0)= C(0)a\frac{\Gamma, x:\mathbb{2} \vdash C(x) \equiv C'(x) \; \mathrm{type}}{\Gamma \vdash \beta_\mathbb{2}^{0, C} \equiv \beta_\mathbb{2}^{0, C'}:\prod_{a:C(0)} \prod_{b:C(1)} \mathrm{ind}_\mathbb{2}^C(a, b, 0) =_{C(0)} a}
Γ,x:𝟚C(x)C(x)typeΓβ 𝟚 1,Cβ 𝟚 1,C: a:C(0) b:C(1)ind 𝟚 C(a,b,1)= C(1)b\frac{\Gamma, x:\mathbb{2} \vdash C(x) \equiv C'(x) \; \mathrm{type}}{\Gamma \vdash \beta_\mathbb{2}^{1, C} \equiv \beta_\mathbb{2}^{1, C'}:\prod_{a:C(0)} \prod_{b:C(1)} \mathrm{ind}_\mathbb{2}^C(a, b, 1) =_{C(1)} b}
  • Congruence rules for the natural numbers type:
Γ,x:C(x)C(x)typeΓind Cind C: c 0:C(0) c s: x:C(x)C(s(x)) x:C(x)\frac{\Gamma, x:\mathbb{N} \vdash C(x) \equiv C'(x) \; \mathrm{type}}{\Gamma \vdash \mathrm{ind}_\mathbb{N}^C \equiv \mathrm{ind}_\mathbb{N}^{C'}:\prod_{c_0:C(0)} \prod_{c_s:\prod_{x:\mathbb{N}} C(x) \to C(s(x))} \prod_{x:\mathbb{N} C(x)}}
Γ,x:C(x)C(x)typeΓβ 0,Cβ 0,C: c 0:C(0) c s: x:C(x)C(s(x))ind C(c 0,c s,0)= C(0)c 0\frac{\Gamma, x:\mathbb{N} \vdash C(x) \equiv C'(x) \; \mathrm{type}}{\Gamma \vdash \beta_\mathbb{N}^{0, C} \equiv \beta_\mathbb{N}^{0, C'}:\prod_{c_0:C(0)} \prod_{c_s:\prod_{x:\mathbb{N}} C(x) \to C(s(x))} \mathrm{ind}_\mathbb{N}^C(c_0, c_s, 0) =_{C(0)} c_0}
Γ,x:C(x)C(x)typeΓβ s,Cβ s,C: c 0:C(0) c s: x:C(x)C(s(x)) x:ind C(c 0,c s,s(x))= C(s(x))c s(x)(ind C(c 0,c s,x))\frac{\Gamma, x:\mathbb{N} \vdash C(x) \equiv C'(x) \; \mathrm{type}}{\Gamma \vdash \beta_\mathbb{N}^{s, C} \equiv \beta_\mathbb{N}^{s, C'}:\prod_{c_0:C(0)} \prod_{c_s:\prod_{x:\mathbb{N}} C(x) \to C(s(x))} \prod_{x:\mathbb{N}} \mathrm{ind}_\mathbb{N}^C(c_0, c_s, s(x)) =_{C(s(x))} c_s(x)(\mathrm{ind}_\mathbb{N}^C(c_0, c_s, x))}

Similarly, we have congruence rules for every axiom in the dependent type theory, such as

ΓAAtypeΓ,x:AB(x)B(x)typeΓfunext A,Bfunext A,B: f; x:AB(x) g: x:AB(x)(f= x:AB(x)g) x:Af(x)= B(x)g(x)\frac{\Gamma \vdash A \equiv A' \; \mathrm{type} \quad \Gamma, x:A \vdash B(x) \equiv B'(x) \; \mathrm{type}}{\Gamma \vdash \mathrm{funext}_{A, B} \equiv \mathrm{funext}_{A', B'}:\prod_{f;\prod_{x:A} B(x)} \prod_{g:\prod_{x:A} B(x)} (f =_{\prod_{x:A} B(x)} g) \simeq \prod_{x:A} f(x) =_{B(x)} g(x)}
ΓAAtypeΓ,x:AB(x)B(x)typeΓ,x:A,y:B(x)C(x,y)C(x,y)typeΓchoice A,B,Cchoice A,B,C:(isSet(A)× x:AisSet(B(x)))x:A.y:B(x).C(x,y)g: x:AB(x).x:A.C(x,g(x))\frac{\Gamma \vdash A \equiv A' \; \mathrm{type} \quad \Gamma, x:A \vdash B(x) \equiv B'(x) \; \mathrm{type} \quad \Gamma, x:A, y:B(x) \vdash C(x, y) \equiv C'(x, y) \; \mathrm{type}}{\Gamma \vdash \mathrm{choice}_{A, B, C} \equiv \mathrm{choice}_{A', B', C'}:\left(\mathrm{isSet}(A) \times \prod_{x:A} \mathrm{isSet}(B(x))\right) \to \forall x:A.\exists y:B(x).C(x, y) \to \exists g:\prod_{x:A} B(x).\forall x:A.C(x, g(x))}

Judgmental equality of contexts

In some dependent type theories, there is also judgmental equality of contexts, which is given by the following judgment:

  • ΓΓctx\Gamma \equiv \Gamma' \; \mathrm{ctx} - Γ\Gamma and Γ\Gamma' are judgmentally equal contexts.

There are reflexivity, symmetry, and transitivity rules making judgmental equality for contexts an equivalence relation:

  • Reflexivity of judgmental equality
ΓctxΓΓctx\frac{\Gamma \; \mathrm{ctx}}{\Gamma \equiv \Gamma \; \mathrm{ctx}}
  • Symmetry of judgmental equality

    ΓΔctxΔΓctx\frac{\Gamma \equiv \Delta \; \mathrm{ctx}}{\Delta \equiv \Gamma \; \mathrm{ctx}}
  • Transitivity of judgmental equality

    ΓΔctxΔΞctxΓΞctx\frac{\Gamma \equiv \Delta \; \mathrm{ctx} \quad \Delta \equiv \Xi \; \mathrm{ctx}}{\Gamma \equiv \Xi \; \mathrm{ctx}}

 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:

Last revised on October 30, 2025 at 19:25:57. See the history of this page for a list of all contributions to it.