# What is difference between idempotent magma and unital magma?

I don't understand well in what way idempotent element is wired to identity element in a magma context.

idempotent: $$x \cdot x = x$$
identity element: $$1 \cdot x = x = x \cdot 1$$

For example subtraction has $$0$$ as a right identity since $$x−0=x$$, but it doesn’t have a left identity. So is not a unital magma.

An example of a unital magma that is neither a monoid nor a loop is given by this table but I want understand if this is or is not a idempotent semigroup

$$\begin{array}{c|rrrr}& 1 & a & b \\\hline {1} & 1 & a & b \\ {a} & a & 1 & a \\ {b} & b & b & a & \end{array}$$

I want understand with examples these differences

• an example of unital magma that is not a idempotent semigroup
• an example of unital magma that is not a idempotent magma
• an example of idempotent magma that is not an idempotent semigroup
• if every idempotent magma requires the identity element then is an idempotent element an identity element of itself ?

I'm little confuse between idempotency and identity, I need some examples.

For example, can you provide me a closed operation under some set $$S$$ but not associative nor commutative but with identity element ?

• What do you call an "idempotent semigroup"? Is it a semigroup with an idempotent element? – Captain Lama Nov 19 at 17:21
• @CaptainLama: I would assume the same definition as with an idempotent magma: All elements are idempotent. For example, for a boolean lattice $(B,\vee,\wedge)$, both $(B,\vee)$ and $(B,\wedge)$ would be idempotent semigroups. – celtschk Nov 19 at 17:23

## 3 Answers

There are lots of very nice non-idempotent structures, so let's start there. Consider $$\mathbb{Z}$$ (with addition). This is in fact a group (so in particular an associative unital semigroup), but clearly not idempotent (since the only idempotent element is $$0$$).

What about idempotent magmas and semigroups? The only difference between the two is associativity, so to separate the two we just need a non-associative idempotent operation. A useful example of this is the "midpoint" algebra on a three-element set $$\{a,b,c\}$$: the operation is given by setting $$a*b=b*a=c, \quad a*c=c*a=b, \quad b*c=c*b=a$$ and $$a*a=a,\quad b*b=b,\quad c*c=c.$$ This is obviously idempotent, but it is not associative since e.g. $$(a*a)*b=a*b=c\color{red}{\not=}b=a*c=a*(a*b).$$ Note that in fact this is a commutative idempotent magma which is non-unital and non-associative (= not a semigroup).

Meanwhile, the "left projection" operation on a nonempty set $$A$$ (given by $$a*b=a$$ for all $$a,b\in A$$) is trivially associative and idempotent (so an idempotent semigroup) but neither unital (unless $$\vert A\vert=1$$) nor commutative.

Finally, you ask for an associative, commutative, and non-unital magma. Here we get back to nice natural examples: for instance, the positive reals with addition works.

Of course, that's not idempotent. If you want an idempotent, commutative, associative, non-unital magma, simply consider for $$X$$ a set with more than one element the magma $$(\mathcal{P}_{\not=\emptyset}(X); \cup)$$ - elements of this magma are nonempty subsets of $$X$$, and the binary operation is union.

For an example of a unital, non-associative, non-commutative magma, we can start with subtraction on the integers and use a neat trick: adjoining a new element with desired properties.

Specifically, let $$X=\mathbb{Z}\sqcup\{\xi\}$$ for a new element $$\xi$$, and let $$*$$ be the binary operation on $$X$$ defined as follows:

• If $$a,b\in\mathbb{Z}$$ then $$a*b=a-b$$.

• If $$a=\xi$$ then $$a*b=b$$, and if $$b=\xi$$ then $$a*b=a$$.

That is, we've forcibly adjoined an identity element to the integers with subtraction. The resulting magma is still non-associative and non-commutative (any magma with a non-associative/non-commutative submagma is itself non-associative/non-commutative) but is now also unital.

