Measures

Two pages in, and we still haven't measured anything. We built σ-algebras, the collections of sets we're allowed to ask about, and measurable functions, the functions whose level sets land in them. That was the room. This page puts a scale in it: a rule that hands every measurable set a size. Get the rules right and everything we want, lengths, areas, probabilities, counts, comes out as a special case.

Countable Additivity

On σ-Algebras & Measurable Functions, a σ-algebra had to be closed under countable unions, not just finite ones. Here's the payoff: a measure gets to add up countably many pieces, and the σ-algebra guarantees the union is still a set it can measure.

What should "size" obey? Mostly one thing: if you cut a set into pieces that don't overlap, the size of the whole is the sum of the sizes of the pieces. The question is how many pieces. Finitely many is too weak (we'll see a set function that only manages finitely many, and it's useless). Uncountably many is too strong (every point of $[0, 1]$ should have length $0$). Countably many is the sweet spot.

Let $(X, \mathcal{M})$ be a measurable space. A set function $\mu\colon \mathcal{M} \to [0, \infty]$ is countably additive if, whenever $A_1, A_2, \ldots \in \mathcal{M}$ are pairwise disjoint ($A_i \cap A_j = \emptyset$ for all $i \neq j$), $$\mu\left(\bigcup_{i=1}^{\infty} A_i\right) = \sum_{i=1}^{\infty} \mu(A_i).$$

The sum on the right is a series of numbers in $[0, \infty]$, so it always makes sense: it either converges or it's $\infty$, and the order of the terms doesn't matter. Here it is with pieces of sizes $\frac{1}{2}, \frac{1}{4}, \frac{1}{8}, \ldots$ filling up a set of size $1$.

No piece fills the set by itself, and no finite batch of them does either. Only all of them together, and countable additivity is exactly the rule that says the sizes add up anyway. One more condition, and that's the whole definition.

A positive measure on a measurable space $(X, \mathcal{M})$ is a countably additive set function $\mu\colon \mathcal{M} \to [0, \infty]$ with $\mu(A) < \infty$ for at least one $A \in \mathcal{M}$.

That last clause looks fussy. It's there to rule out exactly one set function, $\mu(A) = \infty$ for every $A$, which is countably additive (both sides are always $\infty$) but tells you nothing. We'll see in a minute that the clause forces $\mu(\emptyset) = 0$. Once you have a measure, the space carries it around with it.

$\mu \equiv \infty$: generous, perfectly consistent, and banned. The one rule is that something has to be finite.

A measure space is a triple $(X, \mathcal{M}, \mu)$, where $(X, \mathcal{M})$ is a measurable space and $\mu$ is a positive measure on $\mathcal{M}$.

From here on, "measure" means positive measure. (Complex measures, which can be negative or complex, show up much later in the course.) The first example is the one you already know without knowing it: counting.

Let $X$ be any set and $\mathcal{M} = \mathcal{P}(X)$. For $E \subseteq X$, let $\mu(E)$ be the number of points in $E$, with $\mu(E) = \infty$ when $E$ is infinite. Show that $\mu$ is a positive measure. It is called the counting measure on $X$.


$\mu(\emptyset) = 0 < \infty$, so some set has finite measure. Now let $A_1, A_2, \ldots$ be disjoint and $A = \bigcup A_i$.

If only finitely many $A_i$ are nonempty and each is finite, then $A$ is finite, and since no point is in two of the pieces, counting the points of $A$ is the same as counting each piece and adding: $\mu(A) = \sum \mu(A_i)$.

Otherwise, either some $A_i$ is infinite or infinitely many are nonempty. Either way $A$ is infinite, so $\mu(A) = \infty$, and the sum is $\infty$ too (it has an $\infty$ term, or infinitely many terms that are at least $1$). So $\mu(A) = \sum \mu(A_i)$ in every case.

Counting treats every point the same. The opposite extreme puts all the mass on one point and none anywhere else.

Let $X$ be a set and $x_0 \in X$. The Dirac measure at $x_0$ is $\delta_{x_0}\colon \mathcal{P}(X) \to [0, \infty]$, $$\delta_{x_0}(E) = \begin{cases} 1, & x_0 \in E, \\ 0, & x_0 \notin E. \end{cases}$$

It's a measure: in a disjoint sequence, $x_0$ lies in at most one piece, so the sum $\sum \delta_{x_0}(A_i)$ has at most one $1$ in it, and that $1$ is there exactly when $x_0$ is in the union. Mix Dirac measures with weights and you get every measure on a finite set.

On $X = \{1, 2, 3, 4, 5\}$ with $\mathcal{P}(X)$, let $\mu = 2\delta_1 + 3\delta_2 + \delta_4$, meaning $\mu(E) = 2\delta_1(E) + 3\delta_2(E) + \delta_4(E)$. Find $\mu(\{1, 4\})$, $\mu(\{3, 5\})$, and $\mu(X)$, and check that $\mu$ is a measure.


Each $\delta$ asks whether its point is in the set. So $\mu(E)$ adds the weights of the points in $E$: point $1$ weighs $2$, point $2$ weighs $3$, point $4$ weighs $1$, and points $3$ and $5$ weigh nothing.

$\mu(\{1, 4\}) = 2 + 1 = 3$, $\mu(\{3, 5\}) = 0$, and $\mu(X) = 2 + 3 + 1 = 6$.

