Back to 4
Author @mujirin Verifier - Public Public AI enabled

Why the Integral of an Indicator Function Is the Measure of the Set

The highlighted formula

\[ \int \mathbf{1}_E\,d\lambda = \lambda(E) \]

expresses one of the simplest and most important ideas in Lebesgue integration: the integral of the yes-or-no function of a set is the size of that set.

Here \(\lambda\) denotes Lebesgue measure, so \(\lambda(E)\) means the length, area, or more generally measure of \(E\), depending on the surrounding space. In the parent document, the intended setting is usually \(E\subseteq \mathbb{R}\), so \(\lambda(E)\) is length. The function \(\mathbf{1}_E\) is the indicator function of \(E\), defined by

\[ \mathbf{1}_E(x) = \begin{cases} 1, & x\in E,\\ 0, & x\notin E. \end{cases} \]

So the function contributes \(1\) at points inside \(E\), and contributes \(0\) outside \(E\). Integrating it should therefore count exactly the amount of space occupied by \(E\). That is the content of the formula.

There is one important condition hidden in the phrase “should satisfy”: the set \(E\) must be Lebesgue measurable. If \(E\) is not measurable, then \(\lambda(E)\) is not defined in the usual Lebesgue theory, and \(\mathbf{1}_E\) is not a Lebesgue measurable function. In that case the displayed equation is not false; rather, it is not meaningful inside the standard theory. Under the measurable-set assumption, however, the equation is part of the definition and basic structure of the Lebesgue integral [Folland 1999; Royden and Fitzpatrick 2010].1

The formula as a first definition of integration

Before Lebesgue integration handles complicated functions, it begins with very simple functions. The simplest nonzero measurable functions are indicator functions. They only take two values: \(0\) and \(1\).

Suppose \(E=[2,5]\). Then

\[ \mathbf{1}_{[2,5]}(x) = \begin{cases} 1, & 2\le x\le 5,\\ 0, & \text{otherwise}. \end{cases} \]

The graph is a rectangle of height \(1\) over the interval \([2,5]\), and height \(0\) elsewhere. Its area is

\[ 1\cdot (5-2)=3. \]

Lebesgue measure also gives

\[ \lambda([2,5])=3. \]

So in this case,

\[ \int \mathbf{1}_{[2,5]}\,d\lambda = 3 = \lambda([2,5]). \]

This agrees perfectly with the familiar geometric idea of area. But the formula is more general than ordinary rectangle area. It also works for sets with holes, countable sets, complicated measurable sets, and sets that are not intervals.

For example, let

\[ E=[0,1]\cup[2,4]. \]

The indicator \(\mathbf{1}_E\) is \(1\) on two separated intervals and \(0\) elsewhere. Since the intervals are disjoint,

\[ \lambda(E) = \lambda([0,1])+\lambda([2,4]) = 1+2 = 3. \]

Therefore

\[ \int \mathbf{1}_{[0,1]\cup[2,4]}\,d\lambda = 3. \]

The integral does not care that the set is split into two pieces. It cares about the total measure of the region on which the function equals \(1\).

The rationals example

The parent document earlier discusses the function

\[ \mathbf{1}_{\mathbb{Q}\cap[0,1]}. \]

This function equals \(1\) at rational points in \([0,1]\) and \(0\) at irrational points. From the point of view of ordinary graphing, this function is extremely wild: every small interval contains both rationals and irrationals, so the function jumps between \(0\) and \(1\) everywhere.

But Lebesgue integration asks a different question: how large is the set where the function equals \(1\)?

That set is

\[ \mathbb{Q}\cap[0,1]. \]

The rationals are countable, and every countable subset of \(\mathbb{R}\) has Lebesgue measure zero. Therefore

\[ \lambda(\mathbb{Q}\cap[0,1])=0. \]

So the indicator formula gives

\[ \int \mathbf{1}_{\mathbb{Q}\cap[0,1]}\,d\lambda = \lambda(\mathbb{Q}\cap[0,1]) = 0. \]

This example shows why the formula is so powerful. The function equals \(1\) at infinitely many points, and those points are dense in \([0,1]\), but their total Lebesgue measure is still zero. Since the integral weights values by measure, the accumulated contribution is zero.

In the same way,

\[ \int \mathbf{1}_{[0,1]\setminus\mathbb{Q}}\,d\lambda = \lambda([0,1]\setminus\mathbb{Q}) = 1. \]

The irrationals in \([0,1]\) have full measure \(1\), even though the rationals are also dense. Measure theory separates “dense” from “large in measure.”

