I was reading these notes on lambda calculus, and I am having some trouble reducing / evaluating one of the expressions at the start.
In particular the function (λf.λx.f(f(x)))(λy.y^2)(5).
How exactly do I begin this? He says the answer comes out to be 625. My mathematical intuition says that we proceed like so: (λf.λx.f(f(x)))(5^2) and he said previously that f(x) is the map
x |-> x^2
so f(f(x)) is the composition which would be f o f = (f)^2 = x^4
So further reducing our lambda expression we get
(λf.λx.x^4))(5^2)
But then we would plug 25 into x^4 which gives us 25*25*25*25 = 390,625.
(λf.(390,625))
then when we get here, I have absolutely no idea what this expression represents?
What part of the Lambda Calculus have I misunderstood? Is the way I am reducing expressions correct?