Given finite sets $A$ and $B$, is $|A \cup B| = |A \cap B| \iff A = B$ true? Given finite sets $A$ and $B$, is
$$
|A \cup B| = |A \cap B| \iff A = B
$$
true? Here is what I tried. For
$$
|A \cup B| = |A \cap B| \implies A = B,
$$
suppose that $|A \cup B| = |A \cap B|$, and from the inclusion-exclusion principle,
\begin{align}
|A \cup B| &= |A| + |B| - |A \cap B| \\
2|A \cup B| &= |A| + |B|.
\end{align}
However, I am not sure how to proceed from here.
 A: For any two sets $\ A\ $ and $\ B,\ A\cup B\ $ can be written as the union of three disjoint sets:
$$A\cup B = (A \cap B)\ \cup\ (A - B)\ \cup (B - A). $$
Therefore, for any two finite sets $\ A\ $ and $\ B,\ $ we have the following:
$$\ |A \cap B| = |A \cup B| \iff |A \cap B| = |(A \cap B)\ \cup\ (A - B)\ \cup (B - A)|$$
$$\iff |A \cap B|= |A \cap B|\ + |A - B|\ + |B - A|\quad\text{(because the three sets are disjoint)} $$
$$ \overset{(*)}{\iff} (A - B) = (B - A) = \emptyset,\quad \text{i.e. there's nothing in A that's not in B and vice versa} $$
$$\iff A=B.$$
Finiteness of sets $\ A\ $ and $\ B\ $ were used for the right implication at $\ (*).$
A: In general if $X \subset Y$ then $|X| \le |Y|$.
With $|A \cup B| = |A \cap B|$ we can write
$\quad |A \cup B| = |A \cap B| \le |A| \quad$and so
$\tag 1 |A \cup B| \le |A|$
But then by the  inclusion-exclusion principle,
$\quad |A| + |B| - |A \cap B| \le |A|$
or
$\quad |A \cap B| \ge |B|$
and therefore $|A \cap B| = |B|$. But $B$ can't be have the same cardinality with any of its proper subsets and so $A \cap B = B$, which is equivalent to $B \subset A$.
By turning our attention to $|A|$ we use the same logic to show that $A \subset B$, giving us the desired result, $A = B$.
A: Yes it is true, of course if $A=B$ then $|A\cup B|=|A\cap B|$. Suppose $|A\cup B|=|A\cap B|$, since $A\cap B\subset A\cup B$ then $A\cap B=A\cup B$ and therefore $A=B$ by double inclusion.
A: $A \cap B \subset A \cup B$ and $|A \cap B|=|A \cup B|$ imply that  $A \cap B=A \cup B$.
Then $A\subset A\cup B=A\cap B\subset A$. Hence the two inclusions here are in fact equalities and $A=A\cup B$. Similarly, $B=A\cup B$. Hence $A=B$.
A: We always have $A\cap B\subset A\cup B$. Suppose that there exists $x\in A\setminus B$. Then $x\in A\cup B$, but $x\notin A\cap B$ and hence $|A\cap B|<|A\cup B|$, a contradiction. Thus, such an $x$ cannot exist. Therefore, $A\setminus B = \emptyset$ (which is equivalent to $A\subset B$). Similarly, one shows that $B\setminus A = \emptyset$, which is equivalent to $B\subset A$. Hence, $A = B$.
A: Note also that $A = (A\cap B) \cup (A\setminus B)$ and $B= (A\cap B) \cup (B\setminus A)$
So $|A\cap B| = |A\cup B| = |A| + |B| - |A\cap B|=$
$|A\cap B| +|A\setminus B| -|(A\cap B)\cap (A\setminus B)| + |A\cap B| +|B\setminus A| -|(A\cap B)\cap (B\setminus A)|  - |A\cap B| =$
$|A\cap B| + |A\setminus B| -|\emptyset| + |A\cap B| + |B\setminus A| - |\emptyset| - |A\cap B| =$
$|A\cap B|  +|A\setminus B|+ |B\setminus A| $
So $|A\setminus B|+ |B\setminus A| = 0$ and so
$|A\setminus B|= |A\setminus B|= 0$ so $A\setminus B = B\setminus A=\emptyset$
So $A\subset B$ and $B\subset A$
====
But you shouldn't use Exclusion/Inclusion as a magic formula.  You should Think why they are so.
$A\cap B \subset \begin{cases}A//B\end{cases} A\cup B$
And $A = (A\cap B) \cup (A\setminus B)$ are disjoint so $|A\cap B| \le |A|$ with equalitiy only holding if $|A\setminus B|=0$ which is true if and  $A\subset B$.  So...
