# What is the difference between dense and closed sets?

I am self studying topology and is a bit stuck on the difference between dense and closed sets. Intuitively, a dense set is a set where all elements are close to each other and a closed set is a set having all of its boundary points.

But to make this more concrete, can someone give me an example of a closed set that is not dense and a dense set that is not closed?

Thanks!

• Can you give an example of a closed set (in a topological space $X$) which is dense? Hint: there is only one.
– bof
Aug 9, 2015 at 6:25
• I think the important point of your misunderstanding is your intuition... "Intuitively, a dense set is a set where all elements are close to each other" - This is untrue. Intuitively, a dense set A in a given space X is a set where all elements of X are close to elements of A Aug 9, 2015 at 20:42
• When a set is dense in a space, I usually hear it described as 'A is dense in X'; I think that nicely emphasises the point in the previous comment. Sep 1, 2015 at 3:30

$[0,1]$ is a closed subset of $\mathbb R$ that is not dense. It contains all of its limit points, so it is closed. Some points in $\mathbb R$, for example $2$, are not limit points of this set, so the set is not dense.

$\mathbb Q$ is a dense subset of $\mathbb R$ that is not closed. It is not closed because it does not contain all of its limit points. For example $\sqrt 2$ is a limit point of this set because every open neighborhood of $\sqrt 2$ contains some rational numbers. It is dense because every point in $\mathbb R$ is one of its limit points.

• Good example !!
– mick
Jan 14, 2017 at 1:17
• @mick : Glad you liked it. Jan 14, 2017 at 1:29

I want to add one thing. The only closed, dense set in a topological space is the space itself!

So these two concepts are pretty far apart. So far that in most situations, they are mutually exclusive!

• Would the proof of that go like this? Let T be a closed dense subset of S, then for every x in S there exist points in T arbitrarily close to x (by definition of dense) and since T contains points arbitrarily close to x, then x must be in T (by definition of closed). Thus any x in S is also an element of T. Aug 9, 2015 at 11:15
• @kasperd 'closeness' isn't a very well defined concept for arbitrary topological spaces. Suppose $X$ is a topological space and $T$ is a dense closed subset of $X$. Let $U$ be the complement of $T$ which is open by definition. By the definition of dense, $T$ and $U$ have a non-empty intersection if and only if $U$ is empty, but $T$ and $U$ are disjoint and hence $U$ must be the empty set. Aug 9, 2015 at 12:33

A set is dense/closed in a given topological space.

$[0,1]$ is closed in $\mathbb{R}$ but it is not dense in $\mathbb{R}$ since there are real numbers that can not be approached arbitrarily close by elements of $[0,1]$.

$[0,1]\setminus\{\frac{1}{2}\}$ is dense in $[0,1]$ but it is not closed in it.

Take $\mathbb R$ with the usual topology. Then the set of integers is closed (any converging series of integers converges to an integer), but not dense (you get nowhere close to $1/2$). On the other hand, the set of rational numbers is dense, but not closed (the limit of a sequence of rational numbers can be irrational).

IMHO a good intuition for a closed set is that while staying in the set, you cannot get arbitrary close to any point outside of that set. Which is actually the exact opposite to a dense set which gets close to each point of the space.

With that intuition it's also immediately clear why the only closed dense set is the space itself: The only way to come close to each point without coming close to any point outside of the set is if there are no points outside of the set.

Let the metric space be $\mathbb{R}$. Then $\{0\}$ is closed but not dense in $\mathbb{R}$. While $\mathbb{Q}$ is dense but not closed in $\mathbb{R}$.

Loosely speaking:

Suppose $X$ is a topological space (with some topology, obviously).

If $A \subseteq X$ and we say $A$ is dense in $X$, we mean that for each point $x \in X$, we can keep finding points from $A$ "closer" and "closer" to $x$.

If $B \subseteq X$ and we say $B$ is closed in $X$, we mean if you can find points in $X$ that are really really close to elements of $B$, then those points from $X$ are also in $B$. In other words, if $y$ is an element that is not in $B$, then none of the points nearby it are in $B$ either (otherwise, if we could keep finding stuff from $B$ closer and closer to $y$, then $y$ would be in $B$).

I'd say the most glaring difference between the two definitions is that dense sets need not contain their limit points. Closed sets necessarily do. There are plenty of examples of "dense not closed" and "closed not dense" scattered throughout this question now.

I'd also argue that your intuition for a dense set only makes sense in spaces where distance makes sense, like $\Bbb{R}^n$. As long as that helps you warm up to the definition, that's good. But in more general spaces things won't be that intuitive. For example, the set $X=\left\{\square ,\triangle\right\}$. A topology for the set is $$\mathcal{T}=\left\{\emptyset, \left\{\square ,\triangle\right\},\left\{\square\right\} \right\}$$ We see that $\square$ is open in $X$ and that $\text{Cl}(\square) = X$ so $\square$ is dense in $X$. But "closeness" doesn't mean a whole lot either.

In a topological space $(X,\tau)$ a subset $A \subset X$ is dense, iff its closure is the whole space, i.e. $\overline{A} = X$, while a subset $B \subset X$ is closed iff it is its own closure, i.e. $\overline{B} = B$.

To recite the example of $\mathbb{R}$ with euclidian topology:

• $\mathbb{Q} \subset \mathbb{R}$ is dense but not closed, since: $\overline{\mathbb{Q}} = \mathbb{R}$.
• $[0,1] \subset \mathbb{R}$ is closed but not dense, since $\overline{[0,1]} = [0,1]$.

One explanation is in terms of continuous functions.

A continuous function (on a topological space $X$) is determined by its values on a dense subset of $X$. This is a defining characteristic of dense sets; any non-dense subset does not have this property.

A prototype of a closed subset of $X$ is the solution set of a collection of equations defined by continuous functions; more abstractly, the set of points where a continuous function (from $X$ into some other topological space $Y$) attains a particular value. This might encompass all closed subsets under some fairly general hypotheses that endow $X$ it with "enough" continuous functions, or maybe allowing arbitrary $Y$ is enough. This picture is made precise in a more advanced setting by dualities between algebras of functions and topological (or geometric, or algebra-geometric, ....) spaces.

• Note that for $(X,\tau),(Y,\sigma)$ topological spaces your first paragraph only holds for continuous functions $f : (X, \tau) \to (Y, \sigma)$ if $(Y,\sigma)$ is hausdorff. Aug 9, 2015 at 21:04
• I guess I'm overly used to working in tame categories of spaces. If you know of a more general way of stating the same sort of point I would be interested to learn it. Aug 9, 2015 at 21:07
• (ie, if there is a version using nets or something, without Hausdorff assumptions) Aug 9, 2015 at 21:08
• This is an interesting point. Why don't you ask the community at math.stackexchange? Aug 9, 2015 at 21:11
• I'm just posting to get reputation for answering a question on meta. If I continue with this user account, I might ask sometime as you suggest. Thanks. Aug 9, 2015 at 21:13

No one talk about Zarisky topology so I wanted to write it. Zariski topology is taught at the beginning of algebraic geometry. Let $$k$$ be algebraically closed field and $$\mathbb{A}^n_k$$ is the set of all elements $$(a_1,...,a_n)$$ where $$a_i's \in k$$. In Zarisky topology, the closed sets are the zero set of ideals of $$k[x_1,...,x_n]$$.

In this topology, in $$\mathbb{A}^n_k$$, there is only one dense and closed set which is $$\mathbb{A}^n_k$$. The other closed sets are not dense. Besides, all nontrivial open sets are dense in this topology.