The Lebesgue Integral
Learning objectives
- Define measurable functions and simple functions
- Construct the Lebesgue integral in three stages: simple, non-negative, general
- Compute integrals of step functions and the Dirichlet function
- Contrast Lebesgue integration with Riemann integration on the same examples
The Lebesgue integral is the Riemann integral, but with the partitioning happening on the -axis instead of the -axis. Riemann chops the domain into vertical slivers and adds up rectangle areas. Lebesgue chops the range into horizontal strips and asks: how much of the domain is mapped into this strip? The reorganisation looks cosmetic but is conceptually decisive: it cleanly separates "what values does the function take?" from "how often does it take each value?", which makes integration robust under limits and extends to a vastly larger class of functions. Every modern theorem about expectations, Fourier transforms, and PDE solutions is a Lebesgue integral.
This section is computational and prose-heavy; the integration construction does not lend itself to a single small widget in lang-core. We make the construction concrete with explicit step-function calculations.
Measurable functions
A function is measurable if for every , equivalently, the preimage of every Borel set lies in . On with the Lebesgue -algebra, every continuous function is measurable, every monotone function is measurable, every limit of measurable functions is measurable, and the indicator of any measurable set is measurable. Non-measurable functions exist but are even harder to construct than non-measurable sets, in practice, "measurable" is automatic.
Simple functions: the building blocks
A simple function is a measurable function taking only finitely many values:
where and the are pairwise disjoint measurable sets. The integral of a non-negative simple function is defined directly:
, the same rectangle-area sum as Riemann, but with in place of the width of an interval. The crucial feature: does not have to be an interval.
Three-stage construction
Stage 1. Non-negative simple functions: integral as above.
Stage 2. Non-negative measurable functions : define
, the supremum of integrals of simple functions below . This can be ; we say is integrable if the supremum is finite.
Stage 3. General measurable : split where and are non-negative. Define
provided at least one of the two integrals is finite (otherwise the difference is undefined). The function is integrable if both and are finite, equivalently .
Lebesgue versus Riemann: the Dirichlet function
Let D : [0, 1] \to \mathbb{R} be the Dirichlet function: if , else . The function takes value on a dense set of rationals and value on the dense set of irrationals.
Riemann sees: every upper Darboux sum is (rationals are dense, so every interval contains a point where ). Every lower Darboux sum is (irrationals are dense, so every interval contains a point where ). The upper integral is ; the lower integral is . They do not agree, so is not Riemann integrable.
Lebesgue sees: D = \chi_{\mathbb{Q} \cap [0, 1]} is a simple function (it has only two values). Its integral is
\int_0^1 D\, d\lambda = 1 \cdot \lambda(\mathbb{Q} \cap [0, 1]) + 0 \cdot \lambda([0, 1] \setminus \mathbb{Q}) = 1 \cdot 0 + 0 \cdot 1 = 0.
Lebesgue assigns the integral . The function is integrable in the Lebesgue sense, and the answer matches the intuition " is on a measure-zero set, so its integral is ."
- Probability and expectation: The expected value of a random variable is a Lebesgue integral E[X] = \int X\, dP. Discrete and continuous random variables become a single unified theory because the Lebesgue integral handles both step functions and densities natively.
- Fourier analysis: The Fourier transform is a Lebesgue integral on . Plancherel's theorem, the inversion theorem, and the entire machinery rest on Lebesgue.
- Quantum mechanics: Inner products in the Hilbert space are Lebesgue integrals . Wave functions are Lebesgue-square-integrable; the Riemann integral would not support the limit operations needed.
- Machine learning: Cross-entropy loss, KL divergence, and the Radon-Nikodym likelihood ratio are all Lebesgue integrals against a base measure (Lebesgue, counting, or a model density). PyTorch and TensorFlow implement them using Lebesgue-style decomposition into discrete and continuous parts.
Pause and think: Compute for the step function \phi = 2\chi_{[0, 1)} + 5\chi_{[1, 3]} + 1\chi_{(3, 4]}. (Walk through: each rectangle's area is value times length of the base set, all summed.)
Try it
- Predict first: what is \int_0^1 \chi_{[0, 1/3]}\, d\lambda? Then compute \int_0^1 (\chi_{[0, 1/3]} + 2\chi_{[1/3, 2/3]} + 3\chi_{[2/3, 1]})\, d\lambda.
- Show that if almost everywhere (the set where has measure zero), then . (Hint: the difference is zero almost everywhere, so its integral is .)
- True or false: every Lebesgue-integrable function is Riemann-integrable. (Hint: think about the Dirichlet function and remember which direction the inclusion runs.)
- Compute and for . Then compute using the difference formula. (Hint: lives on [1/2, 1]; lives on [0, 1/2].)
- Find a sequence of simple functions approximating on [0, 1] from below, with taking values. Use them to recover in the Lebesgue framework.
A trap to watch for
A common misconception is that Lebesgue integration replaces Riemann integration entirely. It does not. For any function that is Riemann integrable on [a, b] (which includes every continuous function and every function with countably many discontinuities), the Riemann integral and the Lebesgue integral give the same number. The Lebesgue framework extends the Riemann framework to a wider class, the Dirichlet function is the canonical extension, but on the overlap they agree exactly. So no result you proved with Riemann integrals in calculus needs to be reproved. The only thing changing is the toolkit available for taking limits, which is decisively bigger.
What you now know
You can recognise measurable and simple functions, build up the integral in three stages, compute integrals of step functions, and explain why the Dirichlet function is Lebesgue-integrable but not Riemann-integrable. The next and final section showcases the real payoff of this construction: convergence theorems that let you swap and under conditions Riemann could never tolerate.
Mark section complete →
References
- Garrity, T. (2002). All the Mathematics You Missed: But Need to Know for Graduate School. Cambridge University Press, ch. 12.
- Royden, H. L., Fitzpatrick, P. M. (2010). Real Analysis (4th ed.). Pearson, ch. 3-4.
- Folland, G. B. (1999). Real Analysis: Modern Techniques and Their Applications (2nd ed.). Wiley, ch. 2.
- Rudin, W. (1987). Real and Complex Analysis (3rd ed.). McGraw-Hill, ch. 1.
- Stein, E. M., Shakarchi, R. (2005). Real Analysis. Princeton UP, ch. 2.