# Prove that the set $S\subseteq\mathbb{R}$ is countable.

Given a set $S\subseteq \mathbb{ R}$ with the property that for every $x\in S$ there is an open interval $I$ containing $x$ such that $I\cap S$ is countable. Prove that S is countable.

I am trying to write $S$ as a countable union of countable sets by using the given property of intersection, but not getting the suitable idea. Please suggest me. Thanks a lot.

• have you tried expressing $\mathbb{R}$ as a countable union of closed intervals e.g. $[n,n+1]$ then using a compacness argument for each interval? – David Holden Aug 21 '16 at 19:01
• Hint: we can use a countable topological basis for $\Bbb R$ that consists of open intervals. – Omnomnomnom Aug 21 '16 at 19:02
• no i did't try like this...but now i am think according to you... – neelkanth Aug 21 '16 at 19:02
• Hint: $\mathbb{R}$ is second-countable (en.wikipedia.org/wiki/Second-countable_space), thus you can extend the collection of $I_x$'s to a cover of $\mathbb{R}$ by open sets, and then invoke second-countability to reduce that cover to a countable cover. This cover still satisfies (by necessity) that $\forall x$ there is an $I$ such that $x\in I$, and since the intersections with the original $I$'s were countable, so to must the intersections with the reduced cover. Therefore, $S$ is countable. – Justin Benfield Aug 21 '16 at 19:02
• @Omnomnomnom i am trying without using general toplogical ideas... – neelkanth Aug 21 '16 at 19:03

Let $S$ be a set so that for every $x\in S$ there is an open interval $U$ containing $x$ so that $U\cap S$ s countable.

It follows that for every $x\in S$ we can select an open interval $U_x=(a,b)$ so that $x\in U_x$, $U_x\cap S$ is countable and $a$ and $b$ are rational.

Cleary $S\subseteq\bigcup\limits_{x\in S} U_x$, it follows that $S=S\cap(\bigcup\limits_{x\in S} U_x)=\bigcup\limits_{x\in S}(S\cap U_x)$.

This last union is equal to a countable union of countable sets, because the number of open intervals with rational endpoints is countable.

• yes i was searching this type of idea.... – neelkanth Aug 21 '16 at 19:04
• @CarryonSmiling But last union is over elements of $S$, then how is it countable union? intervals may not be distinct.. – neelkanth Aug 21 '16 at 19:11
• $U_x$ is always an interval with rational endpoints, there is only a countable number of intervals of this form. – Jorge Fernández Hidalgo Aug 21 '16 at 19:12
• every thing is ok ...my confusion is just about last union as its also depends with elements of $S.$ – neelkanth Aug 21 '16 at 19:15
• Every real number can be put in an interval of rational endpoint.. then isn't there as much intervals with rational endpoints as there are real numbers? – user290300 Aug 21 '16 at 19:20

Write $\mathbb{R}=\bigcup\limits_{n\in\mathbb{N}}\,[-n,+n]$ and $S_n:=[-n,+n]\cap S$ for each $n\in\mathbb{N}$. Then, consider the open cover of $[-n,+n]$ consisting of $[-n,+n]\setminus \bar{S}_n$, where $\bar{S}_n$ is the topological closure of $S_n$, and all open intervals $I$ that contain $x\in S_n$ with $I\cap S$ being countable.

• Let $s : \mathbb{N} \to \mathbb{Q}$ be an enumeration of $\mathbb{Q}$. Let $I_n$ denote an interval such that $s(n) \in I_n$ where $I_n \cap S$ is countable. Then $\mathbb{R} = \cup_{n = 1}^{\infty} I_n$, so $S = \cup_{n = 1}^{\infty} (I_n \cap S)$, a countable union of countable sets. – AJY Aug 22 '16 at 3:35