# Show that set of Real numbers has the same cardinality as a set of Irrational Numbers. [duplicate]

How can I show that sets $| \mathbb R-\mathbb Q |$ and $| \mathbb R |$ have same cardinality.
My Solution: As long as for element in one set I can match it with unique element
in another set they have same cardinality:
After removing $\mathbb Q$ from $\mathbb R$ I can shift elements of Irrational numbers to correspond to elements of two sets match like this: $\begin{array}{c|c|c|c|c|c} \mathbb R&0&1&\cdots&n&\cdots\\\hline \mathbb R\setminus\mathbb Q & \sqrt{2} &\sqrt{5} &\cdots & \sqrt{n+1} &\cdots \end{array}$
Note that I use n as Real number for simplicity.

Even if this solution is correct, I feel like Professor won't accept it on exam.
How would formal solution look like?

## marked as duplicate by martini, Hanul Jeon, Namaste, Andrés E. Caicedo set-theory StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Jan 6 '17 at 15:03

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

• What is supposed to be the image of $2$ with your shift? – md5 Jan 6 '17 at 13:21
• Your problem is a special case of the one dealt with in this question. – Brian M. Scott Jan 6 '17 at 13:24
• I'm afraid you are right -- your attempt is very far from being a proof. For instance, what is the image of $\sqrt 2$ ? (Perhaps this is what @md5 meant to ask.) It can't be $\sqrt 2$, because that is already the image of $0$. – TonyK Jan 6 '17 at 13:25
• @md5 shift is just an example. I agree it is bad example, but the best came to my mind. – Baimyrza Shamyr Jan 6 '17 at 13:27
• @AlexMacedo it's not a duplicate of that one. – user384138 Jan 6 '17 at 13:28

## 2 Answers

Define $$f(x)=\begin{cases}x+\sqrt 2\text{ if } x-n\sqrt 2\in\Bbb Q\text{ for some integer }n\ge 0 \\ x\text{ otherwise}\end{cases}$$

Clearly, $\mathbb{R} \setminus \mathbb{Q}$ has at most the same cardinality as $\mathbb{R}$ and is an infinite set. The set can therefore be either countable or of the same cardinality as $\mathbb{R}$.

Assuming the continuum hypothesis, if $|\mathbb{R} \setminus \mathbb{Q}| \neq |\mathbb{R}|$, we must then have that $\mathbb{R} \setminus \mathbb{Q}$ is countable.

But the union of two countable sets is countable, and $(\mathbb{R} \setminus \mathbb{Q}) \cup \mathbb{Q} = \mathbb{R}$. Therefore $\mathbb{R} \setminus \mathbb{Q}$ must have the same cardinality as $\mathbb{R}$.