Cantor's derived sets Does there exist a compact subset $P$ of reals for which $P^n \neq P^{n+1} \forall n\geq0$ ( $P^{n+1}$ is derived set of  $P^{n}, P^0=P$) and ${P^\infty} \neq \emptyset$ ($P^\infty=\bigcap_{n=0}^{n=\infty}P^n$)?
 A: Yes, there are such sets. To describe an example, let's start with simpler tasks. 


*

*If we just want $P\ne\emptyset$ with $P^1=\emptyset$, take $P$ to be a singleton.

*If we want $P^1\ne\emptyset$ and $P^2=\emptyset$, take $P$ to be a strictly increasing sequence together with its limit $a$. Then $P^1=\{a\}$.

*If we want $P^2\ne\emptyset$ and $P^3=\emptyset$, then take $P$ such that $P^1$ is a strictly increasing sequence together with its limit $a$. For instance, start with such a sequence $a_0<a_1<\dots\nearrow a$. Let all these points be in $P$, together with, for each $i>0$, a strictly increasing sequence sitting betwen $a_{i-1}$ and $a_i$ and converging to $a_i$. Note that $P^1=\{a_1,a_2,\dots\}\cup\{a\}$.

*We can recursively extend these examples to produce, for each $n$ an example $P$ with $P^n\ne\emptyset$ and $P^{n+1}=\emptyset$. To see this, note that any $P$ so built has a minimal point, some points that are successor points, meaning that they have an immediate predecessor in $P$, and some points that are limits of sequences of points in $P$. We build the next example: For each successor point $b$ in $P$ with immediate predecessor $b^-\in P$, fix a strictly increasing sequence sitting strictly between $b^-$ and $b$ and converging to $b$. Let $Q$ be the union of $P$ and (the ranges of) all these sequences. Note that $Q$ is closed and that all points of $P$, except for its least element, are limit points of elements of $Q$, so $Q'$ is just $P$ with its least element removed.


Ok, we are ready to build the desired example. Let $P_n$ be a set built as in the procedure just described, with $P_n^n$ a singleton. By means of a dilation and a translation, we may also ensure that $P_0=\{0\}$, $P_1\subset(0,1/2]$ with $\max P_1=1/2$, $P_2\subset(1/2,3/4]$ with $\max P_2=3/4$, and so on, with $P_n\subset(1-1/2^{n-1},1-1/2^n]$ and $\max P_n=1-1/2^n$ for all $n>0$. 
Now set $P=P_0\cup P_1\cup\dots\cup P_n\cup\dots\cup\{1\}$.    

In fact, you can ensure much more. For each countable ordinal $\alpha$ there is a closed countable set of reals $P=P^0$ such that $P\supsetneq P^1\supsetneq\dots\supsetneq P^\beta\supsetneq\dots\supsetneq P^\alpha$ for all $\beta<\alpha$ (at limit stages $\gamma$, define $P^\gamma=\bigcap_{\rho<\gamma}P^\rho$). An easy way to achieve this is to note first that each countable ordinal embeds into $\mathbb R$, and that we may further ensure that the embedding is continuous (where the ordinal is given the order topology). We then just note that successor ordinals are compact, and that their derived sets are easy to compute. For instance, the limit points of an ordinal $\alpha$ are just the limit ordinals below $\alpha$. The limit points of this set are the ordinals below $\alpha$ that are multiples of $\omega^2$, and so on. 
In the examples above, each set $P_n$, $n>0$, has order type $\omega^n+1$ and $P=P_\omega$ has order type $\omega^\omega+1$ (the exponentiation is in the ordinal sense).  
(To see that any countable ordinal embeds into $\mathbb R$, in fact note that any countable linear order embeds into $\mathbb Q$, as can be easily verified by constructing the embedding recursively using an enumeration of the linear order and the fact that $\mathbb Q$ is dense in itself and has no endpoints. Once such an embedding of an ordinal is arranged, consider the closure of its range. Check that this is again an ordinal, perhaps slightly larger than the ordinal you began with, and redefine the embedding accordingly, to obtain a continuous embedding.)
It is perhaps worth pointing out that mention of ordinals is not an accident or capricious. For instance, theorem 2.1 of 

MR0867644 (88a:05013). Baumgartner, James E. Partition relations for countable topological spaces. J. Combin. Theory Ser. A 43 (1986), no. 2, 178–195, 

implies in particular that if $X$ is a countable Hausdorff space with a countable open base, $0<\alpha$ is countable, and $X^\alpha\ne\emptyset$, then $X$ has a subspace homeomorphic to $\omega^\alpha+1$.
