= Lebesgue integral
{c}
{title2=$\int_X f\,d\mu$}
{wiki}
For a nonnegative <measurable function> $f:X\to[0,\infty]$ on a <measure space>, define
$$
\int_X f\,d\mu=\sup\left\{\int_X s\,d\mu: s\text{ is a nonnegative simple function},\ 0\leq s\leq f\right\}.
$$
The <supremum> may be infinite. A <simple function> assigns finitely many heights to <measurable sets>, so its <integral> is height times <measure>, summed over those pieces. This definition groups points by their values rather than requiring a partition into short intervals. See https://ocw.mit.edu/courses/18-102-introduction-to-functional-analysis-spring-2021/615c26170233747c081d6dab928f7d91_MIT18_102s21_lec11.pdf[MIT lecture 11, Definition 108].
A <real-valued function> is <Lebesgue integrable> when $\int_X|f|\,d\mu<\infty$. Its <integral> is $\int_X f_+\,d\mu-\int_X f_-\,d\mu$, where $f_+=\max(f,0)$ is its <positive part> and $f_-=\max(-f,0)$. This finiteness requirement avoids subtracting two infinities. For <functions> taking values in the <complex numbers>, integrate the <real part> and <imaginary part> separately.
Consider the <Dirichlet function> $f=\mathbf1_{\mathbb Q\cap[0,1]}$ on $[0,1]$. It is a <simple function>, and
$$
\int_{[0,1]}f\,d\lambda=\lambda(\mathbb Q\cap[0,1])=0.
$$
Its <Riemann integral> does not exist. For every <partition of an interval> $0=x_0<\cdots<x_n=1$, each nondegenerate $[x_{i-1},x_i]$ contains both <rational numbers> and <irrational numbers>, by their respective <density of the rational numbers> and <density of the irrational numbers>. Thus its <infimum> there is $0$ and its <supremum> is $1$. The <lower Darboux sum> is $\sum_i0(x_i-x_{i-1})=0$, whereas the <upper Darboux sum> is $\sum_i1(x_i-x_{i-1})=1$. Refinement never closes this gap. A finite scatterplot cannot represent this behavior: the assertion concerns every subinterval and every <partition of an interval>.
Another view builds the <Lebesgue integral> from horizontal layers. For any nonnegative <measurable function>, the <layer cake representation> states
$$
\int_X f\,d\mu=\int_0^\infty\mu\bigl(\{x\in X:f(x)>t\}\bigr)\,dt.
$$
Both sides may be infinite. The right side integrates the <measure> of a <superlevel set> against <Lebesgue measure> in the height variable $t$. See https://www.math.cmu.edu/~gautam/sj/teaching/2022-23/720-measure/pdfs/measure-twocolumn.pdf[Gautam Iyer's measure theory notes, Theorem 9.5].
For $f(x)=x^2$ on $[0,1]$ with <Lebesgue measure>, the <superlevel set> at $0\leq t<1$ is $(\sqrt t,1]$, of <Lebesgue measure> $1-\sqrt t$; for $t\geq1$ it is empty. Consequently
$$
\int_0^1 x^2\,d\lambda(x)=\int_0^1(1-\sqrt t)\,dt
=\left[t-\frac23t^{3/2}\right]_0^1=\frac13.
$$
At height $t=1/4$, the layer extends from $x=1/2$ to $x=1$, a width of $1/2$. The picture shows why the same area can be accumulated vertically or horizontally. In a <probability space>, the identical formula expresses the <expected value> of a nonnegative <random variable> through its exceedance <probabilities>.
\Image[/lebesgue-level-sets.png]
{title=Integrating $x^2$ by horizontal layers and their widths}
A proof outline avoids extra assumptions on the <measure space>. For a nonnegative <simple function> $s=\sum_ja_j\mathbf1_{A_j}$ with disjoint <measurable sets> $A_j$, the <superlevel set> has <measure> $\sum_{a_j>t}\mu(A_j)$. Integrating this finite sum gives $\sum_ja_j\mu(A_j)=\int s\,d\mu$. Next use <approximation by nonnegative simple functions> $s_n\uparrow f$. For every $t$, the <superlevel sets> $\{s_n>t\}$ increase to $\{f>t\}$. <Continuity from below of a measure> and the <monotone convergence theorem> on the height variable give the formula for $f$.
Back to article page