Contrasting Lebesgue and Riemann integration
Lebesgue integration partitions the range of a function and measures the preimages of these value slices, while Riemann integration partitions the domain into intervals. Simple functions, which take finitely many values and are measurable, approximate measurable functions from below in Lebesgue theory. The Dirichlet function, defined as the indicator of the rationals, is not Riemann integrable due to being discontinuous everywhere, but it is Lebesgue integrable with integral zero since the rationals have measure zero and the function itself is a simple measurable function.
In the Riemann construction you form a partition of the domain ( [a,b] ) into subintervals, pick sample points in each subinterval and form the usual upper and lower Darboux sums
[
U(P,f)=\sum_{k}( \sup_{x\in I_k} f(x)),\lvert I_k\rvert,\qquad L(P,f)=\sum_{k}( \inf_{x\in I_k} f(x)),\lvert I_k\rvert,
]
and you declare (f) integrable if these two sums can be made to coincide by choosing the mesh of the partition small enough. This is well‑adapted to functions which are “almost continuous”: the fundamental criterion for Riemann integrability is that the set of discontinuities has Lebesgue measure zero.
Lebesgue's idea is to turn this on its head. Instead of chopping up the domain and looking at the range on each piece, you chop up the range into “horizontal slices” ({y : \alpha_k<y\le \alpha_{k+1}}) and look at their preimages in the domain. For a non‑negative measurable function (f) one starts with simple functions
[
\varphi(x)=\sum_{k=1}^N c_k,\mathbf{1}_{E_k}(x)
]
where (E_k) are measurable sets and (c_k) are constants, so (\varphi) takes only finitely many values. Given such a simple function, its integral is defined by
(\int \varphi,\mathrm{d}\mu=\sum_k c_k,\mu(E_k)). One of the basic theorems of measure theory is that if (f) is measurable and non‑negative, there is an increasing sequence of simple functions (\varphi_n) with (\varphi_n(x)\uparrow f(x)) pointwise. The Lebesgue integral of (f) is then defined as the supremum of the integrals of these approximants:
[
\int f,\mathrm{d}\mu=\sup\left{ \int \varphi,\mathrm{d}\mu : \varphi\leq f,\ \varphi\ \text{simple}\right}.
]
The Dirichlet function (D) on ([0,1]) defined by (D(x)=1) if (x) is rational and (D(x)=0) if (x) is irrational is the characteristic function (\mathbf{1}_{\mathbb{Q}\cap[0,1]}). It is discontinuous everywhere, so its upper and lower Riemann sums never come together and the Riemann integral does not exist. In the Lebesgue setting, (\mathbb{Q}\cap[0,1]) is a measurable set of measure zero, so (D) is a measurable, simple function. Its Lebesgue integral is just (\mu(\mathbb{Q}\cap[0,1])=0): almost every point sees the value zero, and the set on which it equals one is too small to contribute.