Understanding the definition of Lebesgue integral in "Real and complex analysis"-book I'm reading the "Real and complex analysis"-book by Rudin. I'm currently in the section where the Lebesgue integral is being defined using simple functions. The definition of the Lebesgue integral is stated in the following way:

Definition: If $s:X\to[0, \infty)$ is a measurable simple function, of the form:
$$s(x)=\sum_{i=1}^n \alpha_i \textbf{1}_{A_i}(x),$$
where $\alpha_1, ...\alpha_n$ are the distinct values of $s$,
$\textbf{1}_{A_i}(x)$ is an indicator function, and if
$E\in\mathbb{R}$, we define
$$\int_E s\,d\mu=\sum_{i=1}^n \alpha_i\,\mu(A_i\cap E).$$
If $f:X\to [0, \infty]$ is measurable, and $E\in\mathbb{R}$, we define
the Lebesgue integral of $f$ over $E$ with respect to measure $\mu$
as:
$$\int_E f\,d\mu=\sup_{0\leq s\leq f} \int_E s\,d\mu$$

Now if I look at the definition of Lebesgue integral in wikipedia I get that:
$$\int f\,d\mu = \int_0^\infty \mu(\{x\,|\,f(x)>t\})\,dt,$$
where $dt$ is a differential change in the value of $f$, that is $dt = \lim_{\Delta x\to0}f(x+\Delta x)-f(x).$
Now the wiki definition makes sense to me ("summing the slices upwards"), but the definition in Rudin's book confuses me. How are these the same:
$$\sup_{0\leq s\leq f}\sum_{i=1}^n \alpha_i\,\mu(A_i\cap E)=\int_0^\infty \mu(\{x\,|\,f(x)>t\})\,dt\;\;\;?$$
I could understand this if the $\alpha_i$ would be the differential changes corresponding to $dt$.?
 A: They are in fact equal and you can set up the theory of the Lebesgue integral starting from either one and arrive at the other. We just had this last semester as part of calc III and the proof is not trivial (depending on how far you are into the topic), but very easy to follow once you have the basic tools to prove it assembled. We did it with measure theoretic induction, monotone convergence etc. In fact, we started from the definition you quoted from the book.
I have not read that particular piece, but I would not be surprised to see the author prove that equality throughout his book.
This explanation maybe does not directly give intuition for how to prove that both expressions are equal. But maybe it is convincing enough to suggest that both arrive at the same value, which is "computing the integral for functions and sets not as well-behaved as in the Riemann case". The integral of simple functions basically means you go through all values of that function's domain and sum up the corresponding area, i.e. per $\alpha_{i} $ you compute the area as $\alpha_{i}\cdot \mu(s=\alpha_{i})$ and take the sum to arrive at $\int s$. Then $\sup_{0\leq s\leq f} \int s$ basically equates to going through all approximations of f through simple functions s.t. $s \leq f$ (similar to the Riemann upper sum), computing their integrals, and taking the closest match.

Edit:
If you restrict this to the Lebesgue integral this follows quickly from Fubini's theorem and another result which states $\int_{\mathbb{R}^{n}}f d\mathcal{L}^{n}=\mathcal{L}^{n+1}(\{(x,y)\in \mathbb{R} \mid 0\leq y < f(x)\})$.
For general measure spaces the proof goes like this. If $\exists k\in\mathbb{N}\setminus{\{0\}}:\mu(f^{-1}((\frac{1}{k},\infty])=\infty \implies$ both sides are infinite.
So we can assume $\forall k \in\mathbb{N}\setminus{\{0\}}:\mu(f^{-1}((\frac{1}{k},\infty])<\infty$.
Thus, $f^{-1}((0,\infty])$ is $\sigma$-finite (will be relevant in Step 2). For functions where this is the case, the integral (defined as the sup of simple $s$ s.t. $s\leq f$) can be written as follows:
$\int_{E} f d \mu = sup\big\{\int_{F} \varphi d \mu \mid F \subseteq E, F \in 
 \mathcal{S},\mu(F)<\infty, \varphi : F\rightarrow [0,\infty) measurable, \#\varphi(F)<\infty, 0\leq\varphi\leq f\big\}$.
The proof for the above is lengthier, so I am skipping that, but it's a useful result for proving your equality.
This proof follows measure theory induction (starting with simple functions, then working your way up to arbitrary measurable functions).
Step 1: let f be linear combination of indicator functions. Then $f=\sum_{j=1}^{J}c_{j}\chi_{F_j}$ s.t. $F_j \cap F_k=\emptyset$ for $j \neq k$. Then $f^{-1}((t,\infty])$ is the union of the $F_j$ s.t. $c_j > t$, therefore $\mu(f^{-1}(t,\infty])=\sum_{j} \mu(F_{j})\chi_{[0,c_{j})}$. Linearity of the integral implies $\int_{(0,\infty)}\mu(f^{-1}((t,\infty]))d\mathcal{L}^{1}(t)=\int_{(0,\infty)}\sum_{j}\mu(F_{j})\chi_{[0,c_{j})}(t)d\mathcal{L}^{1}=\sum_{j}\mu(F_{j})c{j}=\int_{E}f d\mu $
Step 2: let f be positive. Let $\{\varphi_{k}\}_{k\in\mathbb{N}}$ be a monotone series of integrable functions s.t. $\#\varphi_{k}(E)<\infty$ and $\varphi_{k} \rightarrow f$ pointwise. This series exists because $f^{-1}((0,\infty])$ is $\sigma$-finite (a result that is proven as part of the theory). Monotone convergence (another important result) now implies
$\int_{E}fd\mu=lim_{k\rightarrow \infty}\int_{E} \varphi_{k}d\mu$ [1]
Let $t\in(0,\infty)$, then $\varphi_{k}\leq\varphi_{k+1}$ implies $\{x\mid \varphi_{k}(x)>t\} \subseteq \{x\mid \varphi_{k+1}(x)>t\}$ and pointwise convergence leads to $\{x\mid \varphi_{k}(x)>t\}=\bigcup_{k\in\mathbb{N}}\{x\mid \varphi_{k}(x)>t\}$. Hence $\mu(\{x\mid \varphi_{k}(x)>t\})\rightarrow \mu(\{x\mid f(x)>t\})$ monotonically. Therefore, $\lim_{k\rightarrow \infty}\int_{0,\infty)}\mu(\{x\mid \varphi_{k}(x)>t\})d\mathcal{L}^{1}(t)=\int_{(0,\infty)}\mu(\{x\mid f(x)>t\})d\mathcal{L}^{1}(t)$
The equality immediately follows by applying Step 1 to every $\varphi_{k}$ and equation [1]
