# Cardinality of set difference of finite sets

Is $|A \setminus B| = |A| - |A \cap B|$, where $A$ and $B$ are finite sets, true? I have been unable to prove this or find a good reference on cardinality of set differences. The only reference I found was ProofWiki, and the only case they consider is when $A \subseteq B$, which is not necessarily the case here.

• Try to reduce the problem by noticing that $A \setminus B = A \setminus (A \cap B)$. You then indeed only need to consider $B \subseteq A$. You could then proceed by induction on the number of elements of $B$ (since $A \setminus (B_1 \cup B_2) = (A \setminus B_1) \setminus B_2$). Commented Dec 7, 2015 at 0:31

Let A, B be sets, where A is finite. $x \in A \Rightarrow (x \in A$ and $x \not \in B$) or ($x \in A$ and $x\in B )\Rightarrow$ $x \in A \setminus B$ or $x \in A \cap B$.

Hence

Clearly if $x \in A \setminus B$ or $x \in A \cap B$, then $x \in A$. So we have established that

$A = (A \cap B) \cup (A \setminus B)$

Now since $A \cap B$ and $A \setminus B$ are disjoint, then we have that $\lvert A \rvert = \lvert A \cap B \rvert + \lvert A \setminus B \rvert$.