# Is there a commutative operation for which the inverse of the operation is also commutative?

For instance addition is commutative, but the inverse, subtraction, is not.

$$5+2 = 2+5\\ 5-2 \neq 2-5$$

Same for multiplication/division:

$$5\times4 = 4\times5\\ 5/4 \neq 4/5$$

So is there a group operation $\circ$ with the inverse $\circ^{-1}$ such that

$$a\circ b = b\circ a\\ a\circ^{-1}b = b\circ^{-1}a$$

• Define inverse operation of a given operation, please. Feb 12, 2015 at 13:00
• @GitGud That's also something I was wondering about when I wrote the question. Is the inverse operation always $a\circ^{-1}b := a\circ b^{-1}$ (or $a^{-1}\circ b$ depending on the order), or are there other ways to define it? I figured that should be another question instead of having two questions. But perhaps I should've asked that one first instead... Feb 12, 2015 at 13:35
• I think the correct definition of an inverse operation here is that $(a \circ b) \circ^{-1} b = a = (a \circ^{-1} b) \circ b$, all $a$ and $b$. If we weren't going to require commutativity anyway, you would probably want to require the same equations with left and right swapped in at least the obvious way. Feb 12, 2015 at 20:24
• @ErikP. can you deduce the standard definition from the one you gave? I think you also need to repeat from $\circ$ the "associativity" law: $(a \circ b) \circ^{-1} c = a \circ (b \circ^{-1} c)$ (and a symmetric version, given again by commutativity in this instance). That way, it's easy to prove that $(a \circ^{-1} a^{-1}) \circ (b \circ^{-1} b^{-1}) = a \circ^{-1} a^{-1} = b \circ^{-1} b^{-1}$ — it seems I need to reassociate twice before applying your law. Feb 13, 2015 at 19:53
• @ErikP. Ah, apparently you gave the definition of quasigroups in universal algebra (en.wikipedia.org/wiki/Quasigroup); in fact, "an associative quasigroup are either empty or a group". Feb 13, 2015 at 20:05

On natural numbers, the bitwise XOR operation is commutative, and is its own inverse operation (the neutral element is$~0$).

• Also known as the Nim sum. Feb 12, 2015 at 13:12
• What about normal or? Feb 12, 2015 at 16:07
• @tox123 normal or (inclusive or) has no inverse: there's no way to invert $(\ldots \lor \sf true)$.
– chi
Feb 12, 2015 at 16:27
• Are there any examples on the reals where the operation is not its own inverse? Feb 12, 2015 at 23:38
• @RossPresser: Other answers (notably the accepted one) show that all elements must be of order (dividing) $2$, which mean the operation is its own inverse. This can be deduced using (in addition to what the question mentions) only associativity. Without associativity there are other examples, see the question that goblin linked to. Feb 13, 2015 at 19:07

Note that $-$ (minus) is really just a short way of writing $+$ something negative.

In fact, what you call $\circ^{-1}$ is just the composition $$G \times G \xrightarrow{id \times inv} G \times G \xrightarrow{\cdot (mult)} G$$

So the condition you are asking for $a \circ^{-1} b= b \circ ^{-1} a$ is equivalent to the condition $a\circ b^{-1}=b \circ a^{-1}$.

But this is equivalent to $a = b \circ a^{-1} \circ b$. If you demand that $G$ is commutative, then this is equivalent to $a^2=b^2$, which for example is true if all elements have order $2$.

EDIT As Klaus Draeger points out below, the implication that all elements have order two does not need commutativity (see his comment). But then again, if all elements have order two, the group must be commutative...

• You don't even need commutativity - the equation is also equivalent to $(a^{-1}b)^2=1$ for all $a,b$, and therefore all elements have order $2$. Feb 12, 2015 at 18:23
• @Klaus: Of course! Thanks for the comment. Feb 12, 2015 at 21:45

If we define $\circ^{-1}$ for a group, we have a neutral element $1$. Applying commutativity with b = 1 we get

$$1\circ^{-1} a = a \circ^{-1} 1$$ but this simplifies to $$a^{-1} = a$$

