# Is the following a valid countable dense subset of (0,1) the open unit interval?

Let $$X = \mathbb{R}$$, $$D = \mathbb{Q}$$ and $$I = (0,1)$$. We know that $$X$$ is a complete metric space and $$D$$ a countable dense subset, thus making $$X$$ separable.

First of all, I do know that a subspace of a separable metric space is itself separable. I have learned the proof using second countability, which also gives a construction of said dense subset (I think).

This question however is based on something else: In this particular case I feel like the first approach one would choose to construct a dense subset would be to just look at $$I \cap D$$. Now here I would argue that the closure $$cl(I \cap D)=[0,1]$$ which is not $$I$$ again, so is $$I \cap D$$ actually dense in $$I$$?

Furthermore if this construction works in this particular example, would it be possible to extend this to a proof? Naively translating this would not work, as if $$I:=\{x\in\mathbb{R}: x \notin \mathbb{Q}\}$$ the "purely" irrational numbers, then the intersection would just be empty...

$$I \cap D$$ is indeed dense in $$I$$ and in general that argument can show that any open subset of a separable (general) space is again separable: the intersection of the dense set with the open set is dense in the open set.
• also forgive me for this novice question, but why is $I \cap D$ dense in $I$? I'm working with the definition that the closure has to be $I$ again, but here we get something slightly larger than that? Commented Jan 23, 2022 at 14:26
• @Taleofwoe all that matters is that $I$ lies in that closure. It could be larger. And it’s true in general spaces for open subsets. It needs the metric in more general setting. Commented Jan 23, 2022 at 14:29