# Isn't this a non-surjective epimorphism on the category of sets?

I am trying to prove that a morphism in the category of sets is epic iff it is a surjective function.

Recall that for objects $A,B,C$, $f \in \hom(A,B)$ is epic when $g_1 \circ f = g_2 \circ f \Rightarrow g_1 = g_2, \forall g_1, g_2 \in \hom(B,C)$.

Consider $A= \{0\}, B= \{1,2\}, C=\{3\}$. Since there is only one element in $\hom(B,C)$, $g_1 \circ f = g_2 \circ f \Rightarrow g_1 = g_2, \forall g_1, g_2 \in \hom(B,C)$ is trivially satisfied $\forall f \in \hom(A,B)$

In particular,

$f : A \rightarrow B$

$f(0) \mapsto 1$

is an epimorphism, but $f$ is non-surjective.

Am I missing something about how categories are defined? Or is it simply false that the original implication is two-sided?

• I suppose we could simplify the example even more by taking $C = \emptyset$... Apr 12 '15 at 6:50
• The right-cancellative property of $f$ has to hold for all morphisms $B\to C$ for all objects $C$. Apr 12 '15 at 6:53
• Ahhh, that makes sense. Thank you! Apr 12 '15 at 7:10
• @BenWest I think that your comment (somewhat expanded) could be postedas an answer. Apr 12 '15 at 8:17
• @MartinSleziak Sure, will do. Apr 12 '15 at 15:48

In order for $f$ to be an epimorphism, it has to be right-cancellative for all morphisms $B\to C$ for all objects $C$.
Take $C=\{3,4\}$. Define $f(0)=1$, as above, which is not surjective. Define $g_1,g_2\in\operatorname{Mor}(B,C)$ by $g_1(1)=3, g_1(2)=3$, and $g_2(1)=3,g_2(2)=4$. Then $g_1\circ f=g_2\circ f$ as both are the constant functions $A\to C$ with image $\{3\}$, but $g_1\neq g_2$. So $f$ is not an epimorphism either.