Clopen set

In topology, a clopen set (a portmanteau of closed-open set) in a topological space is a set which is both open and closed.

That this is possible may seem counterintuitive, as the common meanings of open and closed are antonyms, but their mathematical definitions are not mutually exclusive.

A set is closed if its complement is open, which leaves the possibility of an open set whose complement is also open, making both sets both open and closed, and therefore clopen.

As described by topologist James Munkres, unlike a door, "a set can be open, or closed, or both, or neither!

"[1] emphasizing that the meaning of "open"/"closed" for doors is unrelated to their meaning for sets (and so the open/closed door dichotomy does not transfer to open/closed sets).

This contrast to doors gave the class of topological spaces known as "door spaces" their name.

which consists of the union of the two open intervals

This is a quite typical example: whenever a space is made up of a finite number of disjoint connected components in this way, the components will be clopen.

be an infinite set under the discrete metric – that is, two points

Under the resulting metric space, any singleton set is open; hence any set, being the union of single points, is open.

So, all sets in this metric space are clopen.

of all rational numbers with their ordinary topology, and the set

of all positive rational numbers whose square is bigger than 2.

is not a clopen subset of the real line