Lectures onType Theory
Chapter 90
Chapter 90Core route

Extensional Type Theory

Suppose p identifies a with b and u:B[a/x]. In the intensional theory the passage from u to the fiber B[b/x] is recorded by the term trp(u). Extensional type theory makes a different choice: from p it admits the judgment ab, after which conversion regards the unchanged term u as an element of B[b/x].

The extensional equality type EqA(a,b) has reflexivity as its proof and reflects an inhabitant into judgmental equality. Equality reflection turns p:EqA(a,b) into ab, so conversion moves terms between the two fibers without an explicit transport.

The extensional delta

The equality type internalizes the judgment Γab:A itself, not a proof-relevant approximation of it.

Definition 35.1 — Extensional equality types

Extend the binding signature by the type former EqA(a,b) of arity (0,0,0) and an annotated constructor eqrefla of arity (0). The constructor eqrefla is printed refl when its endpoint is determined by the expected type. The extensional equality former EqA(a,b) is distinct from the intensional identity type IdA(a,b) of definition 30.1, which the base theory retains.

The theory ETT extends the base by the type former EqA(a,b), governed by the following rules (premises compressed per convention 26.14).

Γa:AΓb:A
ΓEqA(a,b) type
Eq-F
Γa:A
Γrefl:EqA(a,a)
Eq-I
Γp:EqA(a,b)
Γab:A
Eq-Reflect
Γp:EqA(a,b)
Γprefl:EqA(a,b)
Eq-Uniq

When the base contains the Russell universes of definition 29.1, equality propositions are small whenever their ambient type is small:

ΓA:UiΓa:AΓb:A
ΓEqA(a,b):Ui
Eq-Form-U

Remark 35.2 — Congruence

The classified congruence instances for the new raw operators are

ΓAA typeΓaa:AΓbb:A
ΓEqA(a,b)EqA(a,b) type
Eq-F-eq
Γaa:A
Γeqreflaeqrefla:EqA(a,a)
Eq-I-eq

In the second conclusion the right-hand term and its natural classifier are first converted along Eq-F-eq. The conclusions of Eq-Reflect and Eq-Uniq are likewise stable under conversion of their premises. These are the congruence facts used below.

Remark 35.3 — Meta-well-typedness of Eq-Uniq

The conclusion of Eq-Uniq equates p with refl at the type EqA(a,b), although Eq-I gives refl the type EqA(a,a). The rule is nevertheless well posed: from the premise, Eq-Reflect yields ab, hence ΓEqA(a,a)EqA(a,b) type by congruence, and refl inhabits EqA(a,b) by conversion. Thus Eq-Uniq presupposes Eq-Reflect; the two rules cannot be adopted separately in this formulation.

Convention 48.28 — Ambient set theory

Work in ZFC with an (ω+1)-chain of Grothendieck universes. This is a large-cardinal assumption, not a theorem of ZFC.

Proposition 35.4 — A separating set interpretation

Under convention 48.28, let V0V1 be the resulting sequence as in lemma 74.14. The set interpretation of the Russell hierarchy, extended to intensional identity types as in proposition 77.32, extends further to the extensional equality rules. Consequently, relative to those set-theoretic assumptions, ETT with Russell universes has no closed term of 0, and ttff remains valid after adding reflection.

Proof of Proposition 35.4 — A separating set interpretation

Proof. First use the extension of proposition 77.32: interpret an identity type by the singleton when its endpoints have equal denotations and by the empty set otherwise. Reflexivity denotes the unique element; J is well defined because an inhabitant forces the two endpoints to have the same denotation, and its reflexivity clause is literal.

At level i, continue that interpretation by putting [[EqA(a,b)]]ρ:={[[a]]ρ=[[b]]ρ}. Thus an equality type is either empty or a singleton. Reflexivity denotes . An inhabitant forces the endpoint denotations to be equal, validating Eq-Reflect; any two inhabitants denote the unique element, validating Eq-Uniq. Both fibers lie in Vi: they are subsets of the singleton {}Vi, and a Grothendieck universe is closed under subsets. Thus Eq-Form-U is sound at every level. Ordinary substitution of set families validates substitution and congruence.

The interpretations of 0, tt, and ff have not changed: they are , 1, and 0. Soundness therefore gives the two separation conclusions. ◻

Definition 48.30 — The set model

The set model is the composite of the interpretations in definition 28.12, lemma 74.14, proposition 77.32, proposition 35.4. The name includes exactly those four stages; it does not silently add a quotient, a simplicial interpretation, or a univalent universe.

Corollary 90.7 — Relative consistency

Under convention 48.28, the intensional base and its extensional equality extension derive no closed term of 0.

Proof of Corollary 90.7 — Relative consistency

Proof. Soundness of definition 48.30 sends any closed inhabitant of 0 to an element of its interpretation, which is by proposition 35.4. ◻

Remark 35.5 — What reflection discards

Eq-Reflect concludes an equality judgment from the mere existence of a term. Three observations measure its strength. (i) Judgmentally equal terms may be exchanged silently at any position of any judgment, by conversion and the classified congruence scheme of definition 26.36, convention 27.1. (ii) The proof p is not recorded in such exchanges: the conclusion ab retains no trace of it. (iii) The premise does not require p to be closed or canonical; p may be a variable, so any hypothesis of equality type acts on the judgmental equality of the entire context. This observation concerns the rule itself; the undecidability proof below is a separate reduction.

Example 35.6 — Silent transport

Let Γ,x:AB type, Γp:EqA(a,b) and Γu:B[a/x]. Then u itself inhabits B[b/x] — transport is the identity. In the base, the same passage requires the transport construction tr of construction 30.9 and leaves a mark on the term. Rule names for the structural rules as in definition 26.22:

Γu:B[a/x]
Γ,x:AB type
Γp:EqA(a,b)
Γab:A
Eq-Reflect
ΓB[a/x]B[b/x] type
Subst-Eq-Ty
Γu:B[b/x]
Conv

Theorem 35.7 — Eq internalizes judgmental equality

Let Γa:A and Γb:A. Then:

  1. EqA(a,b) is inhabited in Γ if and only if Γab:A;

  2. any two inhabitants of EqA(a,b) are judgmentally equal.

Proof of Theorem 35.7 — Eq internalizes judgmental equality

Proof. (1) If Γp:EqA(a,b), then Γab:A by Eq-Reflect. Conversely, if Γab:A, then ΓEqA(a,a)EqA(a,b) type by congruence for Eq-F, and Γrefl:EqA(a,a) by Eq-I, so Γrefl:EqA(a,b) by Conv. (2) If p,q both inhabit EqA(a,b), then prefl and qrefl by Eq-Uniq. The inverse of the second judgment is reflq; composing it with the first gives pq. ◻

Remark 35.8 — Departure from the fourfold order

Eq is the one former of this book with no type-valued elimination rule: it has formation and introduction rules, but no ordinary elimination or computation rules. Eq-Reflect occupies the place of elimination — it eliminates into the judgmental level rather than into types — and Eq-Uniq is an η-law. An eliminator in the style of J is derivable, with a judgmental computation rule (theorem 35.9(iii)), so nothing is lost. Conversely, suppose the other three rules are joined by a J-eliminator. In context x,y:A,q:EqA(x,y), reflection makes C(x,y,q):=EqEqA(x,y)(q,refl) well formed. The reflexivity branch is refl:C(x,x,refl), so J gives C(a,b,p) for every p:EqA(a,b). Reflecting that inhabitant gives prefl; this is Eq-Uniq. Thus the derivation belongs to the main line; exercise 35.2 reconstructs its rule tree.

Exercise 35.1

★★☆ Exhibit the following rule as the instance of the classified congruence scheme of definition 26.36 for the parameter telescope (A type;a:A;b:A): if ΓAA type, Γaa:A and Γbb:A, then ΓEqA(a,b)EqA(a,b) type. Conclude that Γrefl:EqA(a,b) whenever Γab:A.

Exercise 35.2

★★☆ Consider the base extended by Eq-F, Eq-I, Eq-Reflect and a J-style eliminator for Eq (formulate its rules following definition 30.1), but without Eq-Uniq. Show that Eq-Uniq is derivable. Hint: the family C(x,y,q):=EqEqA(x,y)(q,refl) is well formed thanks to Eq-Reflect applied to the variable q; eliminate, then reflect.

Exercise 35.3

★☆☆ In the situation of example 35.6, give a derivation of Γλu.u:B[a/x]B[b/x].

Exercise 35.4

★★☆ Using Eq-Reflect but not J, construct terms sym:EqA(a,b)EqA(b,a),trans:EqA(a,b)EqA(b,c)EqA(a,c), and show that every application of either is judgmentally equal to refl.

Consequences of reflection

