17

Since both of them are uncountable sets, we should be able to construct such a map. Am I correct?

If so, then what is the map?

TRiG
  • 203
Error 404
  • 6,006
  • The answer is yes, such a map exists, but I personally don't know if you can actually construct it. – jgon May 03 '15 at 08:14
  • 10
    They are both uncountable, but it doesn't follow from that that they have the same cardinality. Actually they are equicardinal, so there is a bijection between them. We can prove it easily, but the easy proof isn't constructive. So it isn't so obvious that we should be able to construct a bijection between them. – Leonhardt von M May 03 '15 at 08:16
  • $|\mathbb{R}|=|\mathbb{R-Q}|$ and we are done – JMP May 03 '15 at 08:17
  • 2
    @LeonhardtvonM: When the difference between two sets is countable, it is easy to construct an explicit bijection without appeal to any set theory. Since we have an easy bijection between $(0,1)$ and $\mathbb{R}$, we can fix the countable discrepancies between $[0,1]$ and $(0,1)$, and between $\mathbb{R}$ and $\mathbb{R} \setminus \mathbb{Q}$. – user21820 May 03 '15 at 09:47
  • @JonMarkPerry That doesn't seem any eaiser than the question itself. – Trevor Wilson May 04 '15 at 00:53

8 Answers8

17

Both sets $[0,1]$ and $[0,1]\setminus\mathbb Q$ have the same cardinality $\mathfrak c=2^{\aleph_0}$, so there is a bijection between them.


If you want write down some explicit bijection, you can use basically the standard Hilbert's hotel argument which shows that if $|A|\ge\aleph_0$ then $|A|+\aleph_0=|A|$.

So let us try to describe some bijection $f \colon [0,1] \to [0,1]\setminus\mathbb Q$.

  • Choose some infinite sequence $x_n$, $n=0,1,2,3,\dots$ of irrational numbers in the interval $[0,1]$.
  • Choose some bijection $g\colon \mathbb N\to\mathbb Q\cap[0,1]$.

Then you can define $f$ as:

  • $f(x_{2n})=x_n$;
  • $f(x_{2n+1})=g(n)$;
  • $f(x)=x$ for $x\in [0,1] \setminus \{x_n; n=0,1,2,\dots\}$

Let me add links to some posts where a very similar ideas can be used to construct a bijection between two given sets:

15

Define $f : [0,1] \to \mathbb{R}$ as follow : if $x \in \mathbb{Q}$, then $f(x) = \pi + x$. If $x$ is irrational, then $f(x) = x$. This function is injective. It is not a bijection.

  • 2
    You can also just use $f(x) = \sqrt{2} + x$ for rational $x$. – user21820 May 03 '15 at 08:44
  • As simple as that ! awesome. :) – Error 404 May 03 '15 at 08:56
  • @VikrantDesai: Yes this answer is perfect for your question since you didn't ask for a bijection. But see the other answers for bijections since that is the more interesting question. – user21820 May 03 '15 at 09:50
  • 1
    @user21280 yes , surely ! I am going through all of them, couldn't have imagined various such constructions. Maths stack exchange is really an amazing source to learn ! – Error 404 May 03 '15 at 09:52
  • 1
    You can make this bijective easily though by "bumping" $\mathbb Q + \pi $ to $\mathbb Q + 2\pi$ and so on. That is, if $f$ is such that for $x$ such that $x-n\pi$ is rational for non-negative $n$, define $f(x)=x+\pi$. Otherwise, define $f(x)=x$. This is a bijection. – Milo Brandt May 03 '15 at 15:35
  • @Meelo Can you put it in answers? – Error 404 May 03 '15 at 16:38
  • Take $x \in \mathbb Q$ , then $f(x + \pi ) = x + \pi$ as $ x + \pi \in \mathbb R \setminus \mathbb Q$ then , $f(x + \pi) = f(x) = x + \pi$ since $x \in \mathbb Q$ but clearly $x + \pi \neq x$ hence the condition that $f$ is injective is not satisfied. – null Jun 18 '19 at 16:55
