๐Ÿงฎ Brain Teaser

The Lebesgue Integral of a Suspicious Function

Define f:[0,1]โ†’Rf : [0,1] \to \mathbb{R} by

f(x)={1ifย xโˆˆQ0ifย xโˆ‰Q.f(x) = \begin{cases} 1 & \text{if } x \in \mathbb{Q} \\ 0 & \text{if } x \notin \mathbb{Q}. \end{cases}

(This is the Dirichlet function.)

  1. Show that ff is not Riemann integrable on [0,1][0,1].
  2. Compute the Lebesgue integral โˆซ[0,1]fโ€‰dฮผ\int_{[0,1]} f \, d\mu.
  3. Now consider the sequence of functions fn:[0,1]โ†’Rf_n : [0,1] \to \mathbb{R} defined as follows: enumerate the rationals in [0,1][0,1] as q1,q2,q3,โ€ฆq_1, q_2, q_3, \ldots and set

fn(x)={1ifย xโˆˆ{q1,q2,โ€ฆ,qn}0otherwise.f_n(x) = \begin{cases} 1 & \text{if } x \in \{q_1, q_2, \ldots, q_n\} \\ 0 & \text{otherwise.} \end{cases}

Show that fnโ†’ff_n \to f pointwise, compute โˆซ[0,1]fnโ€‰dฮผ\int_{[0,1]} f_n \, d\mu for each nn, and verify the Monotone Convergence Theorem in this example.

Lebesgue integrationmeasure zeroRiemann vs LebesgueMonotone Convergence TheoremDirichlet function

Answer: Dirichlet Function and Lebesgue Measure Zero

Key Idea / Intuition

The Dirichlet function is the poster child for why the Lebesgue integral was invented. Riemann integration "sees" oscillation at every scale and fails, but Lebesgue integration "doesn't care" about individual points or countable sets โ€” a countable set has measure zero, so it contributes nothing to the integral. The sequence fnf_n then gives a concrete, hands-on illustration that integrating through pointwise limits is valid here, exactly as the Monotone Convergence Theorem promises.


Formal Proof / Solution

Part 1: ff is not Riemann integrable

Recall: ff is Riemann integrable iff for every ฮต>0\varepsilon > 0 there exists a partition PP such that U(f,P)โˆ’L(f,P)<ฮตU(f,P) - L(f,P) < \varepsilon.

For any partition P={x0,x1,โ€ฆ,xn}P = \{x_0, x_1, \ldots, x_n\} of [0,1][0,1], every subinterval [xiโˆ’1,xi][x_{i-1}, x_i] contains both a rational and an irrational number (by density of Q\mathbb{Q} and Rโˆ–Q\mathbb{R} \setminus \mathbb{Q} in R\mathbb{R}). Therefore:

Mi=supโก[xiโˆ’1,xi]f=1,mi=infโก[xiโˆ’1,xi]f=0.M_i = \sup_{[x_{i-1},x_i]} f = 1, \qquad m_i = \inf_{[x_{i-1},x_i]} f = 0.

So for every partition PP: U(f,P)=โˆ‘i=1nMiฮ”xi=1,L(f,P)=โˆ‘i=1nmiฮ”xi=0.U(f,P) = \sum_{i=1}^n M_i \Delta x_i = 1, \qquad L(f,P) = \sum_{i=1}^n m_i \Delta x_i = 0.

Hence U(f,P)โˆ’L(f,P)=1U(f,P) - L(f,P) = 1 for all PP, so ff is not Riemann integrable.


Part 2: Lebesgue integral of ff

The set of rationals Qโˆฉ[0,1]\mathbb{Q} \cap [0,1] is countable, hence has Lebesgue measure zero:

ฮผ(Qโˆฉ[0,1])=0.\mu(\mathbb{Q} \cap [0,1]) = 0.

We can write f=1Qโˆฉ[0,1]f = \mathbf{1}_{\mathbb{Q} \cap [0,1]}, the indicator of a null set. For any non-negative measurable simple function ฯ•=โˆ‘iai1Ai\phi = \sum_i a_i \mathbf{1}_{A_i}, the Lebesgue integral is โˆ‘iaiฮผ(Ai)\sum_i a_i \mu(A_i). Here ff itself is a simple function (two values, two measurable sets):

โˆซ[0,1]fโ€‰dฮผ=1โ‹…ฮผ(Qโˆฉ[0,1])+0โ‹…ฮผ((Rโˆ–Q)โˆฉ[0,1])=1โ‹…0+0โ‹…1=0.\int_{[0,1]} f \, d\mu = 1 \cdot \mu(\mathbb{Q} \cap [0,1]) + 0 \cdot \mu((\mathbb{R}\setminus\mathbb{Q}) \cap [0,1]) = 1 \cdot 0 + 0 \cdot 1 = \boxed{0}.

Alternatively: f=0f = 0 almost everywhere (a.e.), so its Lebesgue integral equals โˆซ0โ€‰dฮผ=0\int 0 \, d\mu = 0. This is the key philosophy: sets of measure zero are invisible to Lebesgue integration.


Part 3: The sequence fnf_n and MCT

Pointwise convergence to ff: Fix any xโˆˆ[0,1]x \in [0,1].

  • If xโˆ‰Qx \notin \mathbb{Q}: fn(x)=0f_n(x) = 0 for all nn, so fn(x)โ†’0=f(x)f_n(x) \to 0 = f(x). โœ“
  • If xโˆˆQx \in \mathbb{Q}: then x=qkx = q_k for some kk. For all nโ‰ฅkn \geq k, fn(x)=1f_n(x) = 1, so fn(x)โ†’1=f(x)f_n(x) \to 1 = f(x). โœ“

So fnโ†’ff_n \to f pointwise on all of [0,1][0,1].

Integral of fnf_n: Each fn=1{q1,โ€ฆ,qn}f_n = \mathbf{1}_{\{q_1,\ldots,q_n\}} is the indicator of a finite set. Finite sets have measure zero, so:

โˆซ[0,1]fnโ€‰dฮผ=1โ‹…ฮผ({q1,โ€ฆ,qn})=1โ‹…0=0forย everyย n.\int_{[0,1]} f_n \, d\mu = 1 \cdot \mu(\{q_1, \ldots, q_n\}) = 1 \cdot 0 = 0 \quad \text{for every } n.

Verification of MCT: The Monotone Convergence Theorem states: if 0โ‰คfnโ†—f0 \leq f_n \nearrow f a.e. and each fnf_n is measurable, then

limโกnโ†’โˆžโˆซfnโ€‰dฮผ=โˆซfโ€‰dฮผ.\lim_{n \to \infty} \int f_n \, d\mu = \int f \, d\mu.

Here:

  • fnโ‰ฅ0f_n \geq 0 โœ“
  • fnโ‰คfn+1f_n \leq f_{n+1} since {q1,โ€ฆ,qn}โІ{q1,โ€ฆ,qn+1}\{q_1,\ldots,q_n\} \subseteq \{q_1,\ldots,q_{n+1}\} โœ“
  • fnโ†’ff_n \to f pointwise โœ“

And indeed: limโกnโ†’โˆžโˆซfnโ€‰dฮผ=limโกnโ†’โˆž0=0=โˆซfโ€‰dฮผ.โœ“\lim_{n\to\infty} \int f_n \, d\mu = \lim_{n\to\infty} 0 = 0 = \int f \, d\mu. \checkmark

The example is slightly degenerate (all integrals are 00) but perfectly illustrates that the passage of the limit through the integral is valid โ€” and shows how Lebesgue theory handles functions that are wildly discontinuous yet perfectly integrable.

Source: Rudin - Real and Complex Analysis, Chapter 1; mathematical folklore

Type: analysisSource: Rudin - Real and Complex Analysis, Chapter 1; mathematical folkloreEdit on GitHub โ†—