Post 1


This is the first post in the PLT section. It is concerning the Untyped/Simply-Typed Lambda Calculus, and an important result stemming from a foundational Theorem in λ and λ.

I already assume the reader has knowledge of the syntax of the Untyped Lambda Calculus and Simply-Typed Lambda Calculus. I also assume that the reader is familiar with the notions of β-reduction, α-equivalence and substitution.

The post is (unfortunately for the reader), a very lengthy post about an alternative proof of a Corollary to the Church-Rosser Theorem, that I thought of.

NOTE : I shall use β to refer to both, chained AND singular β-reductions.

Let’s just begin by stating the Church-Rosser Theorem and the definition of = β . It’s elegant to see that the Church-Rosser Theorem holds for λ and λ.

Church-Rosser Theorem : Given a legal-term MΛ, ,(M β M 0 )(M β M 1 ), NΛ, ,(M 0 β N)(M 1 β N).

Proof : Various proofs for this Theorem have been presented over the years. The most succinct one I know of is presented by Takahashi in 1995, using an Algebraic basis. A more standard proof is presented by Barendregt in his book : The Lambda Calculus. Its Syntax and Semantics (Studies in Logic).

I shall not discuss the proof here, and we shall assume that the Theorem is already true for future reference in this post.

Definition (= β ) : Two terms M,N are said to be M= β N, if :

i) M 0 M, M n N

ii) n,,(M i β M i+1 )(M i β M i+1 ),i[1,n]

All this definition is saying is that if two terms can reach some common Lambda-Term by some sequence of bi-directional β-reductions, they are equivalent.

The Corollary to this theorem (the main concern of this post), is actually a very important statement.

Corollary : Given two terms M,NΛ,,M= β N, we have that, LΛ,,(M β L)(N β L).

Plan : The proof to the Corollary presented by Nederpelt & Geuvers in their text Type Theory And Formal Proof in Chapter 1, Pg 22-23 uses Induction.

While the proof is succinct (as with most proofs using induction), I feel it does not really give a full understanding of how exactly the L term is constructed. Nor does it, in my opinion, allow us to get an intuitive grasp on the structure of evaluation paths for two terms that are β-equivalent. Nonetheless, I shall first briefly expose their proof, and then move on to mine.

Proof (Nederpelt & Geuvers) : The Theorem is essentially saying that if two terms are β-equivalent, then we can find a common redex for them. As stated, the text takes the inductive approach, which goes as follows :

Base Case : Assume i=0. Then, M=M 0 =N, and the Theorem is true.

Inductive Hypothesis : Assume that, i<n, the Theorem holds true.

Inductive Case : There are actually 2 cases we need to prove here.

Case 1 : M n-1 β M n

In this case, the Evaluations look as follows :

MM 0 .... M n-1 β M n N

