Take three judgments 𝑃,𝑄,𝑅 and the one-rule system
𝑃𝑄
𝑅
The sets 𝑆={𝑃} and 𝑇={𝑄} are each closed: in either set at least one premise of the rule is absent. Their union contains both premises but not the conclusion, and therefore is not closed. This also explains why intersections, rather than unions, occur in proposition 1.5.
Writing ¯1=𝗌𝗎𝖼(𝟢) and using the metalevel operation ⊕ defined in the exercise, the required relation is generated by
𝗅𝖾𝗇(𝗌;¯1)
𝗅𝖾𝗇(𝗄;¯1)
𝗅𝖾𝗇(𝑎1;𝑚)𝗅𝖾𝗇(𝑎2;𝑛)
𝗅𝖾𝗇(𝖺𝗉(𝑎1;𝑎2);𝑚⊕𝑛)
Rule induction shows simultaneously that a derivable length judgment has a combinator as its first subject and that its second subject is precisely the number of leaves labeled 𝗌 or 𝗄.
Every node in the numeral-equality derivation is forced: 𝑋𝟢𝗂𝗌𝟢Is−Z𝗌𝗎𝖼(𝟢)𝗂𝗌𝗌𝗎𝖼(𝟢)Is−S𝗌𝗎𝖼(𝗌𝗎𝖼(𝟢))𝗂𝗌𝗌𝗎𝖼(𝗌𝗎𝖼(𝟢))Is−S. The tree derivation uses one axiom for each empty subtree and one Tree-Node for each node: 𝑋𝖾𝗆𝗉𝗍𝗋𝖾𝖾Tree−Emp𝑋𝖾𝗆𝗉𝗍𝗋𝖾𝖾Tree−Emp𝗇𝗈𝖽𝖾(𝖾𝗆𝗉;𝖾𝗆𝗉)𝗍𝗋𝖾𝖾Tree−Node𝑋𝖾𝗆𝗉𝗍𝗋𝖾𝖾Tree−Emp𝗇𝗈𝖽𝖾(𝗇𝗈𝖽𝖾(𝖾𝗆𝗉;𝖾𝗆𝗉);𝖾𝗆𝗉)𝗍𝗋𝖾𝖾Tree−Node.
The only conclusions of the equality rules are 𝟢𝗂𝗌𝟢 and 𝗌𝗎𝖼(𝑎)𝗂𝗌𝗌𝗎𝖼(𝑏). Hence no rule instance has conclusion 𝗌𝗎𝖼(𝟢)𝗂𝗌𝟢, so a finite derivation of that judgment has no possible final rule.
Likewise, the outer successor on both sides of 𝗌𝗎𝖼(𝑎)𝗂𝗌𝗌𝗎𝖼(𝑏) excludes Is-Z. Its final rule must therefore be 𝑎𝗂𝗌𝑏𝗌𝗎𝖼(𝑎)𝗂𝗌𝗌𝗎𝖼(𝑏)Is−S. Thus the derivation contains a derivation of 𝑎𝗂𝗌𝑏 as its immediate subtree.
For reflexivity, induct on 𝑎𝗇𝖺𝗍. The Nat-Z case is Is-Z. If the premise derivation gives, by induction, 𝑎𝗂𝗌𝑎, then Is-S gives 𝗌𝗎𝖼(𝑎)𝗂𝗌𝗌𝗎𝖼(𝑎).
For transitivity, induct on the derivation of 𝑎𝗂𝗌𝑏. If it ends in Is-Z, then 𝑎=𝑏=𝟢. Final-rule inspection of 𝟢𝗂𝗌𝑐 forces Is-Z, hence 𝑐=𝟢, and Is-Z proves the result. In the successor case the two derivations have the shapes 𝑎0𝗂𝗌𝑏0𝗌𝗎𝖼(𝑎0)𝗂𝗌𝗌𝗎𝖼(𝑏0)Is−S,𝑏0𝗂𝗌𝑐0𝗌𝗎𝖼(𝑏0)𝗂𝗌𝗌𝗎𝖼(𝑐0)Is−S. The induction hypothesis derives 𝑎0𝗂𝗌𝑐0, and Is-S derives the required successor judgment.
Finally, the outer form of 𝗌𝗎𝖼(𝑎)𝗂𝗌𝗌𝗎𝖼(𝑏) excludes Is-Z; the final rule is Is-S, and its premise is exactly 𝑎𝗂𝗌𝑏. This proves successor injectivity.
Only Ev-S concludes a judgment whose subject is a successor and whose tag is 𝖾𝗏𝖾𝗇. Thus a derivation of 𝗌𝗎𝖼(𝑎)𝖾𝗏𝖾𝗇 has immediate premise 𝑎𝗈𝖽𝖽. Similarly, only Od-S can conclude 𝗌𝗎𝖼(𝑎)𝗈𝖽𝖽, and its premise is 𝑎𝖾𝗏𝖾𝗇.
Assume for contradiction that both 𝑎𝖾𝗏𝖾𝗇 and 𝑎𝗈𝖽𝖽 are derivable. Either derivation gives 𝑎𝗇𝖺𝗍 by lemma 1.24. Induct on that numeral derivation. If 𝑎=𝟢, no rule concludes 𝟢𝗈𝖽𝖽. If 𝑎=𝗌𝗎𝖼(𝑏), the two inversion facts extract both 𝑏𝗈𝖽𝖽 and 𝑏𝖾𝗏𝖾𝗇. The induction hypothesis for the predecessor derivation rules this out. Hence no expression has both parity tags.
The complete tree is 𝑋𝟢𝗇𝖺𝗍Nat−Z𝗌𝗎𝖼(𝟢)𝗇𝖺𝗍Nat−S𝗌𝗎𝗆(𝟢;𝗌𝗎𝖼(𝟢);𝗌𝗎𝖼(𝟢))Sum−Z𝗌𝗎𝗆(𝗌𝗎𝖼(𝟢);𝗌𝗎𝖼(𝟢);𝗌𝗎𝖼(𝗌𝗎𝖼(𝟢)))Sum−S𝗌𝗎𝗆(𝗌𝗎𝖼(𝗌𝗎𝖼(𝟢));𝗌𝗎𝖼(𝟢);𝗌𝗎𝖼(𝗌𝗎𝖼(𝗌𝗎𝖼(𝟢))))Sum−S. Deleting the final Sum-S leaves 𝗌𝗎𝗆(𝗌𝗎𝖼(𝟢);𝗌𝗎𝖼(𝟢);𝗌𝗎𝖼(𝗌𝗎𝖼(𝟢))) at the root. This premise is forced: Sum-Z can conclude only a sum whose first argument is 𝟢, so the displayed successor-headed conclusion can only arise from Sum-S. Matching that rule against the conclusion uniquely determines the premise above.
Let E𝑖 derive 𝐾𝑖 from Γ. For the iterated proof, weaken E1 to the ambient hypotheses Γ,𝐾2,…,𝐾𝑛 and apply transitivity to discharge 𝐾1. The result derives 𝐽 from Γ,𝐾2,…,𝐾𝑛. Repeat with E2, and so on. After 𝑛 applications, the result derives 𝐽 from Γ.
For the single proof, induct on the given derivation D of 𝐽 from Γ,𝐾1,…,𝐾𝑛. A hypothesis leaf from Γ is retained. A leaf 𝐾𝑖 is replaced by the fixed tree E𝑖. At a primitive-rule node, transform every immediate subderivation by the induction hypotheses and reapply the same rule. Every new leaf is now justified by Γ, and every internal node has the same conclusion as before, so the transformed root is a derivation of 𝐽 from Γ.
One direction is immediate: every R-derivation is also an R∪{𝑟}-derivation. Conversely, induct on a derivation over R∪{𝑟}. If its final rule lies in R, transform its premises by the induction hypotheses and reapply that rule. For a two-premise instance of 𝑟, the induction hypotheses transform D1,D2 into closed R-derivations, and admissibility supplies E. The complete final-rule transformation is D1::∅⊢R∪{𝑟}𝐽1D2::∅⊢R∪{𝑟}𝐽2∅⊢R∪{𝑟}𝐽rinduction;admissibility⟹E::∅⊢R𝐽. Thus every judgment derivable after adjoining 𝑟 was already derivable before adjoining it.
For the reverse direction, assume that adjoining 𝑟 preserves and reflects derivability. Fix a two-premise instance 𝐽1,𝐽2/𝐽 whose premises have closed R-derivations D1,D2. The one use of the added rule and the right-to-left implication are D1::∅⊢R𝐽1D2::∅⊢R𝐽2∅⊢R∪{𝑟}𝐽rright-to-leftimplication⟹E::∅⊢R𝐽. Since the instance was arbitrary, 𝑟 is admissible.
Fix an instance of Ev-Inv and suppose its premise 𝗌𝗎𝖼(𝑎)𝖾𝗏𝖾𝗇 is derivable in the original parity system. The axiom Ev-Z concludes only 𝟢𝖾𝗏𝖾𝗇, and Od-S concludes an odd judgment. The final rule can only be 𝑎𝗈𝖽𝖽𝗌𝗎𝖼(𝑎)𝖾𝗏𝖾𝗇Ev−S. Its immediate subtree derives the desired conclusion, so every instance is admissible.
After adjoining the new axiom, there is a one-node derivation 𝑋𝗌𝗎𝖼(𝟢)𝖾𝗏𝖾𝗇New. For the concrete instance 𝑎=𝟢, admissibility would require a derivation of 𝟢𝗈𝖽𝖽. No parity rule has that conclusion, so it remains underivable. The new premise is derivable while the required conclusion is not; admissibility is destroyed.
Put 𝑒0=𝖺𝖽𝖽(𝖺𝖽𝖽(𝟢;𝗌𝗎𝖼(𝟢));𝗌𝗎𝖼(𝟢)). The complete one-step trees are 𝑋𝟢𝗇𝗎𝗆Num−Z𝗌𝗎𝖼(𝟢)𝗇𝗎𝗆Num−S𝖺𝖽𝖽(𝟢;𝗌𝗎𝖼(𝟢))⟼𝖠𝗌𝗎𝖼(𝟢)A−Add−Z𝑒0⟼𝖠𝖺𝖽𝖽(𝗌𝗎𝖼(𝟢);𝗌𝗎𝖼(𝟢))A−Add−L,𝑋𝟢𝗇𝗎𝗆Num−Z𝗌𝗎𝖼(𝟢)𝗇𝗎𝗆Num−S𝑋𝟢𝗇𝗎𝗆Num−Z𝗌𝗎𝖼(𝟢)𝗇𝗎𝗆Num−S𝖺𝖽𝖽(𝗌𝗎𝖼(𝟢);𝗌𝗎𝖼(𝟢))⟼𝖠𝗌𝗎𝖼(𝖺𝖽𝖽(𝟢;𝗌𝗎𝖼(𝟢)))A−Add−S. The final one-step tree is 𝑋𝟢𝗇𝗎𝗆Num−Z𝗌𝗎𝖼(𝟢)𝗇𝗎𝗆Num−S𝖺𝖽𝖽(𝟢;𝗌𝗎𝖼(𝟢))⟼𝖠𝗌𝗎𝖼(𝟢)A−Add−Z𝗌𝗎𝖼(𝖺𝖽𝖽(𝟢;𝗌𝗎𝖼(𝟢)))⟼𝖠𝗌𝗎𝖼(𝗌𝗎𝖼(𝟢))A−Suc.
Let V0 and V1 denote the complete AB-Z and AB-S(AB-Z) derivations of 𝟢⇓𝖠𝟢 and 𝗌𝗎𝖼(𝟢)⇓𝖠𝗌𝗎𝖼(𝟢). The big-step tree is V0V1𝑋𝟢𝗇𝖺𝗍Nat−Z𝗌𝗎𝖼(𝟢)𝗇𝖺𝗍Nat−S𝗌𝗎𝗆(𝟢;𝗌𝗎𝖼(𝟢);𝗌𝗎𝖼(𝟢))Sum−Z𝖺𝖽𝖽(𝟢;𝗌𝗎𝖼(𝟢))⇓𝖠𝗌𝗎𝖼(𝟢)AB−AddV1𝑋𝟢𝗇𝖺𝗍Nat−Z𝗌𝗎𝖼(𝟢)𝗇𝖺𝗍Nat−S𝗌𝗎𝗆(𝟢;𝗌𝗎𝖼(𝟢);𝗌𝗎𝖼(𝟢))Sum−Z𝗌𝗎𝗆(𝗌𝗎𝖼(𝟢);𝗌𝗎𝖼(𝟢);𝗌𝗎𝖼(𝗌𝗎𝖼(𝟢)))Sum−S𝑒0⇓𝖠𝗌𝗎𝖼(𝗌𝗎𝖼(𝟢))AB−Add.
Because 𝑦≠𝑥, the first renaming passes under the binder: (𝜆𝑦.𝑥(𝑦𝑧))⟨𝑤/𝑥⟩=𝜆𝑦.𝑤(𝑦𝑧). Its free variables are {𝑤,𝑧}, which equals ({𝑥,𝑧}∖{𝑥})∪{𝑤}. In the second term the binder is the source name, so renaming stops: (𝜆𝑥.𝑥𝑦)⟨𝑤/𝑥⟩=𝜆𝑥.𝑥𝑦. Its free-variable set remains {𝑦}; the source 𝑥 was not free in the complete abstraction, so the absent-source branch of the free-variable equation adds no 𝑤.
Choose 𝑤∉{𝑥,𝑦,𝑢,𝑣}. Opening the outer abstractions gives 𝜆𝑦.𝑤and𝜆𝑣.𝑤. Choose 𝑟∉{𝑤,𝑦,𝑣}. Opening their binders gives 𝑤 on both sides, and the variable clause gives 𝑤=𝛼𝑤. The abstraction clause with witness 𝑟, followed by the abstraction clause with witness 𝑤, therefore derives 𝜆𝑥.𝜆𝑦.𝑥=𝛼𝜆𝑢.𝜆𝑣.𝑢. The choice 𝑤=𝑦 is invalid because 𝑦∈Names(𝑒); opening to an existing binder name would not satisfy the common freshness premise.
The displayed binder 𝑦 would capture a free 𝑦 in the inserted term, so first rename it to a fresh 𝑢: (𝜆𝑦.𝑥(𝑦𝑧))[(𝑦𝑥)/𝑥]=𝛼(𝜆𝑢.𝑥(𝑢𝑧))[(𝑦𝑥)/𝑥]=𝜆𝑢.(𝑦𝑥)(𝑢𝑧). Its free-variable set is {𝑥,𝑦,𝑧}; the displayed 𝑢 is bound.
For the composition equation, the binder 𝑧 is already clean for the displayed data. The left side is (𝜆𝑧.𝑥𝑦)[𝑦/𝑥][𝗍𝗍/𝑦]=(𝜆𝑧.𝑦𝑦)[𝗍𝗍/𝑦]=𝜆𝑧.𝗍𝗍𝗍𝗍. The right side is (𝜆𝑧.𝑥𝑦)[𝗍𝗍/𝑦][𝑦[𝗍𝗍/𝑦]/𝑥]=(𝜆𝑧.𝑥𝗍𝗍)[𝗍𝗍/𝑥]=𝜆𝑧.𝗍𝗍𝗍𝗍. Thus both sides agree, and the hypotheses 𝑥≠𝑦 and 𝑥∉FV(𝗍𝗍) hold.
Put 𝑣=𝜆𝑥.𝖺𝖽𝖽(𝑥;𝗌𝗎𝖼(𝟢)). At the first term, 𝐸=𝑣[−] and 𝑟=𝖺𝖽𝖽(𝟢;𝗌𝗎𝖼(𝟢)), which contracts to 𝗌𝗎𝖼(𝟢). At 𝑣𝗌𝗎𝖼(𝟢), the context is empty and the whole term is the beta-redex; it contracts to 𝖺𝖽𝖽(𝗌𝗎𝖼(𝟢);𝗌𝗎𝖼(𝟢)). This whole addition is again the redex in the empty context and contracts to 𝗌𝗎𝖼(𝖺𝖽𝖽(𝟢;𝗌𝗎𝖼(𝟢))). Finally 𝐸=𝗌𝗎𝖼([−]) and the redex in its hole is 𝖺𝖽𝖽(𝟢;𝗌𝗎𝖼(𝟢)), contracting to 𝗌𝗎𝖼(𝟢). The final term is 𝗌𝗎𝖼(𝗌𝗎𝖼(𝟢)), a value.
With argument 𝜆𝑦.𝑦, beta contraction first produces 𝖺𝖽𝖽(𝜆𝑦.𝑦;𝗌𝗎𝖼(𝟢)). Both arguments are values, but the first is not numeric. It cannot step, no addition contraction matches it, and the whole term is not a value. Hence it is in clause 3 of unique decomposition.
The original step is 𝑋𝗍𝗍𝗏𝖺𝗅V−True(𝜆𝑦.𝑥𝑦)𝗍𝗍⟼𝑥𝗍𝗍E−Beta. Because 𝑦 is fresh for 𝜆𝑧.𝑧, substitution throughout the derivation gives 𝑋𝗍𝗍𝗏𝖺𝗅V−True(𝜆𝑦.(𝜆𝑧.𝑧)𝑦)𝗍𝗍⟼(𝜆𝑧.𝑧)𝗍𝗍E−Beta𝑋𝗍𝗍𝗏𝖺𝗅V−True(𝜆𝑧.𝑧)𝗍𝗍⟼𝗍𝗍E−Beta.
If the original display uses binder 𝑧, clean it first: (𝜆𝑧.𝑥𝑧)𝗍𝗍=𝛼(𝜆𝑢.𝑥𝑢)𝗍𝗍. Now substitution produces 𝑋𝗍𝗍𝗏𝖺𝗅V−True(𝜆𝑢.(𝜆𝑧.𝑧)𝑢)𝗍𝗍⟼(𝜆𝑧.𝑧)𝗍𝗍E−Beta. The second complete tree is the preceding E-Beta/V-True tree for (𝜆𝑧.𝑧)𝗍𝗍⟼𝗍𝗍. The fresh representative is what prevents the inserted binder name from being confused with the binder discharged by the outer beta step.
Since 𝜔 is a value, E-Beta applies: 𝑋𝜔𝗏𝖺𝗅V−Lam(𝜆𝑥.𝑥𝑥)𝜔⟼(𝑥𝑥)[𝜔/𝑥]E−Beta. The contractum satisfies (𝑥𝑥)[𝜔/𝑥]=𝜔𝜔. The same step repeats forever. Thus 𝜔𝜔 diverges, but it is not stuck because it always has a next step.
In (𝜆𝑥.𝗍𝗍)(𝗍𝗍𝖿𝖿), the function is already a value, so call by value must next reduce the argument. But 𝗍𝗍𝖿𝖿 is neither a value nor a redex: both subterms are final and the function is not an abstraction. Consequently the argument has no step, the outer application has no step, and the outer term is not a value; it is stuck. Unevaluated beta substitution would instead give 𝗍𝗍[(𝗍𝗍𝖿𝖿)/𝑥]=𝗍𝗍, but call by value forbids that contraction until the argument is a value.
Induct on the displayed value derivation. A final V-Lam, V-True, or V-False conclusion has a source shape matched by no reduction rule. A final V-Num reduces the claim to the premise 𝑛𝗇𝗎𝗆; rule induction on that premise excludes a step from 𝟢, and excludes a step from 𝗌𝗎𝖼(𝑛) because E-Suc would require a step from the smaller numeral. Structural induction on the raw syntax would expose arbitrary successors as well as numeral successors and would therefore have to recover the missing numeric premise by inversion.
After deleting E-Suc, the premise 𝖺𝖽𝖽(𝟢;𝟢)⟼𝟢 remains derivable by E-Add-Z, but no remaining rule has source 𝗌𝗎𝖼(𝖺𝖽𝖽(𝟢;𝟢)); hence the proposed rule is not admissible. Restoring E-Suc makes the transformation immediate: append one E-Suc inference below any derivation of 𝑒⟼𝑒′ to obtain 𝗌𝗎𝖼(𝑒)⟼𝗌𝗎𝖼(𝑒′). Thus admissibility depends on the complete ambient rule set.
First prove the backward-step lemma 𝑒⟼𝖠𝑒′and𝑒′⇓𝖠𝑛⟹𝑒⇓𝖠𝑛 by induction on the one-step derivation. In A-Suc, inversion of the target evaluation selects AB-S; apply the induction hypothesis to its premise and rebuild AB-S. In A-Add-L, inversion selects AB-Add; apply the induction hypothesis to the changed left evaluation, retain the right evaluation and sum derivation, and rebuild AB-Add. The A-Add-R case applies its induction hypothesis to the changed right evaluation; its left evaluation and sum derivation are unchanged.
In A-Add-Z, the target is a numeral 𝑛2. From 𝑛2⇓𝖠𝑞, lemma 1.44, lemma 1.37 gives 𝑞𝗇𝖺𝗍. Rule Sum-Z gives 𝗌𝗎𝗆(𝟢;𝑞;𝑞), so AB-Add, with AB-Z and the assumed target evaluation, derives 𝖺𝖽𝖽(𝟢;𝑛2)⇓𝖠𝑞.
In A-Add-S, inversion of the target evaluation gives a numeral 𝑞 and derivations 𝑛1⇓𝖠𝑝1,𝑛2⇓𝖠𝑝2,𝗌𝗎𝗆(𝑝1;𝑝2;𝑞), with final result 𝗌𝗎𝖼(𝑞). Rule AB-S changes the first evaluation to 𝗌𝗎𝖼(𝑛1)⇓𝖠𝗌𝗎𝖼(𝑝1), and Sum-S changes the sum premise to 𝗌𝗎𝗆(𝗌𝗎𝖼(𝑝1);𝑝2;𝗌𝗎𝖼(𝑞)). Reapplying AB-Add derives the required source evaluation.
Finally fix 𝑛𝗇𝗎𝗆 and induct on 𝑒⟼∗𝖠𝑛. In M-Refl, lemma 1.45 gives 𝑛⇓𝖠𝑛. In M-Step, the induction hypothesis gives 𝑒1⇓𝖠𝑛 for the many-step tail, and the backward-step lemma applied to 𝑒⟼𝖠𝑒1 gives 𝑒⇓𝖠𝑛.
Practical route.
The evaluator requested by exercise 1.20 is built in appendix F; its frozen Kappa run and evidence boundary are recorded in appendix E.