Is there a known "standard" injective function $f: \mathbb{R} \to \mathbb{R} \setminus \mathbb{Q}$? Or actually any injective function, doesn't have to be "standard/simple."
2 Answers
Pick an irrational number $0.a_1a_2...a_n... \in (0,1)$.
Define $f: (0,1) \to (0,1)$ the following way:
$$f(0.b_1b_2...b_n...)=0.a_1b_1a_2b_2...a_nb_n....$$
It is easy to see that $f$ takes only irrational values [If $0.a_1b_1a_2b_2...a_nb_n....$ is periodic, it is easy to see that $0.a_1a_2...a_n... $ would be periodic].
Now, $g(x)=f( \frac{\arctan(x)+\frac{\pi}{2}}{\pi})$ satisfies the desired condition.
- 132,525
Here's another approach. Bijectively enumerate $\mathbb{Q}$ as $\{q_n:n\in\mathbb{N}\}$.
Define $f:\mathbb{R}\to\mathbb{R}\setminus \mathbb{Q}$ by $$ f(x)=\begin{cases}\sqrt{2}+2n &\text{if } \exists n\in\mathbb{N}[x=q_n]\\\sqrt{2}+2n+1 &\text{if } \exists n\in\mathbb{N}[x=\sqrt{2}+n]\\x &\text{otherwise}\end{cases} $$ Note that $f$ is bijective. Naturally, any irrational in place of $\sqrt{2}$ works.
Also, the above works for any countable subset of an uncountable set (assuming very mild AC), by essentially the same argument.
As an additional comment, any such injection has to be a bit ugly. For example, there can be no such continuous injection. Indeed, if $f:\mathbb{R}\to \mathbb{R}\setminus\mathbb{Q}$ is continuous, then $f[\mathbb{R}]$ is connected. But $\mathbb{R}\setminus\mathbb{Q}$ is totally disconnected (in fact zero-dimensional, as it is homeomorphic to Baire space), thus $f[\mathbb{R}]$ is a singleton, so $f$ is constant and in particular not injective.
Note, however, that the function $f$ constructed above is Borel.
- 13,044
-
1In fact, your function $f(x)$ is a Borel bijection. – Alex Kruckman Oct 16 '19 at 04:10
-
@AlexKruckman You are, of course, correct. Thanks! – Reveillark Oct 16 '19 at 04:10