It's a measure because a sum of measures with nonnegative weights is a measure: add the countable additivity of $\delta_1$, $\delta_2$, and $\delta_4$ term by term. (That's the first exercise below.) Notice the nonempty set $\{3, 5\}$ with measure $0$. Measure zero does not mean empty.

Now the warning shots. Here are two set functions that look like measures and aren't, and each one fails for a different reason. The second one needs a name for the weaker rule it does obey: $\mu$ is finitely additive if $\mu\left(\bigcup_{i=1}^{n} A_i\right) = \sum_{i=1}^{n} \mu(A_i)$ for every finite list of pairwise disjoint sets in $\mathcal{M}$.

On $\mathcal{P}(\mathbb{N})$, which of these are positive measures?

(a) $\mu(A) = \infty$ for every $A$.   (b) $\nu(A) = 0$ if $A$ is finite and $\nu(A) = \infty$ if $A$ is infinite.


(a) It's countably additive: for any disjoint $A_1, A_2, \ldots$, both $\mu\left(\bigcup A_i\right)$ and $\sum \mu(A_i)$ are $\infty$. But no set has finite measure, so it is not a positive measure.

(b) It's finitely additive: a finite union of sets is infinite exactly when one of them is, so both sides are $\infty$ in that case and $0$ otherwise. But it is not countably additive: $\mathbb{N} = \{1\} \cup \{2\} \cup \cdots$ is a disjoint union of finite sets, so $$\nu(\mathbb{N}) = \infty \neq 0 = \nu(\{1\}) + \nu(\{2\}) + \cdots.$$ So $\nu$ is not a positive measure either.

The trick in (b) is the one to remember: test a set function on a countable union of small pieces, and countable additivity is where fakes get caught. Try it on a finite set first. Put weights on the points and test the additivity rule yourself.

Build a Measure

The second mission is the interesting one: $\mu(A \cup B) = \mu(A) + \mu(B)$ can hold for sets that overlap, as long as the overlap weighs nothing. Additivity only promises the formula for disjoint sets; it never says the converse. Now go hunting. Each of these set functions is a fake, and your job is to find two disjoint sets that prove it.

Break Additivity

Two points usually do it. A fake almost always gives itself away on the smallest disjoint pair you can find. Now pick the real measure out of a lineup.

Loading practice engine...

The point-mass example used a fact we haven't proved: you can add measures together and scale them, and you get a measure back. You can also cut a measure down to one set. Both are quick, and both get used constantly.

Let $(X, \mathcal{M}, \mu)$ be a measure space.

(a) Fix $E \in \mathcal{M}$ and define $\mu_E(A) = \mu(A \cap E)$ for $A \in \mathcal{M}$. Show that $\mu_E$ is a positive measure on $\mathcal{M}$.

(b) Let $\mu_1, \mu_2, \ldots$ be positive measures on $\mathcal{M}$ and $c_1, c_2, \ldots \in [0, \infty)$. Show that $\nu(A) = \sum_{k=1}^{\infty} c_k \, \mu_k(A)$ is a positive measure on $\mathcal{M}$ (with $0 \cdot \infty = 0$).

Show proof

Proof. We'll use $\mu(\emptyset) = 0$, proved in the next section; the proof there doesn't use this exercise.

(a) $\mu_E$ takes values in $[0, \infty]$, and $\mu_E(\emptyset) = \mu(\emptyset) = 0 < \infty$. If $A_1, A_2, \ldots \in \mathcal{M}$ are disjoint, so are $A_1 \cap E, A_2 \cap E, \ldots$, all in $\mathcal{M}$, and their union is $\left(\bigcup A_i\right) \cap E$. So $$\mu_E\left(\bigcup A_i\right) = \mu\left(\bigcup (A_i \cap E)\right) = \sum \mu(A_i \cap E) = \sum \mu_E(A_i).$$

(b) $\nu(\emptyset) = \sum c_k \cdot 0 = 0 < \infty$. If $A_1, A_2, \ldots$ are disjoint, then $$\nu\left(\bigcup_n A_n\right) = \sum_k c_k \sum_n \mu_k(A_n) = \sum_k \sum_n c_k \, \mu_k(A_n) = \sum_n \sum_k c_k \, \mu_k(A_n) = \sum_n \nu(A_n).$$ Multiplying a series in $[0, \infty]$ through by $c_k \ge 0$ is fine term by term, and swapping the two sums is allowed because every term is nonnegative: both orders give the sup of the finite partial sums over all finite sets of pairs $(k, n)$. $\blacksquare$

Elementary Properties

Countable additivity is one rule, and it's enough to get every property "size" ought to have. Here are the first three. Watch how the finite set from the definition gets used, and how often the move is "pad the list with empty sets".

Let $(X, \mathcal{M}, \mu)$ be a measure space. Then:

(a) $\mu(\emptyset) = 0$.

(b) Finite additivity: if $A_1, \ldots, A_n \in \mathcal{M}$ are pairwise disjoint, then $\mu(A_1 \cup \cdots \cup A_n) = \mu(A_1) + \cdots + \mu(A_n)$.

(c) Monotonicity: if $A, B \in \mathcal{M}$ and $A \subseteq B$, then $\mu(A) \le \mu(B)$.

