# Exercise on compact $G_\delta$ sets

I'm having trouble proving an exercise in Folland's book on real analysis.

Problem: Consider a locally compact Hausdorff space $X$. If $K\subset X$ is a compact $G_\delta$ set, then show there exists a $f\in C_c(X, [0,1])$ with $K=f^{-1}(\{1\})$.

We can write $K=\cap_1^\infty U_i$, where the $U_i$ are open.

My thought was to use Urysohn's lemma to find functions $f_i$ which are 1 on $K$ and $0$ outside of $U_i$, but I don't see how to use them to get the desired function. If we take the limit, I think we just get the characteristic function of $K$.

I apologize if this is something simple. It has been a while since I've done point-set topology.

-

## 1 Answer

As you have said, we can use Urysohn's lemma for compact sets to construct a sequence of functions $f_i$ such that $f_i$ equals $1$ in $K$ and $0$ outside $U_i$.

Furthermore, $X$ is locally compact, so there is an open neighbourhood $U$ of $K$ whose closure is compact. We can then assume without loss of generality that $U_i\subseteq U$

Then we can put $f=\sum_i2^{-i} f_i$. Clearly, $f^{-1}[\{1\}]=K$. Moreover, $f$ is the uniform limit of continuous functions (because $f_i$ are bounded by $1$), so it is continuous, and its support is contained in $U$, so $f$ is the function you seek.

-
Excellent, thank you. – Potato Jul 7 '12 at 2:58