I'm trying to solve this exercise which consists of two proofs. In my attempt to solve it, I notice that the part [a.] and [b.] are related, since I think that both express the Inclusion-exclusion principle. I'm having trouble with [a.] and as far as I understand, that proof will be useful in solving [b].
Let $(\Omega,F,\textit{P})$ be a probability space and $A_{1}.A_{2},...,A_{n}\in F$, then
$$ A:=\bigcup_{k=1}^{n}A_{k} $$
[a.]Prove that $$ \mathcal{X}_{A} = 1- \prod_{k=1}^{n}(1-\mathcal{X}_{A_{k}}) $$ [b.] Prove that $$ P(A)=\sum_{j=1}^{n}P(A_{k})-\sum_{i<j}P(A_{i}\cap A_{j})+\sum_{i<j<k}P(A_{i}\cap A_{j}\cap A_{k})-...+(-1)^{n-1}P\left( \bigcap_{j=1}^{n}A_{j}\right) $$
In my attempt I'm considering that $A=\bigcup_{k=1}^{n}A_{k}\subseteq \Omega$, then due to $\mathcal{X}_{A}$ is an indicator function, every $\mathcal{X}_{A_{k}}$ in [a] should be equal to $1$, since $$ \mathcal{X}_{A_{k}} = \begin{cases} 1 & \text{ if } \omega \in A_{k}\\ 0 & \text{ if } \omega \notin A_{k} \end{cases} $$
Evaluating [a] for n=2 I obtained \begin{align*} \mathcal{X}_{A} &= 1-((1-\mathcal{X}_{A_{1}})(1-\mathcal{X}_{A_{2}})) \\ &=\mathcal{X}_{A_{1}}+\mathcal{X}_{A_{2}}-\mathcal{X}_{A_{1}}\mathcal{X}_{A_{2}} \end{align*}
And for n=3 \begin{align*} \mathcal{X}_{A}=\mathcal{X}_{A_{1}}+\mathcal{X}_{A_{2}}-\mathcal{X}_{A_{1}}\mathcal{X}_{A_{2}}+\mathcal{X}_{A_{3}}-\mathcal{X}_{A_{1}}\mathcal{X}_{A_{3}}-\mathcal{X}_{A_{2}}\mathcal{X}_{A_{3}}+\mathcal{X}_{A_{1}}\mathcal{X}_{A_{2}}\mathcal{X}_{A_{3}} \end{align*}
I think this is similar to the proof Inclusion-exclusion principle in [b] but I'm stuck here because I don't know how to generalize [a] to prove it. Thank you.
For a): By the definitions and standard algebra facts: $$\omega \in A \iff \chi_A(\omega)=1$$ and both hold iff: $$\prod_{i=1}^n (1-\chi_{A_i}(\omega)) = 0 \iff \exists i \le n: (1-\chi_{A_i}(\omega) = 0 \iff \exists i \le n: \chi_{A_i}(\omega)=1 \iff \\ \exists i \le n: \omega \in A_i$$ and the last statement is just the definition of $\omega \in \bigcup_{i=1}^n A_i$. Sets are equal iff their characteristic fucntions are equal so the equality has been shown.
$(b)$ follows from expanding $(1- \prod_{i=1}^n (1- \chi_{A_i}))$ and using that $P(B)=\int \chi_B d\mu$ and additivity of integrals. Plus $\chi_{A \cap B}= \chi_A \cdot \chi_B$ for all $A,B$.