Proving that $\{E_i\}$ need not be disjoint for the Lebesgue integral $\int\varphi = \sum a_i \mu(E_i)$ I'm following Royden's textbook and he mentions this in one line but doesn't elaborate. I'll post my attempt at a proof and would appreciate any corrections/feedback.
So far only the weaker lemma has been proved. That is, if $\{E_i\}$ are all disjoint and $\varphi = \sum a_iX_{E_i}$, then
$$\int\varphi = \sum_{i=1}^{N}(a_i\;\mu(E_i))$$
Now suppose that $E_i$ aren't necessarily disjoint. I create two collections of sets $\{A_i\}$ and $\{B_i\}$ whose members are all disjoint from each other. Let
$$A_i = E_i - \bigcup_{i \neq n}E_n$$
$$B_i = \bigcup_{n}E_i \cap E_n - \bigcap_{p,q \neq i}E_p \cap E_q$$
Furthermore $\mu(E_i) = \mu(A_i \cup B_i) = \mu(A_i) + \mu(B_i)$ Since $A_i$ and $B_i$ are disjoint. Also $a_iX_{E_i} = a_iX_{A_i} + a_iX_{B_i}$. Therefore,
$$\int \varphi = \int \sum_{i=1}^{N}(a_i\;X_{E_i}) = \int\sum_{i=1}^{N}(a_iX_{A_i}) + \int\sum_{i=1}^{N}(a_iX_{B_i}) $$
Now since the collections $\{A_i\}$ and $\{B_i\}$ are already disjoint, I can use the old lemma to show
$$\int \varphi = \sum_{i=1}^{N}(a_i\;\mu(A_i)) + \sum_{i=1}^{N}(a_i\;\mu(B_i)) = \sum_{i=1}^{N}(a_i\; \mu(A_i \cup B_i))$$
Finally since $\mu(A_i \cup B_i) = \mu(E_i)$, I have
$$\int \varphi = \sum_{i=1}^{N}(a_i\; \mu(E_i))$$
In particular I'm not sure about how I constructed the disjoint sets $A_i$ and $B_i$. I don't think that part is correct.
 A: Hint: prove the following not quite difficult lemma:
If $A_{1},\dots,A_{n}$ are disjoint measurable sets that cover the
whole space then for every tuple $\langle r_{1},\dots,r_{n}\rangle\in\mathbb{R}^{n}$
function $\psi=\sum_{i=1}^{n}r_{i}1_{A_{i}}$ is a simple function
with $\int\psi d\mu=\sum_{i=1}^{n}r_{i}\mu A_{i}$.
Note that this representation is not very far from the canonical one which is used to define the integral. It is not completely the same though, so a little work must be done.

If $\chi=\sum_{j=1}^{m}s_{j}1_{B_{j}}$ is a sortlike function and the $B_j$ form
a sortlike collection of measurable sets then the sets $A_{i}\cap B_{j}$ are disjoint and cover the space, and $\psi+\chi$ takes value $r_{i}+s_{j}$ on that
set.
Applying the lemma results in: $$\int\psi+\chi d\mu=\sum_{i=1}^{n}\sum_{j=1}^{m}\left(r_{i}+s_{j}\right)\mu\left(A_{i}\cap B_{j}\right)=\sum_{i=1}^{n}r_{i}\mu A_{i}+\sum_{j=1}^{m}s_{j}\mu B_{j}=\int\psi d\mu+\int\chi d\mu$$
Every simple function has such a characterization so actually it has been shown now that the integral is additive on simple functions.
Then for $\phi=\sum_{k=1}^{N}a_{k}1_{E_{k}}$
we have: $$\int\phi d\mu=\sum_{k=1}^{N}\int a_{k}1_{E_{k}}d\mu=\sum_{k=1}^{N}a_{k}\mu\left(E_{k}\right)$$
