I am self-studying Hindley & Seldin's Lambda-Calculus and Combinators. I would appreciate some help with filling in a final detail for a proof for the following statement regarding combinatory logic:
Claim. If a closed term $Y$ is in strong nf, then $Yx$ weakly reduces to a strong nf $Z$.
Weak reduction (notation: $\rhd_w$) is defined as usual: $X \rhd_w Y$ iff there exists a (possibly empty) series of $\mathsf{I}, \mathsf{K}, \mathsf{S}$ contractions from $X$ to $Y$. For completeness, the single contractions are as follows:
- $\mathsf{I}x \rhd_{1w} x$
- $\mathsf{K}xy \rhd_{1w} x$
- $\mathsf{S}xyz \rhd_{1w} xz(yz)$
The book states that the claim can be proven by induction on the following definition:
Definition 1. (Strong normal forms)
- All atoms other than $\mathsf{I}$, $\mathsf{K}$ and $\mathsf{S}$ are in strong normal form;
- if $X_1, \ldots, X_n$ are in strong normal form and $a$ is any atom $\not \equiv \mathsf{I}, \mathsf{K}, \mathsf{S}$, then $aX_1\ldots X_n$ is in strong normal form;
- if $X$ is in strong nf, then so is $[x].X$.
Here, $[x]$ is the pseudoabstractor (also denoted by $\lambda^*$ in other literature), defined as follows:
Definition 2. (Abstraction) For every CL-term $M$ and every variable $x$, a CL-term called $[x].M$ is defined by induction on $M$, thus:
- $[x].M \equiv \mathsf{K}M$ $\hspace{29.8mm}$if $x \not\in FV(M)$
- $[x].x \equiv \mathsf{I}$
- $[x].Ux \equiv U$ $\hspace{33mm}$if $x \not\in FV(U)$
- $[x].UV \equiv \mathsf{S}([x].U)([x].V)$ $\hspace{6mm}$if neither (1) nor (3) applies
Note that $\equiv$ denotes syntactical equivalence.
This is what I have so far:
Proof. Assume that the closed term $Y$ is in strong nf. The cases are as follows according to Def. 1.
$Y \equiv a$ (with $a$ some variable). Then $Yx \equiv ax \rhd_{w} ax$. By Def. 1.1, $x$ is in strong nf. By Def 1.2, and the preceding fact, $ax$ is in strong nf.
$Y \equiv aX_1...X_n$ with $X_1,\ldots,X_n$ in strong nf. Then $Yx \equiv aX_1...X_nx \rhd_{w} aX_1...X_n x$. Since $X_1, \ldots, X_n, x$ are all in strong nf, so is $aX_1\ldots X_nx$ by Def 1.2.
$Y \equiv [x].X$ with $X$ in strong nf. Then the cases must be distinguished according to Def. 2.
a. $x \not\in FV(X)$. Then $Yx \equiv \mathsf{K}Xx \rhd_{w} X$. $X$ is in strong nf by hypothesis.
b. $X \equiv x$. Then $Yx \equiv \mathsf{I}x \rhd_{w} x$. $x$ is in strong nf by Def 1.1.
c. $X \equiv Ux$ with $x \not\in FV(U)$. Then $Yx \equiv ([x].Ux)x \equiv Ux \equiv X \rhd_w X$. $X$ is in strong nf by hypothesis.
Now for the final case, which gives me trouble:
d. $X \equiv UV$ with $x \in FV(UV)$ and $V \not\equiv x$. Then $$Yx \equiv \mathsf{S}([x].U)([x].V)x \rhd_{w} ([x].U)x(([x].V)x)$$By the IH, both $([x].U)x$ and $([x].V)x$ weakly reduce to strong nfs $Z_1$ and $Z_2$.
Question: Should I now argue that $Z_1Z_2$ weakly reduces to a strong normal form, or that $Z_1Z_2$ is a strong normal form? If the former, how do I properly complete this argument without falling into the trap of infinite regress?
Let me know if you require additional information.
To prove that for every strong nf $X$ the expression $([y]X)x$ weakly reduce to a strong nf I think you should use induction over definition of strong nf not over abstraction.
To prove this we procede by induction over definition of strong nf:
where $AZ_1 \dots Z_n$ is a strong nf since all the $Z_i$ are Strong nf and $A$ is an atom.
This proves the point 3 and so conclude your proof.