Exercise 21.1.
The first pair has distinct ordinary heads, so it is algorithmically disjoint. For the products, the first coordinates have distinct ordinary heads, so the left product rule proves disjointness even though the second coordinates are both 𝖨𝗇𝗍. Two arrows with the same result are rejected because the arrow clause compares only results. If their domains are 𝐷1,𝐷2 and their common result is 𝑅, the raw type (𝐷1&𝐷2) →𝑅 is a common supertype. The domain intersection need not be well formed. There is no common supertype in either accepted case.
Exercise 21.2.
Without the disjointness premises of I-Merge and WF-&, synthesis gives 1,,2 :𝖨𝗇𝗍&𝖨𝗇𝗍 with target (1,2). The two checking derivations end in I-Sub, using 𝑐1=𝜆𝑝.𝜋1𝑝,𝑐2=𝜆𝑝.𝜋2𝑝. Their targets are 𝑐1(1,2) ⟼1 and 𝑐2(1,2) ⟼2. Both are well typed; their different values are the coherence failure.
Exercise 21.3.
Let 𝑋 =𝖨𝗇𝗍, 𝑌 =𝖨𝗇𝗍 →𝖨𝗇𝗍, and 𝐴 =𝑋&𝑌. Let 𝑍 =𝖨𝗇𝗍 ×𝖨𝗇𝗍; then 𝐴 ∗𝑍. Write 𝑐𝑋 :𝑋 →𝑋 and 𝑐𝑌 :𝑌 →𝑌 for the raw coercions generated by S-Int and S-Arr, and put 𝑑𝑋=𝜆𝑞.𝑐𝑋(𝜋1𝑞),𝑑𝑌=𝜆𝑞.𝑐𝑌(𝜋2𝑞),𝑐𝐴=𝜆𝑞.(𝑑𝑋𝑞,𝑑𝑌𝑞). These are the rule-generated coercions for 𝐴 <:𝑋, 𝐴 <:𝑌, and 𝐴 <:𝐴. For (𝐴&𝑍) <:𝐴, the forbidden direct left rule gives 𝜆𝑝.𝑐𝐴(𝜋1𝑝). Rule S-&R, followed by the permitted ordinary projections to 𝑋 and 𝑌, gives 𝜆𝑝.((𝜆𝑞.𝑑𝑋(𝜋1𝑞))𝑝,(𝜆𝑞.𝑑𝑌(𝜋1𝑞))𝑝). Both have target type (|𝐴| ×|𝑍|) →|𝐴|, but they are not alpha equal. They do beta-normalize to the same projection pair; this does not rescue the chapter’s raw-syntax uniqueness claim. Thus coercion typing still holds; lemma 21.10 is the first metatheorem in the chapter to fail, and raw elaboration coherence subsequently fails with it.
Exercise 21.4.
From (𝐴&𝐵)&𝐶, the coercion to 𝐵 is 𝜆𝑝.𝜋2(𝜋1𝑝). From 𝐴&(𝐵&𝐶), it is 𝜆𝑝.𝜋1(𝜋2𝑝). Their domains are respectively (|𝐴| ×|𝐵|) ×|𝐶| and |𝐴| ×(|𝐵| ×|𝐶|). Coherence compares two derivations of one fixed source judgment; it does not identify distinct, merely isomorphic source types or insert a product associator.
Exercise 21.5.
The merge synthesizes 𝖨𝗇𝗍&(𝖨𝗇𝗍 →𝖨𝗇𝗍) and elaborates to (1,𝜆𝑥.𝑥). Checking the annotated function position against 𝖨𝗇𝗍 →𝖨𝗇𝗍 inserts 𝜆𝑝.𝜋2𝑝. Application therefore elaborates to (𝜆𝑝.𝜋2𝑝)(1,𝜆𝑥.𝑥)2⟼(𝜆𝑥.𝑥)2⟼2.
Exercise 21.6.
If the result types are disjoint, inversion of any common arrow supertype would exhibit a common supertype of the results, a contradiction. Conversely, if 𝐴2 and 𝐵2 share 𝐶, then (𝐴1&𝐵1) →𝐶 is a raw common supertype of 𝐴1 →𝐴2 and 𝐵1 →𝐵2. The witness grammar is unrestricted, so this remains valid when its domain intersection is not well formed.
Exercise 21.7.
Take 𝐴=𝖨𝗇𝗍&(𝖨𝗇𝗍→𝖨𝗇𝗍),𝐵=𝖨𝗇𝗍&(𝖨𝗇𝗍×𝖨𝗇𝗍). They are incomparable: answering the function component of 𝐴, or the product component of 𝐵, is impossible from the other type. Both subtype 𝐶 =𝖨𝗇𝗍. Closed inhabitants 1,,(𝜆𝑥.𝑥) and 2,,(3,4), with the displayed component annotations, coerce to 1 and 2. Thus incomparability does not imply disjointness.
Exercise 21.8.
For an intersection target, both derivations must end in S-&R; the ordinary-target premises exclude S-&L𝑖. For an intersection source and ordinary target, two different left projections are excluded by unique contribution, and two equal projections reduce to the induction hypothesis. For equal ordinary heads, inversion forces the same one of S-Int, S-Arr, and S-Prod; distinct heads have no derivation. These are all overlapping last-rule pairs.