Lectures onType Theory
ch:cdle-cedille: CDLE and Cedille
appendix sectionsolutions

ch:cdle-cedille: CDLE and Cedille

exercise 96.1.

Erasing implicit abstractions and applications gives erase(sucI(n))=λz.λs.s(erase(n)zs). Also erase(sucC(n.1))=λz.λs.s(erase(n.1)zs)=βηλz.λs.s(erase(n)zs). Thus CDLE-Isect-I applies. Two successors erase to λz.λs.s(sz) after beta reduction; every intersection and projection annotation disappears.

exercise 96.2.

Let the function view be h:=λx.d.1(c.1x):AC. The equality view follows from the two cast equality proofs and transitivity of erased beta-eta equality. Pair them as [h,p]:Cast(A,C). The erasure calculation is erase(h)=λx.(λy.y)((λz.z)x)λx.(λy.y)xλx.x. Hence composition remains an identity-erasing cast.

exercise 96.3.

The forgetful cast has function view i:Vec(A,n)List(A) with erase(i)=λx.x. A copying conversion k has the same function type but erases to a case recursor. On a two-element vector, i erases to the original constructor tree, while k performs two case steps and allocates two list constructors. Thus erase(k)βηλx.x as open functions. The equality view required by Cast is the failed premise; agreement on this one closed input would not repair it.

exercise 96.4.

zeroC and zeroI both erase to λz.λs.z, so their intersection introduces zero. For n:Nat, the two successor components have the common erasure erase(sucC(n.1))=erase(sucI(n))=λz.λs.s(erase(n)zs). Their intersection therefore introduces suc(n). Instantiating n.2 with the Church-subject motive P(m)m+0=m gives the result at n.1. The zero computation is erased beta reduction of the stored Church program; the occurrences identifying m+0 with m in its classifier are internal equality rewrites and do not add runtime steps.

exercise 96.5.

For intersection introduction, the common erased class lies in the first candidate and, by the second premise, in the dependent fiber; hence it lies in their intersection. For equality introduction, beta-eta equality of the two endpoints makes the equality interpretation the greatest candidate, which contains the arbitrary erasure of β{u}. If t:X:.X were closed, soundness instantiated at the empty candidate would require erase(t), a contradiction.

For Top={λx.xλx.x}, the rule types β{Ω}:Top because the endpoints agree, regardless of the erased witness. Its interpretation is the greatest candidate, not the empty candidate chosen for X above, so this nonnormalizing inhabitant does not affect the consistency argument.

Search the book

Type to search the local edition.