Conditions under which Commutative Semigroup is Group

Theorem
Suppose the following:

Then $\struct {S, \circ}$ is a group.

Proof
Some lemmata:

Lemma 3
First we note that if $S = \set e$ is a singleton, $\struct {S, e}$ is the trivial group.

So in the following, it is assumed that there are at least two elements of $S$.

Taking the group axioms in turn:

and
We have that $\struct {S, \circ}$ is a semigroup.

Hence the semigroup axioms are fulfilled:



Hence and  are fulfilled by $\struct {S, \circ}$.

Let $x \in S$.

Let $e \in S$ be the element of $S$ asserted by $(1)$ such that $e \circ x = x$.

From Lemma $1$, this is the only such element of $S$ with this property.

Let $z \in S$ such that $z \ne x$ be arbitrary.

By $(1)$ there exists $e' \in S$ such that $e' \circ z = z$.

By Lemma $3$ we have that $e' = e$.

As $z$ is arbitrary, it follows that:
 * $\exists e \in S: \forall z \in S: e \circ z = z$

As $\struct {S, \circ}$ is a commutative semigroup, it follows also that:
 * $\forall z \in S: z \circ e = z$

Thus $e$ has been shown to be an identity of $\struct {S, \circ}$.

From Identity is Unique, $e$ is the only such element of $S$ which is an identity.

Hence $e$ is the identity of $\struct {S, \circ}$.

We have that $e$ is the identity element of $\struct {S, \circ}$:


 * $\forall x \in S: x \circ e = x$

It follows directly from $(2)$ that:
 * $\forall x \in S: \exists z \in S: z \circ x = e$

As $\struct {S, \circ}$ is a commutative semigroup, it follows also that:
 * $\forall x \in S: x \circ z = e$

Thus every element $x$ of $\struct {S, \circ}$ has an inverse $z$.

All the group axioms are thus seen to be fulfilled, and so $\struct {S, \circ}$ is a group.