Sum of cardinality of two disjoint finite sets – check the proof

elementary-set-theoryfunctionsproof-verification

We know that a set $A$ is finite with $\vert A \vert = m$ and $m \in \mathbb{N}$ when there exists a bijection $\varphi : A \to [m]$ where $[m]:=1, …, m$. Although the following is intuitively clear I want to show it rigorously.

Let $A$ and $B$ be two disjoint, finite sets where $\vert A \vert = m$ and $\vert B \vert = n$. Show that $\vert A \cup B \vert = \vert A \vert + \vert B \vert$.

My approach:

As $A$ and $B$ are both finite we know that there exist two bijections:

$\varphi : A \to [m]$ and $\psi : B \to [n]$. I will construct a new function $f$:

$f(x)=\left\{\begin{array}{ll} \varphi(x), & x\in A \\
m+\psi(x), & x\in B\end{array}\right .$

As $A$ and $B$ are disjoint the function $f$ is well-defined and we have $f:A\cup B \to [m+n]$. Also, $f$ is bijective because $\varphi(x)$ and $(m+\psi)(x)$ are bijective. Hence, $\vert A\cup B \vert = m+n = \vert A\vert +\vert B \vert$.

Is this correct?

Any comments are appreciated.

EDIT:

I should add the following to my proof to show bijectivity of $f$:

Let $y\in [m +n]$. If $1\leq y \leq m$ then there exists a preimage of y due to surjectivity of $\varphi$. The same holds if $m<y\leq n$ regarding $(m+\psi)$. So $f$ is surjective.

Let $x, y \in A$. If $f(x)=f(y) \Rightarrow \varphi(x)=\varphi(y)$ and as $\varphi$ is injective it follows $x=y$. The same holds if $x, y \in B$. Now, let $x \in A$ and $y \in B $ (or vice versa) $\Rightarrow x \neq y$. If we assumed $f(x)=f(y)$ it leads to $\varphi(x) = m+\psi(y)$ but this can never be equal as $1 \leq \psi(y) \leq n$ and $1\leq \varphi(x) \leq m$. Hence, $f(x) \neq f(y)$ which shows injectivity of $f$.

Best Answer

Since your emphasis is on rigor, I would suggest proving that $f$ is bijective needs more work. Just because the component functions are bijective, it doesn't guarantee that $f$ will be bijective. For example, take $f:[0,1] \cup [2,3] \rightarrow [0,1]$ given by $$f(x)=\begin{cases}x & \text{ if } \, x \in [0,1]\\-x+3 & \text{ if } \, x \in [2,3]\end{cases}$$ The both components are bijective but $f$ is not ($f(0)=f(3)$).