Let $X$ be a metric space, $\mu$ a $\sigma$-finite non-negative Borel measure on $X$, and $(E, |\cdot|)$ a Banach space. Let $\mathcal L\_p := \mathcal L\_p (X, \mu, E)$ and $\|\cdot\|\_{\mathcal L\_p}$ be its semi-norm. Here we use [Bochner integral](https://math.stackexchange.com/questions/4298588/dominated-convergence-theorem-for-banach-space). Let $\mathcal C\_c :=\mathcal C\_c(X, E)$ be the space of all $E$-valued continuous functions on $X$ with compact supports. It is well-known that



> 
> [Theorem](https://math.stackexchange.com/questions/4573158/if-x-is-locally-compact-separable-then-mathcal-c-cx-is-dense-in-big) If $X$ is locally compact separable, then $\mathcal C\_c$ is dense in $\big (\mathcal L\_p, \|\cdot\|\_{\mathcal L\_p} \big)$ for all $p \in [1, \infty)$.
> 
> 
> 


I would like to ask if above result can be further strengthened, i.e.,



> 
> Let $X$ be locally compact separable. For each $f \in \mathcal L\_p$ with $p \in [1, \infty)$ and $\varepsilon>0$, there is $g \in \mathcal C\_c$ such that
> $$
> \color{red}{|g| \le |f|} \quad \mu\text{-a.e.}
> \quad \quad \text{and} \quad \quad
> \| f-g \|\_{\mathcal L\_p} < \varepsilon.
> $$
> 
> 
> 


This result, if true, generalizes [this lemma](https://math.stackexchange.com/a/4573202/1019043) which itself generalizes [another lemma](https://math.stackexchange.com/q/3967941/1019043).


Thank you so much for your elaboration!



A generalization about the density of $\mathcal C_c(X, E)$ in $\mathcal L_p (X, \mu, E)$ when $E$ is a Banach space
Below is a counter-example taken from [this thread](https://math.stackexchange.com/q/4574262/1019043). It works even when $\mathcal C\_c$ is replaced by $\mathcal C$, the space of all continuous functions from $X$ from $E$.




---


Let $X:=[0, 1]$, $E:=\mathbb R$, and $\mu$ the Lebesgue measure on $[0, 1]$. Let $C$ be the [fat Cantor set](https://en.wikipedia.org/wiki/Smith%E2%80%93Volterra%E2%80%93Cantor_set). Then $C$ is closed and $\mu(C) =\frac{1}{2}$. Let $f :=1\_C$. Then $\| f \|\_{\mathcal L\_1} = \frac{1}{2}$.


Let $g \in \mathcal C$ such that $|g| \le |f|$ $\mu$-a.e. This implies there is a $\mu$-null subset $N$ of $X$ such that $|g| \le |f|$ on $X \setminus N$. Assume $g (a) \neq 0$ for some $a \in X$. By continuity of $g$, there is an open interval $I$ of $X$ such that $g\neq0$ on $I$. Then $f>0$ on $I \setminus N$. So $(I \setminus N) \subset C$ and thus $I \subset (C \cup N)$.


Notice that $I \setminus C$ is non-empty and open, so there is a non-empty open interval $J$ such that $J \subset I$ and $J \cap C = \emptyset$. As such, $J \subset N$ and thus $\lambda (N)>0$. This is a contradiction. As such, $g =0$ everywhere. Hence any $g \in \mathcal C$ can not approximate $f$ from below.


