# Dense set

A **dense set** is a subset \( D \) of a topological space \( X \) whose closure equals all of \( X \), written \( \operatorname{cl}(D) = X \); equivalently, \( D \) intersects every nonempty open set of \( X \)<sup>[1](https://planetmath.org/denseset)</sup>. In a metric space with metric \( d \), this says that for every \( \varepsilon > 0 \) and every \( x \in X \) there is a point \( y \in D \) with \( d(x, y) < \varepsilon \), so every point of the space can be approximated arbitrarily closely by points of \( D \)<sup>[1](https://planetmath.org/denseset)</sup>. The concept is central to analysis and topology because it lets properties proved on a well-behaved subset extend to the whole space.

| Key fact | Detail |
|---|---|
| Definition | \( D \subseteq X \) is dense when \( \operatorname{cl}(D) = X \), equivalently \( D \) meets every nonempty open set<sup>[1](https://planetmath.org/denseset)</sup> |
| Metric form | For every \( x \in X \) and \( \varepsilon > 0 \) there is \( y \in D \) with \( d(x, y) < \varepsilon \)<sup>[1](https://planetmath.org/denseset)</sup> |
| Canonical example | \( \mathbb{Q} \) and \( \mathbb{R} \setminus \mathbb{Q} \) are both dense in \( \mathbb{R} \)<sup>[1](https://planetmath.org/denseset)</sup> |
| Density cardinal | The least cardinality of a dense set is the density \( d(X) \); spaces of density \( \aleph_0 \) are precisely the separable spaces<sup>[1](https://planetmath.org/denseset)</sup> |
| Disjoint dense sets | \( \mathbb{Q} \) and \( \sqrt{2} + \mathbb{Q} \) are both dense in \( \mathbb{R} \) yet do not intersect<sup>[2](https://ma.huji.ac.il/~razk/iWeb/My_Site/Teaching_files/Chapter1.pdf)</sup> |
| Baire category theorem | In a complete metric space, a countable intersection of open dense sets is dense<sup>[3](https://www.impan.pl/~tkoch/FA_lecturenotes/lecture11.pdf)</sup> |
| Approximation | Polynomials are dense in \( C[a, b] \) with the uniform norm (Weierstrass approximation theorem)<sup>[4](https://www2.math.upenn.edu/~ancoop/3600/section-31.html)</sup> |

## Definition and equivalent forms

The closure of a set \( A \) is the intersection of all closed sets containing \( A \), and a point \( x \) lies in \( \operatorname{cl}(A) \) exactly when every open neighborhood of \( x \) meets \( A \)<sup>[5](https://publish.uwo.ca/~jbell/topology.pdf)</sup>. It follows that \( D \) is dense in \( X \) if and only if \( D \) meets every nonempty open set<sup>[5](https://publish.uwo.ca/~jbell/topology.pdf)</sup>. In a metric space this becomes the approximation condition: every open ball around any point of \( X \) contains a point of \( D \)<sup>[1](https://planetmath.org/denseset)</sup>. Equivalently, every point of \( X \) is a limit of a sequence in \( D \)<sup>[2](https://ma.huji.ac.il/~razk/iWeb/My_Site/Teaching_files/Chapter1.pdf)</sup>.

Density is always relative to an ambient space. The interval \( (0, 1) \) is not dense in \( \mathbb{R} \), but it is dense in the subspace \( [0, 1] \)<sup>[6](https://www.andreaminini.net/math/dense-sets-in-topology)</sup>. The ambient topology matters as much as the set itself: in the finite complement topology, all infinite sets are dense, and in the indiscrete space every nonempty subset is dense<sup>[6](https://www.andreaminini.net/math/dense-sets-in-topology)</sup><sup> • </sup><sup>[7](https://funaab.edu.ng/funaab-ocw/opencourseware/General%20Topology.pdf)</sup>.

## Examples

The rationals \( \mathbb{Q} \) are the standard dense subset of \( \mathbb{R} \): for every real \( x \) and every \( \varepsilon > 0 \) there is a rational \( q \) with \( |x - q| < \varepsilon \)<sup>[8](https://theaxiomacademy.org/modules/ra-dense-subsets.html)</sup>. The irrationals \( \mathbb{R} \setminus \mathbb{Q} \) are dense in \( \mathbb{R} \) by the same reasoning, so between any two reals lie both a rational and an irrational<sup>[8](https://theaxiomacademy.org/modules/ra-dense-subsets.html)</sup>. The dyadic rationals, numbers of the form \( k/2^{n} \), also form a dense subset of \( \mathbb{R} \)<sup>[8](https://theaxiomacademy.org/modules/ra-dense-subsets.html)</sup>.

Density does not require countability or any particular size. For any irrational \( \alpha \), the set \( S_{\alpha} = \{ a + b\alpha : a, b \in \mathbb{Z} \} \) is dense in \( \mathbb{R} \)<sup>[9](https://brilliant.org/wiki/dense-set/)</sup>. In the complex plane, the set \( \mathbb{Q} + i\mathbb{Q} \) of complex numbers whose real and imaginary parts are both rational is dense in \( \mathbb{C} \)<sup>[10](https://heil.math.gatech.edu/handouts/metricreview.pdf)</sup>.

Two dense sets can be disjoint: \( \mathbb{Q} \) and \( \sqrt{2} + \mathbb{Q} \) are both dense in \( \mathbb{R} \) with empty intersection, as are the rationals and the irrationals<sup>[2](https://ma.huji.ac.il/~razk/iWeb/My_Site/Teaching_files/Chapter1.pdf)</sup>. This could not happen if the dense sets were required to be open, a fact connected to the Baire category theorem<sup>[2](https://ma.huji.ac.il/~razk/iWeb/My_Site/Teaching_files/Chapter1.pdf)</sup>.

## Density, cardinality, and separability

Dense sets can be small in senses other than topology. The rationals are countable yet dense in the uncountable real line, so density is not a statement about measure or cardinality<sup>[11](https://a-warded.org/open-book/university-real-analysis/lesson-19)</sup>.

The **density** of a topological space \( X \), denoted \( d(X) \), is the least cardinality of a dense subset of \( X \)<sup>[1](https://planetmath.org/denseset)</sup>. With the convention that a finite density is taken to be \( \aleph_0 \), the spaces of density \( \aleph_0 \) are precisely the separable spaces<sup>[1](https://planetmath.org/denseset)</sup>. A metric space is separable when it contains a countable dense set; \( \mathbb{R} \) is separable because \( \mathbb{Q} \) is countable and dense<sup>[2](https://ma.huji.ac.il/~razk/iWeb/My_Site/Teaching_files/Chapter1.pdf)</sup>. Separability matters in functional analysis: a [Banach space](https://www.edgepedia.org/banach-space) with a countable dense subset is called separable, and \( C[-1, 1] \) is separable because the polynomials with rational coefficients form a countable dense subset<sup>[12](https://www.buttenschoen.ca/MATH725/introduction/approximation/)</sup>.

For Hausdorff spaces, density controls the size of the whole space: \( |X| \le 2^{2^{d(X)}} \)<sup>[1](https://planetmath.org/denseset)</sup>.

## Density and completeness

Density links incomplete spaces to their completions. The metric completion of \( \mathbb{Q} \) with the usual metric is \( \mathbb{R} \), and in a completion \( \hat{X} \) of a metric space \( X \) the image of \( X \) is dense in \( \hat{X} \)<sup>[13](https://www2.math.upenn.edu/~gressman/analysis/08a-completions.html)</sup><sup> • </sup><sup>[2](https://ma.huji.ac.il/~razk/iWeb/My_Site/Teaching_files/Chapter1.pdf)</sup>. [Georg Cantor](https://www.edgepedia.org/georg-cantor)'s 1872 construction, in his paper *Über die Ausdehnung eines Satzes aus der Theorie der trigonometrischen Reihen*, represented each real number as a [Cauchy sequence](https://www.edgepedia.org/cauchy-sequence) of rational numbers, two sequences naming the same real when their difference converges to zero<sup>[14](https://www.maths.tcd.ie/pub/HistMath/People/Cantor/Ausdehnung/)</sup>. A dense set also carries completeness across: a metric space \( X \) with a dense subset \( D \) is complete if and only if every Cauchy sequence in \( D \) converges in \( X \)<sup>[2](https://ma.huji.ac.il/~razk/iWeb/My_Site/Teaching_files/Chapter1.pdf)</sup>.

## The Baire category theorem

The main structural theorem about dense sets is the **Baire category theorem**: in a complete metric space \( X \), the intersection of countably many open dense subsets of \( X \) is dense in \( X \)<sup>[3](https://www.impan.pl/~tkoch/FA_lecturenotes/lecture11.pdf)</sup>. Its contrapositive form says that a countable union of nowhere dense sets, called a set of first category or meager set, cannot fill a complete metric space; every complete metric space is of second category in itself<sup>[3](https://www.impan.pl/~tkoch/FA_lecturenotes/lecture11.pdf)</sup>. A set is nowhere dense when the interior of its closure is empty<sup>[7](https://funaab.edu.ng/funaab-ocw/opencourseware/General%20Topology.pdf)</sup>.

A set of the first category can have the cardinality of the continuum and be dense in every interval, so category is a notion of size distinct from both density and measure<sup>[15](https://bpb-us-w2.wpmucdn.com/u.osu.edu/dist/0/26656/files/2023/10/STEIN-Shakarchi-Stein-Functional-Analysis_-Introduction-to-Further-Topics-in-Analysis-Princeton-Lectures-in-Analysis-Princeton-University-Press-2011.pdf)</sup>.

## Applications in analysis

Density is the formal device behind approximation. A continuous function is determined by its values on a dense set, since two continuous functions agreeing on a dense subset agree everywhere<sup>[8](https://theaxiomacademy.org/modules/ra-dense-subsets.html)</sup>. The Weierstrass approximation theorem states that for any continuous \( f : [a, b] \to \mathbb{R} \) and any \( \varepsilon > 0 \) there is a polynomial \( p \) with \( |f(x) - p(x)| < \varepsilon \) for all \( x \in [a, b] \), which is exactly the statement that polynomials are dense in \( C[a, b] \) under the uniform norm<sup>[4](https://www2.math.upenn.edu/~ancoop/3600/section-31.html)</sup>. The [Stone–Weierstrass theorem](https://www.edgepedia.org/stone-weierstrass-theorem) extends this: on a compact [Hausdorff space](https://www.edgepedia.org/hausdorff-space), any subalgebra of \( C(X) \) that separates points is dense<sup>[16](https://ncatlab.org/nlab/show/Stone-Weierstrass%2Btheorem)</sup>.

The rational approximation of reals underlies finite arithmetic on computers, where each real is replaced by a nearby rational<sup>[12](https://www.buttenschoen.ca/MATH725/introduction/approximation/)</sup>. In functional analysis, density arguments combined with the Baire category theorem establish the uniform boundedness, open mapping, and closed graph theorems, and show that continuous nowhere-differentiable functions are generic in \( C[0, 1] \)<sup>[17](https://ocw.mit.edu/courses/18-102-introduction-to-functional-analysis-spring-2021/resources/lecture-3-quotient-spaces-the-baire-category-theorem-and-the-uniform-boundedness-theorem/)</sup><sup> • </sup><sup>[18](https://math.hodapp.com/lectures/foundations/topology/metric-baire.html)</sup>.

## References

1. [Dense set, PlanetMath](https://planetmath.org/denseset)
2. [Metric Spaces, Chapter 1, lecture notes of Raz Kupferman, Hebrew University](https://ma.huji.ac.il/~razk/iWeb/My_Site/Teaching_files/Chapter1.pdf)
3. [Functional Analysis, Lecture 11, T. Koch, IMPAN](https://www.impan.pl/~tkoch/FA_lecturenotes/lecture11.pdf)
4. [The Stone-Weierstraß Theorem, University of Pennsylvania](https://www2.math.upenn.edu/~ancoop/3600/section-31.html)
5. [Notes on General Topology, J. Bell, University of Western Ontario](https://publish.uwo.ca/~jbell/topology.pdf)
6. [Dense Sets in Topology, Andrea Minini](https://www.andreaminini.net/math/dense-sets-in-topology)
7. [General Topology course notes, FUNAAB](https://funaab.edu.ng/funaab-ocw/opencourseware/General%20Topology.pdf)
8. [Dense Subsets: Rationals in Reals, Axiom Academy](https://theaxiomacademy.org/modules/ra-dense-subsets.html)
9. [Dense Set, Brilliant Math & Science Wiki](https://brilliant.org/wiki/dense-set/)
10. [Real Analysis lecture notes, J. Heil, Georgia Tech](https://heil.math.gatech.edu/handouts/metricreview.pdf)
11. [The Baire Category Theorem, A-Warded Real Analysis](https://a-warded.org/open-book/university-real-analysis/lesson-19)
12. [Density and Approximation, A. Buttenschoen, Applied Functional Analysis](https://www.buttenschoen.ca/MATH725/introduction/approximation/)
13. [Advanced Analysis: Completions, E. Gressman, University of Pennsylvania](https://www2.math.upenn.edu/~gressman/analysis/08a-completions.html)
14. [Über die Ausdehnung eines Satzes aus der Theorie der trigonometrischen Reihen, Georg Cantor (1872)](https://www.maths.tcd.ie/pub/HistMath/People/Cantor/Ausdehnung/)
15. [Stein & Shakarchi, Functional Analysis, Chapter 4 (Baire category)](https://bpb-us-w2.wpmucdn.com/u.osu.edu/dist/0/26656/files/2023/10/STEIN-Shakarchi-Stein-Functional-Analysis_-Introduction-to-Further-Topics-in-Analysis-Princeton-Lectures-in-Analysis-Princeton-University-Press-2011.pdf)
16. [Stone-Weierstrass theorem, nLab](https://ncatlab.org/nlab/show/Stone-Weierstrass%2Btheorem)
17. [Lecture 3: Quotient Spaces, the Baire Category Theorem and the Uniform Boundedness Theorem, MIT OpenCourseWare](https://ocw.mit.edu/courses/18-102-introduction-to-functional-analysis-spring-2021/resources/lecture-3-quotient-spaces-the-baire-category-theorem-and-the-uniform-boundedness-theorem/)
18. [The Baire category theorem, Math Foundations lectures](https://math.hodapp.com/lectures/foundations/topology/metric-baire.html)

---
*Topic: Encyclopedia › Physical world and mathematics › Mathematics and statistics › Geometry and topology › General and set-theoretic topology*

*Initially written Sep 17, 2026 · Reviewed: Oct 15, 2026 · Edited: Oct 15, 2026 · Last review: Oct 15, 2026*

*Copyright 2026 EdgeChat AI, a subsidiary of Biostate AI.*

License: Edgepedia Community License 1.0, https://www.edgepedia.org/edgepedia/license