9

You can construct such a function in the following steps (it's certainly by far not the only way):

  1. Map the closed interval $[0,1]$ to the open interval $(0,1)$ by the function $$f(x) = \begin{cases} \frac{1}{4} & x = 0\\ \frac{1}{4(n+1)} & x = \frac{1}{4n}, n\in\mathbb Z^+\\ \frac{3}{4} & x = 1\\ 1-\frac{1}{4(n+1)} & x = 1 - \frac{1}{4n}, n\in\mathbb Z^+\\ x & \text{otherwise} \end{cases}$$

  2. Map the interval $(0,1)$ to $\mathbb R$ by the function $$g(x) = \ln(-\ln x)$$

  3. Map $\mathbb R$ to the set of irrational numbers by the function $$h(x) = \begin{cases} x\pi^{n+1} & x = q\pi^n, q\in\mathbb Q, n \in \mathbb N_0\\ x & \text{otherwise} \end{cases}$$

Then the function $F = h\circ g\circ f$ is a bijection from $[0,1]$ to the set of irrational real numbers.

Here I've used the notations $\mathbb Z^+ = \{1,2,3,\ldots\}$ the set of positive integers, and $\mathbb N_0 = \{0,1,2,3,\ldots\}$ the set of positive integers (natural numbers, including $0$).

celtschk
  • 43,384
  • 2
    Your answer relies on $π$ being transcendental, but how are you going to justify it? My answer is similar in idea to yours but uses primes instead, which only requires elementary number theory. – user21820 May 03 '15 at 08:43
  • 3
    @user21820: What exactly do you think I have to justify? That $\pi$ is transcendental is a well-known fact; see e.g. Wikipedia. – celtschk May 03 '15 at 08:55
  • 3
    Yes it is a well-known fact, but it is a sledgehammer. One might open up the proof of cardinal arithmetic to solve this question, but it sheds not much 'concrete' light on the matter since the general case requires the axiom of choice. Similarly, the fact that π is trancendental is totally not elementary and not at all crucial to this question. It's just a strange feeling one gets, as if the real reasons are being hidden away in the claim of the transcendentality of π instead of being proven here. It's not wrong, just strange. – user21820 May 03 '15 at 09:05
4

Let $p_0 = 0$ and $p_n$ be the $n$-th prime for any $n \in \mathbb{N}^+$.

Let $f:\mathbb{R}\to\mathbb{R}$ such that:

  $f(x) = \cases{ r+\sqrt{p_{n+1}} & \text{if $x = r+\sqrt{p_n}$ for some $n \in \mathbb{N}$ and $r \in \mathbb{Q}$} \\ x & \text{otherwise} }$.

To prove that this function is well-defined, we just need to check that it is impossible to have $a+\sqrt{p_m} = b+\sqrt{p_n}$ for distinct $m,n \in \mathbb{N}^+$ and $a,b \in \mathbb{Q}$, which is clearly the case otherwise $(a-b)^2 = (\sqrt{p_m}-\sqrt{p_n})^2$ $= p_m+p_n-\sqrt{p_mp_n} \notin \mathbb{Q}.$

I leave you to prove that it is a bijection from $\mathbb{R}$ to $\mathbb{R} \setminus \mathbb{Q}$. Then you can compose it with a bijection from $[0,1]$ to $\mathbb{R}$.

user21820
  • 57,693
  • 9
  • 98
  • 256
  • 2
    Your answer relies on $\sqrt{p_n}$ being irrational and all linearly independent over $\mathbb Q$, but how are you going to justify it? One might open op the proof of number theory to solve this question, but it sheds not much 'concrete' light on the matter since the general case requires the axiom of choice. It's just a strange feeling one gets, as if the real reasons are being hidden away in the claim of the rational independence of ${\sqrt{p_n}}_n$ instead of being proven here. It is not wrong, just strange. – hmakholm left over Monica May 03 '15 at 13:45
  • 1
    @HenningMakholm: Thanks for making me read my answer again. I found and fixed a small error. Note that it does not at all require independence of all square roots of primes over the rationals, nor does it require the axiom of choice. – user21820 May 03 '15 at 14:09
  • How is axiom of choice related to this ? I merely know the statement of axiom of choice and am unable to relate it here. Can you elaborate? or can you suggest me some proper reference to study it ? thanks. – Error 404 May 03 '15 at 14:10
  • @VikrantDesai: It is not related. Just look at what I wrote in my answer. =) – user21820 May 03 '15 at 14:11
  • @VikrantDesai: I'm not sure the axiom of choice is really relevant here. I was just echoing user21820's own criticism of celtschk's answer. – hmakholm left over Monica May 03 '15 at 14:12
  • 1
    @HenningMakholm: Eh wait.. are you implying that you don't actually know whether the axiom of choice is relevant? Then please don't echo anything. My statement about the axiom of choice is correct regarding cardinality, which is not used in celtschk's answer but is necessary for the general form of user59001's answer to work. – user21820 May 03 '15 at 14:14
  • Oh, so you're saying that it is a fault of celtschk's answer that a completely different answer by another user requires AC? (I'm not sure even AC can save that one as an answer to the question, though). If so, I should think this criticism applies as much to your answer than it does to celtschk's one. – hmakholm left over Monica May 03 '15 at 14:18
  • @HenningMakholm: No no you're misunderstanding a lot of things. I said "open up the proof of cardinal arithmetic to solve this question", referring to the original question. More precisely, it is necessary to assume the axiom of choice in order to prove that every set has a cardinality, which would be needed if one wants to invoke cardinal arithmetic as user59001 did. If you are not familiar with ZFC, it goes through a long route through ordinals and transfinite recursion, which are irrelevant to the problem. celtschk used the transcendentality of π, which is likewise a big detour. – user21820 May 03 '15 at 14:21
  • Yes @HenningMakholm. I merely know the statement of the axiom of choice. So couldn't understand your discussion. But understood you echoing him. – Error 404 May 03 '15 at 14:21
  • 1
    @VikrantDesai: Sorry to say but my answer is now sufficiently complete and does not depend on any difficult results that you cannot prove on your own, contrary to Henning's objection. – user21820 May 03 '15 at 14:23
  • Okay thanks then. – Error 404 May 03 '15 at 14:27
  • @user21820: I'm perfectly conversant with ZFC, thank you. Just because is common (and convenient) in ZFC to use initial ordinals to represent cardinal numbers, that doesn't mean this is the only possible way to talk about cardinals. In ZF, as long as you have Foundation, you can use Scott's Trick to get a perfectly good representation of cardinalities and prove that every set has a cardinality. What you can't do without AC is to prove rules such as $\kappa+\lambda=\max(\kappa,\lambda)$ -- indeed without AC it is possible to have pairs of cardinals that don't have a max. – hmakholm left over Monica May 03 '15 at 14:27
  • 1
    @HenningMakholm: Correct. Let me rephrase the point I was trying to make. I meant that we can take the proof of that very theorem of cardinal addition, that uses AC, and either attach it to a simple-looking proof of this problem like user59001's, or open up the proof and apply the deductions one by one to this particular problem. In both cases, one gets a complicated proof of a simple theorem that uses assumptions that are completely unnecessary. That is what I mean by sledgehammer. If you still don't like my method despite its simplicity, then by all means use the better odd-even method. =) – user21820 May 03 '15 at 14:32
  • @user21820: The fact is still that is if you can use a failing of user59001's answer to criticize celtschk's answer, then the same failing applies equally well (i.e., not at all, same as it does against celtschk) against your answer. – hmakholm left over Monica May 03 '15 at 14:37
  • 1
    @HenningMakholm: I think you're still missing my point. I consider a full proof to include the proof of every result used. A full proof following my method would use far less axioms than either of their proofs, and hence is preferable to me unless there is some deep intrinsic structure that is revealed by their proofs. In this case, there doesn't seem to be any. – user21820 May 03 '15 at 14:43
  • @user21820: Nothing of that gives you any rig h to blame celtschk for a failing (real or imagined) of a different user's different answer to the 0same question! If celtschk's answer is wrong because user59001 depends on cardinal arithmetic, then your answer is wrong for exactly the same reason! – hmakholm left over Monica May 03 '15 at 14:47
  • 1
    @HenningMakholm: I'm not blaming him about cardinality! It was just an analogous example, since transcendentality of π is a very difficult result. Anyway let's forget the whole thing. I'm sorry to have offended you. =( – user21820 May 03 '15 at 14:49
