Exercise 108.1.
From 𝑟 :𝖱𝗈𝗈𝗍, DOT-Rec-E exposes 𝑟:{𝑝𝑎𝑙𝑒𝑡𝑡𝑒:𝖯𝖺𝗅𝖾𝗍𝗍𝖾}∧{𝑑𝑒𝑓𝑎𝑢𝑙𝑡:𝑟.𝑝𝑎𝑙𝑒𝑡𝑡𝑒.𝐶𝑜𝑙𝑜𝑟}. The first intersection projection and DOT-Fld-E give 𝑟.𝑝𝑎𝑙𝑒𝑡𝑡𝑒 :𝖯𝖺𝗅𝖾𝗍𝗍𝖾. Rule P-Var first gives 𝑟 𝗉𝖺𝗍𝗁; the field typing just derived then gives 𝑟.𝑝𝑎𝑙𝑒𝑡𝑡𝑒 𝗉𝖺𝗍𝗁 by P-Fld. Eliminating the recursive palette type exposes its member declaration {𝐶𝑜𝑙𝑜𝑟 :⊥..⊤}, so selection forms 𝑟.𝑝𝑎𝑙𝑒𝑡𝑡𝑒.𝐶𝑜𝑙𝑜𝑟. Finally the second root intersection projection gives 𝑟:{𝑑𝑒𝑓𝑎𝑢𝑙𝑡:𝑟.𝑝𝑎𝑙𝑒𝑡𝑡𝑒.𝐶𝑜𝑙𝑜𝑟}. Rule DOT-Fld-E derives 𝑟.𝑑𝑒𝑓𝑎𝑢𝑙𝑡:𝑟.𝑝𝑎𝑙𝑒𝑡𝑡𝑒.𝐶𝑜𝑙𝑜𝑟.
Exercise 108.2.
Let 𝑇0={𝑎:𝑝.𝐴}∧{𝑏:𝑝.𝐴},𝑇1={𝑎:𝑞.𝐴}∧{𝑏:𝑝.𝐴},𝑇2={𝑎:𝑞.𝐴}∧{𝑏:𝑞.𝐴}. The first Repl-𝑝𝑞 instance changes only the occurrence in the 𝑎-field, using Γ ⊢Replace(𝑇0,𝑝,𝑞,𝑇1), and derives 𝑇0 <:𝑇1. The second uses Γ ⊢Replace(𝑇1,𝑝,𝑞,𝑇2) for the 𝑏-field and derives 𝑇1 <:𝑇2. Transitivity gives 𝑇0 <:𝑇2. Each indexed replacement derivation ends in R-Sel, whose second premise forms the complete changed selection Γ ⊢𝑞.𝐴 𝗍𝗒𝗉𝖾.
Exercise 108.3.
Extend the family by 𝖳𝗋𝖾𝖾𝗉𝖺𝗅:=𝜇(𝑡:{𝑁𝑜𝑑𝑒:⊥..⊤}∧{𝑟𝑜𝑜𝑡:𝑡.𝑁𝑜𝑑𝑒}∧{𝑎𝑑𝑑:∀(𝑛:𝑡.𝑁𝑜𝑑𝑒)⊤}∧{𝑝𝑎𝑙𝑒𝑡𝑡𝑒:𝖯𝖺𝗅𝖾𝗍𝗍𝖾}), and replace 𝖳𝗋𝖾𝖾 by 𝖳𝗋𝖾𝖾𝗉𝖺𝗅 in the three declarations of Γ. Recursion elimination at apple supplies the exact field premise Γ⊢apple:{𝑝𝑎𝑙𝑒𝑡𝑡𝑒:𝖯𝖺𝗅𝖾𝗍𝗍𝖾}. Together with Γ ⊢apple 𝗉𝖺𝗍𝗁, obtained by P-Var, this is the premise of P-Fld; hence Γ⊢apple.𝑝𝑎𝑙𝑒𝑡𝑡𝑒𝗉𝖺𝗍𝗁,Γ⊢apple.𝑝𝑎𝑙𝑒𝑡𝑡𝑒.𝐶𝑜𝑙𝑜𝑟𝗍𝗒𝗉𝖾. The corresponding two premises for orange are Γ⊢orange𝗉𝖺𝗍𝗁,Γ⊢orange:{𝑝𝑎𝑙𝑒𝑡𝑡𝑒:𝖯𝖺𝗅𝖾𝗍𝗍𝖾}. They yield the selected type orange.𝑝𝑎𝑙𝑒𝑡𝑡𝑒.𝐶𝑜𝑙𝑜𝑟.
Now use alias :orange.𝗍𝗒𝗉𝖾. The first Sngl-E, with the target path orange.𝑝𝑎𝑙𝑒𝑡𝑡𝑒, derives Γ⊢alias.𝑝𝑎𝑙𝑒𝑡𝑡𝑒:(orange.𝑝𝑎𝑙𝑒𝑡𝑡𝑒).𝗍𝗒𝗉𝖾. The second Sngl-E, with target path orange.𝑝𝑎𝑙𝑒𝑡𝑡𝑒.𝑧𝑒𝑟𝑜, derives Γ⊢alias.𝑝𝑎𝑙𝑒𝑡𝑡𝑒.𝑧𝑒𝑟𝑜:(orange.𝑝𝑎𝑙𝑒𝑡𝑡𝑒.𝑧𝑒𝑟𝑜).𝗍𝗒𝗉𝖾. Field typing gives alias.𝑝𝑎𝑙𝑒𝑡𝑡𝑒.𝑧𝑒𝑟𝑜 :alias.𝑝𝑎𝑙𝑒𝑡𝑡𝑒.𝐶𝑜𝑙𝑜𝑟, while Sngl-Trans and orange.𝑝𝑎𝑙𝑒𝑡𝑡𝑒.𝑧𝑒𝑟𝑜 :orange.𝑝𝑎𝑙𝑒𝑡𝑡𝑒.𝐶𝑜𝑙𝑜𝑟 give the same path the type orange.𝑝𝑎𝑙𝑒𝑡𝑡𝑒.𝐶𝑜𝑙𝑜𝑟.
Finally R-Sel constructs the one-occurrence replacement, and Repl-𝑝𝑞 gives the requested agreement direction Γ⊢alias.𝑝𝑎𝑙𝑒𝑡𝑡𝑒.𝐶𝑜𝑙𝑜𝑟<:orange.𝑝𝑎𝑙𝑒𝑡𝑡𝑒.𝐶𝑜𝑙𝑜𝑟. Rule Repl-𝑞𝑝 gives the converse. Thus the two selected Color types agree by mutual subtyping. The apple selection remains unrelated, as it should for a distinct tree family.
Exercise 108.4.
The displayed store yields the lookup chain Lookup𝛾(𝑥)=𝜈(𝑥){𝑎=𝑦.𝑏},Lookup𝛾(𝑥.𝑎)=𝑦.𝑏,Lookup𝛾(𝑦)=𝜈(𝑦′){𝑏=𝜈(𝑦″){𝑐=𝜆(𝑧:⊤).𝑧}},Lookup𝛾(𝑦.𝑏)=𝜈(𝑦″){𝑐=𝜆(𝑧:⊤).𝑧},Lookup𝛾(𝑦.𝑏.𝑐)=𝜆(𝑧:⊤).𝑧. Rule Lookup-Path rewrites the pending 𝑥.𝑎.𝑐 lookup through the intermediate alias 𝑦.𝑏.𝑐, after which Lookup-Val supplies the last line. Precise field typing gives 𝑥.𝑎.𝑐 :∀(𝑧 :⊤)⊤. With 𝑦 :⊤, dependent application therefore has type ⊤. Ordinary term progress first encounters the normal path 𝑥.𝑎.𝑐; exactly there lemma 108.9 ensures that extended reduction reaches the displayed lambda, enabling the beta step with 𝑦.
Exercise 108.5.
𝑥 is a stable path by P-Var; 𝑥.𝑎.𝑏 is a stable path after two P-Fld instances, provided both field typings exist. Application (𝜆𝑦.𝑦)𝑥 is rejected because the path grammar has no application clause. The object value 𝜈(𝑥 :𝑇)𝑑 is rejected because it has no object- construction clause. The whole let expression is rejected because it has no let clause, even though its bound expression and the body path 𝑦.𝑏 may separately be stable.
Exercise 108.6.
Install a root 𝑟 whose 𝑝𝑎𝑙𝑒𝑡𝑡𝑒 field contains a tight member 𝐶𝑜𝑙𝑜𝑟 :𝑇..𝑇 and a value 𝑧𝑒𝑟𝑜 :𝑇, whose 𝑎𝑙𝑖𝑎𝑠 definition is the path 𝑟.𝑝𝑎𝑙𝑒𝑡𝑡𝑒, and whose 𝑑𝑒𝑓𝑎𝑢𝑙𝑡 definition is 𝑟.𝑎𝑙𝑖𝑎𝑠.𝑧𝑒𝑟𝑜. Def-Path gives 𝑟.𝑎𝑙𝑖𝑎𝑠 :𝑟.𝑝𝑎𝑙𝑒𝑡𝑡𝑒.𝗍𝗒𝗉𝖾. Since 𝑟.𝑝𝑎𝑙𝑒𝑡𝑡𝑒.𝐶𝑜𝑙𝑜𝑟 is formed, singleton propagation and one-occurrence replacement give the two tight comparisons 𝑟.𝑎𝑙𝑖𝑎𝑠.𝐶𝑜𝑙𝑜𝑟<:𝑟.𝑝𝑎𝑙𝑒𝑡𝑡𝑒.𝐶𝑜𝑙𝑜𝑟,𝑟.𝑝𝑎𝑙𝑒𝑡𝑡𝑒.𝐶𝑜𝑙𝑜𝑟<:𝑟.𝑎𝑙𝑖𝑎𝑠.𝐶𝑜𝑙𝑜𝑟. Field typing gives 𝑟.𝑑𝑒𝑓𝑎𝑢𝑙𝑡 :𝑟.𝑎𝑙𝑖𝑎𝑠.𝐶𝑜𝑙𝑜𝑟; subsumption along the first comparison yields 𝑟.𝑑𝑒𝑓𝑎𝑢𝑙𝑡 :𝑟.𝑝𝑎𝑙𝑒𝑡𝑡𝑒.𝐶𝑜𝑙𝑜𝑟. The derivation transports the selected type along the stable alias and does not assert raw syntactic equality of the paths.
Exercise 108.7.
Take Γ=𝑞:⊤,𝑝:𝑞.𝗍𝗒𝗉𝖾∧{𝑎:{𝐴:⊥..⊤}}. The intersection component forms 𝑝.𝑎.𝐴, and the singleton component gives 𝑝 :𝑞.𝗍𝗒𝗉𝖾. A root-only replacement would change that occurrence to 𝑞.𝑎.𝐴. Rule RP-Fld blocks it because P-Fld cannot derive Γ ⊢𝑞.𝑎 𝗉𝖺𝗍𝗁 from 𝑞 :⊤. Even if that premise were deleted, R-Sel would still require Γ ⊢𝑞.𝑎.𝐴 𝗍𝗒𝗉𝖾, which also has no derivation. Thus the indexed prefix and complete-leaf checks reject the malformed replacement.
Exercise 108.8.
Let the enclosing object have stable path 𝑝, and let its nested field be 𝑎=𝜈(𝑦:𝑇)𝑑. The installed inner self is the stable path 𝑝.𝑎. Inverting Def-New gives the body judgment 𝑝.𝑎;Γ⊢𝑑[𝑝.𝑎/𝑦]:𝑇[𝑝.𝑎/𝑦]. The tight-record premise supplies equal member bounds and pairwise distinct labels. Intrinsic well-formedness of the body derivation supplies the path-formation steps for every path in the two substituted expressions 𝑑[𝑝.𝑎/𝑦]and𝑇[𝑝.𝑎/𝑦]. Rule Def-New has no separate path side condition. When the nested object is added to the store, extend the runtime context with 𝑝.𝑎 :𝜇(𝑦 :𝑇) and with the precise field declarations obtained from 𝑇[𝑝.𝑎/𝑦]. The body premise types the stored definitions at those declarations. Disjoint labels make field lookup unique. Hence the extended store matches the extended inert, well-formed context, and the surrounding installation term retains its type.