Skip to content

The fat Cantor set

Level: 201 → 301 · for anyone who has met a limit

One line: Build a Cantor set with narrower gaps and it still contains no interval anywhere — yet half of [0, 1] survives, so "full of gaps" and "measure zero" are different things.

It is also called the Smith–Volterra–Cantor set, after Henry Smith, Vito Volterra and Georg Cantor; Smith and Volterra both described sets like it before Cantor's own set appeared in 1883 (Wikipedia ↗).

One recipe, one dial

The Cantor set deletes middle thirds. Here is the same construction written with a dial, a:

At step n, delete an open gap of length aⁿ from the middle of every piece that is left.

With a = 1/3, the step-n gap is 1/3ⁿ, which is exactly the middle third of every piece: the standard Cantor set. With a = 1/4, the first gap is (3/8, 5/8), a quarter of [0, 1], and every later gap is a smaller share of the piece it cuts, a share that keeps shrinking. That is the fat Cantor set. Section 1 draws both for three steps, and they look like close relatives.

What the program prints

Verified output of fat_cantor_set.py — regenerated by tools/run_examples.py, never hand-typed.

1. ONE RECIPE, ONE DIAL
   At step n, delete an open gap of length a^n from the middle of every
   piece that is left. (# marks a character more than half still there.)
   a = 1/3, the Cantor set:
     0 |#################################################################################|
     1 |###########################                           ###########################|
     2 |#########         #########                           #########         #########|
     3 |###   ###         ###   ###                           ###   ###         ###   ###|
   a = 1/4, the fat Cantor set:
     0 |#################################################################################|
     1 |##############################                     ##############################|
     2 |#############     ############                     ############     #############|
     3 |###### ######     #####  #####                     #####  #####     ###### ######|
   With a = 1/3 the step-n gap is 1/3^n, exactly the middle third of every
   piece: lesson 3's set. With a = 1/4 every gap after the first is a
   smaller share of its piece, and the share keeps shrinking.

2. ADD UP THE GAPS
     step   Cantor deletes  fat deletes
        1   1/3             1/4
        2   2/9             1/8
        3   4/27            1/16
        4   8/81            1/32
        5   16/243          1/64
        6   32/729          1/128
   Step by step, the Cantor column shrinks by 2/3 and the fat column halves.
     deleted in 10 steps:  Cantor 1 - 1.734e-02    fat 1/2 - 4.883e-04
     deleted in 50 steps:  Cantor 1 - 1.568e-09    fat 1/2 - 4.441e-16
     deleted in the limit: Cantor 1                fat 1/2

3. HOW MUCH IS LEFT, FOR ANY SETTING OF THE DIAL
   Summing the gaps gives a formula: length left = (1 - 3a) / (1 - 2a).
     a      formula   left after 100 steps
     1/3    0         0.000000000000
     1/4    1/2       0.500000000000
     1/5    2/3       0.666666666667
     1/10   7/8       0.875000000000
     1/100  97/98     0.989795918367
   Past 1/3 the recipe breaks. With a = 2/5, the gap for step 4 is
   16/625 long, but each piece left after step 3 is only 3/1000.
   So a = 1/3 is the one setting that deletes everything; every smaller
   setting leaves a set of positive length.

4. STILL NO INTERVAL INSIDE
   Every piece is cut again at the next step. After step n, each fat piece
   is 1/2^(n+1) + 1/2^(2n+1) long:
     after step  1:  2^1 pieces,   each 3.750e-01 long
     after step  2:  2^2 pieces,   each 1.562e-01 long
     after step  5:  2^5 pieces,   each 1.611e-02 long
     after step 10:  2^10 pieces,  each 4.888e-04 long
     after step 20:  2^20 pieces,  each 4.768e-07 long
     after step 40:  2^40 pieces,  each 4.547e-13 long
   Name any interval, however short. From some step on it is longer than
   every piece, so it cannot fit inside the set. The fat Cantor set, like
   the Cantor set, contains no interval: there is a gap in every stretch.

5. AND YET IT IS NOT MEASURE ZERO
   The pieces at step n cover it with total length 1/2 + 1/2^(n+1):
     step  1:  total 0.750000000
     step  5:  total 0.515625000
     step 10:  total 0.500488281
     step 20:  total 0.500000477
   That never drops below 1/2 -- and the page shows why no cover of any
   kind can. No interval inside it, and still length 1/2.

6. WHY ANYONE CARES: RIEMANN SUMS
   Let f(x) = 1 on the set and 0 off it, and cut [0,1] into N equal cells.
   The LOWER sum is 0 for both sets: every cell holds points of a gap.
   The UPPER sum is the total length of the cells that touch the set:
          N   Cantor   fat Cantor
         10   0.8000   0.8000
        100   0.3400   0.6400
      1,000   0.1600   0.5500
     10,000   0.0638   0.5146
   Cantor: the upper sum sinks toward 0, the lower sum is 0, and the two
   squeeze together. f has a Riemann integral, and it is 0.
   Fat Cantor: the upper sum never goes below 1/2. The sums never meet,
   and f has no Riemann integral at all.

Where the length goes

Section 2 lines up what each step deletes. The Cantor column shrinks by a factor of 2/3 each step; the fat column halves. Both are geometric series, and the ratio decides everything:

Cantor:   1/3 + 2/9 + 4/27 + ⋯   =   (1/3) / (1 − 2/3)   =   1
fat:      1/4 + 1/8 + 1/16 + ⋯   =   (1/4) / (1 − 1/2)   =   1/2

The Cantor set's gaps eat the whole interval. The fat set's gaps eat half of it, and the other half survives.

The same sum works for any setting of the dial (section 3). Step n deletes 2ⁿ⁻¹ gaps of length aⁿ, so the gaps total a / (1 − 2a), and the length left is (1 − 3a) / (1 − 2a). a = 1/3 is the only setting that leaves nothing; a = 1/5 leaves 2/3, and a = 1/100 leaves 97/98. Beyond 1/3 the recipe breaks: with a = 2/5, the gap for step 4 is 16/625 long, but each piece left after step 3 is only 3/1000, so there is nothing wide enough to cut.

Still no interval inside

After step n each fat piece is 1/2ⁿ⁺¹ + 1/2²ⁿ⁺¹ long, which goes to 0 (section 4). Any interval you name, however short, is longer than every piece from some step on, so it cannot fit inside the set. The fat Cantor set contains no interval, exactly like the Cantor set: between any two of its points there is a gap. A closed set with no interval inside is called nowhere dense, and both Cantor sets are.

It also has uncountably many points, for a simpler reason than the base-3 argument. Each point is pinned down by a record of left-or-right choices, one per step, and every infinite record of choices pins down a different point.

And yet it is not measure zero

The pieces at step n cover the fat set with total length 1/2 + 1/2ⁿ⁺¹, which gets close to 1/2 and never goes below it (section 5). Could some cleverer cover do better? No, and the proof is short:

Suppose some list of intervals, with total length L less than 1/2, covered the fat Cantor set. The gaps deleted during the construction are also a list of intervals, with total length exactly 1/2, and they cover everything in [0, 1] that is not in the set. Put the two lists together and they cover all of [0, 1] with total length L + 1/2, which is less than 1.

But no list of intervals covers [0, 1] with total length less than 1 — the theorem from what measure zero means. So no such cover exists.

Its measure is exactly 1/2. There is no interval anywhere inside it, and it fills half the room.

That separates two ideas of thin that the Cantor set had kept together. Nowhere dense says there are gaps everywhere. Measure zero says the set takes no room. The Cantor set is both; the fat Cantor set is only the first.

Why anyone cares: Riemann sums

Measure zero is not a curiosity. It is the exact dividing line for the integral taught in calculus.

Let f(x) = 1 on the set and 0 off it. Cut [0, 1] into N equal cells and bound the integral from both sides. The lower sum is 0 for both sets, because every cell, however small, contains points of a gap, where f is 0. The upper sum is the total length of the cells that touch the set (section 6):

  • For the Cantor set it falls — 0.80, 0.34, 0.16, 0.0638 as N goes from 10 to 10,000 — and keeps falling toward 0. Lower and upper sums squeeze together, so f has a Riemann integral, and it is 0.
  • For the fat Cantor set it falls toward 1/2 — 0.80, 0.64, 0.55, 0.5146 — and can never go below it, because the cells touching the set cover the set, and the set has length 1/2. The lower sum stays at 0. The two never meet, so f has no Riemann integral at all.

This is Lebesgue's criterion, also called the Lebesgue–Vitali theorem: a bounded function on a closed interval has a Riemann integral exactly when the points where it is discontinuous form a set of measure zero (Wikipedia ↗). Here f is discontinuous exactly on its set. At a point of the set, f is 1 but there are gap points arbitrarily close where f is 0; off the set, a point sits inside an open gap where f is 0 all around it. So the Cantor set's f is integrable because the Cantor set has measure zero, and the fat set's f is not, because the fat set has measure 1/2.

The criterion is also why measure zero was worth defining without Lebesgue measure: it needs nothing but intervals and their lengths, and it answers a question about the integral every calculus student meets.

Run it yourself

From the root of your clone of this repository:

python3 02_Measure_Zero/fat_cantor_set/examples/fat_cantor_set.py

See also