# Magma
Is **a set of all possible values of $a$ together with a binary operation on that set**, which is defined as an operation with the following signature: $a \rightarrow a \rightarrow a$. You can **think of a binary operation as 'combining' elements of the same type into another element of that same type**.
## Properties of Binary Operations
- [[Associativity]]
- [[Identity]]
- [[Divisibility]] (and when combined with [[Identity]]: [[Invertibility]])
- [[Commutativity]]
When thinking about the definitions of binary operations it's important to remember that it is up to the set to define what equality actually means. This is important to think about, when defining magmas in OOP languages that do not enforce [[Referential transparency]].
## Categorizations
### [[Semigroups]] (with [[Associativity]])
- Magma with [[Associativity]] is a semigroup
- Semigroup with [[Identity]] is a [[Monoid]]
- [[Monoid]] with [[Divisibility]] is a group
### [[Quasigroups]] (with [[Divisibility]])
- Magma with [[Divisibility]] is a quasigroup
- Quasigroup with [[Identity]] is a loop
- Loop with [[Associativity]] is a group
### Others
- Magma with [[Identity]] is a unital magma
- Magma with [[Divisibility]] and [[Associativity]] is an inverse semigroup
![[600px-Magma_to_group4.svg.png|300]]
## Sources
- [[Monoids, Semigroups, and Friends]]