If $A$ and $B$ are two events in some finite
sample space $\Omega $ and $P$ is the event
probability function of some distribution, we
have seen that
\[
P(A \cup B) = P(A) + P(B) - P(A \cap B)
\]
\[ \begin{aligned} P(A \cup B \cup C) = P&(A) + P(B) + P(C) \\ &- P(A \cap B) - P(A \cap C) - P(B \cap C) \\ &+ P(A \cap B \cap C) \end{aligned} \]
\[ \begin{aligned} P(A \cup B \cup C) &= P(A \cup B) + P(C) - P((A \cup B) \cap C) \\ &= P(A) + P(B) + P(C) - P(A \cap B) - P((A \cup B) \cap C) \\ \end{aligned} \]
by using the inclusion-exclusion formula. Recall1 that\[ (A \cup B) \cap C = (A \cap C) \cup (B \cap C) \]
Now use the inclusion-exclusion formula again, and properties of set pair intersections to get\[ \begin{aligned} P((A \cup B) \cap C) &= P(A \cap C) + P(B \cap C) - P((A \cap C) \cap (B \cap C)) \\ &= P(A \cap C) + P(B \cap C) - P(A \cap B \cap C) \\ \end{aligned} \]
\[ \begin{aligned} P(A_1 \cup \cdots \cup A_n) = \sum P&(A_i) -\sum P(A_i \cap A_j) \\ &\sum P(A_i \cap A_j \cap A_k) - \cdots \\ &(-1)^{n-1} P(A_1 \cap \cdots A_n) \end{aligned} \]
Here there are ${n \choose r}$ terms in the $r$th sum, $r = 1, \dots , n$.