Exercise 8.1.
For 𝑎 ::𝖴, the image 𝖲𝗍𝗋𝗂𝗇𝗀 is a well-formed type. For 𝑟 ::{{𝖭𝖺𝗆𝖾 :𝑎}}, substitution produces the obligation ∅⊢{𝖠𝗀𝖾:𝖭𝖺𝗍,𝖭𝖺𝗆𝖾:𝖲𝗍𝗋𝗂𝗇𝗀}::{{𝖭𝖺𝗆𝖾:𝖲𝗍𝗋𝗂𝗇𝗀}}. Its finite-map inclusion premise holds because the concrete type contains the required field with exactly the substituted type. Thus the pair respects both bindings of K, and K-Rec derives the displayed judgment.
Exercise 8.2.
The first label set sorts as [𝖭𝖺𝗆𝖾,𝖮𝖿𝖿𝗂𝖼𝖾], so 𝖭𝖺𝗆𝖾 has position 1. The second sorts as [𝖠𝗀𝖾,𝖭𝖺𝗆𝖾,𝖯𝗁𝗈𝗇𝖾], so it has position 2. Therefore the two record values compile to ["𝙹𝚘𝚎",403] and [21,"𝙷𝚊𝚗𝚊𝚔𝚘",7222]. Rule V-Nth types the selections at 𝖲𝗍𝗋𝗂𝗇𝗀, and the two target roots are ["𝙹𝚘𝚎",403]⟨1⟩⇝0"𝙹𝚘𝚎",[21,"𝙷𝚊𝚗𝚊𝚔𝚘",7222]⟨2⟩⇝0"𝙷𝚊𝚗𝚊𝚔𝚘".
Exercise 8.3.
After the two type applications, the selector has target term 𝜆𝗂𝐼.𝜆𝑥 :𝜏∗𝖧.𝑥⟨𝐼⟩ and index-arrow result 𝗂𝖽𝗑(𝖭𝖺𝗆𝖾,𝜏∗𝖧) ⇒𝗂(𝜏∗𝖧 →𝖲𝗍𝗋𝗂𝗇𝗀), where 𝜏𝖧 is the displayed concrete record type. In its translated layout, 𝖭𝖺𝗆𝖾 has position 2, so IV-Pos derives ∅;∅ ⊢𝗂𝖵2 :𝗂𝖽𝗑(𝖭𝖺𝗆𝖾,𝜏∗𝖧). Rule V-IApp therefore derives (𝜆𝗂𝐼.𝜆𝑥 :𝜏∗𝖧.𝑥⟨𝐼⟩)@2 :𝜏∗𝖧 →𝖲𝗍𝗋𝗂𝗇𝗀. Rule V-Vec assigns the vector the type 𝜏∗𝖧; target application gives type 𝖲𝗍𝗋𝗂𝗇𝗀. The two target contractions yield [21,"𝙷𝚊𝚗𝚊𝚔𝚘",7222]⟨2⟩ ⇝0"𝙷𝚊𝚗𝚊𝚔𝚘".
Exercise 8.4.
The two source roots are {𝖭𝖺𝗆𝖾="𝙹𝚘𝚎",𝖮𝖿𝖿𝗂𝖼𝖾=403}.𝖭𝖺𝗆𝖾⇝0"𝙹𝚘𝚎",{𝖠𝗀𝖾=21,𝖭𝖺𝗆𝖾="𝙷𝚊𝚗𝚊𝚔𝚘",𝖯𝗁𝗈𝗇𝖾=7222}.𝖭𝖺𝗆𝖾⇝0"𝙷𝚊𝚗𝚊𝚔𝚘". Write 𝑣𝖩 and 𝑣𝖧 for the two source record values in the displayed roots, put 𝐴𝖩 =["𝙹𝚘𝚎",403] and 𝐴𝖧 =[21,"𝙷𝚊𝚗𝚊𝚔𝚘",7222], and let 𝜏𝖩 and 𝜏𝖧 be their respective record types. The record clause gives the two exact membership judgments (𝑣𝖩,𝐴𝖩)∈R𝜏𝖩𝗋𝖾𝖼,(𝑣𝖧,𝐴𝖧)∈R𝜏𝖧𝗋𝖾𝖼. The canonical positions are 1 and 2, so the target roots are ["𝙹𝚘𝚎",403]⟨1⟩⇝0"𝙹𝚘𝚎",[21,"𝙷𝚊𝚗𝚊𝚔𝚘",7222]⟨2⟩⇝0"𝙷𝚊𝚗𝚊𝚔𝚘". The base clause relates each resulting string constant to itself, which is the projection case of the fundamental relation for both records.
Exercise 8.5.
The translated type is ∀𝑎::𝖴.∀𝑟::{{𝖠𝗀𝖾:𝖭𝖺𝗍,𝖭𝖺𝗆𝖾:𝑎}}.𝗂𝖽𝗑(𝖠𝗀𝖾,𝑟)⇒𝗂𝗂𝖽𝗑(𝖭𝖺𝗆𝖾,𝑟)⇒𝗂𝑟→{𝖠𝗀𝖾:𝖭𝖺𝗍,𝖭𝖺𝗆𝖾:𝑎}. The term inserts index abstractions in canonical label order: Λ𝑎.Λ𝑟.𝜆𝗂𝐼𝑟,𝖠𝗀𝖾.𝜆𝗂𝐼𝑟,𝖭𝖺𝗆𝖾.𝜆𝑥.[𝑥⟨𝐼𝑟,𝖠𝗀𝖾⟩,𝑥⟨𝐼𝑟,𝖭𝖺𝗆𝖾⟩]. At the stated concrete type, the canonical layout is [𝖠𝗀𝖾,𝖭𝖺𝗆𝖾,𝖯𝗁𝗈𝗇𝖾], so the supplied indices are 1,2. The body is [𝑥⟨1⟩,𝑥⟨2⟩], whose result layout is [𝖠𝗀𝖾,𝖭𝖺𝗆𝖾].
Exercise 8.6.
For the record-kinded abstraction case, fix 𝑘 ={{ℓ𝑖 :𝜏𝑖}}𝑚𝑖=1 in canonical order. The induction hypothesis is K∗,𝑡::𝑘∗;(LK)∗,(LK,𝑡)∗;T∗⊢𝖵𝐶:𝜎∗. Every variable in LK,𝑡 has the form 𝐼𝑡,ℓ𝑖. Every variable in LK has the form 𝐼𝑢,ℓ with 𝑢 ∈dom(K). Freshness of 𝑡 and global injectivity therefore make the domains disjoint. Applying V-IAbs for 𝑖 =𝑚,𝑚 −1,…,1 derives the index-arrow suffix, and V-TAbs derives the translated universal.
For type application, canonical translation gives K∗ ⊢𝖵𝜏∗ ::𝑘∗. Index availability certifies (ℓ𝑖,𝜏) for 𝐽𝑖 in the source index judgment; clause 3 of lemma 8.13 gives, for every 𝑖, K∗;(LK)∗⊢𝗂𝖵𝐽𝑖:𝗂𝖽𝗑(ℓ𝑖,𝜏∗). Rule V-TApp first derives 𝐶[𝜏∗]; applying V-IApp in the canonical order derives the type 𝜎∗[𝜏∗/𝑡]. By lemma 8.13, this type is (𝜎[𝜏/𝑡])∗, which is the required conclusion.
Exercise 8.7.
Erasure leaves one target body 𝜆𝑥.𝑥⟨𝑖⟩. In the first opening layout the name is at 𝑖 =1; in the second it is at 𝑖 =2. Since 1 ≠2, no numeral makes both calls select the name. Searching the vector for a run-time label can choose the right component, but the target operation is then a dynamic search rather than the constant numeric selection required by the compiler specification.
Exercise 8.8.
Use the record types 𝜏1={𝖭𝖺𝗆𝖾:𝖲𝗍𝗋𝗂𝗇𝗀,𝖮𝖿𝖿𝗂𝖼𝖾:𝖭𝖺𝗍},𝜏2={𝖠𝗀𝖾:𝖭𝖺𝗍,𝖭𝖺𝗆𝖾:𝖲𝗍𝗋𝗂𝗇𝗀}. Both have exactly two distinct labels, so |layout(𝜏1)| =2 =|layout(𝜏2)|. Their layouts are [𝖭𝖺𝗆𝖾,𝖮𝖿𝖿𝗂𝖼𝖾] and [𝖠𝗀𝖾,𝖭𝖺𝗆𝖾], and their name positions are 1 and 2. An unlabeled vector of length two does not reveal which layout produced it, so length and vector shape cannot determine the source projection. Passing the singleton-typed index 𝐼 :𝗂𝖽𝗑(𝖭𝖺𝗆𝖾,𝑟), instantiated to the concrete position at type application, restores exactly the missing information.