nLab fibered heterogeneous identity type

Context

Equality and Equivalence

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
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

Contents

Idea

A form of heterogeneous equality in dependent type theory.

 Definition

Given a type AA and an AA-dependent type a:AB(a)a \colon A \;\vdash\; B(a), the fibered heterogeneous identity type is the dependent type indexed by

  1. a pair of parameters

    a,a:A a ,\, a' \;\colon\; A

    indexing a pair of fibers of BB,

  2. a pair of terms of these fiber types

    b:B(a),b:B(a) b \;\colon\; B(a) ,\;\;\;\; b' \;\colon\; B(a')

    whose “heterogeneousidentification is to be witnessed,

and defined equivalently as follows:

  • [Winterhalter 2023, p. 30] as the dependent sum type

    fhId(a,b;a,b) p:Id A(a,a)hId(b,p,b) fhId(a, b; a', b') \;\coloneqq\; \sum_{p \colon \mathrm{Id}_A(a, a')} \mathrm{hId}(b, p, b')

    of the heterogeneous identity types

    hId(b,p,b)Id B(b)(p *(b),b), hId(b, p, b') \;\equiv\; \mathrm{Id}_{B(b)}\big( p_\ast(b) ,\, b' \big) \,,

    over all identifications p:Id A(a,a)p \colon \mathrm{Id}_A(a, a'), where

    p *:B(a)B(a) p_\ast \,\colon\, B(a) \overset{\sim}{\to} B(a')

    denotes the type transport along pp;

  • as the identification type of dependent pairs in the dependent sum type x:AB(x)\sum_{x:A} B(x)

    fhId(a,b;a,b)Id x:AB(x)((a,b),(a,b)). fhId(a, b; a', b') \;\coloneqq\; \mathrm{Id}_{\sum_{x:A} B(x)} \big( (a, b) ,\, (a', b') \big) \mathrlap{\,.}

The two definitions are equivalent due to the extensionality property of dependent sum types.

Inference rules with UIP

Beware that the following text writes “JMEq(a,b,x,y)\mathrm{JMEq}(a, b, x, y)” for what above is denoted fhId(a,x;b,y)fhId(a,x; b,y).

When the type theory has a set truncation axiom such as UIP or axiom K, one could use one of the following inference rules to define John Major equality:

 McBride’s axiomatization

The axioms given in McBride 1999 are in OLEG? pseudocode, use Russell universes, and interpret relations impredicatively as functions into a type of all propositions. Here, the axioms are written as inference rules in a deduction system, modified slightly to use Tarski universes instead of Russell universes, as well as interpreting relations predicatively as prop-valued type families instead of functions into a type of all propositions. The axioms are as follows:

ΓA:UΓB:UΓu:El(A)Γv:El(B)ΓJMEq(A,B,u,v)type\frac{\Gamma \vdash A:U \quad \Gamma \vdash B:U \quad \Gamma \vdash u:\mathrm{El}(A) \quad \Gamma \vdash v:\mathrm{El}(B)}{\Gamma \vdash \mathrm{JMEq}(A, B, u, v) \; \mathrm{type}}
ΓA:UΓB:UΓu:El(A)Γv:El(B)Γ,p:JMEq(A,B,u,v),q:JMEq(A,B,u,v)propTruncJMEq(A,B,u,v,p,q):Id JMEq(A,B,u,v)(p,q)\frac{\Gamma \vdash A:U \quad \Gamma \vdash B:U \quad \Gamma \vdash u:\mathrm{El}(A) \quad \Gamma \vdash v:\mathrm{El}(B)}{\Gamma, p:\mathrm{JMEq}(A, B, u, v), q:\mathrm{JMEq}(A, B, u, v) \vdash \mathrm{propTruncJMEq}(A, B, u, v, p, q):\mathrm{Id}_{\mathrm{JMEq}(A, B, u, v)}(p, q)}
ΓA:UΓu:El(A)Γrefl(A,u):JMEq(A,A,u,u)\frac{\Gamma \vdash A:U \quad \Gamma \vdash u:\mathrm{El}(A)}{\Gamma \vdash \mathrm{refl}(A, u):\mathrm{JMEq}(A, A, u, u)}
Γ,A:U,B:U,u:El(A),v:El(B),e:JMEq(A,B,u,v)Φ(A,B,u,v,e)typeΓ,t: X:U x:El(X)Φ(X,X,x,x,refl(X,x)),A:U,B:U,u:El(A),v:El(B),e:JMEq(A,B,u,v)eqIndElim(t,A,B,u,v,e):Φ(A,B,u,v,e)\frac{\Gamma, A:U, B:U, u:\mathrm{El}(A), v:\mathrm{El}(B), e:\mathrm{JMEq}(A, B, u, v) \vdash \Phi(A, B, u, v, e) \; \mathrm{type}}{\Gamma, t:\prod_{X:U} \prod_{x:\mathrm{El}(X)} \Phi(X, X, x, x, \mathrm{refl}(X, x)), A:U, B:U, u:\mathrm{El}(A), v:\mathrm{El}(B), e:\mathrm{JMEq}(A, B, u, v) \vdash \mathrm{eqIndElim}(t, A, B, u, v, e):\Phi(A, B, u, v, e)}
Γ,A:U,B:U,u:El(A),v:El(B),e:JMEq(A,B,u,v)Φ(A,B,u,v,e)typeΓ,t: X:U x:El(X)Φ(X,X,x,x,refl(X,x)),A:U,u:El(A)eqIndElim(t,A,A,u,u,refl(A,u))t(a,u):Φ(A,A,u,u,refl(A,u))\frac{\Gamma, A:U, B:U, u:\mathrm{El}(A), v:\mathrm{El}(B), e:\mathrm{JMEq}(A, B, u, v) \vdash \Phi(A, B, u, v, e) \; \mathrm{type}}{\Gamma, t:\prod_{X:U} \prod_{x:\mathrm{El}(X)} \Phi(X, X, x, x, \mathrm{refl}(X, x)), A:U, u:\mathrm{El}(A) \vdash \mathrm{eqIndElim}(t, A, A, u, u, \mathrm{refl}(A, u)) \equiv t(a, u):\Phi(A, A, u, u, \mathrm{refl}(A, u))}

The use of Tarski universes instead of Russell universes makes it clear that John Major equality could be defined using inference rules for any type family x:AB(x)x:A \vdash B(x) instead of just the Tarski universe type family X:UEl(X)X:U \vdash \mathrm{El}(X):

ΓAtypeΓ,x:AB(x)typeΓa:AΓb:AΓu:B(a)Γv:B(b)ΓJMEq(a,b,u,v)type\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma, x:A \vdash B(x) \; \mathrm{type} \quad \Gamma \vdash a:A \quad \Gamma \vdash b:A \quad \Gamma \vdash u:B(a) \quad \Gamma \vdash v:B(b)}{\Gamma \vdash \mathrm{JMEq}(a, b, u, v) \; \mathrm{type}}
ΓAtypeΓ,x:AB(x)typeΓa:AΓb:AΓu:B(a)Γv:B(b)Γ,p:JMEq(a,b,u,v),q:JMEq(a,b,u,v)propTruncJMEq(a,b,u,v,p,q):Id JMEq(a,b,u,v)(p,q)\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma, x:A \vdash B(x) \; \mathrm{type} \quad \Gamma \vdash a:A \quad \Gamma \vdash b:A \quad \Gamma \vdash u:B(a) \quad \Gamma \vdash v:B(b)}{\Gamma, p:\mathrm{JMEq}(a, b, u, v), q:\mathrm{JMEq}(a, b, u, v) \vdash \mathrm{propTruncJMEq}(a, b, u, v, p, q):\mathrm{Id}_{\mathrm{JMEq}(a, b, u, v)}(p, q)}
ΓAtypeΓ,x:AB(x)typeΓa:AΓu:B(a)Γrefl(a,u):JMEq(a,a,u,u)\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma, x:A \vdash B(x) \; \mathrm{type} \quad \Gamma \vdash a:A \quad \Gamma \vdash u:B(a)}{\Gamma \vdash \mathrm{refl}(a, u):\mathrm{JMEq}(a, a, u, u)}
ΓAtypeΓ,x:AB(x)typeΓ,a:A,b:A,u:B(a),v:B(b),e:JMEq(a,b,u,v)Φ(a,b,u,v,e)typeΓ,t: x:A y:B(a)Φ(x,x,y,y,refl(x,y)),a:A,b:A,u:B(a),v:B(b),e:JMEq(a,b,u,v)eqIndElim(t,a,b,u,v,e):Φ(a,b,u,v,e)\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma, x:A \vdash B(x) \; \mathrm{type} \quad \Gamma, a:A, b:A, u:B(a), v:B(b), e:\mathrm{JMEq}(a, b, u, v) \vdash \Phi(a, b, u, v, e) \; \mathrm{type}}{\Gamma, t:\prod_{x:A} \prod_{y:B(a)} \Phi(x, x, y, y, \mathrm{refl}(x, y)), a:A, b:A, u:B(a), v:B(b), e:\mathrm{JMEq}(a, b, u, v) \vdash \mathrm{eqIndElim}(t, a, b, u, v, e):\Phi(a, b, u, v, e)}
ΓAtypeΓ,x:AB(x)typeΓ,a:A,b:A,u:B(a),v:B(b),e:JMEq(a,b,u,v)Φ(a,b,u,v,e)typeΓ,t: x:A y:B(a)Φ(x,x,y,y,refl(x,y)),a:A,u:B(a)eqIndElim(t,a,a,u,u,refl(a,u))t(a,u):Φ(a,a,u,u,refl(a,u))\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma, x:A \vdash B(x) \; \mathrm{type} \quad \Gamma, a:A, b:A, u:B(a), v:B(b), e:\mathrm{JMEq}(a, b, u, v) \vdash \Phi(a, b, u, v, e) \; \mathrm{type}}{\Gamma, t:\prod_{x:A} \prod_{y:B(a)} \Phi(x, x, y, y, \mathrm{refl}(x, y)), a:A, u:B(a) \vdash \mathrm{eqIndElim}(t, a, a, u, u, \mathrm{refl}(a, u)) \equiv t(a, u):\Phi(a, a, u, u, \mathrm{refl}(a, u))}