2

Yes, the irrationals and the set [0,1] have the same cardinality. Using cardinal arithmetic:

$$\text{card}([0,1]) = \text{card}(\mathbb{R}) = \text{card}(\mathbb{Q} + (\mathbb{R} \setminus \mathbb{Q}) ) = \text{card}(\mathbb{Q}) + \text{card}(\mathbb{R} \setminus \mathbb{Q} ) = \text{card}(\mathbb{R} \setminus \mathbb{Q} )$$

I cannot recall an explicit construction of such a bijection, however.

ಠ_ಠ
  • 10,682
2

Let me prove a more general theorem that may be instructive: $\def\nn{\mathbb{N}}$ $\def\power{\mathcal{P}}$

Given any infinite set $S$, there is a bijection from $\power(S)$ to $\power(S) \setminus \{ \{x\} : x \in S \}$.

One could use the full theory of cardinals and cardinal arithmetic, but the proof of that needs the axiom of choice (AC) and hence is necessarily non-constructive. But it is possible to prove an explicit bijection in this case, using only the axiom of countable choice and avoiding AC, as follows:

Let $(a_n)_{n\in\nn}$ be a sequence of distinct elements in $S$, since $S$ is infinite, and let $A = \{ a_n : n \in \nn \}$.

Let $f(X) = \cases{ \{ a_i : i \in [k..m+1] \} & \text{if $X = \{ a_i : i \in [k..m] \}$ for some $k,m \in \nn$ with $k \le m$} \\ \{s,a_0\} & \text{if $X = \{s\}$ for some $s \in S \setminus A$} \\ \{s,a_{m+1}\} & \text{if $X = \{s,a_m\}$ for some $s \in S \setminus A$ and $m \in \nn$} \\ X & \text{otherwise} }$

