I have trouble, when attempting to multiply Church numerals with lambda.
First, does this work?
MULT := $\lambda$mnfx.m ( PLUS n )
MULT := $\lambda$mnfx.m ( m SUCC n )
MULT := $\lambda$mnfx.m(m f(n f x))
Therefore if I multiply 3 ($\lambda$fx.f(f(f x))) and 4 ($\lambda$fx.f(f(f(f x)))), it should look like this when I start:
($\lambda$mnfx.m(m f(n f x)))($\lambda$fx.f(f(f x)))($\lambda$fx.f(f(f(f x))))
:= $\lambda$fx.$\lambda$fx.f(f(f x))($\lambda$fx.f(f(f x)) f($\lambda$fx.f(f(f(f x))) f x))
:= $\lambda$fx.$\lambda$fx.f(f(f x))($\lambda$fx.f(f(f x)) f(f(f(f(f x)))))
This is where I am confused. Do I do ($\lambda$fx.f(f(f x)))[f := f(f(f(f(f x))))]? Or ($\lambda$fx.f(f(f x)))[f := f][x := f(f(f(f x)))]?
If I do the first, then I end up with:
:= $\lambda$fx.$\lambda$fx.f(f(f x))($\lambda$fx.f(f(f x)) f(f(f(f(f x)))))
:= $\lambda$fx.$\lambda$fx.f(f(f x))($\lambda$x.f(f(f(f(f x))))(f(f(f(f(f x))))(f(f(f(f(f x)))) x))
And I am unsure of where to go from there, because I have no parameters for the x.
If I do the second, then I end up with:
:= $\lambda$fx.$\lambda$fx.f(f(f x))(f
:= $\lambda$fx.f(f(f(f(f(f(f(f(f x))))))))
or 3 * 4 = 8, so that cannot be right.