exercise 18.1.
Pairwise disjointness supplies the six facts Δ1#Δ2,Δ1#Θ1,Δ1#Θ2,Δ2#Θ1,Δ2#Θ2,Θ1#Θ2. Thus every intermediate union displayed in the problem is defined. Repeated associativity gives ((Δ1⊎Δ2)⊎Θ1)⊎Θ2=Δ1⊎(Δ2⊎(Θ1⊎Θ2)). Commuting the middle two summands and reassociating yields Δ1⊎(Θ1⊎(Δ2⊎Θ2)). For the second equation, both sides are the finite map whose domain is the disjoint union of the same four domains and whose restriction to each domain is the corresponding context. More explicitly, (Δ1⊎Θ1)⊎(Δ2⊎Θ2)=Δ1⊎Θ1⊎Δ2⊎Θ2=Θ2⊎Δ2⊎Θ1⊎Δ1=(Θ2⊎Δ2)⊎(Θ1⊎Δ1). The first line uses the four cross-disjointness facts between the two parenthesized pairs; the last line uses them again after the permutation.
exercise 18.2.
Under the singleton context 𝑓 :𝖥𝗂𝗅𝖾, the body of 𝑒1 has the derivation ⋅;𝑢:1⊢𝑢:1⋅;𝑓:𝖥𝗂𝗅𝖾⊢𝗋𝖾𝖺𝖽𝑓:𝖥𝗂𝗅𝖾⊗𝖡𝗒𝗍𝖾𝗌⋅;𝑢:1,𝑓:𝖥𝗂𝗅𝖾⊢𝗅𝖾𝗍 ∗=𝑢 𝗂𝗇𝗋𝖾𝖺𝖽𝑓:𝖥𝗂𝗅𝖾⊗𝖡𝗒𝗍𝖾𝗌T−OneE. Hence ⋅;𝑓 :𝖥𝗂𝗅𝖾 ⊢𝑒1 :1 ⊸(𝖥𝗂𝗅𝖾 ⊗𝖡𝗒𝗍𝖾𝗌). Separately, T-Close, T-LVar, and T-LolliE give ⋅;𝑓:𝖥𝗂𝗅𝖾⊢𝑒2=𝖼𝗅𝗈𝗌𝖾𝑓:1. The rejected rule therefore offers the same declaration 𝑓 :𝖥𝗂𝗅𝖾 to both premises and concludes a type for 𝑒1𝑒2. Call by value first evaluates the argument 𝑒2, removing the live token, and beta reduction then exposes the read in 𝑒1. The duplicated assumption is precisely 𝑓 :𝖥𝗂𝗅𝖾. Removing an explicit contraction rule does not help: the unsplit application rule itself has copied its entire Δ into two premises.
exercise 18.3.
The body derivation is 𝑋⋅;𝑝:𝐴⊗𝐵⊢𝑝:𝐴⊗𝐵T−LVar𝑋⋅;𝑦:𝐵⊢𝑦:𝐵T−LVar𝑋⋅;𝑥:𝐴⊢𝑥:𝐴T−LVar⋅;𝑦:𝐵,𝑥:𝐴⊢𝑦⊗𝑥:𝐵⊗𝐴T−TensorI⋅;𝑝:𝐴⊗𝐵⊢𝗅𝖾𝗍 𝑥⊗𝑦=𝑝 𝗂𝗇 𝑦⊗𝑥:𝐵⊗𝐴T−TensorE. The two singleton premises of T-TensorI are 𝑦 :𝐵 and 𝑥 :𝐴; their union is the branch context supplied by tensor elimination. Applying T-LolliI discharges 𝑝 and concludes ⋅;⋅⊢𝗌𝗐𝖺𝗉:(𝐴⊗𝐵)⊸(𝐵⊗𝐴).
exercise 18.4.
Suppose first that ⋅; ⋅ ⊢𝜆𝑥.𝑥 ⊗𝑥 :𝐴 ⊸(𝐴 ⊗𝐴). Inverting T-LolliI gives ⋅;𝑥 :𝐴 ⊢𝑥 ⊗𝑥 :𝐴 ⊗𝐴. Inverting T-TensorI would split the singleton context as Δ1 ⊎Δ2 =𝑥 :𝐴 and type one occurrence of 𝑥 in each premise. Each variable premise requires its entire linear context to be the singleton 𝑥 :𝐴, so both Δ1 and Δ2 contain 𝑥. They are not disjoint, a contradiction.
For 𝜆𝑥. ∗, implication inversion would require ⋅;𝑥 :𝐴 ⊢ ∗ :1. The only introduction of ∗ is T-OneI, whose linear premise is ⋅. No rule removes the unused declaration 𝑥 :𝐴. Hence neither displayed judgment is derivable.
exercise 18.5.
Define 𝗋𝗈𝗎𝗍𝖾′=𝜆𝑧.𝜆𝑟.𝖼𝖺𝗌𝖾 𝑧 𝗈𝖿 𝗂𝗇𝗅𝑥⇒𝗂𝗇𝗋(𝑥⊗𝑟)∣𝗂𝗇𝗋𝑦⇒𝗂𝗇𝗅(𝑦⊗𝑟). In either branch, T-TensorI first gives 𝑥 ⊗𝑟 :𝐴 ⊗𝑅 or 𝑦 ⊗𝑟 :𝐴 ⊗𝑅. Use T-PlusI2 in the left branch and T-PlusI1 in the right: ⋅;𝑥:𝐴,𝑟:𝑅⊢𝗂𝗇𝗋(𝑥⊗𝑟):(𝐴⊗𝑅)⊕(𝐴⊗𝑅), ⋅;𝑦:𝐴,𝑟:𝑅⊢𝗂𝗇𝗅(𝑦⊗𝑟):(𝐴⊗𝑅)⊕(𝐴⊗𝑅). With scrutinee context 𝑧 :𝐴 ⊕𝐴, T-Case takes 𝑟 :𝑅 as the same residual context in both alternatives. Two implications therefore give ⋅;⋅⊢𝗋𝗈𝗎𝗍𝖾′:(𝐴⊕𝐴)⊸(𝑅⊸((𝐴⊗𝑅)⊕(𝐴⊗𝑅))). The printed occurrence of 𝑟 is duplicated between alternatives, but only the selected alternative executes; this is exactly why T-Case shares, rather than splits, its residual context.
exercise 18.7.
Suppose the last rule of the first derivation is Γ;Ξ1⊢𝑒1:𝐶⊸𝐵Γ;Ξ2⊢𝑒2:𝐶Γ;Ξ1⊎Ξ2⊢𝑒1𝑒2:𝐵T−LolliE, where Ξ1 ⊎Ξ2 =Δ1,𝑥 :𝐴. Exclusive membership puts 𝑥 in exactly one premise. If Ξ1 =Ξ′1,𝑥 :𝐴, the induction hypothesis and the substituent Γ;Δ2 ⊢𝑣 :𝐴 give Γ;Ξ′1⊎Δ2⊢𝑒1[𝑣/𝑥]:𝐶⊸𝐵. The second premise is unchanged. Reapplying T-LolliE yields Γ;(Ξ′1⊎Δ2)⊎Ξ2⊢𝑒1[𝑣/𝑥]𝑒2:𝐵. Pairwise disjointness and split algebra identify its context by (Ξ′1⊎Δ2)⊎Ξ2=(Ξ′1⊎Ξ2)⊎Δ2=Δ1⊎Δ2. The term is (𝑒1𝑒2)[𝑣/𝑥]. If 𝑥 ∈Ξ2, the symmetric argument substitutes in the argument premise and uses Ξ1 ⊎(Ξ′2 ⊎Δ2) =(Ξ1 ⊎Ξ′2) ⊎Δ2.
exercise 18.9.
Inversion of a typing derivation for the tensor redex supplies pairwise disjoint contexts and premises Γ;Δ𝑣⊢𝑣:𝑃,Γ;Δ𝑤⊢𝑤:𝑄,Γ;Δ𝑒,𝑥:𝑃,𝑦:𝑄⊢𝑒:𝐶. The redex is typed under (Δ𝑣 ⊎Δ𝑤) ⊎Δ𝑒: tensor introduction first types 𝑣 ⊗𝑤, and tensor elimination combines that result with the body premise.
Alpha-rename 𝑥,𝑦 away from the substituents. Regard the body context as (Δ𝑒,𝑦 :𝑄),𝑥 :𝑃. Linear substitution with 𝑣 gives Γ;Δ𝑒⊎Δ𝑣,𝑦:𝑄⊢𝑒[𝑣/𝑥]:𝐶. A second substitution with 𝑤 gives Γ;(Δ𝑒⊎Δ𝑣)⊎Δ𝑤⊢𝑒[𝑣/𝑥,𝑤/𝑦]:𝐶. Finally, (Δ𝑒⊎Δ𝑣)⊎Δ𝑤=(Δ𝑣⊎Δ𝑤)⊎Δ𝑒 by commutativity and associativity of the pairwise-disjoint union. This is the context of the redex, so the tensor root preserves its type.
exercise 18.11.
Rule T-TensorI gives Γ;Δ𝑣⊎Δ𝑤⊢𝑣⊗𝑤:𝑃⊗𝑄. Combining this with the supplied body premise by T-TensorE types the redex under (Δ𝑣 ⊎Δ𝑤) ⊎Δ𝑒.
For the reduct, first apply linear substitution to 𝑥: Γ;Δ𝑒,𝑥:𝑃,𝑦:𝑄⊢𝑒:𝐶Γ;Δ𝑣⊢𝑣:𝑃Γ;Δ𝑒⊎Δ𝑣,𝑦:𝑄⊢𝑒[𝑣/𝑥]:𝐶. Then apply it to 𝑦: Γ;Δ𝑒⊎Δ𝑣,𝑦:𝑄⊢𝑒[𝑣/𝑥]:𝐶Γ;Δ𝑤⊢𝑤:𝑄Γ;(Δ𝑒⊎Δ𝑣)⊎Δ𝑤⊢𝑒[𝑣/𝑥,𝑤/𝑦]:𝐶. After fresh alpha-renaming, the simultaneous substitution is the displayed pair of successive substitutions. The context equation is (Δ𝑒⊎Δ𝑣)⊎Δ𝑤=(Δ𝑣⊎Δ𝑤)⊎Δ𝑒=Δ𝑣⊎Δ𝑤⊎Δ𝑒, so redex and reduct have the required common context and type.
exercise 18.12.
On the left, T-Case uses Δ𝑠 for its scrutinee and the common residual Δ𝑟,𝑝:𝑃,𝑞:𝑄 for both branches. It therefore types the case at 𝐶 under Δ𝑠 ⊎(Δ𝑟,𝑝 :𝑃,𝑞 :𝑄). Tensor elimination then combines this body with 𝑡 :𝑃 ⊗𝑄 and concludes under Δ𝑡⊎Δ𝑠⊎Δ𝑟.
On the right, use tensor elimination separately in the alternatives. The left one has premises 𝑡 :𝑃 ⊗𝑄 under Δ𝑡 and 𝑒1 :𝐶 under Δ𝑟,𝑝 :𝑃,𝑞 :𝑄,𝑥 :𝐴, so it concludes under Δ𝑡 ⊎Δ𝑟,𝑥 :𝐴. The right alternative similarly concludes under Δ𝑡 ⊎Δ𝑟,𝑦 :𝐵. Thus the outer T-Case has scrutinee context Δ𝑠 and the common residual Δ𝑡⊎Δ𝑟. It concludes under Δ𝑠 ⊎(Δ𝑡 ⊎Δ𝑟). The freshness hypotheses prevent either elimination binder from capturing a free variable of 𝑠 or 𝑡, and split commutativity and associativity give Δ𝑠⊎(Δ𝑡⊎Δ𝑟)=Δ𝑡⊎Δ𝑠⊎Δ𝑟. Hence both sides have type 𝐶 under the stated context.
exercise 18.8.
In the first configuration, T-Case places 𝑥 :𝐴 in the scrutinee context. Linear substitution gives Γ;Δ0⊎Θ⊢𝑠[𝑣/𝑥]:𝑃⊕𝑄. The branch premises are unchanged, so rebuilding the case yields Γ;(Δ0⊎Θ)⊎Δ𝑟⊢𝖼𝖺𝗌𝖾 𝑠[𝑣/𝑥] 𝗈𝖿 𝗂𝗇𝗅𝑝⇒𝑒1∣𝗂𝗇𝗋𝑞⇒𝑒2:𝐶.
In the second configuration, the scrutinee is unchanged. Apply linear substitution to both branch derivations: Γ;Δ𝑟⊎Θ,𝑝:𝑃⊢𝑒1[𝑣/𝑥]:𝐶,Γ;Δ𝑟⊎Θ,𝑞:𝑄⊢𝑒2[𝑣/𝑥]:𝐶. Both alternatives therefore have the common residual Δ𝑟 ⊎Θ, and T-Case gives Γ;Δ0⊎(Δ𝑟⊎Θ)⊢𝖼𝖺𝗌𝖾 𝑠 𝗈𝖿 𝗂𝗇𝗅𝑝⇒𝑒1[𝑣/𝑥]∣𝗂𝗇𝗋𝑞⇒𝑒2[𝑣/𝑥]:𝐶. If the two residual contexts differed, no single Δ𝑟 could fill both branch premises of T-Case; the rule would therefore be inapplicable.
exercise 18.6.
For the first term, implication inversion puts one declaration 𝑓 :𝖥𝗂𝗅𝖾 in the body. Tensor inversion would split it between two premises, but inversion of each application 𝗋𝖾𝖺𝖽 𝑓 requires a premise containing 𝑓. Both summands would contain the same declaration, contradicting disjointness.
For the second term, implication inversion requires ⋅;𝑓 :𝖥𝗂𝗅𝖾 ⊢ ∗ :1. Inverting its only possible last rule, T-OneI, requires the empty linear context, so the declaration 𝑓 cannot be consumed.
For the third term, the application 𝗋𝖾𝖺𝖽 𝑓 consumes 𝑓 and has type 𝖥𝗂𝗅𝖾 ⊗𝖡𝗒𝗍𝖾𝗌. Tensor elimination therefore extends the body by 𝑓′ :𝖥𝗂𝗅𝖾,𝑏 :𝖡𝗒𝗍𝖾𝗌. Returning 𝑏 uses T-LVar under the singleton context 𝑏 :𝖡𝗒𝗍𝖾𝗌; the declaration 𝑓′ :𝖥𝗂𝗅𝖾 remains. Since there is no linear weakening rule, that branch premise cannot be formed. Thus all three displayed types are underivable.
exercise 18.10.
The scrutinee variable has ⋅;𝑧 :1 ⊕1 ⊢𝑧 :1 ⊕1. In the left branch, T-OneE consumes 𝑢 :1 and a second T-OneE consumes the unit returned by 𝖼𝗅𝗈𝗌𝖾 𝑓; the application of close consumes 𝑓 :𝖥𝗂𝗅𝖾. Hence ⋅;𝑢:1,𝑓:𝖥𝗂𝗅𝖾⊢𝗅𝖾𝗍 ∗=𝑢 𝗂𝗇𝗅𝖾𝗍 ∗=𝖼𝗅𝗈𝗌𝖾𝑓 𝗂𝗇 ∗:1. The right branch has the identical derivation with 𝑣 in place of 𝑢. Thus T-Case uses 𝑓 :𝖥𝗂𝗅𝖾 as its common residual and gives ⋅;𝑧:1⊕1,𝑓:𝖥𝗂𝗅𝖾⊢𝑞(𝑧,𝑓):1.
The scrutinee contributes one use of 𝑧 and zero of 𝑓. After masking the branch binders, each branch contributes one use of 𝑓: it occurs only as the close argument. The case clause therefore compares equal branch counts and calculates 𝗎𝗌𝖾𝑓(𝑞(𝑧,𝑓))=0+1=1. For the left injection, the complete branch trace is ({ℎ},𝑞(𝗂𝗇𝗅∗,𝖿𝗂𝗅𝖾ℎ))⟶({ℎ},𝗅𝖾𝗍 ∗=∗ 𝗂𝗇 𝗅𝖾𝗍 ∗=𝖼𝗅𝗈𝗌𝖾𝖿𝗂𝗅𝖾ℎ 𝗂𝗇 ∗)⟶({ℎ},𝗅𝖾𝗍 ∗=𝖼𝗅𝗈𝗌𝖾𝖿𝗂𝗅𝖾ℎ 𝗂𝗇 ∗)⟶(∅,𝗅𝖾𝗍 ∗=∗ 𝗂𝗇 ∗)⟶(∅,∗). The roots are, in order, E-InL, E-One, E-Close, and E-One. Replacing 𝗂𝗇𝗅 and its binder by 𝗂𝗇𝗋 and the right binder gives the symmetric four-step trace. Only the selected printed occurrence of 𝑓 runs.
exercise 18.14.
One affine weakening gives the body premise ⋅;⋅⊢𝑎∗:1⋅;𝑓:𝖥𝗂𝗅𝖾⊢𝑎∗:1W−Aff. Rule T-LolliI therefore types 𝜆𝑓. ∗ :𝖥𝗂𝗅𝖾 ⊸1. Independently, T-Open, T-OneI, and T-LolliE type 𝗈𝗉𝖾𝗇 ∗ :𝖥𝗂𝗅𝖾 under the empty context. A final T-LolliE derives ⋅; ⋅ ⊢𝑎𝖽𝗋𝗈𝗉 :1.
For fresh ℎ, evaluation is (∅,𝖽𝗋𝗈𝗉)⟶∗({ℎ},(𝜆𝑓.∗)𝖿𝗂𝗅𝖾ℎ)⟶({ℎ},∗). The strictly linear cleanup conclusion says that a returned unit has empty live set. The affine trace ends with live set {ℎ}, so that conclusion does not transfer to affine typing. This is not a counterexample to theorem 18.20: its premise is the strictly linear ownership judgment 𝐻 ⊩𝑒 :𝐴, whereas the displayed derivation uses ⊢𝑎 and its additional weakening rule.
exercise 36.15.
Use distinct assumptions 𝑓1,𝑓2 :𝖥𝗂𝗅𝖾 before contraction. The body has the derivation shape ⋅;𝑓1:𝖥𝗂𝗅𝖾⊢𝑟𝖼𝗅𝗈𝗌𝖾𝑓1:1⋅;𝑓2:𝖥𝗂𝗅𝖾⊢𝑟𝖼𝗅𝗈𝗌𝖾𝑓2:1⋅;𝑓1:𝖥𝗂𝗅𝖾,𝑓2:𝖥𝗂𝗅𝖾⊢𝑟𝗅𝖾𝗍 ∗=𝖼𝗅𝗈𝗌𝖾𝑓1 𝗂𝗇𝖼𝗅𝗈𝗌𝖾𝑓2:1T−OneE. Rule C-Rel identifies 𝑓1,𝑓2 with 𝑓, producing the body printed in 𝖻𝖺𝖽𝖢𝗅𝗈𝗌𝖾; T-LolliI discharges 𝑓. The closed argument 𝗈𝗉𝖾𝗇 ∗ supplies the final T-LolliE premise.
For fresh ℎ, the complete relevant trace is (∅,𝖻𝖺𝖽𝖢𝗅𝗈𝗌𝖾)⟶({ℎ},(𝜆𝑓.𝗅𝖾𝗍 ∗=𝖼𝗅𝗈𝗌𝖾𝑓 𝗂𝗇𝖼𝗅𝗈𝗌𝖾𝑓)𝖿𝗂𝗅𝖾ℎ)⟶({ℎ},𝗅𝖾𝗍 ∗=𝖼𝗅𝗈𝗌𝖾𝖿𝗂𝗅𝖾ℎ 𝗂𝗇𝖼𝗅𝗈𝗌𝖾𝖿𝗂𝗅𝖾ℎ)⟶(∅,𝗅𝖾𝗍 ∗=∗ 𝗂𝗇𝖼𝗅𝗈𝗌𝖾𝖿𝗂𝗅𝖾ℎ)⟶(∅,𝖼𝗅𝗈𝗌𝖾𝖿𝗂𝗅𝖾ℎ). The last configuration is stuck because ℎ is no longer live.
Affine typing preserves configurations and at-most-one ownership, but cleanup fails by the drop trace. Relevant typing destroys one-owner immediately and configuration preservation at the first close; therefore iterated progress also fails. Its no-weakening fact still implies 𝐻 ⊩𝑟𝑣 :1 ⇒𝐻 =∅, so the trace above is not a cleanup counterexample: it never returns unit. Unrestricted typing admits both counterexamples, so one-owner, configuration preservation/progress, and cleanup all fail there.
exercise 18.13.
The identity needs no structural rule: T-LVar followed by T-LolliI derives it already in ⊢ℓ (and the same tree is available in every regime). It uses zero weakenings and zero contractions.
The discarded function needs exactly one W-Aff, as in exercise 18.14; its inclusion-minimal regime is affine, and it is also derivable unrestrictedly. It is not linear or relevant: inversion of the implication would require a derivation of ∗ with 𝑥 :𝐴 still in the linear context, while neither regime has weakening.
For 𝜆𝑥.𝑥 ⊗𝑥, start with two variable leaves under 𝑥1 :𝐴 and 𝑥2 :𝐴, combine them by T-TensorI, and use one C-Rel to identify 𝑥1,𝑥2 with 𝑥. Thus its minimal regime is relevant, with one contraction and no weakening. For 𝜆𝑥.(𝑥 ⊗𝑥) ⊗𝑥, tensor introduction first uses three fresh declarations 𝑥1,𝑥2,𝑥3 :𝐴. Contract 𝑥1,𝑥2 and then contract the resulting declaration with 𝑥3. After the two capture-avoiding identifications the body is (𝑥 ⊗𝑥) ⊗𝑥. Its minimal regime is again relevant, now with two contractions and no weakening. Both copying terms are also unrestrictedly derivable.
Neither copying term is affine or linear. Inverting their tensor trees forces two, respectively three, leaves whose contexts all contain the one declaration 𝑥 :𝐴; disjoint splitting cannot supply those leaves, and affine weakening cannot create a second occurrence. Hence the classifications and the stated rule counts are minimal.
exercise 18.15.
Let 𝑔 :!(𝐴 ⊸𝐴) be linear. Bang elimination consumes 𝑔 and places 𝑓 :𝐴 ⊸𝐴 in the unrestricted context. Under the additional linear declaration 𝑥 :𝐴, the innermost application is 𝑓:𝐴⊸𝐴;⋅⊢𝑓:𝐴⊸𝐴𝑓:𝐴⊸𝐴;𝑥:𝐴⊢𝑥:𝐴𝑓:𝐴⊸𝐴;𝑥:𝐴⊢𝑓𝑥:𝐴T−LolliE. Apply the same unrestricted 𝑓 once to 𝑓 𝑥 and once to 𝑓(𝑓 𝑥). These are three T-UVar leaves for 𝑓, each with empty linear context, and one T-LVar leaf for 𝑥. Implication introduction discharges 𝑥; bang elimination rebuilds the body; the outer implication introduction discharges 𝑔. Hence ⋅;⋅⊢𝗍𝗁𝗋𝗂𝖼𝖾!:!(𝐴⊸𝐴)⊸(𝐴⊸𝐴). The derivation stores only the permission to reuse 𝑓, not the numeral three: the same T-UVar rule could occur any finite number of times.
For the unwrapped term, inversion of the outer and inner T-LolliI rules leaves a single linear declaration 𝑓 :𝐴 ⊸𝐴 for the nested application. Inversion of its two outer T-LolliE rules would have to partition that singleton among three function premises, each of which ends in T-LVar for 𝑓. Pairwise disjoint context splitting cannot do so. Thus the displayed linear type of the unwrapped 𝗍𝗁𝗋𝗂𝖼𝖾 is underivable.
exercise 36.8.
Removing 𝑥 is absence: the precontext no longer contains it, so neither a term nor a type may mention it. Marking 𝑥 by zero is contemplation: the shared precontext retains 𝑥 :𝑆, but a nonzero run-time subject cannot consume it. This is the case justified by zero-erasure.
Permitting an unused unit-priced input is discardability. It needs the ordered weakening rule and its factorization, splitting, and zero-reflection conditions; the rigid zero annotation alone does not justify it. Postulating that all proof inhabitants are equal is proof irrelevance. It needs an equality rule or semantic principle and follows neither from absence nor from erasure. Thus the four changes realize, respectively, clauses 1–4 of proposition 36.33; only the second is the zero-use mechanism of the erasure theorem.