Lectures onType Theory
ch:algebraic-syntax: ch:algebraic-syntax
appendix sectionsolutions

ch:algebraic-syntax: ch:algebraic-syntax

exercise 54.1.

Apply Ext-Uniq to the two substitutions. Their projection components agree because p(γδ)(pγ)δ by category associativity. Their term components agree because q[γ,aδ]q[γ,a][δ]a[δ]. These are exactly the category and term equations needed by uniqueness, hence γ,aδγδ,a[δ].

exercise 54.2.

Expand γ+ as γp,q. For γ=id, the projection triangle reduces to p and the variable triangle to q, so Ext-Uniq gives id+=id. For a composite, use lemma 116.10 twice: both sides have projection γδp, while substitution of q through the lifted right factor reduces again to q. Ext-Uniq therefore gives (γδ)+=γ+δ+ at the appropriately substituted type.

exercise 54.3.

Stability of Π gives Π(A,B)[γ]=Π(A[γ],B[γ+]), so the substituted function and argument may be fed to application. Its result type is B[γ+][id,a[γ]]. Term substitution composition changes this to B[γ+id,a[γ]]. The extension-composition lemma and the two triangles give γ+id,a[γ]=γ,a[γ], which is the type on the other side of App-Sb.

exercise 54.4.

At k=0 the generic variable has type A[p]. If the displayed term has type A[pk+1] after k extensions, weaken it once. Tm-Subst changes its type to A[pk+1][p], and substitution composition makes this A[pk+2]. The term itself is q[pk][p]=q[pk+1]. Induction on k proves the rule.

exercise 54.5.

In algebraic notation the term is lam(lam(q[p])). The inner generic variable would denote y; weakening it once selects the preceding variable x. Its type is A[p][p], so the inner abstraction has type Π(A[p],A[p]) and the outer abstraction has the translation of Π(x:A).Π(y:B).A. Thus both weakenings occur under the second binder: one in the selected term and one in the translated constant family A.

exercise 54.6.

Induct on b. A variable is either the variable being replaced, where Var-Ext returns a, or an older variable, where Var-Wk commutes past the extension. Application follows from the two induction hypotheses and App-Sb. For λb0, substitution under the binder is by id,a+; the lift/extension equations reduce this to the simultaneous assignment that fixes the new variable and substitutes a for the next one. The induction hypothesis for b0, followed by Lam-Sb, is exactly the translation of capture-avoiding b0[a/x].

exercise 54.7.

Distribution through application gives E[app(v1,v0),[g,a]]=app(E[v1,[g,a]],E[v0,[g,a]])=app(g,a). The lifted list is lift([g,a])=[shift(g),shift(a),v0]. List lookup therefore sends v0 to the fresh variable v0, v1 to shift(a), and v2 to shift(g). Their types are, respectively, C, the weakening of A, and the weakening of AB in Δ,y:C.

exercise 54.8.

Put T(Γ)=(Ty(Γ),ATm(Γ,A)). For γ:ΔΓ, let T(γ) send A to A[γ] and a to a[γ]. The equations A[id]=A, A[γδ]=(A[γ])[δ] and their two term analogues say exactly that T(id) is the identity family map and T(γδ)=T(δ)T(γ). 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 u=p,q:EΓ.A; the second gives v=p,q:Γ.AE. Both uv and the identity have projection p and generic component q, so uniqueness gives uv=id; symmetrically vu=id. Any map commuting with the two components is forced by the corresponding uniqueness clause, so this isomorphism is unique.

exercise 54.10.

Set τ=δ,qA[σ]. Its first triangle is pτ=δ. For the second, naturality of substitution and the assumed equality give A[γ][δ]=A[γδ]=A[pAσ], which is the type of qA[σ]; the variable triangle then yields the required comparison with σ. If τ has the same triangles, its projection is δ and its generic component is qA[σ], so comprehension uniqueness gives τ=τ.

exercise 54.11.

Stability of Π along pA gives the stated type of f[pA]. Application with qA:A[pA] then has codomain B[pA+][id,qA]. By substitution composition this is B[pA+id,qA]. Both components of the displayed composite are those of the identity substitution; Ext-Uniq gives pA+id,qA=id. Hence the application has type B, and abstraction makes the eta equation well typed.

exercise 54.12.

From Γ.A.B to Γ.Σ(A,B) 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 ρ=id,a,b,p into the generic context and define Ja,b,p(C,d)=J(C,d)[ρ]. Stability of generic J gives the displayed type. At b=a,p=refla, 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 J-structure.

exercise 54.14.

For syntactic γ:ΔΓ and a:A[γ], the extension γ,a has projection γ by Ext-Wk and generic component a by Ext-Var. If δ:ΔΓ.A has those two components, Ext-Uniq gives δ=γ,a. 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 F=G on all four quotient sorts.

exercise 54.16.

Here Γ.A={(ρ,a)aA(ρ)}, p(ρ,a)=ρ, and q(ρ,a)=a. Thus γ,a(δ)=(γδ,aδ): the two triangles, naturality, and p,q=id are literal equalities of ordered pairs. Interpret Σ(A,B)(ρ) by aA(ρ)B(ρ,a), 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 Γ.A has objects (ρ,a) and arrows (u,α):(ρ,a)(ρ,a) with u:ρρ and α:A(u)(a)a. A functor F:ΔΓ.A therefore projects to γ=pF and its second components form a natural section of A[γ]. Conversely a functor γ and such a section assemble componentwise into F. The two constructions are inverse on objects and arrows, hence give the required bijection.

exercise 54.18.

At ρ, take the Grothendieck groupoid Σ(A,B)(ρ)=a:A(ρ)B(ρ,a). Pairing sends (a,b) to its object; an arrow is the pair (α,β) with β lying over α. The projections return a and b, including their arrow components. Beta is componentwise, while eta sends (a,b) and (α,β) back to themselves. Reindexing applies the functors A(u) and B(u,) 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 A as the family ρ[[A]]ρ, and a term a:A as the section ρ[[a]]ρ. The comprehension comparison is the literal bijection [[Γ.A]]={(ρ,u)ρ[[Γ]],u[[A]]ρ}, 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.

Search the book

Type to search the local edition.