Tutorials › Real Analysis › Simple Functions Are Dense in Lp

Lp Spaces · Tutorial 898 of 1000

Simple Functions Are Dense in Lp

You will construct finite-range measurable approximations to Lp functions and see why truncating both small values and large values is useful.

Advanced 10 min read

What You'll Learn

  • Define simple functions and identify when they belong to Lp
  • Restrict an Lp function to sets of finite measure with vanishing error
  • Quantize bounded function values to construct simple approximations
  • Prove that simple functions are dense for every finite p
  • Build explicit approximations on an interval, a counting space, and the half-line
  • Distinguish finite-exponent density from approximation in the L-infinity norm

Why Approximate Lp Functions by Simple Functions?

The previous tutorial compared convergence in measure, almost-everywhere convergence, and convergence in \(L^p\). We now use the \(L^p\) norm to answer a different question: how can an arbitrary \(L^p\) function be approximated by functions with a very simple form? A simple function takes only finitely many values, so its integral and norm can be reduced to calculations on measurable sets.

For finite \(p\), two features of an \(L^p\) function make such approximation possible. First, the integral of \(|f|^p\) on the region where \(f\) is very large can be made small. Second, the region where \(|f|\) is bigger than a fixed positive threshold has finite measure. We can therefore discard the small values, truncate the large ones, and divide the remaining bounded range into short intervals.

Definition: A simple function is a measurable function that takes only finitely many values. Equivalently, it can be written as \(s=\sum_{j=1}^N c_j\mathbf{1}_{A_j}\), where \(N\) is finite, the \(A_j\) are measurable, and the \(c_j\) are real numbers. The sets may be taken to be disjoint by combining any overlapping level sets.

If \(s\in L^p(X,\mu)\), every level set on which \(s\) has a nonzero value must have finite measure: for \(c\ne0\), the contribution of that set to \(\int_X|s|^p\,d\mu\) is \(|c|^p\mu(A)\). In particular, simple functions supported on sets of finite measure are natural approximants on spaces that may have infinite total measure.

Discarding Values Outside a Finite-Measure Region

Fix \(f\in L^p(X,\mu)\), where \(1\leq p<\infty\), and consider the measurable sets $$ E_k=\{x\in X:1/k<|f(x)|\leq k\},\qquad k=1,2,\ldots. $$ These sets increase with \(k\). They exclude points where \(f\) is zero, where its values are too small, or where its values are too large. The zero values need no approximation: setting them to zero creates no error.

Each \(E_k\) has finite measure. Indeed, it is contained in \(\{|f|>1/k\}\), and the Level-Set Estimate for \(L^p\) gives $$ \mu(E_k)\leq \mu(\{|f|>1/k\})\leq k^p\int_X|f|^p\,d\mu<\infty. $$ At the same time, \(f\mathbf{1}_{E_k}\) approaches \(f\) in \(L^p\). The result below records this truncation step explicitly.

Lemma (Finite-Measure Truncation): If \(1\leq p<\infty\) and \(f\in L^p(X,\mu)\), then \(\|f-f\mathbf{1}_{E_k}\|_p\to0\) for the sets \(E_k=\{1/k<|f|\leq k\}\).

Proof. For every point where \(f(x)\ne0\), the value \(|f(x)|\) is positive and finite, so \(1/k<|f(x)|\leq k\) for all sufficiently large \(k\). At points where \(f(x)=0\), the product \(f(x)\mathbf{1}_{E_k}(x)\) is zero for every \(k\). Thus \(f\mathbf{1}_{E_k}\to f\) pointwise. Also, $$ |f-f\mathbf{1}_{E_k}|^p=|f|^p\mathbf{1}_{X\setminus E_k}\leq |f|^p. $$ The function \(|f|^p\) is integrable. The Dominated Convergence Theorem therefore gives $$ \int_X|f-f\mathbf{1}_{E_k}|^p\,d\mu\longrightarrow0. $$ Taking \(p\)th roots proves the asserted \(L^p\) convergence. \(\square\)

The same conclusion follows by applying the Approximation on Increasing Domains theorem to the integrable function \(|f|^p\) on the increasing sets \(E_k\); points where \(f=0\) contribute nothing. The important point is that this truncation takes place in the \(L^p\) norm, not merely pointwise. On an infinite-measure space, discarding a small value over the whole space might not give a small norm. The finite-measure sets \(E_k\) avoid that difficulty.