Show proof

Proof. (a) Pick $A \in \mathcal{M}$ with $\mu(A) < \infty$. Let $A_1 = A$ and $A_i = \emptyset$ for $i \ge 2$. These are pairwise disjoint with union $A$, so $$\mu(A) = \mu(A) + \sum_{i=2}^{\infty} \mu(\emptyset).$$ Since $\mu(A)$ is a finite number, subtract it from both sides: $\sum_{i \ge 2} \mu(\emptyset) = 0$. A series of copies of one number in $[0, \infty]$ is $0$ only if that number is $0$, so $\mu(\emptyset) = 0$.

(b) Set $A_i = \emptyset$ for $i > n$. The whole sequence is pairwise disjoint and has the same union, so by countable additivity and (a), $$\mu(A_1 \cup \cdots \cup A_n) = \sum_{i=1}^{\infty} \mu(A_i) = \sum_{i=1}^{n} \mu(A_i) + 0 + 0 + \cdots.$$

(c) $B \setminus A = B \cap A^c \in \mathcal{M}$, and $B$ is the disjoint union of $A$ and $B \setminus A$. By (b), $\mu(B) = \mu(A) + \mu(B \setminus A) \ge \mu(A)$, since $\mu(B \setminus A) \ge 0$. $\blacksquare$

Notice that (a) really needed the finite set: with $\mu(A) = \infty$, the equation $\infty = \infty + \sum \mu(\emptyset)$ says nothing about $\mu(\emptyset)$. That's why $\mu \equiv \infty$ had to be banned by hand. The proof of (c) also gives a formula, and it's worth stating with its hypothesis in plain sight.

If $A, B \in \mathcal{M}$, $A \subseteq B$, and $\mu(A) < \infty$, then $\mu(B \setminus A) = \mu(B) - \mu(A)$.

Show proof

Proof. As in (c), $\mu(B) = \mu(A) + \mu(B \setminus A)$. The number $\mu(A)$ is finite, so it can be subtracted from both sides (if $\mu(B) = \infty$, both sides of the result are $\infty$). $\blacksquare$

The hypothesis $\mu(A) < \infty$ is not decoration.

Never subtract infinities. Under counting measure on $\mathbb{N}$, let $A$ be the even numbers and $B = \mathbb{N}$. Then $\mu(A) = \mu(B) = \infty$, and "$\mu(B) - \mu(A) = 0$" would say the odd numbers have measure $0$. They have measure $\infty$. Whenever you're about to subtract, check that the thing you subtract is finite. If it isn't, add instead: $\mu(B) = \mu(A) + \mu(B \setminus A)$ is always true.

Here are all three properties working on one example, with every measure finite so subtraction is safe.

In a measure space, $\mu(A) = 7$, $\mu(B) = 5$, and $\mu(A \cap B) = 2$. Find $\mu(A \setminus B)$, $\mu(A \cup B)$, and the possible values of $\mu(A \cap B^c \cap C)$ for a measurable $C$.


$A \cap B \subseteq A$ and $\mu(A \cap B) < \infty$, and $A \setminus B = A \setminus (A \cap B)$, so $\mu(A \setminus B) = 7 - 2 = 5$.

$A \cup B$ is the disjoint union of $A \setminus B$ and $B$, so $\mu(A \cup B) = 5 + 5 = 10$.

$A \cap B^c \cap C \subseteq A \setminus B$, so by monotonicity its measure is somewhere in $[0, 5]$. Without knowing $C$, that's all we can say: $C = \emptyset$ gives $0$, and $C = X$ gives $5$.

The union computation is the inclusion–exclusion formula in disguise. Here's the version that never subtracts, so it holds even with infinite measures.

Show that for all $A, B \in \mathcal{M}$, $$\mu(A \cup B) + \mu(A \cap B) = \mu(A) + \mu(B).$$ Deduce that $\mu(A \cup B) = \mu(A) + \mu(B) - \mu(A \cap B)$ when $\mu(A \cap B) < \infty$.

Show proof

Proof. Cut everything into the three disjoint measurable pieces $P = A \setminus B$, $Q = A \cap B$, and $R = B \setminus A$. Then $A \cup B = P \cup Q \cup R$, $A = P \cup Q$, and $B = R \cup Q$, all disjoint unions. By finite additivity, $$\mu(A \cup B) + \mu(A \cap B) = \mu(P) + \mu(Q) + \mu(R) + \mu(Q) = \big(\mu(P) + \mu(Q)\big) + \big(\mu(R) + \mu(Q)\big) = \mu(A) + \mu(B).$$ Only additions in $[0, \infty]$ were used, so this holds with infinite values too. If $\mu(A \cap B) < \infty$, subtract it from both sides. $\blacksquare$

One more property, and this one is about countably many sets that are allowed to overlap. Overlaps get counted more than once on the right, so we can only expect an inequality.

If $A_1, A_2, \ldots \in \mathcal{M}$, then $$\mu\left(\bigcup_{n=1}^{\infty} A_n\right) \le \sum_{n=1}^{\infty} \mu(A_n).$$

Show proof

