Equality in Lebesgue measure theory I have found some notes about measure theory where it is used the following equality 
$$\int_A f \, dx=\int_0^\infty \mu_A(\lambda)\,d\lambda,$$
where $f$ is a positive Lebesgue integrable function and $\mu_A(\lambda)$ is the Lebesgue measure of the set $\{x\in A:f(x)>\lambda\}$.
Could somebody justify that equality?
 A: Alternatively, you could evaluate the 2-dimensional Lebesgue measure of the set $\{(x,\lambda): x\in A, 0\le \lambda \lt f(x)\}$ using Fubini's theorem. (Or more properly, as Michael Hardy points out, by Tonelli's theorem.  I'm sloppy in terminology and think of F's theorem as being F $\cup$ T.) 
A: This is, essentially, problem $20$ in chapter $3$ of Michael Taylor's textbook "Measure Theory and Integration." 
First, verify the result for simple functions. By density, there exists a sequence of simple functions $(\varphi_j)$ with $\varphi_j\nearrow f$. Then, for each $\lambda,$
$$S_{\varphi_1}(\lambda)\subset S_{\varphi_2}(\lambda)\subset\cdots,$$ where $S_f(\lambda)=\{x\in A: f(x)>\lambda\}$. This follows directly from the monotone convergence of the sequence. Continuity from below gives that $\mu(S_{\varphi_j}(\lambda))\nearrow \mu(S_{f}(\lambda)).$ Then, $$\int_A \varphi_j\, dx =\int\limits_0^\infty \mu(S_{\varphi_j}(\lambda))\, d\lambda\nearrow \int\limits_0^\infty \mu(S_f(\lambda))\, d\lambda,$$ by the MCT. But, the MCT also guarantees that $$\int_A\varphi_j\, dx\nearrow\int_A f\, dx.$$ Finally, the uniqueness of the limit guarantees the desired equality.
A: This answer will follow up on "kimchi lover" 's answer and also add three remarks.
\begin{align}
\int\limits_{[0,+\infty)} \mu_A(\lambda)\,d\lambda & = \int\limits_{[0,+\infty)} \left( \,\, \int\limits_{x\,:\, f(x)\,>\,\lambda\ \&\ x\,\in\,A} 1 \, dx \right) \, d\lambda \\[10pt]
& = \iint\limits_{x,\lambda\,:\,0 \,\le\,\lambda\,<\,f(x)\ \&\ x\,\in \,A} 1\, d(x,\lambda) \\[10pt]
& = \int\limits_A \left( \,\, \int\limits_{\lambda\,:\, 0\,\le\,\lambda\,<\,f(x)}   1\,d\lambda \right) \, dx \\[10pt]
& = \int\limits_A f(x) \,dx. 
\end{align}
Note well that


*

*Tonelli's theorem rather than Fubini's theorem entails the equalities on the second and third lines above, simply because the function being integrated, which is everywhere equal to $1,$ is everywhere nonnegative;

*Fubini's theorem can also entail those equalities provided the $2$-dimensional Lebesgue measure of the set $\{(x,\lambda) : 0 \le \lambda < f(x) \ \&\ x\in A \}$ is finite. Do we have that? In the case in which I've done this problem before, $A$ was a probability space, so that was no problem.

*I once tried doing a similar exercise by integrating by parts: $$ \int_{x\,:=\,a}^{x\,:=\,b} u \,dv = uv\Big|_{x\,:=\,a}^{x\,:=\,b} - \int_{x\,:=\,a}^{x\,:=\,b} v\,du $$ The problem with which I then had difficulty was in showing that $$ uv\Big|_{x\,:=\,a}^{x\,:=\,b} \to 0. $$ That that limit holds follows from the argument from Tonelli's theorem above, but doing it directly temporarily stumped me.

