exercise 141.1.
With Θ =𝑧 :𝟐 →𝟐 and 𝜌 =(𝑧 𝖿𝖿), 𝜌∘𝜏=((𝑧𝖿𝖿)[𝜏])=((𝜆𝑤:𝟐.𝑦)𝖿𝖿):Δ⟶Λ, so (𝜌 ∘𝜏) ∘𝜎 =(((𝜆𝑤 :𝟐. 𝑦) 𝖿𝖿)[(𝑓 𝑥)/𝑦]) =((𝜆𝑤 :𝟐. 𝑓 𝑥) 𝖿𝖿), the bound 𝑤 needing no change because 𝑤 is not free in 𝑓 𝑥. On the other side, 𝜏 ∘𝜎 =(𝜆𝑤 :𝟐. 𝑓 𝑥) by the calculation in the text, and 𝜌 ∘(𝜏 ∘𝜎) =((𝑧 𝖿𝖿)[(𝜆𝑤 :𝟐. 𝑓 𝑥)/𝑧]) =((𝜆𝑤 :𝟐. 𝑓 𝑥) 𝖿𝖿). The two lists coincide, as proposition 141.7 requires.
exercise 141.2.
By the definition of composition in example 141.19, (𝑥,𝑥′)∈𝑅⌣∘𝑅⟺∃𝑦.(𝑥,𝑦)∈𝑅∧(𝑥′,𝑦)∈𝑅,(𝑦,𝑦′)∈𝑅∘𝑅⌣⟺∃𝑥.(𝑥,𝑦)∈𝑅∧(𝑥,𝑦′)∈𝑅. Hence id𝐴 ⊆𝑅⌣ ∘𝑅 says ∀𝑥 ∈𝐴. ∃𝑦. (𝑥,𝑦) ∈𝑅, which is totality, and 𝑅 ∘𝑅⌣ ⊆id𝐵 says (𝑥,𝑦) ∈𝑅 ∧(𝑥,𝑦′) ∈𝑅 ⇒𝑦 =𝑦′, which is single-valuedness. A relation is the graph of a function exactly when it is total and single-valued: the function sends 𝑥 to the unique 𝑦 with (𝑥,𝑦) ∈𝑅.
exercise 141.3.
First the claim in the hint. By the clauses of definition 2.41, (𝑒1𝑒2)[𝜎] is an application, (𝜆𝑦 :𝐵. 𝑏)[𝜎] is an abstraction, and 𝗍𝗍[𝜎] =𝗍𝗍, 𝖿𝖿[𝜎] =𝖿𝖿; so if 𝑡[𝜎] is a variable then 𝑡 is a variable 𝑥𝑖 and 𝑡[𝜎] =𝜎(𝑥𝑖).
Let 𝜎 :Γ ⟶Δ and 𝜏 :Δ ⟶Γ with 𝜏 ∘𝜎 =idΓ and 𝜎 ∘𝜏 =idΔ. The first equation says 𝜏(𝑥𝑖)[𝜎] =𝑥𝑖 for each declaration 𝑥𝑖 :𝐴𝑖 of Γ; by the claim, 𝜏(𝑥𝑖) is a variable 𝑦𝑘(𝑖) of Δ with 𝜎(𝑦𝑘(𝑖)) =𝑥𝑖. Symmetrically the second equation gives, for each 𝑦𝑗 :𝐵𝑗 of Δ, a variable 𝑥𝑚(𝑗) with 𝜎(𝑦𝑗) =𝑥𝑚(𝑗) and 𝜏(𝑥𝑚(𝑗)) =𝑦𝑗. Then 𝑚(𝑘(𝑖)) =𝑖 and 𝑘(𝑚(𝑗)) =𝑗, so 𝑘 and 𝑚 are mutually inverse bijections between the declarations of Γ and of Δ. Typing of the components gives Δ ⊢𝑦𝑘(𝑖) :𝐴𝑖, so 𝐵𝑘(𝑖) =𝐴𝑖. Thus Δ lists the same types as Γ, in the order given by 𝑘, under the renaming 𝑥𝑖 ↦𝑦𝑘(𝑖).
Conversely, if Δ is obtained from Γ by a bijection 𝑘 on positions with 𝐵𝑘(𝑖) =𝐴𝑖 and a renaming, then 𝜎:=(𝑥𝑚(1),…,𝑥𝑚(|Δ|)) and 𝜏:=(𝑦𝑘(1),…,𝑦𝑘(|Γ|)) are substitutions, and (𝜏 ∘𝜎)(𝑥𝑖) =𝑦𝑘(𝑖)[𝜎] =𝑥𝑚(𝑘(𝑖)) =𝑥𝑖, likewise for the other composite.
exercise 141.4.
Let 0 and 0′ be initial and let 𝑖 :0 ⟶0′ and 𝑖′ :0′ ⟶0 be the unique arrows. Then 𝑖′ ∘𝑖 :0 ⟶0 and id0 are both arrows 0 ⟶0, so they are equal by uniqueness; likewise 𝑖 ∘𝑖′ =id0′. Any isomorphism 0 ⟶0′ is an arrow 0 ⟶0′, hence equals 𝑖. Compared with the displayed proof, every arrow has been reversed: 𝑡 :1 ⟶1′ became 𝑖 :0 ⟶0′ with the source and target exchanged, and the composite 𝑡′ ∘𝑡 :1 ⟶1 became 𝑖′ ∘𝑖 :0 ⟶0, which is the reversed composite 𝑡 ∘op𝑡′ read in Cop.
exercise 141.5.
Let 𝑟 ∘𝑓 =id𝑎. If 𝑓 ∘𝑢 =𝑓 ∘𝑢′ for 𝑢,𝑢′ :𝑡 ⟶𝑎, then 𝑢𝑢𝑛𝑖𝑡=id𝑎∘𝑢=(𝑟∘𝑓)∘𝑢𝑎𝑠𝑠𝑜𝑐.=𝑟∘(𝑓∘𝑢)ℎ𝑦𝑝.=𝑟∘(𝑓∘𝑢′)𝑎𝑠𝑠𝑜𝑐.=(𝑟∘𝑓)∘𝑢′=𝑢′, so 𝑓 is monic. If moreover 𝑓 is epic, compute (𝑓 ∘𝑟) ∘𝑓 𝑎𝑠𝑠𝑜𝑐.=𝑓 ∘(𝑟 ∘𝑓) =𝑓 ∘id𝑎 =𝑓 =id𝑏 ∘𝑓; cancelling the epimorphism 𝑓 on the right gives 𝑓 ∘𝑟 =id𝑏. Together with 𝑟 ∘𝑓 =id𝑎 this makes 𝑓 an isomorphism with inverse 𝑟.
exercise 141.6.
If 𝑔 ∘𝑓 =id𝑎 and 𝑓 ∘𝑔 =id𝑏, then 𝐹(𝑔)∘𝐹(𝑓)(141.4)=𝐹(𝑔∘𝑓)ℎ𝑦𝑝.=𝐹(id𝑎)(141.4)=id𝐹(𝑎), and likewise 𝐹(𝑓) ∘𝐹(𝑔) =id𝐹(𝑏); so 𝐹(𝑓) is an isomorphism and, by lemma 141.22, 𝐹(𝑓)−1 =𝐹(𝑔) =𝐹(𝑓−1).
For the converse, let 𝑃 ={𝑎,𝑏} with 𝑎 ≤𝑏 and not 𝑏 ≤𝑎, let 𝑄 be the one-element preorder { ∗}, and let 𝐹 send both objects to ∗; 𝐹 is monotone, hence a functor by example 141.33. The arrow 𝑓 given by 𝑎 ≤𝑏 is sent to id∗, an isomorphism, but 𝑓 is not an isomorphism in 𝑃, because an inverse would be an arrow 𝑏 ⟶𝑎 and hom𝑃(𝑏,𝑎) is empty.
exercise 141.7.
For 𝑓 :𝑎 ⟶𝑏, 𝑔 :𝑏 ⟶𝑐 in C and (𝑢,𝑢′) ∈(𝐾 ×𝐾′)(𝑐), (𝐾×𝐾′)(𝑔∘𝑓)(𝑢,𝑢′)=(𝐾(𝑔∘𝑓)(𝑢),𝐾′(𝑔∘𝑓)(𝑢′))(141.5)=(𝐾(𝑓)(𝐾(𝑔)(𝑢)),𝐾′(𝑓)(𝐾′(𝑔)(𝑢′)))=(𝐾×𝐾′)(𝑓)((𝐾×𝐾′)(𝑔)(𝑢,𝑢′)), and (𝐾 ×𝐾′)(id𝑎)(𝑢,𝑢′) =(𝑢,𝑢′) by the identity clause of (141.5) in each component. For the conditional: if Γ ⊢𝑒 :𝟐 and Γ ⊢𝑒𝑖 :𝐴 then Γ ⊢𝗂𝖿(𝑒;𝑒1;𝑒2) :𝐴 by the conditional rule of chapter 2, so the map is well defined, and the nonbinding-constructor clause of definition 2.41, which recurses in the immediate subterms, gives, for every 𝜎 :Γ ⟶Δ, 𝗂𝖿(𝑒;𝑒1;𝑒2)[𝜎]=𝗂𝖿(𝑒[𝜎];𝑒1[𝜎];𝑒2[𝜎]), the analogue of (141.6).
exercise 141.8.
Naturality of at at 𝜎 :Γ ⟶Δ requires, for 𝑒 ∈Tm𝐴→𝐵(Δ), (𝑒 𝑡)[𝜎] =𝑒[𝜎] 𝑡. By the application clause the left side is 𝑒[𝜎] 𝑡[𝜎], so the requirement is 𝑡[𝜎] =𝑡, which is lemma 141.2(3) because 𝑡 is closed. The one property used is FV(𝑡) =∅; for an open 𝑡 the family is not natural in general, because 𝑡[𝜎] can differ from 𝑡.
exercise 141.10.
Choose 𝑥′ ≠𝑥 and let Δ2:=(𝑥 :𝐴, 𝑥′ :𝐴′). By proposition 141.62 with Γ =⟨𝐴⟩, y(Δ2) ≅y(⟨𝐴⟩) ×Tm𝐴′, and by proposition 141.60, y(⟨𝐴⟩) ≅Tm𝐴; composing the natural isomorphisms componentwise gives Tm𝐴 ×Tm𝐴′ ≅y(Δ2), the component at Γ sending (𝑒,𝑒′) to the substitution (𝑒,𝑒′). Then corollary 141.53 with 𝑟 =Δ2, 𝐾 =Tm𝐵 gives Nat(Tm𝐴 ×Tm𝐴′,Tm𝐵) ≅Tm𝐵(Δ2), the terms 𝑥 :𝐴, 𝑥′ :𝐴′ ⊢𝑏 :𝐵. The transformation of 𝑏 has components (𝑒,𝑒′) ↦Tm𝐵((𝑒,𝑒′))(𝑏) =𝑏[𝑒/𝑥,𝑒′/𝑥′], and the term of a transformation 𝛼 is 𝛼Δ2(𝑥,𝑥′). For 𝐴 =𝐴′ →𝐵, application (𝑒1,𝑒2) ↦𝑒1𝑒2 corresponds to appΔ2(𝑥,𝑥′) =𝑥 𝑥′, and indeed (𝑥 𝑥′)[𝑒1/𝑥,𝑒2/𝑥′] =𝑒1𝑒2.
exercise 141.11.
Regard 𝑃 as a category by example 141.15. A presheaf 𝐾 assigns a set 𝐾(𝑎) to each 𝑎 and a function 𝐾(𝑎 ≤𝑏) :𝐾(𝑏) →𝐾(𝑎) to each 𝑎 ≤𝑏, with 𝐾(𝑎 ≤𝑎) =id𝐾(𝑎) and 𝐾(𝑎 ≤𝑐) =𝐾(𝑎 ≤𝑏) ∘𝐾(𝑏 ≤𝑐) for 𝑎 ≤𝑏 ≤𝑐. The representable y(𝑟) has y(𝑟)(𝑎) =hom𝑃(𝑎,𝑟), a one-element set when 𝑎 ≤𝑟 and empty otherwise: the down-set of 𝑟. A natural transformation 𝜙 :y(𝑟) ⇒𝐾 is a family of elements 𝜙𝑎 ∈𝐾(𝑎) for 𝑎 ≤𝑟 (the value of 𝜙𝑎 at the unique arrow), natural when 𝐾(𝑎 ≤𝑏)(𝜙𝑏) =𝜙𝑎 for all 𝑎 ≤𝑏 ≤𝑟: a compatible family over the down-set. Corollary 141.53 says such a family is determined by 𝜙𝑟 ∈𝐾(𝑟) through 𝜙𝑎 =𝐾(𝑎 ≤𝑟)(𝜙𝑟), and every element of 𝐾(𝑟) arises. In chapter 49, the values at a context restrict along every extension, and the uniform action demanded there is exactly compatibility of the family; the lemma identifies a single value at Γ with its whole compatible family of restrictions.
exercise 141.9.
If 𝑎 ∼𝑎′ and 𝑏 ∼𝑏′ then 𝑎 ≤𝑏 implies 𝑎′ ≤𝑎 ≤𝑏 ≤𝑏′, and symmetrically, so [𝑎] ≤[𝑏] does not depend on the representatives. It is reflexive and transitive because ≤ is, and antisymmetric: [𝑎] ≤[𝑏] and [𝑏] ≤[𝑎] give 𝑎 ≤𝑏 and 𝑏 ≤𝑎, so 𝑎 ∼𝑏 and [𝑎] =[𝑏]. The quotient map 𝑞(𝑎):=[𝑎] is monotone, hence a functor (example 141.33); it is faithful because hom-sets have at most one element, full because [𝑎] ≤[𝑏] means 𝑎 ≤𝑏 by definition, and essentially surjective because every class is 𝑞(𝑎) for any of its members. By theorem 141.46 it is an equivalence. If ≤ is antisymmetric then every class is a singleton, 𝑞 is a bijection on objects, and the map sending [𝑎] to its member is an inverse functor, monotone because [𝑎] ≤[𝑏] means 𝑎 ≤𝑏; so 𝑞 is an isomorphism of categories. Conversely an isomorphism of categories is injective on objects, so 𝑎 ∼𝑏 implies [𝑎] =[𝑏] implies 𝑎 =𝑏: antisymmetry. For the generality order, 𝜎1 ∼𝜎2 means 𝜎1 ⊒𝜎2 and 𝜎2 ⊒𝜎1, that is, every instance of each is an instance of the other: the two schemes have the same monotype instances, as ∀𝛼. 𝛼 →𝛼, ∀𝛽. 𝛽 →𝛽, and ∀𝛼∀𝛽. 𝛼 →𝛼 do.
exercise 141.12.
𝜏 ∘𝜎 =((𝑦 𝑣)[𝜎]) =((𝜆𝑤 :𝟐. 𝑢 𝑤) (𝑢 𝗍𝗍)) :Γ ⟶Θ. The range of 𝜏 ∘𝜎 has free variable 𝑢, which is the bound name of 𝑒:=𝜆𝑢 :𝟐. 𝑧; so the abstraction clause renames it: (𝜆𝑢:𝟐.𝑧)[𝜏∘𝜎]=𝜆𝑢′:𝟐.(𝜆𝑤:𝟐.𝑢𝑤)(𝑢𝗍𝗍). Separately, 𝑒[𝜏] =𝜆𝑢 :𝟐. 𝑦 𝑣 with no renaming, since 𝑢 is not free in 𝑦 𝑣; then applying 𝜎, whose range again has 𝑢 free, renames the binder and gives 𝜆𝑢′ :𝟐. (𝜆𝑤 :𝟐. 𝑢 𝑤) (𝑢 𝗍𝗍). The two results are identical, confirming lemma 141.5. A bound name changed at exactly the steps where a substitution whose range contains 𝑢 passed under the binder 𝑢: once in the composite action and once in the second of the two separate actions. Without the change, the free 𝑢 of Γ would have been captured and the result would have been closed.
exercise 141.13.
For 𝑅 :𝐴 ⟶𝐵 and 𝑆 :𝐵 ⟶𝐶, (𝑧,𝑥)∈(𝑆∘𝑅)⌣𝑑𝑒𝑓. ⌣⟺(𝑥,𝑧)∈𝑆∘𝑅𝑑𝑒𝑓. ∘⟺∃𝑦.(𝑥,𝑦)∈𝑅∧(𝑦,𝑧)∈𝑆𝑑𝑒𝑓. ⌣⟺∃𝑦.(𝑧,𝑦)∈𝑆⌣∧(𝑦,𝑥)∈𝑅⌣𝑑𝑒𝑓. ∘⟺(𝑧,𝑥)∈𝑅⌣∘𝑆⌣, and (id𝐴)⌣ ={(𝑥,𝑥)} =id𝐴. Define 𝐹 :𝐑𝐞𝐥 →𝐑𝐞𝐥op as the identity on objects and 𝐹(𝑅):=𝑅⌣, an arrow 𝐵 ⟶𝐴 of 𝐑𝐞𝐥, hence an arrow 𝐴 ⟶𝐵 of 𝐑𝐞𝐥op. Functoriality: 𝐹(𝑆 ∘𝑅) =𝑅⌣ ∘𝑆⌣, and in 𝐑𝐞𝐥op the composite 𝐹(𝑆) ∘op𝐹(𝑅) is 𝐹(𝑅) ∘𝐹(𝑆) =𝑅⌣ ∘𝑆⌣ by definition 141.25; identities are preserved by the second equation. Since (𝑅⌣)⌣ =𝑅, 𝐹 is its own inverse, so it is an isomorphism of categories.
exercise 141.15.
Define Θ(𝑔):=homC(𝑔, −) for 𝑔 :𝑠 ⟶𝑟, with components homC(𝑟,𝑎) →homC(𝑠,𝑎), ℎ ↦ℎ ∘𝑔; this is natural by associativity, as in the proof of theorem 141.52. Define the inverse Ξ(𝜙):=𝜙𝑟(id𝑟) ∈homC(𝑠,𝑟) for natural 𝜙 :homC(𝑟, −) ⇒homC(𝑠, −). Then Ξ(Θ(𝑔)) =id𝑟 ∘𝑔 =𝑔. For the other composite, let 𝜙 be natural, 𝑎 an object, ℎ :𝑟 ⟶𝑎; naturality of 𝜙 at ℎ, evaluated at id𝑟, gives 𝜙𝑎(ℎ ∘id𝑟) =ℎ ∘𝜙𝑟(id𝑟), i.e. 𝜙𝑎(ℎ) =ℎ ∘Ξ(𝜙) =Θ(Ξ(𝜙))𝑎(ℎ). So Θ and Ξ are mutually inverse. The assignment 𝑟 ↦homC(𝑟, −), 𝑔 ↦homC(𝑔, −) is a functor Cop →[C,𝐒𝐞𝐭]: an arrow 𝑟 ⟶𝑠 of Cop is 𝑔 :𝑠 ⟶𝑟, and homC(𝑔′ ∘𝑔, −) =homC(𝑔, −) ∘homC(𝑔′, −) componentwise, ℎ ↦ℎ ∘𝑔′ ∘𝑔, which is the composite in the order required by Cop. The bijection just proved says this functor is injective and surjective on each hom-set, that is, fully faithful.
exercise 141.16.
Let 𝛼 :𝐹 ⇒𝐺, 𝛽 :𝐺 ⇒𝐻, 𝛾 :𝐻 ⇒𝐽. Associativity asserts (𝛾 ∘𝛽) ∘𝛼 =𝛾 ∘(𝛽 ∘𝛼) as natural transformations 𝐹 ⇒𝐽; two natural transformations are equal when all their components are, and at 𝑎 the two sides are (𝛾𝑎 ∘𝛽𝑎) ∘𝛼𝑎 and 𝛾𝑎 ∘(𝛽𝑎 ∘𝛼𝑎), equal by associativity in D. The unit laws id𝐺 ∘𝛼 =𝛼 =𝛼 ∘id𝐹 reduce at 𝑎 to id𝐺(𝑎) ∘𝛼𝑎 =𝛼𝑎 =𝛼𝑎 ∘id𝐹(𝑎), the unit laws of D. That the composites are natural was shown in section 141.7, so the laws are equations between arrows of [C,D].
exercise 141.17.
𝑤 is a substitution because Γ,𝑥 :𝐴 ⊢𝑥𝑖 :𝐴𝑖 by Var. Its action on a Γ-term 𝑒 is 𝑒[𝑥1/𝑥1,…,𝑥𝑛/𝑥𝑛] =𝑒 by lemma 141.2(2), the same term regarded in the larger context; so the action is injective.
Epic. Let 𝑣,𝑣′ :Γ ⟶Θ with 𝑣 ∘𝑤 =𝑣′ ∘𝑤. Componentwise, 𝑣(𝑧𝑘)[𝑤] =𝑣′(𝑧𝑘)[𝑤], and by the remark just made this is 𝑣(𝑧𝑘) =𝛼𝑣′(𝑧𝑘); so 𝑣 =𝑣′.
Not monic. Let Λ:=Γ,𝑥 :𝐴,𝑥′ :𝐴 and 𝑢:=(𝑥1,…,𝑥𝑛,𝑥), 𝑢′:=(𝑥1,…,𝑥𝑛,𝑥′), both substitutions Λ ⟶Γ,𝑥 :𝐴. Then 𝑤 ∘𝑢 =(𝑥1,…,𝑥𝑛) =𝑤 ∘𝑢′, since 𝑤 has no component for 𝑥, but 𝑢 ≠𝑢′.
Not an isomorphism. An isomorphism 𝑓 with inverse 𝑔 is monic: 𝑓 ∘𝑢 =𝑓 ∘𝑢′ gives 𝑢 =𝑔 ∘𝑓 ∘𝑢 =𝑔 ∘𝑓 ∘𝑢′ =𝑢′. Since 𝑤 is not monic, it is not an isomorphism.
The epimorphism argument used only the injectivity of the action: if 𝑒[𝑤] =𝑒′[𝑤] then 𝑒 =𝑒′. The global-element argument of proposition 141.29 separated two arrows into 𝐴 by evaluating them at elements 1 →𝐴. In 𝐂𝐭𝐱 take 𝐴 =𝑃 atomic: the source Γ,𝑥 :𝑃 of 𝑤 has no global elements, because a global element would include a closed term of type 𝑃, and by theorem 2.43 and lemma 2.59 a closed normal term has a non-atomic type or a free variable. So the test “𝑤 ∘𝜌 =𝑤 ∘𝜌′ implies 𝜌 =𝜌′” at 𝑡 = ⋅ holds vacuously while 𝑤 is not monic; cancellation in 𝐂𝐭𝐱 must be tested against arbitrary contexts, as the definition requires.
exercise 141.14.
An arrow (𝑎,𝑏) ⟶(𝑎′,𝑏′) of 𝑃 ×𝑄 is a pair of an arrow 𝑎 ≤𝑎′ and an arrow 𝑏 ≤𝑏′, which exists exactly when both relations hold and is then unique; so 𝑃 ×𝑄 has at most one arrow between any two objects and is the preorder described, by example 141.15. On a preorder, hom𝑃(𝑎,𝑏) is a one-element set when 𝑎 ≤𝑏 and empty otherwise, and hom𝑃(𝑓,𝑔) for 𝑓 :𝑎′ ≤𝑎, 𝑔 :𝑏 ≤𝑏′ is the unique function between the corresponding sets, which exists because 𝑎 ≤𝑏 implies 𝑎′ ≤𝑎 ≤𝑏 ≤𝑏′. Functoriality is automatic. For a functor 𝐾 :𝑃op ×𝑃 →𝐒𝐞𝐭 with empty or one-element values, define the canonical functor ̂𝐾 by ̂𝐾(𝑎,𝑏) =1 when 𝐾(𝑎,𝑏) is inhabited and ̂𝐾(𝑎,𝑏) =∅ otherwise. The function on objects (𝑎,𝑏) ↦[𝐾(𝑎,𝑏) ≠∅] is monotone into {0 ≤1}: a function 𝐾(𝑎,𝑏) →𝐾(𝑎′,𝑏′) can exist only when 𝐾(𝑎,𝑏) =∅ or 𝐾(𝑎′,𝑏′) ≠∅. Conversely a monotone truth-value map defines such a canonical functor, with every arrow action the unique function between the corresponding empty or singleton sets. The unique bijection 𝐾(𝑎,𝑏) →̂𝐾(𝑎,𝑏) at each object is natural, since every square is between sets with at most one element. Thus 𝐾 and ̂𝐾 are naturally isomorphic; they need not be literally equal when 𝐾 uses noncanonical singleton sets. Under this correspondence the hom bifunctor is naturally isomorphic to the functor classified by the map sending (𝑎,𝑏) to 1 iff 𝑎 ≤𝑏: it is monotone because (𝑎,𝑏) ≤(𝑎′,𝑏′) in 𝑃op ×𝑃 means 𝑎′ ≤𝑎 and 𝑏 ≤𝑏′, and then 𝑎 ≤𝑏 implies 𝑎′ ≤𝑏′.
exercise 141.18.
homC(1, −) sends 𝑓 :𝑎 ⟶𝑏 to the function 𝑢 ↦𝑓 ∘𝑢 on global elements. It is faithful exactly when 𝑓 ≠𝑓′ implies that these functions differ, that is, that some 𝑢 has 𝑓 ∘𝑢 ≠𝑓′ ∘𝑢: this is the definition of having enough points. 𝐒𝐞𝐭 has enough points because 𝑓 ≠𝑓′ means 𝑓(𝑥) ≠𝑓′(𝑥) for some 𝑥, and then 𝑓 ∘𝑥―― ≠𝑓′ ∘𝑥――. In 𝐂𝐭𝐱, let 𝑃 be atomic. The substitutions (𝗍𝗍),(𝖿𝖿) :⟨𝑃⟩ ⟶⟨𝟐⟩ are distinct. A global element of ⟨𝑃⟩ is a closed term of type 𝑃, and there is none: such a term would reduce, by theorem 2.43 and subject reduction (corollary 2.44), to a closed normal term of type 𝑃, which by lemma 2.59 is an introduction form, whose type is never atomic, or variable-headed, which needs a free variable. So the two substitutions agree on every environment vacuously, and 𝐂𝐭𝐱 does not have enough points.
exercise 141.19.
Let 𝜂 :Id ⇒𝐺 ∘𝐹, 𝜀 :𝐹 ∘𝐺 ⇒Id, 𝜂′ :Id ⇒𝐺′ ∘𝐹, 𝜀′ :𝐹 ∘𝐺′ ⇒Id be the given natural isomorphisms. Define 𝜃𝑑:=𝐺′(𝜀𝑑) ∘𝜂′𝐺(𝑑) :𝐺(𝑑) ⟶𝐺′(𝐹(𝐺(𝑑))) ⟶𝐺′(𝑑). Each component is an isomorphism: 𝜂′𝐺(𝑑) is one, and 𝐺′(𝜀𝑑) is one with inverse 𝐺′(𝜀−1𝑑), by (141.4). Naturality at 𝑔 :𝑑 ⟶𝑑′: 𝜃𝑑′∘𝐺(𝑔)=𝐺′(𝜀𝑑′)∘𝜂′𝐺(𝑑′)∘𝐺(𝑔)𝑛𝑎𝑡. 𝜂′=𝐺′(𝜀𝑑′)∘𝐺′(𝐹(𝐺(𝑔)))∘𝜂′𝐺(𝑑)𝑓𝑢𝑛𝑐𝑡𝑜𝑟=𝐺′(𝜀𝑑′∘𝐹(𝐺(𝑔)))∘𝜂′𝐺(𝑑)𝑛𝑎𝑡. 𝜀=𝐺′(𝑔∘𝜀𝑑)∘𝜂′𝐺(𝑑)=𝐺′(𝑔)∘𝜃𝑑. So 𝜃 is a natural isomorphism 𝐺 ⇒𝐺′ by proposition 141.43.
exercise 141.20.
Let (𝑟,𝑢) and (𝑟′,𝑢′) be two representations, so both are terminal objects of ∫𝐾 by proposition 141.65. By lemma 141.27 they are isomorphic in ∫𝐾 by a unique isomorphism 𝑓 :(𝑟,𝑢) ⟶(𝑟′,𝑢′) with inverse 𝑓′. The arrows of ∫𝐾 are arrows of C composed as in C, so 𝑓 :𝑟 ⟶𝑟′ and 𝑓′ :𝑟′ ⟶𝑟 satisfy 𝑓′ ∘𝑓 =id𝑟 and 𝑓 ∘𝑓′ =id𝑟′ in C, because the projection 𝜋𝐾 is the identity on arrows and composition in ∫𝐾 is that of C. Hence 𝑟 ≅𝑟′, which is the uniqueness stated in corollary 141.59; moreover 𝑓 satisfies 𝐾(𝑓)(𝑢′) =𝑢, so it carries one universal element to the other.
exercise 141.21.
An object of ∫Env is a pair (Γ,𝜌) of a context and an environment 𝜌 : ⋅ ⟶Γ for it. An arrow (Γ,𝜌) ⟶(Δ,𝜌′) is a substitution 𝜎 :Γ ⟶Δ with Env(𝜎)(𝜌) =𝜎 ∘𝜌 =𝜌′: a substitution that carries the first environment to the second. The object ( ⋅,()), the empty context with the empty environment, is initial: an arrow ( ⋅,()) ⟶(Γ,𝜌) is a substitution 𝜎 : ⋅ ⟶Γ with 𝜎 ∘() =𝜌, and 𝜎 ∘() =𝜎 since () is id⋅, so 𝜎 =𝜌 is the unique such arrow. This is the dual of the terminal object (⟨𝐴⟩,𝑥) of ∫Tm𝐴: the covariant functor Env =hom𝐂𝐭𝐱( ⋅, −) is represented by ⋅, and its category of elements has an initial object, the universal element ().
exercise 141.22.
Suppose 𝜙 :y(Δ) ⇒𝐾 is a natural isomorphism. By proposition 141.43 its component at ⋅ is a bijection hom𝐂𝐭𝐱( ⋅,Δ) →𝐾( ⋅) ={0,1}, so hom𝐂𝐭𝐱( ⋅,Δ) has exactly two elements. These elements are lists of closed terms ( ⋅ ⊢𝑎𝑗 :𝐵𝑗)𝑗.
If Δ = ⋅, the only list is the empty one: one element. Otherwise, if some declared type 𝐵𝑗 has no closed term, the hom-set is empty. This happens for an atomic type 𝑃: a closed term of type 𝑃 would, by strong normalization (theorem 2.43) and subject reduction (corollary 2.44), reduce to a closed normal term 𝑛 of type 𝑃, and by lemma 2.59 𝑛 is either an introduction form, whose type is never atomic, or is variable-headed, which requires a free variable; neither has type 𝑃 in the empty context, the argument of corollary 2.44. If every 𝐵𝑗 has a closed term 𝑡𝑗, then the hom-set is infinite: the terms 𝑡1, (𝜆𝑦 :𝐵1. 𝑦) 𝑡1, (𝜆𝑦 :𝐵1. 𝑦) ((𝜆𝑦 :𝐵1. 𝑦) 𝑡1), … are closed, of type 𝐵1 by Lam and App, and pairwise distinct as syntax trees, hence as 𝛼-classes, since their sizes differ; each gives a different list. In every case the count is not two, so no representation exists. Note that Tm𝐴 counts terms up to 𝛼-equivalence only; the argument would change for terms up to 𝛽𝜂-equality.