Why use *λx.x* instead of *f(x)*?

209 Views Asked by At

In my semantics class, we're learning about using (abusing?) lambda calculus. So far the professor hasn't imparted any reason for using λx.x instead of using f(x).

  • Why use lambdas instead of basic functions?
  • Why do mathematicians notate lambdas, λx.x; wouldn't λ(x) suffice?

Thank you

1

There are 1 best solutions below

0
On BEST ANSWER

An alternative notation for $\lambda$ is $\mapsto$. For instance, the following mean the same:

  • $x\mapsto x+3$
  • $\lambda x. x+3$

You could have defined it like $f(x) = x+3$, but then $f$ becomes an entity in your discourse. And having to name every function you need becomes cumbersome after a while, especially if they are of no particular interest and you just want to convey their correspondence.

To understand why you need to write $\lambda x.x+3$ instead of simply $\lambda(x+3)$, consider the following function definition (given in the three different notations we are addressing):

  • $x\mapsto (y\mapsto x-y)$
  • $\lambda x.(\lambda y. x-y)$
  • $f(x) = g(x,\cdot)$ where $g(x,y) = x-y$

In all of the above definitions it is clear that $x$ is the first argument and $y$ is the second. But, if you write $\lambda(\lambda (x-y))$, then that information is lost precisely because we have not associated with each $\lambda$ its corresponding argument, i.e. $\lambda(\lambda(x-y))$ could stand for both $\lambda x.(\lambda y.x-y)$ and $\lambda y.(\lambda x.x-y)$.