I was sitting in an algebra course a year ago and while commutativity and associativity were discussed I wondered:

Does there exist a set $S$ with an operation $\cdot$ which is commutative, has an identity $e$, and where every element has an inverse, but where the operation is not associative?

I jotted down some things and came upon a relatively short proof concluding that if such a set exists, it must satisfy the property that $x^2=e$ for every $x\in S$.

I didn't think much of it, but recently I thought about the problem again and tried extensively to recreate the proof, but I was not able to. I suspect that the original proof was incorrect, but at the same time, I have not been able to come up with a counterexample.

An example of such a structure is given below:

let $S=[0,\infty)$, with

$$x\cdot y := |x-y| $$

Clearly it is commutative, has identity $0$, and it is not associative, since

$$ \left|3-|2-2| \right| = 3 \neq \left| |3-2|-2\right| $$

But alas it does satisfy exactly $x\cdot x = 0$!

I also verified for sets of $3$ elements that commutativity and inverses force associativity, but I have not made any progress towards a general solution, besides the "proof" from a year ago that I can't remember. If anyone has some ideas or insight, it would be greatly appreciated

  • 3
    $\begingroup$ You should consider $S = [0, \infty)$ rather than $\Bbb R$ for $0$ to be the identity. $\endgroup$
    – User
    Oct 4 at 12:25
  • $\begingroup$ @DietrichBurde this is not a duplicate, here we have commutativity. In all the commutative examples given in the answers to that question, every element is in fact its own inverse, which is what I am asking for a general proof of $\endgroup$
    – Carlyle
    Oct 4 at 12:46
  • 1
    $\begingroup$ A set with a binary, non-associative operation that has an identity and whete every element has an inverse is called a loop. So you want a commutative loop. $\endgroup$ Oct 4 at 14:21
  • 2
    $\begingroup$ Not sure you are correct that every such loop must have exponent 2. This preprint considers commutative Moufang loops, and states that the associators have exponent 3. That would imply, I think, that all commutative Moufang loops are groups, and that is not the case. $\endgroup$ Oct 4 at 14:28
  • 2
    $\begingroup$ One possible source of error is that in loops $x^n$ is not generally well defined for large $n$. While in a commutative loop you get $(xx)x = x(xx)$ so that $x^3$ is well defined, $(xx)(xx)$ may not equal $((xx)x)x$. I am told this is a common issue to look out for when starting to work with loops. $\endgroup$ Oct 4 at 16:17

3 Answers 3


If you think about it, start with an arbitrary set $S$ with a binary operation. No identity? Let's just add one to it. No inverse for $a$? Again just add one and call it $a^{-1}$. Then there comes the potential problem: what is $a^{-1}b$? or even $a^{-1}a^{-1}$? Well, since associativity isn't enforced, identity and inverses don't talk to other products hence it can be anything you want!

Here is a minimal example: $S=\{e, a, b\}$ with multiplication table: $$ea=ae=a, eb=be=b, ee=e$$ that is $e$ is the identity.

$$ab=ba=e$$ that is $a$ and $b$ are inverses of each other.

$$aa=a, bb=b$$ which kills the associativity and $x^2=e, \forall x$.

The moral is without associativity, identity and inverse don't mean much. That's why in category theory, almost nothing but associativity is assumed.


Define a structure $(\mathbb{R}, \cdot)$ where $x \cdot y = x\cos y + y\cos x$. Note $0$ is a identity. Note for every $x \in \mathbb{R}$, $$x \cdot (-x) = x\cos (-x) -x\cos x = x\cos x -x\cos x= 0 =(-x) \cdot x$$ So, $-x$ is a inverse for $x$ (which we can easily verify that it need to be unique). It is easy to verify that $x \cdot y =y \cdot x$ for every $x,y \in \mathbb{R}$.
Is it associative? Note $x \cdot \frac{\pi}{2} = \frac{\pi}{2} \cos x$. Using this, we compute $$(\frac{\pi}{3} \cdot \frac{\pi}{2}) \cdot \frac{\pi}{4}=\frac{\pi}{2 \sqrt{2}}$$ $$\frac{\pi}{3} \cdot (\frac{\pi}{2} \cdot \frac{\pi}{4}) = \frac{\pi}{3} \cos \frac{\pi}{2 \sqrt{2}}$$ Note $8 < 9$, so $2\sqrt{2} < 3$ and thus we have: $$\frac{\pi}{3} \cos \frac{\pi}{2 \sqrt{2}} \le \frac{\pi}{3} < \frac{\pi}{2 \sqrt{2}} $$ $$\therefore (\frac{\pi}{3} \cdot \frac{\pi}{2}) \cdot \frac{\pi}{4} \not = \frac{\pi}{3} \cdot (\frac{\pi}{2} \cdot \frac{\pi}{4})$$ Thus, $\cdot$ is not associative.
Note $x \cdot x = 2x \cos x$. So, $\pi \cdot \pi = -2\pi\not = 0$
I think this is a counterexample. (Note $-2 \pi \cdot -2\pi = -4 \pi \not = -2\pi$, so $-2 \pi$ is not an identity)


The answer by Just a user is a very simple counterexample and so is probably a better answer, this is mostly just showing off an interesting way to construct counterexamples that I saw while looking at this.

One method to construct a counterexample is essentially to work backwards as follows.

If we consider a set with a binary operation which is commutative has an identity, every element has an inverse and is associative, this is an abelian group by definition. Clearly there are abelian groups which do not have $x^2=e$ for all $x$, let us choose any such group $(G,\times)$ (with $|G|\geq 3$) with identity $e$.

Now this may seem unhelpful, but all we need is a way to make the binary operation non-associative without affecting the other properties and we would have a counterexample.

Consider the following property of any group $(H,\bullet)$. For all $a,b\in H$ there is a unique $y\in H$ s.t. $a \bullet y = b$ (namely $a^{-1}\bullet b$). If we modify $\times$ by changing the output of any single operation this must no longer be true, and so it we would no longer have a group. If we haven't changed any of the other properties the only thing that could have changed to make it no longer a group would be that it is no longer associative.

We can indeed do that using the following very simple method. Let $x_0\in G$ be s.t. $x_0^2\neq e$ and $x_0^2=y$. Now (as $|G|\geq 3$) we can choose some element $z\neq e,y$. Define $\bar{\times}$ as follows.

$$a\bar{\times}b=\cases{z & if $a=b=x_0$\\a \times b & \text{ Otherwise}}$$

As noted before $(G,\bar{\times})$ cannot be an abelian group but it is commutative has an identity and has inverses, therefore it must not be associative. Additionally $x_0^2 \neq e$ and so $(G,\bar{\times})$ is a counterexample.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .