I'm trying to understand a proof in Rotman's 'Introduction to Homological Algebra', Proposition 5.92, p.310.
Proposition: Let $\mathcal S$ be a full subcategory of an abelian category $\mathcal A$. If, for all $A, B \in \text{obj}(\mathcal S)$ and all $f : A \to B$,
- a zero object in $\mathcal A$ lies in $\mathcal S$,
- the direct sum $A \oplus B$ in $\mathcal A$ lies in $\mathcal S$,
- both $\text{ker } f$ and $\text{coker } f$ lie in $\mathcal S$,
then $\mathcal S$ is an abelian category.
The definition for abelian category that is being used: A category $\mathcal C$ is an abelian category if it is an additive category such that
- every morphism has a kernel and cokernel
- every monomorphism is a kernel and every epimorphism is a cokernel.
Here's the proof given in the book:
The hypothesis gives $\mathcal S$ additive, so $\mathcal S$ is abelian if axiom 2 in the definition of abelian category holds. If $f : A \to B$ is a monomorphism in $\mathcal S$, then $\text{ker } f = 0$. But $\text{ker } f$ is the same in $\mathcal A$ as in $\mathcal S$, by hypothesis, so that $f$ is monic in $\mathcal A$. By hypothesis, $\text{coker } f$ is a morphism in $\mathcal S$. As $\mathcal A$ is abelian, there is a morphism $g : B \to C$ with $f = \text{ker } g$. But $g$ is a morphism in $\mathcal S$, because $\mathcal S$ contains cokernels, and so $f = \text{ker } g$ in $\mathcal S$.
I understand that $\text{coker } f$ is a morphism in $\mathcal S$.
I also understand that since $\mathcal A$ is abelian, there exists a morphism $g : B\to C$ with $f = \text{ker } g$ (this is the second axiom of the definition of abelian category being applied to $\mathcal A$).
I don't understand how these two pieces are connected, but from the way he's using them, it appears that he's assuming $g = \text{coker } f$. I don't see how this follows, since we're only given that there exists a function $g$ in $\mathcal A$ with $f = \text{ker } g$.
The main piece of the proof I don't understand is the line "But $g$ is a morphism in $\mathcal S$, because $\mathcal S$ contains cokernels".
I understand $\mathcal S$ contains cokernels, but I don't understand why that implies that $g$ is in $\mathcal S$, unless $g$ is a cokernel of a morphism in $\mathcal S$. My guess was that $g = \text{coker } f$, but I'm unable to show this. (I've tried using the definition of cokernel as the solution to the universal mapping problem to show that $g = \text{coker }f$, specifically showing domain and codomain are the same, or equivalent, but it hasn't gotten me anywhere).
Also, as a side question: the first axiom in the proposition statement seems out of place. I think that should be before: "If, for all $A, B$...". Correct?