37

I have learnt that the cardinality of the power set of the natural numbers is equal to the cardinality of the real numbers. What is the function that gives the one-to-one correspondence between these two sets?

I have also learnt that there exists no set whose cardinality is strictly between the natural numbers and the real numbers. Is there a proof of this or at least some intuitiveness behind it?

  • 4
    not elementary: http://en.wikipedia.org/wiki/Continuum_hypothesis – Vinicius M. Nov 05 '13 at 22:45
  • 5
    The simplest function (though one must elaborate to get rid of a few kinks) is : Interprete a subset $A$ of $\mathbb N$ as a 0-1-sequence ($a_n=1$ iff $n\in A$) and then interprete that sequence as a binary exoansion of a rea number. – Hagen von Eitzen Nov 05 '13 at 22:47
  • See also: http://math.stackexchange.com/questions/209396/is-2-mathbbn-mathbbr – Martin Sleziak Aug 09 '16 at 05:16

5 Answers5

42

It's not quite correct to ask for "the function", because if there is one then there are many. Moreover, explicit bijections are highly overrated. We can write one, but it's much much oh so much easier to use the Cantor-Bernstein theorem, and simply exhibit two injections.

If you do insist on writing an actual bijection, let me identify $\mathcal P(\Bbb N)$ with infinite binary sequences (which is quite standard). Now let me describe the steps. We would like to take a binary sequence to the real number in $[0,1]$ which has this binary string as an expansion. However some numbers, e.g. $\frac12=0.1\bar0_2=0.0\bar1_2$, one sequence with finitely many $1$'s and the other has finitely many $0$'s.

  1. First enumerate all the strings which contain finitely many $0$'s the strings containing finitely many $1$'s. One can show that both sets are countably infinite, one can even enumerate them in a very nice way. Write them as $p_n$ for the $n$-th sequence with finitely many zeros and $q_n$ for the $n$-th sequence with finitely many $1$'s.

    The next step is to take $f\colon2^\Bbb N\to2^\Bbb N$ defined as: $$f(x)=\begin{cases} q_{2k} & x=p_k\\ q_{2k+1} & x=q_k\\ x &\text{otherwise}\end{cases}$$ Easily this is an injection whose range is $2^\Bbb N\setminus\{p_n\mid n\in\Bbb N\}$.

  2. Now map $x\in2^\Bbb N$ to $r\in[0,1)$ such that, $$r=\sum_{n\in\Bbb N}\frac{f(x)}{2^{n}}$$ that is the real number whose binary expansion is $f(x)$. One can show that this is a surjective function, since if a number has a binary expansion then it has one which has infinitely many $0$'s. It is also injective since if a real number one has two different binary expansions then we can show that exactly one of them has finitely many $0$'s and the other finitely many $1$'s. But since we use $f(x)$, this is impossible.

  3. Find a bijection between $[0,1)$ and $\Bbb R$. Usually one does that by first "folding $0$ in" and having a bijection between $[0,1)$ and $(0,1)$ and then using something like $\frac{2x-1}{x(x-1)}$ or a similar function for a bijection with $\Bbb R$.


Using the Cantor-Bernstein theorem is much easier.

  1. First note that that $\Bbb R$ can inject into $\mathcal P(\Bbb Q)$ by mapping $r$ to $\{q\in\Bbb Q\mid q<r\}$. Since $\Bbb Q$ is countable there is a bijection between $\cal P(\Bbb Q)$ and $\cal P(\Bbb N)$. So $\Bbb R$ injects into $\cal P(\Bbb N)$.

  2. Then note that we can map $x\in2^\Bbb N$ to the continued fraction defined by the sequence $x$. Or to a point in $[0,1]$ defined by $\sum\frac{x(n)}{3^{n+1}}$, which we can show is injective in a somewhat easier proof.

Finally, as mentioned the last part is false. From the usual axioms of modern set theory (read: $\sf ZFC$) we cannot prove nor disprove that there are no intermediate cardinalities between $\Bbb N$ and $\Bbb R$. The proof of that is difficult and require a deep understanding of modern [read: axiomatic] set theory, as well logic.