The base signature contains neither K nor function extensionality; definition 30.35 therefore treated the latter as an additional principle. ETT proves both. No underivability claim is a premise here; a later groupoid countermodel separates K from J for its exact universe/Π/Σ/base-type fragment.

Theorem 35.9 — Consequences of reflection

In ETT:

  1. (UIP) If Γp:EqA(a,b) and Γq:EqA(a,b), then Γpq:EqA(a,b); moreover the internal statement EqEqA(a,b)(p,q) is inhabited (by refl).

  2. (Function extensionality) If Γf:x:AB, Γg:x:AB and Γh:x:AEqB(fx,gx), then Γfg:x:AB; moreover Eqx:AB(f,g) is inhabited (by refl).

  3. (J and K definable) Let Γ,x:A,y:A,q:EqA(x,y)C type and Γ,x:Ac:C[x,x,refl/x,y,q]. Then for all Γa:A, Γb:A, Γp:EqA(a,b), the term J(x.c;a,b,p):=c[a/x] satisfies Γc[a/x]:C[a,b,p/x,y,q] and computes judgmentally: J(x.c;a,a,refl)c[a/x]. For the K construction, suppose Γ,x:A,q:EqA(x,x)D type, Γ,x:Ad:D[refl/q], Γa:A, and Γp:EqA(a,a), define K(x.q.D;x.d;a,p):=d[a/x]:D[a/x,p/q]. Then K(x.q.D;x.d;a,refl)d[a/x].

Proof of Theorem 35.9 — Consequences of reflection

Proof. (1) By Eq-Uniq, preflq. Internalization gives the term refl:EqEqA(a,b)(p,q).

(2) In the context Γ,x:A we have Γ,x:Ahx:EqB(fx,gx), so Γ,x:Afxgx:B by Eq-Reflect. By the rule λ-eq (remark 27.4), Γλx.fxλx.gx:x:AB, and by the η-rule for Π (definition 27.2) fλx.fx and gλx.gx; hence fg by transitivity. Apply theorem 35.7(1) for the internal statement.

(3) We have Γc[a/x]:C[a,a,refl/x,y,q] by the substitution rule. From p, Eq-Reflect gives ab and Eq-Uniq gives prefl, so ΓC[a,a,refl/x,y,q]C[a,b,p/x,y,q] type by congruence, and Conv concludes the typing. The computation rule J(x.c;a,a,refl)c[a/x] holds because the left-hand side is defined to be the right-hand side.

For K, substitution gives d[a/x]:D[a/x,refl/q]. Rule Eq-Uniq gives prefl, so dependent congruence and conversion change this classifier to D[a/x,p/q]. The reflexivity equation is judgmental because the displayed K was defined to be d[a/x]. ◻

Proposition 35.10 — Collapse of the identity type

In ETT, the intensional identity type of definition 30.1 satisfies reflection and uniqueness as derived rules: if Γp:IdA(a,b), then Γab:A and Γprefl:IdA(a,b). Consequently IdA(a,b) and EqA(a,b) are inhabited in exactly the same contexts, and each inhabitant of either is judgmentally equal to refl.

Proof of Proposition 35.10 — Collapse of the identity type

Proof. Define e:=λp.J(x.y.q.EqA(x,y);z.refl;p):IdA(a,b)EqA(a,b), using the primitive J with motive EqA(x,y) and reflexivity clause z.refl; here J is the primitive eliminator of definition 30.1. Given Γp:IdA(a,b), we obtain Γep:EqA(a,b) and hence ab by Eq-Reflect.

Conversely, if r:EqA(a,b), reflection gives ab; hence refla:IdA(a,a) converts to an inhabitant of IdA(a,b). This proves the asserted equivalence of inhabitation.

For uniqueness, consider the family Γ,x:A,y:A,q:IdA(x,y)IdIdA(x,y)(q,refl) type. It is well formed: applying e to the variable q and reflecting gives xy in its context. Hence IdA(x,x)IdA(x,y) as types, and reflx:IdA(x,y) by conversion. The base case refl:IdIdA(x,x)(refl,refl) is available, so J yields Γw:IdIdA(a,b)(p,refl). Applying e at the type IdA(a,b) and reflecting once more gives prefl. ◻

Corollary 35.11 — The groupoid structure trivializes

In ETT, every operation of the groupoid structure of theorem 30.20 — symmetry, transitivity, ap, transport — is judgmentally equal to a constant function returning refl (respectively, for transport, to the identity function): for instance trpB(u)u for every p and u.

Proof of Corollary 35.11 — The groupoid structure trivializes

Proof. Each operation is defined by J from a base case (theorem 30.20). By proposition 35.10, every path argument is judgmentally refl. Hence p1proposition35.10refl1Idcomprefl,pqproposition35.10reflreflIdcomprefl,apf(p)proposition35.10apf(refl)Idcomprefl. Likewise trpB(u)proposition35.10trreflB(u)Idcompu. For example, the right-unit law reduces to preflbproposition35.10reflareflaIdcompreflaproposition35.10p. The inverse, left-unit, associativity, and action laws reduce by the same three displayed computations. ◻

Remark 35.12 — The delta is strict

Equality reflection derives K. The derivation is clause (3) of theorem 35.9. The groupoid countermodel refutes K in the corresponding intensional fragment. Equality reflection therefore strictly strengthens that fragment. The exact core signature in which reflection has the same inhabitation strength as UIP plus function extensionality is stated in section 35.4.

Exercise 35.5

★★☆ Use the derived K from theorem 35.9(3), with motive D(x,p):=EqEqA(x,x)(p,refl). Compare the resulting inhabitant with the direct inhabitant given by Eq-Uniq. Internalize their equality using theorem 35.7.

Exercise 35.6

★★☆ Write out the conversions in trpqB(u)trqB(trpB(u)) explicitly: first replace p,q by reflexivity using proposition 35.10, then cite the two relevant J computation rules. Repeat for (pq)1q1p1.

Exercise 35.7

★★☆ Define happly:Eqx:AB(f,g)x:AEqB(fx,gx) without J, and show that happly and the function funext:=λh.refl of theorem 35.9(2) are mutually inverse, both composites being judgmentally equal to identity functions.

Propositions and truncation

Under propositions-as-types, 1, 0, Π, × and model , , , and ; but Σ and + overshoot and , because their inhabitants carry more information than the bare truth of the proposition. This section delimits the types that behave as propositions and adds the connective that discards the surplus.

Definition 35.13 — Proposition

A type ΓA type is a proposition if every two generic elements are judgmentally equal, that is, if Γ,x:A,y:Axy:A.

Remark 35.14

Being a proposition is a judgment about the generic pair of elements of A, and is therefore stable under substitution and weakening, as every judgment is. It is not the condition “A has at most one closed inhabitant”. With the universes of definition 29.1, take the type X in context X:U0. It has no inhabitants: one would specialize under X:=0 to an inhabitant of 0. Yet it is not a proposition: propositionhood is preserved by the substitution X:=2, and 2 is not a proposition (lemma 35.15(v)).

Lemma 35.15 — Closure properties

In ETT:

  1. EqA(a,b) is a proposition, for all A,a,b;

  2. 1 and 0 are propositions;

  3. if Γ,x:AB type is a proposition, so is x:AB;

  4. if A and Γ,x:AB type are propositions, so is x:AB;

  5. 2 is not a proposition, and propositions are not closed under +.

Proof of Lemma 35.15 — Closure properties

Proof. (1) By Eq-Uniq, both generic inhabitants are judgmentally equal to refl.

(2) For 1: xy by the η-rule in definition 27.14. For 0: in the context Γ,x:0,y:0 the term rec0(x) inhabits Eq0(x,y), and Eq-Reflect concludes xy. (Note the use of reflection: in the base, 0 is a proposition only propositionally.)

(3) Let f,g be the generic elements of x:AB. In the extended context ,x:A, the terms fx and gx are two elements of the proposition B, so fxgx; rule λ-eq of remark 27.4 and the η-rule of definition 27.2 then give fg, exactly as in the proof of theorem 35.9(2).

(4) Let u,v be the generic elements of x:AB. Since A is a proposition, pr1(u)pr1(v):A. Convert pr2(v) along this equality to the fiber B[pr1(u)/x]. That fiber is a proposition, so pr2(u)pr2(v). Pair congruence followed by the two Σ eta equations gives uΣη(pr1(u),pr2(u))paireq(pr1(v),pr2(v))Σηv.

(5) If 2 were a proposition, substituting its generic elements by tt,ff would give ttff. This contradicts the sound set interpretation of proposition 35.4, in which they denote 1 and 0. The propositions 1,1 have a coproduct with distinct elements inl() and inr(); their set interpretations carry different tags. Hence 1+1 is not a proposition. ◻

