Tutorials › Measure Theory › Constructing the Middle-Third Cantor Set

Lebesgue Measurable Sets and Regularity · Tutorial 127 of 798

Constructing the Middle-Third Cantor Set

Learn how the Cantor set is built stage by stage, and how to count and calculate the lengths of the intervals removed.

Advanced 9 min read

What You'll Learn

  • Define the stage sets and their intersection in the middle-third construction
  • Describe every surviving interval using a finite sequence of digits
  • Prove the number and length of intervals at each stage
  • Calculate the gaps removed at a specified stage
  • Sum the lengths removed through any finite stage
  • Avoid confusing a stage's gaps with the gaps from all earlier stages

Building the Set by Successive Deletions

The middle-third Cantor set is defined by a repeated geometric operation: begin with a closed interval, remove its open middle third, and repeat that operation on every closed interval that remains. The construction is simple to state, but its indexing matters. At stage \(n\), there are \(2^{n-1}\) gaps being removed, not \(2^n\); each of those gaps has length \(3^{-n}\). We will establish these counts and compute the total length removed, without conflating a finite stage with the infinite intersection that defines the set.

Work in \((\mathbb{R},\mathcal{L},m)\), where \(m\) is Lebesgue measure. This ambient measure space is sigma-finite, not finite, although all the sets considered below lie in \([0,1]\) and have finite measure. The intervals in the construction are Lebesgue measurable. For an interval \([a,b]\), its length and its Lebesgue measure are both \(b-a\).

Definition: Set \(C_0=[0,1]\). Given \(C_{n-1}\), form \(C_n\) by removing the open middle third of each closed interval component of \(C_{n-1}\). Write \(G_n=C_{n-1}\setminus C_n\) for the union of the gaps removed at stage \(n\). The middle-third Cantor set is \(C=\bigcap_{n=0}^{\infty}C_n\).

The distinction between \(G_n\), \(C_n\), and \(C\) is important. \(G_n\) records only the gaps removed at one stage; \(C_n\) is the finite-stage remainder; \(C\) consists of the points that remain at every stage. The sets \(C_n\) are nested: \(C_n\subseteq C_{n-1}\). The gaps removed at different stages are disjoint, since every later gap lies inside a remainder from which all earlier gaps have already been removed.

The Intervals at Each Stage

There is a convenient exact description of the surviving intervals. For a sequence \(d=(d_1,\ldots,d_n)\) with each \(d_j\) equal to \(0\) or \(2\), define

$$ I_d=\left[\sum_{j=1}^{n}d_j3^{-j},\ \sum_{j=1}^{n}d_j3^{-j}+3^{-n}\right]. $$

At stage \(n\), the remainder is the union of these intervals, one for each such sequence. The digits \(0\) and \(2\) indicate choosing the left or right child interval at each step. The formula also shows that every interval at stage \(n\) has length \(3^{-n}\).

Proposition: For each integer \(n\ge 0\), \(C_n\) is the union of \(2^n\) pairwise disjoint closed intervals, each of length \(3^{-n}\). For \(n=0\), the single interval is \([0,1]\). For \(n\ge1\), these intervals are precisely the \(I_d\) above.

Proof. At \(n=0\), there is one empty sequence of digits, and the corresponding interval is \([0,1]\), of length \(1=3^0\). Suppose the assertion holds at stage \(n-1\). Each interval there has the form \([a,a+3^{-(n-1)}]\). Its open middle third is \((a+3^{-n},a+2\cdot3^{-n})\), so the two intervals left behind are \([a,a+3^{-n}]\) and \([a+2\cdot3^{-n},a+3\cdot3^{-n}]\). Each has length \(3^{-n}\). They correspond to appending \(0\) and \(2\), respectively, to the sequence describing the parent interval. Thus each of the \(2^{n-1}\) parent intervals gives two children, for \(2^n\) intervals altogether. The two children of one parent are separated by the removed open middle third. Children of different parents remain separated because their parent intervals were pairwise disjoint. This proves both the count and pairwise disjointness at stage \(n\), completing the induction. \(\square\)

The gap removed from a parent interval \([a,a+3^{-(n-1)}]\) at stage \(n\) is exactly \((a+3^{-n},a+2\cdot3^{-n})\). It is open, and its length is \(3^{-n}\). Since there is one such gap for each stage-\((n-1)\) interval, the number of stage-\(n\) gaps is \(2^{n-1}\).

Theorem: At stage \(n\ge1\), \(G_n\) is a union of \(2^{n-1}\) pairwise disjoint open intervals, each of length \(3^{-n}\). Consequently, $$ m(G_n)=2^{n-1}3^{-n}. $$ The total measure of all gaps removed through stage \(n\) is \(1-(2/3)^n\).

