I am reading through a book on measure theory and it says that for simple functions $f=\sum a_i \mathbf{1}_{A_i}$ and $g=\sum b_j\mathbf{1}_{B_j}$, the sum can be written $$(f+g)=\sum_{i,j}(a_i+b_j)\mathbf{1}_{A_i \cap B_j}$$
I am having trouble showing how this can be done. I tried writing $f+g=\sum a_i \mathbf{1}_{A_i} +\sum b_j\mathbf{1}_{B_j}$ but didn't make a lot of progress.
Is there a nice way to show this property?
Note that $\{A_i\}$ and $\{B_j\}$ are pairwise disjoint collections of sets and $\mathbf{1}_{A_i}$ is the indicator function for set $A_i$.
Thanks
With the help of a few astute comments, I see how to do it now:
$$\mathbf{1}_{A_i}=\mathbf{1}_{A_i\cap (\cup_jB_j)}=\sum_{j}\mathbf{1}_{A_i\cap B_j}$$ So we can write $f=\sum_i a_i\mathbf{1}_{A_i}=\sum_ia_i\sum_j\mathbf{1}_{A_i \cap B_j}=\sum_{i,j}a_i\mathbf{1}_{A_i \cap B_j}$
Thus $$f+g=\sum_{i,j}a_i\mathbf{1}_{A_i \cap B_j}+\sum_{j,i}b_j\mathbf{1}_{B_j \cap A_i}=\sum_{i,j}(a_i+b_j)\mathbf{1}_{A_i \cap B_j}$$
because the order of finite sums can be rearranged.