Fixed-point theorem and Y-combinator
Fixed-Point Theorem
The Fixed-Point Theorem states that for any function
This means that
What is a Fixed Point? 🤔
A fixed point of a function
In simple terms:
This means
Real-World Example 🌍
Think of pressing an elevator button:
- If you're on the 3rd floor and press "3", the elevator doesn't move.
- The 3rd floor is a fixed point because pressing "3" doesn't change your position.
Another Example: Multiplication
Imagine a function that doubles a number:
-
If we apply
to : -
is a fixed point because doubling it still gives .
🚀 A fixed point is a value that "stays put" under a function! It will help us to stop the recursion later...
Constructing a Fixed Point
To construct a fixed point, we define a special term
Now, let’s set:
Expanding:
Now applying
Thus, we have:
✅ We found a fixed point for
The Y-Combinator
The Y-Combinator is a special lambda function that finds fixed points for any function
Definition of the Y-Combinator
When applied to
Expanding:
Now, look at this magic:
Thus,
✅
Why is the Y-Combinator Important?
- 🔁 Enables recursion in lambda calculus, where self-reference is not inherently possible.
- 🏗 Builds loops and functions that call themselves indefinitely.
- 🔍 Used in functional programming (e.g., Haskell, Scala) for defining recursive functions without explicit self-references.