Winterhalter’s axiomatization

The axioms given in Winterhalter 2023 are in Coq pseudocode and use Russell universes. Here, the axioms are written as inference rules in a deduction system and modified slightly to use Tarski universes instead of Russell universes. The axioms are as follows:

ΓA:UΓB:UΓu:El(A)Γv:El(B)ΓJMEq(A,B,u,v)type\frac{\Gamma \vdash A:U \quad \Gamma \vdash B:U \quad \Gamma \vdash u:\mathrm{El}(A) \quad \Gamma \vdash v:\mathrm{El}(B)}{\Gamma \vdash \mathrm{JMEq}(A, B, u, v) \; \mathrm{type}}
ΓA:UΓu:El(A)Γhrefl(A,u):JMEq(A,B,u,v)\frac{\Gamma \vdash A:U \quad \Gamma \vdash u:\mathrm{El}(A)}{\Gamma \vdash \mathrm{hrefl}(A, u):\mathrm{JMEq}(A, B, u, v)}
ΓA:UΓu:El(A)Γv:El(A)Γp:Id El(A)(u,v)ΓeqToHeq(A,u,v,p):JMEq(A,A,u,v)type\frac{\Gamma \vdash A:U \quad \Gamma \vdash u:\mathrm{El}(A) \quad \Gamma \vdash v:\mathrm{El}(A) \quad \Gamma \vdash p:\mathrm{Id}_{\mathrm{El}(A)}(u, v)}{\Gamma \vdash \mathrm{eqToHeq}(A, u, v, p):\mathrm{JMEq}(A, A, u, v) \; \mathrm{type}}
ΓA:UΓu:El(A)Γv:El(A)Γp:JMEq(A,A,u,v)ΓheqToEq(A,u,v,p):Id El(A)(u,v)type\frac{\Gamma \vdash A:U \quad \Gamma \vdash u:\mathrm{El}(A) \quad \Gamma \vdash v:\mathrm{El}(A) \quad \Gamma \vdash p:\mathrm{JMEq}(A, A, u, v)}{\Gamma \vdash \mathrm{heqToEq}(A, u, v, p):\mathrm{Id}_{\mathrm{El}(A)}(u, v) \; \mathrm{type}}
ΓA:UΓB:UΓp:Id U(A,B)Γt:El(A)ΓheqTransport(A,B,p,t):JMEq(A,B,t,transport X:U.El(X)(A,B,p,t))\frac{\Gamma \vdash A:U \quad \Gamma \vdash B:U \quad \Gamma \vdash p:\mathrm{Id}_{U}(A, B) \quad \Gamma \vdash t:\mathrm{El}(A)}{\Gamma \vdash \mathrm{heqTransport}(A, B, p, t):\mathrm{JMEq}(A, B, t, \mathrm{transport}_{X:U.\mathrm{El}(X)}(A, B, p, t))}