Notice that, as the IH applies to M n-1 (because n-1<n, and, M 0 = β M n-1 ), we have that, L ' ,,(M β L ' )(M n-1 β L ' ).

This now tells us that 2 terms that M n-1 β-reduces to (M n-1 β L ' and M n-1 β N), lending itself vulnerable to the Church-Rosser Theorem.

This implies, LΛ,,(L ' β L)(M n β L).

And this is all we need, as we can use the transitivity of β-reductions to compose the reduction from M 0 as : M 0 β L ' β L.

So, (M 0 β L ' β L)(M n β L).

Case 2 : M n-1 β M n

In this case, the Evaluations look as follows :

MM 0 .... M n-1 β M n N

This case is actually even easier to see.

By IH on M n-1 , we construct:

L ' ,,(M β L ' )(M n-1 β L ' ). This actually completes the proof, because, now we have :

(M 0 β L ' )(L ' β M n-1 β M n ).

Clearly, in this case, L ' =L.

Q.E.D.

Proof 2 : Now, we move on to the method that I thought of, which is more tedious, yet far more informative. It also does not rely on induction. This method only requires the assumption of the Church-Rosser Theorem.

Let us first eliminate the 2 trivial cases, so that we can focus on the most generic case.

Case 1 : MM 0 β M 1 β .... β M n-1 β M n N

This is the case in which all reductions are right-arrows. So, M β NL

Case 2 : MM 0 β M 1 β .... β M n-1 β M n N

This is the case in which all reductions are left-arrows. So, LM β N

Case 3 : This is the final, and most generic case. While, technically, there are 4 of these that we should deal with, we’ll only deal with 2, as it will become apparent that symmetry will deal with the others the same as we deal with the first two. So, let’s first try to express β-equivalence in a way that is useful diagrammatically. As β-equivalence has a switching between right-arrows and left-arrows, there are terms that "switch" the direction in the Equivalence Set. Such terms are either sources of sinks (with the terms having the standard Graph-Theoretic meaning).

Therefore, one may rewrite a general equivalence diagram for M= β N in one of two ways (assuming that the first reduction on M 0 is a right-arrow) :

i) MM 0 β ... β M i 1 β ... β M i 2 β ... β M i k 1 β ... β M n N

ii) MM 0 β ... β M i 1 β ... β M i 2 β ... β M i k 2 β ... β M n N

Proof (i) : We can see that j 𝕖𝕧𝕖𝕟 , M i j is a source. While, j 𝕠𝕕𝕕 , M i j is a sink. As M k 1 is a sink, we have that, k 1 is odd. As M i even are sources, their neighboring sinks form 2 redexes that reduce to a common term by virtue of the Church-Rosser Theorem. More specifically :

(M i k-1 ,M i k ,M i k+1 ), where, k is even (and M k a source), L k ' , (M i k-1 β L k ' )(M i k+1 β L k ' ).

This creates a set of terms Λ ' ={L ' 2 ,L 4 ' ,..,L k 1 -1 ' }.

Now, because of the "sliding-window" that creates these terms, each of these has 2 parents, and each of the parents (excluding the first sink (M i 1 ) and last sink (M i k 1 )), have 2 children.

NOTE : M i 1 and M i k 1 only have 1 children, the first and last term in Λ ' .

As a result, we can apply the Church-Rosser Theorem again to all these parents. More precisely :

M i 2p+1 , for p{1,(k 1 -1) 2} , ,L 2p ' and L 2(p+1) ' , (M i 2p+1 β L 2p ' )(M i 2p+1 β L 2(p+1) ' ). Therefore, by the Church-Rosser Theorem, we have that :

There is a set of terms Λ '' ={L 2 '' ,L 4 '' ,...,L k 1 -3 '' }, where,

(L j ' β L j '' )(L j+2 ' β L j '' ), where, j{2,4,...,(k 1 -1)}

As one can see Λ '' has 1 term less than Λ ' .

We can continue to apply the Church-Rosser Theorem recursively, as now, the terms in Λ ' have 2 children each (except for L 2 ' and L k 1 -1 ' ).

In fact, this general pattern will hold, where, each Λ ' (j) set will continue to collapse by one, until at last there is only term in there. This term is the redex we are looking for. This redex is : L 2 ' (k 1 2) , where the notation of ' (m) indicates the term belongs to the m-th Lambda Set on the way down. So, we have :

(MM 0 β M i 1 β L 2 ' β L 2 '' ... β L 2 ' (k 1 2) )(NM n β M k 1 β L k 1 -1 ' β L k 1 -3 '' ... β L 2 ' (k 1 2) ).

Proof (ii) : The second case is similar, differing in only that :

a) k 2 is even, as it is a source.

b) The last term in the equivalence-set, M n has a direct redex that takes it to the final term : (NM n β L k 2 ' β L k 2 -2 '' ... β L 2 ' (k 1 2) ).

The path from the first term remains the same.

It is also easy to see that in the 2 cases that follow when the first reduction is a β , we can use symmetry to invert the paths and construct the redex we want.

Q.E.D.

As one can see, this proof is constructive as it explicitly creates this term (without using induction). Furthermore, this proof is better because it also gives an idea of the Complexity of evaluating this term given the ability to compute chained β-reductions.

- The height of the "Diamond" Graph is : 1+ h=1 k 2 (k 2-h)=1+k 2

- In the formula above (and below), k is the number of "switches" in the Equivalence Set. Furthermore, this graph is not a Tree, it is a DAG.

- Also, in the worst case, the number of nodes in this Graph are :

|V|=( h=1 k 2 (1+h))+n=(k 2)(k 2-1)+n

So, there you have it, a constructive proof to a very important corollary to the Church-Rosser Theorem.