# Show $(a, b) \sim\Bbb R$ for any interval $(a, b)$ [duplicate]

Show $$(a, b)$$ has the same cardinality as $$\Bbb R$$ for any interval $$(a, b)$$.

From the previous chapters of the book (Understanding Analysis by Stephen Abbott), I know that $$(-1,1)$$ has the same cardinality as $$\Bbb R$$. I am willing to know is there any systematic way to show this or I have to guess some function $$f: (a,b)\to(-1,1)$$ that is 1-to-1 and onto?

A straight line joining the points $$(a,b)$$ and $$(-1,1)$$ will work.

$$f(x)=1+\frac{b-1}{a+1}(x+1)$$\

EDIT: After the readers pointed out the error in my answer while choosing the end points of line, here is the corrected version:
A straight line joining $$(a,-1)$$ to $$(b,1)$$ will work as you need $$a\mapsto -1$$ and $$b\mapsto 1$$ which is
$$y=-1+\frac{2}{b-a}(x-a)$$

• I found the solution, but I somehow guessed, making some trials. I would like to know is there a systematic way... like "recipe" to solve such kind of questions? Commented Aug 8, 2018 at 15:50
• As you already stated $card(-1,1)=card (\mathbb R)$ so u just need a 1-1 onto map $f$ from $(a,b)$ to $(-1,1)$ which is a line in simplest form. Though other transcendental functions may work too. Commented Aug 9, 2018 at 0:54
• This answer is wrong. Your $f$ does not do the job asked for. Commented Mar 5 at 16:31
• Yes, the actual formula for the straight line should be $f(x) = -1 + \frac {1-(-1)}{b-a}(x-a)$. What this answer has is the linear connection of $(1,b)$ to $(-1,a)$. Commented Mar 5 at 17:22
• Thanks @AnneBauval for pointing out the error. Commented Mar 6 at 6:58

One can also directly deploy the linear transformation

$y(x) = \dfrac{\pi}{b - a} \left (x - \dfrac{a + b}{2} \right ), \tag 1$

which takes the interval

$(a, b) \to \left (-\dfrac{\pi}{2}, \dfrac{\pi}{2} \right); \tag 2$

then

$\tan \circ y:(a, b) \to \Bbb R, \; x \to \tan y(x) \tag 3$

is one-to-one and onto; and in fact, it is differentiable and possessed of a differentiable inverse; we know it is one-to-one since its derivative

$(\tan \circ y)'(x) = (\sec^2 y(x)) y'(x) = \dfrac{\pi}{b - a} \sec^2 y(x) > 0, \; x \in (a, b); \tag 4$

thus $\tan \circ y$ is montonically increasing and hence one-to-one; $\tan \circ y$ is seen to be onto since

$\tan \circ y(x) \to -\infty, \; x \to a^+, \tag 5$

$\tan \circ y(x) \to \infty, \; x \to b^-, \tag 6$

and thus for any $\rho \in \Bbb R$ we may choose $a_0, b_0 \in (a, b)$ with

$\rho \in (\tan \circ y (a_0), \tan \circ y(b_0)) \subset [\tan \circ y(a_0), \tan \circ y(b_0) ]; \tag 7$

since then

$\tan \circ y(a_0) \le \rho \le \tan \circ(b_0), \tag 8$

we have, by the intermediate value theorem,

$\exists z \in [a_0, b_0], \; \rho = \tan \circ y(z), \tag 9$

and we see that $\tan \circ y$ is onto $\Bbb R$.

Now since $\tan \circ y:(a, b) \to \Bbb R$ is both ono-to-one and onto, we conclude that $\vert (a, b) \vert = \vert \Bbb R \vert$ for any $a, b \in \Bbb R, \; a < b$.

• For future readers: here is a much simpler (and not transcendental) bijection between $\Bbb R$ and $(-1,1)$. Commented Mar 5 at 17:07