Every set is contained in a $G_\delta$ set of the same Hausdorff dimension I have been trying to prove that if $(X,d)$ is a metric space, then every subset of $X$ is contained in a $G_\delta$ set of the same Hausdorff dimension. I know that this is obvious if a set is open or closed, since in metric spaces open and closed sets are automatically $G_\delta$, but I am not sure how to do this for other sets. Let $Y$ be a set that is neither open nor closed. Then I tried to use a basis $\mathcal{B}$ for $X$ and write $Y=\bigcup_{i\in I}B_i$, where $B_i\in\mathcal{B}$ for all $i\in I$ and using the countable stability of the Hausdorff dimension to say $dim_HY=\max_{i\in I}dim_HB_i$ but I did not manage to get anywhere. So my question is, how do I prove this for the case of when $Y$ is neither open nor closed?
 A: Hint: This is easy from the  definitions.
First let's simplify one of the definitions a bit. Define $C_\alpha(E)$, sometimes called the Hausdorff capacity of $E$, by $$C_\alpha(E)=\inf\left\{
\sum r_j^\alpha: E\subset\bigcup B(x_j,r_j)\right\}.$$
It's important to note that $C_\alpha(E)$ is not  the same as the Hausdorff measure $H_\alpha(E)$. But


Exercise $C_\alpha(E)=0$ if and only if $H_\alpha(E)=0$.


So we can use $C_\alpha$ in place of $H_\alpha$ in defining the Hausdorff dimension.
Now assume the Hausdorff dimension of $E$ is $\alpha$.


Lemma. If $\beta>\alpha$ and $\epsilon>0$ there exists an open set $V$ with $E\subset V$ and $C_\beta(V)<\epsilon$.


So there is a sequence of open sets $V_n$ with $E\subset V_n$ and $C_{\alpha+1/n}(V_n)<1/n$. Let $V=\bigcap V_n$. Show that $C_\beta(V)=0$ for every $\beta>\alpha$; hence the dimension of $V$ is less than or equal to $\alpha$.
Techinality: At some point you'll probably need to note this: If $\beta>0$,  $r_j\ge0$ and $\sum r_j^\beta<1$  then $r_j<1$, hence $$\sum r_j^\gamma\le\sum r_j^\beta\quad(\gamma>\beta).$$