Lemma 35.16 — Internal characterization

For ΓA type put isProp(A):=x:Ay:AEqA(x,y). Then A is a proposition if and only if isProp(A) is inhabited; and isProp(A) is itself a proposition.

Proof of Lemma 35.16 — Internal characterization

Proof. If A is a proposition, then in Γ,x:A,y:A we have xy, so refl inhabits EqA(x,y) by conversion, and λx.λy.refl:isProp(A). Conversely, if Γw:isProp(A), then Γ,x:A,y:Awxy:EqA(x,y), and Eq-Reflect gives xy. Finally isProp(A) is a Π-type into an Eq-type, hence a proposition by lemma 35.15(1),(3). ◻

Example 35.17 — Σ is not : the illusion of choice

Let ΓA type, ΓB type and Γ,x:A,y:BP type. The naive translation of the axiom of choice with Σ as , NaiveChoice:=(x:Ay:BP)f:ABx:AP[fx/y], is inhabited already in the base, by λF.(λx.pr1(Fx),λx.pr2(Fx)) (the second component typechecks up to β). This term does not choose anything: it merely re-associates a pair-valued function into a pair of functions. The force of the axiom of choice — extracting a function from a bare existence statement — is absent, because an inhabitant of y:BP is not a bare existence statement: its witness is available by projection. The proper formulation requires an existential that is a proposition.

Definition 35.18 — Propositional truncation

The propositional truncation A discards the identity of an inhabitant of A while retaining whether one exists. Extend the binding signature by A and |a|, both of arity (0), and by the annotated recursor recA(x.c,t) of arity (1,0), binding x in c. Substitution through the recursor is therefore the corresponding binding clause of definition 26.10.

The optional truncation delta adds a former A.

ΓA type
ΓA type
Tr-F
Γa:A
Γ|a|:A
Tr-I
Γp:AΓq:A
Γpq:A
Tr-Uniq
ΓC typeΓ,y:C,z:Cyz:CΓ,x:Ac:CΓt:A
ΓrecA(x.c,t):C
Tr-E

Its classified congruence instances include

ΓAA type
ΓAA type
Tr-F-eq
Γaa:A
Γ|a||a|:A
Tr-I-eq

and, after converting the primed data to the displayed common types,

ΓCC typeΓ,y:C,z:Cyz:CΓ,x:Acc:CΓtt:A
ΓrecA(x.c,t)recA(x.c,t):C
Tr-E-eq

Rule Tr-Uniq makes A a proposition. Rule Tr-E permits elimination into propositions only: its premise on C is the judgment of definition 35.13.

Corollary 35.19 — Set interpretation of truncation

The set interpretation of proposition 35.4 extends to the optional truncation delta.

Proof of Corollary 35.19 — Set interpretation of truncation

Proof. Interpret A as the quotient of [[A]]ρ by the indiscrete equivalence relation. It is empty when A is empty and otherwise a singleton; |a| denotes the class of a. Given a branch ac(a) into a proposition C, set recA(x.c,[a]):=c(a). This is independent of the representative because every two elements of C are equal. It validates Tr-Uniq, Tr-E, their congruence rules, and semantic substitution. ◻

Remark 35.20

No computation rule accompanies Tr-E: since C is a proposition, recA(x.c,|a|) and c[a/x] are two elements of C and hence the following equality is derivable: ΓrecA(x.c,|a|)c[a/x]:C. For the same reason a dependent eliminator is derivable rather than postulated (proposition 35.21). Rule Tr-Uniq makes A judgmentally propositional.

Proposition 35.21 — Dependent truncation elimination

Suppose every fiber C is a proposition and Γ,z:AC type. Assume Γ,x:Ac:C[|x|/z]andΓt:A. One can derive a term of C[t/z] using only Tr-E and the earlier type formers.

Proof of Proposition 35.21 — Dependent truncation elimination

Proof. Put D:=z:AC. This is a proposition. Indeed, for generic d,e:D, rule Tr-Uniq gives pr1(d)pr1(e). After converting the second components to the same fiber, propositionhood of C gives pr2(d)pr2(e); pair congruence and Σ-η then give de.

The branch x.(|x|,c) has type D, so Tr-E gives d:=recA(x.(|x|,c),t):D. Both pr1(d) and t inhabit A, hence Tr-Uniq gives pr1(d)t. Consequently pr2(d):C[pr1(d)/z] converts to an element of C[t/z], as required. When t=|a|, the induced computation equality from the preceding remark, followed by the two Σ beta rules, identifies this term with c[a/x]. ◻

Definition 35.22 — Existence and disjunction

For ΓA type, Γ,x:AB type and ΓC type, put x:AB:=x:AB,AC:=A+C.

Proposition 35.23 — The logic of ETT

With the truncation delta, the propositions of definition 35.13 model intuitionistic predicate logic, with connectives:

logic type a proposition when
1 always
0 always
φψ φ×ψ φ,ψ propositions
φψ φψ ψ a proposition
¬φ φ0 always
a=Ab EqA(a,b) always
x:A.φ x:Aφ φ a proposition
x:A.φ x:Aφ always
φψ φ+ψ always

Each connective is a proposition under the stated hypotheses, and its introduction and elimination rules (restricted, for and , to propositional conclusions) are derivable.

Proof of Proposition 35.23 — The logic of ETT

Proof. Proposition-hood follows from lemma 35.15 and Tr-Uniq. The ordinary rules of the corresponding formers give the rules for ,,,,¬, and . Equality uses theorem 35.7. Existential introduction is |(a,b)|; elimination into a proposition combines Tr-E with Σ-elimination.

For disjunction, the two introductions are λa.|inl(a)|:AAB,λb.|inr(b)|:BAB. Given a proposition C, f:AC, and g:BC, coproduct elimination gives z:A+Bind+(f,g,z):C. Applying Tr-E yields λt.recA+B(z.ind+(f,g,z),t):(AB)C. On either injection the expected computation equality follows first from the induced truncation computation of remark 35.20 and then from the corresponding coproduct beta rule. ◻

Definition 35.24 — Small propositions

Assume the universe rules of definition 29.1. The type of small propositions is Prop0:=X:U0isProp(X). For φ:Prop0, write φ:=pr1(φ) for its underlying type. Thus the universe-quantified form of excluded middle is the precise type φ:Prop0φ¬φ. No closure property of Prop0 is hidden in this notation; the required codes and proofs of propositionhood must be constructed. Quantifying over Prop0 is what upgrades the preceding predicate-logic interpretation to higher-order logic.

Remark 35.25 — Choice and excluded middle

Formulated with of definition 35.22, the axiom of choice AC:=(x:Ay:BP)f:ABx:AP[fx/y] is no longer automatically inhabited: the witness inside a truncation is inaccessible to the type AB. Neither AC nor the law of excluded middle LEM:=φ:Prop0φ¬φ of definition 35.24 is assumed in this chapter. Projecting from y:BP cannot define a witness in B; therefore the calculation of example 35.17 proves neither AC nor LEM.

Exercise 35.8

★★☆ Assume ΓA type and Γ,x:AB type, let every fiber B be a proposition, and suppose it has a section s:x:AB. Show that x:AB is a proposition if and only if A is. For the implication from the sum to A, apply pr1 to the equality between (x,s(x)) and (y,s(y)).

Exercise 35.9

★☆☆ Use proposition 35.4 to show that N is not a proposition. More generally, let A be a closed type with a closed inhabitant a:A. Show in the empty context that A+A is not a proposition by comparing inl(a) and inr(a) in the set interpretation.

Exercise 35.10

★★☆ Show that A is a proposition if and only if the map λa.|a|:AA admits a retraction, and that in this case the retraction is a judgmental isomorphism (both composites judgmentally equal to identities). Conclude that A and A are always judgmentally isomorphic.

Exercise 35.11

★★☆ For f:AB, use Tr-E to construct f:AB. Show from propositionhood alone that λx.x is judgmentally the identity and that gf is judgmentally gf.

Exercise 35.12

★★☆ Construct maps ABBA and (AB)CA(BC). Construct their reverse maps and use propositionhood to show that both pairs of composites are judgmentally equal to the relevant identity functions.

Exercise 35.13

★★★ Work with Prop0 from definition 35.24. Construct elements representing , , φψ, and φψ for φ,ψ:Prop0. More generally, if Γ,x:AB:U0 and ΓA:U0 and Γq:x:AisProp(B), construct the element of Prop0 whose underlying type is x:AB.

For ΓA:U0 and Γa,b:A, explicitly apply Eq-Form-U and Eq-Uniq to construct the element whose underlying type is EqA(a,b). Finally, assuming a universe code for truncation and its decoding equation, construct elements whose underlying types are x:ABandφ+ψ. These are the universe-coded existential and disjunction operations.

