I’ve found a few questions on this website relating to this question, but none that answer this specific question directly.
Let $E$ be a compact subset of $\mathbb{R}$ with Lebesgue measure $\lambda(E)=0$. For $\epsilon > 0$, let $E_\epsilon = \{x : d(x,E)<\epsilon\}$ where $d(x,E)$ is the distance between a point and a set.
How do I show that $\lim_{\epsilon \rightarrow 0} \lambda(E_{\epsilon}) = \lambda(E) = 0$?
I understand from the hint here that I need to be able to use that $\cap_{\epsilon}E_\epsilon = E$ for $\epsilon>0$ and that somehow the fact that $E$ being compact implies that if $d(x,E) = 0$, then $x\in E$. However I’m not sure how to go about this.
Is this generalizable? What if $\lambda(E) = \alpha < \infty$, can I show $\lim_{\epsilon \rightarrow 0} \lambda(E_{\epsilon}) = \lambda(E) = \alpha$?
Any help is appreciated!
You first need to show that, for $\epsilon_n$ decreasing to 0, $\cap_n E_{\epsilon_n} = E$. Now, fix any $x \in \cap_n E_{\epsilon_n}$. Since $x \in E_{\epsilon_n}$, by definition there is a point $x_n \in E$ with $d(x, x_n) < \epsilon_n$. As $\epsilon_n \rightarrow 0$, we have $x_n \rightarrow x$, so by compactness (or, really, it is enough if $E$ is just closed), $x$ must be in $E$, i.e., $\cap_n E_{\epsilon_n} \subseteq E$. The converse is obvious. Hence, $\lim_{n \rightarrow \infty} \lambda(E_{\epsilon_n}) = \lambda(E)$ as $E_{\epsilon_n}$ is a decreasing sequence of sets. Thus, for large enough $n$, whenever $\epsilon \leq \epsilon_n$, $\lambda(E_\epsilon)$ can be made as close to $\lambda(E)$ as desired, i.e., $\lim_{\epsilon \rightarrow 0} \lambda(E_\epsilon) = \lambda(E)$. (So, yes, the general version you asked at the end is also right. I should caution though that this only works when $E$ is closed. In general, a similar argument shows $\cap_n E_{\epsilon_n}$ is the closure of $E$, so $\lim_{\epsilon \rightarrow 0} \lambda(E_\epsilon) = \lambda(\bar{E})$ and the result fails whenever $\lambda(\bar{E} \setminus E) > 0$.)
Edit: As @ThomasLehéricy pointed out, the argument contains a gap. The claim $\lim_{n \rightarrow \infty} \lambda(E_{\epsilon_n}) = \lambda(E)$ is not necessarily true without assuming $\lambda(E_\epsilon) < \infty$ for some $\epsilon > 0$. If this assumption holds, then the argument works as is, showing that $\lim_{\epsilon \rightarrow 0} \lambda(E_\epsilon) = \lambda(\bar{E})$. But as @ThomasLehéricy mentioned, this could fail when $E$ is not compact, say, when $E = \mathbb{Z}$. This wouldn’t be a problem if $E$ is compact, since a compact $E$ must be contained in $[-a, a]$ for some $a > 0$, so $E_\epsilon \subseteq (-a - \epsilon, a + \epsilon)$ and is thus of finite measure.
To summarize, for compact $E$, your question and the more general version both have a positive answer. This might not be true without compactness.