I am reading Lectures on the Curry-Howard Isomorphism by Sorensen and Urzyczyn, and I got stuck when trying to fill in the details of Lemma 1.2.12(2). Below is the statement of Lemma 1.2.12.
Lemma 1.2.12.
- For all pre-terms $M,N$ and all variable $x$, there exists a pre-term $M'$ such that $M =_\alpha M'$ (i.e., $M$ is $\alpha$-equivalent to $M'$) and the substitution $M'[x := N]$ is defined.
- For all pre-terms $M,N,P$ and all variables $x,y$, there exist $M',N'$ such that $M =_\alpha M'$, $N =_\alpha N'$, and the substitutions $M'[x := N']$ and $M'[x := N'][y := P]$ are defined.
The proof of Lemma 1.2.12(1) is a simple induction on $M$. However, Lemma 1.2.12(2) seems much more complicated. Sorensen and Urzyczyn claim that Lemma 1.2.12(2) can also be easily solved by a straightforward induction on $M$, but I do not see how this works for application.
Let us assume that $M = AB$, where $A,B$ are pre-terms. By the induction hypothesis on $A$, there exist $A',N_1'$ such that $A =_\alpha A'$, $N =_\alpha N_1'$, and the substitutions $A'[x := N_1']$ and $A'[x := N_1'][y := P]$ are defined. Similarly, by the induction hypothesis on $B$, there exist $B',N_2'$ such that $B =_\alpha A'$, $N =_\alpha N_2'$, and the substitutions $B'[x := N_2']$ and $B'[x := N_2'][y := P]$ are defined. If $N_1' = N_2'$, then we could define $M' = A'B'$ and $N' = N_1' = N_2'$, and we would be done. But it is clear that one can construct an example here where $N_1' \ne N_2'$.
What elements should we add to the proof to ensure that $N_1' = N_2'$, or more generally, what is the correct way to prove Lemma 1.2.12(2)?