Describing the monomorphisms and epimorphisms in the category of multisets Consider the category $\mathbf{MSet}$ of multisets defined as follows. The objects would be the pairs of $(S, \sim_S)$, where $S$ is a set and $\sim_S$ is an equivalence relation on $S$. The morphisms would then be the usual set functions with an additional requirement of preserving the relation.
Now consider, say, monomorphisms in this category. How could we describe them in (multi)set-theoretic terms? Looks like they indeed should be injective functions (just as in the usual $\mathbf{Set}$). But is there any additional structure that I'm missing?
It feels sort of natural if monomorphisms would preserve the relation "backwards" (so that for any monomorphism $f : A \rightarrow B$ if $f(a_1) \sim_B f(a_2)$ then $a_1 \sim_A a_2$), but I was not able to prove that. Is that the case?
It does not: consider $A$ to be the set $\{ a, b, c \}$ with $\sim_A$ being the transitive reflexive closure of $a \sim_A b$, and B to be the set $\{ 1, 2, 3 \}$ where every pair of elements belongs to the $\sim_B$. $f$ such that $f(a) = 1; f(b) = 2; f(c) = 3$ is clearly a monomorphism, but it does not preserve $2 \sim_B 3$.
 A: First let's spell out what it means to preserve the equivalence relation. I assume that it means that if $x\sim y$, then $f(x)\sim f(y)$. 
Monomorphisms
Note that monomorphisms are preserved by right adjoint functors. Proof of the dual statement at stacks, currently Proposition 4.5.
Let $U:\newcommand\MSet{\mathbf{MSet}}\MSet \to \newcommand\Set{\mathbf{Set}}\Set$ be the forgetful functor, $U(S,\sim_S)=S$.
I claim that the functor $L:\Set\to \MSet$ defined by $LS = (S,=_S)$ is left-adjoint to $U$.
This is more or less immediate, since if $(T,\sim_T)\in \MSet$ (which by abuse of notation I will also call $T$), then any function $f:S\to T$ respects the equivalence relation on $LS$, so we have $$\newcommand\Hom{\operatorname{Hom}}\Hom_\Set(S,UT)=\Hom_\Set(S,T)\simeq\Hom_\MSet(LS,T).$$
Thus $U$ preserves monomorphisms. Hence if $f$ is a monomorphism in $\MSet$, it must be a monomorphism in $\Set$. Therefore all monomorphisms are injective.
It should also be fairly clear that if $f$ is an injective function that respects the equivalence relation, then it is going to be a monomorphism for the same reason that it is a monomorphism in $\Set$.
Epimorphisms
Similar to monomorphisms, surjective functions that respect the equivalence relation are epimorphisms in $\MSet$. To show that these are all of the epimorphisms it would be good if the forgetful functor had a right adjoint as well, and indeed it does.
Let $RS = (S,S\times S)$. Then just like with the left adjoint, all functions from a set with an equivalence relation to $RS$ respect the equivalence relations, so $$\Hom_\Set(US,T)\simeq \Hom_\MSet(S,RT).$$
Edit
The proofs given above can be rephrased in elementary language, and it's frankly a bit cleaner (probably because I thought these proofs out thoroughly before writing them this time).
The elementary proof:
Proof.
First, as above, injective and surjective functions that respect the equivalence relation are still monomorphisms and epimorphisms respectively, so we just need to prove that monomorphisms (epimorphisms) are injective (surjective).
Let $f:(S,\sim_S)\to (T,\sim_T)$ be a monomorphism. We'll prove that $f$ is a monomorphism in $\Set$. Suppose that we have a set $A$ and arrows $a,b : A\to S$ such that $f\circ a = f\circ b$. Then $a$ and $b$ induce morphisms $a,b:(A,=_A)\to (S,\sim_S)$. Thus $f\circ a=f\circ b$ as morphisms $(A,=_A)\to (T,\sim_T)$ in $\MSet$. Then since $f$ is a monomorphism in $\MSet$, $a=b$ as morphisms in $\MSet$, which means that $a=b$ as functions. Thus $f$ is a monomorphism in $\Set$.
The proof when $f$ is an epimorphism is symmetric, but we now have parallel functions $a,b : T\to A$, and they induce morphisms $(T,\sim_T)\to (A,A\times A)$ this time. $\quad\blacksquare$
A: i was doing this exercise in Algebra: Chapter 0 from Aluffi. First, I considered a multiset to be a function $f:S\rightarrow \mathbb{N}_{>0}$ where S is any object in $\textbf{Set}$. Morphisms in this manner are just commutative diagrams where m,m' are multisets (so m,m'are functions $m:S\rightarrow \mathbb{N}_{>0}$ and $m':S'\rightarrow \mathbb{N}_{>0}$ and $\sigma$ is a set-function from S to S' such that $m=\sigma\circ m'$). Then if you draw the diagrams that should appear in the hypothesis for a morphism to be a monomorphism you realize that $\sigma$ has to be injective. Then the monomorphisms are commutative diagrams in which the function that goes from S to S' is injective.
