Equality Except on a Null Set
Two functions can differ at some points and still be indistinguishable for many purposes in measure theory. The precise meaning is not that the exceptional points are few, or even that there are finitely many: they must lie in a measurable set of measure zero. Which sets are null depends on the measure, so the same pair of functions can be equal almost everywhere for one measure and not for another.
Throughout, \((X,\mathcal{M},\mu)\) is an arbitrary measure space; no assumption of finiteness, sigma-finiteness, or completeness is made. Functions in this tutorial are real-valued and \(\mathcal{M}\)-measurable unless stated otherwise. A measurable set \(N\in\mathcal{M}\) is a null set if \(\mu(N)=0\).
For measurable real-valued \(f\) and \(g\), their disagreement set \(\{x\in X:f(x)\ne g(x)\}\) is measurable: it is the preimage of \(\mathbb{R}\setminus\{0\}\) under the measurable function \(f-g\). Consequently, an equivalent test is that this disagreement set has measure zero. Indeed, if a null set \(N\) contains every disagreement, then the disagreement set is measurable and has measure zero by monotonicity. Conversely, if the disagreement set itself has measure zero, take it as \(N\).
Almost-Everywhere Equality Is an Equivalence Relation
It is useful to know that equality almost everywhere groups measurable functions into classes: functions in one class may have different pointwise values, but differ only on a null set. This conclusion uses only the measure axioms, in particular that a finite union of measurable null sets is again a measurable null set.
Proof. For reflexivity, any measurable function \(f\) agrees with itself on all of \(X\); choose \(N=\varnothing\), which is measurable and has measure zero. For symmetry, if \(f=g\) outside a measurable null set \(N\), then \(g=f\) at every point outside that same \(N\). For transitivity, suppose \(f=g\) outside a measurable null set \(N_1\), and \(g=h\) outside a measurable null set \(N_2\). The set \(N_1\cup N_2\) is measurable, and subadditivity gives \(\mu(N_1\cup N_2)\le\mu(N_1)+\mu(N_2)=0\), so it is null. If \(x\notin N_1\cup N_2\), then \(f(x)=g(x)\) and \(g(x)=h(x)\), hence \(f(x)=h(x)\). This proves transitivity, including when \(X\) is empty. \(\square\)
The exception sets in this argument need not be unique: any measurable null set containing all the disagreements works. For example, one may use a larger null set than the disagreement set itself. The definition requires a single measurable null exception, not a separate exception chosen anew for each point.
Indicator Functions and Symmetric Difference
For a set \(E\subseteq X\), its indicator function is \(\chi_E(x)=1\) when \(x\in E\), and \(\chi_E(x)=0\) when \(x\notin E\). If \(E\in\mathcal{M}\), then \(\chi_E\) is measurable. For two sets \(E,F\), their symmetric difference is \(E\,\triangle\,F=(E\setminus F)\cup(F\setminus E)\): it consists precisely of points belonging to exactly one of the two sets.
Proof. At a point \(x\), the two indicator values differ exactly when one of \(E,F\) contains \(x\) and the other does not. Thus \(\{x:\chi_E(x)\ne\chi_F(x)\}=E\,\triangle\,F\). This symmetric difference is measurable because it is formed from measurable sets using complements, intersections, and unions. By the disagreement-set criterion, the indicators are equal \(\mu\)-a.e. exactly when their disagreement set has measure zero, which is exactly \(\mu(E\,\triangle\,F)=0\). \(\square\)
Worked Example: Indicators of Two Intervals
Take \(X=\mathbb{R}\), \(\mathcal{M}=\mathcal{L}\), the Lebesgue sigma-algebra, and \(\mu=m\), Lebesgue measure. Let \(E=[0,1]\) and \(F=[0,1)\). Both sets are measurable. For \(0\le x<1\), both indicators equal \(1\); for \(x=1\), \(\chi_E(1)=1\) and \(\chi_F(1)=0\); outside \([0,1]\), both indicators equal \(0\). Therefore \(E\,\triangle\,F=\{1\}\).
The Lebesgue measure of a singleton is zero, so \(m(E\,\triangle\,F)=m(\{1\})=0\). Hence \(\chi_E=\chi_F\) \(m\)-a.e., although the indicators are not equal everywhere: their values differ at \(x=1\). Check: the disagreement set computed pointwise is \(\{1\}\), exactly the symmetric difference, and its measure is zero.
Changing Values on a Specified Null Set
If measurable functions \(f\) and \(g\) on \((X,\mathcal{M},\mu)\) agree outside a specified measurable null set \(N\), then they are equal \(\mu\)-a.e. Conversely, if they are equal \(\mu\)-a.e., their disagreement set is itself a measurable null set. The pointwise values on \(N\) may differ; equality almost everywhere does not require those values to match.
Proof. The first claim follows directly from the definition, using \(N\) as the exceptional set. For the addition claim, choose a measurable null set \(N\) outside which \(f=g\). For every \(x\notin N\), adding the same real number \(h(x)\) to both sides gives \(f(x)+h(x)=g(x)+h(x)\). Thus \(N\) is a null exception for \(f+h\) and \(g+h\). For scalar multiplication, for every \(x\notin N\), multiplying \(f(x)=g(x)\) by \(a\) gives \(af(x)=ag(x)\), including when \(a=0\). Hence the same \(N\) works. \(\square\)
These statements concern functions that are already measurable. Merely prescribing new values on a null set does not always guarantee that the resulting function is measurable when the measure space is not complete. A complete measure space has the additional property that every subset of a measurable null set is measurable; completeness is treated separately. For now, keep two questions distinct: do the functions agree outside a measurable null set, and are both functions measurable?
Worked Example: Changing One Value on the Real Line
Take \(X=\mathbb{R}\), \(\mathcal{M}=\mathcal{B}_{\mathbb{R}}\), the Borel sigma-algebra, and \(\mu=m\) on the Lebesgue-measurable sets (so both the functions and the set below are Lebesgue measurable). Define \(f(x)=x\), and define \(g(x)=x\) for \(x\ne2\), while \(g(2)=-5\). The disagreement set is \(N=\{2\}\): at \(x=2\), the two values are \(f(2)=2\) and \(g(2)=-5\); for every \(x\ne2\), both values equal \(x\).
The set \(N\) is measurable and \(m(N)=0\), so \(f=g\) \(m\)-a.e. Both functions are measurable: \(f\) is continuous, and \(g\) differs from \(f\) only at the Borel singleton \(\{2\}\). Check: the disagreement set remains exactly \(\{2\}\), and its Lebesgue measure is zero, even though the values at that point are different.
Null Exceptions Depend on the Measure
“Almost everywhere” is always relative to a particular measure. A singleton is null for Lebesgue measure on \(\mathbb{R}\), but not for counting measure. Conversely, a set may be null for a measure even if it contains many points. The measure, not the size of the exception in an informal sense, decides the relation.
Worked Example: The Same Exception Under Counting Measure
Let \(X=\mathbb{N}=\{1,2,\ldots\}\), let \(\mathcal{M}\) be its power set, and let \(\mu\) be counting measure, so \(\mu(A)\) is the number of elements of \(A\), or \(+\infty\) if \(A\) is infinite. Define \(f(n)=1/n\) for every \(n\), and define \(g(n)=f(n)\) when \(n\ne3\), while \(g(3)=0\). The functions disagree exactly on \(\{3\}\). Counting measure gives \(\mu(\{3\})=1\), not zero. Therefore \(f\ne g\) \(\mu\)-a.e.
Check: the exception is a singleton, but its measure is \(1\) under this measure. This differs from the Lebesgue-measure example, where a singleton has measure zero; the measure space has changed, so the almost-everywhere conclusion changes too.
Worked Example: A Large Null Exception for a Dirac Measure
Let \(X=\mathbb{R}\), \(\mathcal{M}=\mathcal{B}_{\mathbb{R}}\), and \(\mu=\delta_0\), the Dirac measure at \(0\), defined by \(\delta_0(A)=1\) if \(0\in A\) and \(\delta_0(A)=0\) if \(0\notin A\). Set \(f(x)=0\) for all \(x\), and \(g(x)=0\) at \(x=0\) while \(g(x)=1\) for \(x\ne0\). These are Borel-measurable functions. They disagree on \(N=\mathbb{R}\setminus\{0\}\), which is Borel and does not contain \(0\). Hence \(\delta_0(N)=0\), so \(f=g\) \(\delta_0\)-a.e.
Here the functions differ at every nonzero real number, yet are equal almost everywhere for \(\delta_0\). Check: at the point carrying all the Dirac mass, \(x=0\), both values are \(0\); the entire disagreement set has Dirac measure zero.
A Common Mistake
A frequent error is to assume that a finite or singleton exception is automatically null. Nullity is not a statement about the number of points alone. For the counting-measure space \((\mathbb{N},\mathcal{P}(\mathbb{N}),\mu)\), where \(\mu\) is counting measure, the incorrect calculation would be “\(\{3\}\) is a singleton, so \(\mu(\{3\})=0\).” The correct calculation is \(\mu(\{3\})=1\), because counting measure assigns measure one to each singleton. Thus functions that disagree at \(3\) are not equal \(\mu\)-a.e. In contrast, for Lebesgue measure \(m\) on \(\mathbb{R}\), \(m(\{3\})=0\), so the same one-point disagreement is a null exception there.
Also do not replace “outside a measurable null set” with “outside a set that seems small.” The definition requires measurability and measure zero. Nor should equality \(\mu\)-a.e. be read as pointwise equality: it permits differences on the exceptional set, while retaining a precise, measure-dependent meaning.
Check Your Understanding
For each question, identify the measure and the exceptional set before deciding whether the functions are equal almost everywhere.
- In a measure space \((X,\mathcal{M},\mu)\), prove that if \(f=g\) outside a measurable null set, then their disagreement set is measurable and null, assuming \(f\) and \(g\) are measurable real-valued functions.
- For measurable \(E,F\) in a measure space \((X,\mathcal{M},\mu)\), write the disagreement set of \(\chi_E\) and \(\chi_F\), and state the exact condition for their equality \(\mu\)-a.e.
- Under counting measure on \(\mathbb{N}\), can two functions that differ at exactly one integer be equal almost everywhere? Explain using the measure of a singleton.
- Under \(\delta_0\) on \(\mathbb{R}\), describe a nonempty set of measure zero and explain why a null exception need not be small in cardinality.
- If \(f=g\) \(\mu\)-a.e. and \(h\) is measurable on the same measure space, prove that \(f+h=g+h\) \(\mu\)-a.e. using a common exceptional set.