[Math] Proving sets A and B are countable

elementary-set-theoryproof-writing

a) Let A and B be disjoint sets, which are both countable. Prove that $A$ U $B$ is also countable.

b) Use part (a) to show that the set of all irrational real numbers is not countable.

So for part a I understand that disjoint sets share no elements in common (other than the empty set). I tried to get a visual understanding and did: A = {1,2,3} and B = {4,5,6}.

I drew myself a diagram and realized that I can map each element in each set to a natural number, so there it has the same cardinality as the natural numbers, which implies it is countable. How can I do this as a formal proof? $A+B = N$?

Best Answer

HINT: If $A$ and $B$ are countably infinite, there are bijections $a:A\to\Bbb N$ and $b:B\to\Bbb N$. Now modify these to get a map $a'$ that maps $A$ bijectively onto the even natural numbers and a map $b\,'$ that maps $B$ bijectively onto the odd natural numbers. Then combine $a'$ and $b\,'$ into a single bijection from $A\cup B$ to $\Bbb N$.