Monoids

class sage.categories.monoids.Monoids(s=None)

Bases: sage.categories.category_singleton.Category_singleton

The category of (multiplicative) monoids, i.e. semigroups with a unit.

EXAMPLES:

sage: Monoids()
Category of monoids
sage: Monoids().super_categories()
[Category of semigroups]
sage: Monoids().all_super_categories()
[Category of monoids,
 Category of semigroups,
 Category of magmas,
 Category of sets,
 Category of sets with partial maps,
 Category of objects]

TESTS:

sage: C = Monoids()
sage: TestSuite(C).run()
class Algebras(base_category, base_ring)

Bases: sage.categories.algebra_functor.AlgebrasCategory

EXAMPLES:

sage: C = Semigroups().Algebras(QQ)
sage: C
Category of semigroup algebras over Rational Field
sage: C.base_category()
Category of semigroups
sage: C.super_categories()
[Category of algebras with basis over Rational Field, Category of set algebras over Rational Field]

TESTS:

sage: C._short_name()
'Algebras'
sage: latex(C) # todo: improve that
\mathbf{Algebras}(\mathbf{Semigroups})
ElementMethods

alias of Algebras.ElementMethods

ParentMethods

alias of Algebras.ParentMethods

extra_super_categories()

EXAMPLES:

sage: Monoids().Algebras(QQ).extra_super_categories()
[Category of algebras with basis over Rational Field]
sage: Monoids().Algebras(QQ).super_categories()
[Category of semigroup algebras over Rational Field]

sage: Monoids().example().algebra(ZZ).categories()
[Category of monoid algebras over Integer Ring,
 Category of semigroup algebras over Integer Ring,
 Category of algebras with basis over Integer Ring,
 ...
 Category of objects]
class Monoids.CartesianProducts(category, *args)

Bases: sage.categories.cartesian_product.CartesianProductsCategory

The category of monoids constructed as cartesian products of monoids

ParentMethods

alias of CartesianProducts.ParentMethods

extra_super_categories()

A cartesian product of monoids is endowed with a natural monoid structure.

EXAMPLES:

sage: Monoids().CartesianProducts().extra_super_categories()
[Category of monoids]
sage: Monoids().CartesianProducts().super_categories()
[Category of monoids, Category of Cartesian products of semigroups]
class Monoids.ElementMethods
is_one()

Returns whether self is the one of the monoid

The default implementation, is to compare with self.one().

TESTS:

sage: S = Monoids().example()
sage: S.one().is_one()
True
sage: S("aa").is_one()
False
class Monoids.ParentMethods
one()

Returns the one of the monoid, that is the unique neutral element for \(*\).

Note

The default implementation is to coerce \(1\) into self. It is recommended to override this method because the coercion from the integers:

  • is not always meaningful (except for \(1\));
  • often uses self.one().

EXAMPLES:

sage: M = Monoids().example(); M
An example of a monoid: the free monoid generated by ('a', 'b', 'c', 'd')
sage: M.one()
''
one_element()

Backward compatibility alias for one().

TESTS:

sage: S = Monoids().example()
sage: S.one_element()
''
prod(args)

n-ary product

INPUT:
  • args – a list (or iterable) of elements of self

Returns the product of the elements in args, as an element of self.

EXAMPLES:

sage: S = Monoids().example()
sage: S.prod([S('a'), S('b')])
'ab'
class Monoids.Subquotients(category, *args)

Bases: sage.categories.subquotients.SubquotientsCategory

TESTS:

sage: from sage.categories.covariant_functorial_construction import CovariantConstructionCategory
sage: class FooBars(CovariantConstructionCategory):
...       _functor_category = "FooBars"
sage: Category.FooBars = lambda self: FooBars.category_of(self)
sage: C = FooBars(ModulesWithBasis(ZZ))
sage: C
Category of foo bars of modules with basis over Integer Ring
sage: C.base_category()
Category of modules with basis over Integer Ring
sage: latex(C)
\mathbf{FooBars}(\mathbf{ModulesWithBasis}_{\Bold{Z}})
sage: import __main__; __main__.FooBars = FooBars # Fake FooBars being defined in a python module
sage: TestSuite(C).run()
ParentMethods

alias of Subquotients.ParentMethods

class Monoids.WithRealizations(category, *args)

Bases: sage.categories.with_realizations.WithRealizationsCategory

TESTS:

sage: from sage.categories.covariant_functorial_construction import CovariantConstructionCategory
sage: class FooBars(CovariantConstructionCategory):
...       _functor_category = "FooBars"
sage: Category.FooBars = lambda self: FooBars.category_of(self)
sage: C = FooBars(ModulesWithBasis(ZZ))
sage: C
Category of foo bars of modules with basis over Integer Ring
sage: C.base_category()
Category of modules with basis over Integer Ring
sage: latex(C)
\mathbf{FooBars}(\mathbf{ModulesWithBasis}_{\Bold{Z}})
sage: import __main__; __main__.FooBars = FooBars # Fake FooBars being defined in a python module
sage: TestSuite(C).run()
ParentMethods

alias of WithRealizations.ParentMethods

Monoids.super_categories()

Returns a list of the immediate super categories of self.

EXAMPLES:

sage: Monoids().super_categories()
[Category of semigroups]

Previous topic

Monoid algebras

Next topic

Number fields

This Page