Lectures onType Theory
ch:algebraic-subtyping: ch:algebraic-subtyping
appendix sectionsolutions

ch:algebraic-subtyping: ch:algebraic-subtyping

Exercise 19.1.

The outer arrow reverses its domain, and the inner arrow reverses once more. Thus α in αBool is positive overall, while the final occurrence in Unitα is positive. An upper-bound elimination changes negative occurrences only, so it changes neither of these two occurrences in this whole positive type.

Exercise 19.2.

For Paα, map a constrained instance T, with ρ(P)aT, to the same image. Join introduction gives Taρ(P)T, while the bound and reflexivity give ρ(P)TaT by join elimination. Thus the two types are equivalent by mutual subtyping, not literal syntax. Conversely, for an arbitrary eliminated instance with image T, instantiate the constrained scheme at ρ(P)T. This image satisfies the lower bound. Positive occurrences agree with the eliminated instance, while Taρ(P)T compares the negative occurrences in the required direction. Structural induction on the polar scheme, reversing the comparison in arrow domains, proves equality of the two upward-closed instance sets.

Exercise 19.3.

If the two branch variables have output types α,β, the body has αβ. A polar scheme is Boolαβ(α+β+). Instantiating both variables with Int gives the ordinary type ending in Int; instantiating both with Bool gives the one ending in Bool. Neither ordinary arrow type is an instance of the other when the ground types are incomparable.

Exercise 19.4.

Polar bisubstitution and principal polar schemes belong only to MLsub. Boolean complement and characteristic Boolean homomorphisms belong only to BAS0. Guarded equi-recursion belongs to both, but in MLsub it supports polar automata and biunification, whereas in BAS0 the contractiveness condition supports the tagged-value Boolean semantics.

Exercise 19.5.

Arrow decomposition yields IntBoolaα and βaStringγ. Lower elimination gives α+=(IntBool)α and α=α. Upper elimination gives β=(Stringγ)β and β+=β. The untouched faces record exactly the direction of flow.

Exercise 19.6.

Assign α= and β=. Both directed constraints hold, but equality would require =IntBool and =Stringγ. Equality’s solution obtained by making those identifications is recovered by instantiating the free polar faces of the biunification result at the same types.

Exercise 19.8.

A scheme translation must also map the negative environment Δ and prove that source instantiation corresponds to target substitution; the proposed equations specify neither. The Boolean equation T¬T=1 is formed in BAS0. Its source counterpart is not formed because MLsub has no complement constructor. Hence the proposed map cannot transport the MLsub principality theorem.

Search the book

Type to search the local edition.