so each element is its own inverse.

• Don't know why this got downvoted; this is actually a pretty neat way to see that all elements must have order$~2$; easier than in the accepted answer by Frederik Meyer. It would have been a bit more readable though if it started with the inverse of $a$ on the far left, and had used $1$ as neutral element to match the multiplicative notation, but after all that is just notation. Feb 12, 2015 at 17:23
• I wasn't the original downvoter, but this is worded in a needlessly confusing way — the right equation doesn't follow from a∘1=a=1∘a. I see no good reason why reading such a simple proof should require going to the whiteboard: math.stackexchange.com/a/1146999/79293 Feb 13, 2015 at 20:13

If $G$ is an abelian group, then $ab^{-1}=ba^{-1}$ for all $a,b\in G$ if and only if each element of $G$ has order at most $2$.

The notion of inverse of an element can still be defined in the setting of inverse semigroups, which generalize groups.

An inverse semigroup is a semigroup $S$ such that, for every $x \in S$, there is a unique $x^*$ such that $x x^* x = x$ and $x^* x x^* = x^*$.

Then it can be seen that the operation $/$ defined by $x / y = x y^*$ is commutative if and only if $x = x^3$ for all $x$, if and only if $x = x^*$ for all $x$.

In particular, in every semilattice (a semilattice being a special case of inverse semigroup) the operation $/$ is commutative.

Edit. One can also put the result the following way. The operation $/$ is commutative if and only if the multiplication on $S$ is commutative and coincides with $/$.

Bonus. The operation $/$ is commutative if and only if it is associative.

• Note that the question was now changed to be only about groups... This answer is (now) more relevant to the (new) question about quasigroups: math.stackexchange.com/questions/1145034/… Feb 15, 2015 at 14:04
• Also, there's a name for such a quasigroup; it is called a "totally symmetric quasigroup". Feb 23, 2015 at 5:16

Part of the problem here is the difference between a function and an operation.

A function f(x) is defined as the mapping from objects x to their counterparts f(x). The inverse function f-1(x) is the mapping that takes the objects back to where they started.

So f(f-1(x))=x

Under this definition, “adding” is not a function, but “adding two” is a function.

I believe that what you want is what I would describe as a binary operation. It is effectively a function of two values.

I'm not sure that a binary operation can have an inverse in the proper sense, because how can we undo the addition to get the original pair of values? Given that add(x, y) = 6, for example, we can never determine which values x and y were added together.

So let's try to rephrase the question. I started thinking about addition and its “inverse” (or perhaps better “reverse”) subtraction. Subtraction can also be written as subtract(x, y) and it is not commutative; subtract(x, y) is not equal to subtract(y, x).

The effect of subtraction is really to reverse the addition process.

The question is therefore if there are a pair of functions f and g that act on two values that have this property:

f(g(x, y), y) = f(g(x, y), x)

But if f is the reverse of g, that would mean that f(g(a, b), b) = a

So we would end up with y = x

• First, the OP is using "inverse" in the sense used in early school (division is inverse to multiplication, etc., as he says), while you're using inverse in the standard mathematical sense. Both senses exist - in my native language and (I believe) in English. Second, have you read the other answers? They have a different result, so there must be an error somewhere. Third, I'm convinced the bug is in your proof, and I think that f(g(x, y), y) = f(g(x, y), x) is wrong — how does it relate to the statement? I only see tempting but wrong ways to get there. Feb 15, 2015 at 11:12
• @Blaisorblade: tomi's inverse is not in any "standard mathematical sense" I know of. I'm not aware of any such standard sense for inverting a function of two arguments other than considering them as a tuple, which would give you non-unique inverses here. What tomi is talking about is in quasigroup sense. His formula is wrong though, as you noticed. The correct one for inverse would be (in his notation) $g(f(x,y),y) = f(g(x,y),y)$. And commutativity for both $f$ and $g$ would mean $g(f(x,y),y) = g(y, f(x,y)) = f(g(x,y),y) = f(y, g(x,y))$, but this still does not imply his formula. Feb 15, 2015 at 13:51