The use of Tarski universes instead of Russell universes makes it clear that John Major equality could be defined using inference rules for any type family x:AB(x)x:A \vdash B(x) instead of just the Tarski universe type family X:UEl(X)X:U \vdash \mathrm{El}(X):

ΓAtypeΓ,x:AB(x)typeΓa:AΓb:AΓu:B(a)Γv:B(b)ΓJMEq(a,b,u,v)type\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma, x:A \vdash B(x) \; \mathrm{type} \quad \Gamma \vdash a:A \quad \Gamma \vdash b:A \quad \Gamma \vdash u:B(a) \quad \Gamma \vdash v:B(b)}{\Gamma \vdash \mathrm{JMEq}(a, b, u, v) \; \mathrm{type}}
ΓAtypeΓ,x:AB(x)typeΓa:AΓu:B(a)Γhrefl(a,u):JMEq(a,b,u,v)\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma, x:A \vdash B(x) \; \mathrm{type} \quad \Gamma \vdash a:A \quad \Gamma \vdash u:B(a)}{\Gamma \vdash \mathrm{hrefl}(a, u):\mathrm{JMEq}(a, b, u, v)}
ΓAtypeΓ,x:AB(x)typeΓa:AΓu:B(a)Γv:B(a)Γp:Id B(a)(u,v)ΓeqToHeq(a,u,v,p):JMEq(a,a,u,v)type\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma, x:A \vdash B(x) \; \mathrm{type} \quad \Gamma \vdash a:A \quad \Gamma \vdash u:B(a) \quad \Gamma \vdash v:B(a) \quad \Gamma \vdash p:\mathrm{Id}_{B(a)}(u, v)}{\Gamma \vdash \mathrm{eqToHeq}(a, u, v, p):\mathrm{JMEq}(a, a, u, v) \; \mathrm{type}}
ΓAtypeΓ,x:AB(x)typeΓa:AΓu:B(a)Γv:B(a)Γp:JMEq(a,a,u,v)ΓheqToEq(a,u,v,p):Id B(a)(u,v)type\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma, x:A \vdash B(x) \; \mathrm{type} \quad \Gamma \vdash a:A \quad \Gamma \vdash u:B(a) \quad \Gamma \vdash v:B(a) \quad \Gamma \vdash p:\mathrm{JMEq}(a, a, u, v)}{\Gamma \vdash \mathrm{heqToEq}(a, u, v, p):\mathrm{Id}_{B(a)}(u, v) \; \mathrm{type}}
ΓAtypeΓ,x:AB(x)typeΓa:AΓb:AΓp:Id A(a,b)Γt:B(a)ΓheqTransport(a,b,p,t):JMEq(a,b,t,transport x:A.B(x)(a,b,p,t))\frac{\Gamma \vdash A \; \mathrm{type} \quad \Gamma, x:A \vdash B(x) \; \mathrm{type} \quad \Gamma \vdash a:A \quad \Gamma \vdash b:A \quad \Gamma \vdash p:\mathrm{Id}_{A}(a, b) \quad \Gamma \vdash t:B(a)}{\Gamma \vdash \mathrm{heqTransport}(a, b, p, t):\mathrm{JMEq}(a, b, t, \mathrm{transport}_{x:A.B(x)}(a, b, p, t))}