Proof. Make the sets disjoint by removing what came before. Let $B_1 = A_1$ and, for $n \ge 2$, $$B_n = A_n \setminus (A_1 \cup \cdots \cup A_{n-1}).$$ Each $B_n$ is in $\mathcal{M}$, being built from finitely many sets of $\mathcal{M}$ with unions and complements. They are pairwise disjoint: if $m < n$, then $B_m \subseteq A_m$ while $B_n$ misses $A_m$. Each $B_n \subseteq A_n$. And $\bigcup B_n = \bigcup A_n$: a point of $\bigcup A_n$ has a first index $n$ with $x \in A_n$, and then $x \in B_n$. So by countable additivity and monotonicity, $$\mu\left(\bigcup A_n\right) = \mu\left(\bigcup B_n\right) = \sum \mu(B_n) \le \sum \mu(A_n).$$ $\blacksquare$

The inequality is usually strict, because the right side pays for every overlap again. Here's a case where you can see how much extra it pays.

On $\mathcal{P}(\mathbb{N})$, let $\mu(\{k\}) = 2^{-k}$, and for $n \ge 2$ let $A_n = \{n, 2n, 3n, \ldots\}$, the multiples of $n$. Compare $\mu\left(\bigcup_{n \ge 2} A_n\right)$ with $\sum_{n \ge 2} \mu(A_n)$.


Every $k \ge 2$ is a multiple of itself, and $1$ is a multiple of no $n \ge 2$, so $\bigcup_{n \ge 2} A_n = \{2, 3, 4, \ldots\}$, with measure $1 - \frac{1}{2} = \frac{1}{2}$.

Each $A_n$ is a geometric series: $\mu(A_n) = 2^{-n} + 2^{-2n} + \cdots = \frac{2^{-n}}{1 - 2^{-n}} = \frac{1}{2^n - 1}$. So the sum is $\frac{1}{3} + \frac{1}{7} + \frac{1}{15} + \frac{1}{31} + \cdots$, already $\frac{1}{3} + \frac{1}{7} = \frac{10}{21} \approx 0.476$ after two terms and about $0.607$ in all. That's more than $\frac{1}{2}$: the sum pays for $4$ twice (in $A_2$ and $A_4$), for $6$ three times (in $A_2$, $A_3$, and $A_6$), and in general for $k$ once per divisor of $k$ bigger than $1$.

The most-used special case: countably many sets of measure $0$ have a union of measure $0$, since the sum on the right is $0 + 0 + \cdots$. Now put the properties to work. Each of these comes down to cutting a set into disjoint pieces and adding.

Loading practice engine...

Continuity From Below and Above

Here's what countable additivity really buys: measures commute with limits of nested sets. If sets grow, their measures grow toward the measure of the union. That's how the Lebesgue integral will get its convergence theorems on the next page.

If $A_1 \subseteq A_2 \subseteq \cdots$ are sets in $\mathcal{M}$, then $$\mu\left(\bigcup_{n=1}^{\infty} A_n\right) = \lim_{n \to \infty} \mu(A_n).$$

Show proof

Proof. Peel the sets into rings. Let $A_0 = \emptyset$ and $B_n = A_n \setminus A_{n-1}$ for $n \ge 1$. The $B_n$ are in $\mathcal{M}$ and pairwise disjoint (if $m < n$, then $B_m \subseteq A_m \subseteq A_{n-1}$, which $B_n$ misses). Since the $A_n$ are nested, $A_n = B_1 \cup \cdots \cup B_n$, a disjoint union, and $\bigcup A_n = \bigcup B_n$. By countable and finite additivity, $$\mu\left(\bigcup A_n\right) = \sum_{i=1}^{\infty} \mu(B_i) = \lim_{n \to \infty} \sum_{i=1}^{n} \mu(B_i) = \lim_{n \to \infty} \mu(A_n).$$ $\blacksquare$

No finiteness needed, and the limit can be $\infty$. Here's the proof as a picture: the sets grow, and each new ring $B_n$ adds its measure to the running total.

Let's put numbers on that picture.

On $\mathcal{P}(\mathbb{N})$, let $\mu(\{k\}) = 2^{-k}$ and $A_n = \{1, \ldots, n\}$. Find $\mu(A_n)$ and $\lim \mu(A_n)$, and check the answer against continuity from below.


$\mu(A_n) = \frac{1}{2} + \frac{1}{4} + \cdots + \frac{1}{2^n} = 1 - \frac{1}{2^n}$, which tends to $1$.

The $A_n$ increase to $\mathbb{N}$, and $\mu(\mathbb{N}) = \sum_{k=1}^{\infty} 2^{-k} = 1$. The two agree, as continuity from below says they must. The rings are the single points $B_n = \{n\}$.

Shrinking sets are the mirror image, with one catch.

If $A_1 \supseteq A_2 \supseteq \cdots$ are sets in $\mathcal{M}$ and $\mu(A_k) < \infty$ for some $k$, then $$\mu\left(\bigcap_{n=1}^{\infty} A_n\right) = \lim_{n \to \infty} \mu(A_n).$$

Show proof

Proof. Turn shrinking into growing by looking at what's been removed. For $n \ge k$ let $C_n = A_k \setminus A_n$. Since the $A_n$ decrease, the $C_n$ increase, and their union is $A_k \setminus \bigcap_{n \ge k} A_n = A_k \setminus \bigcap_{n} A_n$ (the sets before $A_k$ contain $A_k$, so leaving them out of the intersection changes nothing).

