Let $(X, d)$ be a metric space. Let $\mu$ be a Radon measure on $X$, i.e.,
- $\mu$ is locally finite,
- $\mu$ is tight on every Borel set, and
- $\mu$ is outer regular on every Borel set.
As a result, $\mu$ is finite on every compact set. Let $L^p (X, \mu)$ be the space of all functions $f:X \to \mathbb R$ such that $|f|^p$ is $\mu$-integrable. Let $\mathrm{Lib}_c (X)$ be the space of all Lipschitz functions $f:X \to \mathbb R$ that are compactly supported.
I would like to generalize this result, i.e.,
Theorem If $X$ is locally compact, then $\mathrm{Lib}_c (X)$ is dense in $L^p (X, \mu)$ for $p \in [1, \infty)$.
Could you have a check on my below attempt?
Proof Notice that the space of $\mu$-simple functions is dense in $L^p (X, \mu)$ for $p \in [1, \infty)$. Let $g = 1_B$ where $B$ is a Borel set such that $\mu(B)<\infty$. It suffices to approximate $g$ by a Lipschitz function $f$ with compact support.
Because $\mu$ is Radon, there exist a compact subset $K$ and open subset $U$ such that
- $K \subset B \subset U$,
- $\mu(K)+\mu(U)<\infty$,
- $\mu (B \setminus K) < \varepsilon$ and $\mu (U \setminus B) < \varepsilon$.
Lemma 1 Let $X$ be a locally compact Hausdorff space. Let $K$ be a compact subset of $X$ and $U$ an open subset of $X$ such that $K \subset U$. Then there is an open subset $V$ of $X$ such that $K \subset V \subset \overline V \subset U$ and $\overline V$ is compact.
By Lemma 1, there is an open subset $V$ of $X$ such that $$ K \subset V \subset \overline V \subset U, $$ and $\overline V$ is compact.
Lemma 2 Let $A,B$ be two closed subsets of $X$ such that $A$ is compact and $A \cap B = \emptyset$. We define $d_A(x) := \inf_{a \in A} d(x, a)$. Then the Urysohn function $f:X \to [0, 1]$ defined by $$ f(x) := \frac{d_A(x)}{d_A(x)+d_B(x)} \quad \forall x\in X. $$ is Lipschitz such that $f=1$ on $A$ and $f=0$ on $B$.
Clearly, $K$ and $V^c:= X \setminus V$ are closed and $K \cap V^c =\emptyset$. Let $f$ be the Urysohn function associated with $K$ and $V^c$ provided by Lemma 2. WLOG, we assume $f=1$ on $K$ and $f=0$ on $V^c$. Clearly, $f$ is Lipschitz and compactly supported. We have $$ \begin{align} \|f - 1_B\|_{L^p} &\le \|f - 1_V \|_{L^p} + \|1_V - 1_K \|_{L^p} + \|1_K-1_B\|_{L^p} \\ &\le 3\|1_U-1_K\|_{L^p} \\ &\le 6 \varepsilon. \end{align} $$
This completes the proof.