Reflection versus UIP and function extensionality

By theorem 35.9, reflection proves UIP and function extensionality. This section states the precise converse: over the core base, the two axioms recover the full strength of reflection, as far as inhabitation is concerned. The result is due to Hofmann.

Definition 35.26 — The three theories

Fix the Hofmann core TH: the structural rules (definition 26.22) with the formers Π, Σ, and 1 (with their η-rules), N, and Id with J (definition 30.1); no universes or other inductive types. Define:

  1. TE (extensional core): TH extended by the rules

    Γp:IdA(a,b)
    Γab:A
    Id-Reflect
    Γp:IdA(a,b)
    Γprefl:IdA(a,b)
    Id-Uniq

    i.e. the delta of definition 35.1 imposed on Id directly; by proposition 35.10 this is our ETT restricted to the core after replacing Eq by the propositionally equivalent Id former. The two raw type formers are not being declared judgmentally equal.

  2. TI (intensional core with extensionality axioms): TH extended by two constants without computation rules. Their raw arities are uip(p):(0) and ext(f,g,x.h):(0,0,1), the last entry binding x in h:

    Γp:IdA(a,a)
    Γuip(p):IdIdA(a,a)(p,refl)
    UIP-Ax
    Γf:x:ABΓg:x:ABΓ,x:Ah:IdB(fx,gx)
    Γext(f,g,x.h):Idx:AB(f,g)
    Ext-Ax

    The one-endpoint form of UIP-Ax is the primitive constant used below.

Definition 35.27 — Stripping

The named stripping map sends expressions of TI to expressions of TE. For source expressions e:=uip(p),e:=ext(f,g,x.h), put strip(e):=reflstrip(p),strip(e):=reflstrip(f). The map is homomorphic through every other term, type, and context former. For contexts, strip()=,strip((Γ,x:A))=strip(Γ),x:strip(A). The corresponding type and term clauses induce stripping on judgments. Propositional truncation is not among the formers of TI or TE. In particular, stripping preserves the raw domain annotation of λ(x:A).b, sending it to the annotated expression λ(x:strip(A)).strip(b). The annotation is merely suppressed in ordinary print.

Lemma 35.28 — Stripping and binding

Stripping is well defined on alpha-classes and commutes with capture-avoiding substitution: strip(e[a/x])=strip(e)[strip(a)/x]. For a telescope, the induced equation is strip((Δ[a/x]))=strip(Δ)[strip(a)/x] declaration by declaration.

Proof of Lemma 35.28 — Stripping and binding

Proof. Induct on the binding tree of e. Every old constructor is homomorphic. For uip(p) the induction hypothesis gives the first equation below. For ext(f,g,y.h) choose y fresh for a; the induction hypothesis applies to f,g,h and gives the second: strip(p[a/x])=IHstrip(p)[strip(a)/x],strip(f[a/x])=IHstrip(f)[strip(a)/x]. Changing the fresh representative changes neither result, so the calculation also respects the alpha-generator at the bound branch. The displayed context and telescope equations then induce the result for judgments. ◻

Proposition 35.29 — Soundness of stripping

If a judgment J is derivable in TI, then strip(J) is derivable in TE.

Proof of Proposition 35.29 — Soundness of stripping

Proof. Use induction on derivations. Substitution cases use lemma 35.28. Every other rule of TH translates to itself. For UIP-Ax, put I:=Idstrip(A)(strip(a),strip(a)). Inductively, strip(Γ)strip(p):I. Hence strip(p)IdUniqrefl,IdI(strip(p),refl)congruenceIdI(refl,refl). The term reflstrip(p) inhabits the latter type; conversion concludes. For Ext-Ax, the induction hypothesis gives strip(Γ),x:strip(A)strip(h):Idstrip(B)(strip(f)x,strip(g)x). Thus strip(f)xstrip(g)x by Id-Reflect, hence strip(f)strip(g) by the λ-eq (remark 27.4) and η as in theorem 35.9(2). By conversion, reflstrip(f) inhabits Idx:strip(A)strip(B)(strip(f),strip(g)). (Without the η-rule for Π this case fails for terms that are not abstractions; η is essential here.)

The two new term-congruence schemes also require cases because stripping is not homomorphic at these constructors. The induction hypothesis is strip(p)strip(p); conversion makes the two identity classifiers the same type; congruence for annotated reflexivity then gives reflstrip(p)IHreflstrip(p). This is the congruence case for uip. For ext, the induction hypothesis strip(f)strip(f) gives reflstrip(f)reflstrip(f) by reflexivity congruence. The hypotheses for g and the bound branch validate the remaining premises of the source congruence instance, although stripping its conclusion depends only on f. Thus every stripped uip congruence is reflexivity congruence in TE; the same holds for ext congruence. ◻

Stripping is now a sound one-way translation, but it is not an inverse on terms: the two axiom constants have disappeared. The first quotient attempt identifies a and b whenever IdA(a,b) is inhabited. It fails under substitution: if the substitution representatives are only propositionally equal, then A[f] and A[g] are different fibers, so the two substituted terms do not even have a common identity type until one is transported. Choosing an arbitrary transport does not repair composition, because the two choices at an intermediate representative need not be the same raw map.

Here is the failed backward case in symbols. We write XY for the underlying comparison map from X to Y. Equality reflection in TE turns p:IdA(a,b) into ab. A backward translation must instead compare B[a/x]andB[b/x]bytrpx.B:B[a/x]B[b/x]. For two witnesses p,q:IdA(a,b) it obtains two raw maps trpx.B and trqx.B. Even if both have the right endpoints, composition through a third representative requires a path trprx.B=Idtrrx.Btrpx.B, and changing p to q requires another such coherence. A quotient by inhabitation alone records neither witness, so it cannot type, let alone prove, these two comparison obligations. General UIP equates parallel witnesses; canonical comparisons retain the transport maps and their composition paths.

To lift an extensional inhabitant back, we therefore construct a quotient Q of TI syntax in which propositionally equal substitutions and terms have coherent representatives. The construction comes in four steps. General UIP makes any two identity witnesses interchangeable, so no choice among them matters. Equal-substitution transport compares fibers over propositionally equal substitutions. Canonical comparisons then organize changes of representative, and the quotient lemmas carry the structural rules and the five core formers across them. A final triangle calculation produces the lifted term.

Lemma 35.30 — General UIP in T_I

If p,q:IdA(a,b) in TI, then IdIdA(a,b)(p,q) is inhabited.

Proof of Lemma 35.30 — General UIP in T_I

Proof. Use the primitive two-endpoint J on q with motive x,y:A, q:IdA(x,y)  p:IdA(x,y)IdIdA(x,y)(p,q) type. Its reflexivity clause is z.λp.uip(p). The required inhabitant is the resulting function applied to p. Only its existence and the resulting uniqueness of all identity witnesses are needed below. ◻

Definition 35.31 — Paths between substitutions

Let Δ=(y1:B1,,yn:Bn) and let f,g:ΓΔ. A component path p:f=Δg is a left-to-right list of identifications. Its first component is p1:IdB1(f1,g1). Having chosen the first i1 components, transport fi through them to the fiber containing gi and choose an identification there. This is the same telescope discipline used for a context morphism in proposition 26.46.

If ΔA type, write pA:A[f]A[g] for iterated transport through this list. Its reverse is (p1)A. Concatenation of component paths is defined in the same left-to-right order, transporting every later component before composing it.

The first dependent case is worth displaying. For Δ=(y:B,z:C(y)), write f=(b,c) and g=(b,c). A component path from f to g is not merely a pair of parallel paths: it consists of p:IdB(b,b),q:IdC(b)(pC(c),c). Thus, for y:B,z:C(y)D type, its action has the typed form (p,q)D:D[b/y,c/z]D[b/y,c/z]. One first eliminates p; only then do c and c lie in a common fiber and the elimination of q become well formed. At prefl and qrefl the displayed map is the identity. This two-coordinate calculation is the induction step repeated down a longer telescope.

Lemma 35.32 — Equal-substitution transport

For every p:f=Δg and ΔA type:

  1. pA and (p1)A are inverse up to identity;

  2. for Δa:A there is an identification pA(a[f])=Ida[g];

  3. these maps respect reflexivity, concatenation, and reindexing by a further substitution, up to identity;

  4. after stripping to TE, every one of these maps and identifications is judgmentally the corresponding identity.

All choices of the displayed comparison data are propositionally equal.

Proof of Lemma 35.32 — Equal-substitution transport

