Construction of enveloping group of a monoid Let $M$ be a monoid and let $G$ be the group which it generates. $G$ can be described as the group obtained from $M$ by adjoining formal inverses. Despite this simple description, I am trying to understand $G$ in a more concrete manner.
Let $S$ be the underlying set of $M$, and let $T$ be the set
$$
T=\bigsqcup_{n=0}^{\infty}(S\sqcup S)^n.
$$
Elements of $T$ can be thought of as words built from symbols that are either in $M$ (first $S$) or in its formal inverse (second $S$). I believe there should be a fairly explicit way of partitioning $T$ in such a way that each element of $G$ corresponds to a unique set in the partition, and such that:


*

*the product in $G$ comes from using $M$ to somehow multiply elements of the partition

*the inverse in $G$ comes from somehow interchanging the two copies of $S$
Question. Does there exist a partition of $T$ that exhibits the group $G$ in this manner?
 A: I suppose you want to define the fundamental group of $M$. Let $\overline{M} = \{\overline{m} \mid m \in M\}$ be a disjoint copy  of $M$ and form the free monoid $(M \cup \overline{M})^*$ of basis $M \cup \overline{M}$. The quotient of this monoid by the relations $m \overline{m} = \overline{m}m = 1$, for $m \in M$, is the free group $F(M)$ generated by $M$. To avoid confusion between the elements of M and the elements of $F(M)$, let us denote by $\iota: M \to F(M)$ the natural embedding. Note that $\iota$ is not a monoid morphism.
The fundamental group of $M$ is the quotient $\pi_1(M)$ of $F(M)$ under the relations $\iota(u)\iota(v) = \iota(uv)$ for all $u, v \in M$. Let $\pi: F(M) \to \pi_1(M)$ be the surjective group morphism onto $\pi_1(M)$. Then the monoid morphism $\eta =\pi \circ \iota: M \to \pi_1(M)$ has the following universal property:

For every monoid morphism $\gamma: M \to G$ into a group such that
  $\gamma(G)$ generates $G$ as a group, there exists a unique group
  morphism $\varphi: \pi_1(M) \to G$ such that $\gamma = \varphi \circ \eta$. Moreover $\varphi$ is surjective.

