# When are these two definitions of “monomorphism” equivalent?

I am new to category theory so I apologize if this is a silly question.

We say that $f : X \rightarrow Y$ is a mono iff for all $g,g' : W \rightarrow X$ it holds that $f \circ g = f \circ g' \Rightarrow g=g'$.

Now define that $f : X \rightarrow Y$ is a mono* iff for all $h : X \rightarrow Z$ there exists $h' : Y \rightarrow Z$ such that $h' \circ f = h$.

Is there any connection between these two definitions? My intuition says that, at least in $\mathsf{Set}$, they're equivalent; but, I could be completely wrong.

-

The first one is the standard definition. The second one is the definition of a split monomorphism. Indeed, take $h = \textrm{id}_X$, then your definition implies there is $h' : Y \to X$ such that $h' \circ f = \textrm{id}_X$; conversely, if there is $r : Y \to X$ such that $r \circ f = \textrm{id}_X$, then for any $h : X \to Z$, for $h' = h \circ r$, we have $h' \circ f = h \circ r \circ f = h$.
In particular, the two definitions are not equivalent even in $\textbf{Set}$: the unique map $\emptyset \to Y$ is always injective but splits if and only if $Y = \emptyset$. It is, however, true in the category of vector spaces over a field.