How do I prove that
$$1_{A∪B} = 1_A + 1_B - 1 _{A∩B}$$ ?
For the proof of intersection I found on mathexchange that:
\begin{align}1_A(x)1_B(x)&=\begin{cases} 1& x\in A\\ 0& x\in A^C \end{cases}\begin{cases} 1& x\in B\\ 0& x\in B^C \end{cases}\\&=\begin{cases} 1& x\in A \cap x\in B\\ 0\cdot 1& x\in A^C\cap B\\ 1\cdot 0& x\in A \cap B^C\\ 0\cdot 0& x\in A^C \cap B^C\\ \end{cases}\\&=\begin{cases} 1& x\in A \cap B\\ 0& x\in \underbrace{(A^C\cap B)\cup(A \cap B^C )\cup(A^C \cap B^C)}_{=(A\cap B)^C}\\ \end{cases}\\&=1_{A\cap B}(x)\end{align}
I tried to do the same thing as in writing $ 1_A + 1_B - 1 _{A∩B}$ out like that but ended up getting really confused and can't seem to be able to prove this.
\begin{align}1_A(x)+1_B(x)-1_A(x)1_B(x)&=\begin{cases}...+\begin{cases}...-\begin{cases} \end{cases}\end{cases}\end{cases}...\end{align}
Distinguish between the following cases:
These are all disjoint cases and $A\cup B= (A\setminus B) \cup (B\setminus A) \cup (A\cap B)$. Now, if $1_{A\cup B}(x)=1$ then only one of the above holds. You can then verify that both sides are equal in $1_{A\cup B}= 1_A+1_B-1_{A\cap B}$ for each of these three cases and you are done since then the functions have equal values for all $x$ (trivially if the left hand side is zero then the right hand side is also).