Lectures onType Theory
ch:very-dependent-functions: very-dependent functions
appendix sectionsolutions

ch:very-dependent-functions: very-dependent functions

exercise 95.1.

At 0, the restriction is empty and the range PER is equality on naturals. At 1, the restriction contains only f(0); after choosing a natural n0, the range is the finite PER on values below n0+1. At 2, the restriction contains f(0) and f(1); after values n0,n1 have been validated, the range is the finite PER below n0+n1+1. Each definition uses only PERs at strict predecessors, so induction on 0<1<2 constructs them in that order.

exercise 95.2.

With 1<0, label 1 has no predecessor. Its original range reads f(0), but 01, so the predecessor-function context contains no such application and formation fails. An accepted reversed family is B[f,1]=N and B[f,0]=Fin(f(1)+1): the only dependency at 0 now reads its strict predecessor 1.

exercise 95.3.

Place eq:RRBool in M(R). Opening independently packed o1,o2:Object(M) gives R1,s1,m1 and R2,s2,m2. The receiver method m1.eq expects two R1 values. The application m1.eqs1s2 is ill typed because s2:R2; it would require R1R2, which existential unpacking does not provide.

exercise 95.4.

Take ordered labels R<get<set<law and the VDF whose ranges are respectively Ui, RZ, RZR, and the equation r,i.get(set(r,i))=i. The predecessor sets read by the ranges are , {R}, {R}, and {R,get,set}. If law is placed before set, its range still mentions set, which is no longer a strict predecessor; the fourth premise of VDF-F fails at that label.

exercise 95.5.

Append color:Color and recolor:RColorR after the Point fields. Restricting an extended record to the old labels preserves every old predecessor restriction, so proposition 95.7 gives the Point view. A wrapper applies old set to the position component and copies the color branch; its proof fields are recomputed from the old law and reflexivity of the copied color. If a new field is inserted before law and the law’s range is defined over all predecessors, that range changes. The old law proof then has the old type, so merely copying it is a counterexample to the wrapper calculation.

Search the book

Type to search the local edition.