Quant Memo
Advanced

Lebesgue Measure and Integration

A way of measuring the size of sets and adding things up by sorting them into piles of equal value rather than sweeping left to right. It is the integral that makes expectation work for any random variable, mixes jumps and densities in one formula, and survives limits that break the Riemann integral.

Prerequisites: Probability Spaces, Sigma-Algebras and Filtrations

You already know how to average things. Add up the values, divide by how many, or weight each value by its probability. So why does probability theory bother rebuilding the integral from scratch? Because the school version quietly assumes your random variable is tidy — either a short list of outcomes or a smooth density — and real ones are not. A stock return has a lump of probability at exactly zero on halted days and a spread of values otherwise. A limit of well-behaved approximations can be a monster. The Lebesgue integral is a single definition that handles all of it, and it is the reason E[X]E[X] means something for every random variable rather than for the two convenient cases.

Counting the coins

You are handed a bucket of mixed coins and asked for the total. There are two honest methods.

Method one: tip them into a line on the table and walk along it, adding whatever you meet. 5, then 5, then 50, then 1, then 20... This works, but you have to touch every coin in the order they happen to lie.

Method two: sort first. Make a pile of 1s, a pile of 5s, a pile of 20s, a pile of 50s. Count each pile. Multiply the value by the count. Add four numbers.

Method one is the Riemann integral: chop the horizontal axis into thin vertical strips and add up strip areas. Method two is the Lebesgue integral: chop the vertical axis into levels, and for each level ask "how big is the set of places where the function is around here?" Same answer for a tidy pile of coins. But if someone shuffles the coins on the table, method one has to start over and method two does not care at all — and that indifference to rearrangement is exactly the robustness probability needs.

Riemann: vertical strips Lebesgue: horizontal slabs slice the input slice the output
The same area computed two ways. Riemann asks "how tall is the function here?" at every location. Lebesgue asks "how much territory sits at this height?" — which needs a way to measure territory, and that is what a measure is for.

Measure: how big is a set?

Method two needs one new tool: a rule for the size of the pile. A measure μ\mu (the Greek letter mu) assigns a non-negative number to each set in a sigma-algebra, subject to two conditions:

μ()=0,μ ⁣(n=1An)=n=1μ(An)   for disjoint An.\mu(\emptyset) = 0, \qquad \mu\!\left( \bigcup_{n=1}^{\infty} A_n \right) = \sum_{n=1}^{\infty} \mu(A_n) \;\text{ for disjoint } A_n .

In words: the empty set has size zero, and if you break a set into non-overlapping pieces, the sizes add up — even for infinitely many pieces. On the real line, Lebesgue measure is the one that gives an interval its obvious length: μ([2,7])=5\mu([2, 7]) = 5. A probability measure PP is just a measure with P(Ω)=1P(\Omega) = 1.

Once you can measure sets, the integral of a simple function — one that takes finitely many values c1,,cmc_1, \dots, c_m on sets A1,,AmA_1, \dots, A_m — writes itself:

fdμ=k=1mckμ(Ak).\int f \, d\mu = \sum_{k=1}^{m} c_k \, \mu(A_k).

That is literally "value of the coin times size of the pile, summed over piles". Every other function is handled by squeezing it between simple functions from below and taking the limit, so this one line is the whole definition. Expectation is the special case where the measure is a probability:

E[X]=ΩXdP.E[X] = \int_{\Omega} X \, dP .

The expected value of XX is the integral of XX over all scenarios, weighting each scenario by its probability. Discrete sums and density integrals are not two different formulas — they are this one formula with two different measures.

Worked example 1: slicing horizontally, with a die

For a random variable XX that is never negative, Lebesgue's horizontal slicing gives the layer-cake formula:

E[X]=0P(X>x)dx.E[X] = \int_{0}^{\infty} P(X > x) \, dx .

In words: stack up, level by level, the probability of clearing that level. For a whole-number variable the integral becomes a sum: E[X]=k0P(X>k)E[X] = \sum_{k \ge 0} P(X > k).

Take a fair six-sided die and compute all six terms:

  • P(X>0)=6/6=1P(X > 0) = 6/6 = 1
  • P(X>1)=5/60.8333P(X > 1) = 5/6 \approx 0.8333
  • P(X>2)=4/60.6667P(X > 2) = 4/6 \approx 0.6667
  • P(X>3)=3/6=0.5P(X > 3) = 3/6 = 0.5
  • P(X>4)=2/60.3333P(X > 4) = 2/6 \approx 0.3333
  • P(X>5)=1/60.1667P(X > 5) = 1/6 \approx 0.1667
  • P(X>6)=0P(X > 6) = 0, and everything after is 0.

