Composition was defined by 𝑔∘𝑓:=𝜆(𝑥:𝐴).𝑔(𝑓𝑥). Hence the two equations are direct 𝛽-computations followed by congruence under abstraction; the second also uses app-eq, since its redex lies in the argument of 𝑔: In context Γ,𝑧:𝐶, const𝐵→𝐶𝑧∘𝑓≡𝜆(𝑥:𝐴).(𝜆(𝑦:𝐵).𝑧)(𝑓𝑥)≡𝜆(𝑥:𝐴).𝑧≡const𝐴→𝐶𝑧:𝐴→𝐶, In context Γ,𝑦:𝐵, 𝑔∘const𝐴→𝐵𝑦≡𝜆(𝑥:𝐴).𝑔((𝜆(𝑥′:𝐴).𝑦)𝑥)≡𝜆(𝑥:𝐴).𝑔𝑦≡const𝐴→𝐶𝑔𝑦:𝐴→𝐶. The original 𝑓 and 𝑔 are weakened into the displayed extended contexts. The superscript records the domain and codomain of each constant map; the freshness conditions on 𝑥,𝑥′ are supplied by alpha-renaming.
For a fresh 𝑢:𝟏, the unit uniqueness rule gives 𝑓𝑢≡⋆ and 𝑔𝑢≡⋆. Symmetry of the second equality gives 𝑓𝑢≡𝑔𝑢. Congruence for abstraction and the two Π-uniqueness equations therefore give 𝑓≡𝜆(𝑢:𝟏).𝑓𝑢≡𝜆(𝑢:𝟏).⋆≡𝜆(𝑢:𝟏).𝑔𝑢≡𝑔. The third step uses symmetry of unit uniqueness for 𝑔𝑢, and the last step uses symmetry of function eta for 𝑔. Taking 𝑔=id𝟏 yields the final claim. The argument uses both 𝟏-𝜂, to identify the values, and Π-𝜂, to identify the functions.
For 𝑝:∑𝑥:𝐴𝐵, use the positive eliminator with constant motive 𝐴 and branch 𝑥: 𝗉𝗋1(𝑝):=𝗂𝗇𝖽Σ(𝑥;𝑝):𝐴. Its pair computation gives 𝗉𝗋1((𝑎,𝑏))≡𝑎. Next use the motive 𝐶(𝑧):=𝐵[𝗉𝗋1(𝑧)/𝑥] and branch 𝑦. The first projection equation converts 𝑦:𝐵[𝑥/𝑥] to the required 𝐵[𝗉𝗋1((𝑥,𝑦))/𝑥], so 𝗉𝗋2(𝑝):=𝗂𝗇𝖽Σ(𝑦;𝑝):𝐵[𝗉𝗋1(𝑝)/𝑥], and positive computation yields 𝗉𝗋2((𝑎,𝑏))≡𝑏 after the same conversion.
Conversely define elimination by substituting the projections into the branch: 𝗂𝗇𝖽Σ(𝑧.𝐶;𝑑;𝑝):=𝑑[𝗉𝗋1(𝑝)/𝑥,𝗉𝗋2(𝑝)/𝑦]. Projection beta proves its pair computation. Typing the displayed term first places it in 𝐶[(𝗉𝗋1(𝑝),𝗉𝗋2(𝑝))/𝑧]; judgmental Σ-eta is used exactly once to convert this type to 𝐶[𝑝/𝑧].
For ℎ:∏𝑝:∑𝑥:𝐴𝐵𝐶(𝑝), put 𝖼𝗎𝗋𝗋𝗒(ℎ):=𝜆𝑥.𝜆𝑦.ℎ(𝑥,𝑦); in the reverse direction put 𝗎𝗇𝖼𝗎𝗋𝗋𝗒(𝑘):=𝜆𝑝.𝑘(𝗉𝗋1(𝑝))(𝗉𝗋2(𝑝)). Then 𝗎𝗇𝖼𝗎𝗋𝗋𝗒(𝖼𝗎𝗋𝗋𝗒(ℎ))Π−𝛽=𝜆𝑝.ℎ(𝗉𝗋1(𝑝),𝗉𝗋2(𝑝))Σ−𝜂=ℎ and 𝖼𝗎𝗋𝗋𝗒(𝗎𝗇𝖼𝗎𝗋𝗋𝗒(𝑘))Π−𝛽,Σ−𝛽=𝜆𝑥.𝜆𝑦.𝑘𝑥𝑦Π−𝜂=𝑘. For 𝐶(𝑝):=𝖨𝖽∑𝑥:𝐴𝐵(𝑝,𝑝), replacing judgmental Σ-eta by a path makes the first round trip only propositionally, not judgmentally, equal to ℎ.
Both terms are beta-normal. The neutral form 𝑝 has a variable at its head, whereas (𝗉𝗋1(𝑝),𝗉𝗋2(𝑝)) has a pair constructor at its head; no beta rule relates them. Consequently the uncurry–curry composite stops at 𝜆𝑝.ℎ((𝗉𝗋1(𝑝),𝗉𝗋2(𝑝))) instead of reducing judgmentally to ℎ. A propositional Σ-eta witness permits congruence to construct a propositional equality between the two maps, followed by function extensionality if equality of functions is wanted. It does not turn the stalled normal forms into a judgmental equality, so the result is a propositional rather than definitional isomorphism.
The simply typed function rules, reorganized in the fourfold order, are
Γ⊢𝐴𝗍𝗒𝗉𝖾Γ⊢𝐵𝗍𝗒𝗉𝖾
Γ⊢𝐴→𝐵𝗍𝗒𝗉𝖾
→-form
Γ,𝑥:𝐴⊢𝑏:𝐵
Γ⊢𝜆𝑥.𝑏:𝐴→𝐵
→-intro
Γ⊢𝑓:𝐴→𝐵Γ⊢𝑎:𝐴
Γ⊢𝑓𝑎:𝐵
→-elim
If judgmental equality is added, the computation and uniqueness rules are
Γ,𝑥:𝐴⊢𝑏:𝐵Γ⊢𝑎:𝐴
Γ⊢(𝜆𝑥.𝑏)𝑎≡𝑏[𝑎/𝑥]:𝐵
→-β
Γ⊢𝑓:𝐴→𝐵
Γ⊢𝑓≡𝜆𝑥.𝑓𝑥:𝐴→𝐵
→-η
with 𝑥∉FV(𝑓). The chapter on simple typing has no judgmental-equality judgment, so these last two displays are an extension of that calculus, not a reclassification of rules already present there.
For Π-types, the codomain is no longer a fixed type 𝐵 in Γ, but a family 𝐵 formed in Γ,𝑥:𝐴. Consequently:
formation assumes 𝐵𝗍𝗒𝗉𝖾 in the extended context;
the abstraction body has the dependent type 𝐵 there;
application to 𝑎 has type 𝐵[𝑎/𝑥], rather than 𝐵;
the beta equation is likewise classified by 𝐵[𝑎/𝑥];
in eta, the generic application 𝑓𝑥 has type 𝐵 in Γ,𝑥:𝐴.
The arrow rules are exactly the constant-family specialization in which 𝑥∉FV(𝐵), so every displayed fiber 𝐵[𝑎/𝑥] is literally 𝐵.
Assume first Π-𝜂. From Γ,𝑥:𝐴⊢𝑓𝑥≡𝑔𝑥:𝐵 and reflexive equalities for the domain and family, abstraction congruence gives Γ⊢𝜆(𝑥:𝐴).𝑓𝑥≡𝜆(𝑥:𝐴).𝑔𝑥:∏𝑥:𝐴𝐵. The two eta instances are 𝑓≡𝜆(𝑥:𝐴).𝑓𝑥,𝑔≡𝜆(𝑥:𝐴).𝑔𝑥. Therefore, using symmetry on the second and transitivity, 𝑓≡𝜆(𝑥:𝐴).𝑓𝑥≡𝜆(𝑥:𝐴).𝑔𝑥≡𝑔:∏𝑥:𝐴𝐵. This is extensionality.
Conversely, assume the extensionality rule and take 𝑓:∏𝑥:𝐴𝐵. Put 𝑔:=𝜆(𝑥:𝐴).𝑓𝑥. It is well typed by Π-intro. In the generic context Γ,𝑥:𝐴, choose a fresh binder 𝑦 for the displayed abstraction. The beta rule gives (𝜆(𝑦:𝐴).𝑓𝑦)𝑥≡𝑓𝑥:𝐵. After symmetry this is the pointwise premise 𝑓𝑥≡𝑔𝑥:𝐵. Extensionality now yields 𝑓≡𝑔=𝜆(𝑥:𝐴).𝑓𝑥:∏𝑥:𝐴𝐵, which is precisely Π-𝜂. Thus, with the remaining product rules fixed, eta and judgmental function extensionality are interderivable.
Choose 𝑥 fresh for 𝑓. In context Γ,𝑥:𝐴, beta for the identity gives Γ,𝑥:𝐴⊢id𝐴𝑥≡𝑥:𝐴. Application congruence, using reflexivity of 𝑓:𝐴→𝐵, therefore gives
Γ,𝑥:𝐴⊢𝑓≡𝑓:𝐴→𝐵Γ,𝑥:𝐴⊢id𝐴𝑥≡𝑥:𝐴
Γ,𝑥:𝐴⊢𝑓(id𝐴𝑥)≡𝑓𝑥:𝐵
app-eq
Abstraction congruence lifts this equality out of the generic context:
Γ⊢𝐴≡𝐴𝗍𝗒𝗉𝖾Γ,𝑥:𝐴⊢𝐵≡𝐵𝗍𝗒𝗉𝖾Γ,𝑥:𝐴⊢𝑓(id𝐴𝑥)≡𝑓𝑥:𝐵
Γ⊢𝜆(𝑥:𝐴).𝑓(id𝐴𝑥)≡𝜆(𝑥:𝐴).𝑓𝑥:𝐴→𝐵
λ-eq
By definition the left side is 𝑓∘id𝐴. Eta gives 𝑓≡𝜆(𝑥:𝐴).𝑓𝑥; after symmetry, 𝜆(𝑥:𝐴).𝑓𝑥≡𝑓. Transitivity now yields Γ⊢𝑓∘id𝐴≡𝑓:𝐴→𝐵. Thus the beta step is transported first through application and then through abstraction, while eta removes the final generic abstraction.
Assume first the ordinary beta rule and a derivation Γ,𝑥:𝐴⊢𝑏:𝐵. Rename the local declaration from 𝑥 to a fresh 𝑦, obtaining Γ,𝑦:𝐴⊢𝑏[𝑦/𝑥]:𝐵[𝑦/𝑥]. Weakening inserts a fresh declaration 𝑥:𝐴 before 𝑦:𝐴, and Π-𝛽 in ambient context Γ,𝑥:𝐴 gives (𝜆(𝑦:𝐴).𝑏[𝑦/𝑥])𝑥≡(𝑏[𝑦/𝑥])[𝑥/𝑦]:(𝐵[𝑦/𝑥])[𝑥/𝑦]. The two successive fresh substitutions undo one another on a clean display, so the right side and its type are respectively 𝑏 and 𝐵. This is the generic beta instance.
For the converse, assume all such generic instances. Start with Γ,𝑥:𝐴⊢𝑏:𝐵 and Γ⊢𝑎:𝐴. Choose 𝑦 fresh for Γ,𝐴,𝐵,𝑏,𝑎, rename the body to 𝑑:=𝑏[𝑦/𝑥] in context Γ,𝑦:𝐴, and use the assumed generic instance there, taking the fresh abstraction binder to be 𝑥: Γ,𝑦:𝐴⊢(𝜆(𝑥:𝐴).𝑑[𝑥/𝑦])𝑦≡𝑑:𝐵[𝑦/𝑥]. Since 𝑑[𝑥/𝑦]=(𝑏[𝑦/𝑥])[𝑥/𝑦]=𝑏, this is Γ,𝑦:𝐴⊢(𝜆(𝑥:𝐴).𝑏)𝑦≡𝑏[𝑦/𝑥]:𝐵[𝑦/𝑥]. Substitute 𝑎 for 𝑦. The left side becomes (𝜆(𝑥:𝐴).𝑏)𝑎. For the right side, apply proposition 26.11.4 with the successive substitutions [𝑦/𝑥] and [𝑎/𝑦]: because 𝑥≠𝑦, 𝑥∉FV(𝑎), and 𝑦∉FV(𝑏), (𝑏[𝑦/𝑥])[𝑎/𝑦]=𝑏[𝑎/𝑦][𝑦[𝑎/𝑦]/𝑥]=𝑏[𝑎/𝑥]. The identical calculation gives (𝐵[𝑦/𝑥])[𝑎/𝑦]=𝐵[𝑎/𝑥]. Hence substitution of the generic equation yields Γ⊢(𝜆(𝑥:𝐴).𝑏)𝑎≡𝑏[𝑎/𝑥]:𝐵[𝑎/𝑥], the ordinary beta rule.
Since 𝐵 is formed already in Γ, Exch applied to Γ,𝑥:𝐴,𝑦:𝐵⊢𝐶𝗍𝗒𝗉𝖾 gives Γ,𝑦:𝐵,𝑥:𝐴⊢𝐶𝗍𝗒𝗉𝖾. Thus the same raw family can be used after swapping the two independent arguments. Put 𝐹:=∏𝑥:𝐴∏𝑦:𝐵𝐶,𝐹′:=∏𝑦:𝐵∏𝑥:𝐴𝐶, and define 𝜎:=𝜆(𝑓:𝐹).𝜆(𝑦:𝐵).𝜆(𝑥:𝐴).𝑓𝑥𝑦,𝜎′:=𝜆(𝑔:𝐹′).𝜆(𝑥:𝐴).𝜆(𝑦:𝐵).𝑔𝑦𝑥. Successive applications and abstractions give 𝜎:(∏𝑥:𝐴∏𝑦:𝐵𝐶)→(∏𝑦:𝐵∏𝑥:𝐴𝐶), and 𝜎′ has the reverse type. The uses of 𝐶 in the body of 𝜎 are licensed by the exchanged formation judgment above.
For a generic 𝑓:𝐹, repeated beta and congruence give 𝜎′(𝜎𝑓)≡𝜆(𝑥:𝐴).𝜆(𝑦:𝐵).𝑓𝑥𝑦. In context Γ,𝑓:𝐹,𝑥:𝐴, eta for the inner product gives 𝜆(𝑦:𝐵).𝑓𝑥𝑦≡𝑓𝑥. Abstraction congruence yields 𝜆(𝑥:𝐴).𝜆(𝑦:𝐵).𝑓𝑥𝑦≡𝜆(𝑥:𝐴).𝑓𝑥, and a second eta step gives 𝜆(𝑥:𝐴).𝑓𝑥≡𝑓. Hence 𝜎′(𝜎𝑓)≡𝑓:𝐹. Abstracting over 𝑓 shows 𝜎′∘𝜎=𝜆(𝑓:𝐹).𝜎′(𝜎𝑓)≡𝜆(𝑓:𝐹).𝑓=id𝐹. The symmetric calculation proves 𝜎∘𝜎′≡id on the swapped product. Each round trip uses eta once for the inner argument and once for the outer argument.
We list the normally suppressed judgments and indicate how the natural type of each right-hand term is moved to the common type displayed in the equality.
For pair-eq, the expanded data are Γ𝖼𝗍𝗑,Γ⊢𝐴𝗍𝗒𝗉𝖾,Γ,𝑥:𝐴⊢𝐵𝗍𝗒𝗉𝖾,Γ⊢∑𝑥:𝐴𝐵𝗍𝗒𝗉𝖾,Γ⊢𝑎:𝐴,Γ⊢𝑎′:𝐴,Γ⊢𝑎≡𝑎′:𝐴,Γ⊢𝐵[𝑎/𝑥]𝗍𝗒𝗉𝖾,Γ⊢𝐵[𝑎′/𝑥]𝗍𝗒𝗉𝖾,Γ⊢𝑏:𝐵[𝑎/𝑥],Γ⊢𝑏′:𝐵[𝑎/𝑥],Γ⊢𝑏≡𝑏′:𝐵[𝑎/𝑥]. Equal substitution in 𝐵 gives Γ⊢𝐵[𝑎/𝑥]≡𝐵[𝑎′/𝑥]𝗍𝗒𝗉𝖾. Consequently Conv types the same raw term 𝑏′ at its natural right-pair fiber 𝐵[𝑎′/𝑥]. The two intro instances then supply (𝑎,𝑏):∑𝑥:𝐴𝐵,(𝑎′,𝑏′):∑𝑥:𝐴𝐵, which are the direct presuppositions of the pair equality. With all of these premises restored, pair-eq concludes Γ⊢(𝑎,𝑏)≡(𝑎′,𝑏′):∑𝑥:𝐴𝐵.
For 𝗉𝗋1-eq, restore Γ𝖼𝗍𝗑,Γ⊢𝐴𝗍𝗒𝗉𝖾,Γ,𝑥:𝐴⊢𝐵𝗍𝗒𝗉𝖾,Γ⊢∑𝑥:𝐴𝐵𝗍𝗒𝗉𝖾,Γ⊢𝑝:∑𝑥:𝐴𝐵,Γ⊢𝑝′:∑𝑥:𝐴𝐵,Γ⊢𝑝≡𝑝′:∑𝑥:𝐴𝐵,Γ⊢𝗉𝗋1(𝑝):𝐴,Γ⊢𝗉𝗋1(𝑝′):𝐴. The last line consists of the two projection-elimination instances and is the direct term presupposition of the conclusion 𝗉𝗋1(𝑝)≡𝗉𝗋1(𝑝′):𝐴.
For 𝗉𝗋2-eq, put 𝑞:=𝗉𝗋1(𝑝),𝑞′:=𝗉𝗋1(𝑝′),𝑟:=𝗉𝗋2(𝑝),𝑟′:=𝗉𝗋2(𝑝′). In addition to all the context, family, sum, and package judgments listed for 𝗉𝗋1-eq, restore Γ⊢𝑞:𝐴,Γ⊢𝑞′:𝐴,Γ⊢𝑞≡𝑞′:𝐴,Γ⊢𝐵[𝑞/𝑥]𝗍𝗒𝗉𝖾,Γ⊢𝐵[𝑞′/𝑥]𝗍𝗒𝗉𝖾,Γ⊢𝑟:𝐵[𝑞/𝑥],Γ⊢𝑟′:𝐵[𝑞′/𝑥]. The equality of first projections is the preceding congruence rule. The requested transport of the right-hand second projection is the literal tree
Γ⊢𝑟′:𝐵[𝑞′/𝑥]
Γ⊢𝑞≡𝑞′:𝐴Γ,𝑥:𝐴⊢𝐵𝗍𝗒𝗉𝖾
Γ⊢𝐵[𝑞/𝑥]≡𝐵[𝑞′/𝑥]𝗍𝗒𝗉𝖾
Subst-Eq-Ty
Γ⊢𝐵[𝑞′/𝑥]≡𝐵[𝑞/𝑥]𝗍𝗒𝗉𝖾
Ty-Sym
Γ⊢𝑟′:𝐵[𝑞/𝑥]
Conv
Together with 𝑟:𝐵[𝑞/𝑥], this supplies the direct term presuppositions of Γ⊢𝑟≡𝑟′:𝐵[𝑞/𝑥]. Thus every equality is stated in one common fiber, even though the natural type of 𝑟′ is the fiber over 𝑞′.
Use Subst with empty telescope and with the generic thesis 𝐵𝗍𝗒𝗉𝖾:
Γ⊢𝑎:𝐴Γ,𝑥:𝐴⊢𝐵𝗍𝗒𝗉𝖾
Γ⊢𝐵[𝑎/𝑥]𝗍𝗒𝗉𝖾
Subst
Hence 𝐵[𝑎/𝑥] is a formed type before the premise Γ⊢𝑏:𝐵[𝑎/𝑥] is even considered. This is the meta-well-typedness required by convention 26.14; the structural substitution rule supplies it from the family and the first component.
Choose 𝑥 fresh for 𝐵. Weakening forms 𝐵 in Γ,𝑥:𝐴, and the dependent-sum rules specialize to
Γ⊢𝐴𝗍𝗒𝗉𝖾Γ⊢𝐵𝗍𝗒𝗉𝖾
Γ⊢𝐴×𝐵𝗍𝗒𝗉𝖾
×-form
Γ⊢𝑎:𝐴Γ⊢𝑏:𝐵
Γ⊢(𝑎,𝑏):𝐴×𝐵
×-intro
Γ⊢𝑝:𝐴×𝐵
Γ⊢𝗉𝗋1(𝑝):𝐴
×-elim_1
Γ⊢𝑝:𝐴×𝐵
Γ⊢𝗉𝗋2(𝑝):𝐵
×-elim_2
Γ⊢𝑎:𝐴Γ⊢𝑏:𝐵
Γ⊢𝗉𝗋1((𝑎,𝑏))≡𝑎:𝐴
×-β_1
Γ⊢𝑎:𝐴Γ⊢𝑏:𝐵
Γ⊢𝗉𝗋2((𝑎,𝑏))≡𝑏:𝐵
×-β_2
Γ⊢𝑝:𝐴×𝐵
Γ⊢𝑝≡(𝗉𝗋1(𝑝),𝗉𝗋2(𝑝)):𝐴×𝐵
×-η
All fibers 𝐵[𝑎/𝑥] have simplified to 𝐵.
Given 𝑓:𝐴→(𝐵→𝐶) and 𝑝:𝐴×𝐵, define 𝗋𝖾𝖼×(𝑓;𝑝):=𝑓(𝗉𝗋1(𝑝))(𝗉𝗋2(𝑝)):𝐶. For 𝑎:𝐴 and 𝑏:𝐵, the two projection beta equations and two uses of application congruence give 𝗋𝖾𝖼×(𝑓;(𝑎,𝑏))=𝑓(𝗉𝗋1((𝑎,𝑏)))(𝗉𝗋2((𝑎,𝑏)))≡𝑓𝑎(𝗉𝗋2((𝑎,𝑏)))≡𝑓𝑎𝑏:𝐶. Thus the non-dependent recursor computes by 𝗋𝖾𝖼×(𝑓;(𝑎,𝑏))≡𝑓𝑎𝑏:𝐶.
Work in the positive presentation. First define 𝗉𝗋1(𝑝):=𝗂𝗇𝖽Σ(𝑥;𝑝) using the constant motive 𝐶1:=𝐴, formed in the package context, and branch 𝑥:𝐴. The primitive computation rule gives 𝗉𝗋1((𝑎,𝑏))≡𝑎:𝐴.
Now let 𝑧:∑𝑥:𝐴𝐵 and define the second motive 𝐶2:=𝐵[𝗉𝗋1(𝑧)/𝑥]incontext𝑧:∑𝑥:𝐴𝐵. It is a type because 𝗉𝗋1(𝑧):𝐴 and ordinary substitution forms the corresponding fiber. In the branch context Γ,𝑥:𝐴,𝑦:𝐵, the eliminator requires a term of 𝐶2[(𝑥,𝑦)/𝑧]=𝐵[𝗉𝗋1((𝑥,𝑦))/𝑥]. The first-projection computation equation gives Γ,𝑥:𝐴,𝑦:𝐵⊢𝗉𝗋1((𝑥,𝑦))≡𝑥:𝐴. Applying equal substitution to the family 𝐵 yields 𝐵[𝗉𝗋1((𝑥,𝑦))/𝑥]≡𝐵[𝑥/𝑥]=𝐵𝗍𝗒𝗉𝖾. After symmetry, the required branch typing is
Γ,𝑥:𝐴,𝑦:𝐵⊢𝑦:𝐵
Γ,𝑥:𝐴,𝑦:𝐵⊢𝐵[𝗉𝗋1((𝑥,𝑦))/𝑥]≡𝐵𝗍𝗒𝗉𝖾
Γ,𝑥:𝐴,𝑦:𝐵⊢𝐵≡𝐵[𝗉𝗋1((𝑥,𝑦))/𝑥]𝗍𝗒𝗉𝖾
Ty-Sym
Γ,𝑥:𝐴,𝑦:𝐵⊢𝑦:𝐵[𝗉𝗋1((𝑥,𝑦))/𝑥]
Conv
We may therefore define 𝗉𝗋2(𝑝):=𝗂𝗇𝖽Σ(𝑦;𝑝):𝐵[𝗉𝗋1(𝑝)/𝑥].
On a displayed pair, primitive computation gives 𝗂𝗇𝖽Σ(𝑦;(𝑎,𝑏))≡𝑦[𝑎/𝑥,𝑏/𝑦]=𝑏:𝐵[𝗉𝗋1((𝑎,𝑏))/𝑥]. The first-projection beta equation and equal substitution identify this type with 𝐵[𝑎/𝑥]; Conv-Eq therefore yields the familiar rule 𝗉𝗋2((𝑎,𝑏))≡𝑏:𝐵[𝑎/𝑥]. For an arbitrary variable 𝑝, however, the primitive eliminator is neutral: its computation rule matches only a scrutinee whose outer form is (𝑎,𝑏). With no eta or uniqueness rule in the positive presentation, nothing derives 𝑝≡(𝗉𝗋1(𝑝),𝗉𝗋2(𝑝)).
Choose the family binder 𝑥 fresh for 𝐵, so 𝐵[𝑎/𝑥]=𝐵 for every 𝑎. The dependent sum on the right side of theorem 27.22 then becomes an ordinary Cartesian product. The maps are 𝐹:Tm(Γ,𝐴×𝐵)⟶Tm(Γ,𝐴)×Tm(Γ,𝐵),𝐹([𝑝])=([𝗉𝗋1(𝑝)],[𝗉𝗋2(𝑝)]),𝐺:Tm(Γ,𝐴)×Tm(Γ,𝐵)⟶Tm(Γ,𝐴×𝐵),𝐺([𝑎],[𝑏])=[(𝑎,𝑏)]. Projection and pair congruence make both definitions independent of the chosen representatives.
The first round trip is 𝐹(𝐺([𝑎],[𝑏]))=𝐹([(𝑎,𝑏)])=([𝗉𝗋1((𝑎,𝑏))],[𝗉𝗋2((𝑎,𝑏))])=([𝑎],[𝑏]) by the two beta rules. The other is 𝐺(𝐹([𝑝]))=𝐺([𝗉𝗋1(𝑝)],[𝗉𝗋2(𝑝)])=[(𝗉𝗋1(𝑝),𝗉𝗋2(𝑝))]=[𝑝] by symmetry of Σ-𝜂. Hence the two maps are inverse bijections.
Use the notation and hypotheses of theorem 27.21(2). The local product variable 𝑥 is distinct from the context variable 𝑦. Moreover, scoping gives FV(𝑐)⊆dom(Γ0), while 𝑥∉dom(Γ0); hence 𝑥∉FV(𝑐).
Choose all other displayed binders away from 𝑦 and FV(𝑐). The abstraction clause of capture-avoiding substitution then applies without freshening: Λ(𝑏)[𝑐/𝑦]=(𝜆(𝑥:𝐴).𝑏)[𝑐/𝑦]=𝜆(𝑥:𝐴[𝑐/𝑦]).𝑏[𝑐/𝑦]=Λ(𝑏[𝑐/𝑦]). The condition 𝑥≠𝑦 ensures that substitution passes through rather than replacing the binder, and 𝑥∉FV(𝑐) ensures that the inserted term is not captured by that binder.
For evaluation, weakening changes the derivation of 𝑓 but not its raw expression. The application clause gives 𝐸(𝑓)[𝑐/𝑦]=(𝑓𝑥)[𝑐/𝑦]=𝑓[𝑐/𝑦](𝑥[𝑐/𝑦])=𝑓[𝑐/𝑦]𝑥=𝐸(𝑓[𝑐/𝑦]). The third line uses 𝑥≠𝑦. The condition 𝑥∉FV(𝑐) is what makes the substituted context still extend by the same fresh declaration 𝑥:𝐴[𝑐/𝑦], and it is also the side condition for the substitution-composition identity identifying all dependent result fibers. Thus the equalities are literal equalities of clean raw displays and therefore equalities of judgmental classes.
Let 𝑈Γ:Tm(Γ,𝟏)→{∗} be the unique map 𝑈Γ([𝑎])=∗, with inverse 𝑉Γ(∗)=[⋆]. Under a context substitution [𝑐/𝑦]:Γ→Γ[𝑐/𝑦], term substitution defines 𝑆𝑐:Tm(Γ,𝟏)⟶Tm(Γ[𝑐/𝑦],𝟏),𝑆𝑐([𝑎])=[𝑎[𝑐/𝑦]]. This is well defined because structural substitution preserves term equality. The analogue of theorem 27.21(2) is the commutative square Tm(Γ,𝟏)𝑈Γ⟶{∗}↓𝑆𝑐↓idTm(Γ[𝑐/𝑦],𝟏)𝑈Γ[𝑐/𝑦]←←←←←←←←←←←→{∗}. Indeed, the two composites send a class [𝑎] respectively to [𝑎]⟼∗⟼∗and[𝑎]⟼[𝑎[𝑐/𝑦]]⟼∗. They are the same unique map.
The inverse maps commute as well. From the singleton, the two composites are ∗⟼[⋆]⟼[⋆[𝑐/𝑦]]and∗⟼∗⟼[⋆]. The nullary-operator clause of substitution gives ⋆[𝑐/𝑦]=⋆, so both return [⋆]. Thus the singleton bijection is natural under context substitution in both directions.
Take the assumed judgment Γ⊢𝑃𝗍𝗒𝗉𝖾 as the formation rule. The introduction operation is Γ,𝑥:𝐴⊢𝑏:𝐵Γ⊢Λ′(𝑏):𝑃. For elimination, weaken 𝑓:𝑃 to Γ,𝑥:𝐴, apply 𝐸′, and then substitute the argument:
Γ⊢𝑎:𝐴Γ,𝑥:𝐴⊢𝐸′(𝑓):𝐵
Γ⊢𝐸′(𝑓)[𝑎/𝑥]:𝐵[𝑎/𝑥]
Subst
Define the resulting raw operation by 𝑓𝑎:=𝐸′(𝑓)[𝑎/𝑥].
For beta, start with the inverse equation in the generic context, 𝐸′(Λ′(𝑏))≡𝑏:𝐵. Substituting 𝑎 for 𝑥 in this equality gives 𝐸′(Λ′(𝑏))[𝑎/𝑥]≡𝑏[𝑎/𝑥]:𝐵[𝑎/𝑥]. The left side is Λ′(𝑏)𝑎 by definition, so this is the beta rule. Commutation of the operations with substitution ensures that this expression is independent of the chosen derivation representatives and fresh displays.
For eta, the second inverse equation says Λ′(𝐸′(𝑓))≡𝑓:𝑃. After symmetry, 𝑓≡Λ′(𝐸′(𝑓)):𝑃, which is eta, since 𝐸′(𝑓) is the generic application 𝑓𝑥.
Equality preservation by Λ′ gives introduction congruence directly: 𝑏≡𝑏′:𝐵⟹Λ′(𝑏)≡Λ′(𝑏′):𝑃. For elimination congruence, suppose 𝑓≡𝑓′:𝑃 and 𝑎≡𝑎′:𝐴. Equality preservation by 𝐸′ gives, in Γ,𝑥:𝐴, 𝐸′(𝑓)≡𝐸′(𝑓′):𝐵. Ordinary substitution with 𝑎 yields 𝐸′(𝑓)[𝑎/𝑥]≡𝐸′(𝑓′)[𝑎/𝑥]:𝐵[𝑎/𝑥]. Independently, Subst-Eq-Tm applied to 𝑎≡𝑎′:𝐴 and the term 𝐸′(𝑓′) gives 𝐸′(𝑓′)[𝑎/𝑥]≡𝐸′(𝑓′)[𝑎′/𝑥]:𝐵[𝑎/𝑥]. Transitivity produces 𝑓𝑎≡𝑓′𝑎′:𝐵[𝑎/𝑥], with the natural type 𝐵[𝑎′/𝑥] of the right side converted to the common fiber by equal substitution. These are exactly the fixed-family 𝜆-eq and app-eq rules. Hence the internal bijection data reconstruct formation, introduction, elimination, beta, eta, and congruence.
Let 𝑦:𝐶0 be any declaration of Γ, let Γ0⊢𝑐:𝐶0, and choose the local binders 𝑥,𝑝,𝑞,𝑟 outside {𝑦}∪FV(𝑐). Write 𝐿 and 𝑅 for the left and right associated sum types in example 27.26. The fully annotated first map has the form Θ=𝜆(𝑞:𝐿).(𝗉𝗋1(𝗉𝗋1(𝑞)),(𝗉𝗋2(𝗉𝗋1(𝑞)),𝗉𝗋2(𝑞))). Applying the operator clauses of definition 26.10 from the outside in gives Θ[𝑐/𝑦]=𝜆(𝑞:𝐿[𝑐/𝑦]).(𝗉𝗋1(𝗉𝗋1(𝑞)),(𝗉𝗋2(𝗉𝗋1(𝑞)),𝗉𝗋2(𝑞)))=Θ𝐴[𝑐/𝑦],𝐵[𝑐/𝑦],𝐶[𝑐/𝑦]. No occurrence of 𝑞 is substituted, and no occurrence of 𝑐 is captured, by the chosen freshness. Consequently, for every argument, (Θ𝑠)[𝑐/𝑦]=Θ[𝑐/𝑦]𝑠[𝑐/𝑦]=Θ𝐴[𝑐/𝑦],𝐵[𝑐/𝑦],𝐶[𝑐/𝑦]𝑠[𝑐/𝑦].
The same literal recursion for Ξ=𝜆(𝑟:𝑅).((𝗉𝗋1(𝑟),𝗉𝗋1(𝗉𝗋2(𝑟))),𝗉𝗋2(𝗉𝗋2(𝑟))) gives Ξ[𝑐/𝑦]=Ξ𝐴[𝑐/𝑦],𝐵[𝑐/𝑦],𝐶[𝑐/𝑦],(Ξ𝑡)[𝑐/𝑦]=Ξ[𝑐/𝑦]𝑡[𝑐/𝑦]. Substitution in the dependent annotations and result fibers is governed by the same binder clause; the identity (𝐷[𝑎/𝑥])[𝑐/𝑦]=𝐷[𝑐/𝑦][𝑎[𝑐/𝑦]/𝑥] follows from the freshness assumptions. Thus both comparison maps commute with substitution in an arbitrary variable of Γ, and hence in every such variable.
For the sum unit law, define 𝐹:=𝜆(𝑝:∑𝑥:𝐴𝟏).𝗉𝗋1(𝑝):(∑𝑥:𝐴𝟏)→𝐴,𝐺:=𝜆(𝑎:𝐴).(𝑎,⋆):𝐴→∑𝑥:𝐴𝟏. For 𝑎:𝐴, beta for the first projection gives 𝐹(𝐺𝑎)≡𝗉𝗋1((𝑎,⋆))≡𝑎. For 𝑝:∑𝑥:𝐴𝟏, unit eta gives 𝗉𝗋2(𝑝)≡⋆:𝟏; pair congruence and sum eta give 𝑝≡(𝗉𝗋1(𝑝),𝗉𝗋2(𝑝))≡(𝗉𝗋1(𝑝),⋆)=𝐺(𝐹𝑝). After symmetry this is the required round trip 𝐺(𝐹𝑝)≡𝑝. This isomorphism uses exactly Σ-eta and 𝟏-eta.
For the product unit law, set 𝐵⋆:=𝐵[⋆/𝑥] and define 𝐻:=𝜆(𝑓:∏𝑥:𝟏𝐵).𝑓⋆:(∏𝑥:𝟏𝐵)→𝐵⋆. For 𝑏:𝐵⋆, weaken 𝑏 to Γ,𝑥:𝟏. Unit eta gives 𝑥≡⋆:𝟏, so equal substitution in 𝐵, followed by symmetry, gives 𝐵⋆≡𝐵𝗍𝗒𝗉𝖾inΓ,𝑥:𝟏. Convert the unchanged raw term 𝑏 along this equality; call the resulting term ¯𝑏𝑥:𝐵. Define 𝐾:=𝜆(𝑏:𝐵⋆).𝜆(𝑥:𝟏).¯𝑏𝑥:𝐵⋆→∏𝑥:𝟏𝐵. Because conversion changes typing derivations, not raw terms, beta at ⋆ gives 𝐻(𝐾𝑏)≡¯𝑏⋆=𝑏:𝐵⋆.
For 𝑓:∏𝑥:𝟏𝐵, unit eta in the generic context gives 𝑥≡⋆. Application congruence therefore identifies 𝑓𝑥 with the converted term 𝑓⋆:𝐵. Abstraction congruence and product eta give 𝐾(𝐻𝑓)≡𝜆(𝑥:𝟏).𝑓𝑥≡𝑓. Thus the second isomorphism uses 𝟏-eta to compare the arguments and Π-eta to remove the rebuilt abstraction. The two laws use no other eta principles.
Take 𝐵 independent of 𝑥 and 𝐶 independent of the pair variable 𝑝 in example 27.25. Then the two types reduce to (𝐴×𝐵)→𝐶and𝐴→(𝐵→𝐶). The comparison maps specialize literally to 𝖼𝗎𝗋𝗋𝗒:=𝜆(𝑓:(𝐴×𝐵)→𝐶).𝜆(𝑥:𝐴).𝜆(𝑦:𝐵).𝑓((𝑥,𝑦)),𝗎𝗇𝖼𝗎𝗋𝗋𝗒:=𝜆(𝑔:𝐴→(𝐵→𝐶)).𝜆(𝑝:𝐴×𝐵).𝑔(𝗉𝗋1(𝑝))(𝗉𝗋2(𝑝)), which are exactly the classical simply typed combinators displayed in the exercise. No dependent conversion remains because every substituted codomain is constant.
For 𝑓:(𝐴×𝐵)→𝐶, beta reduction gives 𝗎𝗇𝖼𝗎𝗋𝗋𝗒(𝖼𝗎𝗋𝗋𝗒𝑓)≡𝜆(𝑝:𝐴×𝐵).𝑓((𝗉𝗋1(𝑝),𝗉𝗋2(𝑝)))≡𝜆(𝑝:𝐴×𝐵).𝑓𝑝≡𝑓. The middle step uses symmetry of product eta under application, and the last uses function eta. For 𝑔:𝐴→(𝐵→𝐶), 𝖼𝗎𝗋𝗋𝗒(𝗎𝗇𝖼𝗎𝗋𝗋𝗒𝑔)≡𝜆(𝑥:𝐴).𝜆(𝑦:𝐵).𝑔(𝗉𝗋1((𝑥,𝑦)))(𝗉𝗋2((𝑥,𝑦)))≡𝜆(𝑥:𝐴).𝜆(𝑦:𝐵).𝑔𝑥𝑦≡𝑔. The second step uses the two projection beta rules; the last uses function eta first at 𝐵→𝐶 and then at 𝐴→(𝐵→𝐶). Hence the specialization is a definitional isomorphism, not merely a set-theoretic bijection.