5

For a computable real number $x$, let $A_x : \mathbb N \to \mathbb Z$ be a computable function representing x such that for all $n>0$, $\frac{A_x(n)-1}{n} \leq x \leq \frac{A_x(n)+1}{n}$.

Does there exist a computable function $f : (\mathbb N \to \mathbb Z) \to (\mathbb N \to \mathbb Z)$ such that for all computable functions $A_x,A_y$, if $f(A_x) = A_y$, then $y$ is rational if and only if $x$ is irrational?

In other words, does there exist a computable function that maps (computable) irrationals to rationals and vice versa? In contrast, we can construct a perfectly well-defined function that returns $1$ when its input is irrational and $\sqrt 2$ when the input is rational. But since rationality checking is undecidable in general, this function would be uncomputable.

A positive answer would allow us to construct a number $y$ that is rational if and only if, for instance, $e^e$ is irrational without knowing whether or not $e^e$ is irrational.

1 Answers1

3

The answer is negative: assuming the model you have in mind is type 2 computability (but I believe this is also true for type 1 computability), all computable functions $\mathbb{R} \to \mathbb{R}$ are continuous (see e.g. some of the answers to this question), but there is no continuous function that swaps the rationals and the irrationals (see this question).