# Monoid homomorphism

I have read here and in some other places that if $$(a \circ b) \star (c \circ d) = (a \star c) \circ (b \star d)$$ for all $a,b,c,d$ in a set with two binary operations $\circ$ and $\star$, then each one is a monoid homomorphism.

My problem is that I don't quite understand in what sense these are monoid homomorphisms, since neither is a function $M \to M'$, but instead $M^2 \to M$, which confuses me somewhat. So, what exactly are these homomorphisms? Is $M^2$ supposed to be a monoid? If so, how?

Thanks.

-

If $M$ is a monoid, $M^2=M\times M$ is a monoid with coordinate-wise multiplication: that is, if $(a,b)$, $(a',b')\in M^2$, then the product is such that $$(a,b)\cdot(a',b')=(aa',bb').$$
Now suppose $M$ is a monoid, and that $M^2$ is endowed with this monoid structure. Suppose additionally that we have a function $\phi:M^2\to M$. It then makes sense to say that $\phi$ is a morphism of monoids.
Finally, it may well happen that the function $\phi$ defines itself a monoid structure on $M$. That is the situation of the lemma you have in mind, which is called the Eckmann-Hilton lemma.