Semigroup

In algebra, a semigroup is a set equipped with a binary operation satisfying certain properties similar to but less stringent than those of a group. A motivating example of a semigroup is the set of positive integers with multiplication as the operation.

Formally, a semigroup is a set S with a binary operation $$\star$$ satisfying the following conditions:
 * S is closed under $$\star$$;
 * The operation $$\star$$ is associative.

A commutative semigroup is one which satisfies the further property that $$x \star y = y \star x$$ for all x and y in S. Commutative semigroups are often written additively.

A subsemigroup of S is a subset T of S which is closed under the binary operation.

A semigroup homomorphism f from semigroup $$(S,{\star})$$ to $$(T,{\circ})$$ is a map from S to T satisfying


 * $$f(x \star y) = f(x) \circ f(y) . \, $$

Examples

 * The non-negative integers under addition form a commutative semigroup.
 * The positive integers under multiplication form a commutative semigroup.
 * Square matrices under matrix multiplication form a semigroup, not in general commutative.
 * Every monoid is a semigroup, by "forgetting" the identity element.
 * Every group is a semigrpup, by "forgetting" the identity element and inverse operation.

Cancellation property
A semigroup satisfies the cancellation property if


 * $$xz = yz \Rightarrow x = y \, $$ and
 * $$zx = zy \Rightarrow x = y . \, $$

A semigroup is a subsemigroup of a group if and only if it satisfies the cancellation property.