# Given closed $C \subseteq \mathbb{R}$ find a sequence with subsequences convergent to every point in $C$ and nowhere else

Given $C \subseteq \mathbb{R}$ closed, find a sequence such for every point in $C$ there is a subsequence of your sequence which converges to that point, and that there is no subsequence of your sequence which converges to a point outside of $C$ (excluding $\pm \infty$).

If I take an enumeration of $\mathbb{Q}$ that will have subsequences which converge everywhere in $\mathbb{R}$. I want to somehow cut out the portions of $\mathbb{Q}$ which are not near $C$. Initially I thought to just take $\mathbb{Q} \cap C$ but this didn't work. Perhaps I could modify this trick a little to get it to work? Or is there a better way to do it?

-
$C$ has to be bounded, or there will be a subsequence that converges to whichever of $\pm\infty$ is in the unbounded direction. –  Ross Millikan Oct 21 '11 at 18:15
Are you sure of the "including $\pm\infty$" part? If $\infty$ is considered a "point", then one would expect that this point should also be considered when determining whether $C$ is closed or not. And if so, either $C$ is bounded (in which case there can never be a subsequence converging to $\infty$ anyway), or $C$ contains $\infty$ (in which case it should be allowed as a limit point). –  Henning Makholm Oct 21 '11 at 18:28
By the way, you also have to require that $C$ is non-empty. Otherwise there are no sequences at all. :-) –  Henning Makholm Oct 21 '11 at 18:33
No we don't need that it is nonempty, if it is empty then take the empty sequence and the statement is vacuously true. –  nullUser Oct 21 '11 at 18:47
A sequence is a function with domain $\mathbb{N}$. There's no such thing as an empty sequence. –  Chris Eagle Oct 21 '11 at 19:23

I think this requires (countable) choice in general. Enumerate all open intervals with rational endpoints, and for each such interval $I$ choose a point in $I\cap C$ if one exists (and throw away the interval otherwise). The set of all the chosen points will be dense in $C$.

-
I am okay with using any form of the Axiom of Choice if necessary. –  nullUser Oct 21 '11 at 18:36
Can't I enumerate all the rational open intervals without choice? Use a pairing function three times to get all ordered fours of $N$ and use them as endpoints if the fractions are in lowest terms and increasing? –  Ross Millikan Oct 21 '11 at 21:47
@Ross, you can enumerate the rational intervals without choice, but you need choice to select an element in each $I\cap C$ simultaneously. –  Henning Makholm Oct 21 '11 at 21:50
Don't you need to add in any isolated points in $C$ an infinite number of times in the sequence, too? –  Ross Millikan Oct 21 '11 at 22:02
@Ross, yes -- my intention was that this construction would be used together with Dave's one. –  Henning Makholm Oct 21 '11 at 22:08

This might be easier: Let $\{x_{1},\;x_{2},\; x_{3},\;...\}$ be a countable dense subset of $C$ and let the sequence be

$$x_{1},\; x_{1},\; x_{2},\;x_{1},\;x_{2},\;x_{3},\;x_{1},\;x_{2},\;x_{3},\;x_{4},\;...$$

There are some details to fill in (what if the set is finite, how do we know that no subsequences converge to a point not in $C$, etc.), which I'll leave to you.

-
Exactly my question, it is not clear at all that an arbitrary closed set has a countable dense subset. –  nullUser Oct 21 '11 at 18:25
@Kb100: You may want roughly indicate the mathematical level that is being assumed, as I took it for granted that we could use the fact that $\mathbb R$ is separable. In fact, I'm using the fact that $\mathbb R$ is hereditarily separable, which is equivalent to separability in metric spaces. –  Dave L. Renfro Oct 21 '11 at 18:31
I have no idea what that even means =\. This is introductory real analysis. –  nullUser Oct 21 '11 at 18:35
@Kb100: Unless I'm overlooking something, I think you have enough if you use Henning Makholm's answer along with mine. However, it would probably be a good idea to try to prove the result for some specific closed sets, such as $[0,1]$ and $\{\frac{1}{n}:\;n=1,2,3,...\} \cup \{0\},$ to get a better feel for what's going on. –  Dave L. Renfro Oct 21 '11 at 20:12
Yes his idea was sufficient. I made some preferential changes to the idea but it was rather easy to prove with this bit of help. The general proof was less than a page. Thanks so much everyone! –  nullUser Oct 21 '11 at 21:20

Here is an explicit construction.

For every $n\geqslant0$ call $I(n)$ the integer interval $I(n)=[2\cdot4^{n},8\cdot4^{n}-1]$. For every $k$ in $I(n)$, let $a(k)=2^{-n}(k-5\cdot4^{n})$, and $x(k)$ any point in $C$ such that $|x(k)-a(k)|=\min\{|x-a(k)|\mid x\in C\}$. Then $\mathfrak X=(x(k))_{k\geqslant2}$ is a sequence of elements of $C$ whose limit set is $C\cup D$ where $D\subseteq\{-\infty,+\infty\}$ is such that $D$ contains $-\infty$ if and only if $\inf C=-\infty$ and $D$ contains $+\infty$ if and only if $\sup C=+\infty$.

To see this, first note that every $x$ in $C$ is such that $|x|\leqslant3\cdot2^n$ for $n$ large enough. For every such $n$, there exists $k$ in $I(n)$ such that $|x-a(k)|\leqslant2^{-n-1}$. Since $|x(k)-a(k)|\leqslant2^{-n-1}$, $|x-x(k)|\leqslant2^{-n}$ hence $x$ is a limit point of $\mathfrak X$.

Finally, $\mathfrak X\subseteq C$ hence every limit point of $\mathfrak X$ is in the closure of $C$ in $\overline{\mathbb R}$, that is, in $C\cup D$.

-