Exercise 121.1.
After reversing the rows, the matrix is 𝖼𝗁𝗈𝗈𝗌𝖾(𝑏,𝑛)=𝗌𝗎𝖼(𝟢),𝖼𝗁𝗈𝗈𝗌𝖾(𝗍𝗍,𝑛)=𝟢. The first row has no blocking pattern. Ordered priority therefore returns its leaf before inspecting the later constructor row. The case tree is simply 𝗅𝖾𝖺𝖿(1,𝗌𝗎𝖼(𝟢)). Its one schematic leaf equation is 𝖼𝗁𝗈𝗈𝗌𝖾(𝑏,𝑛)≡𝗌𝗎𝖼(𝟢). The two closed Boolean instances follow by substitution; no case split is needed. The first row matches every Boolean, so the later constructor row can never be the least matching row and reaches no leaf.
Exercise 121.2.
Specializing the vector column against 𝗏𝖼𝗈𝗇𝗌(𝑘,𝑎,𝑥𝑠):𝖵𝖾𝖼(𝐴,𝗌𝗎𝖼(𝑘)) generates 𝑚=𝗌𝗎𝖼(𝑘). The restricted unifier takes one solution step, producing [𝗌𝗎𝖼(𝑘)/𝑚]. Hence the index position in this branch is forced to be 𝗌𝗎𝖼(𝑘). Suppose instead that the inaccessible pattern contains the written term 𝑘. Validation then asks for the judgmental equality 𝗌𝗎𝖼(𝑘)≡𝑘, which does not hold. The useful diagnostic is therefore: “inaccessible term mismatch; forced 𝗌𝗎𝖼(𝑘), written 𝑘.” Treating the comparison as another equation would not rescue it: orienting 𝑘 =𝗌𝗎𝖼(𝑘) reaches the cycle transition of definition 78.9, because the right side contains the variable being solved.
Exercise 121.3.
Row count is not a decreasing measure. A variable row is copied into every positive branch, and a row headed by the selected constructor survives in its matching branch; the branch may consequently contain as many rows as the parent.
For the matrix whose two patterns are 𝗏𝖼𝗈𝗇𝗌(𝑘,𝑎,𝑥𝑠)and𝑧, the measure 𝜇 of lemma 121.13 is initially one: only the outer 𝗏𝖼𝗈𝗇𝗌 is a constructor node. In the 𝗏𝗇𝗂𝗅 branch the constructor row is deleted and the variable row is copied, so 𝜇 =0. In the 𝗏𝖼𝗈𝗇𝗌 branch the outer constructor is consumed; its exposed subpatterns 𝑘,𝑎,𝑥𝑠 and the copied variable pattern contain no constructor or absurd node, so again 𝜇 =0. Thus every recursive branch decreases 𝜇 strictly even though row count need not decrease. This proves the matrix-recursion part of the relative lemma; its separate hypothesis accounts for termination of each scheduled restricted-unifier call.
Exercise 121.4.
Splitting the input 𝑣 :𝖵𝖾𝖼(𝐴,𝑚) gives two branches. The 𝗏𝗇𝗂𝗅 branch solves 𝑚 =𝟢 and reaches the leaf ⋆. In the 𝗏𝖼𝗈𝗇𝗌 branch the unifier solves 𝑚 =𝗌𝗎𝖼(𝑘), but specialization deletes the sole row. The reported uncovered symbolic pattern is therefore [𝗌𝗎𝖼(𝑘)/𝑚,𝗏𝖼𝗈𝗇𝗌(𝑘,𝑎,𝑥𝑠)/𝑣],𝑎:𝐴,𝑥𝑠:𝖵𝖾𝖼(𝐴,𝑘). It is well typed, but if 𝐴:=𝖨𝖽𝟐(𝗍𝗍,𝖿𝖿), the internal no-confusion map of example 30.12 sends any candidate 𝑎 :𝐴 to 𝟎. Thus, under the separately stated consistency assumption that Timpl has no closed term of 𝟎, the symbolic pattern has no closed instance. This argument uses no canonicity theorem, and the coverage theorem itself does not establish that consistency assumption. If 𝐴:=𝟏, take 𝑘:=𝟢, 𝑎:= ⋆, and 𝑥𝑠:=𝗏𝗇𝗂𝗅. Then 𝗏𝖼𝗈𝗇𝗌(𝟢, ⋆,𝗏𝗇𝗂𝗅) :𝖵𝖾𝖼(𝟏,𝗌𝗎𝖼(𝟢)) is a closed uncovered input.
Exercise 121.5.
The leftmost tree first splits 𝑥. In each resulting branch the second column blocks. Put T𝑡:=𝗌𝗉𝗅𝗂𝗍(𝑦,{𝗍𝗍↦([𝗍𝗍/𝑦],𝗅𝖾𝖺𝖿(1,𝟢)),𝖿𝖿↦([𝖿𝖿/𝑦],𝗅𝖾𝖺𝖿(2,𝗌𝗎𝖼(𝟢)))}),T𝑓:=𝗌𝗉𝗅𝗂𝗍(𝑦,{𝗍𝗍↦([𝗍𝗍/𝑦],𝗅𝖾𝖺𝖿(3,𝗌𝗎𝖼(𝗌𝗎𝖼(𝟢)))),𝖿𝖿↦([𝖿𝖿/𝑦],𝗅𝖾𝖺𝖿(2,𝗌𝗎𝖼(𝟢)))}). The complete tree is 𝗌𝗉𝗅𝗂𝗍(𝑥,{𝗍𝗍↦([𝗍𝗍/𝑥],T𝑡),𝖿𝖿↦([𝖿𝖿/𝑥],T𝑓)}). Thus the judgmental leaf equations are 𝑔(𝗍𝗍,𝗍𝗍)≡𝟢,𝑔(𝗍𝗍,𝖿𝖿)≡𝗌𝗎𝖼(𝟢),𝑔(𝖿𝖿,𝗍𝗍)≡𝗌𝗎𝖼(𝗌𝗎𝖼(𝟢)),𝑔(𝖿𝖿,𝖿𝖿)≡𝗌𝗎𝖼(𝟢). For example, let 𝑁(𝑥,𝑦):=¬(𝖨𝖽𝟐(𝑥,𝗍𝗍)×𝖨𝖽𝟐(𝑦,𝗍𝗍))׬𝖨𝖽𝟐(𝑦,𝖿𝖿). Boolean case analysis proves 𝑁(𝑥,𝑦) →𝖨𝖽ℕ(𝑔(𝑥,𝑦),𝗌𝗎𝖼(𝗌𝗎𝖼(𝟢))): the premise eliminates the (𝗍𝗍,𝗍𝗍) leaf by its first conjunct and both 𝑦 =𝖿𝖿 leaves by its second, leaving only (𝖿𝖿,𝗍𝗍). In contrast, the unconditional equation 𝑔(𝑥,𝑦) =𝗌𝗎𝖼(𝗌𝗎𝖼(𝟢)) suggested by the third source row is false, for instance at (𝗍𝗍,𝗍𝗍).
Exercise 121.6.
Write the two vector inputs as 𝑥 :𝖵𝖾𝖼(𝐴,𝑛) and 𝑦 :𝖵𝖾𝖼(𝐵,𝑛). The complete frontier is 𝐴,𝐵,𝐶,𝑓,𝑛,𝑥,𝑦; only 𝑥 and then 𝑦 block. Splitting 𝑥 gives 𝜎0=[𝟢/𝑛,𝗏𝗇𝗂𝗅/𝑥],𝜎𝑠=[𝗌𝗎𝖼(𝑟)/𝑛,𝗏𝖼𝗈𝗇𝗌(𝑟,𝑎,𝑎𝑠)/𝑥]. In the first branch 𝑦 :𝖵𝖾𝖼(𝐵,𝟢). The empty-constructor constraint for the second split is (𝟢;𝑦)≡𝑞:ℕ;𝖵𝖾𝖼(𝐵,𝑞)(𝟢;𝗏𝗇𝗂𝗅). Its index component 𝟢 =𝟢 is positive because the injectivity transition reduces equal nullary constructor heads to the empty constructor telescope; no reflexive-equation deletion is used. The element component then assigns 𝑦 :=𝗏𝗇𝗂𝗅, giving 𝜏00 =[𝗏𝗇𝗂𝗅/𝑦]. A 𝗏𝖼𝗈𝗇𝗌(𝑞,𝑏,𝑏𝑠) alternative gives 𝟢 =𝗌𝗎𝖼(𝑞) and is removed by a conflict certificate.
In the successor branch 𝑦 :𝖵𝖾𝖼(𝐵,𝗌𝗎𝖼(𝑟)). Its empty alternative gives 𝗌𝗎𝖼(𝑟) =𝟢 and is negative. Its successor alternative gives 𝗌𝗎𝖼(𝑟) =𝗌𝗎𝖼(𝑞); injectivity and solution yield 𝑞 :=𝑟. Here 𝑟 is an old frontier variable and 𝑞 is fresh from the second constructor telescope, so the canonical variable–variable orientation preserves 𝑟 and eliminates 𝑞. The forced-image matcher then consumes the freshly created 𝑞-cell: applying 𝑞 :=𝑟 compares its dot .𝑟 with the forced image 𝑟, discharging 𝑟 ≡𝑟. This gives 𝜏𝑠𝑠=[𝑟/𝑞,𝗏𝖼𝗈𝗇𝗌(𝑟,𝑏,𝑏𝑠)/𝑦]. Put 𝑒𝑠:=𝗏𝖼𝗈𝗇𝗌(𝑟,𝑓𝑎𝑏,𝗓𝗂𝗉𝖶𝗂𝗍𝗁(𝐴,𝐵,𝐶,𝑓,𝑟,𝑎𝑠,𝑏𝑠)). Omitting the two negative branches but retaining their certificates, the typed tree is as follows. Each split is keyed by a constructor name; its declared constructor telescope binds the variables used in that branch. 𝗌𝗉𝗅𝗂𝗍(𝑥,{𝗏𝗇𝗂𝗅↦(𝜎0,𝗌𝗉𝗅𝗂𝗍(𝑦,{𝗏𝗇𝗂𝗅↦(𝜏00,𝗅𝖾𝖺𝖿(1,𝗏𝗇𝗂𝗅))})),𝗏𝖼𝗈𝗇𝗌↦(𝜎𝑠,𝗌𝗉𝗅𝗂𝗍(𝑦,{𝗏𝖼𝗈𝗇𝗌↦(𝜏𝑠𝑠,𝗅𝖾𝖺𝖿(2,𝑒𝑠))}))}). Its judgmental leaf equations are the two written source clauses: 𝗓𝗂𝗉𝖶𝗂𝗍𝗁(𝐴,𝐵,𝐶,𝑓,𝟢,𝗏𝗇𝗂𝗅,𝗏𝗇𝗂𝗅)≡𝗏𝗇𝗂𝗅,𝗓𝗂𝗉𝖶𝗂𝗍𝗁(𝐴,𝐵,𝐶,𝑓,𝗌𝗎𝖼(𝑟),𝗏𝖼𝗈𝗇𝗌(𝑟,𝑎,𝑎𝑠),𝗏𝖼𝗈𝗇𝗌(𝑟,𝑏,𝑏𝑠))≡𝑒𝑠. All seven original telescope positions are therefore present in both leaf instances. The target has the type displayed in the exercise. The recursive call uses 𝑎𝑠, the direct child of the designated first vector; 𝑏𝑠 is the corresponding second-vector child but is not the termination witness.
Exercise 121.7.
Put 𝐷(𝑥):=𝖨𝖽𝐴(𝑎,𝑥). Splitting 𝑒 :𝐷(𝑎) against reflexivity generates the homogeneous telescopic equality (𝑎;𝑒)≡𝑥:𝐴;𝐷(𝑥)(𝑎;𝗋𝖾𝖿𝗅𝑎). Unfolding one telescope layer first presents the index component 𝑎 =𝑎 :𝐴; only after solving it could the dependent tail compare the transported 𝑒 with 𝗋𝖾𝖿𝗅𝑎. The neutral equation 𝑎 =𝑎 has neither a permitted solution step, since neither side is a unification variable, nor a permitted injectivity or conflict step. Deletion is outside the restricted unifier. The complete run is consequently the zero-step run ending at that same unsolved index component. In particular, it never reaches an assignment 𝑒 :=𝗋𝖾𝖿𝗅𝑎. Compilation reports stuck unification.
Replacing the reflexivity pattern by ! asks the compiler to certify that no constructor is compatible. But 𝗋𝖾𝖿𝗅𝑎 :𝐷(𝑎) is a compatible constructor instance. Its full telescopic constraint is the one displayed above; the stuck neutral component is not a conflict certificate, so the absurd assertion is invalid.
Exercise 121.8.
The seven first results are as follows.
Complete Boolean negation succeeds: the 𝗍𝗍 and 𝖿𝖿 constraints are positive, and each specialized matrix has a leaf.
The sole 𝗍𝗍 clause reports uncovered constructor 𝖿𝖿. Its certificate is the positive path choosing 𝖿𝖿 together with the resulting empty specialized matrix.
The identity-family K clause reports stuck unification at the first component 𝑎 =𝑎 of (𝑎;𝑒) ≡𝑥:𝐴;𝐷(𝑥)(𝑎;𝗋𝖾𝖿𝗅𝑎).
Append with .𝑘 reports an unforced inaccessible term. The positive vector constraint forces 𝗌𝗎𝖼(𝑘), whereas the row wrote 𝑘; the failed check is 𝗌𝗎𝖼(𝑘) ≡𝑘.
The declaration ℎ(!) at 𝟐 reports a reachable absurd pattern. Boolean constructors are enumerated in declaration order, so the first result is 𝖻𝖺𝖽𝖠𝖻𝗌𝗎𝗋𝖽(1,𝗍𝗍,(𝗍𝗍)). The 𝖿𝖿 branch is positive as well, so no negative certificate required by ! exists. The practical corpus’s two-constructor list is an aggregate observation, not the mathematical compiler’s single first diagnostic.
The constructor pattern in 𝐸’s erased Boolean column is blocking, but that column is not a runtime split position. Compilation returns 𝖻𝖺𝖽𝖱𝖾𝗅𝖾𝗏𝖺𝗇𝖼𝖾(1,𝑏), where 𝑏 names the erased binder.
For 𝐹, the first row initially selects the reflexivity column. Its positive unifier orients the old-variable equation as 𝑎 :=𝑥. The second row’s constructor cell 𝗍𝗍 at 𝑎 is therefore paired with the neutral forced image 𝑥, so the matcher suspends 𝗍𝗍𝖿𝗈𝗋𝖼𝖾𝖽𝖡𝗒𝑥. The first row next selects its final 𝗍𝗍 cell. In the 𝖿𝖿 branch that row is deleted, the second row becomes first, and retrying the suspended task returns 𝗌𝗍𝗎𝖼𝗄𝖥𝗈𝗋𝖼𝖾(2,𝑎,𝗍𝗍,𝑥).
The coverage item reports a constructor path rather than a unifier certificate. The remaining failures expose, respectively, the unsolved equation, the forced-versus-written pair, the reachable constructors, the erased blocker, and the neutral forced image with its demanded head.