Inference rules without UIP

It should be possible to take McBride’s axiomatization of John Major equality above and simply remove the requirement that John Major equality be a proposition-valued type family.

Then, the inference rules for forming John Major equality and terms are as follows. First the inference rule that defines the John Major equality itself, as a dependent type, in some context Γ\Gamma.

Formation rule for John Major equality:

ΓAtypeΓB(x)type Γa:AΓb:AΓy:B(a)Γz:B(b)ΓJMEq x:A.B(x)(a,b,y,z)type\frac{ \begin{array}{l} \Gamma \vdash A \; \mathrm{type} \quad \Gamma \vdash B(x) \; \mathrm{type} \\ \Gamma \vdash a:A \quad \Gamma \vdash b:A \quad \Gamma \vdash y:B(a) \quad \Gamma \vdash z:B(b) \end{array} }{\Gamma \vdash \mathrm{JMEq}_{x:A.B(x)}(a, b, y, z) \; \mathrm{type}}

Now the basic “introduction” rule, which says that everything is equal to itself in a canonical way.

Introduction rule for John Major equality:

ΓAtypeΓ,x:AB(x)type Γa:AΓy:B(a)Γrefl x:A.B(x)(a,y):JMEq x:A.B(x)(a,a,y,y)\frac{ \begin{array}{l} \Gamma \vdash A \; \mathrm{type} \quad \Gamma, x:A \vdash B(x) \; \mathrm{type} \\ \Gamma \vdash a:A \quad \Gamma \vdash y:B(a) \end{array} }{\Gamma \vdash \mathrm{refl}_{x:A.B(x)}(a, y):\mathrm{JMEq}_{x:A.B(x)}(a, a, y, y)}

