# A semigroup XX is a group iff for every g∈Xg\in X, ∃!x∈X\exists! x\in X such that gxg=ggxg = g

The following could have shown up as an exercise in a basic Abstract Algebra text, and if anyone can give me a reference, I will be most grateful.

Consider a set $X$ with an associative law of composition, not known to have an identity or inverses. Suppose that for every $g\in X$, there is a unique $x\in X$ with $gxg=g$. Show that $X$ is a group.

Note that I’m not asking for a proof (though a really short one would please me!), just some place where this has been published.

I believe this is well-known to those working in regular/inverse semigroups. So well-known in fact that one can even find proofs on the web, e.g. see this proof on PlanetMath. Alas, I cannot recall the history of this result, though I vaguely recall reading something about such decades ago.

For completeness, I reproduce below the proof presented on PlanetMath (slightly edited).

Theorem $$\$$ A non-empty semigroup $$SS$$ is a group if and only if for every $$x∈Sx\in S$$ there is a unique $$y∈Sy\in S$$ such that $$xyx=xxyx=x$$.

Proof $$\$$ Suppose that $$SS$$ is a non-empty semigroup, and for every $$x∈Sx\in S$$ there is a unique $$y∈Sy\in S$$ such that $$xyx=x.xyx=x.$$ For each $$x∈S,x\in S,$$ let $$x′x'$$ denote the unique element of $$SS$$ such that $$xx′x=x. \,xx'x=x.\$$ Note $$x(x′xx′)x=(xx′x)x′x=xx′x=x,\,x(\color{blue}{x'xx'})x=(xx'x)x'x=x\color{#C00}{x'}x=x,\,$$ so, by uniqueness, $$x′xx′=x′,\color{blue}{x'xx'}=\color{#C00}{x}',$$ and therefore $$x=x″.\color{blue}x = \color{#C00}{x}''.$$

For any $$x∈S,x\in S,$$ the element $$xx′xx'$$ is idempotent, by $$(xx′)2=(xx′x)x′=xx′.(xx')^2=(xx'x)x'=xx'.$$ As $$SS$$ is nonempty, we infer that $$SS$$ has at least one idempotent. If $$i∈Si\in S$$ is idempotent, then $$ix=ix(ix)′ix=ix(ix)′iix,ix =ix\color{#0A0}{(ix)'}ix=ix\color{#C00}{(ix)'i}ix,$$ so, by uniqueness, $$(ix)′i=(ix)′,\color{#C00}{(ix)'i}=\color{#0A0}{(ix)'},$$ hence $$(ix)′=(ix)′(ix)″(ix)′=(ix)′ix(ix)′=(ix)′x(ix)′,(ix)'=(ix)'(ix)''(ix)'=\color{#C00}{(ix)'i}x(ix)'=\color{#0A0}{(ix)'}x(ix)',$$ so, by uniqueness, $$x=(ix)″=ix.x = (ix)''=ix.$$ So every idempotent $$ii$$ is a left identity, and, by a symmetry, a right identity. Therefore, $$SS$$ has at most one idempotent element. Combined with the previous result, this means that $$SS$$ has exactly one idempotent element, denoted $$ee$$ . We have shown that $$ee$$ is an identity, and that $$xx′=exx'=e$$ for each $$x∈S,x\in S,$$ hence $$SS$$ is a group.

Conversely, if $$SS$$ is a group then $$xyx=xxyx=x$$ clearly has a unique solution, namely $$y=x−1.y=x^{-1} .$$
$$\$$ QED