Level 0: Foundation
★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.Two ways to count coins
You have a pile of coins to total up. One way: pick them up in the order they lie and add each one’s value. Another: first sort them by value (all the 1s, all the 5s, all the 10s), count how many are in each pile, and add up value × count. You get the same answer, but the second way doesn’t care how messily the coins were scattered.
That second way is the Lebesgue integral. Instead of slicing the x-axis, it slices the heights: “how much of the ground is at least this high?” All it needs is a way to measure the size of a set. Probability is exactly such a measure: the size of an event is its chance.
Every expectation in robotics and AI (an expected cost, a loss averaged over data, a filter’s prediction) is a Lebesgue integral. The measure-theory vocabulary (“almost surely”, “measurable”, “density with respect to…”) appears in every paper on reinforcement learning, filtering and generative models. This page gives you the intuition to read it.
- 1. The Lebesgue integral slices…
- 2. In probability, the 'size' of an event is…
- 3. Totalling coins by value piles gives…
Level 1: Beginner
★★☆☆☆ Basic⏱ 20 minSecondary-school mathematics: arithmetic and elementary algebra.The three ingredients: (Ω, 𝓕, P)
- Sample space : every possible outcome (A4.1-1).
- σ-algebra : the collection of events you’re allowed to ask about. It must contain , and be closed under complements and countable unions. Think of it as the list of yes/no questions you can answer.
- Probability measure : assigns each event in a number in , with and countable additivity: for disjoint .
Why not allow every subset?
On a finite you can: take = all subsets. On , there is no way to assign a length to every subset that is countably additive and unchanged by shifting. Vitali (1905) built a non-measurable set. So we restrict to the Borel σ-algebra generated by intervals. Every set you will ever meet in engineering is in it.
Random variables and “almost surely”
A random variable is a measurable function , meaning for every , so its CDF makes sense. A null set has probability 0. A property holds almost surely (a.s.) if it fails only on a null set. For example, a uniform point on is irrational almost surely, even though rational outcomes exist.
- 1. A σ-algebra must be closed under complements and…
- 2. P(a uniform point on [0,1] is rational) =
- 3. 'Almost surely' means…
Level 2: Intermediate
★★★☆☆ Intermediate⏱ 45 minUndergraduate students and practising engineers.The Lebesgue integral in three steps
- Indicators. .
- Simple functions : . This is value × size of the level set.
- Non-negative : . Concretely, use , which increases to .
General . Then the expectation is just . One definition covers discrete, continuous and mixed variables.
A convenient consequence is the layer-cake formula: for ,
Why it beats Riemann
The Dirichlet function on has no Riemann integral: every strip contains both rationals and irrationals. Its Lebesgue integral is simply . More importantly, Lebesgue integrals commute with limits under mild conditions:
- Monotone convergence (MCT): .
- Dominated convergence (DCT): a.e. and with .
These are what justify swapping derivatives and expectations, , in every gradient-based learning algorithm.
Densities are Radon–Nikodym derivatives
If whenever (written ), there is a density with (Radon–Nikodym). An ordinary pdf is with respect to length. A PMF is the density with respect to counting measure. Importance sampling reweights by (Practice Code 5).
- 1. For X ≥ 0, E X equals…
- 2. The Lebesgue integral of 1 on the rationals in [0,1] is…
- 3. Swapping ∇ and E is justified by…
Level 3: Advanced
★★★★☆ Advanced⏱ 45 minGraduate level, with full derivations and proofs.Proving monotone convergence
Let . Monotonicity gives , and the limit exists.
- Fix a simple function. Take simple and . Let . These sets increase to , because wherever .
- Bound the integral. .
- Pass to the limit. By continuity of measure (from countable additivity), , so .
- Conclude. Let and take the sup over : . ∎
When limits and integrals don’t commute
Take . It tends to 0 at every point, yet for all . No integrable dominates all , since is not integrable. So the DCT doesn’t apply (Practice Code 4). Fatou’s lemma still gives the inequality .
Conditional expectation is projection onto information
For a sub-σ-algebra (the information you have), is the -measurable random variable with for all . For square-integrable , this is the orthogonal projection in (A3.5-5) onto the -measurable functions, and therefore the minimum-MSE predictor. When is generated by a partition, it’s the probability-weighted average over each cell.
Exercise 3.1: Show that a finite σ-algebra has 2^k events
The atoms (the minimal non-empty events) partition into cells. Every event is a union of atoms, and each of the subsets of atoms gives a different event.
- 1. f_n = n·1(0, 1/n) shows that…
- 2. E[X | 𝒢] is the orthogonal projection onto…
- 3. A σ-algebra with 3 atoms has how many events?
Level 4: Expert
★★★★★ Expert⏱ 40 minResearchers: original papers and open problems.Information, filtrations and quantized sensors
A sensor that reports only which of 4 range bins an object is in gives you a σ-algebra with 4 atoms. A finer sensor gives a finer σ-algebra. Your best estimate is , the average over the bin, and finer information can only lower its mean-squared error. A growing sequence is a filtration, the formal model of information arriving over time. It is the language of martingales, stopping times and optimal filtering (Williams, 1991). The tower property is what makes recursive filters consistent.
Measure theory in AI, robotics and aerospace
- Reinforcement learning on continuous spaces needs measurable policies and transition kernels. Without them, the value function of a continuous-state MDP may not even be well-defined (Bertsekas and Shreve, 1978).
- Normalizing flows and diffusion models are statements about how measures push forward under maps and how densities with respect to Lebesgue measure change (A4.3-2; Papamakarios et al., 2021).
- Off-policy evaluation and importance sampling use Radon–Nikodym derivatives . Estimates blow up when is not absolutely continuous with respect to the behaviour policy , which is why coverage assumptions matter.
- Rare-event estimation for spacecraft (collision probabilities around 1e-5 and below) relies on change of measure. Naive Monte Carlo almost never sees the event (Rubino and Tuffin, 2009).
- Stochastic calculus for estimation and control (A4.4-5) is built on filtrations and conditional expectations.
References
- D. Williams (1991). Probability with Martingales. Cambridge University Press.
- R. Durrett (2019). Probability: Theory and Examples, 5th ed. Cambridge University Press.
- P. Billingsley (1995). Probability and Measure, 3rd ed. Wiley.
- T. Tao (2011). An Introduction to Measure Theory. AMS.
- H. Lebesgue (1902). “Intégrale, longueur, aire.” Annali di Matematica, 7.
- G. Vitali (1905). Sul problema della misura dei gruppi di punti di una retta. Bologna.
- D. Bertsekas, S. Shreve (1978). Stochastic Optimal Control: The Discrete-Time Case. Academic Press.
- G. Papamakarios et al. (2021). “Normalizing flows for probabilistic modeling and inference.” JMLR, 22(57).
- G. Rubino, B. Tuffin, eds. (2009). Rare Event Simulation Using Monte Carlo Methods. Wiley.
- A. N. Kolmogorov (1933). Grundbegriffe der Wahrscheinlichkeitsrechnung. Springer.