Proof. Induct on the length of Δ. For the empty telescope there is one substitution, pAλx.x, and every clause is reflexivity. For Δ=(Δ,y:B), write f=(f¯,r), g=(g¯,s), and p=(p¯,q), where p¯:f¯=Δg¯,q:IdB[g¯](p¯B(r),s). First apply the induction hypothesis to p¯. Elimination on q then reduces the last coordinate to reflexivity, so the action on a family over Δ,y:B is the iterated action (p¯,q)A:=qy.A[g¯]p¯y.A; the displayed notation abbreviates the two successive, well-typed identity eliminations. At p¯refl and qrefl this is literally the identity. The inverse law and the term-action law therefore follow by the same two eliminations. For concatenation and reindexing, the induction hypothesis identifies the prefix maps, after which elimination on the two last-coordinate paths leaves the reflexivity equation. This proves (1)–(3) and records the induction step rather than appealing to simultaneous elimination without its dependent typing.

For (4), stripping reflects the prefix components and then q to judgmental equalities, so the two successive eliminations compute to the identity. Choice-independence uses the same telescope induction. UIP first identifies the two prefix paths; transport along that identification puts the two last-coordinate paths in one identity type, where UIP identifies them. The two induced maps are pointwise equal by the preceding calculation, and Ext-Ax identifies the maps themselves. ◻

Definition 35.33 — Canonical comparison data

A context comparison c:ΓΔ consists of substitutions c+:ΓΔ and c:ΔΓ and component paths ϵ:cc+=Γ1Γ,η:c+c=Δ1Δ.

For ΓA type and ΔB type, a type comparison u:AcB consists of u+:AB[c+],u:BA[c], together with inverse identifications. In the first composite, u[c+]u+ lands in A[cc+] and is transported by ϵA before it is compared with the identity; the other composite uses ηB. Thus the inverse equations are literally well typed.

Both comparisons are written , and the subscript names the context comparison the types are compared over. When A and B live over the same context, that comparison is the identity and the subscript is omitted, so a bare AB is still a type comparison, never a context comparison: the operands say which is meant.

The canonical comparisons are the inductively generated class containing identity comparisons and the comparisons pA of lemma 35.32, and closed under inverse, composite, substitution, judgmental conversion, and the following constructors. At a context extension the forward substitution is (c+,u+(x)):Γ,x:AΔ,x:B; the reverse is obtained by exchanging c+ with c and u+ with u. The two component paths are the prefix paths followed by the inverse laws for u. For 1 and N take identity comparisons. From c:ΓΔ, u:AcA, and a comparison v:B(c,u)B over the extended contexts, close the class under the induced Π- and Σ-comparisons. For identity types, from c,u and arbitrary endpoint identifications α:u+(a)=Ida[c+],β:u+(b)=Idb[c+], close it under the induced comparison between IdA(a,b) and IdA(a,b). These clauses are closed under reindexing. Every generator preserves the number of context declarations; in particular, the canonical-comparison class of contains only . Arguments about canonical comparisons may therefore proceed by induction on the final generating clause; no additional, unnamed comparisons belong to the class.

Example 90.37 — The identity comparison

For the identity context comparison on Γ and any ΓA type, the generated type comparison is A1ΓA,u+:=λx.x,u:=λx.x. Both inverse witnesses reduce to reflexivity. Reindexing this comparison along f:ΔΓ computes to the same identity comparison on A[f]; thus the first generator already exhibits the typing, inverse, and reindexing components required below.

Lemma 35.34 — Canonical comparisons for the formers

The class of definition 35.33 is closed under Π,Σ,1,N, and Id, and under reindexing. Its inverse and composite comparisons obey the expected unit, associativity, and substitution laws up to identity. Parallel canonical maps are propositionally equal. After stripping, every canonical map is judgmentally the identity.

Proof of Lemma 35.34 — Canonical comparisons for the formers

Proof. The proof is a simultaneous induction on comparison-generation trees. The Σ case maps pairs coordinate by coordinate. The Π case conjugates functions by the domain and codomain comparisons. The Id case maps a path by the endpoint comparisons and the action of the carrier map. For each constructor, the proof writes the forward and reverse maps before checking inverse paths, reindexing, uniqueness, and stripping.

The comparisons for 1 and N are identities. Suppose c:ΓΔ, u:AcA, and v:B(c,u)B over the extended contexts. For Σ, the forward map is (Σ)z(u+(pr1z),v+,pr1z(pr2z)). The reverse map is symmetric. Pair congruence, the inverse laws of u,v, and Σ-eta give the two inverse identifications.

The product comparison must include the prefix transport. Reindex u along c+ and, for x:A[c+], put x¯:=ϵA(u[c+](x)):A. The component path actually used here is the extended path (ϵ~)ϵ~x:(cc+,u[c+](x))=Γ,x:A(1Γ,x¯). Its prefix is ϵ and its last component is reflexivity, because x¯ was defined by the required transport. Apply clause 2 of lemma 35.32 to the section x.u+(x) and this extended path. It aligns u+[cc+](u[c+](x)) with u+(x¯). The η-side inverse law for u, reindexed along c+, identifies the former term with x; general UIP (lemma 35.30) identifies the intervening transport witnesses. Concatenating these paths in the required orientation gives δx:IdA[c+](u+(x¯),x). Now define (Π)(Π(u,v))+(f)(x):=(δx)B[c+](v+,x¯(f(x¯))). Here the last transport moves the value from the fiber at u+(x¯) to the fiber at x.

For the reverse map, take x:A[c] and put x¯:=ηA(u+[c](x)):A. The extended path (c+c,u+[c](x))=Δ,x:A(1Δ,x¯) and the ϵ-side inverse law for u, reindexed along c, give in exactly the preceding way δx:IdA[c](u(x¯),x). Define (Π1)(Π(u,v))(g)(x):=(δx)B[c](v,x¯(g(x¯))). After expanding the two formulas, the inverse laws for u identify the twice-converted arguments and those for v identify the values; UIP aligns the composite transports. Write P+:=Π(u,v)+ and P:=Π(u,v). Thus, pointwise, P(P+(f))(x)=Idf(x),P+(P(g))(x)=Idg(x). Rule Ext-Ax, followed by Π-eta, gives the two inverse identifications of functions.

For identity types, let α:u+(a)=Ida[c+] and β:u+(b)=Idb[c+] be the endpoint comparisons. Put (Id)p(α1apu+(p))β. For the reverse map, reindex α and β along c and transport them through η. Clause 2 of equal-substitution transport for the endpoint sections gives α^:IdA(ηA(u+[c](a[c])),a),β^:IdA(ηA(u+[c](b[c])),b). Let ιa and ιb be the ϵ-side inverse laws for u at a[c] and b[c], with the displayed η transports inserted, and set α¯:=apu(α^)1ιa:IdA[c](u(a),a[c]),β¯:=apu(β^)1ιb:IdA[c](u(b),b[c]). The reverse map is therefore the well-typed formula (Id1)p(α¯1apu(p))β¯. Let F and G denote the forward and reverse maps just defined. General UIP gives the endpoint-indexed inverse paths ηp:IdIdA(a,b)(F(G(p)),p),ϵp:IdIdA(a,b)(G(F(p)),p). The same UIP terms make the maps independent of the chosen witnesses used to define α^,β^.

These formulas define the former clauses. For substitution, reindex every displayed map; whenever two reindexed substitutions are only connected by a component path, insert the map of lemma 35.32. Its concatenation and reindexing laws give the unit, associativity, and substitution equations.

The identity comparison is reflexivity. For an equal-substitution generator, typing is the first clause of lemma 35.32; its inverse law is the second clause; uniqueness of the chosen comparison is the third; and stripping is the fourth. For an inverse or composite, concatenate the paths obtained for the smaller generation trees. The only mixed calculation is reindexing a composite: (v+u+)[h]v+[h]u+[h]. If the two occurrences of h have equal substitution components, the comparison between them is the transport of lemma 35.32; its concatenation law proves that the two inserted comparisons agree.

For a context extension, the induction splits into the prefix components and the final fiber component. For Σ, pointwise equality of the two coordinates and pair congruence compare parallel maps. For Π, compare the values at an arbitrary x by the induction hypotheses for u and v, use UIP to identify the intervening transport paths, and apply Ext-Ax; this is exactly the point at which function extensionality is needed. For Id, the two endpoint calculations reduce the claim to equality of parallel path data by lemma 35.30. The 1 and N cases are identities. Hence the induction proves closure, the three coherence laws, and uniqueness of parallel comparisons.

Finally, after stripping, Id-Reflect makes every component path judgmental. Formula (Σ) then reduces by pair eta, (Π) by λ-eq and Π-eta, and (Id) by the groupoid computations at reflexivity. Thus every canonical comparison strips to the identity. ◻

Canonical comparisons are stable under composition and reindexing, so quotient equality can use them without choosing an arbitrary transport.

Definition 35.35 — The quotient data