Every set here sits inside $A_k$, which has finite measure, so the difference formula applies: $\mu(C_n) = \mu(A_k) - \mu(A_n)$ and $\mu\left(A_k \setminus \bigcap A_n\right) = \mu(A_k) - \mu\left(\bigcap A_n\right)$. Continuity from below on the $C_n$ gives $$\mu(A_k) - \mu(A_n) \longrightarrow \mu(A_k) - \mu\left(\bigcap A_n\right).$$ Subtract the finite number $\mu(A_k)$: $\mu(A_n) \to \mu\left(\bigcap A_n\right)$. $\blacksquare$

The finite set was used twice, both times to subtract. Drop it and the theorem fails, and the counterexample is about as simple as they come.

Under counting measure on $\mathbb{N}$, let $A_n = \{n, n + 1, n + 2, \ldots\}$. Compare $\lim \mu(A_n)$ with $\mu\left(\bigcap A_n\right)$. Then redo it with $\mu(\{k\}) = 2^{-k}$.


The $A_n$ are nested and decreasing. No number is in all of them ($k \notin A_{k+1}$), so $\bigcap A_n = \emptyset$, with measure $0$. But every $A_n$ is infinite, so $\mu(A_n) = \infty$ for every $n$, and $\lim \mu(A_n) = \infty \neq 0$. No $A_n$ has finite measure, so the theorem doesn't apply, and it really does fail.

With $\mu(\{k\}) = 2^{-k}$, every set has finite measure: $\mu(A_n) = 2^{-n} + 2^{-n-1} + \cdots = 2^{1-n} \to 0 = \mu(\emptyset)$. Same sets, a finite measure, and the theorem works.

Here are both versions running side by side. The sets are the same; only the measure changes.

Every point of $[0, 1]$ has length $0$. So add them all up, and $[0, 1]$ has length... $0$. Thanks, uncountable sums. Very cool.

The tail slides off to infinity and leaves nothing behind, but under counting measure the measure never comes down to meet it. Now you predict. Pick a shrinking sequence and a measure, call the limit, and see if continuity from above backs you up.

From Above

What decides it is whether the tails have finite measure. Here that's one dial: put mass $k^{-p}$ on each point $k$ and slide $p$. When $p \le 1$ the tails are infinite and continuity from above breaks; past $p = 1$ they shrink to $0$.

Tail Weights

The boundary at $p = 1$ is the harmonic series: $\sum \frac{1}{k}$ diverges, so every tail of it is infinite. Now compute some limits. Before you do, ask which theorem you're using, and whether its hypothesis holds.

Loading practice engine...

Continuity from below came straight out of countable additivity. It turns out to be the whole difference between finite and countable additivity, which explains why the set function $\nu$ above was a fake.

Let $\mu\colon \mathcal{M} \to [0, \infty]$ be finitely additive with $\mu(\emptyset) = 0$, and suppose $\mu\left(\bigcup A_n\right) = \lim \mu(A_n)$ for every increasing sequence $A_1 \subseteq A_2 \subseteq \cdots$ in $\mathcal{M}$. Show that $\mu$ is countably additive. Which increasing sequence does $\nu$ (0 on finite sets, $\infty$ on infinite ones) get wrong?

Show proof

Proof. Let $A_1, A_2, \ldots \in \mathcal{M}$ be pairwise disjoint, and let $S_n = A_1 \cup \cdots \cup A_n$. The $S_n$ increase, and their union is $\bigcup A_i$. By the hypothesis and then finite additivity, $$\mu\left(\bigcup_{i=1}^{\infty} A_i\right) = \lim_{n \to \infty} \mu(S_n) = \lim_{n \to \infty} \sum_{i=1}^{n} \mu(A_i) = \sum_{i=1}^{\infty} \mu(A_i).$$

For $\nu$, take $S_n = \{1, \ldots, n\}$. Each $\nu(S_n) = 0$, so the limit is $0$, but the union is $\mathbb{N}$ and $\nu(\mathbb{N}) = \infty$. $\blacksquare$

Almost Everywhere

Sets of measure $0$ are invisible to a measure. Change a function on one, and nothing a measure can detect changes. That idea is so useful it gets its own vocabulary.

Let $(X, \mathcal{M}, \mu)$ be a measure space. A set $N \in \mathcal{M}$ with $\mu(N) = 0$ is a null set.

Remember that a null set needn't be empty: $\{3, 5\}$ was null for the point masses above. Now let a statement fail on a null set and call it true anyway.

Let $(X, \mathcal{M}, \mu)$ be a measure space and $E \in \mathcal{M}$. A property $P$ holds almost everywhere on $E$ (with respect to $\mu$) if there is a null set $N \subseteq E$ such that $P$ holds at every point of $E \setminus N$. We write "$\mu$-a.e." or just "a.e."

From now on, a.e. is fine; it's standard. What "almost everywhere" means depends completely on the measure, so let's see two extremes.

So I can be wrong on a set of measure zero and still get full credit? Putting that on my next exam.

Let $f, g\colon X \to \mathbb{R}$. What does "$f = g$ a.e." mean (a) under counting measure on $\mathcal{P}(X)$, and (b) under $\delta_{x_0}$ on $\mathcal{P}(X)$?


