Approximating continuous functions with compact support by simple functions in $L^\infty$ norm

analysismeasure-theoryreal-analysisuniform-convergence

Let $f\in C_0(\mathbb{R}^n,\mathbb{R})$ be a continuous function with a compact support. I am reading material which states that we can then find a sequence of simple functions $\left(g_n\right)_{n=1}^\infty$ such that $\lim_{n\to\infty}||f – g_n||_\infty = 0$ where $||.||_\infty$ is the uniform norm $||f||_\infty = \sup_{x\in\mathbb{R}^n}|f(x)|$, $g_n(x) = \sum_{k=1}^{M_n}\alpha_k\chi_{S_k}(x)$ for some $\alpha_k\in\mathbb{R}$ and $\chi_{S_k}$ the indicator functions of some sets $S_k\subset\mathbb{R}^n$. The material does not refer to any prior given result or explicitly state why we may approximate $f$ in this way w.r.t. the uniform norm. Unfortunately it is some time since my analysis class so I don't recall any one result giving this. I am aware that every non-negative measurable function is the pointwise limit of an increasing sequence of simple functions. However this converge needs to be uniform.

Best Answer

As peek-a-boo pointed out in the comments, compact support is not needed, bounded and measurable is enough. For $k\in \{-n, \dots, n\}$ define the sets

$$ S_{k,n} = \begin{cases} f^{-1}([\Vert f\Vert_\infty k/n, \Vert f\Vert_\infty (k+1)/n)),& k\in \{-n, \dots, n -1\},\\ f^{-1}( \{\Vert f\Vert_\infty\}),& k=n. \end{cases}$$ Now consider the simple function $$g_n =\sum_{k=-n}^n \Vert f\Vert_\infty \frac{k}{n} \chi_{S_{k,n}}.$$ Then one checks that $$\Vert f-g_n\Vert_\infty \leq 1/n.$$

Related Question