Integrating over a smaller domain

Sometimes the integral is written with a domain:

\[ \int_A \mathbf{1}_E\,d\lambda. \]

This means we only integrate over \(A\). In that case, the function contributes \(1\) only at points that are both in \(A\) and in \(E\). Therefore

\[ \int_A \mathbf{1}_E\,d\lambda = \lambda(A\cap E), \]

provided \(A\) and \(E\) are measurable.

For example,

\[ \int_{[0,2]} \mathbf{1}_{[1,5]}\,d\lambda = \lambda([0,2]\cap[1,5]) = \lambda([1,2]) = 1. \]

Even though \([1,5]\) has length \(4\), only the part inside the integration region \([0,2]\) is counted.

This is often useful in probability and analysis. If \(A\) is the region where we are looking, and \(E\) is the event or set of interest, then the integral counts the size of the overlap.

From indicators to simple functions

The formula

\[ \int \mathbf{1}_E\,d\lambda = \lambda(E) \]

is not just an isolated fact. It is the starting point for building the whole Lebesgue integral.

A simple function is made by adding multiples of indicator functions. For instance, suppose \(A\) and \(B\) are disjoint measurable sets, and define

\[ s(x)=2\mathbf{1}_A(x)+5\mathbf{1}_B(x). \]

This means \(s(x)=2\) on \(A\), \(s(x)=5\) on \(B\), and \(s(x)=0\) outside \(A\cup B\). Since the function has value \(2\) on a set of measure \(\lambda(A)\), and value \(5\) on a set of measure \(\lambda(B)\), the natural definition is

\[ \int s\,d\lambda = 2\lambda(A)+5\lambda(B). \]

For example, let

\[ A=[0,1], \qquad B=[3,7]. \]

Then

\[ \lambda(A)=1, \qquad \lambda(B)=4. \]

So

\[ \int \left(2\mathbf{1}_{[0,1]}+5\mathbf{1}_{[3,7]}\right)\,d\lambda = 2\cdot 1+5\cdot 4 = 22. \]

This is exactly the same idea as adding areas of rectangles: height times base length. Lebesgue integration extends this idea from finitely many rectangles to much more general measurable functions.

A probability example

The same formula appears in probability, where the measure is usually called \(P\) instead of \(\lambda\). If \(E\) is an event in a probability space, then \(\mathbf{1}_E\) is the random variable that equals \(1\) if the event happens and \(0\) if it does not.

In probability notation, the integral of a random variable is its expectation. Thus

\[ \mathbb{E}[\mathbf{1}_E] = \int \mathbf{1}_E\,dP = P(E). \]

For example, roll a fair die and let \(E\) be the event “the result is even.” Then

\[ E=\{2,4,6\}, \]

and

\[ P(E)=\frac{3}{6}=\frac12. \]

The indicator \(\mathbf{1}_E\) equals \(1\) on even rolls and \(0\) on odd rolls. Its expected value is

\[ 1\cdot \frac12 + 0\cdot \frac12 = \frac12. \]

So

\[ \mathbb{E}[\mathbf{1}_E]=P(E). \]

This is the probabilistic version of the same measure-theoretic identity. It is one reason indicator functions are so common in probability: they turn events into functions, and integration turns those functions back into probabilities [Kolmogorov 1956; Billingsley 1995].

What the highlighted formula really tells us

The equation

\[ \int \mathbf{1}_E\,d\lambda = \lambda(E) \]

says that integration is built to respect measure from the very beginning. Before the integral can accumulate varying values of a function, it must correctly accumulate the simplest possible values: \(1\) on a measurable set and \(0\) outside it.

For intervals, this reproduces ordinary area. For countable sets, it explains why infinitely many points may still contribute zero. For probability spaces, it says that the expectation of an event’s indicator is the probability of the event. And for simple functions, it becomes the rule that values are weighted by the measures of the sets on which they occur.

So the formula is not merely a convenient identity. It is the bridge from measuring sets to integrating functions.

References

Billingsley, Patrick. Probability and Measure. 3rd ed., Wiley, 1995.

Folland, Gerald B. Real Analysis: Modern Techniques and Their Applications. 2nd ed., Wiley, 1999.

Kolmogorov, A. N. Foundations of the Theory of Probability. 2nd English ed., Chelsea Publishing Company, 1956.

Royden, H. L., and P. M. Fitzpatrick. Real Analysis. 4th ed., Pearson, 2010.

τ TheoryTrace