# Can I construct a bijection between (0,1) and [0,1] using sets and sup/inf? (Proof verification)

This question comes from a class I'm in currently: Find a 1-1 onto map between $(0,1)$ and $[0,1]$.

Let $r \in (0,1)$. Now, define the function $f: (0,1) \rightarrow S$ such that $$f(r) = s = \begin{cases} \lbrace x \in \mathbb{R} \mid r \leq x <1/2 \rbrace, \quad r <1/2 \\ \lbrace x \in \mathbb{R} \mid 1/2 < x \leq r \rbrace, \quad r \geq 1/2 \end{cases}$$ This is clearly a bijection, for each element of $(0,1)$ is mapped to a unique element $s$, for every $s \in S$. Now, let us define the function $g: S \rightarrow [0,1]$ such that, for $s \in S$, $$g(s) =\begin{cases} \inf (s), \quad s \cap (1/2,1]= \emptyset\\ \sup (s), \quad s \cap [0,1/2)=\emptyset \end{cases}$$ This function $g$ is 1-1, for if it were not, then there would exist two unequal infimum or supremum for the same set. This $g$ is also onto, for $g$ maps $S$ onto the whole of $[0,1] = (0,1) \cup \lbrace 0,1\rbrace$. Therefore, $g$ is a bijection, implying that the composition $g \circ f$ is also a bijection between $(0,1)$ and $[0,1]$.

• $f(\frac 1 2) = \emptyset$ by the second case of $f$'s definition. Which of the two cases that define $g$ applies to $s = \emptyset$? Even assuming $sup(\emptyset) = 0$ and $inf(\emptyset) = 1$ by convention. – BrianO Oct 14 '15 at 2:22
• Since $\inf\emptyset$ and $\sup\emptyset$ aren't defined, neither case can be used - you need to give a specific new case for $r={1\over 2}$. – Noah Schweber Oct 14 '15 at 2:23

First, note that there's a problem: if $r={1\over 2}$, then $f(r)=\emptyset$, so $g(f(r))$ is undefined.
However, that's not the only problem. Let's look at $g\circ f$ directly. If $r<{1\over 2}$, then $f(r)=[r, {1\over 2})$, which has empty intersection with $({1\over 2}, 1]$, so $g(f(r))=r$. Meanwhile, if $r>{1\over 2}$, then $f(r)=({1\over 2}, r]$, which has empty intersection with $[0, {1\over 2})$, so $g(f(r))=r$.
To sum up: $g(f(r))=r$, for all $r$! (Except $r={1\over 2}$ where it isn't defined, but can be easily fixed.) Your statement that $g$ is onto is unjustified.
• A hint towards building an explicit bijection: can you write $(0, 1)$ as a union $X\sqcup Y$, where $Y$ is countably infinite? How does this help? – Noah Schweber Oct 14 '15 at 2:22