# Epimorphisms are surjective in the category of actions over a monoid

Let $M$ be a monoid and consider the category of $M$-acts. The morphisms of this category are mappings that preserve the action of $M$. Let $f : X \rightarrow Y$ be an epimorphism in this category, i.e. a right-cancellable morphism. I am trying to prove that actually $f$ is a surjective mapping, but i am having difficulty. Thanks for your help.

-
Why not try proving a stronger statement? For any category $\mathcal{C}$, a morphism (i.e. natural transformation) in the functor category $[\mathcal{C}, \textbf{Set}]$ is an epimorphism if and only if it is a componentwise surjection. Hint: Yoneda lemma. – Zhen Lin Mar 4 '12 at 18:47
@ZhenLin: What do you mean by "functor category"? – Manos Mar 4 '12 at 21:01
The category of all functors $\mathcal{C} \to \textbf{Set}$. A $M$-set is a special case of a functor, when you take $\mathcal{C}$ to be a one-object category. – Zhen Lin Mar 4 '12 at 23:42

Let's assume that $f:X\to Y$ is not surjective, and let's show that $f$ is not an epimorphism.
It is straightforward to check that the equivalence relation $\sim$ defined on $Y$ by $$y\sim y'\iff y,y'\in f(X)$$ is a congruence.
Let $z\in Y/\!\!\sim$ be the equivalence class $f(X)$, and let $c:Y\to Y/\!\!\sim$ be the constant map equal to the equivalence class $f(X)$.
Then we have $p\circ f=c\circ f$ but $p\neq c$.