Multisets don’t have addition

category-theorymonads

Multisets are containers, also called bags. A multiset is a set that can have repeats:

$$ \{ a, a, a, c, b, c \} $$

Usually when researchers talk about multisets, they use this kind of presentation:

$$ \psi = 3| a \rangle + 2| c \rangle + | b \rangle $$

In fact, $\psi$ is an element of an $\mathbb{N}$-module. I had thought that $\mathbb{N}$-modules are the Eilenberg-Moore category of the multiset monad. I now think that's not the case. There is no notion of addition of the scalar multiples in the Eilenberg-Moore category of the multiset monad. Instead, that category is just commutative monoids. This means that there is an intermediary monad, $\mathcal{MMeas}$, which is a measures monad where you can add the multiplicities. In that monad, the functor takes a set to multiplicities over set elements like this:

$$ F: \{ a, b, c \} \rightarrow \{ \{ 3|a \rangle, 1|b \rangle , 2 |c \rangle \}, \ldots\} $$

I think this monad map:

$$ U: Multiset \rightarrow \mathcal{MMeas} $$

is an equivalence and that is why multisets are always written like this:

$$ \psi = 3| a \rangle + 2| c \rangle + | b \rangle $$

It is this monad whose Eilenberg-Moore category is $\mathbb{N}$-modules.

Is this true or am I overthinking this?

Best Answer

Yes, you are overthinking this! You write:

I had thought that $\newcommand{\N}{\mathbf{N}}\newcommand{\Z}{\mathbf{Z}}\N$-modules are the Eilenberg-Moore category of the multiset monad. I now think that's not the case. […] Instead, that category is just commutative monoids.”

But $\N$-modules are precisely commutative monoids. This just like the better-known fact that $\Z$-modules are precisely Abelian groups: every commutative monoid carries a unique $\N$-module structure (this is easy check directly, or it can be abstractly seen by viewing an $\N$-module structure on $A$ as a semiring map $\N \to \mathrm{End}(A)$ and remembering that $\N$ is the initial semiring), so the forgetful functor from $\N$-modules to comm monoids is an isomorphism of categories.

So if you’re happy that the E-M category of the multiset monad is commutative monoids, then that shows that it’s $\N$-modules. Concretely, the addition comes from the multiplication of the multiset monad: writing $\newcommand{\M}{\mathcal{M}}$ for the monad, we have $\M1 \cong \N$, and under this isomorphism, the monad multiplication $\mu : \M^2 1 \to \M 1$ corresponds to addition on $\N$, seen as a map $\M \N \to \N$.

Related Question