I have come up with an explanation for the countability of the reals and I am wondering where I went wrong.
In the lambda calculus, all integers can be represented by functions fairly simply. Rationals are represented as pairs of integers. Reals are represented as limits of rational functions.
I have come up with a simple way to demonstrate this. To represent $n\in\mathbb R$, use a function $f$ such that $\lim_{x\to\infty} f(x) = n$. For example, $\sqrt 2$ can be represented using its continuous fraction, in the lambda calculus $\lambda n.ng(0)$, where $g(x) = 1/(2+x)$. This calls the $g$ function $n$ times. $g$ and $0$ can be represented in the lambda calculus as well.
Next, I will show that all functions in the lambda calculus are countable using the SKI combinator calculus. Any function can be represented as a string of S
, K
, (
, )
, and optionally I
, so the $n$th function could be the $n$th valid string of these characters.
If all functions in the lambda calculus are countable and all reals can be represented as function in the lambda calculus, then the reals must be countable, but this is of course false. Where did I err?