4

It is easy to create a bijection between two bounded open intervals of $\mathbb{R}$, such as:

$$ \begin{align} f : (a,b) &\to (\alpha,\beta) \\ x &\mapsto \alpha+(x-a)(\beta-\alpha). \end{align} $$

It is also possible to biject a bounded open interval of $\mathbb{R}$ onto the whole of $\mathbb{R}$, e.g.:

$$ \begin{align} f : (a,b) &\to \mathbb{R} \\ x &\mapsto \tanh^{-1} x. \end{align} $$

Consider now the set of rational numbers $\mathbb{Q}$. The bijection between two bounded open intervals still holds, but is it possible to biject: $$ f : (p,q) \to \mathbb{Q} $$

where $p,q\in\mathbb{Q}$ and $(p,q) = \{x\in \mathbb{Q} : p < x < q\}$?

MGA
  • 9,636
  • 1
    Do you just want a bijection, or rather an order isomorphism? – Andrés E. Caicedo Aug 14 '14 at 06:10
  • 1
    I would suspect so--there are a countably infinite number of rationals between any two distinct real numbers, and so there must be a bijection between such an interval and $\Bbb Q$--but I don't know how to construct one. – Fargle Aug 14 '14 at 06:12
  • @AndresCaicedo I would be happy to see either/both. – MGA Aug 14 '14 at 06:12
  • @Fargle I suspect the same because $\mathbb{Q}$ is dense like $\mathbb{R}$. – MGA Aug 14 '14 at 06:13
  • I see. I also needed 0 to be in the open subset of $\mathbb{Q}$ for my function to work. – Eoin Aug 14 '14 at 06:23

4 Answers4

6

Cantor showed that any two countable densely ordered sets with no first or last element are order isomorphic. One can build the isomorphism using his Back and Forth Method.

If all we want is a bijection, we can more simply note that both sets are countably infinite.

André Nicolas
  • 507,029
  • If the interval is bounded but closed --- i.e. $[p,q]$ --- is there still a bijection but no longer an order isomorphism? – MGA Aug 14 '14 at 06:31
  • 1
    @MGA There is a bijection because they are the same cardinality, but they are not isomorphic as ordered sets because the closed interval $[p,q]$ has a maximum and a minimum, whereas $\Bbb Q$ has no such elements. (The existence or nonexistence of such purely-ordered-theoretically defined things is an invariant.) – anon Aug 14 '14 at 06:34
  • I believe an unstated aim in the OP is to have an order preserving monotonic bijection. – Oskar Limka Sep 14 '23 at 17:47
6

The answer to this question: (Is there a bijection between $(0,1)$ and $\mathbb{R}$ that preserves rationality?) -- that is, $f(x) = \frac{1}{x} - 2$ for $(0,\frac{1}{2})$ and $f(x) = 2 - \frac{1}{x - 1}$ on $[\frac{1}{2},1)$ -- is a bijection from $(0,1)$ to $\Bbb R$ that preserves rationality; then $f|_{\Bbb Q}$ is a bijection from $(0,1)_{\Bbb Q}$ to $\mathbb{Q}$.

I'm not sure how this could be extended to general $(p,q)$, but this is an example of one function for one such interval.

EDIT: as Whacka has pointed out, simply by composing this function with a bijection from $(0,1)_{\Bbb Q}$ to $(p,q)_{\Bbb Q}$, this may be achieved. One such map is $x \mapsto (q-p)x + p$, whose inverse is $x \mapsto \frac{x - p}{q - p}$.

So in general, a bijection from $(p,q)_{\Bbb Q}$ to $\Bbb Q$ is:

$f(x) = \frac{q - p}{x - p} - 2,\;x \in (p, \frac{p+q}{2})$

$f(x) = 2 - \frac{q - p}{x - q},\;x \in [\frac{p+q}{2}, q)$

Fargle
  • 1,420
  • 10
  • 16
4

Start: Pick any monotonic decreasing sequence $l_i$ of positive rationals converging to zero and any monotonic increasing sequence $r_i$ of positive rationals converging to $1$, with $l_1<r_1$. Consider

$$\begin{array}{lllll} \Bbb Q= & \cdots & \sqcup & [2,-1) & \sqcup & [-1,0) & \sqcup & [0,1) & \sqcup & [1,2) & \sqcup & [2,3) & \sqcup & \cdots \\ (0,1) = & \cdots & \sqcup & [l_3,l_2) & \sqcup & [l_2,l_1) & \sqcup & [l_1,r_1) & \sqcup & [r_1,r_2) & \sqcup & [r_2,r_3) & \sqcup & \cdots \end{array} $$

Note that $[a,b)\cong[c,d)$ are order-isomorphic for any rationals $a,b,c,d\in\Bbb Q$ with $a<b$, $c<d$.

All intervals are taken in $\Bbb Q$.

anon
  • 151,657
1

I know similar ideas already came up here, but the first thing I thought of was to construct the bijection $f:\mathbb R\longrightarrow(-2,2)$ given by $$ f(x)= \begin{cases} -2-\frac{1}{x}&x\in(-\infty,-1)\\ x&x\in[-1,1]\\ 2-\frac{1}{x}&x\in(1,\infty) \end{cases} $$ with explicit inverse $$ f^{-1}(x)= \begin{cases} -\frac{1}{x+2}&x\in(-2,-1)\\ x&x\in[-1,1]\\ \frac{1}{2-x}&x\in(1,2) \end{cases} $$ and then this could be composed with a linear bijection $g:(-2,2)\longrightarrow(p,q)$.

String
  • 18,395