I have a problem connecting the definition of a coproduct with its often mentionend universal property. Let's start with the definition (just for two objects):
Let $A_1$ and $A_2$ be objects of a category $\mathcal{C}$. A coproduct of $A_1$ and $A_2$ in $\mathcal{C}$ is a triple $(A,p_1,p_2)$ where $A \in ob(\mathcal{C})$ and $p_i \in hom_\mathcal{C}(A_i,A)$ such that if $B$ is any object in $\mathcal{C}$ and $f_i \in hom_\mathcal{C}(A_i, B), i=1,2$, then there exists a unique $f \in hom_\mathcal{C}(A,B)$ such that the diagrams are commutative ($f_i = p_if$).
My apologies, I can't draw the diagram but it's pretty simple with the equation and I assume well known. While this already sounds like a universal property to me, referred to as the universal property of the coproduct is something else:
$$hom(A_1 \amalg A_2, B) \cong hom(A_1,B) \prod hom(A_2,B)$$
Now I wonder how to connect these two, e.g. how to derive this statement from the definition. It comes out of the blue for me, and I didn't came across an explanation nor a proof so far. Also often I see $\mathrm{Hom}$ instead of $hom$ - that is the same, isn't it?
Let $x$ and $y$ be objects of a category $C$. Their coproduct is an object $x \sqcup y$ together with morphisms $x \to x \sqcup y$ and $y \to x \sqcup y$, satisfying the universal property that given any object $z$ with maps $x \to z$ and $y \to z$, there exists a unique morphism $x \sqcup y \to z$ through which the given maps factor. Another way to say this is that the data of
is the same as the data of
Of course, this is the same as the data of