# If the kernel (cokernel) of a morphism $f$ is trivial, then is $f$ injective (surjective), or mono (epi)?

Define a monomorphism (epimorphism) as a left-cancellative (right-cancellative) morphism, in some category.

The Wikipedia page on cokernels says that a morphism is injective (surjective) iff its kernel (cokernel) is trivial. The category being discussed seems to be that of vector spaces.

Now, in many categories, being an injection (surjection) is equivalent to being a monomorphism (epimorphism), but, if this is not the case --ie. monomorphisms are not injective (epimorphisms are not surjective)--, does the above result generalize to such monomorphisms (epimorphisms)?

Namely, is the following true? A morphism is a monomorphism (epimorphism) iff its kernel (cokernel) is trivial.

• A category need not have kernels at all. The typical kinds of categories that are considered where kernels behave like they do in e.g. the category of vector spaces are abelian categories. In abelian categories, it is indeed the case that the monomorphisms are exactly the kernels (and dually for epimorphisms and cokernels). Admittedly, the Wikipedia definition almost takes this as part of the definition. – Derek Elkins Jun 6 '17 at 21:10
• It's much more common for injective to be equivalent to monomorphic, than for surjective to be equivalent to epimorphic, in concrete categories. Counterexample for the latter: in the category of rings, the inclusion $\mathbb{Z} \to \mathbb{Q}$ is an epimorphism; and in general, the inclusion of an integral domain in its field of fractions is an epimorphism. – Daniel Schepler Jun 6 '17 at 21:11
• Kernels and cokernels don't make sense in an arbitrary category. The right statement in an arbitrary category involves a generalization called the kernel pair resp. the cokernel pair. – Qiaochu Yuan Jun 6 '17 at 21:15

If you have a category with a zero object, then a monomorphism $$f$$ has zero kernel: $$f\circ\ker f = 0 = f\circ 0\implies \ker f = 0$$. This doesn't show that the kernel actually exists, just that if it does, it must be equal to zero. However, it is not difficult to verify that $$0$$ satisfies the universal property of the kernel in this case. Reverse all the arrows to get the dual statement for cokernels.
However, the converse is false: consider the category with four objects $$A$$, $$B$$, $$C$$, and a zero object $$0$$ and morphisms \begin{align*} \operatorname{Hom}(X,X) &= \{0, id_X\}\quad\textrm{for each object }X\\ \operatorname{Hom}(B,C) &= \{0, f\}\\ \operatorname{Hom}(A,B) &= \{0,g,h\}\\ \operatorname{Hom}(A,C) &= \{0, fg = fh\}\\ \operatorname{Hom}(C,A) &= \operatorname{Hom}(C,B) = \operatorname{Hom}(B,A) =\{0\}. \end{align*} By construction, $$g\neq h$$, $$fg = fh$$, and you can verify that $$\ker f$$ exists and is equal to $$0 : 0\to X$$.