Exercise 128.1.
Unfolding append exposes a case on 𝑥. Rule D-Case-Open first creates two refinement edges, to the same case with scrutinee 𝖭𝗂𝗅 and with scrutinee 𝖢𝗈𝗇𝗌(𝑎,𝑧), respectively. The edge substitutions are [𝖭𝗂𝗅/𝑥] and [𝖢𝗈𝗇𝗌(𝑎,𝑧)/𝑥]. At the second node on each path, D-Case-Known contracts the case and gives the residual leaves 𝐶𝗇𝗂𝗅=𝖢𝗈𝗇𝗌(𝑏,𝖭𝗂𝗅),𝐶𝖼𝗈𝗇𝗌=𝖢𝗈𝗇𝗌(𝑎,𝖺𝗉𝗉𝖾𝗇𝖽(𝑧,𝖢𝗈𝗇𝗌(𝑏,𝖭𝗂𝗅))). The second leaf contains the one residual recursive call; its first argument is the constructor tail 𝑧.
Exercise 128.2.
At the roots, Emb-Couple reduces the forward judgment to its two children. Rule Emb-Var gives 𝑥 ≼𝑎. For the tail, Emb-Dive selects the tail of the outer right-hand 𝖢𝗈𝗇𝗌, after which Emb-Couple gives 𝖭𝗂𝗅 ≼𝖭𝗂𝗅. Hence the required embedding holds. Reversing it would couple the outer 𝖢𝗈𝗇𝗌 heads and then require 𝖢𝗈𝗇𝗌(𝑥,𝖭𝗂𝗅) ≼𝖭𝗂𝗅. The heads do not match for Emb-Couple, and 𝖭𝗂𝗅 has no child for Emb-Dive; the derivation stops there.
Exercise 128.3.
The first five call configurations are 𝑄𝑖=𝗅𝗈𝗈𝗉(𝖲𝑖(𝑥))(0≤𝑖≤4). The first whistle is 𝑄0 ≼𝑄1: couple the common 𝗅𝗈𝗈𝗉 head and use Emb-Dive with Emb-Var for 𝑥 ≼𝖲(𝑥). Their most-specific generalization is 𝑔=𝗅𝗈𝗈𝗉(𝑧),𝜎=[𝑥/𝑧],𝜏=[𝖲(𝑥)/𝑧]. Direct substitution gives 𝑔𝜎 =𝑄0 and 𝑔𝜏 =𝑄1. Root agreement forces any common generalization to retain the loop head, while the child disagreement forces a variable, so the factorization clause of lemma 128.5 proves most-specificity.
Exercise 128.4.
Let the faulty test erase constructor names before comparing states. It then identifies the same-arity closed states 𝖲(𝖹) and 𝖯(𝖹), where 𝖲 and 𝖯 are distinct unary constructors, and folds the former to the latter’s residual node. The unfolded state returns 𝖲(𝖹), whereas the folded state returns 𝖯(𝖹), so returned constructors differ. Variant equivalence repairs the test by demanding identical constructor heads and only a bijective renaming of free variables. For an accepted pair 𝑄′ =𝑄𝜋, the residual equation for 𝑄 abstracts exactly fv(𝑄); applying it to 𝜋 alpha-renames that equation to 𝑄′. Thus the repaired back edge satisfies the folding equation and preserves evaluation.