Skip to content

Instantly share code, notes, and snippets.

@influentcoder
Created March 13, 2019 13:36
Show Gist options
  • Save influentcoder/9ecbfa882fa8937e2ad19953f5b7dd67 to your computer and use it in GitHub Desktop.
Save influentcoder/9ecbfa882fa8937e2ad19953f5b7dd67 to your computer and use it in GitHub Desktop.
Magma, Semigroups, Monoids, Groups

Summary

Closure Associativity Identity Invertibility
Magma Required
Semigroup Required Required
Monoid Required Required Required
Group Required Required Required Required

Magma

A magma consists of a set equipped with a single binary operation. The binary operation must be closed by definition but no other properties are imposed.

(See the definition of closure below)

A magma is a set M matched with an operation, •, that sends any two elements a, b ∈ M to another element, a • b. The symbol, •, is a general placeholder for a properly defined operation. To qualify as a magma, the set and operation (M, •) must satisfy the following requirement (known as the magma or closure axiom):

For all a, b in M, the result of the operation a • b is also in M.

And in mathematical notation:

alt text

Semigroup

A semigroup is an associative magma.

Monoid

A monoid is a semigroup with an identity element.

Group

A monoid in which each element has an inverse is a group.

Definitions

Closure

A set is closed under an operation if performance of that operation on members of the set always produces a member of that set. For example, the positive integers are closed under addition, but not under subtraction: 1 - 2 is not a positive integer even though both 1 and 2 are positive integers.

Associativity

Given a set S, for all associativity, the equation associativity2 holds.

Identity Element

Given a set S, there exists an element e in S such that for every element a in S, the equations e • a = a • e = a hold.

We say that 'e' is an identity element.

Inverse Element

For each a in a set S, there exists an element b in S, commonly denoted a−1 (or −a, if the operation is denoted "+"), such that a • b = b • a = e, where e is the identity element.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment