Question on how to show that a set $A\times B$ is isomorphic to a coproduct of $B$ copies of $A$ For the following question:
Prove that the set $A\times B$ is isomorphic to a coproduct of $B$ copies of $A$. [Hint:  Think of the plane as a union of horizontal lines.]
Am i correct to interpret the hint as suggesting that I consider the map from $f:A\times B \rightarrow A\times \{\{b_i:i\in B, \wedge i\in I\}\times \{i\}\}$, defined by the function $f(a,b_i)=(a, (b_i,i))$ and $a\in A$, $b_i\in B$ for $i\in I$.  Here $(b_i,i)$ denotes I am decomposing $B$ into singleton sets $\{(b_i,i)\}$.
Thank you in advance.
 A: Elaborating on my comments: the hint is that the elements of $B$ in $A\times B$ themselves can be taken as the "index" elements for the coproduct of $B$-many copies of $A$, and we can prove that $A\times B$ satisfies the universal property for the coproduct.
To see this, for each $b\in B$ define $A_b=A$ and define the injection $i_b:A_b\to A\times B$ by $i_b(a)=(a,b)$. Now given any set $C$ and functions $q_b:A_b\to C$ for all $b\in B$, we can define a function $q:A\times B\to C$ by
$$q(a,b)=q_b(a)$$
It is easy to see that $q\circ i_b=q_b$ for all $b\in B$, and $q$ is unique satisfying this property (that is, if $q':A\times B\to C$ satisfies $q'\circ i_b=q_b$ for all $b\in B$, then $q'=q$). This shows that the pair $(A\times B,(i_b)_{b\in B})$ satisfies the universal property for the coproduct of $B$-many copies of $A$. By uniqueness of the coproduct it is isomorphic to any other "implementation"; more precisely, for any coproduct $(\coprod_{b\in B}A_b,(j_b)_{b\in B})$, there is a unique isomorphism $F:A\times B\to\coprod_{b\in B}A_b$ with $F\circ i_b=j_b$ for all $b\in B$.