If the last part somehow confused you, perhaps my answer to this question can help, Why is the Continuum Hypothesis (not) true?.

Asaf Karagila
  • 393,674
  • 1
    "First note that that R can inject into P(Q) by mapping r to {q∈Q∣q<r}." - Could you explain why this is? – user85798 Nov 06 '13 at 08:03
  • 1
    Oliver, given $r_1\neq r_2$ then either $r_1<r_2$ or $r_2<r_1$. Assume the first holds, then there is a rational $q$ such that $r_1<q<r_2$. Now we have that the set associated with $r_2$ includes $q$, whereas the set associated with $r_1$ does not. So the map is injective. – Asaf Karagila Nov 06 '13 at 08:05
  • 1
    Thanks, I'm convinced, but it does seem strange that between any two real numbers there is a rational, when the real numbers have a larger cardinality than the rational numbers. – user85798 Nov 06 '13 at 08:26
  • Yes, it is strange. Then you get used to the idea, then you finally understand the idea (because you had time to understand the mathematics behind it). – Asaf Karagila Nov 06 '13 at 08:27
  • Why couldn't you just take the largest member of this set ${q\in\Bbb Q\mid q<r}$ and map r to that number, which should give an injective function from R to Q? – user85798 Nov 06 '13 at 13:00
  • 3
    What is the largest rational below $e$? – Asaf Karagila Nov 06 '13 at 13:04
  • In fact, what is the largest rational below $0$? – Asaf Karagila Nov 06 '13 at 17:06
  • Good point. I understand the function now, and Cantor-Bernstein theorem seems quite obvious (for finite sets anyway). I'm curious about the proof that the continuum hypothesis cannot be proven or disproven - who would this proof be accessible to? – user85798 Nov 06 '13 at 17:48
  • I would think that a course about axiomatic set theory, logic (in particular the completeness theorem for first-order logic), and then studying forcing is pretty much a first step towards understanding the proof. – Asaf Karagila Nov 06 '13 at 17:52
  • One reason one might want an explicit map is that Cantor-Berstein mat not be true in an intuitionistic setting. – Baby Dragon Jan 31 '14 at 05:25
  • 1
    @BabyDragon: While you are technically correct (which, according to Futurama's $1.0$ is the best kind of correct) I think that it's best to avoid talking about intuitionstic context with people that just start mathematics. It's a good idea to first let them be comfortable with classical logic, and then make things harder by introducing the failure of LEM and so on. – Asaf Karagila Jan 31 '14 at 19:22
  • I agree. I think where you write "We can write one, but it's much much oh so much easier to use the Cantor-Bernstein theorem, and simply exhibit two injections" you implicitly make the argument that classical logic is indeed easier. Another wrinkle in this approach is that the Dedekind reals and the Cauchy reals are different. http://mathoverflow.net/questions/128569/a-model-where-dedekind-reals-and-cauchy-reals-are-different – Baby Dragon Jan 31 '14 at 19:32
  • 1
    @BabyDragon: Another wrinkle is that there might be an injection from the reals into the natural numbers. – Asaf Karagila Jan 31 '14 at 19:37
  • Can you add more on how to enumerate the sequences with finitely many 1's and finitely many 0's? – Salman Qureshi Mar 19 '19 at 13:57
  • @Salman: Cut after the last 0 and treat it as a binary expansion of a natural number. Likewise with those having finitely many 1s. – Asaf Karagila Mar 19 '19 at 16:42
  • When you wrote "one sequence with finitely many 1's and the other with finitely many 0's", you make it seem like you are only talking about the sequences of the form (0001111...),(00000001111111...) or (111100000....),(1111111111000000....) – Salman Qureshi Mar 19 '19 at 16:49
  • I would be obliged if you could edit your answer to touch more on the topic of binary expansion and how the sequences that you mentioned are countable. – Salman Qureshi Mar 19 '19 at 18:51
  • @Salman: I don't think that there would be any problem enumerating $00011111\dots$ and so on. But I also think that $01101001111\dots$ has only finitely many 0s in it. – Asaf Karagila Mar 19 '19 at 19:10
  • I am trying to enumerate just like you told but my mapping is not bijective. Because $010000\dots$ and $00010000\dots$ represent the same natural number after cutting from the last 1. – Salman Qureshi Mar 19 '19 at 19:18
  • Can anyone prove that the function defined $ 2^{\mathbb{N}}\to[0,1] $ in section 2 in injective? – FreeZe Jun 12 '20 at 11:58
  • 1
    @Waizman: Yes. It is explained in the paragraph below it. – Asaf Karagila Jun 12 '20 at 12:00
  • @AsafKaragila The paragraph below it is about cardinality of the continuum. If you ment to the privious method that dosent require Cantor-Berenstein theorem, It is different because the map described there is from $ 2^{\mathbb{N}}\to[0,1) $ – FreeZe Jun 12 '20 at 12:05
  • @Waizman: Did you read the paragraph after the definition of the function? Where I explain that $f$ ensures that the strings are not eventually $0$, and therefore the function is injective? It's a long answer, but please read it through carefully. – Asaf Karagila Jun 12 '20 at 12:07
  • @AsafKaragila Im talking about the map defined from $ 2^{\mathbb{N}}\to[0,1] $ by mapping $f\in 2^{\mathbb{N}} $ to $ \sum_{k=1}^{\infty}\frac{f\left(n\right)}{3^{n+1}} \in [0,1] $. You mentioned that we can show it is injective in a somewhat easier proof. So can you please be more explicit ? I have read it all, and still couldnt find an explicit answer. – FreeZe Jun 12 '20 at 12:12
  • 1
    @Waizman: Ah, that one. It wasn't clear that you're not referring to the map defined in (2). There is a small typo, it should read $2x(n)$ in the numerator in order to make it truly simple. – Asaf Karagila Jun 12 '20 at 12:21
  • @AsafKaragila I'm sorry. It's not intuitive for me, since we are talking about infinite sums. Assume $ f\neq g\in2^{\mathbb{N}} $. Why would that imply that $ \sum_{k=1}^{\infty}\frac{2f\left(k\right)}{3^{k+1}}\neq\sum_{k=1}^{\infty}\frac{2g\left(k\right)}{3^{k+1}} $, I mean, assume $ g(n_0)=1$ and $f(n_0)=0$ for some $ n_0 $. maybe in the next 100 natural numbers $g(n)=0$ and $f(n)=1$ and it would reach equallity? – FreeZe Jun 12 '20 at 12:43
  • @Waizman: Suppose that $n_0=1$, for sake of simplicity here, then the trenary expansion given by $f$ is $0{.}0\dots$ and the one given by $g$ is $0{.}2\dots$. That means that any number whose trenary expansion is $0{.}1\dots$ is between them. – Asaf Karagila Jun 12 '20 at 12:52
3

An explicit mapping is difficult to write out. But you can see one possible way on constructing it through this argument showing that the power set of $\mathbb{Z}$ and $\mathbb{R}$ have the same cardinality. I'll start by showing $\mathbb{R}$ is uncountable and then use that idea to show that the two sets have the same cardinality.

First, we show the classic Cantor proof that $\mathbb{R}$ is uncountable. It would suffice to show that $[0,1]$ is uncountable. We assume that every real number $x\in [0,1]$ has a decimal expansion that does not end in an infinite sequence of 9's. Suppose that $\mathbb{R}$ is countable. We could then construct a bijection from $\mathbb{Z}_+$ to $[0,1]$. Writing out $x$'s decimal expansion,$$x_1 = n_{1,1}n_{1,2},\cdots,n_{1,j}$$ $$ x_2 = n_{2,1}n_{2,2},\cdots,n_{2,j}$$ and so on, where $n_{i,j}$ is some number in $\{0,1,2,3,4,5,6,7,8,9\}$. Suppose all the number appeared in the order we wrote above. Now let $y_j=1$ if $n_{j,j}=0$ and $y_j=0$ if $n_{j,j}>0$. But we now have disagreement with $y_j$ and $x_j$ at the $n$th position! So $y_{j}$ is not on our list. However, $y_j$ is a real number. Therefore, the interval $[0,1)$ is uncountable. Moreover, the reals are uncountable.

Now we define a function $f: [0,1)\rightarrow \mathbb{Z}_+$. Notice $x \in [0,1)$ has a unique binary expansion (as the previous restriction on non repeating infinite 9's is equivalent to non infinite repeating 1's). So $x=\sum_{i=1}^{\infty} \, \frac{x_i}{2^i}$, where each $x_i$ is either 0 or 1. So we have $f(x)=\{i \, \, | \, \, i \in \mathbb{Z}_+ \wedge x_i=1\}$ as an injection. Notice that we can also define an injection $g:P(\mathbb{Z}_+)\rightarrow [0,1)$ by $x_{i,n}=0$ if $i \notin n$ and $x_{i,n}=1$ if $i \in n$, where $n\in P(\mathbb{Z}_+)$. Then using the ordinary decimal expansion on $n$, we have an injection. Then by the Cantor-Schroeder-Bernstein Theorem, there is a bijective function from $P(\mathbb{Z}_+)$ and $[0,1)$. But we have injective function $h(x)=\frac{x}{2}$ from $[0,1]$ to $[0,1)$ and the injective function $i(x)=x$ from $[0,1)$ to $[0,1]$. Hence, there is a bijective function from $[0,1]$ to $[0,1)$. Therefore, there is a bijective function from $P(\mathbb{Z}_+)$ to $\mathbb{R}$. So they must have the same cardinality, but by above, $\mathbb{R}$ is uncountable. Then $P(\mathbb{Z})$ is uncountable and of the same cardinality as $\mathbb{R}$.

As for your other question, it is not known if there is a set with cardinality between that of $\mathbb{N}$ and $\mathbb{R}$. It is certainly not a trivial question and is known as the Continuum Hypothesis.

  • This part confuses me "Now let $y_j=1$ if $n_{j,j}=0$ and $y_j=0$ if $n_{j,j}>0$" – user85798 Nov 05 '13 at 23:04
  • Sorry, I did this a long time ago for a homework set. We are constructing a number that can't be in the list above (that is, it can't be any of the $x_i$). We call this new number $y$ and it's decimal digits are given by $y_i$. So $y_1$ is the first digit after the decimal and so on. Now start at the first number in our 'countable list $x_1$, if the digit in the 1st spot is $0$, let $y_1=1$ and if its not zero let $y_1=0$. Then look at the second decimal digit of $x_2$, if it is $0$ then $y_2=1$ and if it is not $0$, then $y_2=0$. Continue this process indefinitely. – mathematics2x2life Nov 05 '13 at 23:13
  • ....(continued from above). Now think carefully. This number $y$ we have just made can't be in the list. So it isn't any one of the $x_i$. But this is a contradiction! We just listed all of the 'countably' many reals in $[0,1]$. So the real numbers in $[0,1]$ must be uncountable. Therefore, the real numbers are uncountable. – mathematics2x2life Nov 05 '13 at 23:14
  • Later we use the fact because $[0,1]$ is uncountable that $[0,1)$ is uncountable, which is obvious. – mathematics2x2life Nov 05 '13 at 23:16
