0% found this document useful (0 votes)
17 views

Notes On Lambda Calculus: Tytus Metrycki

The document defines lambda calculus terms and concepts. It begins by defining pre-terms (Λ−) as variables (V), applications of pre-terms, or abstractions binding a variable. It then defines lambda terms (Λ) as an equivalence class of pre-terms under alpha equivalence. Key concepts introduced include free variables (F V), closed terms, substitution of terms for variables, and beta reduction rewriting an application using substitution.

Uploaded by

Tytus Metrycki
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

Notes On Lambda Calculus: Tytus Metrycki

The document defines lambda calculus terms and concepts. It begins by defining pre-terms (Λ−) as variables (V), applications of pre-terms, or abstractions binding a variable. It then defines lambda terms (Λ) as an equivalence class of pre-terms under alpha equivalence. Key concepts introduced include free variables (F V), closed terms, substitution of terms for variables, and beta reduction rewriting an application using substitution.

Uploaded by

Tytus Metrycki
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Notes on lambda calculus

Tytus Metrycki

Definition 1. Pre-terms
Let
V = {vi : i ∈ N}
denote an infinite alphabet. The set Λ− (pre-terms) is defined by following
grammar
Λ− ::= V | (Λ− Λ− ) | (λ V Λ− )
Remark 1. The expression will be surrounded by parenthesis when needed
to avoid ambiguity. Otherwise: the convection I use is left-to-right function
application.

Remark 2. Examples of pre-terms


The following are examples of pre-terms.
• v0 v1 v2 ∈ Λ−
• λ v0 . (v0 v1 ) ∈ Λ−

• (λ v0 . v0 )(λ v1 . v1 v1 )
Notation 1. I will use uppercase letter to denote arbitrary elements of Λ− and
lowercase to denote arbitrary elements of V
Notation 2. I will write λ v0 . . . vn . M for λv0 . . . vn M

Definition 2. Variable, Abstraction, Application


A pre-term of a form x is called variable.
A pre-term of a form λ x. M is called abstraction.
A pre-term of a form M, N is called an application (of M to N ).
Definition 3. Free variables
Let M ∈ Λ− . We define F V (M ) ⊆ V (free variables) as follows:

F V (x) := {x}
F V (λ x. M ) := F V (P ) \ {x}
F V (P Q) := F V (P ) ∪ F V (Q)

Definition 4. Closed pre-term


We call M closed if M has no free variables that is: F V (M ) = ∅

1
Definition 5. Substitution
For M, N ∈ Λ− and x ∈ V the substation of N for x in M , written M [x :=
N ] ∈ Λ− is defined as follows

x[x := N ] ≡ N
y[x := N ] ≡ y
(P Q)[x := N ] ≡ P [x := N ]Q[x := N ]
(λ x. P )[x := N ] ≡ λ x. P
(λ y. P )[x := N ] ≡ λ y. P [x := N ] if y 6∈ F V (N ) or x 6∈ F V (P )
(λ y. P )[x := N ] ≡ λ z. P [y := z][x := N ] if y ∈ F V (N ) and x ∈ F V (P )

where z = vi such that i is minimal and vi 6∈ F V (P ) ∪ F V (N )


Definition 6. α−equivalence, written =α , be the smallest equivalence (sym-
metric, transitive, reflexive) relation on Λ− , such that

∀ P ∈ Λ− : P =α P
∀ y 6∈ F V (P ) : λ x. P =α λ y. P [x := y]

and closed under following rules:

P =α P 0 =⇒ ∀ x ∈ V : λ x. P =α λ x. P 0
P =α P 0 =⇒ ∀ Z ∈ Λ− : P Z =α P 0 Z
P =α P 0 =⇒ ∀ Z ∈ Λ− : ZP =α ZP 0

Definition 7. λ−terms
The set of lambda term is defined as an equivalence relation α on Λ− .
Symbolically:
Λ = Λ− / =α = {[M ]α : M ∈ Λ− }
Remark 3. From now on we will informally write M instead of [M ]α since we
don’t care much about pre-terms. Except when explicitly stated otherwise.
Definition 8. Free variables in Λ
Let M ∈ Λ. We define F V (M ) ⊆ V (free variables) as follows:

F V (x) := {x}
F V (λ x. M ) := F V (P ) \ {x}
F V (P Q) := F V (P ) ∪ F V (Q)

Definition 9. Closed form


We call M closed if M has no free variables that is: F V (M ) = ∅.
Definition 10. Substitution
For M, N ∈ Λ and x ∈ V the substation of N for x in M , written M [x := N ] ∈ Λ

2
is defined as follows

x[x := N ] ≡ N
y[x := N ] ≡ y if x 6= y
(P Q)[x := N ] ≡ P [x := N ]Q[x := N ]
(λ y. P )[x := N ] ≡ λ y. P [x := N ] if y 6∈ F V (N ) or x 6∈ F V (P )

Definition 11. →β reduction


We define →β as the smallest relation on Λ such that

(λ x. P )Q →β P [x := Q]

You might also like