# Calculating cardinal numbers of subsets in $\mathbb R\times\mathbb R$

Calculate the cardinal numbers of the following subsets of $\mathbb R\times\mathbb R$ :

a.$X=\left\{ (a,b)\in\mathbb{R}\times\mathbb{R}\mid a+b\in\mathbb{Q}\right\}$

b.$Y=\left\{ (a,b)\in\mathbb{R}\times\mathbb{R}\mid a\in\mathbb{Q}\wedge b^2\in\mathbb Q\right\}$

About X: I think $|X|=\aleph_0$ but the only function I can think of is $f:\mathbb {R\times R}\to\mathbb Q$ defined by $(a,b)\to a+b$, which is surjective but not injective. Maybe the cardinal is aleph? I so,what's the general intuition for it?

about Y:I think $|Y|=\aleph_0$ but again, I have troubles define appropriate function.

How can I define the 'right' functions?

-

HINT: For $X$ note that $x+(-x)\in\Bbb Q$ for all $x\in\Bbb R$. To prove that $|Y|=\aleph_0$, it suffices to prove that $\{b\in\Bbb R:b^2\in\Bbb Q\}$ is countable.
thanks. still, I don't know either how to continue with $X$. About Y I just need to define function from your set to $\mathbb Q$ by $b\mapsto b^2$ if b positive and $b\mapsto -b^2$ if b is negative?) – user65985 Sep 12 '13 at 7:12
@CoarguAliquis: The hint for $X$ gives you enough specific members of $X$ to make it very easy to decide what $|X|$ is. Yes, the function that you describe is an injection from my set to $\Bbb Q$, and since $\Bbb Q$ is countable, my set must also be countable. Now just show that $Y$ is the Cartesian product of two countable sets, which you know is also countable, and you’re home free. – Brian M. Scott Sep 12 '13 at 7:16