Fall 98, CSE 520: Lecture 3 (Sep 3)


Consistency of the Lambda Calculus

We will show that the Lambda Calculus is consistent, in the sense that not all terms are equivalent (lambda-convertible). In particular, different Church's numerals are not lambda-convertible. Note that if the Church's numerals were identified by lambda-conversion, then the result of lambda-definability (Lecture 2) would not be of any interest.

In order to prove this result, it is convenient to introduce the notion of beta-reduction.

Beta reduction

The notion of conversion is symmetric, but from a computational point of view the beta rule has a direction. This directionality is captured in the concept of beta-reduction.

From now on, we will reason modulo alpha-renaming, i.e. we will identify terms which are alpha-convertible.

Note: the lambda-conversion is the reflexive, symmetric, and transitive closure of -> (or equivalently, of ->>)

Theorem (Church-Rosser) ->> is confluent (enjoyes the diamond property). Namely, if M ->> N and M ->> P, then there exists Q such that N ->> Q and P ->> Q.

Corollary If N = P then there exists Q such that N ->> Q and P ->> Q.

As a consequence we have:

Theorem The Lambda Calculus is consistent. In particular, different Church's numerals are not lambda-convertible.

In fact, if [m] = [n], then from previous corollary there must exist P such that [m] ->> P and [n] ->> P. However, Church's numerals are in normal form, i.e. they cannot be reduced. Hence we mush have that [m] and P and [n] are identical (modulo alpha-renaming). But, by definition of Church's numerals, [m] and [n] are identical only if m and n are the same number.

Programming Languages based on the Lambda Calculus

The Lambda Calculus is the basis of the functional languages. These usually have a "core" corresponding to the Lambda Calculus, plus: Several languages have been proposed. For instance:

Typed Lambda Calculus

There are two main type systems for the symple typed Lambda Calculus: The system of Curry (1934) and the system of Church (1940).

The Type System of Curry

Hystorical note: Haskell Curry lived in State College and worked at the Mathematical Department of Penn State! See the dedication to him at the entrance of the Math building.

In this system, the syntax of Lambda terms is the same as in the untyped version.

The types are defined by the following grammar:

Type ::= TVar           (type variable)
       | Type -> Type   (function)

The system allows to derive statements of the following form:

G |- M : A
meaning: under the assumptions G (asociations between lambda variables and types), the lambda term M has type A.

The rules for the Type System are the following:

(var)  ---------------   if x : A is in G
         G |- x : A
 

         G |- M : A -> B    G |- N : A
(app)  ----------------------------------
               G |- M N : B
 

          G , x : A |- M : B
(abs)  ------------------------
         G |- \x. M : A -> B