Add them: 1+0.8333+0.6667+0.5+0.3333+0.1667=3.51 + 0.8333 + 0.6667 + 0.5 + 0.3333 + 0.1667 = 3.5. Exactly the expected value you would get from the usual weighted average 16(1+2+3+4+5+6)=3.5\tfrac{1}{6}(1+2+3+4+5+6) = 3.5. The two methods agree, but the second one never mentioned an individual face — it only ever measured sets.

P(X > x) for a fair die — shaded area = E[X] 0 1 2 3 4 5 6 1 0 1 + 5/6 + 4/6 + 3/6 + 2/6 + 1/6 = 3.5
The layer-cake view of an expectation: six rectangles, each one unit wide, whose heights are the chances of clearing 0, 1, 2, 3, 4 and 5. Their total area is the mean.

Worked example 2: a set of measure zero

Here is the function that broke the old integral. On the interval [0,1][0,1], define f(x)=1f(x) = 1 if xx is a fraction (rational) and f(x)=0f(x) = 0 otherwise.

The Riemann integral fails outright. Take any thin strip: it contains both fractions and non-fractions, so the tallest point in the strip is 1 and the lowest is 0. The upper estimate is always 1, the lower estimate is always 0, and refining the strips never closes the gap.

Lebesgue's version asks a different question: how big is the set of fractions? Answer it directly. The fractions in [0,1][0,1] can be lined up in a list — 12,13,23,14,34,\tfrac{1}{2}, \tfrac{1}{3}, \tfrac{2}{3}, \tfrac{1}{4}, \tfrac{3}{4}, \dots — because they are countable. Pick a tolerance, say ε=0.001\varepsilon = 0.001. Cover the first fraction with an interval of length ε/2=0.0005\varepsilon/2 = 0.0005, the second with ε/4=0.00025\varepsilon/4 = 0.00025, the third with ε/8=0.000125\varepsilon/8 = 0.000125, and so on, halving each time. Every fraction is now covered, and the total length used is

0.0005+0.00025+0.000125+=0.001.0.0005 + 0.00025 + 0.000125 + \cdots = 0.001 .

So the fractions fit inside a cover of total length 0.0010.001. But ε\varepsilon was arbitrary: repeat with ε=109\varepsilon = 10^{-9} and they fit inside 10910^{-9}. A set that fits inside covers of every positive length has measure exactly 00. Therefore

01fdμ=1×μ(fractions)+0×μ(the rest)=1×0+0×1=0.\int_0^1 f \, d\mu = 1 \times \mu(\text{fractions}) + 0 \times \mu(\text{the rest}) = 1 \times 0 + 0 \times 1 = 0 .

Two piles, two sizes, done — with no limit of strips anywhere.

Lebesgue integration = sort by value, measure each pile, multiply and add. Riemann integration = sweep along the input. The switch is what lets one formula, E[X]=XdPE[X] = \int X \, dP, cover discrete outcomes, continuous densities, and everything in between.

What this means in practice

  • Mixed payoffs in one line. A capped position pays exactly 10 with probability 0.20.2 (the cap binds) and otherwise is uniform on [0,10][0,10]. There is no density at the cap, so a plain density integral cannot express this. The Lebesgue integral just adds the two pieces: E=0.2×10+0.8×5=2+4=6E = 0.2 \times 10 + 0.8 \times 5 = 2 + 4 = 6. Real payoffs — barriers, digitals, capped notes — are all of this shape.
  • Swapping limits and expectations. Monte Carlo, series expansions and estimator proofs constantly need E[limnXn]=limnE[Xn]E[\lim_n X_n] = \lim_n E[X_n]. That swap is illegal in general and is licensed by the monotone and dominated convergence theorems, which only exist inside the Lebesgue framework.
  • Densities are ratios of measures. "The density of XX" really means the Radon-Nikodym derivative of XX's distribution with respect to Lebesgue measure. Once you see that, changing to a risk-neutral measure stops looking like a trick.
  • Almost sure statements. "Converges almost surely", "unique up to a null set", "a.e. equal" all mean except on a set of measure zero. That phrase is everywhere in the theory of estimators and stochastic processes, and it is defined by the machinery above.

Measure zero does not mean empty, and probability zero does not mean impossible. The fractions are infinite — there are infinitely many between any two numbers — and their measure is still 0. Likewise, if a stock price is modelled continuously, the event "it closes at exactly 100.00" has probability 0, yet the price closes somewhere, and every particular somewhere had probability 0. Zero measure means negligible in the accounting sense, not forbidden. The reverse slip is just as common: an uncountable set can have measure zero too, so "uncountably many outcomes" never by itself implies positive probability.

When a problem looks awkward because a variable is part-lump, part-spread, stop trying to write a density. Split the expectation into the atoms plus the continuous part and add them — that is exactly what XdP\int X \, dP was built to let you do.

Related concepts

Practice in interviews

Further reading

  • Williams, Probability with Martingales (ch. 4-5)
  • Capinski & Kopp, Measure, Integral and Probability (ch. 2-4)
ShareTwitterLinkedIn