Just trying to learn how inclusion-exclusion proofs work.
Do the inclusion-exclusion arguments work like that below? If not, what are my mistakes?
Suppose $x \in A.$ Then the expression above counts it once in $|A|$, removes it twice in $|A \cap B|, |A \cap C|$, then adds it back in $|A \cap B \cap C|: 1 - 2 + 1 = 0.$ The element in $A$ contributes nothing to the expression. The same analysis holds for elements in $B, C.$
Suppose $y \in A \cup B.$ Then $y \in A$ or $y \in B.$ So then the expression above counts it once in $|A|$ and once in $|B|$, removes it thrice in $|A \cap B|, |B \cap C|, |A \cap C|$, then adds it back in $|A \cap B \cap C|: 2 - 3 + 1 = 0.$ The element in $A \cap B$ contributes nothing to the expression. The same analysis holds for elements in $A \cup B, A\cup C, B \cup C.$
Suppose $z \in A \cup B \cup C.$ Then $z \in A$ or $z \in B$ or $z \in C.$ Thus the expression counts it once in $|A|$, once in $|B|$ and once in $|C|$, removes it thrice in $|A \cap B|, |B \cap C|, |A \cap C|$, then adds it back in $|A \cap B \cap C|: 3 - 3 + 1 = 1.$ So the element in $A \cap B \cap C$ is counted once by the expression.
Edit:
The proof as worked by T. Gunn, amWhy and mTur11 is as follows (just in case someone else sees it in the future and gets confused by the wrong proof):
Call $|A| + |B| + |C| - (|A \cap B| + |A \cap C| + |B \cap C|) + |A \cap B \cap C|$ $E$ for Expression.
We have three cases:
- $x \in A$ but not $B$ or $C.$ Then $E$ counts it once in $|A|$. The element in $A$ contributes $1$ to $E$. The same analysis holds for elements in $B, C.$
- $x \in A$ and $x \in B$ but $x \notin C.$ So then $E$ counts it once in $|A|$ and once in $|B|$, removes it once in $|A \cap B|: 2 - 1 = 1.$ The element in $A \cap B$ contributes $1$ to $E$. The same analysis holds for elements in $A \cap C, B \cap C.$
- $x \in A$ and $B$ and $C.$ Thus $E$ counts it once in $|A|$, once in $|B|$ and once in $|C|$, removes it thrice in $|A \cap B|, |B \cap C|, |A \cap C|$, then adds it back in $|A \cap B \cap C|: 3 - 3 + 1 = 1.$ So the element in $A \cap B \cap C$ is counted once by $E$.
Thus $E$ counts every element in $A \cup B \cup C$ once.
It depends on how many of $A, B, C$ the element is in.
If $x \in A$ but not $B$ or $C$ then $x$ is counted once in the term $|A|$
If $x \in A$ and $x \in B$ but $x \notin C$ then $|A| + |B| - |A \cap B|$ counts $x$ once
If $x \in A$ and $B$ and $C$ then the whole right hand side counts $x$ once
And since we can permute the letters without effect, this characterizes all possibilities.
You can also bootstrap this from the identity $|A \cup B| = |A| + |B| - |A \cap B|$ because then
$$ |A \cup (B \cup C)| = |A| + |B \cup C| - |A \cap (B \cup C)| = |A| + |B \cup C| - |(A \cap B) \cup (A \cap C)| $$
and hence
$$ |A \cup B \cup C| = |A| + (|B| + |C| - |B \cap C|) - (|A \cap B| + |A \cap C| - |A \cap B \cap C|). $$