2

My answer to your first question:

The strategy I am going to follow is to use the Schröder-Bernestein theorem, that says that for two sets $A$, and $B$, if there exists an injective function $f: A \rightarrow B$, and an injective function $g: B \rightarrow A$, then there exists a bijection between $A$ and $B$.

I am going to assume we already know that there exists a bijection between the power set of the naturals, and the set $B=\{(a_{1},a_{2},a_{3},\dots): a_{i} \in \{0, 1\}\}$, in words, the set of all the ordered tuples of 0s and 1s. And that there exists a bijection between the reals and the interval $A=[0,1)$.

If a bijection between $A$ and $B$ exists, then there exists a bijection between the power set of the naturals and the reals.

Let's start with $f: B \rightarrow A$. For each element of $B$ we use the elements of the tuple as the decimal expansion of an element in A. For example, $(0,1,1,0,\dots)$ maps to $0.0110\dots$. This is an injection, because, as long as no element in B is repeated, the mapped element in A is distinct.

For $g: A \rightarrow B$, where $g$ maps any real $a \in A$ by spacing the number of 1s in the tuple using the digits in the decimal expansion of $a$. For example, if $a=0.2130\dots$, then $g(a)=(0, 0, 1, 0, 1, 0, 0, 0, 1, 1 \dots)$. This is also an injection, as no distinct decimal expansion can map to the same tuple.

