# Does there exist a dense bijection on the unit interval

I was looking at the question "Are there any valid continuous Sudoku grids?" and that lead me to this question.

Let $$U$$ be the unit interval $$[0,1]$$ or $$[0,1)$$. (pick which is easier for you)

Does there exist a bijective function $$f: U \to U$$ such that for every subinterval $$I$$ of $$U$$, the set $$\{f(x)\ |\ x \in I\}$$ is dense in $$U$$?

• This is shown in one of the answers of the question you are citing... – Mushu Nrek Oct 28 '20 at 19:31

Choose open subintervals $$I_1,I_2,\dots$$ of $$U$$ such that if $$J$$ is an open subinterval of $$U,$$ then $$J$$ contains $$I_n$$ for some $$n.$$ (For example we could let $$I_1,I_2,\dots$$ be the open subintervals of $$U$$ with rational endpoints.)
We can then choose pairwise disjoint countable sets $$D_n\subset I_n$$ such that $$D_n$$ is dense in $$I_n$$ for each $$n.$$
And we can choose pairwise disjoint countable sets $$E_n\subset U$$ such that $$E_n$$ is dense in $$U$$ for each $$n.$$
Now define $$f:U\to U$$ as follows: For each $$n=1,2,\dots$$ let $$f$$ be a bijection of $$D_n$$ onto $$E_n.$$ Then $$f$$ is a bijection of $$\cup D_n$$ onto $$\cup E_n.$$ Now $$U\setminus \cup D_n$$ has the same cardinality as $$U\setminus \cup E_n.$$ So to finish the definition of $$f,$$ let $$f$$ be any bijection of $$U\setminus \cup D_n$$ onto $$U\setminus \cup E_n.$$
It follows that $$f:U\to U$$ is a bijection. Let $$I\subset U$$ be a subinterval. Then $$I_n\subset I$$ for some $$n.$$ Since $$f(I_n) = E_n,$$ $$f$$ is the desired function.
• Perfect! I'm thinking we could use $D_n = (\sqrt{p_n} \cdot \mathbb{Q}) \cap I_n$ and $E_n = (\sqrt{p_n} \cdot \mathbb{Q}) \cap U$, where $p_n$ is the $n$-th prime number. – Paul Oct 28 '20 at 22:33