From Function Values to Threshold Sets
A nonnegative number can be recovered by measuring how many thresholds it exceeds: the length of the interval of thresholds below it is exactly that number. Applying this pointwise observation to a measurable function turns its integral into an integral of measures of level sets. The resulting identity is useful even when the integral is infinite; no integrability assumption is needed.
Throughout, let \((X,\mathcal{M},\mu)\) be a sigma-finite measure space, and let \(f:X\to[0,\infty]\) be measurable. Write \(m\) for Lebesgue measure on \([0,\infty)\). Integrals and equalities below are understood in the extended nonnegative sense, so \(+\infty\) is allowed. The formula concerns the given pointwise representative of \(f\); changing it on a \(\mu\)-null set does not change either side.
In particular, applying this identity with \(a=f(x)\) gives \(f(x)=\int_0^\infty\chi_{\{t<f(x)\}}\,dt\) for each \(x\in X\). To integrate this equality over \(X\), we must ensure the indicator is measurable on the product space and justify changing the order of integration. Those are precisely the roles of product measurability and Tonelli’s theorem.
The Layer-Cake Formula
Proof. First define \(D=\{(x,t)\in X\times[0,\infty):f(x)>t\}\). This set belongs to \(\mathcal{M}\otimes\mathcal{B}_{[0,\infty)}\). Indeed, using the positive rationals \(\mathbb{Q}_+\), it can be written as $$ D=\bigcup_{q\in\mathbb{Q}_+}\bigl(\{x:f(x)>q\}\times[0,q)\bigr). $$ If \(f(x)>t\), there is a rational \(q\) strictly between \(t\) and \(f(x)\); this also holds when \(f(x)=+\infty\). Conversely, if \(t<q<f(x)\), then \(f(x)>t\). Each set in the countable union is product-measurable, so \(D\) is product-measurable, and therefore \(\chi_D\) is a nonnegative measurable function on the product space.
Both factors are sigma-finite: \(\mu\) is sigma-finite by assumption, and Lebesgue measure on \([0,\infty)\) is sigma-finite because this space is the union of intervals of finite length. Tonelli’s theorem therefore applies to \(\chi_D\) on \((X\times[0,\infty),\mathcal{M}\otimes\mathcal{B}_{[0,\infty)},\mu\times m)\). Integrating first in \(t\), the pointwise identity gives $$ \int_X\left(\int_0^\infty \chi_D(x,t)\,dt\right)d\mu(x) =\int_X f(x)\,d\mu(x). $$ Integrating first in \(x\), the section at a fixed \(t\) is \(\{x:f(x)>t\}\), and hence $$ \int_0^\infty\left(\int_X\chi_D(x,t)\,d\mu(x)\right)dt =\int_0^\infty\mu(\{x:f(x)>t\})\,dt. $$ Tonelli equates these iterated integrals, including when their common value is infinite. It also gives measurability of the inner integral as a function of \(t\). Thus the asserted identity and measurability follow. \(\square\)
The use of the strict inequality \(f(x)>t\) matches the pointwise interval \([0,f(x))\). In particular, if \(f(x)\) is finite, the threshold \(t=f(x)\) is not counted. Choosing a non-strict threshold instead would not change the integral over \(t\), since for each fixed \(x\) the two indicator functions differ at only one value of \(t\); the formula above uses the strict version throughout.
Worked Examples
Worked Example: A Two-Level Function on a Finite Measure Space
Let \(X=[0,1]\), let \(\mathcal{M}\) be the Lebesgue sigma-algebra, let \(\mu=m\), and set \(f=2\) on \([0,1/3]\) and \(f=1\) on \((1/3,1]\). Compute its integral from its tails and check it directly.
The function is nonnegative and measurable, and \(\mu(X)=1\), so the theorem applies. For \(0\le t<1\), both parts of \(X\) have \(f(x)>t\), so \(\mu(\{f>t\})=1\). For \(1\le t<2\), only \([0,1/3]\) has \(f(x)>t\), so the tail measure is \(1/3\). For \(t\ge2\), neither value exceeds \(t\), so the tail measure is zero. The endpoint \(t=1\) belongs to the second case because the value \(1\) is not strictly greater than \(1\); \(t=2\) belongs to the last case.
Directly, the integral of this simple function is $$ \int_X f\,dm=2\,m([0,1/3])+1\,m((1/3,1]) =2\cdot\frac13+1\cdot\frac23 =\frac43. $$ The direct computation agrees with the tail calculation.
Worked Example: Tails Under Counting Measure
Take \(X=\{1,2,3,4\}\) with its full sigma-algebra and counting measure \(\mu\). Define \(f(1)=0\), \(f(2)=1/2\), \(f(3)=3/2\), and \(f(4)=3\). Compute both sides of the formula.
For \(0\le t<1/2\), exactly the three points \(2,3,4\) satisfy \(f(n)>t\), so the tail measure is \(3\). For \(1/2\le t<3/2\), exactly \(3,4\) satisfy the strict inequality, so it is \(2\). For \(3/2\le t<3\), only \(4\) satisfies it, so it is \(1\). For \(t\ge3\), no point satisfies it, so it is \(0\). These intervals account for the boundary cases: at \(t=1/2\), the value \(1/2\) is not counted, and at \(t=3/2\), the value \(3/2\) is not counted.
For counting measure, the integral is the sum of the values: $$ \int_X f\,d\mu=0+\frac12+\frac32+3=5. $$ This independently checks the tail calculation.
Worked Example: A Function with Infinite Integral
Let \(X=\mathbb{R}\) with Lebesgue measure \(m\), and define \(f(x)=1/x\) for \(0<x\le1\), with \(f(x)=0\) otherwise. This is a nonnegative measurable function. Find its tail measures and use them to determine its integral.
If \(0\le t<1\), every \(x\in(0,1]\) satisfies \(1/x>t\), so \(\mu(\{f>t\})=1\). If \(t\ge1\), the inequality \(1/x>t\) on \((0,1]\) is equivalent to \(0<x<1/t\), whose Lebesgue measure is \(1/t\). At \(t=1\), the set is \((0,1)\), also of measure \(1\); at every \(t\ge1\), the strict endpoint \(x=1/t\) is excluded but does not affect the measure.
For a check directly on \(X\), on each interval \((2^{-(k+1)},2^{-k}]\), where \(k\) is a nonnegative integer, we have \(1/x\ge2^k\). The interval has length \(2^{-k}-2^{-(k+1)}=2^{-(k+1)}\), so its contribution to the integral is at least \(2^k\cdot2^{-(k+1)}=1/2\). The first \(N\) such disjoint intervals therefore contribute at least \(N/2\). Since this holds for every positive integer \(N\), \(\int_{\mathbb{R}}f\,dm=+\infty\), in agreement with the tail calculation.
Truncation and a Common Pitfall
Proof. For each \(x\in X\), the length of the set of thresholds \(t\in[0,a]\) for which \(t<f(x)\) is \(\min(f(x),a)\). Equivalently, $$ \min(f(x),a)=\int_0^a\chi_{\{t<f(x)\}}\,dt. $$ The same product-measurable indicator \( \chi_D \) used in the theorem is nonnegative. Tonelli’s theorem applies on \(X\times[0,a]\), since both factors are sigma-finite. Integrating first in \(t\) gives the left side. Integrating first in \(x\) gives \(\int_0^a\mu(\{f>t\})\,dt\). This proves the formula, including \(a=0\), when both sides are zero. \(\square\)
Truncation restricts the threshold range to a finite interval and caps the function at \(a\); it does not assert that the original integral is finite. In particular, the layer-cake identity is not a statement that every tail measure is finite. For example, on a space with infinite measure, a set \(\{f>t\}\) may have infinite measure for some or many thresholds, and the tail integral can then be infinite.
Common mistake: extending a nonzero tail past the largest function value. On \(X=[0,1]\) with Lebesgue measure, let \(f=2\chi_{[0,1]}\). A mistaken calculation might say that \(\mu(\{f>t\})=1\) for every \(t>0\), giving an infinite tail integral. But the inequality \(2>t\) holds only for \(t<2\). Thus the tail measure is \(1\) for \(0\le t<2\) and \(0\) for \(t\ge2\), so $$ \int_0^\infty\mu(\{f>t\})\,dt=\int_0^2 1\,dt=2. $$ The direct integral is also \(\int_0^1 2\,dm=2\). The correction is to determine the threshold set using the actual strict inequality \(f(x)>t\), including where the tail becomes zero.
The layer-cake formula converts information about the sizes of level sets into information about the integral of a function. It applies to every nonnegative measurable function on a sigma-finite measure space, without requiring boundedness or finite integral. The examples show why the extended-value formulation matters: both the function and the integral of its tails may legitimately take the value \(+\infty\).
Check Your Understanding
Use the strict threshold convention in each question, and state whenever an integral may be infinite.
- For \(f=3\chi_E\) on a measure space with \(\mu(E)=2\), determine \(\mu(\{f>t\})\) for every \(t\ge0\), then compute its tail integral.
- On a finite set with counting measure and function values \(0,1,2\), determine the tail measure on each interval of thresholds and verify the layer-cake formula.
- Explain why the set \(D=\{(x,t):f(x)>t\}\) is product-measurable using positive rational numbers.
- For \(f(x)=1/x\) on \((0,1]\), compute the tail measure at \(t=1\) and at \(t=4\), taking care with the strict inequality.
- Use the truncated formula to express \(\int_X\min(f,2)\,d\mu\) as an integral over a bounded threshold interval.