Is the space of smooth functions dense in that of continuous ones?

424 Views Asked by At

In this morning class about Brouwer fixed-point theorem, my professor admits a lemma without proof that

Lemma: Any continuous function $f$ from a compact subset $C$ of $\mathbb{R}^{n}$ to $\mathbb{R}^{n}$ can be uniformly approximated by a sequence of smooth functions $(f_{k})$. That is, $$\forall k \in \mathbb{N},\left\|f-f_{k}\right\|_{\infty}=\max_{x \in C}\left\|f(x)-f_{k}(x)\right\|<\frac{1}{k}$$

This lemma makes me remember of Weierstrass Approximation theorem in which a polynomial is a typical smooth function.

Weierstrass Approximation Theorem: Suppose $f$ is a continuous real-valued function defined on the real interval $[a, b] .$ For every $\varepsilon>0,$ there exists a polynomial $p$ such that for all $x$ in $[a, b],$ we have $|f(x)-p(x)|<\varepsilon$, or equivalently, the supremum norm $\|f-p\|_\infty<\varepsilon$.

I would like to ask if the following statement holds:

Let $E,F$ be Banach spaces, $X \subseteq E$, and $f: X \to F$ is continuous. There is a sequence of smooth functions $(f_k)$ in $\mathcal C^\infty (X,F)$ converges to $f$ w.r.t the supremum norm $\| \cdot \|_\infty$. In the other words, $\mathcal C^\infty (X,F)$ is dense in $\mathcal C^0 (X,F)$.

If this statement does not hold in general. Does it hold in case $X$ is a compact?

Thank you so much for your clarification!