This is absolutely fascinating, but I'm having trouble really grokking the principle behind this. I understand fixed points of mathematical functions with numbers, but my mind seems to explode in the transition to functions of functions.
Is there a really clear explanation anywhere of the idea behind all this? Or is it the kind of thing where this is simple as it gets, and I just need to put in more work to get it?
I don't know if these ramblings will help, but here are some thoughts :)
First of all, the Y-combinator is a function of a function of a function (of a number), so we're three levels deep, which is part of what causes the head-spinning, I think. So ignore the Y-combinator for the moment.
Simply consider the function of a function (of a number) F:
F = function (f) {
return function(n) {
return (n == 0) ? 1 : (n*f(n - 1)); };
};
Here the argument f is a function number -> number, and the return value from F is itself also a function number -> number.
We can pass whatever functions from numbers to numbers we want to F to make new functions from numbers to numbers.
So we know that one possible value for Y(F) is fact.
The article makes the claim that there is only one fixed point of F, which means Y(f) must actually be fact, but to be honest, I'm not sure why we know there can't be other fixed points of F which Y(F) might give us (though maybe this is obvious and I'm being stupid :).
But anyway we can tell by tracing through the definition of Y that it we really do get Y(F) = fact.
Oh, in the morning it occurs to me that a simple argument by induction will show that any function g with g = F(g) must in fact be factorial, so that's one way we can know the fixed point is unique. :)
Is there a really clear explanation anywhere of the idea behind all this? Or is it the kind of thing where this is simple as it gets, and I just need to put in more work to get it?