(a) Under counting measure, the only null set is $\emptyset$. So "$f = g$ outside a null set" means $f = g$ everywhere. Almost everywhere is just everywhere.

(b) Under $\delta_{x_0}$, a set is null exactly when it misses $x_0$. So $f = g$ a.e. exactly when $f(x_0) = g(x_0)$: take $N = \{f \neq g\}$, which misses $x_0$. Under $\delta_0$ on $\mathbb{R}$, the functions $\chi_{\mathbb{Q}}$ and $1$ are equal a.e., since $0 \in \mathbb{Q}$, even though they disagree at every irrational number.

The most common use: two functions that agree except on a null set.

For measurable $f$ and $g$, the set where they disagree is itself measurable (it's $\{f \neq g\}$, the complement of the set $\{f = g\}$ from the σ-algebras page), so "$f = g$ a.e." just says $\mu(\{f \neq g\}) = 0$. We write $f \sim g$, and the notation is earned: it's an equivalence relation.

Let $f, g, h\colon X \to [-\infty, \infty]$ be measurable, and write $f \sim g$ when $\mu(\{f \neq g\}) = 0$. Show that $\sim$ is an equivalence relation.

Show proof

Proof. Every set $\{f \neq g\}$ is measurable: its complement $\{f = g\}$ is, by the last exercise on the σ-Algebras page.

Reflexive: $\{f \neq f\} = \emptyset$, which has measure $0$. Symmetric: $\{f \neq g\} = \{g \neq f\}$.

Transitive: if $f(x) \neq h(x)$, then $f(x) \neq g(x)$ or $g(x) \neq h(x)$, so $\{f \neq h\} \subseteq \{f \neq g\} \cup \{g \neq h\}$. If $f \sim g$ and $g \sim h$, monotonicity and subadditivity give $$\mu(\{f \neq h\}) \le \mu(\{f \neq g\}) + \mu(\{g \neq h\}) = 0 + 0 = 0.$$ So $f \sim h$. $\blacksquare$

One subtlety in the definition is worth a careful look, because it's exactly what the next section fixes.

The definition of a.e. asks for a measurable null set $N$ that contains every point where $P$ fails. It doesn't ask the failure set itself to be measurable, and it might not be. A property can hold a.e. while the set where it fails isn't in $\mathcal{M}$ at all. Complete measures, coming up next, are the ones where that can't happen.

Now try it. Drag the values of $g$ and watch which changes the measure can see.

Equal Almost Everywhere

Changes on the gray, massless points are free, and a change anywhere else costs the mass of that point. Your turn: pick the function the measure can't tell apart from $f$.

Loading practice engine...

On the Lebesgue Integral page, integrals turn out to be blind to null sets: if $f = g$ a.e., then $\int_E f \, d\mu = \int_E g \, d\mu$ for every measurable $E$. That's why functions that agree a.e. get treated as the same function later in the course.

Complete Measures and the Completion

If $N$ has measure $0$ and $F \subseteq N$, any reasonable notion of size says $F$ has measure $0$ too. The trouble is that $F$ might not be in $\mathcal{M}$, and then $\mu(F)$ isn't even defined. Measures where this never happens get a name.

A measure $\mu$ on $(X, \mathcal{M})$ is complete if every subset of a null set is in $\mathcal{M}$: whenever $E \in \mathcal{M}$, $\mu(E) = 0$, and $F \subseteq E$, we have $F \in \mathcal{M}$.

Any measure on all of $\mathcal{P}(X)$ is complete, since every subset is already in. So incompleteness needs a σ-algebra with gaps in it. Here's the smallest kind.

Let $X = \{1, 2, 3\}$, $\mathcal{M} = \{\emptyset, \{1\}, \{2, 3\}, X\}$, and $\mu = \delta_1$ restricted to $\mathcal{M}$. Is $\mu$ complete?


$\mathcal{M}$ is a σ-algebra (the one with atoms $\{1\}$ and $\{2, 3\}$), and $\mu(\{2, 3\}) = 0$, so $\{2, 3\}$ is a null set. Its subset $\{2\}$ is not in $\mathcal{M}$. So $\mu$ is not complete.

Notice the trouble this causes: $\chi_{\{2\}}$ equals $0$ almost everywhere (they differ only inside the null set $\{2, 3\}$), but $\chi_{\{2\}}$ isn't measurable, since $\{2\} \notin \mathcal{M}$.

The fix is to throw in every set the measure "should" be able to measure: anything squeezed between two measurable sets whose difference is null. The theorem says this works, and nothing breaks.

Let $(X, \mathcal{M}, \mu)$ be a measure space. Let $\overline{\mathcal{M}}$ be the collection of all $E \subseteq X$ for which there are $A, B \in \mathcal{M}$ with $$A \subseteq E \subseteq B \quad \text{and} \quad \mu(B \setminus A) = 0,$$ and for such $E$ put $\overline{\mu}(E) = \mu(A)$. Then $\overline{\mathcal{M}}$ is a σ-algebra containing $\mathcal{M}$, $\overline{\mu}$ is a well-defined positive measure on $\overline{\mathcal{M}}$ that agrees with $\mu$ on $\mathcal{M}$, and $\overline{\mu}$ is complete. The measure space $(X, \overline{\mathcal{M}}, \overline{\mu})$ is the completion of $(X, \mathcal{M}, \mu)$.

Show proof

Step 0: $\mathcal{M} \subseteq \overline{\mathcal{M}}$. For $E \in \mathcal{M}$ take $A = B = E$; then $\mu(B \setminus A) = \mu(\emptyset) = 0$, and $\overline{\mu}(E) = \mu(E)$.

Step 1: $\overline{\mu}$ is well defined, that is, $\overline{\mu}(E)$ depends only on $E$, not on the choice of $A$. Suppose $A \subseteq E \subseteq B$ and $A' \subseteq E \subseteq B'$, both with null gaps. Since $A \subseteq E \subseteq B'$, we get $A \setminus A' \subseteq B' \setminus A'$, so $\mu(A \setminus A') = 0$ by monotonicity. In the same way $\mu(A' \setminus A) = 0$. Then $$\mu(A) = \mu(A \cap A') + \mu(A \setminus A') = \mu(A \cap A') = \mu(A \cap A') + \mu(A' \setminus A) = \mu(A').$$

Step 2: $\overline{\mathcal{M}}$ is a σ-algebra. $X \in \mathcal{M} \subseteq \overline{\mathcal{M}}$. If $A \subseteq E \subseteq B$ with $\mu(B \setminus A) = 0$, then $B^c \subseteq E^c \subseteq A^c$, and $A^c \setminus B^c = A^c \cap B = B \setminus A$ is null, so $E^c \in \overline{\mathcal{M}}$. If $A_n \subseteq E_n \subseteq B_n$ with $\mu(B_n \setminus A_n) = 0$ for each $n$, put $A = \bigcup A_n$ and $B = \bigcup B_n$, both in $\mathcal{M}$. Then $A \subseteq \bigcup E_n \subseteq B$, and a point of $B \setminus A$ lies in some $B_n$ but in no $A_m$, so $B \setminus A \subseteq \bigcup (B_n \setminus A_n)$. By subadditivity, $$\mu(B \setminus A) \le \sum_{n} \mu(B_n \setminus A_n) = 0,$$ so $\bigcup E_n \in \overline{\mathcal{M}}$.

Step 3: $\overline{\mu}$ is a positive measure. $\overline{\mu}(\emptyset) = 0 < \infty$. Let $E_1, E_2, \ldots \in \overline{\mathcal{M}}$ be pairwise disjoint, with $A_n \subseteq E_n \subseteq B_n$ as before. Then the $A_n$ are pairwise disjoint too, since $A_n \subseteq E_n$. By Step 2, $A = \bigcup A_n$ and $B = \bigcup B_n$ sandwich $\bigcup E_n$ with a null gap, so by the definition of $\overline{\mu}$ and countable additivity of $\mu$, $$\overline{\mu}\left(\bigcup E_n\right) = \mu\left(\bigcup A_n\right) = \sum \mu(A_n) = \sum \overline{\mu}(E_n).$$

Step 4: $\overline{\mu}$ is complete. Let $E \in \overline{\mathcal{M}}$ with $\overline{\mu}(E) = 0$, sandwiched as $A \subseteq E \subseteq B$. Then $\mu(B) = \mu(A) + \mu(B \setminus A) = 0 + 0 = 0$. If $F \subseteq E$, then $\emptyset \subseteq F \subseteq B$ with $\emptyset, B \in \mathcal{M}$ and $\mu(B \setminus \emptyset) = 0$, so $F \in \overline{\mathcal{M}}$. $\blacksquare$

Since $\mu(B \setminus A) = 0$, the two ends of the sandwich have the same measure, $\mu(A) = \mu(B)$, so $\overline{\mu}(E)$ is squeezed to that one number. Here's the sandwich: $E$ wobbles around inside the gap, and its measure never moves.

There's an equivalent way to say it that's easier to use: $E \in \overline{\mathcal{M}}$ exactly when $E = A \cup F$ for some $A \in \mathcal{M}$ and some subset $F$ of a null set. (Given the sandwich, take $F = E \setminus A \subseteq B \setminus A$; given $A \cup F$ with $F \subseteq N$, the sandwich is $A \subseteq E \subseteq A \cup N$.) Let's complete the example.

Find the completion of $X = \{1, 2, 3\}$, $\mathcal{M} = \{\emptyset, \{1\}, \{2, 3\}, X\}$, $\mu = \delta_1$.


The null sets of $\mathcal{M}$ are $\emptyset$ and $\{2, 3\}$. Their subsets are $\emptyset$, $\{2\}$, $\{3\}$, and $\{2, 3\}$. So $\overline{\mathcal{M}}$ consists of $A \cup F$ with $A \in \mathcal{M}$ and $F \subseteq \{2, 3\}$, which is every subset of $X$: $\overline{\mathcal{M}} = \mathcal{P}(X)$, with $8$ sets.

For instance, $\{2\}$ is sandwiched as $\emptyset \subseteq \{2\} \subseteq \{2, 3\}$, so $\overline{\mu}(\{2\}) = \mu(\emptyset) = 0$, and $\{1, 3\}$ is sandwiched as $\{1\} \subseteq \{1, 3\} \subseteq X$, so $\overline{\mu}(\{1, 3\}) = \mu(\{1\}) = 1$. The completion is $\delta_1$ on all of $\mathcal{P}(X)$.

On a finite set the pattern is always the same. The atoms with positive measure stay whole, and the null atoms shatter into single points, each now measurable on its own. Build some sandwiches yourself.

Sandwich a Set

A set fails exactly when it cuts through an atom that has mass, because then the smallest $B$ and the largest $A$ differ by that whole atom. Now sort a handful of sets by where they land.

Sort Into the Completion

So on a finite set, counting the completion is counting choices: each positive atom is in or out, and each point of a null atom is in or out on its own. That's $2^{p + z}$ sets, with $p$ positive atoms and $z$ points in the null atoms. Try it.

Loading practice engine...

The trouble with $\chi_{\{2\}}$ was that changing a measurable function on a null set broke its measurability. In a complete measure space, that can't happen.

Let $(X, \mathcal{M}, \mu)$ be a measure space with $\mu$ complete. Let $f\colon X \to \mathbb{C}$ be measurable, and let $g\colon X \to \mathbb{C}$ agree with $f$ outside a null set $N$. Show that $g$ is measurable. Then explain why this fails for the incomplete example above.

Show proof

Proof. Let $V \subseteq \mathbb{C}$ be open. Split the preimage according to whether a point is in $N$: $$g^{-1}(V) = \big(g^{-1}(V) \setminus N\big) \cup \big(g^{-1}(V) \cap N\big) = \big(f^{-1}(V) \setminus N\big) \cup \big(g^{-1}(V) \cap N\big),$$ using $g = f$ off $N$. The first piece is $f^{-1}(V) \cap N^c \in \mathcal{M}$. The second is a subset of the null set $N$, so it is in $\mathcal{M}$ by completeness. So $g^{-1}(V) \in \mathcal{M}$, and $g$ is measurable.

In the example, $f = 0$ is measurable and $g = \chi_{\{2\}}$ agrees with it outside the null set $N = \{2, 3\}$, but $g^{-1}(\{z : |z - 1| < \frac{1}{2}\}) = \{2\} \notin \mathcal{M}$. The second piece above is $\{2\}$, a subset of $N$ that $\mathcal{M}$ doesn't contain. $\blacksquare$

This is the step that turns the Borel sets into the Lebesgue measurable sets. On Lebesgue Measure, length on the Borel σ-algebra $\mathcal{B}(\mathbb{R})$ turns out not to be complete (the Cantor set is null and has subsets that aren't Borel), and Lebesgue measure is its completion.

That's the whole toolkit: a measure adds countably many disjoint pieces, which gives monotonicity, subadditivity, and continuity along nested sets; null sets let us ignore what a measure can't see; and the completion makes sure everything we're ignoring is at least measurable.

Mixed Practice

Every question so far came right after its idea, which is a hint. Down here the hint is gone. First, true or false: a claim about anything on this page, some of them the kind that sounds right and isn't. Decide, then read why.

Loading practice engine...

Next, a proof from this page with one step missing.

Loading practice engine...

Next, the mixed set. Every question type on this page except true or false goes into one hat, and each click draws a new one at random. Flip the switch to type your answer; a few types need their answer choices, and they'll say so.

Loading practice engine...

Last, the Spicy Bonus. The completion was built by hand, one sandwich at a time. Is it the only way to complete a measure? It is, in the strongest sense: any complete measure that extends $\mu$ already contains the completion.

🌶️ SPICY BONUS 🌶️

Let $(X, \mathcal{M}, \mu)$ be a measure space with completion $(X, \overline{\mathcal{M}}, \overline{\mu})$. Suppose $\mathcal{N}$ is a σ-algebra on $X$ with $\mathcal{M} \subseteq \mathcal{N}$, and $\nu$ is a complete measure on $\mathcal{N}$ with $\nu(E) = \mu(E)$ for every $E \in \mathcal{M}$. Prove that $\overline{\mathcal{M}} \subseteq \mathcal{N}$ and $\nu(E) = \overline{\mu}(E)$ for every $E \in \overline{\mathcal{M}}$. Conclude that the completion is the smallest complete extension of $\mu$.

Show proof

Proof. Let $E \in \overline{\mathcal{M}}$, with $A, B \in \mathcal{M}$, $A \subseteq E \subseteq B$, and $\mu(B \setminus A) = 0$.

The set $B \setminus A$ is in $\mathcal{M} \subseteq \mathcal{N}$, and $\nu(B \setminus A) = \mu(B \setminus A) = 0$, so it is a $\nu$-null set. Since $E \setminus A \subseteq B \setminus A$ and $\nu$ is complete, $E \setminus A \in \mathcal{N}$, and $\nu(E \setminus A) \le \nu(B \setminus A) = 0$ by monotonicity.

Now $E$ is the disjoint union of $A \in \mathcal{N}$ and $E \setminus A \in \mathcal{N}$, so $E \in \mathcal{N}$, and $$\nu(E) = \nu(A) + \nu(E \setminus A) = \mu(A) + 0 = \overline{\mu}(E).$$

So every complete measure extending $\mu$ is defined on at least $\overline{\mathcal{M}}$ and agrees with $\overline{\mu}$ there. Since $\overline{\mu}$ is itself a complete extension (the completion theorem), it is the smallest one, and it is the only complete extension defined on exactly $\overline{\mathcal{M}}$. $\blacksquare$