# Approximate an $L^2$ function from “inside”

Consider a bounded domain $\Omega \subset \mathbb R^d$ and a function $f \in L^2(\Omega)$. Now $f$ can be approximated through a sequence of functions $f_n \in H^1(\Omega)$ (or even $C^\infty(\Omega)$).

My question is: Can I additionally demand $|f_n| \le |f|$ almost everywhere?

Some thoughts / Things I've tried:

1. Mollification is hard to control and I do not see a way to "fix" a mollified version of $f$ such that it satisfies the constraint and remains smooth.
2. Maybe one could first approximate $L^2$ through step functions (i.e. linear combinations of characteristic functions of rectangular boxes) and then approximate those. Approximating them through smooth functions while satisfying the constraint should not be a problem. I know that step functions are dense in $L^2$, but I'm not sure if the constraint can be met (If the limit was Riemann integrable then the answer should be positive, but what about the general case?)

Note: The assumption $f \in L^\infty(\Omega)$ can be made.

This is my thought process about how I would do it. First, as you suggest, I would approximate any $f \in L^2$ by a simple function $g(x) = \sum_{i} a_i \chi_{A_i}$. Second, by inner regularity I would approximate each $A_i$ by a compact set $B_i \subseteq A_i$. Thus, your problem reduces to finding a strictly less than smooth approximation to $\chi_B$ for any compact set $B$.
Now if $B$ has a nonempty interior, then there are portions of it that look like an interval $[a,b]$. We can easily approximate this with a bump function. So let's consider the nowhere dense part of $B$. If it has no positive measure then we are done. But it might. For instance, think of a fat cantor set for instance.
But let's really think about this more. If $\phi(x) \leq \chi_B(x)$ where $B$ is a fat Cantor set with positive measure supported in $[0,1]$, then consider $y \in B$ and $\phi(y) = z > 0$ ($\phi$ must be nonzero somewhere). But for any $y \in B$ there exists a sequence $a_n \to y$ with $a_n \notin B$ because the complement of $B$ is dense. Necessarily, then $\phi(a_n) \leq \chi_B(a_n) = 0$. From this we conclude $\phi(y) = \lim_n \phi(a_n) \leq 0 < z = \phi(y)$, a contradiction.
• But we don't need $\phi(x) \le \chi_B(x)$ everywhere, just almost everywhere. So the mere fact that $a_n$ exists is not a problem, just if there are too many such $a_n$... or am I missing something? – anonymous May 20 '14 at 13:54
• Okay, good point. How do we choose $a_n$? We chose $a_n$, for instance, so that $|y-a_n| < 1/n$ and $a_n \notin B$. The density of $B^c$ says at least one $a_n$ does the job. So what if we can't pick any of these possible $a_n$ such that $\phi \leq \chi_B$ as well? Then $B_{1/n}(y)\cap B^c$ must have measure zero, since by assumption only on sets of measure zero can this occur. But $B^c$ has a nonempty interior which means this isn't possible. – abnry May 20 '14 at 13:59
• To be honest, your comment does not make it any clearer to me. But I think you're right, the fat Cantor set indeed shows that what I want is not possible: Each $a_n$ is contained in a whole interval $I \subset B^c$, on which $\chi_B$ vanishes and so must $\phi$... I'm a bit sad about this outcome but thank you a lot for answering my question! – anonymous May 20 '14 at 14:06
• Basically I'm saying this: Even if we have on a set of measure zero $\phi \leq \chi_B$, then there is still enough room in the open sets we are dealing with to choose the sequence $a_n$ so that it does everything we want. (I should have just said $B_{1/n}(y)\cap B^c$ is open, nonempty, and hence has nonzero measure.) – abnry May 20 '14 at 14:18