Worked Example: Staircase Approximation to the Identity Function

On \([0,1]\) with Lebesgue measure, let \(f(x)=x\), and for a positive integer \(n\) define $$ s_n(x)=\frac{j}{n}\quad\text{when}\quad \frac{j}{n}\leq x<\frac{j+1}{n}, \qquad j=0,\ldots,n-1, $$ with \(s_n(1)=1\). Each \(s_n\) is measurable and takes finitely many values, so it is a simple function. For \(x\) in the interval indexed by \(j\), \(0\leq x-j/n<1/n\); at \(x=1\), the error is zero. Consequently, $$ \|f-s_n\|_p^p =\int_0^1|x-s_n(x)|^p\,dx \leq\int_0^1\left(\frac{1}{n}\right)^p\,dx =\frac{1}{n^p}. $$ Thus \(\|f-s_n\|_p\leq1/n\to0\). Here the whole domain has finite measure, and evenly spaced values give an immediate error bound.

Approximating the Bounded Values on a Finite-Measure Set

Once we have restricted \(f\) to \(E_k\), its values are bounded in absolute value by \(k\), and \(E_k\) has finite measure. Divide the interval \([-k,k]\) into short pieces and replace each value of \(f\) by a nearby endpoint. This produces a measurable function with only finitely many values. The finite measure of \(E_k\) then turns a uniform error in the values into a small \(L^p\) error.

Theorem (Simple Functions Are Dense in \(L^p\)): Let \((X,\mathcal{F},\mu)\) be any measure space and \(1\leq p<\infty\). For every \(f\in L^p(X,\mu)\) and every \(\varepsilon>0\), there is a simple function \(s\in L^p(X,\mu)\) such that \(\|f-s\|_p<\varepsilon\). The approximating simple function can be chosen to vanish outside a set of finite measure.

Proof. Choose \(k\) large enough that the Finite-Measure Truncation Lemma gives $$ \int_{X\setminus E_k}|f|^p\,d\mu<\frac{\varepsilon^p}{2}. $$ The set \(E_k\) has finite measure. For a positive integer \(m\), define $$ s(x)= \begin{cases} \lfloor mf(x)\rfloor/m,&x\in E_k,\\ 0,&x\notin E_k. \end{cases} $$ On \(E_k\), the value of \(f\) lies in \([-k,k]\), so \(\lfloor mf(x)\rfloor\) belongs to a finite set of integers. Thus \(s\) has finite range. It is measurable because \(E_k\) is measurable and the floor function is measurable. Also, \(s\) vanishes outside \(E_k\), a set of finite measure, and its values are bounded. Hence \(s\in L^p(X,\mu)\).

For every real number \(t\), \(0\leq t-\lfloor t\rfloor<1\). Applying this with \(t=mf(x)\) shows that $$ |f(x)-s(x)|<1/m\qquad(x\in E_k). $$ Choose \(m\) large enough that \(\mu(E_k)/m^p<\varepsilon^p/2\); if \(\mu(E_k)=0\), this bound already holds for every \(m\). The error is \(f\) outside \(E_k\) and is at most \(1/m\) on \(E_k\), so $$ \|f-s\|_p^p =\int_{X\setminus E_k}|f|^p\,d\mu+\int_{E_k}|f-s|^p\,d\mu \leq\int_{X\setminus E_k}|f|^p\,d\mu+\frac{\mu(E_k)}{m^p} <\varepsilon^p. $$ Taking \(p\)th roots gives \(\|f-s\|_p<\varepsilon\), as required. \(\square\)

The proof uses separate choices for the two sources of error. First, \(k\) makes the error from discarding values outside \(E_k\) small. Then, with that set fixed, \(m\) makes the error from replacing values on \(E_k\) small. The order matters: the quantization error is bounded by \(\mu(E_k)/m^p\), so the measure of the region being quantized must be controlled before choosing the mesh size.

Worked Example: Finite Truncations of a Sequence

