0

Why does ($\lambda$c.x) $\lambda$e.f simplify to x?

The next step in this reduction I thought was to replace all c's with x. But there are no c's. What happens with the $\lambda$e.f?

I have gotten it from this example on YouTube, which I could follow, up to this point.

drumfire
  • 103
  • 4
    To reduce this, you replace all the $c$s in $x$ with $\lambda e.f$. But since there are no $c$s, all you're left with is $x$. – JonathanZ Dec 01 '22 at 00:08

1 Answers1

3

The function $\lambda c.x$ is just a function that returns $x$ no matter what the input is. When you write:

$$ (\lambda c.x)(\lambda e.f) $$

What you should be doing is substituting all the $c$'s in the expression $x$ with $(\lambda e.f)$. Since there are no $c$'s in the expression $x$, the result of the substitution $x[c:= (\lambda e.f)]$ is simply $x$.

In a lambda-expression $\lambda x.(y)$, you should view $x$ as the parameter of the anonymous function and $y$ as the body, in which to perform the substitutions. For any further clarification I'll be available in the comments.