exercise 54.1.
Apply Ext-Uniq to the two substitutions. Their projection components agree because 𝐩 ∘(𝛾 ∘𝛿) ≡(𝐩 ∘𝛾) ∘𝛿 by category associativity. Their term components agree because 𝐪[⟨𝛾,𝑎⟩ ∘𝛿] ≡𝐪[⟨𝛾,𝑎⟩][𝛿] ≡𝑎[𝛿]. These are exactly the category and term equations needed by uniqueness, hence ⟨𝛾,𝑎⟩ ∘𝛿 ≡⟨𝛾 ∘𝛿,𝑎[𝛿]⟩.
exercise 54.2.
Expand 𝛾+ as ⟨𝛾 ∘𝐩,𝐪⟩. For 𝛾 =𝗂𝖽, the projection triangle reduces to 𝐩 and the variable triangle to 𝐪, so Ext-Uniq gives 𝗂𝖽+ =𝗂𝖽. For a composite, use lemma 116.10 twice: both sides have projection 𝛾 ∘𝛿 ∘𝐩, while substitution of 𝐪 through the lifted right factor reduces again to 𝐪. Ext-Uniq therefore gives (𝛾∘𝛿)+ =𝛾+ ∘𝛿+ at the appropriately substituted type.
exercise 54.3.
Stability of Π gives Π(𝐴,𝐵)[𝛾] =Π(𝐴[𝛾],𝐵[𝛾+]), so the substituted function and argument may be fed to application. Its result type is 𝐵[𝛾+][⟨𝗂𝖽,𝑎[𝛾]⟩]. Term substitution composition changes this to 𝐵[𝛾+ ∘⟨𝗂𝖽,𝑎[𝛾]⟩]. The extension-composition lemma and the two triangles give 𝛾+ ∘⟨𝗂𝖽,𝑎[𝛾]⟩ =⟨𝛾,𝑎[𝛾]⟩, which is the type on the other side of App-Sb.
exercise 54.4.
At 𝑘 =0 the generic variable has type 𝐴[𝐩]. If the displayed term has type 𝐴[𝐩𝑘+1] after 𝑘 extensions, weaken it once. Tm-Subst changes its type to 𝐴[𝐩𝑘+1][𝐩], and substitution composition makes this 𝐴[𝐩𝑘+2]. The term itself is 𝐪[𝐩𝑘][𝐩] =𝐪[𝐩𝑘+1]. Induction on 𝑘 proves the rule.
exercise 54.5.
In algebraic notation the term is 𝗅𝖺𝗆(𝗅𝖺𝗆(𝐪[𝐩])). The inner generic variable would denote 𝑦; weakening it once selects the preceding variable 𝑥. Its type is 𝐴[𝐩][𝐩], so the inner abstraction has type Π(𝐴[𝐩],𝐴[𝐩]) and the outer abstraction has the translation of Π(𝑥 :𝐴).Π(𝑦 :𝐵).𝐴. Thus both weakenings occur under the second binder: one in the selected term and one in the translated constant family 𝐴.
exercise 54.6.
Induct on 𝑏. A variable is either the variable being replaced, where Var-Ext returns 𝑎, or an older variable, where Var-Wk commutes past the extension. Application follows from the two induction hypotheses and App-Sb. For 𝜆𝑏0, substitution under the binder is by ⟨𝗂𝖽,𝑎⟩+; the lift/extension equations reduce this to the simultaneous assignment that fixes the new variable and substitutes 𝑎 for the next one. The induction hypothesis for 𝑏0, followed by Lam-Sb, is exactly the translation of capture-avoiding 𝑏0[𝑎/𝑥].
exercise 54.7.
Distribution through application gives 𝐸[𝖺𝗉𝗉(𝑣1,𝑣0),[𝑔,𝑎]]=𝖺𝗉𝗉(𝐸[𝑣1,[𝑔,𝑎]],𝐸[𝑣0,[𝑔,𝑎]])=𝖺𝗉𝗉(𝑔,𝑎). The lifted list is 𝗅𝗂𝖿𝗍([𝑔,𝑎]) =[𝗌𝗁𝗂𝖿𝗍(𝑔),𝗌𝗁𝗂𝖿𝗍(𝑎),𝑣0]. List lookup therefore sends 𝑣0 to the fresh variable 𝑣0, 𝑣1 to 𝗌𝗁𝗂𝖿𝗍(𝑎), and 𝑣2 to 𝗌𝗁𝗂𝖿𝗍(𝑔). Their types are, respectively, 𝐶, the weakening of 𝐴, and the weakening of 𝐴 →𝐵 in Δ,𝑦 :𝐶.
exercise 54.8.
Put 𝑇(Γ) =(Ty(Γ),𝐴 ↦Tm(Γ,𝐴)). For 𝛾 :Δ →Γ, let 𝑇(𝛾) send 𝐴 to 𝐴[𝛾] and 𝑎 to 𝑎[𝛾]. The equations 𝐴[𝗂𝖽] =𝐴, 𝐴[𝛾 ∘𝛿] =(𝐴[𝛾])[𝛿] and their two term analogues say exactly that 𝑇(𝗂𝖽) is the identity family map and 𝑇(𝛾 ∘𝛿) =𝑇(𝛿)𝑇(𝛾). Thus the four substitution equations are precisely the contravariant functor laws, in both base and fiber components.
exercise 54.9.
The first universal property gives 𝑢 =⟨𝑝′,𝑞′⟩ :𝐸 →Γ.𝐴; the second gives 𝑣 =⟨𝐩,𝐪⟩′ :Γ.𝐴 →𝐸. Both 𝑢𝑣 and the identity have projection 𝐩 and generic component 𝐪, so uniqueness gives 𝑢𝑣 =𝗂𝖽; symmetrically 𝑣𝑢 =𝗂𝖽. Any map commuting with the two components is forced by the corresponding uniqueness clause, so this isomorphism is unique.
exercise 54.10.
Set 𝜏 =⟨𝛿,𝐪𝐴[𝜎]⟩. Its first triangle is 𝐩 ∘𝜏 =𝛿. For the second, naturality of substitution and the assumed equality give 𝐴[𝛾][𝛿]=𝐴[𝛾∘𝛿]=𝐴[𝐩𝐴∘𝜎], which is the type of 𝐪𝐴[𝜎]; the variable triangle then yields the required comparison with 𝜎. If 𝜏′ has the same triangles, its projection is 𝛿 and its generic component is 𝐪𝐴[𝜎], so comprehension uniqueness gives 𝜏′ =𝜏.
exercise 54.11.
Stability of Π along 𝐩𝐴 gives the stated type of 𝑓[𝐩𝐴]. Application with 𝐪𝐴 :𝐴[𝐩𝐴] then has codomain 𝐵[𝐩𝐴+][⟨𝗂𝖽,𝐪𝐴⟩]. By substitution composition this is 𝐵[𝐩𝐴+ ∘⟨𝗂𝖽,𝐪𝐴⟩]. Both components of the displayed composite are those of the identity substitution; Ext-Uniq gives 𝐩𝐴+ ∘⟨𝗂𝖽,𝐪𝐴⟩ =𝗂𝖽. Hence the application has type 𝐵, and abstraction makes the eta equation well typed.
exercise 54.12.
From Γ.𝐴.𝐵 to Γ.Σ(𝐴,𝐵) use the projection to Γ and the pair of the two generic terms. In the reverse direction, project the generic pair to obtain its first component, extend by it, then extend by the second component transported into the resulting fiber. The two Σ beta laws prove both projection triangles; Σ eta and comprehension uniqueness prove the two composites are identities. Since both maps have first component the projection to Γ, the isomorphism is over Γ.
exercise 54.13.
Let 𝜌 =⟨⟨⟨𝗂𝖽,𝑎⟩,𝑏⟩,𝑝⟩ into the generic context and define 𝖩𝑎,𝑏,𝑝(𝐶,𝑑) =𝖩(𝐶,𝑑)[𝜌]. Stability of generic 𝖩 gives the displayed type. At 𝑏 =𝑎,𝑝 =𝗋𝖾𝖿𝗅𝑎, its computation equation is the generic beta equation followed by substitution. Conversely, instantiate the pointwise operation in the generic context at its three variables. Its assumed stability under every substitution supplies exactly the generic stability equation, so the resulting term is the CwF 𝖩-structure.
exercise 54.14.
For syntactic 𝛾 :Δ →Γ and 𝑎 :𝐴[𝛾], the extension ⟨𝛾,𝑎⟩ has projection 𝛾 by Ext-Wk and generic component 𝑎 by Ext-Var. If 𝛿 :Δ →Γ.𝐴 has those two components, Ext-Uniq gives 𝛿 =⟨𝛾,𝑎⟩. Passing to judgmental-equality classes makes the construction and the uniqueness equality well defined, which is item 4.
exercise 54.15.
Choose a raw representative and induct mutually over contexts, substitutions, types, and terms. Empty context, identity, composition, projection, and extension are forced because both morphisms preserve the chosen CwF operations strictly. The Π, application, and abstraction cases are likewise forced by preservation of the chosen Π-structure; the induction hypotheses identify every argument. Both morphisms respect judgmental equality, so the result is independent of the representative and gives 𝐹 =𝐺 on all four quotient sorts.
exercise 54.16.
Here Γ.𝐴 ={(𝜌,𝑎) ∣𝑎 ∈𝐴(𝜌)}, 𝐩(𝜌,𝑎) =𝜌, and 𝐪(𝜌,𝑎) =𝑎. Thus ⟨𝛾,𝑎⟩(𝛿) =(𝛾𝛿,𝑎𝛿): the two triangles, naturality, and ⟨𝐩,𝐪⟩ =id are literal equalities of ordered pairs. Interpret Σ(𝐴,𝐵)(𝜌) by ∑𝑎∈𝐴(𝜌)𝐵(𝜌,𝑎), with ordinary pairing and projections. Their beta/eta laws are pair equalities, and reindexing acts componentwise, so every Σ operation is strictly stable.
exercise 54.17.
The Grothendieck construction Γ.𝐴 has objects (𝜌,𝑎) and arrows (𝑢,𝛼) :(𝜌,𝑎) →(𝜌′,𝑎′) with 𝑢 :𝜌 →𝜌′ and 𝛼 :𝐴(𝑢)(𝑎) →𝑎′. A functor 𝐹 :Δ →Γ.𝐴 therefore projects to 𝛾 =𝑝𝐹 and its second components form a natural section of 𝐴[𝛾]. Conversely a functor 𝛾 and such a section assemble componentwise into 𝐹. The two constructions are inverse on objects and arrows, hence give the required bijection.
exercise 54.18.
At 𝜌, take the Grothendieck groupoid Σ(𝐴,𝐵)(𝜌) =∫𝑎:𝐴(𝜌)𝐵(𝜌,𝑎). Pairing sends (𝑎,𝑏) to its object; an arrow is the pair (𝛼,𝛽) with 𝛽 lying over 𝛼. The projections return 𝑎 and 𝑏, including their arrow components. Beta is componentwise, while eta sends (𝑎,𝑏) and (𝛼,𝛽) back to themselves. Reindexing applies the functors 𝐴(𝑢) and 𝐵(𝑢, −) to these components, so it commutes on the nose with pairing and both projections.
exercise 54.19.
Induct on the type former over a discrete context. Empty, unit, Boolean, and natural groupoids are discrete. Products, dependent sums, and dependent products of discrete fibers are discrete because a natural isomorphism between their objects is componentwise an equality. The identity type is interpreted by a hom-set of a discrete groupoid, hence is empty or singleton. Thus every interpreted identity proof is unique and UIP holds. A universe is different: its objects are small groupoids and its arrows are equivalences, so it is not discrete; this is exactly the source of the counterexample.
exercise 116.20.
Interpret a syntactic context Γ as its set of environments, a substitution 𝛾 :Δ →Γ as the environment map 𝜌 ↦𝛾[𝜌], a type 𝐴 as the family 𝜌 ↦[[𝐴]]𝜌, and a term 𝑎 :𝐴 as the section 𝜌 ↦[[𝑎]]𝜌. The comprehension comparison is the literal bijection [[Γ.𝐴]]={(𝜌,𝑢)∣𝜌∈[[Γ]],𝑢∈[[𝐴]]𝜌}, under which projection is first projection and the generic term is second projection. Induction over context, substitution, type, and term formation forces these four clauses and every constructor clause; hence any CwF morphism preserving the chosen structure agrees with this interpretation.