Why is the set $\mathcal B=\{\,\mathopen]a,b\mathclose[\mid a,b\in\mathbb Q\,\}$ countable?

359 Views Asked by At

I know that $\mathcal B=\{\,\mathopen]a,b\mathclose[\mid a,b\in\mathbb Q\,\}$ is a countable basis of $\mathbb R$ (for the Euclidean metric), but I don't really understand why it's countable. I tried to find a bijection between $\mathcal B$ and $\mathbb N$ but didn't work. Could someone explain?

2

There are 2 best solutions below

6
On

$$\mathcal B=\bigcup_{\substack{(a,b)\in \mathbb Q\times \mathbb Q\\ a\leq b}}\big\{(a,b)\big\}.$$

1
On

Each set $\mathopen]a,b\mathclose[$ is uncountable, but this is not of a concern: the set $\mathcal{B}$ is countable, because there is an injection $$ f\colon\mathcal{B}\to\mathbb{Q}\times\mathbb{Q} \qquad f(\mathopen]a,b\mathclose[)=(a,b) $$ (because it is assumed $a<b$) and $\mathcal{B}$ is obviously infinite.

The set $\mathbb{Q}$ is countable (see How to prove that $\mathbb{Q}$ ( the rationals) is a countable set), so $\mathbb{Q}\times\mathbb{Q}$ is countable as well.