# Is a monoid a magma?

According to this wikipedia page, a monoid is defined as an object that contains

1. An associative binary operation
2. An identity element

There is no mention of the object necessarily containing a set.

The same page includes the statement "a monoid is a semigroup with an identity element". It is my understanding that a semigroup is a magma with additional constraints, is this correct?

The page also compares a monoid and a magma, stating a monoid simply has more constraints. But doesn't a monoid lack magma's constraint of having to contain a set?

So does this mean a monoid does necessitate a set? Or have I misunderstood something?

I might just be nitpicking the specific wording of a wikipedia page, but I don't want to assume it's an error before I understand it for sure.

• Have you looked at the definition section of the article as opposed to the definition given in the introduction paragraph? – benguin Sep 12 '16 at 17:58
• Monoids, magmas, semigroups, groups, etc. all are supposed to be sets in the first place (or contain sets, if you mean the word "contain" in the sense of "a set is part of their specification"). – darij grinberg Sep 12 '16 at 17:58
• How no? "Suppose that S is a set and • is some binary operation..." – Billy Rubina Sep 12 '16 at 17:59
• It says that a monoid is an algebraic structure, which on its turn is a set with one or more finitary operations. Yes a monoid can be looked at as a magma with special properties. – drhab Sep 12 '16 at 17:59

So, yes. A monoid is a magma with associativity and identity which is also a semigroup with identity. Both the magma and monoid have an attached set, look both pages and see the definitions.

An algebraic structure is an object of the form $(S, f_1,\dots,f_k)$ where $f_1,\dots,f_k$ are operations on $S$, that is, they are functions $f_i\colon S^{r_i}\to S$, and $r_i$ is called the arity of the function $f_i$. A $0$-ary function is understood as a constant symbol. It is often required that $S$ be a nonempty set, but this is in many cases only a matter of convention.

So, a monoid is a structure $(S,f,id)$ where $f\colon S^2\to S$ and $id$ is $0$-ary (it is called the identity element in this context. Moreover we require that $f$ and $id$ satisfy $f(id,x)=x$ and $f(f(x,y),z)= f(x,f(y,z))$.

A magma is a structure $(S,f)$ with no additional restriction except that $f$ is $2$-ary. So even if properly speaking a monoid is not a magma, if you forget that the monoid has an identity element it becomes a magma (we call this "forgetting" operation a reduct in model theory).

Similarly, a semigroup is a structure $(S,f)$ where $f$ again needs to be associative. No identity element here, but every monoid can be understood as a semigroup by forgetting the identity element.

• What does n-ary mean? – Samy Bencherif Sep 13 '16 at 2:45
• A function $f\colon S^n\to S$ is said to have arity $n$, or we say that it is $n$-ary. – zarathustra Sep 13 '16 at 6:37
• Thank you, this also clarifies the term "finitary", which means the function takes a finite number of arguments – Samy Bencherif Sep 13 '16 at 13:49