I have been working on a PDE problem and I came across the need of working with functions with bounded gradient. However, since I am working with semigroups, I need density of the domain of the generator candidate. So my question is: for a fixed $C>0$, is the set $$X = \left\{f \in H^1(0,1); f(1) = 0 \ \mbox{and} \ |f_x(x)| \leqslant C \ \mbox{for all } x \in (0,1)\right\}$$ dense in $L^2(0,1)$ with the $L^2$--norm?
Any hint on how to prove or disprove this would be highly appreciated.
lisyarus' point hits close to home. For almost every $x \in [0, 1]$ and any $f \in X$ we have: $$ \lvert f(x) \rvert = \lvert f(x) - 0 \rvert = \lvert f(x) - f(1) \rvert = \left \lvert \int^1_x f_x(s)~\mathrm{d}s \right \rvert \leq \lvert x -1 \rvert C\leq C $$ So let us assume that there is some sequence $(g_n)_{n \in \mathbb{N}} \subseteq X$ to approximate $g(x) := C+1$ in $L^2$. We know that there is a subsequence $g_{m_n}$ of $g_n$ that converges pointwise a.e. to $g$.
In fact for almost every $x$: $$ C\geq \lvert g_{m_n}(x) \rvert \rightarrow \lvert g(x) \rvert = C+1 $$ So $C \geq C+1$ which is nonsense.
This means that $X$ is not dense.