Proof. The interval proposition gives \(2^{n-1}\) closed parent intervals at stage \(n-1\). Removing the open middle third from each parent creates exactly one gap of length \(3^{-n}\). The parents are disjoint, so these gaps are disjoint. Finite additivity of Lebesgue measure on disjoint measurable sets therefore gives \(m(G_n)=2^{n-1}3^{-n}\). The gaps from distinct stages are also disjoint: if \(j<n\), then \(G_n\subseteq C_{n-1}\subseteq C_j\), whereas \(G_j\cap C_j=\varnothing\). Thus the measure of the union of gaps removed through stage \(n\) is the finite sum $$ \sum_{k=1}^{n}m(G_k)=\sum_{k=1}^{n}2^{k-1}3^{-k} =\frac{1}{3}\sum_{k=0}^{n-1}\left(\frac{2}{3}\right)^k =1-\left(\frac{2}{3}\right)^n. $$ The last equality is the finite geometric-sum formula: multiplying the sum by \(1-\frac23\) gives \(1-(\frac23)^n\), and \(1-\frac23=\frac13\). This proves the claimed finite-stage total. \(\square\)

The same interval count gives a useful check. The total length of the stage-\(n\) remainder, meaning the sum of the lengths of its \(2^n\) disjoint intervals, is \(2^n3^{-n}=(2/3)^n\). The remainder intervals together with all gaps removed through stage \(n\) partition \([0,1]\), so their total measures add to \(1\). This is a statement about each finite stage; it does not by itself compute the measure of the infinite intersection \(C\).

Worked Constructions

Worked Example: The First Removal

Start with \(C_0=[0,1]\). Its open middle third is \((1/3,2/3)\), so $$ G_1=(1/3,2/3),\qquad C_1=[0,1/3]\cup[2/3,1]. $$ There is one gap, and its length is \(2/3-1/3=1/3\). The stage formula gives \(2^{1-1}=1\) gap of length \(3^{-1}=1/3\), so \(m(G_1)=1/3\). Check: the two remainder intervals have lengths \(1/3\) and \(1/3\), hence total length \(2/3\); adding the gap length gives \(2/3+1/3=1\), the length of the starting interval.

Worked Example: The Second-Stage Gaps

The stage-one remainder has parent intervals \([0,1/3]\) and \([2/3,1]\), each of length \(1/3\). Their middle thirds are $$ G_2=(1/9,2/9)\ \cup\ (7/9,8/9). $$ There are \(2^{2-1}=2\) gaps, each of length \(3^{-2}=1/9\), so \(m(G_2)=2\cdot(1/9)=2/9\). Through stage two, the removed length is \(m(G_1)+m(G_2)=1/3+2/9=3/9+2/9=5/9\). The four remaining intervals each have length \(1/9\), giving total length \(4/9\). Check: the removed length and remainder length add to \(5/9+4/9=1\), as required for the partition of \([0,1]\).

Worked Example: Listing the Stage-Three Remainder

At stage three, each of the four stage-two intervals is divided into two intervals of length \(3^{-3}=1/27\). In increasing order, the eight intervals are $$ [0,1/27],\ [2/27,3/27],\ [6/27,7/27],\ [8/27,9/27],\ [18/27,19/27],\ [20/27,21/27],\ [24/27,25/27],\ [26/27,27/27]. $$ Thus \(C_3\) has \(2^3=8\) intervals, with total interval length \(8\cdot(1/27)=8/27\). Stage three removes \(2^{3-1}=4\) gaps, each of length \(1/27\), so their total length is \(4/27\). The cumulative removed length is \(1/3+2/9+4/27=9/27+6/27+4/27=19/27\). Check: \(8/27+19/27=27/27=1\), and the stage-three gap count and length give \(4\cdot(1/27)=4/27\) independently.

What the Infinite Construction Establishes

The definition \(C=\bigcap_{n=0}^{\infty}C_n\) means that a point belongs to \(C\) exactly when it belongs to every finite-stage remainder. Each \(C_n\) is closed, since it is a finite union of closed intervals. Therefore \(C\), an intersection of closed sets, is closed. Also \(C\subseteq[0,1]\), so it is bounded. The endpoints \(0\) and \(1\) belong to every \(C_n\), hence \(C\) is nonempty. By the Heine–Borel theorem, a closed and bounded subset of \(\mathbb{R}\) is compact; consequently \(C\) is compact.

For the total removed at any fixed stage, only finite additivity is needed: there are finitely many disjoint open intervals, and each has a known length. The formula \(1-(2/3)^n\) records the cumulative measure of the gaps removed by stage \(n\). Passing from these finite-stage calculations to a statement about the measure of \(C\) requires addressing the infinite intersection and its measure; the finite-stage formula should not be mistaken for that conclusion.

Common mistake. A frequent indexing error is to say that stage \(n\) removes \(2^n\) gaps. That counts the intervals remaining after stage \(n\), not the parent intervals being cut at stage \(n\). For example, at stage two there are \(2^2=4\) intervals remaining, but only the \(2^{2-1}=2\) stage-one intervals are cut. The correct stage-two removed length is \(2\cdot3^{-2}=2/9\), not \(4\cdot3^{-2}=4/9\). The correction is to count the parents, so the stage-\(n\) gap count is \(2^{n-1}\).

Check Your Understanding

Use the stage index carefully in each calculation.

  1. How many gaps are removed at stage four, and what is the length of each gap?
  2. Write the two open intervals removed at stage two, and verify their combined measure.
  3. Calculate the total length removed through stage four using the finite geometric sum.
  4. How many intervals make up \(C_4\), and what is the sum of their lengths?
  5. Explain why the finite-stage calculation of removed length is not, on its own, a proof of the measure of \(C\).