Why is any compact metric space the union of a countable set a subset which is a perfect space under the induced topology? Recently I stumbled across the fact that any compact metric space is the union of some countable set and a subset that, when given the induced topology, is a perfect space.
Can anyone provide a proof or reference to a proof of this fact? Thanks.
 A: A compact metric space is second countable (i.e. has a countable basis): an open cover consisting of all open balls with radius $1/n$ has a finite subcover $\mathcal{B}_n$ by compactness, and one can show that the union of all these $\mathcal{B}_n,n\in\mathbb{N}$ is a countable basis.
Now that we know that a compact metric space is second countable, we can use the following proposition which can be proven using the hint given in the comments by George Lowther.

Every second countable space is a union of a countable set and a perfect set.

Proof: Let $X$ be a second countable space. Pick a countable basis $\mathcal{B}$ of $X$. Denote
$$C=\{x\in X:x\text{ has a countable neighbourhood}\}\quad\text{and}\quad P=X\setminus C.$$
Let us show that $C$ is countable. For each $x\in C$ choose a countable neighbourhood $B_x\in\mathcal{B}$ of $x$. For each $B\in\mathcal{B}$ denote $C_B=\{x\in C:B_x=B\}$. Since $x\in B_x$ and $B_x$ is countable for each $x\in C$, each $C_B$ is countable too. Now $C=\bigcup_{B\in\mathcal{B}}C_B$ is countable, being a countable union of countable sets.
Note that any open and countable neighbourhood $U$ of a point $x\in C$ is a subset of $C$, since the same $U$ is a countable neighbourhood of each point of $U$. Since each point of $C$ has such a neighbourhood, $C$ is open and $P$ is closed.
Lastly let us show that $P$ does not have isolated points in itself (i.e. $P$ is dense-it-itself). Pick $x\in P$ and a neighbourhood $U$ of $x$. $U$ is uncountable by definition of $C$, so $C$ being countable, $U\setminus(C\cup\{x\})\subseteq P$ is nonempty and thus $x$ is not an isolated point in $P$.
We have shown that $X=C\cup P$, where $C$ is countable and $P$ is perfect. $\square$
By the way, a similar argument can be used to prove that every space having a basis of cardinality $\kappa$ is a union of a set of cardinality $\kappa$ and a perfect set.
A: Every compact metric space is second countable (see, e.g. this proof on PlanetMath). In the book "Basic real analysis" by Sohrab you can find the theorem attributed to Cantor-Bendixon (sic):

Let $(M,d)$ be a second countable metric space and let $F\subset M$ be any closed subset. Then $F=P\cup C$ where $P\subset M$ is perfect and $C\subset M$ is countable.

Here's the link to the relevant theorem (5.3.4) in Google Books.
The theorem thus stated is more general. If you take $(M,d)$ to be compact, then by the first observation, and taking $F=M$ you get the desired result.
