An Application of Inclusion Exclusion Principle. Let $A$ be a finite set and let $A_{1},A_{2},\ldots,A_{n}$ be subsets of $A$. And let $C$ be a subset of $\{1,2,\ldots,n\}$. Let $B$ be the set of all $x\in A$ such that $x\in A_{i}$ for all $i$ and $x\not \in A_{i}$ if $i\in\{1,2,\ldots,n\}-C$. I have to prove that $$|B|=\sum_{C\subseteq D\subseteq \{1,2,\ldots,n\}}(-1)^{|D-C|}\cdot \bigcap_{d\in D}|A_{d}|$$ where $\bigcup_{d\in D}A_{d}$ is taken as $A$ if $D=\emptyset$. Definitely I know this is an application of Inclusion-Exclusion, but I am not sure how to go about applying the result.

Hint: First notice that $x\in B$ iff $x\in A_i$ for $i\in C$ but $x\not \in A_j$ for $j\not \in [n]\setminus C$ so you want to take the following difference of the ones that are all in $C$ minus the ones that are not in $C.$ Show then that you want
$$B=\left (\bigcap _{i\in C}A_i\right )\setminus \left ( \bigcup _{j\not \in C}A_j\right)=\left (\bigcap _{i\in C}A_i\right )\setminus \left ( \bigcup _{j\not \in C}\left (A_j\cap \bigcap _{i\in C}A_i\right )\right),$$
the last equality is just by definition of difference.
Then take the size of the set and use normal inclusion-exclusion (notice that $C$ is always going to be in the intersection of the I-E and so you are taking sets that contain $C,$ be careful with the sign). Can you finish?
