How large can a subset of $[0,1]$ be while containing no interval? At first glance, removing open intervals from $[0,1]$ should eventually leave behind a set that is either countable (and hence negligible) or retains some interval of positive length. The **Cantor set** demolishes both intuitions: it is uncountable — as large as $\mathbb{R}$ in the sense of cardinality — yet contains no interval whatsoever, and its [Lebesgue measure](/page/Measure%20Space) is zero. This single construction serves as the canonical counterexample across analysis, topology, and measure theory. It shows that uncountability does not imply positive measure, that [compactness](/page/Compact%20Space) and [total disconnectedness](/page/Connectedness) can coexist in an uncountable set, and that a [nowhere dense](/page/Nowhere%20Dense%20Set) [closed](/page/Closure) set can still be topologically rich.
text
admin
The construction itself is elementary — one removes middle thirds iteratively — but the resulting object has a surprisingly deep structure. The Cantor set is homeomorphic to the product space $\{0,1\}^{\mathbb{N}}$, making it a universal object: every compact metrizable space is a continuous image of it. Its companion, the **Cantor function** (the "devil's staircase"), provides a continuous surjection from $[0,1]$ onto $[0,1]$ that is constant on a set of full measure yet manages to increase from $0$ to $1$ — a phenomenon that is impossible for absolutely continuous functions. Variants called **fat Cantor sets** show that even the measure-zero property is an artifact of the particular construction, not of the topological type: one can build sets homeomorphic to the Cantor set that have any prescribed Lebesgue measure in $(0,1)$.
text
admin
[example: Naive Interval Removal]
Consider the simplest strategy for building a "small" subset of $[0,1]$: remove a single open interval, say $(1/4, 3/4)$. The remainder $[0, 1/4] \cup [3/4, 1]$ consists of two closed intervals and has Lebesgue measure $1/2$. Remove the middle half of each remaining interval to get four intervals of total measure $1/4$. After $n$ steps, the remaining set $R_n$ consists of $2^n$ closed intervals, each of length $(1/4)^n$, so
\begin{align*}
\mathcal{L}^1(R_n) = 2^n \cdot \left(\frac{1}{4}\right)^n = \left(\frac{1}{2}\right)^n \to 0.
\end{align*}
The intersection $R = \bigcap_{n=0}^{\infty} R_n$ has measure zero. But is $R$ countable or uncountable? The answer depends on the removal ratio, and it is far from obvious. The Cantor set arises from the specific choice of removing middle *thirds*, and it turns out to be uncountable — a fact that requires a careful argument via ternary expansions.
[/example]
example
admin
## Definition
h2
admin
The standard Cantor set is built by iterating a single geometric operation: remove the open middle third of every remaining closed interval.
text
admin
[definition: Cantor Set]
Define a decreasing sequence of compact sets $C_0 \supset C_1 \supset C_2 \supset \cdots$ in $[0,1]$ as follows. Set $C_0 := [0,1]$. Given $C_n$, which is a disjoint union of $2^n$ closed intervals each of length $3^{-n}$, define $C_{n+1}$ by removing the open middle third of each constituent interval. That is, if $[a, b]$ is a constituent interval of $C_n$ (so $b - a = 3^{-n}$), replace it by
\begin{align*}
[a, b] \;\longmapsto\; \left[a,\; a + \frac{b-a}{3}\right] \cup \left[a + \frac{2(b-a)}{3},\; b\right].
\end{align*}
The **Cantor set** (also called the **Cantor ternary set** or **Cantor middle-thirds set**) is
\begin{align*}
\mathcal{C} := \bigcap_{n=0}^{\infty} C_n.
\end{align*}
[/definition]
definition
admin
The first few stages make the construction concrete:
At stage $n$, the set $C_n$ consists of $2^n$ closed intervals, each of length $3^{-n}$. Since each $C_n$ is a finite union of closed intervals, it is compact. The Cantor set $\mathcal{C}$, being the intersection of a nested sequence of nonempty compact subsets of $\mathbb{R}$, is itself nonempty and compact by the [finite intersection property](/page/Compact%20Space).
text
admin
### Characterisation by ternary expansions
h3
admin
The iterative construction, while vivid, does not lend itself to direct computation. A far more useful description identifies $\mathcal{C}$ with those real numbers whose ternary (base-$3$) expansion avoids the digit $1$.
text
admin
[quotetheorem:1196]
text
admin
The connection between the two descriptions becomes transparent once one tracks the removal process digit by digit. At stage $1$, the interval $(1/3, 2/3)$ is removed. In base $3$, this interval consists of those numbers whose first ternary digit is $1$ (excluding the endpoints $0.1000\ldots_3 = 1/3$ and $0.0222\ldots_3 = 1/3$, which have alternative representations $0.0222\ldots_3$ and $0.2000\ldots_3$ using only digits $\{0,2\}$). At stage $2$, we remove numbers whose second ternary digit is $1$ (among those surviving stage $1$), and so on. After all stages, precisely those numbers with no digit $1$ in any position survive.
text
admin
This characterisation is the primary computational tool for the Cantor set. Rather than reasoning about nested intersections of intervals, one reasons about sequences in $\{0,2\}^{\mathbb{N}}$, which is far more tractable.
text
admin
## Measure and Cardinality
h2
admin
Two properties of the Cantor set stand in stark tension: it has Lebesgue measure zero, yet it is uncountable. Understanding both facts — and why they do not contradict each other — is essential for developing correct intuition about the relationship between measure and cardinality.
text
admin
### Measure zero
h3
admin
The total length removed at stage $n$ is straightforward to compute. At stage $1$, we remove one interval of length $1/3$. At stage $2$, we remove two intervals each of length $1/9$. At stage $n$, we remove $2^{n-1}$ intervals each of length $3^{-n}$. The total measure of all removed intervals is