Establishing a bijection Let $A,B$ be finite sets. Prove that $|A\cup B|=|A|+|B|-|A\cap B|$ by establishing a bijection from $A\cup B$ to $\{1,2,\ldots,|A|+|B|-|A\cap B|\}$.
These are some hints that I got but I'm still confused on how to come up with a bijection. 


*

*Prove for disjoint finite sets $A,B$ ( i.e. $A\cap B=∅$) that $|A\cup B|=|A|+|B|$ by coming up with a bijection N→A∪B. 

*$A\cup B=(A∖B)\cup(B∖A)\cup(A\cap B)$ is a disjoint (!) decomposition of $A\cup B$. 

*A=(A∖B)∪(A∩B) is a disjoint (!) decomposition of A

*B=(B∖A)∪(B∩A) is a disjoint (!) decomposition of B
 A: For any $k \in \mathbb{N}$ and any finite set $F$, there is a bijection between $F$ and the set $I_n$ defined by $I_n \doteq  \{1, \cdots, n \}$. 
So, given two finite disjoint sets $A, B$, there exist bijections between $A$ and $I_m$ for some $m \in \mathbb{N}$ and between $B$ and $I_n$ for some $n \in \mathbb{N}$. Let's name them $f: I_m \to A$ and $g: I_n \to B$. Then one example of a bijection between $A \cup B$ and $I_k$ (where $k = m +n$) is given by $$I_k \ni x \mapsto \begin{cases} f(x) \text{ if } 1 \leq x \leq n \\ g(x-n) \text{ if } 1 \leq x - n \leq m\end{cases}$$
Writing $A \cup B$ as a disjoint union$$A \cup B = (A \setminus B) \cup B$$
we have a bijection between $A \cup B$ and $\{1, \cdots, |(A \setminus B) \cup B| \}$  by my previous remarks. All that remains to show is that:
$$|(A \setminus B) \cup B| = |A| + |B| - |A \cap B|$$
Now, since we can write $A$ as a disjoint union $$A = (A \setminus B) \cup (A \cap B)$$
it's clear that $|A| - |A \cap B| = |A \setminus B|$. Therefore
$$|(A \setminus B) \cup B| = |A \setminus B| + |B| =|A| - |A \cap B| +|B| = |A| + |B| - |A \cap B|  $$
as desired.
