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 1


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.

  • $\begingroup$ Excellent, thank you. $\endgroup$
    – Potato
    Jul 7, 2012 at 2:58
  • $\begingroup$ How can you assume that $U_i \subseteq U\ $? $\endgroup$
    – Anacardium
    Dec 31, 2020 at 8:44
  • 1
    $\begingroup$ @Anacardium: because $K\subseteq U$, so $K=U\cap K=U\cap \bigcap_i U_i=\bigcap_i(U\cap U_i)$. $\endgroup$
    – tomasz
    Dec 31, 2020 at 16:24
  • $\begingroup$ Another question. We know that Urysohn's lemma is only valid for normal topological space and the locally compact Hausdorff space is not necessarily normal. Then how can we apply Urysohn's lemma here? $\endgroup$
    – Anacardium
    Dec 31, 2020 at 17:23
  • $\begingroup$ @Anacardium $\bar U$ is compact. $\endgroup$
    – tomasz
    Dec 31, 2020 at 17:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .