Cantor ternary set problem Let C be a cantor ternary set
If $x,y \in C,$ then obviously $x-y \in [-1,1]$
Conversely I want to prove that 
if $w \in [-1,1],$ then there exists $x,y \in C$ such that $x-y=w$
How to prove this problem?

HINT: It obviously suffices to show that $(0,1]\subseteq C-C$. Let $w\in(0,1]$, and let $$w=\sum_{k\ge 1}\frac{w_k}{3^k}$$ be a ternary expansion of $w$ (i.e., each $w_k\in\{0,1,2\}$). Suppose that $$x=\sum_{k\ge 1}\frac{x_k}{3^k},~y=\sum_{k\ge 1}\frac{y_k}{3^k}\in C\;,$$ where each $x_k,y_k\in\{0,2\}$, and that $y=w+x$. Let $\oplus$ be addition mod $3$. Then for each $k\in\Bbb Z^+$ $y_k$ is either $w_k\oplus x_k$ or $w_k\oplus x_k\oplus 1$. Prove the following lemma.

Lemma. For each $k\in\Bbb Z^+$, if $y_k=w_k\oplus x_k\oplus 1$, then either $y_{k+1}=w_{k+1}\oplus x_{k+1}\oplus 1$ and $w_{k+1}\in\{0,2\}$, or $y_{k+1}=w_{k+1}\oplus x_{k+1}$ and $w_{k+1}=1$, and if $y_k=w_k\oplus x_k$, then either ${k+1}=w_{k+1}\oplus x_{k+1}$ and $w_{k+1}\in\{0,2\}$, or $y_{k+1}=w_{k+1}\oplus x_{k+1}\oplus 1$ and $w_{k+1}=1$.

Now define a function $\varphi:\Bbb Z^+\to\{0,1\}$ recursively as follows: $\varphi(1)=1$ iff $w_1=1$, and for every $k\in\Bbb Z^+$
$$\varphi(k+1)=\begin{cases}
1-\varphi(k),&\text{if }w_{k+1}=1\\
\varphi(k),&\text{otherwise}\;.
\end{cases}$$
For each $k\in\Bbb Z^+$ use $\varphi(k)$ and $w_k$ to construct $x_k$ and $y_k$.
(There are other ways to prove the theorem, but this one is very constructive.)
