Epimorphism and Monomorphism Explained Without Math

category-theoryepimorphismsmonomorphisms

I'm trying to understand category theory to increase my coding skills and epimorphism and monomorphism aren't clear to me.
Unfortunately, my last formal education was when I was 12 due to circumstances and I have a hard time understanding algebraic expressions.

I understand what morphisms are and what isomorphism is. $f : X \to Y$ and $g : Y \to X$. Meaning, if there is a morphism going from $X$ to $Y$ then there must be a morphism that goes back and reverses it.

But I don't understand what epimorphism and monomorphism are. Could someone please elaborate in a way a non-mathematician could understand?

Best Answer

When we were little we learned that $$c+a=c+b \;\;\iff\;\; a=b$$ and the notions of epi- and mono-morphism are the same idea of cancellation but for functions, or morphisms of a category. Simply replace "$+$" with "$\circ$", composition ;-)


Now addition doesn't care about the order of its arguments, it's symmetric: $x + y = y + x$. However this is not the case for morphisms in-general!

As such we have two cancellation properties and we name them

  • epi: $f$ is pre-cancellable, i.e., can be cancelled at the beginning of a composition; i.e., $$g \circ f = h \circ f \;\;\iff\;\; g = h$$
  • mono: $f$ is post-cancellable, i.e., can be cancelled at the end of a composition; i.e., $$f \circ g = f \circ h \;\;\iff\;\; g = h$$

It is interesting to note that we speak of a particular $f$ having such a cancellation property, whereas for numbers we know that the cancellation property holds for all numbers.

Can the same be done for all functions?

No, an immediate counterexample is the always-zero function $Z(x)=0$. It is in-general neither epic nor monic! Hence, for functions these properties do not always hold. As such, we may refine our analogy to be more like multiplication than addition: $$\text{ Provided } c \ne 0: \quad c \times a = c \times b \;\;\iff\;\; a = b$$ Just as "Provided $c$ is non-zero, we have (post)cancellation", we can say "Provided $f$ is monic, we have post-cancellation."


Aside: That $f \circ g \;=\; g \circ f$ is not generally true can be seen by considering a counter example.

Indeed, consider the functions $f(x) = x+1$ and $g(x) = 0$ then $$(f \circ g)(x) = f(g\;x) = f(0) = 1 \;\;\neq\;\; 0 = g(x + 1) = g(f\; x) = (g \circ f)(x)$$

Related Question