Cokernels - how to explain or get a good intuition of what they are or might be
When I think about kernels, I have many well-worked examples from group theory, rings and modules - in the earliest stages of dealing with abstract mathematical objects they seem to come up all over the place, whenever I see a homomorphism.
BUT no-one really seems to mention cokernels until you get to commutative diagrams and category theory. And then they can easily just be "things which make the diagram work" with limited intuition or sense of useful reality. [maybe I exaggerate]
So I am looking for good examples to illustrate what a cokernel is, extending to non-trivial examples [I was taught about the kernels of homomorphisms between non-abelian groups before anyone taught me about modules].
Let $\phi:A \to B$ be a homomorphism where $A$ and $B$ are your favorite algebraic objects. I think of $\ker \phi$ as measuring the extent to which the morphism $\phi$ is not injective. That is, the "larger" the kernel, the more the map $\phi$ differs from an injection.
In a similar vein, the cokernel $B /~\text{im}~ \phi$ measures the extent to which the map $\phi$ differs from a surjection. A "large" cokernel indicates that the map $\phi$ is far from being surjective.
As an example, consider the embeddings of vector spaces $f:\mathbb{R} \to \mathbb{R^2}$ and $g:\mathbb{R} \to \mathbb{R^3}$. The cokernel of $f$ is isomorphic to $\mathbb{R}$ and the cokernel of $g$ is isomorphic to $\mathbb{R}^2$. So, in a sense, $f$ is closer to being a surjection than $g$ is.
Some ways I think the cokernel should be taught:
- For beginners: Everybody learns that a map $f\colon A\to B$ (in a suitable category, say abelian groups) is one-to-one iff $\ker f=0$. Conversely, we may think of cokernels as detecting surjections: namely $f$ is surjective iff $\operatorname{coker} f=0$. Any quotient group (ring, module, ...) is a cokernel of an injection, so why not see what happens with maps which aren't injective?
- For more advanced students: Cokernels are the categorical dual of kernels, and to me this is why they are useful. The equalizer of $f$ with the zero map is the kernel, and the coequalizer of the same diagram is the cokernel. In this sense, cokernels should be completely natural as they satisfy the dual universal property of the kernel.
- For people who like topology: They are an algebraic analogue of the (homotopy) cofiber in a topological setting. If one is willing to accept that quotient spaces (= cofiber) and mapping cones (= homotopy cofiber) are useful constructions, then one should agree that cokernels are as well.
What I am thinking, to try to get a handle on this, is that the image of a kernel vanishes - so in the "target" of some map/function/arrow one can actually recover no information about the kernel. The kernel is actually the biggest piece of the "object" of which this is true.
Dually, if one is looking at the "image" of a function, one can say nothing about the structure of the cokernel (in terms of the part of the "target" which is not in the "image"), and this is the biggest piece of the target for which this is true.
The distinction between the two in elementary work seems to be that one is more interested in the structure of the object, of which the kernel is a natural part.
This became too long for a comment, so I have posted it as an answer. Direct sums/orthogonal sums of vector spaces seem to provide the earliest examples of cokernels in my own mathematical education. Other examples which would be pedagogically helpful would be very much appreciated.