Exercise 49.2.
Assume ⋅ ⊢𝑣 :𝟎. Empty elimination gives the closed term 𝑝:=𝖺𝖻𝗈𝗋𝗍𝖨𝖽𝟐(𝗍𝗍,𝖿𝖿)(𝑣):𝖨𝖽𝟐(𝗍𝗍,𝖿𝖿). Canonicity at identity types applied to 𝑝 says, in particular, ⋅⊢𝗍𝗍≡𝖿𝖿:𝟐, contradicting proposition 49.3. Therefore no such 𝑣 exists.
Boolean canonicity alone cannot produce this contradiction. Eliminating 𝑣 into 𝟐 gives a closed Boolean, and Boolean canonicity merely says that this term is equal to one of 𝗍𝗍 or 𝖿𝖿. Both outcomes are individually consistent; it does not force the two constructors to be equal. Identity canonicity is stronger in exactly the needed way: an inhabitant of an identity type forces its endpoints to be judgmentally equal.
Exercise 49.3.
We prove both statements simultaneously by structural induction on the raw expression 𝑡. Write 𝐸=(𝛾,𝛾∙),𝐸𝑎=((𝛾,𝑎),(𝛾∙,𝑎∙)). All equalities below are equalities of the meta-level values defined in definition 49.9.
Variables. For weakening, the side condition excludes 𝑡 =𝑥. If 𝑡 =𝑦 is a variable of Γ, lookup in 𝐸𝑎 and in 𝐸 returns the same component 𝑦∙. For substitution there are two cases: (𝑥[𝑎/𝑥])∙(𝐸)=𝑎∙(𝐸)=𝑥∙((𝛾,𝑎[𝛾]),(𝛾∙,𝑎∙(𝐸))), and, for 𝑦 ≠𝑥, (𝑦[𝑎/𝑥])∙(𝐸)=𝑦∙(𝐸)=𝑦∙((𝛾,𝑎[𝛾]),(𝛾∙,𝑎∙(𝐸))).
Constants. The clauses for 𝗍𝗍, 𝖿𝖿, and 𝟐 ignore the added component except through recursively interpreted subexpressions, so the required equations are immediate.
Application. Let 𝑡 =𝑓 𝑢. For weakening, the induction hypotheses for 𝑓 and 𝑢 give (𝑓𝑢)∙(𝐸𝑎)=𝑓∙(𝐸𝑎)(𝑢[(𝛾,𝑎)],𝑢∙(𝐸𝑎))=𝑓∙(𝐸)(𝑢[𝛾],𝑢∙(𝐸))=(𝑓𝑢)∙(𝐸). Here ordinary syntactic weakening gives 𝑢[(𝛾,𝑎)] =𝑢[𝛾]. For substitution, ordinary substitution composition and the two induction hypotheses give ((𝑓𝑢)[𝑎/𝑥])∙(𝐸)=(𝑓[𝑎/𝑥])∙(𝐸)((𝑢[𝑎/𝑥])[𝛾],(𝑢[𝑎/𝑥])∙(𝐸))=𝑓∙(𝐸𝑎[𝛾])(𝑢[(𝛾,𝑎[𝛾])],𝑢∙(𝐸𝑎[𝛾]))=(𝑓𝑢)∙(𝐸𝑎[𝛾]), where 𝐸𝑎[𝛾] =((𝛾,𝑎[𝛾]),(𝛾∙,𝑎∙(𝐸))).
Abstraction. Alpha-rename so that 𝑡 =𝜆𝑦. 𝑏 with 𝑦 ≠𝑥 and 𝑦 fresh for 𝑎 and the displayed environments. Meta-level functions are equal extensionally. Fix an admissible argument (𝑐,𝑐∙). The weakening induction hypothesis for 𝑏, in the context also extended by 𝑦, gives 𝑏∙((𝛾,𝑎,𝑐),(𝛾∙,𝑎∙,𝑐∙))=𝑏∙((𝛾,𝑐),(𝛾∙,𝑐∙)); therefore the two functions interpreting 𝜆𝑦. 𝑏 are equal. For substitution, the induction hypothesis for 𝑏 in the extended context gives (𝑏[𝑎/𝑥])∙((𝛾,𝑐),(𝛾∙,𝑐∙))=𝑏∙((𝛾,𝑎[𝛾],𝑐),(𝛾∙,𝑎∙(𝐸),𝑐∙)). Freshness identifies (𝑏[𝑎/𝑥])[𝛾,𝑐/𝑦] with 𝑏[𝛾,𝑎[𝛾]/𝑥,𝑐/𝑦], so pointwise equality proves the abstraction case.
Π-types. The proof is the same binder argument, followed by extensionality of the displayed dependent products. For each closed argument 𝑐 and each 𝑐∙ ∈𝐴∙(𝑐), apply the induction hypothesis to the codomain 𝐵 in the environment extended by (𝑐,𝑐∙). The induction hypothesis for the domain identifies the sets of admissible pairs.
Boolean elimination. Apply the induction hypotheses to the scrutinee, motive, and both branches. The scrutinee evidence is the same on both sides, so both semantic eliminators select the same case, 0 or 1; the corresponding branch induction hypothesis proves equality. In the substitution case, alpha-rename the motive binder and use ordinary capture-avoiding substitution composition.
Every raw constructor is handled by one of these patterns: lookup, constant, nonbinding composition, or binding composition. This proves both clauses of lemma 49.11.
Exercise 49.4.
Fix a computable closing instantiation 𝐸 =(𝛾,𝛾∙) ∈Γ∙.
𝜆-congruence. Suppose the final rule is Γ,𝑥:𝐴⊢𝑏≡𝑏′:𝐵Γ⊢𝜆𝑥.𝑏≡𝜆𝑥.𝑏′:∏𝑥:𝐴𝐵. The two interpretations are dependent functions. Given any admissible (𝑎,𝑎∙), induction hypothesis (d) for the premise, instantiated at ((𝛾,𝑎),(𝛾∙,𝑎∙)), gives 𝑏∙((𝛾,𝑎),(𝛾∙,𝑎∙))=𝑏′∙((𝛾,𝑎),(𝛾∙,𝑎∙)). Thus the functions agree pointwise, and meta-level function extensionality gives equality of the two pieces of evidence.
Congruence for Boolean elimination. Write 𝑒=𝗂𝗇𝖽𝟐(𝑥.𝐶;𝑐0,𝑐1;𝑏),𝑒′=𝗂𝗇𝖽𝟐(𝑥.𝐶′;𝑐′0,𝑐′1;𝑏′). The congruence premises give, by the simultaneous induction hypotheses, 𝐶∙=𝐶′∙,𝑐∙0=𝑐′∙0,𝑐∙1=𝑐′∙1,𝑏∙=𝑏′∙. The last equality means that both semantic eliminators inspect the same scrutinee evidence. If it is 1, both select their first branch and use 𝑐∙0 =𝑐′∙0; if it is 0, both select their second branch and use 𝑐∙1 =𝑐′∙1. No other case is reachable for a well-typed Boolean, by part (c). The motive equality identifies the result fibers.
Part (b) for Π-congruence. Suppose the final rule has premises Γ⊢𝐴≡𝐴′ 𝗍𝗒𝗉𝖾,Γ,𝑥:𝐴⊢𝐵≡𝐵′ 𝗍𝗒𝗉𝖾 (with the usual conversion if the second context is displayed using 𝑥 :𝐴′). By induction hypothesis (b), 𝐴∙(𝐸) =𝐴′∙(𝐸). Hence both products quantify over exactly the same closed 𝑎 and evidence 𝑎∙. For each such pair, induction hypothesis (b) for the codomain premise at the extended instantiation gives 𝐵∙((𝛾,𝑎),(𝛾∙,𝑎∙))=𝐵′∙((𝛾,𝑎),(𝛾∙,𝑎∙)). Every corresponding factor in the two dependent products is therefore equal, so the product families themselves are equal. This is exactly the claim required by part (b).
Exercise 49.5.
Extend the assignment by ℕ∙(𝐸)(𝑛)={𝑚∈ℕ∣⋅⊢𝑛≡𝗌𝗎𝖼𝑚(𝟢):ℕ}. The constructor clauses are 𝟢∙(𝐸)=0,(𝗌𝗎𝖼(𝑛))∙(𝐸)=𝑛∙(𝐸)+1. They are sound because reflexivity witnesses 𝟢 ≡𝗌𝗎𝖼0(𝟢), and from 𝑛 ≡𝗌𝗎𝖼𝑚(𝟢) congruence gives 𝗌𝗎𝖼(𝑛) ≡𝗌𝗎𝖼𝑚+1(𝟢).
For the eliminator, let its motive be 𝐶, its zero branch have evidence 𝑐∙0, and its successor branch transform evidence at 𝑚 and for the recursive result into evidence at 𝑚 +1. Define its semantic value by primitive recursion on the actual number 𝑚 =𝑛∙(𝐸): 𝑅(0):=𝑐∙0(𝐸),𝑅(𝑚+1):=𝑐∙𝑠(𝐸,𝗌𝗎𝖼𝑚(𝟢),𝑚,𝑅(𝑚)). The induction hypothesis for 𝑛 supplies 𝑛[𝛾] ≡𝗌𝗎𝖼𝑚(𝟢). Congruence of the eliminator, followed by its zero or successor computation rule, places 𝑅(𝑚) in the required fiber. This validates the Nat eliminator case of the fundamental lemma.
Now let ⋅ ⊢𝑛 :ℕ. Part (c) at the empty instantiation gives an actual 𝑚=𝑛∙((),())∈ℕ∙((),())(𝑛), so, by definition, ⋅⊢𝑛≡𝗌𝗎𝖼𝑚(𝟢):ℕ. If also 𝑛 ≡𝗌𝗎𝖼𝑘(𝟢), then the two numerals are judgmentally equal. Interpreting ℕ as ℕ, or using constructor disjointness and successor injectivity, yields 𝑚 =𝑘. Thus the numeral is unique.
The eliminator needs the evidence value 𝑚, not merely the proposition that the evidence set is inhabited: 𝑚 determines how many successor-branch iterations define 𝑅(𝑚). Mere inhabitation would hide the recursion index.
Exercise 49.6.
Let ⋅ ⊢𝑝 :𝖨𝖽𝐴(𝑎,𝑏). By the assumed term clause of the fundamental lemma, 𝑝∙ belongs to the identity-evidence set displayed in remark 49.13. Hence it contains a pair (𝑞,𝑟) with 𝑞:⋅⊢𝑎≡𝑏:𝐴,𝑟:⋅⊢𝑝≡𝗋𝖾𝖿𝗅𝑎:𝖨𝖽𝐴(𝑎,𝑏). The derivation 𝑞 is also what permits the reflexivity term, whose native type is 𝖨𝖽𝐴(𝑎,𝑎), to be viewed at the displayed type of 𝑟. Thus the endpoint equality and the canonicity equation are stored in the evidence itself; no injectivity theorem for the identity former is used.
This closed calculation is conditional on the enlarged fundamental lemma named in the exercise. The open construction of lemma 111.74 proves the corresponding identity statement for 𝑇𝗂𝗆𝗉𝗅. By contrast, the local Tait proof has no identity or 𝐽 case, and the Coquand construction at 𝑇𝖢𝗈𝗊 supplies no such clause. Neither of those two smaller arguments proves the identity result.
Exercise 49.9.
Eta-long readback expands at every negative type former.
The outer lambda is already present, but its body 𝑓 has function type and must itself be eta-expanded: 𝜆𝑓.𝜆𝑥.𝑓𝑥.
The variable 𝑔 has two successive Π-types, so its eta-long normal form is 𝜆𝑥.𝜆𝑦.𝑔𝑥𝑦.
The variable ℎ has a function type, so readback first introduces an argument 𝑓 :𝟐 →𝟐. Because that argument is itself used at function type, its eta-long occurrence is 𝜆𝑥. 𝑓 𝑥. Hence the fully eta-long normal form is 𝜆𝑓.ℎ(𝜆𝑥.𝑓𝑥). Both expansions are instances of the Π-𝜂 rule; no Σ- or Unit clause is used.
Exercise 49.13.
The eta rule for 𝟏 is precisely Γ⊢𝑡:𝟏Γ⊢𝑡≡⋆:𝟏, so every term of unit type is judgmentally ⋆.
Take the same raw term 𝑥 in two contexts: 𝑥:𝟏⊢𝑥:𝟏,𝑥:𝟐⊢𝑥:𝟐. At 𝟏, eta-long normalization returns ⋆. At 𝟐, the variable is a neutral normal form, so normalization returns 𝑥. Thus the same raw syntax has different normal forms depending on its typing judgment.
A function that inspects only the raw term would have to return the same answer for these two inputs. Returning 𝑥 is incomplete at 𝟏, while returning ⋆ is unsound at 𝟐. Therefore normalization and readback must be indexed by the type and context.
Exercise 49.1.
Suppose 𝑥 :𝟐 ⊢𝑥 ≡𝗍𝗍 :𝟐. The substitution lemma with 𝑥 ↦𝖿𝖿 gives ⋅ ⊢𝖿𝖿 ≡𝗍𝗍 :𝟐, contradicting Boolean separation. Dually, a derivation of 𝑥 :𝟐 ⊢𝑥 ≡𝖿𝖿 :𝟐 and the substitution 𝑥 ↦𝗍𝗍 would give ⋅ ⊢𝗍𝗍 ≡𝖿𝖿 :𝟐, the same contradiction. This proof uses substitution and the closed separation theorem; it assumes no normalization result for open terms.
Exercise 49.7.
Encode finite derivation trees by natural numbers. Enumerate those codes, decode each candidate, and check recursively whether every node is an instance of a rule of the recursive signature and whether its root is the requested judgment Γ ⊢𝑡 ≡𝑢 :𝐴. Rule-instance checking and syntactic equality are effective, so each candidate is checked in finite time. If the judgment is derivable, its finite derivation eventually appears and the procedure halts with “yes.” Hence judgmental equality is semidecidable.
This is not a usable equality oracle. On unequal terms the search runs forever, so a type checker cannot reject a failed conversion, report an error, or continue. It also searches a vast space of irrelevant proof trees rather than computing a canonical representative. A kernel needs a total decision procedure, not merely eventual success on positive instances.
Exercise 49.8.
Fix effective enumerations of raw syntax and finite derivations. From the latter enumerate all tuples (Δ,𝑢,𝑈,𝑑)with𝑑:Δ⊢𝑢:𝑈. For an input derivation 𝑒 :Γ ⊢𝑡 :𝐴, scan this enumeration and retain entries whose context and type are syntactically Γ and 𝐴. Use the assumed equality decision procedure to test Γ ⊢𝑡 ≡𝑢 :𝐴. Return the first 𝑢 for which the test succeeds; call it 𝗇𝖿(𝑒).
The search terminates constructively. The input derivation 𝑒 itself is a finite derivation of a represented term equal to 𝑡 by reflexivity, so its code occurs at a finite position. A successful candidate is therefore guaranteed no later than that position. This is an ordinary terminating search with an explicit termination witness, not an appeal to a classical search principle.
Because the enumeration order is fixed, 𝗇𝖿(𝑒) depends only on the judgmental-equality class of 𝑡. If 𝑡 ≡𝑡′ :𝐴, a candidate 𝑢 that passes for 𝑡 satisfies 𝑡 ≡𝑢 :𝐴. Compose the converse 𝑡′ ≡𝑡 :𝐴 of the assumed equality with that derivation to obtain 𝑡′ ≡𝑢 :𝐴. The converse implication exchanges 𝑡 and 𝑡′ and uses the converse equality 𝑡 ≡𝑡′ :𝐴. Thus a candidate passes for 𝑡 exactly when it passes for 𝑡′; hence the first successful candidate is the same. Conversely, if the returned syntax trees agree, each input is judgmentally equal to that common representative, so the inputs are judgmentally equal. The successful test also supplies soundness 𝑡 ≡𝗇𝖿(𝑒) :𝐴. Repeating the construction for well-formed types gives the type component. These maps, together with the stated soundness, completeness, and injectivity properties, form the normalization structure of definition 49.16.
The representatives are least derivation codes, not pleasant beta-eta normal syntax. The construction establishes existence, not efficiency.
Exercise 49.10.
We use the definitions of the Kripke domain and evaluation from definition 49.24, definition 49.25.
Restriction. First prove by induction on 𝑇 that restriction on [[𝑇]] is functorial: 𝑎↾Γ=𝑎,(𝑎↾Δ)↾Θ=𝑎↾Θ(Θ⊒Δ⊒Γ). At the base type this is composition of weakening for neutral syntax. At 𝑆 →𝑇 it follows pointwise from the definition of restriction of a Kripke family and the induction hypothesis for 𝑇.
Now prove [[𝑡]](𝜌↾Θ)=([[𝑡]]𝜌)↾Θ(1) by structural induction on 𝑡. For a variable, (1) is the definition of restriction of an environment. For application, use the two induction hypotheses and naturality of a Kripke function. For an abstraction, compare the two semantic functions at every further extension Ξ ⊒Θ and argument 𝑎. Both reduce to [[𝑏]](𝜌↾Ξ,𝑥↦𝑎), using functoriality; function extensionality concludes.
Evaluation and substitution. Prove [[𝑡[𝑠/𝑥]]]𝜌=[[𝑡]](𝜌,𝑥↦[[𝑠]]𝜌)(2) by structural induction on 𝑡. If 𝑡 =𝑥, both sides are [[𝑠]]𝜌; if 𝑡 =𝑦 ≠𝑥, both are 𝜌(𝑦). Application follows from the two induction hypotheses. For 𝑡 =𝜆𝑦. 𝑏, alpha-rename 𝑦 fresh for 𝑠 and 𝑥. At an extension Θ and argument 𝑎, both functions reduce, using the induction hypothesis for 𝑏, to [[𝑏]](𝜌↾Θ,𝑥↦[[𝑠]](𝜌↾Θ),𝑦↦𝑎). Equation (1) identifies the restricted value of [[𝑠]]𝜌 with [[𝑠]](𝜌 ↾Θ).
Closure under equality on the left. Induct on 𝑇. At 𝜄, from 𝑡′ ≡𝑡 and 𝑡 ≡𝑢, transitivity gives 𝑡′ ≡𝑢. At 𝑆 →𝑇, given a future context and related argument, congruence gives 𝑡 𝑠 ≡𝑡′ 𝑠; the induction hypothesis at 𝑇 transfers the relation to 𝑡′ 𝑠.
Closure under restriction. Again induct on 𝑇. At 𝜄, weaken the equality 𝑡 ≡𝑢 to the larger context. At 𝑆 →𝑇, pass to an arbitrary further extension and related argument. Functoriality identifies twice-restricted and directly restricted semantic functions, and the induction hypothesis at 𝑇 supplies the result relation.
Clause by clause, (2) is lemma 49.11(2): environments are closing instantiations, variables are lookups, abstraction extends an environment, application applies semantic values, and eliminators inspect semantic constructor evidence. Equation (1) is the Kripke analogue of lemma 49.11(1). Thus the computability assignment is an evaluation into a proof-relevant semantic domain.
Exercise 49.11.
Prove simultaneously, by induction on the displayed normal and neutral derivations, N(𝑣):↓𝑇Γ([[𝑣]]𝜌Γ)=𝑣,Γ⊢𝑣𝗇𝖿𝑇,E(𝑢):[[𝑢]]𝜌Γ=↑𝑇Γ(𝑢),Γ⊢𝑢𝗇𝖾𝑇.
For a neutral variable, E is the definition of the identity environment. For a neutral application 𝑢 𝑣, the induction hypotheses give [[𝑢]]𝜌Γ=↑𝑆→𝑇(𝑢),↓𝑆([[𝑣]]𝜌Γ)=𝑣. By the arrow-reflection clause, applying the first value to the second produces ↑𝑇(𝑢 𝑣), proving E(𝑢 𝑣). Neutral eliminators are identical: evaluation takes the stuck semantic clause, and the induction hypotheses reify every stored minor argument to the original normal syntax.
At a base type, a normal neutral 𝑢 is handled by E(𝑢) and the fact that base reification of reflected neutral syntax is the identity. Constructor normal forms are immediate or follow recursively on their normal arguments. For a normal abstraction 𝜆𝑥. 𝑏, reification of its evaluated closure introduces a fresh reflected variable 𝑥. Applying the closure to that variable evaluates 𝑏 in the extended identity environment; the induction hypothesis for 𝑏 reifies the result to 𝑏. Thus readback returns exactly 𝜆𝑥. 𝑏. Pair and other eta-long cases work componentwise because their readback clauses mirror their normal-form rules. This completes the mutual induction and proves 𝗇𝖿𝑇Γ(𝑣) =𝑣.
Existence of a normal representative follows from normalization. For uniqueness, let 𝑣,𝑤 be normal forms of the same type with 𝑣 ≡𝑤. Completeness gives 𝗇𝖿(𝑣) =𝗇𝖿(𝑤), while the result just proved reduces this to 𝑣 =𝑤 as alpha-equivalence classes of syntax. Soundness says every term is judgmentally equal to its normal form. Hence every judgmental-equality class contains exactly one normal form.
Exercise 49.12.
Use the disjoint-sum presentation [[𝟐]](Γ)={𝗍𝗍𝗏,𝖿𝖿𝗏}+{𝑢∣Γ⊢𝑢𝗇𝖾𝟐}, so constructor values cannot be confused with neutral syntax. Restriction fixes the two constructors and weakens a neutral. Reflection embeds a neutral into the third summand, while reification is ↓𝟐(𝗍𝗍𝗏)=𝗍𝗍,↓𝟐(𝖿𝖿𝗏)=𝖿𝖿,↓𝟐(𝗇𝖾𝗎(𝑢))=𝑢. Evaluation sends the syntactic constructors to their semantic counterparts.
For a non-dependent recursor with result type 𝑇, define 𝗋𝖾𝖼𝗏𝑇(𝑎0,𝑎1,𝗍𝗍𝗏)=𝑎0,𝗋𝖾𝖼𝗏𝑇(𝑎0,𝑎1,𝖿𝖿𝗏)=𝑎1,𝗋𝖾𝖼𝗏𝑇(𝑎0,𝑎1,𝗇𝖾𝗎(𝑢))=↑𝑇(𝗂𝗇𝖽𝟐(_.𝑇;↓𝑇(𝑎0),↓𝑇(𝑎1);𝑢)). In the last line, readback and reflection are taken in the current context; at function result types this automatically eta-expands the stuck eliminator. Evaluation of a syntactic recursor evaluates its branches and scrutinee and applies this operation. Naturality follows from naturality of reflection and reification.
The two new computation cases in completeness are definitionally true in the semantic domain. For example, [[𝗂𝗇𝖽𝟐(_.𝑇;𝑐0,𝑐1;𝗍𝗍)]]𝜌=𝗋𝖾𝖼𝗏𝑇([[𝑐0]]𝜌,[[𝑐1]]𝜌,𝗍𝗍𝗏)=[[𝑐0]]𝜌. With 𝖿𝖿, the same calculation returns [[𝑐1]]𝜌. Thus the two judgmental computation rules are respected by evaluation.
Exercise 49.14.
Extend the value and neutral grammars by 𝐷∋𝗉𝖺𝗂𝗋(𝑑1,𝑑2)∣̂Σ(𝐴,𝐹),𝐷𝗇𝖾∋𝖿𝗌𝗍(𝑒)∣𝗌𝗇𝖽(𝑒). Define semantic projections by 𝖿𝗌𝗍𝗏(𝗉𝖺𝗂𝗋(𝑑1,𝑑2))=𝑑1,𝗌𝗇𝖽𝗏(𝗉𝖺𝗂𝗋(𝑑1,𝑑2))=𝑑2,𝖿𝗌𝗍𝗏(𝗎𝗉(𝑒))=𝗎𝗉(𝖿𝗌𝗍(𝑒)),𝗌𝗇𝖽𝗏(𝗎𝗉(𝑒))=𝗎𝗉(𝗌𝗇𝖽(𝑒)). Evaluation acquires the clauses [[∑𝑥:𝐴𝐵]]𝜌=̂Σ([[𝐴]]𝜌,𝑑↦[[𝐵]](𝜌,𝑑)),[[(𝑎,𝑏)]]𝜌=𝗉𝖺𝗂𝗋([[𝑎]]𝜌,[[𝑏]]𝜌),[[𝗉𝗋1𝑝]]𝜌=𝖿𝗌𝗍𝗏([[𝑝]]𝜌),[[𝗉𝗋2𝑝]]𝜌=𝗌𝗇𝖽𝗏([[𝑝]]𝜌). The semantic typing relation records that the second projection has type 𝐹(𝑑1), where 𝑑1 is the first projection.
Reflection at a Sigma type eta-expands a neutral. Put 𝑑1:=↑𝐴(𝖿𝗌𝗍(𝑒)),↑̂Σ(𝐴,𝐹)(𝑒):=𝗉𝖺𝗂𝗋(𝑑1,↑𝐹(𝑑1)(𝗌𝗇𝖽(𝑒))).(1) For an arbitrary semantic value 𝑑, let 𝑑1 =𝖿𝗌𝗍𝗏(𝑑) and 𝑑2 =𝗌𝗇𝖽𝗏(𝑑). Reification is ↓𝑛̂Σ(𝐴,𝐹)(𝑑)=(↓𝑛𝐴(𝑑1),↓𝑛𝐹(𝑑1)(𝑑2)).(2) Type-code readback gains the corresponding clause for a syntactic Sigma, using a reflected fresh variable to reify the codomain family.
For a semantic constructor pair, the projections establish both beta rules definitionally. For a reflected neutral 𝑒, equations (1) and (2) read it back as (𝗉𝗋1(𝖱𝑛𝑒),𝗉𝗋2(𝖱𝑛𝑒)), which is judgmentally equal to 𝖱𝑛𝑒 by Sigma eta. Hence readback respects beta and eta and always returns eta-long Sigma normal forms.
Exercise 49.15.
Define universe equality and element equality simultaneously. Write 𝛼:𝑐≈U0𝑐′@𝑛 for a proof-relevant derivation that two semantic values are related universe codes at support world 𝑛. Let 𝐷𝑛 be the values admissible at that support and let 𝖤𝗅𝑛(𝛼) ⊆𝐷𝑛 ×𝐷𝑛 be the PER of their elements, defined by recursion on 𝛼. A membership derivation contains the two endpoint-admissibility premises; it is not membership in an unindexed relation on raw 𝐷.
For the closed ̂𝟐/̂Π fragment the generators are as follows.
Boolean code. There is a constructor 𝖻𝗈𝗈𝗅𝑛:̂𝟐≈U0̂𝟐@𝑛. Its element PER is the least symmetric and transitive relation containing ̂𝗍𝗍𝖤𝗅𝑛(𝖻𝗈𝗈𝗅𝑛)̂𝗍𝗍,̂𝖿𝖿𝖤𝗅𝑛(𝖻𝗈𝗈𝗅𝑛)̂𝖿𝖿, and, in open contexts, corresponding related neutral Boolean values. It contains no true–false pair.
Dependent-function code. Suppose 𝛼 :𝐴 ≈U0𝐴′@𝑛 has finite support world 𝑛. For every relational world substitution 𝝈 =(𝜎0,𝜎1;𝑞) :𝑛 ⇒𝑚 and witness 𝜁 :𝑑 𝖤𝗅𝑚(𝝈∗𝛼) 𝑑′, require a derivation 𝛽𝝈,𝜁:(𝜎0∗𝐹)(𝑑)≈U0(𝜎1∗𝐹′)(𝑑′)@𝑚. Require naturality 𝝉∗𝛽𝝈,𝜁 =𝛽𝝉∘𝝈,𝝉∗𝜁. Then 𝗉𝗂(𝛼,𝛽):̂Π(𝐴,𝐹)≈U0̂Π(𝐴′,𝐹′)@𝑛. Define its element PER by 𝑓𝖤𝗅𝑛(𝗉𝗂(𝛼,𝛽))𝑔⟺ for every 𝝈:𝑛⇒𝑚 and 𝑑,𝑑′,𝜁,𝑑𝖤𝗅𝑚(𝝈∗𝛼)𝑑′⟹𝜎0∗𝑓⋅𝑑𝖤𝗅𝑚(𝛽𝝈,𝜁)𝜎1∗𝑔⋅𝑑′.(1) The relational substitution carries the support evidence that an arbitrary semantic assignment would lack. Binder extension appends the supplied 𝜁; formation of that witness gives 𝑑,𝑑′ ∈𝐷𝑚. The new values may therefore contain variables from target gaps but no level outside 𝑚. Hence (1) is required at every future context extension and is stable under composition, not merely at the support world. Symmetry and transitivity of the universe relation, and of every element relation, are defined recursively on these constructors.
The ambiguity is now visible. If universe computability were merely the proposition “𝑐 is convertible to a code,” one proof might present 𝑐 as ̂𝟐 and another as ̂Π(𝐴,𝐹). Recursing on those proofs would assign incompatible element PERs to 𝖤𝗅(𝑐).
The indexed inductive family prevents this by no-confusion for code tags. A 𝖻𝗈𝗈𝗅 derivation relates only two ̂𝟐 tags, whereas a 𝗉𝗂 derivation relates only two ̂Π tags; the tags are disjoint and the Pi tag is injective. Induction on two derivations with the same endpoints proves functionality: 𝛼,𝛼′:𝑐≈U0𝑐′⟹𝖤𝗅𝑛(𝛼)=𝖤𝗅𝑛(𝛼′).(2) In the Pi case, (2) follows recursively for the domain and every codomain relation. Equivalently, semantic codes may be records carrying a constructor tag and their element PER; universe relatedness then matches records by tag. Evidence remains proof-relevant, but the PER it carries is coherent and constructor-determined. That is the information a truth-valued predicate would lose.
Exercise 111.16.
Reflecting 𝑥 :𝟐 →𝟐 produces the semantic function 𝑑 ↦ ↑𝟐(𝑥 ↓𝟐𝑑); reification at the function type yields the eta-long normal form 𝜆𝑦.𝑥 𝑦. For the specified middle term, evaluation leaves the exact neutral spine 𝗂𝗇𝖽𝟐(𝑦.𝟐;𝗍𝗍,𝖿𝖿,𝑥) stuck: its principal is the neutral 𝑥, its constant motive has fiber 𝟐, and its two branch values reify to 𝗍𝗍 and 𝖿𝖿 in that fiber. Reflection at 𝟐 stores this spine, and reification at 𝟐 returns precisely the same displayed term. For 𝑝 :(𝟐 →𝟐) →𝟐, reflection and reification introduce a fresh function variable 𝑓 and then eta-expand that variable at its own function type. The result is 𝜆𝑓.𝑝(𝜆𝑥.𝑓𝑥). The indices 𝟐 →𝟐, the eliminator motive, and (𝟐 →𝟐) →𝟐 select the argument reflection, branch readback, and two nested function-readback clauses. An untyped operation cannot know which eta-expansions or motive fibers to use.