Since both $f$ and $g$ are injective, then by the Schröder-Bernstein theorem, there exists a bijection between $A$ and $B$, and hence between $\mathcal{P}(\mathbb{N})$ and $\mathbb{R}$.

Sergio
  • 686
  • 1
  • 4
  • 12
0

Here's a way of showing that $\mathfrak{c}=|\mathbb{R}|=|P(\mathbb{N})|=|2^{\aleph_0}|$ that provides a "direct" bijection between $P(\mathbb{N})$ and $\mathbb{R}$.

We will establish the bijection relationship, $$P(\mathbb{N})\sim \mathbb{N}_0 \cup (0,1) \sim (0,1) \sim \mathbb{R}$$

where $\mathbb{N}$ is the set of positive integers and $\mathbb{N}_0$ is the set of non-negative integers.

$\mathbf{1.} \ P(\mathbb{N})\sim \mathbb{N}_0 \cup (0,1)$

$\mathbf{Proof.}$ Let $S\in P(\mathbb{N})$ be an element of the power set of $\mathbb{N}$. Define a map, $f:P(\mathbb{N}) \rightarrow \mathbb{N}_0 \cup (0,1)$ such that $$f(S)=\begin{cases} 0 \quad \quad \quad \quad \quad \textrm{if $S=\emptyset$}, \\ \displaystyle \sum_{i\in S} 2^{i-1} \quad \quad \ \textrm{if $S$ is a finite nonempty set}, \\ \displaystyle \sum_{i\in S} 2^{-i} \quad \ \ \ \ \ \ \ \textrm{if $S$ is an infinite set and $\displaystyle \sum_{i\in S} 2^{-i}\ne\frac{1}{2^n}$, $n\ge 0$}, \\ \displaystyle \sum_{i\in S} 2^{-i-1} \quad \ \ \ \ \textrm{if $S$ is an infinite set and $\displaystyle \sum_{i\in S} 2^{-i}=\frac{1}{2^n}$, $n\ge 0$}. \end{cases}$$ Since every non-negative integer has a unique binary representation and every real number between $0$ and $1$ has a unique $\textbf{infinite}$ binary representation, the relation $f: P(\mathbb{N}) \rightarrow \mathbb{N}_0\cup (0,1)$ is bijective.