Define Q without identifying raw representatives silently.

  1. A context is a canonical-comparison class [Γ].

  2. A substitution [Γ][Δ] is represented by a triple (Γ0,Δ0,f) with Γ0[Γ], Δ0[Δ], and f:Γ0Δ0. Two triples (Γ0,Δ0,f) and (Γ1,Δ1,f) are equal when, for canonical c:Γ0Γ1 and d:Δ0Δ1, there is a component path (QSub)d+f=Δ1fc+.

  3. A type over [Γ] is represented by (Γ0,A) with Γ0A type. Two representatives are equal when connected by a canonical type comparison over a canonical comparison of their contexts.

  4. A term is represented by (Γ0,A,a) with Γ0a:A. Representatives (Γ0,A,a) and (Γ1,B,b) are equal when, for canonical c:Γ0Γ1 and u:AcB, one has (QTm)u+(a)=Idb[c+].

By lemma 35.34, the truth of (Q-Sub) and (Q-Tm) is independent of the chosen canonical comparisons.

Lemma 35.36 — Quotient substitution and comprehension

The following operations on Q are well defined.

  1. The identity on [Γ] is represented by (Γ,Γ,1Γ).

  2. To compose representatives f:Γ0Δ0 and g:Δ1Θ0, choose a canonical bridge d:Δ0Δ1 and represent the composite by (QComp)gd+f:Γ0Θ0.

  3. If B is represented over Δ1 and f:Γ0Δ0, choose d:Δ0Δ1 and represent its reindexing by B[d+f]. Reindex terms by the same substitution.

  4. Context extension is represented by Γ0,x:A; projection, the last variable, and pairing are the corresponding named-syntax substitutions and terms.

They satisfy the identity, associativity, reindexing, projection, variable, and pairing equations in Q.

Proof of Lemma 35.36 — Quotient substitution and comprehension

Proof. First, context, substitution, type, and term equality are equivalence relations: identities, inverses, and composites are canonical, and lemma 35.32 aligns the middle fibers in a transitivity calculation.

For example, the transitivity calculation for (Q-Sub) is visible already at substitutions. Suppose fi:ΓiΔi for i=0,1,2 represent consecutive equal substitutions, with canonical source comparisons c01,c12, target comparisons d01,d12, and component paths p:d01,+f0=Δ1f1c01,+,q:d12,+f1=Δ2f2c12,+. Whisker p on the left by d12,+ and q on the right by c01,+, then concatenate: d12,+d01,+f0=Δ2d12,+f1c01,+=Δ2f2c12,+c01,+. This is (Q-Sub) for the composite canonical comparisons; their associativity paths align the displayed bracketings. The type and term transitivity proofs repeat this calculation one fiber at a time, using the transport lemma before concatenating the next component.

For (Q-Comp), replacing d by another bridge gives a componentwise equal composite because parallel canonical maps are equal. Replacing f or g uses (Q-Sub), whiskered on the appropriate side; the concatenation law of lemma 35.32 identifies this concatenated whiskered path with the composite path displayed above. For (3), if d,d:Δ0Δ1 are two bridges, canonical coherence gives d+=Δ1d+. Substitution stability then gives the canonical comparison B[d+f]B[d+f]; the term comparison is its instance of lemma 35.32. For example, if f=Δf, the required comparison B[f]B[f] is exactly (f=f)B from that lemma. This is the comparison that ordinary substitution stability alone would not provide.

Associativity compares the two expressions obtained from (Q-Comp). After inserting the three bridges, their raw composites have the same order; associativity of syntactic substitution and the concatenation law identify them. Unit laws are the reflexivity case. At context extension, use the extended canonical comparison (c,u) of definition 35.33; its last component is precisely the comparison required for the variable. Projection and pairing equations are then the corresponding syntactic equations, represented by reflexivity. This proves every displayed structural equation. ◻

Thus the quotient already supports substitution and context extension; it remains only to show that the type formers and their eliminators respect these structural identifications.

Lemma 35.37 — The formers and eliminators descend

The operations for Π,Σ,1,N, and Id, including their introductions, eliminators, congruence, and computation equations, are well defined on the quotient data.

Proof of Lemma 35.37 — The formers and eliminators descend

Proof. Formation is independent of representatives by the five clauses of lemma 35.34. For Σ, formula (Σ) commutes with pairing and both projections; its two component calculations are the inverse laws for u,v. Hence pair, pr1, and pr2 send equal representatives to equal representatives. The two beta equations and eta are represented by the judgmental equations of TI.

For Π, formula (Π) was chosen so that evaluation commutes with the domain comparison: evaluating at x gives the displayed transported value in the fiber at x. Its inverse calculation shows the same for abstraction. Thus application and abstraction preserve (Q-Tm); beta and eta again descend from their judgmental equations in TI.

The 1 comparison is the identity, so introduction and eta are immediate. The N comparison is also the identity, but compatibility of its eliminator requires a calculation. Let C,C be compared motives, write wn:C(n)C(n) for the forward fiber map, and suppose the zero branches z,z and successor branches s,s satisfy (Q-Tm). For the common scrutinee n, prove by N-induction that (Natcompat)wn(indN(C;z,s;n))=IdindN(C;z,s;n). At zero, both recursors compute and the required path is the comparison of z with z. At suc(n), both compute to their successor branches; apply the branch comparison to the induction hypothesis and then use the substitution transport of lemma 35.32 to align the two successor fibers. This proves (Nat-compat). If the scrutinees themselves are related by p:IdN(m,n), identity induction on p first reduces to the common-scrutinee calculation just proved. Thus N elimination preserves quotient equality, including changes of motive and branches.

For Id, formula (Id) preserves reflexivity by the unit laws. For J, let wa,b,p be the canonical fiber map between the motives, and let c,c be their compared reflexivity branches. Let q:=(α1apu+(p))β and let r:IdIdA(a,b)(q,p) be the (Q-Tm) comparison of the two eliminands. Transport the motive comparison to the target fiber by putting w¯a,b,p,p,r(d):=trrq.C(a,b,q)(wa,b,p(d)). The required equation in this common fiber is (Jcompat)w¯a,b,p,p,r(JC(c;a,b,p))=IdJC(c;a,b,p). Generalize the target endpoints, the endpoint paths α,β, the target eliminand p, and its comparison r. First identity-induct on the source eliminand p; then identity-induct on α and β. The source and target endpoints now coincide and qrefl. At this stage do not replace p by UIP: the transport in w¯ would remain stuck. Instead identity-induct directly on r:IdIdA(a,a)(refl,p). Its reflexivity case makes prefl and rrefl simultaneously. Therefore the transport in w¯ computes to the identity and both J terms compute to their reflexivity branches. The remaining equation is exactly the assumed comparison of c with c. These four identity inductions prove (J-compat), hence J preserves (Q-Tm). General UIP is used only afterward to make the result independent of alternative endpoint and transport witnesses. ◻

These compatibility results make Q a model of the core type theory. The stripping and quotient maps therefore form the triangle used for conservativity.

Lemma 35.38 — The quotient model and its triangle

The quotient data validates every rule of TE. If Syn(T) denotes derivable contexts, types, substitutions, and terms modulo judgmental equality, there are maps K:Syn(TI)Q,R:Syn(TE)Q,S:QSyn(TE) such that K=Rstrip(),SR=1Syn(TE). Here K takes a derivable object to its quotient class, R interprets TE in Q, and S strips a representative.

Proof of Lemma 35.38 — The quotient model and its triangle

Proof. The structural rules hold by lemma 35.36, and the former rules by lemma 35.37. Identity is extensional in Q: a representative p:IdA(a,b) is exactly the witness required by (Q-Tm) to conclude [a]=[b]. To validate Id-Uniq, first align the classifiers: the identity comparison on A, together with the endpoint paths refla:a=a and p1:b=a, gives a canonical comparison IdA(a,b)IdA(a,a). It carries p to a loop at a; general UIP (lemma 35.30) compares that transported loop with refla. Thus [p]=[refla] in the term quotient with its classifiers explicitly aligned. Hence Q validates every rule of TE, and rule induction defines R. This interpretation is independent of the chosen derivation. Indeed, simultaneously for contexts, types, substitutions, and terms, induct on a pair of derivations of the same judgment. Structural and former cases use the equations proved in lemma 35.36, lemma 35.37; conversion and congruence use the defining quotient relations; and the two extensional cases use exactly the endpoint and proof identifications just displayed. Thus two derivations give the same quotient class, so R descends to Syn(TE) rather than depending on proof trees.

Define K by quotienting representatives, and define S[Γ]=strip(Γ),S[(Γ,A)]=strip(A),S[(Γ,A,a)]=strip(a), and, for a substitution representative γ:ΔΓ, set S[γ]=strip(γ). This is well defined: canonical maps strip to identities by lemma 35.34, while Id-Reflect erases component paths and (Q-Tm) witnesses.

