Infinite Inclusion and Exclusion in Probability

Is there some way of generalizing the principle of inclusion and exclusion for infinite unions in the context of probability? In particular, I would like to say that $$P\left(\bigcup_nA_n\right) = \sum_nP(A_n) - \sum_{n \neq m}P(A_n \cap A_m) + \ldots$$

Does the above hold when all the infinite sums converge (and the sum of the infinite sums converges)? Also, is there a generalization to avoid the problem of the sums diverging?


It might be useful to recall that the principle of inclusion-exclusion (PIE), at least in its finite version, is nothing but the integrated version of an algebraic identity involving indicator functions.

Namely, consider $n\geqslant1$ events $(A_i)_{1\leqslant i\leqslant n}$ and let $A=\bigcup\limits_{i=1}^nA_i$, then $A^c=\bigcap\limits_{i=1}^nA_i^c$ hence $$ 1-\mathbf 1_A=\prod_{i=1}^n(1-\mathbf 1_{A_i}). $$ Using the shorthand $A_I=\bigcap\limits_{i\in I}A_i$ for every $I\subseteq\{1,2,\ldots,n\}$ and expanding the product in the RHS, one gets $$ 1-\mathbf 1_A=\sum_{k=0}^n(-1)^k\sum_{|I|=k}\mathbf 1_{A_I}, $$ or equivalently, $$ \mathbf 1_A=\sum_{k=1}^n(-1)^{k-1}\sum_{|I|=k}\mathbf 1_{A_I}. $$ Integrating this pointwise identity between functions, using the linearity of the integral and the identity $P[B]=E[\mathbf 1_B]$ for every $B$, one gets the (finite) PIE as we know it.


Which steps of this program, if any, could fail in the infinite setting? To examine this question, let us consider some infinite sequence $(A_n)$ of events and imagine we want to write a PIE for $A=\bigcup\limits_nA_n$. In particular, we intend to use the sum of the series $\sum\limits_nP[A_n]$, hence let us assume that this series converges. Then the series $\sum\limits_n\mathbf 1_{A_n}$ converges almost surely and $0<1+x\leqslant e^x$ for every $x\geqslant0$ hence $$ Y=\sum_I\mathbf 1_{A_I}=\prod_n(1+\mathbf 1_{A_n})\leqslant\exp\left(\sum_n\mathbf 1_{A_n}\right), $$ converges (absolutely) almost surely. The series $$ X=\sum_I(-1)^{|I|}\mathbf 1_{A_I} $$ converges absolutely almost surely hence $X=1-\mathbf 1_{A}$, and the corresponding absolute series is $Y$ hence, if $Y$ is integrable, then $$ E[X]=\sum_I(-1)^{|I|}P[A_I]. $$


The considerations above can be summarized as follows.

Consider some sequence of events $\mathcal A=(A_n)_{n\in N}$ indexed by some set $N$, finite or countably infinite. Consider the events $A=\bigcup\limits_{n\in N}A_n$ and, for every $I\subseteq N$, $A_I=\bigcap\limits_{i\in I}A_i$.
If the series $\sum\limits_IP[A_I]$ converges, then the PIE holds for the sequence $\mathcal A$ in the sense that $$ P[A]=\sum_{k=1}^{+\infty}(-1)^{k-1}\sum\limits_{|I|=k}P[A_I]. $$