What’s the difference of a monoid and a group? I’m reading this book and it says that a group is a monoid with invertibility and this property is made to solve the equation $x \ast m=e$ and $m \ast x=e$ for $x$, where $m$ is any element of the structure.
I got confused because it’s similar to the monoid’s commutativity property which says that $m \ast n=n*m$ for all $m, n \in M$.
Your confusion arises from the fact that you are using the same letter in both equations. It would be better to say that invertibility is the property that for every $m$ there is a solution to the equation $m*x = e$, and a solution to the equation $y*m=e$. You can then prove that the solutions will in fact be the same, since
$$y = y*e = y*(m*x) = (y*m)*x = e*x = x.$$
Moreover, while it is true that the two equations together imply that $mx=xm$, this is not equivalent to commutativity. To be clear, commutativity would be
For all $a$ and all $b$, $ab=ba$.
Here you have only
If $x$ is the solution to $mx=e$, then $mx=xm$.
That is, you are only guaranteed that a particular element commutes with each $m$, not that every element commutes with every element.
Consider the usual “axioms” of a group. the ingredients are a set $S$, and a function $\cdot\colon S\times S\to S$, which we write using infix notation (so we write $a\cdot b$ or $ab$ instead of $\cdot(a,b)$). Then we require:
If we relax the requirements that all three conditions get satisfied, we get more general structures (but the more general the structure, the less we can say about them).
There are other things you can do; it does not make sense to drop the second and keep the third condition.
If you drop the first (associativity), then can relax the conditions a bit and ask that all equations of the form $ax=b$ and $ya=b$ have solutions, but not requiring that the operation be associative. That gives you a quasigroup. If you require that all such equations have solutions and that there be an identity, you get a loop. This is equivalent to asking that conditions 2 and 3 be satisfied, but not condition 1.
Within each category you can put other conditions. There are “cancellation semigroups”, which are semigroups in which $ax=ay$ implies $x=y$. There are “inverse semigroups” which, perhaps confusingly, does not mean that condition 3 is satisfied (makes no sense if we don’t have condition 2), but rather that for every $a$ there exists a $b$ such that $aba=a$ and $bab=b$. And so on and so forth. Lots of different wrinkles to be seen in there.
The difference is that an element of a monoid doesn’t have to have inverse, while an element of a group does. For example, $\mathbb N$ is a monoid under addition (with identity $0$) but not a group, since for any $n,m\in \mathbb N$ if $n$ or $m$ is not $0$ then $n+m\neq 0$.
Elements of a monoid do not necessarily have inverse elements, while those of a group do. See
There are 4 axioms that define a group, one of which is the presence of inverse elements. Monoids only need to satisfy the other 3.
First, not every monoid has the commutative property. A monoid which is commutative is called a commutative monoid.
Now, to answer your question. Not every element in a monoid has the inverse element. However, if an element $m$ in a commutative monoid has a left inverse, i.e. $x * m = e$, then $x$ is the inverse of $m$ because $m * x = e$ by the commutative property – you can only get this in a commutative monoid.
The difference between a monoid and a group is what you said, a group is a monoid with the invertibility property.
In response to the OP’s later comment – he saw a sentence “A group is commutative, or abelian, if it is so as a monoid.” in the book he cited. It means that a group is also a monoid and if it is commutative when viewing it as a monoid, then it is a commutative(abelian) group.