Lectures onType Theory
ch:datatype-declarations: ch:datatype-declarations
appendix sectionsolutions

ch:datatype-declarations: ch:datatype-declarations

Exercise 122.1.

The complete state trace is (+,open): (NTree(A))N,(,blocked): NTree(A),(,blocked): Tree(A). The last state follows because the inner arrow preserves its ambient sign in its codomain. A block-family application is admitted only at (+,open), so the occurrence is rejected. The inner domain N is separately checked at (+,blocked) and passes; the outer codomain N is checked at (+,open) and also passes. The family occurrence is therefore the unique failing subterm.

Exercise 122.2.

The single parameter binder has type Ui:Ui+1, so lev(Δp)=i+1. The empty index telescopes contribute 0; the constructor telescopes and family declarations contribute i; and the motives contribute k. Therefore L=max(i+1,0,i,i,k)=max(i+1,k). Omitting Δp would instead produce max(i,k). For ki, that incorrect maximum is i, although the binder A:Ui already forces the eliminator package into at least Ui+1.

Exercise 122.3.

Take PT:(A:Ui)Tree(A)Uk,PF:(A:Ui)Forest(A)Uk. The four methods are bleaf:(a:A)PT(A,leaf(a)),bnode:(f:Forest(A))PF(A,f)PT(A,node(f)),bempty:PF(A,empty),bmore:(t:Tree(A))PT(A,t)(f:Forest(A))PF(A,f)PF(A,more(t,f)). The requested computation is the annotated chain indF(more(leaf(a),empty))0Blockcompbmore(leaf(a))(indT(leaf(a)))(empty)(indF(empty))Blockcompbmore(leaf(a))(bleaf(a))(empty)(indF(empty))Blockcompbmore(leaf(a))(bleaf(a))(empty)(bempty). The second line applies Block-comp to the outer forest constructor. The third line contracts the tree child’s computation, and the fourth contracts the forest child’s computation. Both recursive children have supplied exactly one induction hypothesis.

Exercise 122.4.

For (DN)N, the outer domain changes (+,open) to (,blocked). The inner domain changes that state to (+,blocked), where the occurrence of D is rejected. Thus two sign reversals do not restore strict positivity: the ancestry flag remembers that the occurrence lies under a function domain. For ND, the domain N is checked at (,blocked), while the codomain D is checked at the original (+,open); both pass. The first type would require a nested or functorial positivity argument not present in the regular Timpl-data card.

Search the book

Type to search the local edition.