Is the Cantor function as defined here uniformly continuous

cantor setreal-analysisuniform-continuity

I am following these notes here. They construct the partial Cantor function $f:[0,1]\setminus C\to [0,1]$ as follows (where $C$ is the Cantor set):

Let $f(1/3,2/3)=1/2$. Let $f(1/9,2/9)=1/4$ and let $f(7/9,8/9)=3/4$. And so on. The author claims that this function is uniformly continuous on the defined domain. The following is used as justification (bottom of pg. 3):

… convince yourself for each $n\in\mathbb{N}$ that if $|x-y|<1/3^n$ then $|f(x)-f(y)|<1/2^n$. Thus, we have that $f$ is uniformly continuous on $[0,1]\setminus C$ since given $\epsilon>0$, we only need choose $n\in\mathbb{N}$ so that $1/2^n\leq\epsilon$ then choose $\delta=1/3^n$.

The reasoning here does not resonate with me. Certainly I agree that $|x-y|<1/3^n$ implies $|f(x)-f(y)|<1/2^n$. But the $\epsilon$$\delta$ argument does not. To show uniform continuity we must show that given $\epsilon$ we have that there exists $\delta$ so $|x-y|<\delta\implies|f(x)-f(y)|<\epsilon$. So let's pick an $\epsilon$. I agree that we can find an $n$ so $1/2^n\leq\epsilon$ by the Archimedean property. Then $|x-y|<1/3^n$ implies $|f(x)-f(y)|<1/2^n$, but my question is the following:

What if $1/2^n<\epsilon$ and then we pick $x,y$ such that $1/2^n<d(x,y)<\epsilon$ Clearly the above argument does not work for those $x,y$?

I suppose the argument could work if it is the case that no such $x,y$ exist, but I'm having trouble seeing that.

Best Answer

Uniform continuity is proven if, given $\epsilon > 0$, we can find $\delta > 0$ such that whenever $d(x,y) < \delta$, $d(f(x),f(y)) < \epsilon$. Here we take $n$ so $2^{-n} < \epsilon$ and take $\delta = 3^{-n}$. Then, as you agreed, if $d(x,y)< \delta$, $d(f(x),f(y)) < 2^{-n}$, so $d(f(x),f(y)) < \epsilon$. End of proof.

The fact that there exist pairs $(x,y)$ with $d(x,y) > \delta$ is irrelevant. We're only concerned with what happens when $d(x,y) < \delta$.