Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1 Introduction to Lambda Calculus In this section, we will present a brief introduction to untyped lambda calculus. The main purpose is to introduce the
Introduction to Lambda Calculus
In this section, we will present a brief introduction to untyped lambda calculus.
The main purpose is to introduce the notions of alphaequivalence and betaequivalence, which are subsequently used in typed lambda calculus.
Lambda Terms
Let V be an infinite and enumerable set of objects called variables. The set of
lambda terms is the smallest subset A of V cup lambda such that:
V A
If M N in A then MN in A
If x in V and M in A then lambda xM in A
Alternatively, A is the set inductively generated by the generating system whose
universe is V cup lambda and whose set of rules is:
x in V
x in A
M in A N in A
MN in A
x in V M in A
lambda xM in A
We will highlight some conventions to abbreviate the use of parentheses in
expressions. Outer parentheses are always omitted whenever possible. The
application is left associative. Thus, MNP abbreviates MNP Application
has precedence over abstraction Thus, lambda xMN abbreviates lambda xMN Finally,
successive abstractions are combined into a single and associated from the right:
lambda xlambda yM abbreviates lambda xlambda yM
Set of Subterms
Now, we will illustrate how to define functions recursively on the set A The
following definition appears wellformed. However, it is important to highlight
that a certain detail was overlooked, that the generating system is either freely
generated or has the property of unique readability. This implies that a term
can only be formed from the rules in one unique way. For each x and for each
M N in A let st : A
A such that:
stxx
stMN stMcup stNcup MN
stlambda xM stMcup lambda xM
For each M in A we say that stM is the set of the subterms of M
Free Variables
For each x in V and each M N in A let st : A
V
such that:
freexx
freeMN freeMcup freeN
freelambda xM freeMx
For each M in A we say that freeM is the set of the free variables of M
Closed Term or Combinator
A term M in A is a combinator or closed if freeM
Substitution
Lets define a partial function that leads terms into terms. If M and N are
terms and x is a variable, we denote by Mx : N the term obtained from M
by substituting every free occurrence of x in M with N Formally, we define:
xx : N N
yx : N y if x y
P Qx : NPx : NQx : N
lambda xPx : Nlambda xP
lambda yPx : Nlambda yPx : N if x y
This definition, for example, implies that lambda xlambda yxx : y equals lambda yy
which is contrary to the expectation we might have regarding the notion of
substitution. Subsequently, we establish a side condition called alpha equivalence
to legitimize when a substitution makes sense.
The next lemma illustrates how to establish properties involving the syntactic entities, the lambda terms, of Lambda Calculus.
Lemma For every x in V and for all M N in A if x in freeM then
Mx : N M
Proof. The proof is by induction on M
Case : M in V
In this case, M x because x in freeM where Mx : N M
Case : There exist P Q in A such that M P Q
Since x in freeM then x in freeP and x in freeQ Therefore, by the
induction hypothesis, Px : N P and Qx : N Q Hence,
P Qx : NPx : NQx : NP Q
Case : There exists P in A such that M lambda xP
In this case, lambda xPx : Nlambda xP
Case : There exists y x and P in Lambda such that M lambda yP
Since x in freeM then x in freeP By the induction hypothesis, Px : N
P Therefore,
lambda yPx : Nlambda yPx : Nlambda yP
We now define when a substitution is properly defined. Let M and N be
terms and x a variable. We say that N can substitute x in M and we write
Mx : N if for every free variable y in Mlambda yP is a subterm of M that
is if lambda yP in stM then y is not free in P or in other words, any subterm
of M that can capture a free variable of N does not contain x as one of its free
variables.
Exercise
For every x y in V and every M N L in Lambda if
i x in freeL or y in freeM and
ii Mx : N Ny : L and Mx : Ny : L
then
a My : L andMy : Lx : Ny : L and
b Mx : Ny : L My : Lx : Ny : L
Proof. The proof is by induction on M
Case : M in V
Prove!
Case : There exists P in A such that M lambda xP
Prove!
Case : There exists P in A and z in V x y such that M lambda zP
Prove!
Case : Prove the remaining cases
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started