By user1411893


2012-06-20 11:52:13 8 Comments

How to define a bijection between $(0,1)$ and $(0,1]$? Or any other open and closed intervals?

If the intervals are both open like $(-1,2)\text{ and }(-5,4)$ I do a cheap trick (don't know if that's how you're supposed to do it): I make a function $f : (-1, 2)\rightarrow (-5, 4)$ of the form $f(x)=mx+b$ by \begin{align*} -5 = f(-1) &= m(-1)+b \\ 4 = f(2) &= m(2) + b \end{align*} Solving for $m$ and $b$ I find $m=3\text{ and }b=-2$ so then $f(x)=3x-2.$

Then I show that $f$ is a bijection by showing that it is injective and surjective.

8 comments

@CopyPasteIt 2019-03-21 00:47:05

The technique here is to apply the (abstract) proof of the Schröder–Bernstein theorem to this situation.

Let $A = (0,1)$ and $B = (0,1]$. Let $f: A \to B$ be the inclusion mapping $f(x) = x$ and $g: B \to A$ be given by

$$ g(x) = \frac{x}{2}$$

Both of these mappings are injective, so we can use the proof technique to build a bijective mapping $h$ between $A$ and $B$.

The number $1 \in B = (0,1]$ is a B-stopper; let

$$ D = \{\, \frac{1}{2^n} \, | \, n \text{ is a positive integer}\,\}$$

Let $h$ multiply each number in $D$ by $2$ and be equal to $f$ at all other numbers.

The function $h: A \to B$ is a bijection.

@Benjamin 2018-09-17 15:23:38

Note that:

If A is a countable infinite set and a is any element in A, then: there's a bijection for A \ {a} and A;

Or, equivalently if A is contained strictly in B, b is in B \ A, A is countably infinite then: there's a bijection for A $\bigcup$ {b} and A;

To prove the second claim, for example: denote A = {an| n is in $N$}, let: b = f(a0), and an = f(an + 1) for n >= 0. then f is a bijection.

(Similar to a previous answer for your question)

If A is uncountable, you can choose a subset in A as A' that is countable, and do a similar thing to add element to A'. (similar proof for removing element from A, by choosing the element you wish to remove in A')

By this, you can add \ remove as many finite element to an infinite set A as possible, and still have a bijection between them. This is a famous question, called "Hilbert's Hotel", to the name of German Mathematician David Hilbert, you can see more on wiki.

(In fact, (1) if A is countably many, you can even add countably infinite elements to A, and there's still a bijection; and sometimes, you can also do this for removing (2) if A is uncountable, you can always do this for both add/remove a coutably many set to/from A)

@Did 2012-06-20 12:00:18

Choose an infinite sequence $(x_n)_{n\geqslant1}$ of distinct elements of $(0,1)$. Let $X=\{x_n\mid n\geqslant1\}$, hence $X\subset(0,1)$. Let $x_0=1$. Define $f(x_n)=x_{n+1}$ for every $n\geqslant0$ and $f(x)=x$ for every $x$ in $(0,1)\setminus X$. Then $f$ is defined on $(0,1]$ and the map $f:(0,1]\to(0,1)$ is bijective.

To sum up, one extracts a copy of $\mathbb N$ from $(0,1)$ and one uses the fact that the map $n\mapsto n+1$ is a bijection between $\mathbb N\cup\{0\}$ and $\mathbb N$.

@Gaston Burrull 2013-04-01 07:45:35

One can choose $x_n=1/n$ to avoid Axiom of Choice ^^

@Did 2013-04-01 08:07:31

@GastónBurrull Well, "choose" does not refer to the axiom of choice here but simply to the fact that any such sequence (for example the one you suggest) does the job. (But perhaps your comment was tongue-in-cheek... :-))

@user4894 2016-08-22 17:59:51

It's like the Hilbert hotel. If you slide all the guests to the right, you gain an extra empty room. If you slide all the guests to the left, you gain an extra unroomed guest. This trick underlies all bijections among open, closed, or half-open intervals of reals.

@Did 2017-12-06 11:22:32

@Parcly That anybody would decide to edit a 5 years old answer, only to replace the (correct) command \mathbb by the (deprecated in LaTeX for 20 years) command \Bbb, is beyond me.

@leticia 2016-08-22 17:48:36

Clearly, $(\mathbb{R}-\mathbb{Q})\cap [0,1]=(\mathbb{R}-\mathbb{Q})\cap (0,1)$.

So, set some enumeration for the rationals on $[0,1]$, $(r_{n})_{n \ge 1}$, with $r_1 = 0$ and $r_2 = 1$.

Thus, define a function $f:(0,1) \to (0,1]$ to act like the identity on the set of irrationals and, on the set of rationals, set $f(r_j)=r_{j-1}$ for all $j \ge 3$.

This is of course a bijection.

@jaggu 2016-09-22 10:48:30

I think for the set of rationals new enumeration would be $f(r_j)=x_j $for $j\geq3$ where $(x_n)$ is the identity mapping on the set of rationals on $(0,1)$

@Did 2017-04-15 10:24:13

This seems to mimick an answer posted four years earlier, only with mistakes which make that the construction does not work. (@upvoter Why the upvote?)

@Greek - Area 51 Proposal 2013-11-06 06:51:37

I thought to supplement Did's answer with this picture that I sketched.

enter image description here

The blue line represents the set $\color{#0073CF}{(0,1) - \{x_n\}^{\infty}_{n \geq 1}}$.
The orange circles are elements of the infinite sequence $\color{#FF4F00}{X = \{x_n\}^{\infty}_{n \geq 1}}$, but I plotted only 4 (I chose 4 arbitrarily) circles because it is impossible to plot all elements of an infinite sequence.
Subscripts (The order of the points) were arbitrarily assigned to each orange points.
So the depiction above of $f : (0,1] \rightarrow (0,1) $ can be defined with this formula:

$f(\color{#FF4F00}{x_n}) = \color{#FF4F00}{x_{n + 1}} \quad \forall \;n \geq 0$ and
$f(\color{#0073CF}{x}) = \color{#0073CF}{x} \qquad \quad \forall \; \color{#0073CF}{x \in {(0,1) - \{x_n\}^{\infty}_{n \geq 1}}}$.

@Potato 2012-06-20 12:37:06

We will show that both sets are in bijection with $S^1\times \mathbb{Z}$.

Consider $(0,1)$. This is in bijection with $\mathbb{R}$ (for example, scale the interval to $(-\pi/2, \pi/2)$ and apply the tangent function). We can map $\mathbb{R}$ to $S^1\times \mathbb{Z}$ bijectively using the map $t\rightarrow (e^{2\pi i t},\lfloor t \rfloor)$.

Any set homeomorphic to $(0,1]$ can be put into bijection with $S^1$ using the map $t\rightarrow e^{2\pi i t}$. It remains to show that $(0,1]$ is in bijection with countably many copies of itself. To see this, note that the map $x\rightarrow -\frac{1}{x}$ takes $(0,1]$ to $(-\infty, -1]$, and consider the partition

$$\cdots (-4,-3],\ (-3,-2],\ (-2,-1].$$

This seems unnecessarily complicated, and I think you can just map both sets to $\mathbb{R}$ and circumvent the circle stuff, but this is how I figured it out.

@Did 2012-06-21 06:56:48

+1. Actually, my mental image of this is a bijection with $(0,1]\times\mathbb Z$ rather than with $S^1\times\mathbb Z$ but this construction is definitely worthwhile to remember.

@Jeppe Stig Nielsen 2015-06-30 14:44:00

Here is another way to say the same thing. I reverse the half-open intervals. I want to show that the intervals $A=\left[ 0,\infty \right)$ and $B= \left( -\infty,\infty \right)$ are in bijective correspondence. By chopping up in half-open pieces (of length one) like $\ldots, \left[ 3,4 \right) , \left[ 4,5 \right) , \left[ 5,6 \right) ,\ldots$, the interval $A$ is naturally in correspondence $A \approx \left[ 0,1 \right) \times\mathbb{N}$, while for $B$ that is $B \approx \left[ 0,1 \right) \times\mathbb{Z}$. But since it is known that $\mathbb{N}$ and $\mathbb{Z}$ are "equal", we are done.

@Ben 2012-06-20 12:22:57

Let $A=\{\frac{1}{2},\frac{1}{3},...\}$,$B=\{1,\frac{1}{2},\frac{1}{3},...\}$. Define $f:A\rightarrow B$ such that $f(\frac{1}{n})=\frac{1}{n-1}$.It is easy to show that $f$ is a bijection. Then define a function $g:(0,1) \rightarrow (0,1]$ such that

$g(x)=x$ if $x$ is not in $A$ , otherwise $g(x)=f(x)$.

Then $g$ is a required bijection from $(0,1)$ to $(0,1]$.

Remark: We can always solve this kind of question by picking a countable proper subset from (say) $(0,1)$ and then define a bijection $f$ so that the image of $f$ is a little bit bigger than its domain and then define a function which is equal to $f$ on the picked countable set and identity function outside that set.

@user1411893 2012-06-20 12:35:05

thanks that makes it a lot clear for me. If I was to follow that logic for lets say [0,1]^2 and [0,2]^2 would I solve for [0,1] and [0,2] first by letting A = {0,1} and b = {0,2} and then f: A->B ?

@Did 2012-06-20 14:53:57

Between $[0,1]^2$ and $[0,2]^2$, I would rather use the bijection $(x,y)\mapsto(2x,2y)$.

@Martin Sleziak 2012-06-20 12:00:50

Try something like the function in the following picture:

enter image description here


If you only have to show that such bijection exists, you can use Cantor-Bernstein theorem and $(0,1)\subseteq (0,1] \subseteq (0,2)$. See also open and closed intervals have the same cardinality at PlanetMath.

@Math geek 2019-06-09 07:43:18

What about continuous bijection? will it exist?

@Martin Sleziak 2019-06-09 07:54:28

@Mathgeek Using that fact that a continuous injective real function is monotone should help you in showing that any such bijection cannot be continuous. You can have a look at some similar questions on this site, such as Continuous bijection from $(0,1)$ to $[0,1]$ (and other posts linked there) or Continuous, bijective function from $f:[0,1)\to \mathbb{R}.$.

@Math geek 2019-06-09 15:23:55

Thank you very much :)

Related Questions

Sponsored Content

2 Answered Questions

[SOLVED] Proving $f_{\alpha}(x)$ is a bijection

2 Answered Questions

[SOLVED] Find a bijection between 2 intervals

1 Answered Questions

[SOLVED] A bijection between $[0,1]$ and all $k$-encoded strings

1 Answered Questions

3 Answered Questions

[SOLVED] Powerset bijection problem

2 Answered Questions

[SOLVED] Prove that f is a bijection

  • 2012-05-03 05:12:41
  • Danny Rancher
  • 9624 View
  • 1 Score
  • 2 Answer
  • Tags:   functions

2 Answered Questions

[SOLVED] Find a one-to-one correspondence between $[0,1]$ and $(0,1)$.

  • 2012-08-03 00:56:18
  • David
  • 4465 View
  • 0 Score
  • 2 Answer
  • Tags:   real-analysis

Sponsored Content