# When does $f\circ g = f\circ h$ does not imply $g=h?$

An arrow $f:a \to b$ in a category $\mathscr{C}$ is monic in $\mathscr{C}$ if for any parallel pair $g,h:c\rightrightarrows a$ of $\mathscr{C}$-arrows, the equality $f\circ g=f\circ h$ implies that $g=h$. The symbolism $f:a\rightarrowtail b$ is used to indicate that $f$ is monic. The name comes from the fact that an injective algebraic homomorphism (i.e. an arrow in a category like $\mathbf{Mon}$ or $\mathbf{Grp}$) is called a "monomorphism".

I got curious: Is there any situation in which $f\circ g=f\circ h$ does not imply $g=h$? My guess is that for it to imply that, we need:

$$f\circ g =f\circ h$$

$$(F\circ f)\circ g =(F\circ f)\circ h$$

$$Id_B \circ g =Id_B \circ h$$

$$g = h$$

So I guess that the situation I'm looking for is whenever we don't have an arrow $F$ such that $F\circ f=Id_B$. Is that correct?

• Did you mean "does not imply $g = h$"? Commented Sep 22, 2016 at 3:39
• @AlexisOlson That's what I wrote, no? Commented Sep 22, 2016 at 3:39
• No. You wrote "does not imply $f =g$". Commented Sep 22, 2016 at 3:40
• Yes, yes. Sorry, I have the attention span of a lap kitty. Commented Sep 22, 2016 at 3:42
• Given the etymology, take $f$ to be any morphism in a category like Grp, Mon, (or Set!) that is not injective.
– user14972
Commented Sep 22, 2016 at 4:20

Suppose $g(x) = x$ and $h(x) = x + 2\pi$ and $f(x) = \sin(x)$.
Then $f(g(x)) = f(h(x))$, but $g \ne h$.
If there exists a left inverse $F$ of $f$, then clearly $f\circ g = f \circ h$ implies $g = h$. So the absence of a left inverse is necessary for the implication to fail. It is however not sufficient, here's a counterexample: