An exercise of measure theory is probably wrong? The exercise seems to lack to say that the measure must be $\sigma$-finite or so:

Let $(X,\mathcal A,\mu)$ a measure space and take $A_1,A_2,\ldots,A_n\in\mathcal A$ for $n\in\Bbb N_{>0}$. Show that $$\mu\left(\bigcup_{k=1}^n A_k\right)=\sum_{k=1}^n(-1)^{k+1}\sum_{1\le j_1< j_2<\ldots< j_k\le n}\mu\left(\bigcap_{\ell=1}^k A_{j_\ell}\right)$$

It can be solved without too much trouble using induction, however if Im not wrong we need that $\mu(\bigcap_{j=1}^k A_j)<\infty$ to make sense the sum of the RHS on $\overline{\Bbb R}$, right? Otherwise we will had things like $\infty-\infty$.
 A: Having $\mu(A_j)<\infty$ for all $j$ is the easiest way to make sense of both the sides. We could go for minimality and demand that the sequence of sets is irredundand and $\mu(A_i)<\infty$ for all but at most one of the $A_i$-s, or give no restriction at all on the $A_i$-s, but require that all the intersections of two of those sets have finite measure. In my opinion, that would be neither elegant nor interesting. You could more sensibly extend the identity to all measure spaces by considering it before taking an integral. Namely, you could rewrite it as $$1_{\bigcup_{i=1}^n A_i}=\sum_{k=1}^n\sum_{1\le j_1<\cdots<j_k\le n}(-1)^{k-1}1_{\bigcap_{i=1}^kA_{j_i}}$$
or $$\max_{i=1}^n 1_{A_i}=\sum_{k=1}^n\sum_{1\le j_1<\cdots<j_k\le n}(-1)^{k-1}\prod_{i=1}^k1_{A_{j_i}}$$
and it would hold regardless of the integral actually producing sensible sums.
Personally, I find the second version more immediate, because it makes rather apparent that $1-RHS=\prod_{k=1}^n(1-1_{A_i})$. However, the first version states clearly the principle of inclusion-exclusion.
As you can see, $\sigma$-finiteness does not play a role here: any of the aforementioned versions either works for all measures, or it fails for Lebesgue measure in $\Bbb R$.