Give the positive integers counting measure, and define \(a(j)=2^{-j}\). For \(1\leq p<\infty\), $$ \|a\|_p^p=\sum_{j=1}^{\infty}2^{-jp} =\frac{2^{-p}}{1-2^{-p}}<\infty, $$ so \(a\in\ell^p\). Define the simple function \(s_N(j)=2^{-j}\) for \(j\leq N\), and \(s_N(j)=0\) for \(j>N\). It takes only \(N+1\) values and is supported on a finite set. Its error is exactly the tail: $$ \|a-s_N\|_p^p =\sum_{j=N+1}^{\infty}2^{-jp} =\frac{2^{-p(N+1)}}{1-2^{-p}}. $$ As \(N\to\infty\), this expression tends to zero, and therefore \(\|a-s_N\|_p\to0\). In this example, approximation comes from discarding a tail of the domain rather than subdividing a bounded range.

Unbounded Functions on an Infinite-Measure Space

Neither boundedness of \(f\) nor finiteness of \(\mu(X)\) is required by the density theorem. For an unbounded function on an infinite-measure space, both truncation steps can be seen explicitly: restrict to a finite interval, then approximate the bounded values there.

Worked Example: A Decaying Function on the Half-Line

On \([0,\infty)\) with Lebesgue measure, let \(f(x)=1/(1+x)\) and fix \(p>1\). Direct integration gives $$ \|f\|_p^p=\int_0^\infty(1+x)^{-p}\,dx=\frac{1}{p-1}<\infty. $$ For a positive integer \(m\), divide \([0,m)\) into intervals \([j/m,(j+1)/m)\), for \(j=0,\ldots,m^2-1\). On the interval indexed by \(j\), set \(s_m(x)=1/(1+j/m)\), and set \(s_m(x)=0\) for \(x\geq m\). This is a finite-range measurable function supported on a finite-measure set.

If \(a=j/m\) and \(a\leq x<a+1/m\), then $$ \left|\frac{1}{1+x}-\frac{1}{1+a}\right| =\frac{|x-a|}{(1+x)(1+a)} \leq\frac{1}{m}. $$ On the tail \([m,\infty)\), the approximation is zero. Therefore $$ \|f-s_m\|_p^p \leq \frac{m}{m^p}+\int_m^\infty(1+x)^{-p}\,dx =m^{1-p}+\frac{(1+m)^{1-p}}{p-1}. $$ Since \(p>1\), both terms tend to zero as \(m\to\infty\). Hence these simple functions converge to \(f\) in \(L^p\). The cutoff error tends to zero because \(f\) is integrable to the \(p\)th power, while the step error on \([0,m)\) is controlled by the interval width.

What the Density Theorem Does—and Does Not—Say

Density means that every \(L^p\) function can be approximated arbitrarily closely in norm. It does not say that the function itself has finite range, or that one fixed simple function approximates it to every desired accuracy. Rather, the approximating simple function may depend on the chosen error tolerance. Because the theorem works on any measure space, it also applies when \(\mu(X)=\infty\); the constructed approximants are supported on finite-measure sets.

The restriction \(p<\infty\) is central to the truncation argument: it gives an integrable error \(|f|^p\) whose contribution outside the growing sets can be made small. There is also a separate approximation fact for \(L^\infty\): an essentially bounded function can be approximated in essential-supremum norm by finite-range measurable functions, by dividing a bounded range into short intervals after changing the function on a null set if needed. That statement does not generally give approximants supported on finite-measure sets. Thus the finite-\(p\) theorem here includes a useful support property that should not be confused with the endpoint case.

A common mistake on an infinite-measure space is to approximate \(f\) by rounding all its values, including values close to zero, to a small nonzero number. Even a uniformly small error can have infinite \(L^p\) norm if it persists across a set of infinite measure. The construction avoids this: it first sets \(f\) to zero outside \(E_k\), whose measure is finite, and only then rounds the values inside that set. Truncation controls the error in the tails; finite measure controls the cost of quantization.

Check Your Understanding

Use the finite-measure truncation and quantization steps to explain the approximation, not just the pointwise behavior of the functions.

  1. Why does \(\{|f|>1/k\}\) have finite measure when \(f\in L^p\) and \(p<\infty\)?
  2. Why can the values of \(f\) on \(E_k\) be approximated using only finitely many possible values?
  3. In the density proof, what does the choice of \(k\) control, and what does the later choice of \(m\) control?
  4. Why is it not enough to make a rounding error uniformly small on an arbitrary infinite-measure space?
  5. For \(a(j)=2^{-j}\) with counting measure, what is the exact \(p\)th power of the error after retaining the first \(N\) terms?