User:Thepigdog/play2

Derivation of the Y combinator
Curry's Y combinator may be readily obtained from the definition of y. Starting with a let expresion,


 * [0] - $$ \operatorname{let} y\ f = f\ (y\ f) \operatorname{in} y $$


 * [1] - $$ \lambda f.\operatorname{let} y\ f = f\ (y\ f) \operatorname{in} y\ f $$

Define $$ y\ f = x $$
 * [2] - $$ \lambda f.\operatorname{let} x = f\ x \operatorname{in} x $$

Define $$ x = z\ z $$
 * [3] - $$ \lambda f.\operatorname{let} z\ z = f\ (z\ z) \operatorname{in} z\ z $$

Eta reduction
 * [4] - $$ \lambda f.\operatorname{let} z = \lambda z.f\ (z\ z) \operatorname{in} z\ z $$

Let rule,
 * [5] - $$ \lambda f.(\lambda z.z\ z) (\lambda z.f\ z\ z) $$