For the first equation in (35.1), induct on the TI derivation. Structural and former rules are lemma 35.36, lemma 35.37; conversion and congruence follow from the quotient relations, so both routes choose equal classes. The two extra TI constructors are uip and ext. In the first case, uip(p):IdI(p,refl), where I:=IdA(a,a), has endpoints p and refl; this path aligns the natural classifier IdI(p,p) of reflp with IdI(p,refl). After that alignment, general UIP compares reflp with uip(p). In the second case put e:=ext(f,g,x.h):IdP(f,g), where P:=x:AB. The path e aligns the natural classifier IdP(f,f) of reflf with IdP(f,g), and general UIP then compares the transported reflexivity witness with e. These are exactly the two equalities between the K-classes and the classes of the stripped, endpoint-annotated reflexivity terms.

For SR=1, induct on the TE derivation. Every structural or former rule is preserved by stripping the representative selected by its quotient operation. In an Id-Reflect case, R identifies the endpoint classes using the source path and S strips that path to the very judgmental equality produced by reflection. In an Id-Uniq case, R uses the canonical classifier alignment followed by general UIP; S strips both maps to identities and leaves the reflected proof-uniqueness equation. Conversion and congruence are preserved because S is well defined on the quotient relations. These are all rules of TE, so the second induction proves SR=1. This proves the triangle. ◻

Theorem 35.39 — Conservativity; Hofmann

Let Γ ctx and ΓA type in TI. If strip(Γ)t:strip(A) in TE for some term t, then there exists a term t with Γt:A in TI and strip(Γ)strip(t)t:strip(A) in TE. In particular, a TI-type is inhabited in TI if and only if its stripping is inhabited in TE.

Proof of Theorem 35.39 — Conservativity; Hofmann

Proof. First let Γ be empty. Then R(t) is a term of R(strip(A))=K(A)=[(,A)] in Q, by (35.1). Choose a representative b:B of this quotient term. Its classifier equality with [(,A)] has a canonical map u+:BA; put t:=u+(b). The equality of the two quotient terms says K(t)=R(t). Applying S and using SR=1 gives strip(t)t:strip(A) in TE.

For a telescope Γ=(x1:A1,,xn:An), abstract the assumed term: λx1.λxn.t:x1:strip(A1)xn:strip(An)strip(A). This displayed type is the stripping of the corresponding TI iterated product, so the empty-context case produces a TI inhabitant of that product. Apply it successively to x1,,xn; repeated Π-beta gives t:A in Γ and, after stripping, the required equality with t. The converse implication is proposition 35.29. ◻

Remark 90.44

This is Hofmann’s quotient construction [Hof95]. His primitive substitution and our J define one another through transport (construction 30.9); his IdUni and Ext are the two axioms of TI. Choosing a quotient representative is metatheoretic, so the proof gives existence, not a normalization algorithm.

Remark 35.41 — What the theorem conserves

Theorem 35.39 concerns inhabitation, not the conservation of judgmental equations. Reflection can turn a constructed identification into an equation. For example, writing sucx(0) for the x-fold iterate of suc on 0 defined by primitive recursion, induction constructs an inhabitant of IdN(x,sucx(0)). Hence TE derives x:Nxsucx(0):N by Id-Reflect. This calculation illustrates what reflection does; comparison with judgmental equality in TI is outside this example.

Remark 35.42 — Scope of the theorem

The signature of theorem 35.39 is exactly the Hofmann core TH of definition 35.26. Adding a former requires both a canonical action on comparisons and the eliminator-compatibility calculation of lemma 35.37; the book’s universe hierarchy, W-types, and other large eliminations are outside that signature.

Definition 90.47 — The modern model-theoretic endpoint

Kapulkin and Li’s exact intensional models are contextual categories with Id-, ΠExt-, and Σ-structure; the ΠExt structure already includes function extensionality. Their category CxlCatITT+UIP adds chosen UIP structure. The extensional category CxlCatETT instead has equality reflection. Both carry the left semi-model structures fixed in their paper. For these categories, Morita equivalent means that a free–forgetful adjunction is a Quillen adjunction and that its unit is a weak equivalence at every cofibrant intensional model. This is an equivalence of model categories up to the specified weak equivalences, not equality of raw syntax and not a theorem about every theory named ITT or ETT.

Theorem 90.48 — Imported: Kapulkin–Li Morita equivalence

At the signature of definition 90.47, the free–forgetful adjunction CxlCatITT+UIPETT||CxlCatETT is a Morita equivalence. In particular, the result applies to cofibrant extensions by new types, terms, and propositional equations at that same logical signature.

Proof of Theorem 90.48 — Imported: Kapulkin–Li Morita equivalence

Proof. This is Theorem 7.3 of [KL25]. The forgetful functor preserves fibrations and acyclic fibrations. Their quotient construction supplies its left adjoint; Lemmas 5.8 and 7.2 show that the unit is a weak equivalence on cellular models, and cellular replacement plus the two-out-of-three property extends the conclusion to every cofibrant model. The theorem does not assert syntactic conservativity for arbitrary extensions. ◻

Remark 90.49 — Indexed and coinductive profiles are not inherited

Neither Tfam nor Tco is in definition 90.47, and neither is in the Hofmann core of definition 35.26. Adding the indexed-family schema or coinductive records therefore requires a new action on comparison maps and a new eliminator-compatibility proof. No theorem in this section supplies it.

Reflection does simplify a single indexed branch once evidence is present. If p:EqN(k,sucn),u:P(k), then Eq-Reflect gives ksucn, congruence gives P(k)P(sucn), and Conv reclassifies the unchanged term as u:P(sucn). An intensional branch would retain an explicit transport. The calculation does not decide whether p exists; making this equality part of conversion is exactly what invalidates conversion-driven pattern compilation as an algorithm.

Exercise 35.14

★★☆ Write the full primitive-J term used in lemma 35.30. With I:=IdA(x,y), its two-endpoint motive is x,y:A,q:Ip:IIdI(p,q). Show that its diagonal clause is z.λp.uip(p), and verify the resulting classifier for arbitrary p,q:IdA(a,b).

Exercise 35.15

★★☆ Write out the cases of the induction in proposition 35.29 for the rules Conv and Subst-Eq-Ty, verifying that stripping commutes with substitution.

Exercise 35.16

★★☆ Construct, by N-induction in the base, a term x:NP:IdN(x,sucx(0)), using reflexivity at zero and congruence of suc in the inductive step. Then apply Id-Reflect in TE and state the resulting judgmental equality.

The price of reflection

Reflection makes judgmental equality strong enough to contain an undecidable word problem. The reduction needs nothing but the rules already stated.

Convention 90.50 — External decision procedures

Fix an effective Gödel coding of finite raw terms, contexts, and finite derivation trees by natural numbers, and fix an ordinary deterministic Turing machine model. A relation on these codes is decidable when some total machine computes its characteristic function. “Computable encoding” means a total machine computing the output code. These are statements in the ambient metatheory, not typing judgments internal to ETT.

Remark 90.51 — The two source signatures

Castellan, Clairambault, and Dybjer separate two undecidability endpoints [CCD17]. With one base type, dependent products, and extensional identity, type inhabitation and judgmental equality are undecidable; the judgmental-equality result remains true after adding unit and dependent sums. With no base type but one universe containing a chosen type, dependent products, and extensional identity, judgmental equality is again undecidable. The local construction below spells out this second, one-universe reduction. The free-lccc bifreeness theorem from the same paper is not a premise of that calculation.

Definition 35.43 — The SK word problem

The set Λ of combinators is generated by t::=SKtt, with application associated to the left. Conversion is the least equivalence relation closed under

Ktut
SK-K
Stuv(tv)(uv)
SK-S
ttuu
tutu
SK-App

Equivalently, orient the K and S equations from left to right, close one step under application contexts, and write tu for its reflexive–transitive closure; is the least equivalence relation containing that closure.

Lemma 35.44 — The SK word problem is undecidable

The relation tu on the finite trees of definition 35.43 is not decidable in the sense of convention 90.50.

Proof of Lemma 35.44 — The SK word problem is undecidable

Proof. This is the classical word-problem theorem for combinatory logic with the K and S equations and congruence. We import the theorem at exactly that signature; Statman proves the word-problem result [Sta00], and the same result is the explicit input to the type-theoretic encoding of Castellan, Clairambault, and Dybjer [CCD17]. The grammar has no variables, so every term in Λ is already closed. No claim about a particular reduction strategy or about normalization is needed here. ◻

Definition 35.45 — The SK context and its encoding

