# Monos and Epis

Let’s talk more about maps. Mathematicians like to talk about functions being injective (one-to-one) or surjective (onto), but part of the philosophy of category theory is to avoid going inside an object. We want to define injections and surjections in a way extrinsic to the elements.

A map $f:X\to Y$ is a monomorphism if whenever we have $g,h:W\to X$, and $f\circ g=f\circ h$, then $g=h$. This looks similar to the condition for injectivity. Instead of elements applying $f$ to elements, we’re applying it to morphisms. Drawn out as a diagram, we would be considering a picture like this:

As a replacement for injectivity, this sort of makes sense. We think of an injection as being able to tell the difference between different “input points.” Well, we don’t have points to deal with, but a monomorphism separates out different “input morphisms.”

In $\textsc{Set}$, monomorphisms (monos, for short) are precisely the same as injections (a good exercise), but this doesn’t need to happen. For example, in the category of divisible abelian groups however, the map $\mathbb Q\to\mathbb Q/\mathbb Z$ given by $q\mapsto q+\mathbb Z$ is obviously not injective, but it does happen to be a monomorphism.

Despite this apparent hiccup, monomorphisms often are the same as injections. Furthermore, in this abstract setting, it really is the best we can do. In an arbitrary category, the objects don’t even have to be sets (check for yourself; I definitely never said this). In such a situation, it doesn’t even make sense to talk about injections.

So what about surjections? We call a map $f:X\to Y$ an epimorphism (epi, for short) if whenever we have $g,h:Y\to Z$, and $g\circ f=h\circ f$, then $g=h$. The diagram we would be considering would look like this:

Can you convince yourself that this is sort of like a surjection? How could it fail? The short of it is that if $f$ doesn’t cover everything, then $g$ and $h$ could differ somewhere outside the image of $f$. Of course, epis and surjections overlap often (in $\textsc{Set}$), but not always. In the category of rings, the map $\mathbb Z\to\mathbb Q$ is an epimorphism, but not surjective.