Next we have the “elimination” rule:

Elimination rule for John Major equality:

ΓAtypeΓ,x:AB(x)type Γ,a:A,b:A,y:B(a),z:B(b),p:JMEq x:A.B(x)(a,b,y,z)C(a,b,y,z,q)type Γt: a:A y:B(a)C(a,a,y,y,refl x:A.B(x)(a,y)) Γa:AΓb:AΓy:B(a)Γz:B(b)Γp:JMEq x:A.B(x)(a,b,y,z)Γind JMEq x:A.B(x)(t,a,b,y,z,p):C(a,b,y,z,p)\frac{ \begin{array}{l} \Gamma \vdash A \; \mathrm{type} \quad \Gamma, x:A \vdash B(x) \; \mathrm{type} \\ \Gamma, a:A, b:A, y:B(a), z:B(b), p:\mathrm{JMEq}_{x:A.B(x)}(a, b, y, z) \vdash C(a, b, y, z, q) \; \mathrm{type} \\ \Gamma \vdash t:\prod_{a:A} \prod_{y:B(a)} C(a, a, y, y, \mathrm{refl}_{x:A.B(x)}(a, y)) \\ \Gamma \vdash a:A \quad \Gamma \vdash b:A \quad \Gamma \vdash y:B(a) \quad \Gamma \vdash z:B(b) \quad \Gamma \vdash p:\mathrm{JMEq}_{x:A.B(x)}(a, b, y, z) \end{array} }{\Gamma \vdash \mathrm{ind}_{\mathrm{JMEq}_{x:A.B(x)}}(t, a, b, y, z, p):C(a, b, y, z, p)}

The elimination rule then says that if:

  1. for any elements a:Aa:A and b:Ab:A, any elements y:B(a)y:B(a) and z:B(b)z:B(b), and any John Major equality p:JMEq x:A.B(x)(a,b,y,z)p:\mathrm{JMEq}_{x:A.B(x)}(a, b, y, z) we have a type C(a,b,y,z,p)C(a, b, y, z, p), and
  2. we have a specified dependent function
    t: a:A y:B(a)C(a,a,y,y,refl x:A.B(x)(a,y))t:\prod_{a:A} \prod_{y:B(a)} C(a,a,y,y,\mathrm{refl}_{x:A.B(x)}(a, y))

then we can construct a canonically defined term called the eliminator

ind hId x:A.B(x)(t,a,b,y,z,q):C(a,b,y,z,q)\mathrm{ind}_{\mathrm{hId}_{x:A.B(x)}}(t,a,b,y,z,q):C(a,b,y,z,q)

for any aa, bb, yy, zz, and qq.

Then, we have the computation rule or beta-reduction rule. This says that for all elements a:Aa:A and y:B(a)y:B(a), substituting the dependent function t: a:A y:B(a)C(a,a,y,y,refl x:A.B(x)(a,y))t:\prod_{a:A} \prod_{y:B(a)} C(a,a,y,y,\mathrm{refl}_{x:A.B(x)}(a, y)) into the eliminator along reflexivity for aa and yy yields an element equal to t(a,y)t(a, y) itself. Normally “equal” here means judgmental equality (a.k.a. definitional equality), but it is also possible for it to mean propositional equality (a.k.a. typal equality), so there are two possible computation rules.