In ETT with U0, let ΓSK:=(X:U0,app:x:Xy:XX,s:X,k:X,eK:a:Xb:XEqX(kab,a),eS:a:Xb:Xc:XEqX(sabc,(ac)(bc))), where uv:=appuv. Recursively define S:=s,K:=k,tu:=tu. Thus ΓSKt:X for every tΛ.

Lemma 35.46 — Soundness of the encoding

If tu, then ΓSKtu:X.

Proof of Lemma 35.46 — Soundness of the encoding

Proof. Induct on the derivation of tu. In the K case, eKtu inhabits EqX(Ktu,t), and Eq-Reflect gives the required equation. In the S case, eStuv inhabits EqX(Stuv,(tv)(uv)), so Eq-Reflect gives the encoded SKS equation. The application case is application congruence (remark 27.4); reflexivity, symmetry, and transitivity use the corresponding rules for judgmental equality. ◻

Lemma 35.47 — Completeness of the encoding

If ΓSKtu:X, then tu.

Proof of Lemma 35.47 — Completeness of the encoding

Proof. Write [t] for the -class of t. Interpret the context ΓSK in the set model of proposition 35.4 by X:=Λ/,app([t],[u]):=[tu],s:=[S],k:=[K]. The operation on classes is well defined by SK-App. The two remaining components eK,eS are the unique elements of their singleton equality fibers; those fibers are inhabited by SK-K and SK-S. This is a legitimate U0-environment. Under the fixed finite-tree coding of convention 90.50, identify Λ with a subset of N. Since NV0 and a Grothendieck universe is closed under subsets, ΛV0. Then P(Λ)V0, and Λ/P(Λ) puts the quotient itself in V0. This uses the closure properties, not countability alone.

Induction on t gives [[t]]=[t]. Soundness of the set interpretation therefore sends the assumed judgmental equality to [t]=[u], which means tu. ◻

Lemma 35.48 — Generation for equality formation

If ΓEqA(a,b) type is derivable, then Γa:A and Γb:A are derivable.

Proof of Lemma 35.48 — Generation for equality formation

Proof. The naive invariant “inspect only the outer constructor of the conclusion” is not stable under the rules. Substitution can expose an equality former, for example when D(x):=x and the substituted term itself is EqA(a,b); a Russell-universe elimination can likewise place an Eq-headed code in a classifier. Hence the induction must inspect subjects, equality endpoints, classifiers, and every declaration type, as stated below.

Use simultaneous rule induction over the five judgment forms (remark 26.23). The strengthened invariant examines every constituent expression of the conclusion: subjects, both sides of an equality, classifiers, and the declaration types inside its context. If any such constituent has displayed outer constructor Eq, its two endpoints have the displayed ambient type. Thus the invariant also covers an Eq-headed classifier, an Eq-headed declaration, and a term of a Russell universe. The lemma is the type-formation instance of this stronger assertion.

A final Eq-F has premises Γa:A and Γb:A, exactly the required endpoint derivations; Eq-Form-U has the same endpoint premises, and Eq-F-eq has them for both equality types. If U-El concludes that an Eq-headed universe element E is a type, the induction hypothesis for its premise ΓE:Ui gives the endpoint derivations.

The only rule that can expose a new outer constructor is substitution. Raw substitution has the dichotomy E[a/x] is Eq-headedE=EqA0(u,v)or (E=x and a=EqA0(u,v)). In the first case the judgment-premise induction hypothesis gives u:A0 and v:A0; Subst derives u[a/x]:A0[a/x] and v[a/x]:A0[a/x]. In the second case the typing-premise induction hypothesis gives u:A0 and v:A0 for the substituend, and weakening through Δ[a/x] places both judgments in the conclusion context. Equal substitution uses the same dichotomy and its equality rules align the two resulting ambient types.

Every other rule obeys one preservation principle. A newly constructed conclusion has a fixed non-Eq head; an Eq-headed constituent retained from a premise is handled by that premise’s induction hypothesis; and an instantiated branch is handled by the substitution dichotomy. Context extension and variables use the induction hypotheses for their declaration types. Equality, conversion, presupposition, universe, lifting, and the core former rules all have one of these three shapes. Therefore the strengthened invariant, and hence the stated formation case, holds. ◻

Definition 90.58 — Three decision problems

Using the coding of convention 90.50, define:

Judgmental equality.

An input contains derivation trees of Γa:A and Γb:A; decide whether Γab:A is derivable. The supplied trees make this a decision problem on well-typed endpoints, not a hidden typechecking problem.

Typechecking.

On a raw finite triple (Γ,a,A), decide whether Γa:A is derivable.

Typehood.

On a raw finite pair (Γ,A), decide whether ΓA type is derivable.

A decider must be total on every code of the indicated form. Malformed raw inputs are negative instances of the last two problems.

Theorem 35.49 — Undecidability

In ETT with the Russell universes of definition 29.1, none of the three problems in definition 90.58 is decidable. The effective reductions from judgmental equality to typechecking and from typechecking to typehood use only plain ETT.

Proof of Theorem 35.49 — Undecidability

Proof. Lemma 35.46 gives the forward implication and lemma 35.47 the backward one in tuΓSKtu:X. The context, the two endpoint-typing derivations, and the encoded terms are computed by structural recursion on the finite SK trees. Hence this is a total reduction to the first problem of definition 90.58, and lemma 35.44 gives its undecidability.

Now suppose Γa:A and Γb:A. Then Γab:A holds if and only if Γrefl:EqA(a,b): reflection proves the reverse implication, and theorem 35.7(1) proves the forward one. Thus a typechecking algorithm would decide equality.

Finally, Γa:AΓEqA(a,a) type. Rule Eq-F proves the forward implication, while lemma 35.48 proves the reverse. Hence a typehood algorithm would decide typechecking. Both transformations are primitive recursions on raw syntax and hence total under the fixed coding. All three problems are therefore undecidable. ◻

Remark 35.50 — Failure of normalization for open terms

Add the universes of definition 29.1 to ETT and work in the context Γ:=X:U0,p:EqU0(X,XX). The context is well formed because XX:U0. Reflection gives ΓXXX:U0; rule U-El-Eq of definition 29.1 turns this into ΓXXX type. For x:X, conversion therefore gives x:XX, so xx:X and ω:=λx.xx:XX. Converting once more gives ω:X; hence Ω:=ωω:X and ΩβΩ. Thus open ETT terms need not normalize. This is independent of theorem 35.49. The context need not be inhabitable; a type checker must respond to every context.

Remark 35.51 — What survives

The local set models prove soundness of the extensional delta and optional truncation (proposition 35.4, corollary 35.19). What fails is a complete terminating decision procedure for the raw judgments of theorem 35.49. A checker that demands explicit equality evidence can verify the evidence it is given; it still cannot decide conversion between two bare terms.

Exercise 35.17

★★☆ Write out the induction cases in lemma 35.46 for the closure rules of . For given t,u,v, derive the encoded reflexivity tt, the symmetry and transitivity steps, and the SK-App congruence step, all in ΓSK at type X. Explain why the context’s two equation families eK,eS are the only nonstructural hypotheses used.

Exercise 35.18

★★☆ Give the full rule-by-rule typing derivation of Γωω:X in remark 35.50, identifying every use of Eq-Reflect.

Suggested first pass.

None of these problems is a prerequisite for a later chapter. Begin with exercise 90.19, then complete exercise 90.20.

Exercise 90.19

★★☆ Reconstruct the encoding of one SK reduction step as an equality-reflection derivation. Separate the use of extensional equality evidence from the use of Eq-Reflect, and show why erasing the evidence cannot give a decision procedure for bare conversion.

Exercise 90.20

★★★ Practical project.ett-evidence-checker Before implementing the checker, write the complete accepted derivation for eKsk and a rejected derivation attempt whose two endpoints have different classifiers; mark the premise at which it fails. Implement in Agda or Kappa a checker that verifies explicitly supplied ETT identity evidence and then reflects it. The checker must preserve typing of both equality endpoints. Accept the encoded Kxyx step, reject a proof whose endpoints encode different result types, and print the reflected equation; do not search for evidence.

Sources. Martin-Löf introduced extensional type theory [ML82, ML84]. Our propositions and truncation follow [AG26]; for squash and bracket types see [CAB^+86, AB04]. Hofmann proves theorem 35.39 and extensional undecidability in Chapter 3 of [Hof95]: the extension criterion is §3.2.6, and the quotient and universe results are Theorems 3.2.18 and 3.2.20. The conservativity theorem above is restricted to the Hofmann core named in remark 35.42; the Russell hierarchy used for the separate SK model is not silently included in that quotient construction. For SK see [CCD17] and lemma 35.44; the modern model-level endpoint is [KL25]. For choice see [Hyl82, Dia75].

Search the book

Type to search the local edition.