I am trying to show that $A_N$ is closed, where $A_N \subseteq [0,1]$ is the set of real numbers whose ternary expansions have only $0$ or $1$ in the first $N$ places but can be $0,1$ or $2$ after that. I am allowed to assume that every real number in $[0, 1]$ has a ternary expansion, which is unique except for recurring $2s.$
This is what I have done so far:
Take $x \in [0,1]\setminus A_N$. Then x has at least one $2$ in the first $N$ places of its ternary expansion.
So $x= \frac{a_1}{3} + ... \frac{a_N}{3^N} + $$\sum_{i=N+1}^{\infty}$$\frac{a_i}{3^i}$ where $a_i=2$ for some $i \in \{1,...,N\}$
Now suppose, for a contradiction, that $y \in (x-\frac{1}{3^i},x+\frac{1}{3^i}) \cap A_N$.
So $y=\frac{b_1}{3} + ... \frac{b_N}{3^N} + $$\sum_{i=N+1}^{\infty}$$\frac{b_i}{3^i}$ where $b_i\in \{0,1\}$ for all $i \in\{1,...,N\}$
We know that $|x-y| < \frac{1}{3^i}$, but I'm not sure how to proceed from here $-$ any hints would be much appreciated.
You have:
and so on… So, each $A_N$ is a finite union of closed intervals. Therefore, it is closed.