Exercise 80.1.
Interpretation gives [[𝐷𝖵𝖾𝖼(𝐴)(𝟢)]](𝑋)≡𝟏,[[𝐷𝖵𝖾𝖼(𝐴)(𝗌𝗎𝖼(𝑛))]](𝑋)≡𝐴×𝑋(𝑛). Hence the two roll maps have types 𝗋𝗈𝗅𝗅𝟢:𝟏→𝖬𝗎(𝐷)(𝟢),𝗋𝗈𝗅𝗅𝗌𝗎𝖼(𝑛):𝐴×𝖬𝗎(𝐷)(𝑛)→𝖬𝗎(𝐷)(𝗌𝗎𝖼(𝑛)). They are the curried vector constructors after Unit introduction and product currying. For 𝑃(𝑛,𝑥𝑠):=ℕ, the zero method ignores its layer and its unit 𝖠𝗅𝗅 witness and returns 𝟢. At successor index, write the layer as (𝑎,𝑥𝑠) and its 𝖠𝗅𝗅 witness as ( ⋆,𝑘), where 𝑘 :ℕ is the result for 𝑥𝑠. The successor method returns 𝗌𝗎𝖼(𝑘). Thus description induction computes the element count, or length, which agrees with the vector index. The generic constructor-node size of construction 80.12 would instead return 𝗌𝗎𝖼(𝑛).
Exercise 80.3.
For the cons branch, 𝑓 :ℕ →ℕ is successor. At output 𝑚, the Σ𝑓 clause interprets as ∑𝑛:ℕ𝖨𝖽ℕ(𝗌𝗎𝖼(𝑛),𝑚)×(𝐴×𝖬𝗎(𝐷)(𝑛)). A witness contributes only together with 𝑝 :𝗌𝗎𝖼(𝑛) =𝑚. At 𝑚 =𝗌𝗎𝖼(𝑘), successor injectivity converts 𝑝 to 𝑛 =𝑘; transport reduces the payload to 𝐴 ×𝖬𝗎(𝐷)(𝑘). Conversely 𝑛 =𝑘 with reflexivity constructs that branch. Thus the fiber is equivalent to the regular normal form 𝖪(𝐴) ×𝖷(𝑘), while the principal code still records the result-index equation explicitly.
Exercise 80.2.
For 𝑓 :𝐴 →𝐵, take carrier 𝖫𝗂𝗌𝗍(𝐵) and algebra 𝛼(𝗂𝗇𝗅(⋆)):=𝗇𝗂𝗅,𝛼(𝗂𝗇𝗋((𝑎,𝑦𝑠))):=𝖼𝗈𝗇𝗌(𝑓(𝑎),𝑦𝑠). Equation (80.2) gives the usual nil and cons map equations. For identity, induct on 𝑥𝑠. At nil, the fold equation gives 𝗆𝖺𝗉(𝗂𝖽,𝗇𝗂𝗅) =𝗇𝗂𝗅. At cons, 𝗆𝖺𝗉(𝗂𝖽,𝖼𝗈𝗇𝗌(𝑎,𝑥𝑠))=𝖼𝗈𝗇𝗌(𝑎,𝗆𝖺𝗉(𝗂𝖽,𝑥𝑠))=𝖼𝗈𝗇𝗌(𝑎,𝑥𝑠), where constructor congruence uses the induction hypothesis. Fold fusion with ℎ =𝗂𝖽 alone would only compare the same map fold with itself.
Exercise 80.4.
Add 𝗉𝗂(𝐴,𝐸) :𝖣𝖾𝗌𝖼𝑖(𝐼) for 𝐴 :U𝑖 and 𝐸 :𝐴 →𝖣𝖾𝗌𝖼𝑖(𝐼), with [[𝗉𝗂(𝐴,𝐸)]](𝑋):=∏𝑎:𝐴[[𝐸(𝑎)]](𝑋). Every recursive occurrence remains in a codomain, hence positive. The code lies in U𝑖+1 and its interpretation in U𝑖. Traversal needs an operation (∏𝑎:𝐴𝐺(𝐵(𝑎))) →𝐺(∏𝑎:𝐴𝐵(𝑎)) for the applicative 𝐺 :U𝑖 →U𝑖 and every 𝐵 :𝐴 →U𝑖; an ordinary applicative does not provide it for infinite 𝐴. Decidable equality requires finite enumerability of 𝐴, decidable equality in every codomain, and function extensionality to turn pointwise equality into function equality.
Exercise 80.5.
For 𝑡 :𝖳𝗆(𝐵 ::Γ,𝐶), the left side computes to 𝗅𝖺𝗆(𝗋𝖾𝗇(𝗅𝗂𝖿𝗍[𝐵](𝜌),𝗌𝗎𝖻(𝗅𝗂𝖿𝗍[𝐵](𝜎),𝑡))). The induction hypothesis turns its body into substitution by 𝗋𝗉𝗈𝗌𝗍(𝗅𝗂𝖿𝗍[𝐵](𝜌),𝗅𝗂𝖿𝗍[𝐵](𝜎)). The right side computes to substitution by 𝗅𝗂𝖿𝗍[𝐵](𝗋𝗉𝗈𝗌𝗍(𝜌,𝜎)). On the newest variable, both environments return 𝗏𝖺𝗋(𝗏𝗓). On an older variable 𝗏𝗌(𝑥), both return the weakening of 𝗋𝖾𝗇(𝜌,𝜎(𝑥)); renaming composition proves the equality for the first expression. Environment congruence identifies the bodies, and congruence of 𝗅𝖺𝗆 closes the case. No equality between environment functions is used.
Exercise 80.6.
The mirror algebra fixes a leaf and exchanges the two recursively folded children at a fork. The counting algebra sends a leaf to 1 and a fork layer (𝑚,𝑛) to 1 +𝑚 +𝑛. In the leaf summand the fusion premise is 1 =1. In the fork summand it is 1 +𝑚 +𝑛 =1 +𝑛 +𝑚, by commutativity of natural-number addition. Fold fusion therefore gives 𝗌𝗂𝗓𝖾(𝗆𝗂𝗋𝗋𝗈𝗋(𝑡)) =𝗌𝗂𝗓𝖾(𝑡) for every tree 𝑡.
Exercise 80.7.
At 𝖼𝗈𝗇(𝑢), the left side of renaming after substitution expands to a constructor whose recursive-position map is 𝗋𝖾𝗇𝐹(𝗅𝗂𝖿𝗍Ξ(𝜌),𝗌𝗎𝖻𝐹(𝗅𝗂𝖿𝗍Ξ(𝜎),𝑥)). The free-syntax induction hypothesis identifies this term with substitution by 𝗋𝗉𝗈𝗌𝗍(𝗅𝗂𝖿𝗍Ξ(𝜌),𝗅𝗂𝖿𝗍Ξ(𝜎)). The lift lemma identifies that environment pointwise with 𝗅𝗂𝖿𝗍Ξ(𝗋𝗉𝗈𝗌𝗍(𝜌,𝜎)). Layer-action congruence applies these paths at every 𝗋𝖾𝖼(Ξ,𝐵) position of 𝑢, and constructor congruence closes the case. For 𝗅𝖺𝗆(𝑡) the code stores Ξ =[𝐵], so the sole premise is exactly the body equation with both environments lifted through the new variable of type 𝐵.
Exercise 80.8.
The Sigma clause first compares the tags 𝖿𝖺𝗅𝗌𝖾 and 𝗍𝗋𝗎𝖾. Boolean equality returns their disequality, so the procedure rejects before inspecting ⋆, 𝑙, or 𝑟. If equality data omit the decision procedure for 𝟐, the algorithm cannot execute this first tag comparison. In particular it cannot obtain either a disequality for immediate rejection or a path 𝑝 :𝑏 =𝑏′ along which to transport the second payload into the branch code 𝐹(𝑏).