Finite semigroups¶
- class sage.categories.finite_semigroups.FiniteSemigroups(base_category)[source]¶
- Bases: - CategoryWithAxiom_singleton- The category of finite (multiplicative) semigroups. - A finite semigroup is a - finite setendowed with an associative binary operation \(*\).- Warning - Finite semigroups in Sage used to be automatically endowed with an - enumerated setstructure; the default enumeration is then obtained by iteratively multiplying the semigroup generators. This forced any finite semigroup to either implement an enumeration, or provide semigroup generators; this was often inconvenient.- Instead, finite semigroups that provide a distinguished finite set of generators with - semigroup_generators()should now explicitly declare themselves in the category of- finitely generated semigroups:- sage: Semigroups().FinitelyGenerated() Category of finitely generated semigroups - >>> from sage.all import * >>> Semigroups().FinitelyGenerated() Category of finitely generated semigroups - This is a backward incompatible change. - EXAMPLES: - sage: C = FiniteSemigroups(); C Category of finite semigroups sage: C.super_categories() [Category of semigroups, Category of finite sets] sage: sorted(C.axioms()) ['Associative', 'Finite'] sage: C.example() An example of a finite semigroup: the left regular band generated by ('a', 'b', 'c', 'd') - >>> from sage.all import * >>> C = FiniteSemigroups(); C Category of finite semigroups >>> C.super_categories() [Category of semigroups, Category of finite sets] >>> sorted(C.axioms()) ['Associative', 'Finite'] >>> C.example() An example of a finite semigroup: the left regular band generated by ('a', 'b', 'c', 'd') - class ParentMethods[source]¶
- Bases: - object- idempotents()[source]¶
- Return the idempotents of the semigroup. - EXAMPLES: - sage: S = FiniteSemigroups().example(alphabet=('x','y')) sage: sorted(S.idempotents()) ['x', 'xy', 'y', 'yx'] - >>> from sage.all import * >>> S = FiniteSemigroups().example(alphabet=('x','y')) >>> sorted(S.idempotents()) ['x', 'xy', 'y', 'yx'] 
 - j_classes()[source]¶
- Return the \(J\)-classes of the semigroup. - Two elements \(u\) and \(v\) of a monoid are in the same \(J\)-class if \(u\) divides \(v\) and \(v\) divides \(u\). - OUTPUT: - All the \(J\)-classes of self, as a list of lists. - EXAMPLES: - sage: S = FiniteSemigroups().example(alphabet=('a','b', 'c')) sage: sorted(map(sorted, S.j_classes())) # needs sage.graphs [['a'], ['ab', 'ba'], ['abc', 'acb', 'bac', 'bca', 'cab', 'cba'], ['ac', 'ca'], ['b'], ['bc', 'cb'], ['c']] - >>> from sage.all import * >>> S = FiniteSemigroups().example(alphabet=('a','b', 'c')) >>> sorted(map(sorted, S.j_classes())) # needs sage.graphs [['a'], ['ab', 'ba'], ['abc', 'acb', 'bac', 'bca', 'cab', 'cba'], ['ac', 'ca'], ['b'], ['bc', 'cb'], ['c']] 
 - j_classes_of_idempotents()[source]¶
- Return all the idempotents of self, grouped by J-class. - OUTPUT: list of lists - EXAMPLES: - sage: S = FiniteSemigroups().example(alphabet=('a','b', 'c')) sage: sorted(map(sorted, S.j_classes_of_idempotents())) # needs sage.graphs [['a'], ['ab', 'ba'], ['abc', 'acb', 'bac', 'bca', 'cab', 'cba'], ['ac', 'ca'], ['b'], ['bc', 'cb'], ['c']] - >>> from sage.all import * >>> S = FiniteSemigroups().example(alphabet=('a','b', 'c')) >>> sorted(map(sorted, S.j_classes_of_idempotents())) # needs sage.graphs [['a'], ['ab', 'ba'], ['abc', 'acb', 'bac', 'bca', 'cab', 'cba'], ['ac', 'ca'], ['b'], ['bc', 'cb'], ['c']] 
 - j_transversal_of_idempotents()[source]¶
- Return a list of one idempotent per regular J-class. - EXAMPLES: - sage: S = FiniteSemigroups().example(alphabet=('a','b', 'c')) - >>> from sage.all import * >>> S = FiniteSemigroups().example(alphabet=('a','b', 'c')) - The chosen elements depend on the order of each \(J\)-class, and that order is random when using Python 3. - sage: sorted(S.j_transversal_of_idempotents()) # random # needs sage.graphs ['a', 'ab', 'abc', 'ac', 'b', 'c', 'cb'] - >>> from sage.all import * >>> sorted(S.j_transversal_of_idempotents()) # random # needs sage.graphs ['a', 'ab', 'abc', 'ac', 'b', 'c', 'cb']