Image factorisation [016C]
In Lecture 18 we learned about injective and surjective functions. In this section, we will see that any function f\colon A\to B can be factored as the composition of a surjection followed by an injection.
A function f\colon A\to B also restricts to a function onto its image. In particular, we have:
\begin {aligned} e_f&\colon A\to \mathrm {Im}(f)\\ e_f(x) &= f(x) \end {aligned}In fact, e_f is a surjection. To see that this is the case, we fix an element b\in \mathrm {Im}(f) and we must find an element a:A such that f(a)=b. But by definition of images, we know that b is of the form f(a) for some a so we are done.
Furthermore, function f\colon A\to B is equal to the composite m_f\circ e_f as can be quickly seen: given a:A we compute m_f(e_f(a)) = m_f(f(a)) = f(a).