[For convenience I used "$[k..m]$" to denote "$\{k,k+1,k+2,...,m\}$".]

It can be checked that $f$ is a desired bijection.

As a consequence we will obtain:

There is a bijection between $\power(S) \cup T$ and $\power(S)$ for any disjoint infinite $S,T$ such that there is a bijection between $S$ and $T$.

This corresponds to a special case of cardinal addition, namely $\#(\power(S))+\#(S)=\#(\power(S))$ for infinite $S$, which is enough for a lot of mathematics.

Note

The fact that a countably infinite sequence exists within any infinite set can be proven by considering a sequence of finite subsets with increasing sizes. Each exists and by countable choice we get this sequence. The union of the subsets is countably infinite and we can extract the desired sequence from it by the axiom of induction.

user21820
  • 57,693
  • 9
  • 98
  • 256
  • How exactly do you get a sequence of as from infiniteness of S, without AC?? – Veky May 04 '15 at 07:12
  • @Veky: It depends on what system you are working in and how you want to define "infinite". If you want to stay within set theory and define "infinite" as (1) "no bijection with a proper initial segment of the naturals", then you need say (DC) dependent choice. In fact there is a proof using only (CC) countable choice (see https://proofwiki.org/wiki/Infinite_Set_has_Countably_Infinite_Subset/Proof_4). and CC is essentially uncontentious. But if you take "infinite" to mean (2) "there is a subset in bijection with the naturals", then you don't need anything beyond ZF. – user21820 May 04 '15 at 08:41
  • @Veky: Furthermore, if you work in a more constructive theory than ZF then you can often use (1) without needing even CC, because a sequence would just be the rule for generating it, and certainly you can generate any element of that infinite sequence in finitely many steps. But I'm not going to make precise what kind of more constructive system would work here haha.. – user21820 May 04 '15 at 08:42
  • First comment can be understood, though I presume usual definitions of infinitude (equipotent with proper subset, or not bijective with n for any n) don't include your version. And retrofitting definitions to include consequences of AC is not really meaningful game... otherwise you could just redefine what "disjoint family of nonempty sets" meant. :-P But second comment is just wrong: even if you could give a rule for constructing any element of sequence, for applying rule 2 in definition of f(X) you need the whole A to decide, not some finite segment of it. – Veky May 05 '15 at 04:58
  • @Veky: Well if you noticed I included a note in my answer to sketch how to obtain the claimed sequence using CC. For second point, it is possible as I said, not in a purely constructive sense of course (which is what you are referring to). The reason it makes no sense to stick to purely finitely constructible objects is that we a priori assume the truth of classical logic, which is non-constructive already. Furthermore, it is silly if we cannot even tell whether two real numbers are equal, which would be the case in a purely constructive setting. – user21820 May 05 '15 at 05:28
  • I'm glad you corrected your claim regarding first part. Regarding second part, I don't see the relevance, except if you wish to claim "constructive mathematics is silly as a whole". :-P (Which I'm even willing to agree with, but you introduced it into the discussion. :-]) – Veky May 05 '15 at 06:04
2

Let $x=0.x_1x_2\dots$ be the base $10$ representation (choosing the ones ending in repeating $9$s rather than repeating zeros.)

Let $p=0.y_1y_2\cdots$ be any (fixed) irrational number in $(0,1)$.

Then $f(x)=0.x_1y_1x_2y_2\dots$ is a $1-1$ function which maps $[0,1]$ to the irrationals, and it is continuous at every number that is not of the form $\frac{n}{10^k}$.

(This map is not, of course, onto.)

Thomas Andrews
  • 177,126
1

There are lots of good answers already, but I thought I might add one more using a flexible method that shows up a lot in descriptive set theory.

Note that $\mathbb{R} \setminus \mathbb{Q}$ is the intersection of countably many dense open sets $(G_n : n \in \mathbb{N})$; just take $G_n = \mathbb{R} \setminus \{q_i\}$ for some enumeration $(q_i : i \in \mathbb{N})$ of the rationals.

Note also that there is an injection from $[0,1]$ to the Cantor space $2^\mathbb{N}$ given by binary expansions. If there is a choice between a binary expansion that is eventually zeroes and another that is eventually ones, take the one that is eventually zeroes. (This injection is not continuous.)

So it suffices to prove the following general fact:

Let $(G_n : n \in \mathbb{N})$ be a sequence of dense open subsets of $\mathbb{R}$. Then there is an injection from $2^\mathbb{N}$ to $\bigcap_{n \in \mathbb{N}} G_n$. (As we will see, there is a continuous injection.)

By recursion, we can define for each finite sequence $s$ of natural numbers a closed interval $I_s$ satisfying the following properties:

  • $I_s$ has length between zero and $2^{-n}$ where $n$ is the length of the finite sequence $s$,

  • $I_t \subset I_s$ whenever $t$ extends $s$,

  • $I_s \cap I_t = \emptyset$ whenever $s$ and $t$ are incompatible, and

  • $I_s \subset G_n$ where $n$ is the length of $s$.

This binary tree of intervals is called a Cantor scheme. If desired, we can define $I_s$ explicitly as $[q_i,q_j]$ where $(i,j)$ is the lexicographically least pair of natural numbers making this interval obey the rules.

Every element $(d_i : i \in \mathbb{N})$ of the Cantor space $2^\mathbb{N}$ determines a branch in this binary tree. Our continuous injection is obtained by mapping $(d_i : i \in \mathbb{N})$ to the unique point in the intersection of the corresponding sequence of closed intervals $$I_{d_0} \supset I_{d_0,d_1} \supset I_{d_0,d_1,d_2} \supset \cdots.$$

Trevor Wilson
  • 16,989