Dense Sets and Separability
Why can every real number be approximated as closely as we like by a fraction? This is the seed of one of topology's most useful ideas. A dense set is a small, often countable, set. It nevertheless "fills up" a space in a precise topological sense. It leaves no room to breathe around any point that isn't already in it. The rational numbers sit densely inside the reals. The polynomials sit densely inside continuous functions. Finite decimal expansions sit densely inside the real line. In each case an infinite, complicated space is captured by a much simpler skeleton. The notion matters because so much of analysis is built by approximation. One proves a fact for a dense, tractable subset. Then one extends it to the whole space by continuity. Separability is the existence of a countable dense subset. It is the topological hypothesis that makes such extension arguments possible. It is a standing assumption in huge parts of functional analysis, measure theory, and metric geometry. The complementary notion of a nowhere-dense set captures the opposite extreme. It is a set so thin that its closure has empty interior. So it fails to be dense in any open piece of the space. Nowhere-dense sets are the building blocks of "topologically small" sets (meager sets). Their careful analysis is the direct ancestor of the Baire Category Theorem. This is one of the deepest finiteness principles in all of analysis. This article gives the precise definitions of dense, nowhere-dense, and separable. It builds the intuition with pictures. It proves the central structural theorem relating density to open sets and to bases. It works two asymmetric examples in detail. It shows exactly where each hypothesis is load-bearing.
- A subset of a space is dense if : every nonempty open set meets .
- Equivalently, is dense iff its complement has empty interior.
- A set is nowhere dense if — its closure has no interior.
- A space is separable if it contains a countable dense subset, e.g. in .
- Second-countability implies separability, but the converse can fail without extra hypotheses like metrizability.
- Key idea: density is about how a set meets every open set, not about size or measure — a set can be dense and have measure zero.
Where this lives today
Separability is the standing hypothesis behind countless approximation arguments: in functional analysis, a Hilbert space is separable if and only if it admits a countable orthonormal basis, which is the setting for Fourier series and quantum mechanics' state spaces (separable Hilbert space ). In probability theory, separability of the underlying metric space underlies the existence of regular conditional distributions and the theory of weak convergence of measures (Prokhorov's theorem). In numerical analysis and approximation theory, the density of polynomials in (Weierstrass approximation theorem) or of simple functions in spaces is exactly a density statement, enabling algorithms to approximate arbitrary continuous or integrable functions by simple, computable ones. In general topology and set-theoretic topology, nowhere-dense sets are the atomic pieces of meager sets, and the question of when a space cannot be a countable union of nowhere-dense sets is answered by the Baire Category Theorem, a cornerstone used to prove the existence of continuous nowhere-differentiable functions and the Open Mapping / Closed Graph theorems in functional analysis. In computer science, dense countable subsets underlie the theoretical justification for floating-point and rational approximations of real-valued computations, and separability assumptions appear in the theory of Polish spaces used in descriptive set theory and in machine learning's treatment of continuous state spaces.
Ask the tutor: How does the notion of a meager (first category) set, built from countable unions of nowhere-dense sets, set up the proof of the Baire Category Theorem?
Let be a topological space and let . 1. is dense in if , where denotes the closure of in . 2. Equivalently, is dense in if every nonempty open satisfies . 3. is nowhere dense in if , i.e. the closure of has empty interior. 4. is separable if there exists a countable subset with . More generally, for , one says is dense in the subspace if where the closure is taken in (equivalently, is dense in with the subspace topology).
Intuition
Think of the real line with its usual topology. Around every real number, no matter how small a neighborhood you draw, there is a rational number inside it — this is exactly the statement that is dense in . The rationals leave no "gap" open anywhere: every open interval, however tiny, is hit. This is very different from saying the rationals are most of in a measure-theoretic sense — Lebesgue measure of is zero — density is a purely topological notion about intersecting open sets, not about size. Contrast this with the set of integers inside . Its closure is itself (it's already closed), and that closure has empty interior: no open interval is contained entirely in . So is nowhere dense. A nowhere-dense set is "thin" in the strongest topological sense — you can always find an open sub-neighborhood of any open set that entirely avoids it (after passing to the closure). Nowhere-dense sets are the atoms out of which countable unions build "meager" (topologically negligible) sets, foreshadowing the Baire Category Theorem, where a complete metric space is proven to be not a countable union of nowhere-dense sets.
Intuition, continued
Separability is the statement that a single countable set can serve as this dense skeleton for the entire space. Countability is the crucial economizing feature: it means the space, however large and complicated (even uncountable, like ), can be approximated by a set we can enumerate — . This is what allows proofs by "check it on a countable dense set, then pass to the limit," a technique that recurs throughout Continuity arguments, throughout the construction of measures, and throughout functional analysis (e.g. separable Hilbert spaces admit countable orthonormal bases).
Let be a topological space and . Then the following are equivalent: (a) is dense in , i.e. . (b) Every nonempty open set satisfies . (c) has empty interior, i.e. . Moreover, if has a countable base for its topology (i.e. is second countable), then is separable.
We prove the equivalence of (a), (b), (c) directly from the definitions of closure and interior, and then prove the second-countability implication separately using the axiom of countable choice implicitly through a canonical choice function.
(a) (b). Suppose . Let be nonempty and suppose for contradiction that . Then . Since is open, is closed, and implies (by definition of closure as the smallest closed set containing ) that . But by hypothesis, so , forcing , contradicting the assumption that is nonempty. Hence .
(b) (a). We always have ; we must show . Let be arbitrary. Recall the standard characterization of closure: if and only if every open neighborhood of satisfies . (This characterization itself follows from the definition of as the intersection of all closed sets containing : iff there is a closed set with , iff the open set is a neighborhood of disjoint from .) By hypothesis (b), every nonempty open set meets ; in particular every open neighborhood of is nonempty (it contains ) and hence meets . So . Since was arbitrary, , giving .
(b) (c). We show the contrapositive form directly. By definition,
This union is nonempty if and only if there exists a nonempty open with , i.e. . Hence:
Negating both sides: if and only if every nonempty open satisfies , which is precisely (b). This proves (b) (c). Combining, (a) (b) (c), establishing the equivalence.
Second-countable separable. Suppose has a countable base , i.e. every open set of is a union of members of , and is countable. Discard from any that is empty; re-index so that we retain only the nonempty basic open sets, still countably many (a subset of a countable set is countable), and if all were empty then and the empty set is trivially separable via , so assume at least one and discard empty ones. For each remaining index , since , choose a point (this uses countably many choices, justified by the axiom of countable choice). Let
Then is countable, being the image of a countable index set. We claim is dense. Let be nonempty open. Since is a base, for some index set , and since this union is nonempty, so some with is nonempty and . Then , so , giving . By the already-established equivalence (b) (a), is dense in . Since is countable and dense, is separable.
∎Let . Then is nowhere dense in if and only if is dense in .
Apply the equivalence (a) (c) of Density, complements, and countable bases to the closed set in place of 's complement's role: we want . Set , a closed set. By the theorem applied to : is dense in iff , i.e. iff (since ). Thus is dense in iff , which is exactly the definition of being nowhere dense.
∎Worked examples
Example 1: The dyadic rationals are dense in , and are nowhere dense as a subset of considerations aside — but let's do something less standard: showing a non-uniform, asymmetric dense set. Let with the usual topology, and let
be the set of dyadic rationals that are not integers (an intentionally asymmetric, "punctured" variant of the usual dyadic rationals, to make sure density survives removing a nontrivial infinite subset). Claim: is dense in . Let be any nonempty open interval, . We must find an element of inside . Choose large enough that ; this is possible since as (Archimedean property of ). Consider the grid of points , spaced apart. Since the interval has length , it must contain at least one grid point with room to spare: concretely, let ; then automatically, and
using from our choice of . So . Now if happens to be an integer (i.e. ), replace by : since the grid spacing is strictly less than divided by 2, and we have at least grid spacings of room inside by construction (as ), the next grid point still lies in if did with strict room, which holds by the strict inequality above with slack. Concretely, since and , we get , and choosing even larger if necessary so that also guarantees two consecutive grid points both lie in , at most one of which is an integer (integers among dyadic points with denominator occur every grid steps apart, so two consecutive grid points cannot both be integers once ). Hence at least one of , is a non-integer dyadic rational lying in , i.e. lies in . Since was an arbitrary nonempty basic open interval and the topology of has these intervals as a base, and any nonempty open contains some such interval, meets every nonempty open set. By (b) (a) of the theorem, is dense in . Since is a subset of the countable set of all dyadic rationals, is countable, exhibiting 's separability via a deliberately non-obvious countable dense set.
Example 2: A nowhere-dense set that is uncountable — the standard Cantor set . Recall where and is obtained from by deleting the open middle third of each closed interval comprising . Each is a finite union of closed intervals each of length . Claim: is closed and nowhere dense in , despite being uncountable. First, is closed: each is a finite union of closed intervals, hence closed, and is an intersection of closed sets, hence closed. Since is closed, , so nowhere-density reduces to showing . Suppose for contradiction that ; then there is a nonempty open interval with . Since for every , we'd have for every . But consists of intervals each of length , so no subinterval of has length exceeding unless it's contained within one of these length- pieces — in particular forces (an interval of length cannot fit inside a single piece of , and different pieces of are separated by gaps, so no interval can span two pieces either). Choosing large enough that (possible by the Archimedean property, since ) contradicts . Hence no such exists, so . Therefore is nowhere dense — despite the well-known fact that is uncountable (in bijection with via ternary expansions using only digits ). This shows nowhere-density is a statement about the arrangement of a set relative to open sets, entirely independent of cardinality: a nowhere-dense set can be uncountable, and (as Example 1's cousin, , shows) a dense set can be countable.
The theorem shows second countable separable. One might hope for the converse: separable second countable. This is false in general topological spaces; the extra hypothesis of second countability (or at least metrizability) is essential and cannot be dropped or weakened to separability alone.
Construction. Let as a set, but equip it with the lower limit topology generated by the base of half-open intervals for (this is the Sommerfeld line, giving the Sorgenfrey line ). This is a legitimate topology: finite intersections of basic sets are again of that form or empty, and arbitrary unions of basic sets are declared open, satisfying the topology axioms. Claim: is separable. Let . Every nonempty basic open set with contains a rational number (by density of in with the usual topology, since has nonempty interior in the usual sense, or directly: choose a rational with , which exists since the rationals are dense in every nondegenerate interval). Hence every nonempty basic open set meets , so by (b) (a) of the theorem (applied in ; note the equivalence (a)(b) is purely general topology and holds in any space), is dense in . Since is countable, is separable. Claim: is <strong>not</strong> second countable. Suppose toward contradiction that is a countable base for . For each , the set is open, so there exists with . In particular has as its infimum (since forces every element of to be , and ). If then , so . This defines an injection from the uncountable set into , forcing to be uncountable — contradicting the assumption that is countable. Hence is separable but not second countable, showing the implication in the theorem is strict, and that separability alone is too weak a hypothesis to substitute for second countability whenever second countability is genuinely needed (e.g. in metrization theorems or in guaranteeing that "separable implies Lindelöf" arguments requiring a countable base rather than a countable dense set). The gap is repaired if one additionally assumes is metrizable: for metric spaces, separable does imply second countable (taking balls of rational radius around points of a countable dense set), but this extra metrizability hypothesis is exactly what is missing from 's general topological structure being invoked incorrectly.
Scope, edge cases & common traps
| Situation | What holds | What can fail |
|---|---|---|
| second countable | is separable (proved above) | Converse fails in general (Sorgenfrey line) |
| metrizable | Separable second countable Lindelöf | None of these equivalences need metrizability be dropped |
| nowhere dense | has empty interior; dense | itself need not be closed (only matters) |
| Dense set | Meets every nonempty open set | need not be open, closed, or of full measure |
| Countable union of dense sets | Need not be dense's complement small — care needed | Countable union of nowhere-dense sets can be dense (e.g. as a countable union of singletons, each nowhere dense) — this is precisely the phenomenon controlled by the Baire Category Theorem |
The mathematician behind it
Origins · 1 minFelix Hausdorff and how this was discovered
Hausdorff's 1914 treatise Grundzüge der Mengenlehre systematized the modern language of topological spaces, including the precise separation axioms and countability conditions (first and second countability, separability) that make "dense" and "nowhere dense" rigorous, comparable notions across abstract spaces rather than just intuitive facts about . His framework let mathematicians such as Baire's category theory, and later functional analysis built on separable Banach and Hilbert spaces, speak in a common precise vocabulary.
What is the difference between "dense" and "everywhere dense"?
There is no difference — "dense" and "everywhere dense" are synonyms, both meaning , i.e. meets every nonempty open set of . The phrase "everywhere dense" is sometimes used in older or translated texts (especially those following Russian or German conventions) purely to emphasize the contrast with "nowhere dense," where the closure of the set has empty interior instead of being the whole space. In modern English-language topology texts, "dense" alone always means this full, everywhere sense unless a qualifier like "dense in " (for a proper subspace ) is explicitly attached.
Is every dense set the complement of a nowhere-dense set?
Not quite — it is precisely the complements of closed nowhere-dense sets that are dense and open simultaneously. In general, is dense iff has empty interior (shown in the theorem), which is a weaker condition than being nowhere dense, since nowhere-density requires the closure of to have empty interior, a possibly stronger condition if is not already closed. However, if is closed and nowhere dense, then is open and dense (shown in the Corollary), and this converse-flavored fact is exactly the version used inside the proof of the Baire Category Theorem.
Can a set be both dense and nowhere dense?
Only in the trivial case where . If and is dense, then , so , so fails to be nowhere dense (whose defining condition is ). So for nonempty spaces these two notions are mutually exclusive extremes: dense sets have closures that are "topologically everything," while nowhere-dense sets have closures that are "topologically nothing" (contain no open set).
Why does the proof that second countable implies separable need the axiom of choice?
Constructing the dense set requires picking, for each of the countably many nonempty basic open sets , a specific point . Without a canonical rule for choosing (such as a well-ordering or a metric with a canonical "closest point"), this is an instance of making countably many arbitrary choices simultaneously, which formally requires the axiom of countable choice, a weak form of the full axiom of choice. In most concrete spaces encountered in analysis, such as or any metric space with a computable metric, an explicit choice rule (e.g. rational-coordinate points) is available and avoids invoking choice at all, but the general topological statement as proved uses countable choice.
Is the empty set dense, and is it nowhere dense?
The empty set is dense in if and only if , since , and this equals only when itself is empty. On the other hand, is always nowhere dense in any space (including nonempty ones), since and trivially. So in any nonempty space, the empty set is a basic example of a nowhere-dense (but not dense) set, consistent with the mutual exclusivity noted above.
How does nowhere-density relate to the Baire Category Theorem, without proving it here?
A set is called meager (or of the first category) if it is a countable union of nowhere-dense sets, and comeager if its complement is meager. The Baire Category Theorem asserts that in a complete metric space (or a locally compact Hausdorff space), no nonempty open set is meager — equivalently, a countable intersection of dense open sets remains dense. This directly generalizes the intuition that nowhere-dense sets are "thin": the theorem says that even infinitely many thin obstructions, glued together countably, cannot fill up an entire nonempty open region of a complete space. This article's machinery (density, nowhere-density) is exactly the vocabulary that theorem is phrased in.
Does a dense subset of a separable space have to be countable itself?
No — a dense subset can be larger than a minimal countable dense set; for instance is dense in and is uncountable, even though is separable via the countable dense set . Separability is an existence statement ("there exists at least one countable dense subset"), not a universal one about every dense subset. Many dense subsets of a separable space can fail to be countable; the defining feature of separability is merely that some countable dense subset exists.