Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
r""" Finitely generated semigroups """ #***************************************************************************** # Copyright (C) 2014 Nicolas M. Thiery <nthiery at users.sf.net> # # Distributed under the terms of the GNU General Public License (GPL) # http://www.gnu.org/licenses/ #******************************************************************************
r""" The category of finitely generated (multiplicative) semigroups.
A :class:`finitely generated semigroup <Semigroups>` is a :class:`semigroup <Semigroups>` endowed with a distinguished finite set of generators (see :meth:`FinitelyGeneratedSemigroups.ParentMethods.semigroup_generators`). This makes it into an :class:`enumerated set <EnumeratedSets>`.
EXAMPLES::
sage: C = Semigroups().FinitelyGenerated(); C Category of finitely generated semigroups sage: C.super_categories() [Category of semigroups, Category of finitely generated magmas, Category of enumerated sets] sage: sorted(C.axioms()) ['Associative', 'Enumerated', 'FinitelyGeneratedAsMagma'] sage: C.example() An example of a semigroup: the free semigroup generated by ('a', 'b', 'c', 'd')
TESTS::
sage: TestSuite(C).run() """
def extra_super_categories(self): r""" State that a finitely generated semigroup is endowed with a default enumeration.
EXAMPLES::
sage: Semigroups().FinitelyGenerated().extra_super_categories() [Category of enumerated sets]
"""
r""" EXAMPLES::
sage: Semigroups().FinitelyGenerated().example() An example of a semigroup: the free semigroup generated by ('a', 'b', 'c', 'd') """
def semigroup_generators(self): r""" Return distinguished semigroup generators for ``self``.
OUTPUT: a finite family
This method should be implemented by all semigroups in :class:`FinitelyGeneratedSemigroups`.
EXAMPLES::
sage: S = FiniteSemigroups().example() sage: S.semigroup_generators() Family ('a', 'b', 'c', 'd') """
# TODO: update transitive ideal
r""" Return the successor function of the ``side``-sided Cayley graph of ``self``.
This is a function that maps an element of ``self`` to all the products of ``x`` by a generator of this semigroup, where the product is taken on the left, right, or both sides.
INPUT:
- ``side``: "left", "right", or "twosided"
.. TODO:: Design choice:
- find a better name for this method - should we return a set? a family?
EXAMPLES::
sage: S = FiniteSemigroups().example() sage: S.succ_generators("left" )(S('ca')) ('ac', 'bca', 'ca', 'dca') sage: S.succ_generators("right")(S('ca')) ('ca', 'cab', 'ca', 'cad') sage: S.succ_generators("twosided" )(S('ca')) ('ac', 'bca', 'ca', 'dca', 'ca', 'cab', 'ca', 'cad')
"""
r""" Return an iterator over the elements of ``self``.
This brute force implementation recursively multiplies together the distinguished semigroup generators.
.. SEEALSO:: :meth:`semigroup_generators`
EXAMPLES::
sage: S = FiniteSemigroups().example(alphabet=('x','y')) sage: it = S.__iter__() sage: list(it) ['x', 'y', 'yx', 'xy'] """ self.succ_generators(side="right"), enumeration='breadth'))
r""" Return the ``side``-sided ideal generated by ``gens``.
This brute force implementation recursively multiplies the elements of ``gens`` by the distinguished generators of this semigroup.
.. SEEALSO:: :meth:`semigroup_generators`
INPUT:
- ``gens`` -- a list (or iterable) of elements of ``self`` - ``side`` -- [default: "twosided"] "left", "right" or "twosided"
EXAMPLES::
sage: S = FiniteSemigroups().example() sage: list(S.ideal([S('cab')], side="left")) ['cab', 'acb', 'dcab', 'bca', 'abc', 'adcb', 'bdca', 'cba', 'cdab', 'bac', 'dacb', 'dbca', 'adbc', 'bcda', 'dbac', 'dabc', 'cbda', 'cdba', 'abdc', 'bdac', 'dcba', 'cadb', 'badc', 'acdb', 'abcd', 'cbad', 'bacd', 'acbd', 'bcad', 'cabd'] sage: list(S.ideal([S('cab')], side="right")) ['cab', 'cabd'] sage: list(S.ideal([S('cab')], side="twosided")) ['cab', 'acb', 'dcab', 'bca', 'cabd', 'abc', 'adcb', 'acbd', 'bdca', 'bcad', 'cba', 'cdab', 'bac', 'dacb', 'dbca', 'abcd', 'cbad', 'bacd', 'bcda', 'dbac', 'dabc', 'cbda', 'cdba', 'abdc', 'adbc', 'bdac', 'dcba', 'cadb', 'badc', 'acdb'] sage: list(S.ideal([S('cab')])) ['cab', 'acb', 'dcab', 'bca', 'cabd', 'abc', 'adcb', 'acbd', 'bdca', 'bcad', 'cba', 'cdab', 'bac', 'dacb', 'dbca', 'abcd', 'cbad', 'bacd', 'bcda', 'dbac', 'dabc', 'cbda', 'cdba', 'abdc', 'adbc', 'bdac', 'dcba', 'cadb', 'badc', 'acdb'] """
r""" Return an iterable containing some elements of the semigroup.
OUTPUT: the ten first elements of the semigroup, if they exist.
EXAMPLES::
sage: S = FiniteSemigroups().example(alphabet=('x','y')) sage: S.some_elements() ['x', 'y', 'yx', 'xy'] sage: S = FiniteSemigroups().example(alphabet=('x','y','z')) sage: S.some_elements() ['x', 'y', 'z', 'xz', 'yx', 'yz', 'zx', 'zy', 'xy', 'yxz'] """
|