Computation rules for John Major equality:

  • Judgmental computational rule

    ΓAtypeΓ,x:AB(x)type Γ,a:A,b:A,y:B(a),z:B(b),p:JMEq x:A.B(x)(a,b,y,z)C(a,b,y,z,p)type Γt: a:A y:B(a)C(a,a,y,y,refl x:A.B(x)(a,y))Γa:AΓy:B(a)Γind JMEq x:A.B(x)(t,a,a,y,y,refl x:A.B(x)(a,y))t(a,y):C(a,a,y,y,refl x:A.B(x)(a,y))\frac{ \begin{array}{l} \Gamma \vdash A \; \mathrm{type} \quad \Gamma, x:A \vdash B(x) \; \mathrm{type} \\ \Gamma, a:A, b:A, y:B(a), z:B(b), p:\mathrm{JMEq}_{x:A.B(x)}(a, b, y, z) \vdash C(a, b, y, z, p) \; \mathrm{type} \\ \Gamma \vdash t:\prod_{a:A} \prod_{y:B(a)} C(a, a, y, y, \mathrm{refl}_{x:A.B(x)}(a, y)) \quad \Gamma \vdash a:A \quad \Gamma \vdash y:B(a) \end{array} }{\Gamma \vdash \mathrm{ind}_{\mathrm{JMEq}_{x:A.B(x)}}(t, a, a, y, y, \mathrm{refl}_{x:A.B(x)}(a, y)) \equiv t(a, y):C(a, a, y, y, \mathrm{refl}_{x:A.B(x)}(a, y))}
  • Propositional computational rule

    ΓAtypeΓ,x:AB(x)type Γ,a:A,b:A,y:B(a),z:B(b),p:JMEq x:A.B(x)(a,b,y,z)C(a,b,y,z,p)type Γt: a:A y:B(a)C(a,a,y,y,refl x:A.B(x)(a,y))Γa:AΓy:B(a)Γβ JMEq x:A.B(x)(t,a,y):Id C(a,a,y,y,hrefl x:A.B(x)(a,y))(ind JMEq x:A.B(x)(t,a,a,y,y,refl x:A.B(x)(a,y)),t(a,y))\frac{ \begin{array}{l} \Gamma \vdash A \; \mathrm{type} \quad \Gamma, x:A \vdash B(x) \; \mathrm{type} \\ \Gamma, a:A, b:A, y:B(a), z:B(b), p:\mathrm{JMEq}_{x:A.B(x)}(a, b, y, z) \vdash C(a, b, y, z, p) \; \mathrm{type} \\ \Gamma \vdash t:\prod_{a:A} \prod_{y:B(a)} C(a, a, y, y, \mathrm{refl}_{x:A.B(x)}(a, y)) \quad \Gamma \vdash a:A \quad \Gamma \vdash y:B(a) \end{array} }{\Gamma \vdash \beta_{\mathrm{JMEq}_{x:A.B(x)}}(t, a, y):\mathrm{Id}_{C(a, a, y, y, \mathrm{hrefl}_{x:A.B(x)}(a, y))}(\mathrm{ind}_{\mathrm{JMEq}_{x:A.B(x)}}(t, a, a, y, y, \mathrm{refl}_{x:A.B(x)}(a, y)), t(a, y))}

Finally, one might consider a uniqueness rule or eta-conversion rule. But similar to the case for identity types, a judgmental uniqueness rule for John Major equality implies that the type theory is an extensional type theory, in which case there is not much need for John Major equality, so such a rule is almost never written down. And as for identity types and other inductive types, the propositional/typal uniqueness rule is provable from the other four inference rules, so we don’t write it out explicitly.

References

  • Conor McBride, §5.1.3 in: Dependently Typed Functional Programs and their Proofs, (1999) [pdf]

    (who speaks of “John Major equality” McBride 1999 with reference to British political discussion of that times)

  • Théo Winterhalter, A conservative and constructive translation from extensional type theory to weak type theory, Strength of Weak Type Theory, DutchCATS, 11 May 2023. (slides)

Last revised on April 22, 2024 at 20:19:11. See the history of this page for a list of all contributions to it.