Proof of linearity of abstract integration using simple functions Proof of linearity of abstract integrals for simple functions by Prof. David Gamarnik and Prof. John Tsitsiklis - Lecture notes of Fundamentals of Probability
6-436j OCW MIT
In the proof provided above, it seems very confusing to me that the sum of two simple functions
 $g = \sum_{i=1}^n a_i \mathbf{1}_{A_i}$ 
and $h=\sum_{i=1}^m b_i \mathbf{1}_{B_i}$,
where $\mathbf{1}_{S}$ is the indicator function, 
is given by 
$f = \sum_{i=1}^n \sum_{j=1}^m (a_i+b_j) \mathbf{1}_{A_i\cap B_j}$. 
For example, let $g = 3\times\mathbf{1}_{\omega\geq 0}$ and $h = 2\times\mathbf{1}_{\omega< 0}$.
If $\omega = 2$, then $g(2) = 3, h(2) = 0$, while $f(2) = 0 $ since the intersection of ${\omega\geq 0}$ and ${\omega< 0}$ is empty. 
Moreover, in the third equality in the proof where $\sum_{j=1}^m\mu(A_i\cap B_j)$ is said to be $ = \mu(A_i)$ by finite additivity, how do we know that the union of all intersections of $B_j$'s with $A_i$ will cover all of $A_i$ ? 
Thanks in advance!
Link to lecture notes

When writing this way you should use partitions into measurable sets ${\cal A} = (A_1,...,A_n)$ and ${\cal B} = (B_1,...,B_m)$. (so that $\cup_i A_i=X$ and $\cup_j B_j=X$). Then the refinement
$$ {\cal A} \wedge {\cal B} = \{ A\cap B : A\in {\cal A}, B\in {\cal B}\}$$
is again a partition and the function $g+h$ is a simple function with respect to this refined partition. Using this writing systematically, the set of simple functions become an algebra which you then may use in monotone/dominated/etc... convergence.
Another point of view is that each measurable simple function $g$ takes finitely many values (possibly including zero) and ${\cal A}$ is the collection of (measurable) pre-images of all these values and ${\cal A}$ forms a partition.
