[Math] Example of metric space that has more than two sets that are both closed and open

general-topologymetric-spaces

I'm curious if there are examples of metric spaces having more than two sets that are both closed and open.

Note: This is not for homework. This is to help me better understand the concepts of computational topology, so that I may make my own proofs as well.

So I am thinking that this could involve sets that are partially closed, partially open. Ie. a half ball with which one side is open (the boundary) and the other side is closed.

Best Answer

Metric spaces that aren't connected can give such examples. For example, $(0, 1) \cup (2, 3)$ is a metric space (equipped with the usual Euclidean metric) and both $(0, 1)$ and $(2, 3)$ are open and closed in the topology induced by the metric.

Of course, as usual $\emptyset$ and the entire space are two more examples, for a total of four.