## Advanced notes on the Lambda Calculus ##
Hankin uses the symbol
→
for one-step contraction,
and the symbol ↠
for
zero-or-more step reduction. Hindley and Seldin use
⊳1
and
⊳
.
As we said in the main notes, when `M` and `N` are such that there's some `P` that `M` reduces to by zero or more steps, and that `N` also reduces to by zero or more steps, then we say that `M` and `N` are **beta-convertible**. We write that like this:
M <~~> N
This is what plays the role of equality in the lambda calculus. Hankin
uses the symbol `=` for this. So too do Hindley and
Seldin. Personally, we keep confusing that with the relation to be
described next, so let's use the `<~~>` notation instead. Note that
`M <~~> N` doesn't mean that each of `M` and `N` are reducible to each other;
that only holds when `M` and `N` are the same expression. (Or, with
our convention of only saying "reducible" for one or more reduction
steps, it never holds.)
In the metatheory, it's also sometimes useful to talk about formulas
that are syntactically equivalent *before any reductions take
place*. Hankin uses the symbol ≡
for this. So too
do Hindley and Seldin. We'll use that too, and will avoid using `=`
when discussing the metatheory. Instead we'll use `<~~>` as we said
above. When we want to introduce a stipulative definition, we'll write
it out longhand, as in:
> `T` is defined to be `(M N)`.
or:
> Let `T` be `(M N)`.
We'll regard the following two expressions:
(\x (x y))
(\z (z y))
as syntactically equivalent, since they only involve a typographic
change of a bound variable. Read Hankin Section 2.3 for discussion of
different attitudes one can take about this.
Note that neither of the above expressions are identical to:
(\x (x w))
because here it's a free variable that's been changed. Nor are they identical to:
(\y (y y))
because here the second occurrence of `y` is no longer free.
There is plenty of discussion of this, and the fine points of how
substitution works, in Hankin and in various of the tutorials we'll
link to about the lambda calculus. We expect you have a good
intuitive understanding of what to do already, though, even if you're
not able to articulate it rigorously.
## Substitution and Alpha-Conversion ##
Intuitively, (a) and (b) express the application of the same function to the argument `y`:
(\x. \z. z x) y
(\x. \y. y x) y
(\z. (\z. z z) y
(λ. λ. _ _) y
^ ^ | |
| |__| |
|_______|
Here there are no bound variables, but *bound positions* remain. We can
regard formula like (a) and (b) as just helpfully readable ways to designate
these abstract structures.
A version of this last approach is known as [de Bruijn notation](http://en.wikipedia.org/wiki/De_Bruijn_index) for the lambda calculus.
It doesn't seem to matter which of these approaches one takes; the logical
properties of the systems are exactly the same. It just affects the particulars
of how one states the rules for substitution, and so on. And whether one talks
about expressions being literally "syntactically identical," or whether one
instead counts them as "equivalent modulu alpha-conversion."
(Linguistic trivia: some linguistic discussions do suppose that
alphabetic variance has important linguistic consequences; see Ivan Sag's
dissertation.)
Next week, we'll discuss other systems that lack variables. Those systems will
not just lack variables in the sense that de Bruijn notation does; they will
furthermore lack any notion of a bound position.
## Review: syntactic equality, reduction, convertibility ##
Define `N` to be `(\x. x y) z`. Then `N` and `(\x. x y) z` are syntactically equal,
and we're counting them as syntactically equal to `(\z. z y) z` as well. We'll express
all these claims in our metalanguage as:
N ≡ (\x. x y) z ≡ (\z. z y) z
This:
N ~~> z y
means that `N` beta-reduces to `z y`. This:
M <~~> N
means that `M` and `N` are beta-convertible, that is, that there's some common term they both reduce to in zero or more steps.
The symbols `~~>` and `<~~>` aren't part of what we're calling "the Lambda
Calculus". In our mouths, they're just part of our metatheory for talking about it. In the uses of
the Lambda Calculus as a formal proof theory, one or the other of these
symbols (or some notational variant of them) *is* added to the object language. But only in outermost contexts. It's like the "sequent" symbol (written `=>` or ⊢
) in [Gentzen-style proof systems](https://en.wikipedia.org/wiki/Sequent_calculus) for logic. You can't embed the `~~>` or `<~~>` symbol inside lambda terms.
See Hankin Sections 2.2 and 2.4 for the proof theory using `<~~>` (which he
writes as `=`). He discusses the proof theory using `~~>` in his Chapter 3.
This material is covered in slightly different ways (different organization and
some differences in terminology and notation) in Chapters 1, 6, and 7 of the
Hindley & Seldin.