I’m following along to a derivation of the function that returns the sum of the first $n$ natural numbers in this brilliant.org article on Lambda Calculus. To get to the derivation, either
- Go to Fixed Points and Recursion section > Recursion subsection > the first Example in that subsection.
- Or, if it is collapsed, expand the Fixed Points and Recursion section, then search (
Ctrl-F
orCmd-F
) for the followingLet us try to implement a function that returns the sum of the first
It seems to me like they make the following argument:
- $f$ is a fixed point of some function $h$, i.e. $f = hf$. (See footnote $^1$)
- Hey, you know what else is a fixed-point of $h$? ($\Theta h$) is a fixed-point of $h$ (where $\Theta$ is Turing’s fixed-point combinator)
- Conclude from
1.
and2.
that $f = \Theta h$.
I’m wondering if that’s a valid conclusion. It seems like it doesn’t necessarily have to follow from the premises (1.
and 2.
). It seems to assume something - it seems to assume either:
- $h$ has only one fixed-point, so if we find two things that are each a fixed-point of $h$, then the two things must be the same thing, or
- more strongly, that all fixed-points of a function $h$ are equal to each other.
$^1$: In the article’s derivation, $h$ is
$$(\lambda g. \lambda n.\textsf{ifThenElse}\ (\textsf{isZero}\ n)\ \bar 0\ (\textsf{add}\ n\ (g\ (\textsf{pred}\ n))))$$
where $\textsf{ifThenElse}$, $\textsf{isZero}$, $\textsf{add}$, and $\textsf{pred}$ are functions defined earlier in the article.