Proof of the Church-Rosser theorem by parallel reduction full
This proof shows: statement.
We prove that →β is confluent. Terms are taken up to α-conversion, and in each step the bound variables are chosen different from the free variables of the other terms involved (the variable convention). We use one fact about syntactic substitution, proved by induction on M in Barendregt, Chapter 2:
(S) If x=y and x∈/FV(L), then M[x:=N][y:=L]=M[y:=L][x:=N[y:=L]].
Parallel reduction. Let ⇒ be the least relation on lambda terms closed under these four rules:
- x⇒x for each variable x;
- if M⇒M′ then λx.M⇒λx.M′;
- if M⇒M′ and N⇒N′ then MN⇒M′N′;
- if M⇒M′ and N⇒N′ then (λx.M)N⇒M′[x:=N′].
So ⇒ contracts any set of redexes that are present in the term at the start, in one go.
Lemma 1. M⇒M for each M.
Proof. Induction on M, with rules 1, 2 and 3. □
Lemma 2. →β⊆⇒⊆↠β. Hence ⇒∗ and ↠β are the same relation.
Proof. First inclusion: induction on the derivation of M→βM′. A root step (λx.P)Q→βP[x:=Q] is rule 4 with P⇒P and Q⇒Q (Lemma 1). A step inside a context is rule 2 or 3, with Lemma 1 for the part that does not change. Second inclusion: induction on the derivation of M⇒M′. Rules 1 to 3 follow because ↠β is reflexive and closed under the term constructors. For rule 4, by induction M↠βM′ and N↠βN′, so (λx.M)N↠β(λx.M′)N′→βM′[x:=N′]. Taking reflexive transitive closures of →β⊆⇒⊆↠β gives ↠β⊆⇒∗⊆↠β. □
Lemma 3 (substitution). If M⇒M′ and N⇒N′, then M[x:=N]⇒M′[x:=N′].
Proof. Induction on the derivation of M⇒M′.
- Rule 1, M=M′=y. If y=x, both sides are N and N′, and N⇒N′. If y=x, both sides are y.
- Rule 2, λy.P⇒λy.P′ with P⇒P′. By the convention y=x and y∈/FV(N)∪FV(N′). By induction P[x:=N]⇒P′[x:=N′], and rule 2 gives λy.P[x:=N]⇒λy.P′[x:=N′], which are the two substituted terms.
- Rule 3: the induction hypothesis for both parts and rule 3.
- Rule 4, (λy.P)Q⇒P′[y:=Q′] with P⇒P′ and Q⇒Q′, where y=x and y∈/FV(N′). The left side becomes (λy.P[x:=N])(Q[x:=N]). By induction P[x:=N]⇒P′[x:=N′] and Q[x:=N]⇒Q′[x:=N′], so rule 4 gives
(λy.P[x:=N])(Q[x:=N])⇒P′[x:=N′][y:=Q′[x:=N′]]. By (S) with the roles of the two variables exchanged (y=x, y∈/FV(N′)), this term equals P′[y:=Q′][x:=N′], the right side with the substitution applied. □
Complete development. Define M∗, the result of contracting all redexes of M at once, by recursion on M:
- x∗=x;
- (λx.M)∗=λx.M∗;
- ((λx.M)N)∗=M∗[x:=N∗];
- (MN)∗=M∗N∗ when M is not an abstraction.
Lemma 4 (triangle). If M⇒M′, then M′⇒M∗.
Proof. Induction on the derivation of M⇒M′.
- Rule 1: M=M′=x=M∗, and x⇒x.
- Rule 2: λx.P⇒λx.P′ with P⇒P′. By induction P′⇒P∗, so λx.P′⇒λx.P∗=(λx.P)∗.
- Rule 3: PQ⇒P′Q′ with P⇒P′ and Q⇒Q′. By induction Q′⇒Q∗.
- If P is not an abstraction, by induction P′⇒P∗, and rule 3 gives P′Q′⇒P∗Q∗=(PQ)∗.
- If P=λx.P0, then P⇒P′ can only come from rule 2, so P′=λx.P0′ with P0⇒P0′, a shorter derivation. By induction P0′⇒P0∗. Rule 4 gives (λx.P0′)Q′⇒P0∗[x:=Q∗]=(PQ)∗.
- Rule 4: (λx.P)Q⇒P′[x:=Q′] with P⇒P′ and Q⇒Q′. By induction P′⇒P∗ and Q′⇒Q∗. Lemma 3 gives P′[x:=Q′]⇒P∗[x:=Q∗]=((λx.P)Q)∗. □
Lemma 5 (diamond). If M⇒M1 and M⇒M2, then M1⇒M∗ and M2⇒M∗.
Proof. Lemma 4, applied twice. □
Lemma 6 (tiling). If a relation ⇒ has the diamond property, so does ⇒∗.
Proof. First, if M⇒M1 and M⇒nM2, then M1⇒nP and M2⇒P for some P: by induction on n, close the first diamond, then apply the induction hypothesis to the remaining n−1 steps. Next, if M⇒mM1 and M⇒nM2, then M1⇒nP and M2⇒mP for some P: by induction on m, using the first claim for the first step of the m steps and the induction hypothesis for the rest. □
Theorem. →β is confluent.
Proof. Let M↠βM1 and M↠βM2. By Lemma 2, M⇒∗M1 and M⇒∗M2. By Lemmas 5 and 6 there is P with M1⇒∗P and M2⇒∗P. By Lemma 2 again, M1↠βP and M2↠βP. ■
The proof also bounds the length of the join: if M1 and M2 are reached by m and n parallel steps, they meet after n and m parallel steps.