• Not exactly: I ask also for a unital magma that is not associative and not commutative, Integers under substraction is a closed operation and substraction is not commutative and not associative so we have a magma but this operation have only right identity, so is not a unital magma. I try to find a operation similar to substraction but also with the left identity.. That way I can get a unital magma. Problem in this situation is that identity for substraction is $0$ and not $1$. I wonder what operation I need to have. – Jack Nov 19 at 21:40
• @Jack See my edit. – Noah Schweber Nov 20 at 0:54
• Thank you. I had thought of another approach, too to compensate for the fact that substraction on the integers lack left identity and that is not associative and not commutative. We know that set of integers under multiplication ${\mathbb{Z}, \times}$ is a monoid and this is unital magma, this structure is associative and commutative. Instead of adjoining a new element with desired properties, we could introduce another binary operation (multiplication) by working together, instead of adding an identity element to the integers with subtraction, modifying the structure to make it unital. – Jack Nov 20 at 15:21
• So the idea is to have 2 binary operations (multiplication and subtraction) and then 2 structures that work together or in parallel (monoid and non-unital magma), instead of a single, forcibly adjoined magma. – Jack Nov 20 at 15:22
• @Jack If it has more than one binary operation it's not a magma any more. Adjoining elements works, adjoining operations doesn't. – Noah Schweber Nov 20 at 15:27

The example given in your table is a unital magma. It is not an idempotent magma, as $$bb = a ≠ b$$ and it is not a semigroup as $$(aa)b = b ≠ 1 = aa = a(ab)$$. Thus this example solves your first two questions.

Here is an example of an idempotent magma which is not a semigroup:

$$\begin{array}{c|rrrr} & a & b & c \\ \hline a & a & a & b \\ b & b & b & b \\ c & c & c & c \end{array}$$

If you want an idempotent magma with identity, just add an identity

$$\begin{array}{c|rrrrr} & 1 & a & b & c \\ \hline 1 & 1 & a & b & c \\ a & a & a & a & b \\ b & b & b & b & b \\ c & c & c & c & c \end{array}$$

Note that a magma can have at most one identity, but arbitrary many idempotent elements. The identity, if it exists, is always idempotent.

A magma is idempotent if all its elements are idempotent.

Your example magma is not idempotent because neither $$a$$ nor $$b$$ is an idempotent element ($$a^2=1\ne a$$, $$b^2=a\ne b$$).

Therefore your example fulfils the first two points in your list: It is an unital magma (as it contains an identity element, $$1$$), but not an idempotent magma (as not all of its elements are idempotent), and therefore also not an idempotent semigroup (actually is isn't a semigroup anyway, because it's not associative).

The term "an identity element of itself" doesn't make sense because an identity is defined globally (it is the identity of the magma, not of some element).

Note that you can create a magma with identity from any magma by just adding an identity, and an idempotent magma from any magma by simply replacing whatever value $$x^2$$ may have with $$x$$ (that is, in the table replace the diagonal elements with the row/column element).

For example, starting with your magma, $$\begin{array}{c|rrrr} & 1 & a & b \\ \hline 1 & 1 & a & b \\ a & a & 1 & a \\ b & b & b & a \end{array}$$ which already has an identity, you get an idempotent magma $$\begin{array}{c|rrrr} & 1 & a & b \\ \hline 1 & \color{red}{1} & a & b \\ a & a & \color{red}{a} & a \\ b & b & b & \color{red}{b} \end{array}$$ In this specific case, it happens to become also associative, and therefore a monoid (semigroup with identity).

• Thanks for clarification: if all its elements are idempotent. I forgot about this detail, I thought it was enough that it was the identity element, which in the case of magma is idempotent by definition to make it in itself idempotent. Instead they must also be all the other elements, if they were present. So in the case of magma with a single element as an identity element, idempotence and identity coincide because of the closing property that magma has by definition. I also believe that the confusion I was making is that the magma closure property of which we speak is always binary – Jack Nov 19 at 23:50
• I had considered a unary operation, but a set with a unary operation is not a magma, I don't know why I had considered the idempotency and the identity element in this way, perhaps because the combination as the third element of a binary operation gave me a single element that I had, instead, considered as the single operand of the unary operation whereas instead I had the result in my hands of a binary operation. – Jack Nov 19 at 23:50