$\mathbf{2.} \ \mathbb{N}_0 \cup (0,1) \sim (0,1)$

$\mathbf{Proof.}$ Define the bijective map $g:\mathbb{N}_0 \cup (0,1) \rightarrow (0,1)$ as follows, if $x\in \mathbb{N}_0 \cup (0,1)$, $$g(x)= \begin{cases} \frac{1}{2x+2} \quad \ \ \quad \textrm{if $x\in \mathbb{N}_0$, }\\ \frac{x}{2-x} \quad \quad \ \ \ \textrm{if $x = \frac{1}{n} $ where $n \ge 2$,} \\ x \quad \quad \quad \quad \textrm{otherwise}.\end{cases}$$

$\mathbf{3.} \ (0,1) \sim \mathbb{R}$

$\mathbf{Proof.}$ Define the bijective map $h: (0,1) \rightarrow \mathbb{R}$ as $$h(x)=-\frac{1}{x}+\frac{1}{1-x}.$$ Since $h'(x)=\frac{1}{x^2}+\frac{1}{(1-x)^2}>0$ for $x\in (0,1)$, $h(x)\rightarrow -\infty$ as $x\rightarrow 0^+$ and $h(x)\rightarrow +\infty$ as $x \rightarrow 1^-$, $h$ is bijective.

