# Bijection between Cartesian products.

Problem: Show that there is a bijective correspondence of $A \times B$ with $B \times A$.

Here is my proof. I want to see if I'm correct about the injective portion of my proof and some insight towards the onto portion.

First, without loss of generality assume $A$ and $B$ are non-empty. Let $g: A \times B \to B \times A$ defined by $g((a,b))=(b,a)$.

One-to-one: Let $(a_1,b_1)$ and $(a_2, b_2)$ be in $A \times B$. Then $g((a_1,b_1))=g((a_2,b_2))$ implies $(b_1,a_1)=(b_2,a_2)$ which implies $(a_1,b_1)=(a_2,b_2)$.

Onto: This one I'm a bit stuck on.

• Let $\langle b,a\rangle$ be an arbitrary element of $B\times A$. Is there an element of $A\times B$ that is sent to $\langle b,a\rangle$ by your $g$? If so, can you say exactly what it is? If you can, you’ve proved that $g$ is onto. Jan 24, 2013 at 2:39
• It would be $(a,b)$.
– emka
Jan 24, 2013 at 2:47
• Exactly $-$ and you’ve now finished your proof. Jan 24, 2013 at 2:49

$$g(A\times B)=\{g((a,b)):a\in A \mbox{ and } b\in B\}=\{(b,a):(b,a)\in B\times A\}=B\times A.$$ This shows that $g$ is onto.