Open and Closed Sets in Metric Spaces
What does it mean for a set to have no sharp edges? Consider the plane with its usual distance. The disk feels fundamentally different from the disk . The first contains none of its "rim." The second contains all of it. This article makes that intuition precise. It uses only the notion of distance supplied by a metric space. The concepts of open and closed sets are the seed from which all of topology grows. Once we know which sets are "open" in a metric space, we can define continuity, convergence, compactness, and connectedness. We do this purely in terms of open sets. We never again need to mention 's and 's explicitly. This is the bridge from analysis (built on distances) to topology (built on open sets alone). It is the reason a single abstract definition can unify convergence of sequences of real numbers, convergence of functions, and convergence of matrices under one roof. The strategy here is to build outward from the single most basic shape a metric space offers: the open ball. Open sets are unions of open balls. Closed sets are complements of open sets. From these two definitions we extract a small toolkit of equivalent characterizations. These come via limit points, via sequences, and via closure under complementation. This toolkit will be used constantly in every subsequent topological argument. By the end of this article you will have several things. You will have a rigorous definition of open and closed sets in a metric space. You will have a proof of their fundamental closure properties (the axioms that later define a topological space abstractly). You will have a sequential characterization of closedness. You will have worked examples in and in function spaces. Finally, you will have a careful discussion of the traps that trip up every beginner exactly once. These traps include sets that are neither open nor closed, or both.
- An open ball is the basic building block of a metric space.
- A set is open if every point of has some open ball around it contained in .
- A set is closed if its complement is open — equivalently, contains all its limit points.
- Arbitrary unions and finite intersections of open sets are open; arbitrary intersections and finite unions of closed sets are closed.
- Sets can be open, closed, both (clopen), or neither — all four cases occur even in .
- Key idea: openness is a local condition (wiggle room at every point), and closedness is its complement, equivalently "closed under taking limits."
Where this lives today
The open/closed dichotomy underlies essentially all of modern analysis: continuity of a function between metric spaces is equivalent to the preimage of every open set being open, a purely topological reformulation of the - definition. Compactness (every open cover has a finite subcover) and its practical consequences — the Extreme Value Theorem, existence of minimizers in optimization — are stated entirely in the language of open sets. In complex analysis, domains of holomorphy and the identity theorem rely on open connected sets; the maximum modulus principle is phrased via open sets on which a function attains no interior maximum. In differential geometry, manifolds are built by gluing open sets homeomorphic to , making the open-set toolkit the literal scaffolding of the definition of a manifold. In numerical analysis and optimization, closed sets (such as closed convex feasible regions) guarantee that limits of feasible sequences remain feasible, which is exactly why convergence proofs for gradient descent and projection algorithms invoke closedness. In probability theory, the Borel -algebra generating measurable sets is built starting from the open sets of a metric space, so every measure-theoretic statement about "measurable events" ultimately traces back to this article's definitions. In cryptography and coding theory, metrics on finite spaces (e.g. Hamming distance) still support the same ball/open-set machinery, used to define error-correcting sphere-packing bounds. These threads all begin with the same open ball defined here, and all continue directly into Topological Spaces and Open Sets and Closure, Interior, and Boundary.
Ask the tutor: Can you show me why every finite subset of a metric space must be closed, using the limit-point characterization directly?
Let be a metric space.
Open ball. For and , the open ball of radius centered at is
Open set. A subset is open (in , with respect to ) if for every there exists such that
Equivalently, is a union of open balls.
Closed set. A subset is closed if its complement is open.
Limit point. A point is a limit point (or accumulation point) of a set if every open ball , , contains a point of different from ; that is,
By convention, and are declared open (vacuously and trivially, respectively); this is consistent with the ball definition above, since the "for every " condition is vacuous, and obviously contains a ball around each of its points.
Intuition
Think of an open ball as "wiggle room": if , you can nudge slightly in any direction (in a general metric space, "direction" just means "to any nearby point") and stay inside the ball, provided the nudge is small enough. Openness of a set says every point of has some amount of wiggle room, though the amount is allowed to shrink as you approach the "edge" of — as long as it never reaches zero for points actually inside . Closed sets are the mirror image: a set is closed exactly when it has no missing edge — whenever a sequence of points in homes in on some target point of , that target is already in . This is why intervals like (which contain their endpoints) are closed, while (missing both endpoints) is open. The picture below shows the real line with these two intervals, highlighting the crucial difference: at the endpoints of , no ball of any positive radius fits inside , but every ball around an endpoint of pokes outside into the complement, and that is precisely what makes 's complement open.
:::svg[Open interval has wiggle room at every point; closed interval contains its endpoints]
::: The second picture worth carrying around is the ball itself in : not always literally round if you change the metric, but always defined the same way. In the taxicab metric , the "ball" is a diamond, not a disk — a reminder that "open ball" is a metric-dependent notion, even though the resulting open sets of turn out to be the same collection for many common metrics (a fact revisited when comparing equivalent metrics).
Let be a metric space. 1. Every open ball is an open set. For any and , the set is open. 2. and are both open and both closed. 3. Arbitrary unions of open sets are open. If is any family of open subsets of , then is open. 4. Finite intersections of open sets are open. If are open subsets of , then is open. 5. (Dually, by De Morgan's laws) Arbitrary intersections of closed sets are closed, and finite unions of closed sets are closed. 6. Sequential characterization of closed sets. A set is closed if and only if for every sequence in converging to some , we have . Equivalently, is closed iff contains all of its limit points.
We prove each part in order. Throughout, .
(1) Every open ball is open. Let , , and let . Take any ; we must find with . Since , we have , so
We claim . Let , so . By the triangle inequality for the metric ,
Hence . Since was arbitrary, , proving is open by definition.
(2) and are open and closed. is open vacuously: the defining condition "for every , there is a ball around inside " has no to check, so it holds automatically. is open because for every , trivially (every point of has distance defined and every ball is by definition a subset of ). Since is open, is closed; since is open, is closed.
(3) Arbitrary unions of open sets are open. Let be open sets and let . Let . By definition of union, for some index . Since is open, there is with . Since , we get . As was arbitrary, is open. (Note this argument used no finiteness restriction on ; it works even if is uncountable.)
(4) Finite intersections of open sets are open. Let be open and let . If we are done by (2). Otherwise let . For each , since and is open, there exists with . Let
This minimum is over a finite nonempty set of positive numbers, hence (this step genuinely requires finiteness — see the counterexample below for what fails otherwise). For each , since , we have . Hence . Since was arbitrary, is open.
(5) Duals for closed sets. Let be closed sets. By definition each is open. By De Morgan's law,
and the right side is open by part (3) (an arbitrary union of open sets). Hence has open complement, i.e., is closed. Similarly, for finitely many closed sets , De Morgan gives
a finite intersection of open sets, open by part (4). Hence is closed.
(6) Sequential characterization of closed sets. Recall means: for every , there exists such that , i.e. for all . () Suppose is closed. Let be a sequence in with for some . We must show . Suppose, for contradiction, , i.e., . Since is closed, is open, so there exists with . But since , there exists with . Then , contradicting . Hence . () Suppose is not closed; we show the sequential property fails, which proves the contrapositive of this direction. Since is not closed, is not open, so there exists a point such that no ball is contained in ; equivalently, for every , . Apply this with for each positive integer : choose (possible since this intersection is nonempty for every ; this uses the axiom of countable choice implicitly, standard in this context). Then for all , and , so . But . This exhibits a sequence in converging to a point outside , so the sequential property fails. Combining both directions (each proved as a direct implication, together giving the stated "if and only if"): is closed iff every convergent sequence in has its limit in . Finally, the equivalence with limit points: if contains all its limit points, and with , then either for some (so already) or for all large , in which case every ball around contains points of other than (namely tail terms ), making a limit point of , hence by hypothesis. Conversely if is closed and is a limit point of , then for every we may pick with (using the definition of limit point), giving a sequence in with ; by the sequential characterization already proved, . Thus " closed" " contains all its limit points."
∎Worked examples
Example 1: A half-open rectangle in with the Euclidean metric. Let
We claim is neither open nor closed, and we locate exactly which boundary pieces belong to . Not open: consider the point (on the left edge, ). For any , the ball contains points with negative -coordinate, e.g. , since . Such because its -coordinate is negative. Hence no ball around fits in , so is not open. Not closed: consider , which lies on the bottom edge , excluded from (since requires strictly), so . But is a limit point of : for any , the point satisfies (for ; for take any point of near , which still exists since meets every ball around ) and lies in (its -coordinate is in and ). So every ball around meets , making a limit point of not contained in ; by the sequential/limit-point characterization, is not closed. Boundary bookkeeping: the edges and belong to (matching the signs), while and do not (matching strict inequalities). This asymmetric mix of open and closed edges is exactly why falls into neither the "open" nor "closed" category — a single strict inequality among several is enough to destroy openness, and a single non-strict inequality is enough to destroy closedness at the complementary edge.
Example 2: A ball in the space of bounded sequences . Let , the space of bounded real sequences with metric
(This is a metric: symmetry and positivity are immediate, and the triangle inequality follows from for every , hence also for the supremum over .) Consider the set
the closed unit ball centered at . We verify directly (not merely by name) that is closed, by showing is open. Let , so ; write for some (finite since is bounded). We claim . Let , i.e. . Choose an index with close to , say (possible since is a supremum). Then by the reverse triangle inequality,
This alone does not immediately exceed ; we must be more careful and choose with for a small depending on , then bound appropriately. Redo cleanly: given , for every index ,
Taking the supremum over on both extreme sides (valid since the inequality holds for every fixed , so it holds for the index achieving the sup on the left, and the right side's sup is ... but we must take sup of , which equals since is constant):
This only gives , not strictly greater than , so we tighten the radius: use instead. Repeating the computation with in place of gives
so , i.e. . This holds for every , so . Since was arbitrary, is open, so is closed — exactly as its name "closed unit ball" promises, now verified from the definitions rather than assumed.
Theorem part (4) asserts finite intersections of open sets are open, and the proof crucially used that for finitely many positive numbers . Drop the finiteness hypothesis and allow a countably infinite intersection: the conclusion fails. Work in with the usual metric. For each define the open interval
which is open (it is the open ball , open by Theorem part (1)). Consider
We compute this intersection exactly: a real number lies in every iff for all . If , choosing gives , so for that ; hence fails to lie in the intersection. If , then for every , so belongs to every . Therefore
But is not open in : for any , the ball contains nonzero points (e.g. ), so , meaning no ball around fits inside . Thus an intersection of infinitely many open sets produced a non-open (in fact closed, being a single point, verified via the sequential criterion or directly) set. This is precisely why the hypothesis "finite" in part (4) cannot be dropped or replaced by "countable" or "arbitrary": the proof's use of has no analogue for , which can legitimately equal .
Scope, edge cases & common traps
| Situation | What holds | What fails / trap |
|---|---|---|
| Finite intersections of open sets | Open (Theorem part 4) | Infinite intersections can fail to be open (see counterexample) |
| Arbitrary unions of open sets | Always open (Theorem part 3) | No restriction needed here — union is safe for any cardinality |
| A set that is both open and closed | Occurs: e.g. always; in disconnected spaces, more examples ("clopen" sets) | Students often assume "closed" means "not open" — false; the two are not exhaustive or exclusive |
| Single point | Always closed in any metric space (its complement is open by an argument like Example 2/Theorem part 1 combined with the triangle inequality) | Not always open — e.g. is not open |
| Half-open interval | Neither open nor closed in | Easy to mistakenly call it "closed" because of the bracket at alone |
| Discrete metric ( if ) | Every subset is open (and hence closed) | Tempting to think "closed" sets must be small or bounded — false, depends entirely on the metric |
The mathematician behind it
Origins · 1 minFelix Hausdorff and how this was discovered
Felix Hausdorff was a German mathematician whose 1914 treatise Grundzüge der Mengenlehre (Foundations of Set Theory) gave one of the first systematic, rigorous treatments of topological spaces, building directly on the metric-space notions of open sets pioneered by Fréchet. Hausdorff recognized that the properties proved in the theorem above — arbitrary unions and finite intersections of open sets remaining open — could be taken as axioms defining a topological space abstractly, freeing topology from any dependence on a distance function. He also introduced the separation condition now called the Hausdorff property, ensuring distinct points can be separated by disjoint open sets, automatically satisfied by every metric space. Hausdorff's career ended in tragedy: as a Jewish academic in Nazi Germany, he was stripped of his position, and in 1942, facing deportation to a concentration camp, he and his wife and sister-in-law died by suicide. His mathematical legacy, however, is foundational to virtually every branch of modern analysis and geometry.
Is every open set a union of open balls, or just something that "locally looks like" a union of balls?
Every open set genuinely is a union of open balls, not merely something resembling one locally. If is open, then for each there is some with ; taking the union over all gives . This union is contained in (each ball is), and it contains (each lies in its own ball, since ). Hence exactly, a union of open balls — potentially uncountably many, but that is permitted since Theorem part (3) allows arbitrary unions.
Can a set be both open and closed at the same time?
Yes — such sets are called clopen. In any metric space, and are always clopen. In (with the usual metric) these are in fact the only clopen sets, a fact equivalent to being connected. But in disconnected spaces there can be more: in with the inherited metric, the piece is clopen within , because its complement is also open in (every point of has a small ball, using the metric restricted to , that stays inside ). Clopen sets are exactly the obstruction to connectedness.
Does "closed" mean the same thing as "bounded" or "compact"?
No, and conflating them is a common error. Closed only means the complement is open; it says nothing about size. The whole space is always closed (Theorem part 2) yet is typically unbounded (e.g. ). Conversely a set can be bounded but not closed, like . The Heine–Borel theorem shows that in specifically, "closed and bounded" together are equivalent to compactness, but this equivalence is special to finite-dimensional Euclidean space and fails in general metric spaces (there exist closed, bounded sets in infinite-dimensional spaces, like the closed unit ball in from Example 2, that are not compact).
Why do we require open balls to use strict inequality rather than ?
The strict inequality is what makes open in the first place, matching Theorem part (1). If we instead defined "balls" with (the closed ball ), the resulting set is generally closed, not open — for a point with exactly, every ball around pokes outside in a typical metric space like . Both notions are useful and standard; they are just different objects serving different roles (open balls generate open sets, closed balls are prototypical closed sets), and one should never conflate them.
If a set has no limit points at all, is it automatically closed?
Yes. The characterization in Theorem part (6) says is closed iff contains all its limit points. If has no limit points whatsoever, the condition " contains all its limit points" holds vacuously (there is nothing to check), so is closed. This explains why every finite set, and more generally every set with no accumulation points (such as is not such an example since is a limit point — but in has no limit points and is indeed closed), is automatically closed.
How does this metric-space definition connect to the abstract definition of a topological space?
Theorem parts (2), (3), and (4) — that and are open, arbitrary unions of open sets are open, and finite intersections of open sets are open — are exactly the three axioms used to define a general topological space, except there the collection of "open sets" is given by fiat (a topology) rather than derived from a metric. Every metric space thus produces a topological space by taking the metric's open sets as the topology; this is called the metric topology. Not every topological space arises this way (non-metrizable spaces exist), but every metric space gives a legitimate topology, and the theorem proved here is precisely the verification that this construction is consistent.
Is the empty set really open, or is that just a technicality to avoid worrying about it?
It is genuinely open by the definition, not merely a convention adopted for convenience, though it is admittedly a vacuous case. The defining condition for openness is a universally quantified statement: "for every , there exists with ." When , there are no elements to produce a counterexample, so the universal statement is true by the standard logical convention that a universally quantified statement over an empty domain is vacuously true. This is the same logical principle used throughout mathematics (e.g., "every element of is prime" is also vacuously true), not a special exception invented for topology.