Artificial intelligent assistant

Simple statement about the cantor set. Struggling to understand the cantor set i found this. It's really helpful but at the very start when the cantor set is defined it is stated that: "$A_k$ is a union of $2^k$ closed intervals of length $3^{-k}$" without proof. I tried to prove it by induction but got bogged down in silly details. Could you show me how it can be neatly proved?

You do that by induction on $k$. For $k=0$, we have $[0,1]$.

Suppose that for $k$ it holds, then $A_k$ is the union of $2^k$ closed intervals, each of length $3^{-k}$. Then $A_{k+1}$ is the set generated by removing the (open) middle third of each of these intervals, the remainder is two (closed) intervals of exactly $\frac13$ of the length. So we have $2\cdot2^k$ closed intervals, each of length $\frac13\cdot3^{-k}=3^{-(k+1)}$, as wanted.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 1c4e27547a2ad6c34a69914775902712