Examples of semigroups

sage.categories.examples.semigroups.FreeSemigroup

An example of semigroup.

The purpose of this class is to provide a minimal template for implementing of a semigroup.

EXAMPLES:

sage: S = Semigroups().example("free"); S
An example of a semigroup: the free semigroup generated by ('a', 'b', 'c', 'd')

This is the free semigroup generated by:

sage: S.semigroup_generators()
Family ('a', 'b', 'c', 'd')

and with product given by concatenation:

sage: S('dab') * S('acb')
'dabacb'
class sage.categories.examples.semigroups.IncompleteSubquotientSemigroup(category=None)

Bases: sage.structure.unique_representation.UniqueRepresentation, sage.structure.parent.Parent

An incompletely implemented subquotient semigroup, for testing purposes

EXAMPLES:

sage: S = sage.categories.examples.semigroups.IncompleteSubquotientSemigroup()
sage: S
A subquotient of An example of a semigroup: the left zero semigroup
class Element

Bases: sage.structure.element_wrapper.ElementWrapper

ambient()

Returns the ambient semigroup.

EXAMPLES:

sage: S = Semigroups().Subquotients().example()
sage: S.ambient()
An example of a semigroup: the left zero semigroup
sage.categories.examples.semigroups.LeftZeroSemigroup

An example of a semigroup.

This class illustrates a minimal implementation of a semigroup.

EXAMPLES:

sage: S = Semigroups().example(); S
An example of a semigroup: the left zero semigroup

This is the semigroup that contains all sorts of objects:

sage: S.some_elements()
[3, 42, 'a', 3.4, 'raton laveur']

with product rule given by \(a \times b = a\) for all \(a, b\):

sage: S('hello') * S('world')
'hello'
sage: S(3)*S(1)*S(2)
3
sage: S(3)^12312321312321
3
sage.categories.examples.semigroups.QuotientOfLeftZeroSemigroup

Example of a quotient semigroup

EXAMPLES:

sage: S = Semigroups().Subquotients().example(); S
An example of a (sub)quotient semigroup: a quotient of the left zero semigroup

This is the quotient of:

sage: S.ambient()
An example of a semigroup: the left zero semigroup

obtained by setting \(x=42\) for any \(x\geq 42\):

sage: S(100)
42
sage: S(100) == S(42)
True

The product is inherited from the ambient semigroup:

sage: S(1)*S(2) == S(1)
True