If $A$ and $B$ have $n$ and $m$ elements respectively with $A\cap B=\emptyset$. Prove that $A\cup B$ has $m+n$ elements. If $A$ and $B$ have $n$ and $m$ elements respectively with $A \cap B=\emptyset$. Prove that $A \cup B$ has $m+n$ elements.
The solution in the book starts by letting $f$ be a bijection from $\{$1,..m$\}$ onto $A$ and $g$ a bijection from $\{$1,..n$\}$ onto $B$
Then proving the function
$h:=$$f(i)$ if $i=1,...,m$
Or $g(i-m)$ if $i=m+1,...,m+n$ is a bijection from $\{$1,..,m,m+1,..,m+n$\}$ onto $A$$\cup$$B$
But I'm stuck with the surjection part
 A: Since $A$ has $m$ elements and $B$ has $n$ elements, there are bijections $f:\{1,\ldots,m\}\to A$ and $g:\{1,\ldots,n\}\to B$.
Now define $h:\{1,\ldots,m+n\}\to A\cup B$ by
$$
h(i) = \begin{cases}
f(i) & \text{if}\ i\in\{1,\ldots,m\}, \\
g(m-i) & \text{if}\ i\in\{m+1,\ldots,m+n\}.
\end{cases}
$$
First you should convince yourself that $h$ is well-defined.
To see that it is an injection, suppose $h(i)=h(j)$. Then either $i,j\in\{1,\ldots,m\}$ or $i,j\in\{m+1,\ldots,m+n\}$ because $A$ and $B$ are disjoint and $h$ maps $\{1,\ldots,m\}$ into $A$ and $\{m+1,\ldots,m+n\}$ into $B$. If $i,j\in\{1,\ldots,n\}$, then we have $f(i)=h(i)=h(j)=f(j)$, so the injectivity of $f$ gives $i=j$. Similarly we get $i=j$ if $i,j\in\{m+1,\ldots,m+n\}$.
For surjectivity, fix $x\in A\cup B$. Then either $x\in A$ or $x\in B$. If $x\in A$, we can use the surjectivity of $f$ to obtain $i\in\{1,\ldots,m\}$ such that $f(i)=x$. In this case $h(i)=f(i)=x$. On the other hand, if $x\in B$, then we can use the surjectivity of $g$ to obtain $i\in\{1,\ldots,n\}$ such that $g(i)=x$. Then $f(m+i)=g(i)=x$.
A: Follows immediately from the result here
Proving that for finite sets $m(A \cup B)=m(A)+m(b)-m(a \cap B)$; what is a good level of rigor?
that
$m(A \cup B)=m(A)+m(B)-m(A \cap B)$.
A: Partition $A$ into $n$ one-element sets so that we have $A=\bigcup_{i=1}^nA_i$, then partition $B$ into $m$ one-element sets so that we have $B=\bigcup_{i=1}^mB_i$. Then $A \bigcup B=(\bigcup_{i=1}^nA_i) \bigcup (\bigcup_{i=1}^mB_i)$.
If $A\bigcup B$ has more than $m+n$ elements then at least one one-element set has two or more elements, an obvious contradiction.
If $A\bigcup B$ has less than $m+n$ elements then at least one one-element set has no elements, again contradiction.
Your claim follows.