Combining all three functions, $hgf: P(\mathbb{N}) \rightarrow \mathbb{R}$ gives a bijective map. $\quad\square$

ChengYiin
  • 422
  • "every real number between 0 and 1 has a unique infinite binary representation" - not all. There is a problem similar to the infamous $0.999... = 1$ problem. Asaf's answer deals with this. – badjohn Feb 16 '24 at 09:24
  • The case of $0.999...=1$ is not in the open interval $(0,1)$. – ChengYiin Feb 16 '24 at 16:03
  • No but other similar problems are. Asaf gives an example; have a look at his answer. – badjohn Feb 16 '24 at 16:09
  • Sorry, I can't quite get your argument. I think that "every real number between $0$ and $1$ has a unique $\textrm{infinite}$ binary representation" is true as we choose to write a real number with tailing digits of $9$ rather than its finite binary representation, e.g, instead of $0.5123$, we write it as $0.51229999...$. Also, $f({\mathbb{N}})=f({1,2,3,\cdots })= \frac{1}{2}$ and $f({1})=1$. – ChengYiin Feb 16 '24 at 16:19
  • Well, you have just added a rule about the choice of the non-unique forms. That solves one problem but introduces another since the corresponding subsets of $\mathbb{N}$ are not the same. A finite subset now does not correspond to anything. – badjohn Feb 16 '24 at 16:27
  • Maybe you can provide an explicit example that shows my function $f$ is not a bijection between $P(\mathbb{N})$ and $\mathbb{N}_0 \cup (0,1)$? Because those finite subsets correspond to the nonnegative integers. – ChengYiin Feb 16 '24 at 16:32
  • What does the subset ${1, 0, 0, 0, ...}$ map to? What does the subset ${0, 1, 1, 1, ...}$ map to? – badjohn Feb 16 '24 at 16:52
  • I have not carefully analysed your function. It is this statement that I was questioning: "every real number between 0 and 1 has a unique infinite binary representation". – badjohn Feb 16 '24 at 16:57
  • We are considering elements of $P(\mathbb{N})$, i.e. $S\in P(\mathbb{N})$. Those two subsets (${1,0,0,0,\cdots }$ and ${0,1,1,1\cdots}$) are not in $P(\mathbb{N})$. Regarding the statement that you are questioning, the case of $0.999... =1$ does not disproof the statement as $0.999...=1$ is not a real number between $0$ and $1$, i.e. $0.999...\not \in (0,1)$. – ChengYiin Feb 16 '24 at 16:57
  • Sorry, I meant: ${1}$ and ${2, 3, 4, ...}$. – badjohn Feb 16 '24 at 16:59
  • $f({1})=1$ and $f({2,3,4,\cdots })= \frac{1}{4}$. – ChengYiin Feb 16 '24 at 17:02
  • Concentrate on this statement: "every real number between 0 and 1 has a unique infinite binary representation". – badjohn Feb 16 '24 at 17:20
-2

The easiest method I know of is to relate elements in $\mathcal{P}(\mathbf{N})$ to binary sequences in $(0,1)$. For any $A \subset \mathbf{N}$ there is a natural sequence $(a_n)$ such that $a_n = 1$ if $n \in A$, $a_n=0$ if $n \notin A$. Then, we can view any $x\in (0,1)$ as $\sum_{n=1}^{\infty}\frac{a_n}{2^n}$, where $a_i \in \{0,1\}$.

Once you have this, use the map $x \mapsto f(x)=\tan(\pi (x-1/2))$ to produce all real numbers. You must be slightly careful, though, since rational numbers yield two real representations. However, the idea should be clear and give you some insight for why this is true.

doppz
  • 1,805