# What do compact sets look like in the rationals?

I'm trying to prove that $\mathbb Q$ is not locally compact and I'm having trouble seeing what the compact sets are.

Besides merely thinking of sets and then checking if they are compact or not, is there a better way of finding the compact sets?

EDIT: Any subset of the rationals $[q_1,q_2]\cap \mathbb Q$ is not compact because we can take a cover which covers both endpoints but limits from both sides to an irrational inside the interval.

EDIT2: The only compact subsets that I can find are finite subsets.

-
Can you give something explicit that is a motivation to go from Q to R? –  Phira Nov 6 '12 at 18:07
A convergent sequence together with its limit point. That is the simplest infinite compact set. But there are more complicated ones. By the way: characterizing the compact sets in $\mathbb Q$ is not the best way to show non-local-compactness! –  GEdgar Nov 6 '12 at 18:12
the EDIT2 is wrong. Consider e.g. $\{1/n:n\in \mathbb{N}\}$. –  random Nov 6 '12 at 18:12
It's not wrong. It says these are the only ones he/she can find. –  GEdgar Nov 6 '12 at 18:13
Perhaps you know (or not) that $\mathbb{Q}$, with the obvious topology, is a totally disconnected space: en.wikipedia.org/wiki/Totally_disconnected_space . –  Giovanni De Gaetano Nov 6 '12 at 18:14

$\newcommand{\ms}{\mathscr}$The compact subsets of $\Bbb Q$ are a little awkward to describe unless you’re familiar with infinite ordinals, but here’s a rough, intuitive description.

Let $\mathscr{C}_0=\big\{\{q\}:q\in\Bbb Q\big\}$; clearly every member of $\ms{C}_0$ and every finite union of members of $\ms{C}_0$ is compact, since these are just the finite sets.

Let $\ms{C}_1$ be the family of sets that consist of rational number and the points of a sequence of rational numbers converging to it, like $\{0\}\cup\{2^{-n}:n\in\Bbb N\}$; these are compact, and so, of course, are finite unions of them.

Let $\ms{C}_2$ be the family of sets that consist of a rational number $q$ and the union of a countably infinite set of members of $\ms{C}_1$ whose limit points converge to $q$. An example of such a set is

$$\{0\}\cup\bigcup_{n\in\Bbb N}\left(\{2^{-n}\}\cup\{2^{-n}+2^{-k}:k>n\}\right)\;;$$

if you make a sketch, you’ll see that each of the sets $\{2^{-n}\}\cup\{2^{-n}+2^{-k}:k>n\}$ is a simple sequence with its limit point, so it’s a member of $\ms{C}_1$, and the limit points of these sequences $-$ the points $2^{-n}$ $-$ converge to $0$. Each member of $\ms{C}_2$ is compact, as is any finite union of them.

By continuing this construction one can produce compact subsets of $\Bbb Q$ of greater and greater complexity. In fact it continues transfinitely: there is a class $\ms{C}_\alpha$ for every ordinal $\alpha<\omega_1$, and for each $\alpha<\omega_1$ the sets in $\ms{C}_\alpha$ are homeomorphic to the ordinal $\alpha$ with the order topology.

As you’ve probably realized by now, this is not the best way to think about the problem of showing that $\Bbb Q$ is nowhere locally compact.

HINT: A better idea is simply to show that if $q\in\Bbb Q$, then $q$ does not have a compact neighborhood. If $N$ is any nbhd of $q$, there is an $r>0$ such that $[q-r,q+r]\subseteq N$. Now pick an irrational number $x\in[q-r,q+r]$, and use it to show that $N$ is not compact; there are at least two different ways to do this, one involving open covers and the other involving sequences.

-
Nice. Surely, this is in the literature somewhere? I was trying to think in the other direction, starting with a compact $K\subset\mathbb{Q}$, then letting $K_1$ be the limit points of $K$, $K_2$ the limit points of $K_1$, … One gets a descending sequence of compacts, which is either finite or has a nonempty intersection $K_\omega$. In the latter case, continue. The process must stop at some countable ordinal, unless … I was trying to convince myself that every compact set must have at least one isolated point when your post popped up. –  Harald Hanche-Olsen Nov 6 '12 at 18:37
@Harald: I’m pretty sure that it qualifies as folklore. Your approach does essentially the same thing by taking the Cantor-Bendixson derivative. –  Brian M. Scott Nov 6 '12 at 18:41
@user136725: That well-known fact is implicit in both my discussion and Harald’s. –  Brian M. Scott Oct 31 '14 at 20:23

The only compact sets in $\mathbb Q$ are nowhere dense. This is example 31 in Counterexamples in topology by Seebach. A set $A$ in space $X$ is called nowhere dense if $X\setminus \mathrm{cl}(A)$ is dense

-