0
$\begingroup$

NB: This is a full reworking of an earlier post of mine (which I have now deleted). That earlier post was flawed due to a technicality (applying $\eta$-reduction without considering the question of free variables) that clouded issue. This version sidesteps that technicality altogether (I think).


The $\mathbf{identity}$ function can be represented like this:

$$\lambda f.f\label{a}\tag{1}$$

Now, if I understand $\eta$-reduction correctly, the (atomic!) name that makes up the body of this function, namely $f$, is equivalent to the function $\lambda x.(f\;x)$.

Consider the expression obtained by replacing the body of the identity function above with the equivalent expression $\lambda x.f\;x$ (thus performing an "$\eta$-expansion", if you will):

$$ \lambda f.\lambda x.(f\;x)\label{b}\tag{2} $$

My question is: are expressions $\ref{a}$ and $\ref{b}$ equivalent?


My naive answer to this question is: "of course!", but I hesitate because

  1. I'm not completely confident on which manipulations produce equivalent $\lambda$-expressions; and, more importantly
  2. My book gives expressions $\ref{a}$ and $\ref{b}$ different names ($\mathbf{identity}$ and $\mathbf{apply}$, respectively), and says nothing about their being equivalent.

1 Answers 1

1

One way to see if they are equivalent is to just see how they treat parameters.

$$Iab = ab$$ $$(\lambda f.f)ab = ab$$ $$(\lambda f. \lambda x . fx)ab = (\lambda x.ax)b = ab$$

All become ab when given arbitrary parameters a then b, so they are equivalent.