The problem says:

Let A and B be sets. Show that there is a bijective map f: A x B --> B x A.

My professor helped me out and said that the function should be given by f((a,b)) = (b,a) (where a exists in A and b exists in B).

Here is the work I have so far.

Proof. (Injection) Let f((a1,b1)) = f((a2,b2)), where (a1,b1) , (a2,b2) exist in A x B. Then, (b1,a1) = (b2,a2), which implies

b1=b2 and a1=a2,

not {f((b1,a1)) = f((b2,a2))

} Actually, this is also implied, but it's not relevant.
which implies (a1,b1) = (a2,b2). So, f is injective.

(In other words: f(p)=f(q) implies p=q.)
(Surjection)

For any (b,a) which exists in B x A,

there exists (a,b)

in AxB such that f((a,b)) = (b,a). So, f is surjective.

Since f is both injective and surjective, then f is bijective.

I feel like my Injection proof is wrong. Do any of you see anything wrong? Thanks in advance