# Are singletons closed or open?

"Exercise 1. Show that if $$X$$ is equipped with the discrete metric $$d$$ then every subset of $$X$$ is both open and closed. Deduce that any function $$f : (X, d) → (Y, dY )$$ is continuous."

My lecturer shared the following answer:

"Exercise 1. If $$A\subset{X}$$ then for every $$a\in{A}$$ we have $$B(a, 1/2) = \{a\}$$, and so $$A$$ is open. Since every subset is open, every subset is also closed. The function $$f$$ is continuous if $$f^{-1}(U)$$ is open in $$(X,d)$$ for any open set U in $$(Y,dY )$$; but $$f^{-1}(U)$$ is a subset of $$(X,d)$$, so is always open."

So my question is that are singletons open? I thought they are closed. Or does it depend on the metric?

• It depends on the topology, though that can be induced by the metric if you have one. Generally in a topology you declare all the sets that you consider open, so you can have some, all, or none of the singletons open – postmortes May 13 at 9:46
• Yes: a metric gives you a way to define open sets, and so you can generate ("induce") a topology from it – postmortes May 13 at 9:49
• Yes, a metric always induces a topology, but not every topological space is metrizable. – YuiTo Cheng May 13 at 9:52
• It is common to teach metric spaces without mentioning "topology", defining everything (such as open and closed sets, continuity, etc.) directly in terms of the metric. This generally works well. Once you get to general topological spaces it then turns out that almost everything can be defined through the topology, i.e. just by knowing which sets are open. – Henning Makholm May 13 at 9:57
• "Metrizable" is used about a topology and means that this particular topology can be induced by a metric. – Henning Makholm May 13 at 9:58