Every compact set in $\mathbb{Q}$ has empty interior proof

Consider $\mathbb Q$ with the subspace topology.

I read on planet math website that every compact subset in this space has empty interior and then I tried to prove it. Please could someone tell me if my proof is correct?

My proof:

Let $K$ be compact in $\mathbb Q$ with the subspace topology of $\mathbb R$. By contradiction assume it contained an open set $O\subseteq K$. By the definition of the subspace topology there exists an open set $V\subseteq \mathbb R$ such that $O = V \cap \mathbb Q$.

Now let $q \in O \subseteq V$. Since $V$ is open there exists an open ball $B$ such that $q \in B \subseteq V$. Let this ball be small enough so that it is also contained in $[m,M]$ where $M=\max K$ and $m = \min K$. Note that then $B \cap \mathbb Q\subseteq K$

The ball $B$ contains an irratinal $r$. Since the irrationals are dense in the reals we can find a sequence of rationals in this ball converging to $r$. This sequence is contained in $K$. Hence $r$ is a limit point of $K$. Since $K$ is closed, $r \in K$, a contradiction.

• Your contradiction doesn't work. Realize that $r$ is not a limit point of of $K$ because you're working in $\mathbb{Q}$, $r$ does not exist in $\mathbb{Q}$. Any limit point of $K$ will be rational. Instead, find a contradiction by extracting an open cover that has no finite subcover. – Rustyn Sep 11 '14 at 4:31

Your proof does work, but you should mention that if $K \subset \Bbb{Q}$ is compact, this also implies that $K$ is compact as a subset of $\Bbb{R}$ (why?).
You can simplify your proof by noting that the above implies that $K$ is closed as a subset of $\Bbb{R}$. But if $x$ is in the interior (relative to $\Bbb{Q}$) of $K$, then $\Bbb{Q} \cap (x - \varepsilon , x+ \varepsilon) \subset K$ for some $\varepsilon > 0$, so that $K$ accumulates at any $y \in (x-\varepsilon, x+\varepsilon)\cap \Bbb{R}\setminus\Bbb{Q}$, so that it can not be closed.