Covariant Functorial Constructions¶
A functorial construction is a collection of functors
(indexed by a collection of categories) which associate
to a sequence of parents
in a category
a parent
. Typical examples of functorial
constructions are
cartesian_product
and tensor_product
.
The category of , which only depends on
, is
called the (functorial) construction category.
A functorial construction is (category)-covariant if for every
categories and
, the category of
is a subcategory of the category of
whenever
is a subcategory of
. A functorial construction is
(category)-regressive if the category of
is a
subcategory of
.
The goal of this module is to provide generic support for covariant
functorial constructions. In particular, given some parents ,
,
..., in respective categories
,
, ..., it provides tools
for calculating the best known category for the parent
. For examples, knowing that cartesian products of
semigroups (resp. monoids, groups) have a semigroup (resp. monoid,
group) structure, and given a group
and two monoids
and
it
can calculate that
is naturally endowed with a
monoid structure.
See CovariantFunctorialConstruction
,
CovariantConstructionCategory
and
RegressiveCovariantConstructionCategory
for more details.
AUTHORS:
- Nicolas M. Thiery (2010): initial revision
-
class
sage.categories.covariant_functorial_construction.
CovariantConstructionCategory
(category, *args)¶ Bases:
sage.categories.covariant_functorial_construction.FunctorialConstructionCategory
Abstract class for categories
obtained through a covariant functorial construction
-
additional_structure
()¶ Return the additional structure defined by
self
.By default, a functorial construction category
A.F()
defines additional structure if and only ifis the category defining
. The rationale is that, for a subcategory
of
, the fact that
morphisms shall preserve the
-specific structure is already imposed by
.
EXAMPLES:
sage: Modules(ZZ).Graded().additional_structure() Category of graded modules over Integer Ring sage: Algebras(ZZ).Graded().additional_structure()TESTS:
sage: Modules(ZZ).Graded().additional_structure.__module__ 'sage.categories.covariant_functorial_construction'
-
classmethod
default_super_categories
(category, *args)¶ Return the default super categories of
for
parents in
.
INPUT:
cls
– the category class for the functorcategory
– a category*args
– further arguments for the functor
OUTPUT: a (join) category
The default implementation is to return the join of the categories of
for
in turn in each of the super categories of
category
.This is implemented as a class method, in order to be able to reconstruct the functorial category associated to each of the super categories of
category
.EXAMPLES:
Bialgebras are both algebras and coalgebras:
sage: Bialgebras(QQ).super_categories() [Category of algebras over Rational Field, Category of coalgebras over Rational Field]
Hence tensor products of bialgebras are tensor products of algebras and tensor products of coalgebras:
sage: Bialgebras(QQ).TensorProducts().super_categories() [Category of tensor products of algebras over Rational Field, Category of tensor products of coalgebras over Rational Field]
Here is how
default_super_categories()
was called internally:sage: sage.categories.tensor.TensorProductsCategory.default_super_categories(Bialgebras(QQ)) Join of Category of tensor products of algebras over Rational Field and Category of tensor products of coalgebras over Rational Field
We now show a similar example, with the
Algebra
functor which takes a parameter:
sage: FiniteMonoids().super_categories() [Category of monoids, Category of finite semigroups] sage: sorted(FiniteMonoids().Algebras(QQ).super_categories(), key=str) [Category of finite dimensional algebras with basis over Rational Field, Category of finite set algebras over Rational Field, Category of monoid algebras over Rational Field]
Note that neither the category of finite semigroup algebras nor that of monoid algebras appear in the result; this is because there is currently nothing specific implemented about them.
Here is how
default_super_categories()
was called internally:sage: sage.categories.algebra_functor.AlgebrasCategory.default_super_categories(FiniteMonoids(), QQ) Join of Category of finite dimensional algebras with basis over Rational Field and Category of monoid algebras over Rational Field and Category of finite set algebras over Rational Field
-
is_construction_defined_by_base
()¶ Return whether the construction is defined by the base of
self
.EXAMPLES:
The graded functorial construction is defined by the modules category. Hence this method returns
True
for graded modules andFalse
for other graded xxx categories:sage: Modules(ZZ).Graded().is_construction_defined_by_base() True sage: Algebras(QQ).Graded().is_construction_defined_by_base() False sage: Modules(ZZ).WithBasis().Graded().is_construction_defined_by_base() False
This is implemented as follows: given the base category
and the construction
of
self
, that isself=A.F()
, check whether no super category ofhas
defined.
Note
Recall that, when
does not implement the construction
F
, a join category is returned. Therefore, in such cases, this method is not available:sage: Coalgebras(QQ).Graded().is_construction_defined_by_base() Traceback (most recent call last): ... AttributeError: 'JoinCategory_with_category' object has no attribute 'is_construction_defined_by_base'
-
-
class
sage.categories.covariant_functorial_construction.
CovariantFunctorialConstruction
¶ Bases:
sage.structure.unique_representation.UniqueRepresentation
,sage.structure.sage_object.SageObject
An abstract class for construction functors
(eg
= cartesian product, tensor product,
-algebra, ...) such that:
- Each category
(eg
Groups()
) can provide a categoryfor parents constructed via this functor (e.g.
CartesianProductsOf(Groups())
). - For every category
,
is a subcategory of
for every super category
of
(the functorial construction is (category)-covariant).
- For parents
,
, ..., respectively in the categories
,
, ..., the category of
is
where
is the meet of the categories
,
, ...,.
This covers two slightly different use cases:
In the first use case, one uses directly the construction functor to create new parents:
sage: tensor() # todo: not implemented (add an example)
or even new elements, which indirectly constructs the corresponding parent:
sage: tensor(...) # todo: not implemented
In the second use case, one implements a parent, and then put it in the category
to specify supplementary mathematical information about that parent.
The main purpose of this class is to handle automatically the trivial part of the category hierarchy. For example,
CartesianProductsOf(Groups())
is set automatically as a subcategory ofCartesianProductsOf(Monoids())
.In practice, each subclass of this class should provide the following attributes:
_functor_category
- a string which should match the name of the nested category class to be used in each category to specify information and generic operations for elements of this category._functor_name
- an string which specifies the name of the functor, and also (when relevant) of the method on parents and elements used for calling the construction.
TODO: What syntax do we want for
? For example, for the tensor product construction, which one of the followings do we want (see chat on IRC, on 07/12/2009):
tensor(Cat)
tensor((Cat, Cat))
tensor.of((Cat, Cat))
tensor.category_from_categories((Cat, Cat, Cat))
Cat.TensorProducts()
The syntax
Cat.TensorProducts()
does not supports well multivariate constructions liketensor.of([Algebras(), HopfAlgebras(), ...])
. Also it forces every category to be (somehow) aware of all the tensorial construction that could apply to it, even those which are only induced from super categories.Note: for each functorial construction, there probably is one (or several) largest categories on which it applies. For example, the
CartesianProducts()
construction makes only sense for concrete categories, that is subcategories ofSets()
. Maybe we want to model this one way or the other.-
category_from_categories
(categories)¶ Return the category of
for
parents in the given categories.
INPUT:
self
: a functorcategories
: a non empty tuple of categories
EXAMPLES:
sage: Cat1 = Rings() sage: Cat2 = Groups() sage: cartesian_product.category_from_categories((Cat1, Cat1, Cat1)) Join of Category of rings and ... and Category of Cartesian products of monoids and Category of Cartesian products of commutative additive groups sage: cartesian_product.category_from_categories((Cat1, Cat2)) Category of Cartesian products of monoids
-
category_from_category
(category)¶ Return the category of
for
parents in
category
.INPUT:
self
: a functorcategory
: a category
EXAMPLES:
sage: tensor.category_from_category(ModulesWithBasis(QQ)) Category of tensor products of vector spaces with basis over Rational Field
# TODO: add support for parametrized functors
-
category_from_parents
(parents)¶ Return the category of
for
parents.
INPUT:
- self: a functor F
- parents: a list (or iterable) of parents.
EXAMPLES:
sage: E = CombinatorialFreeModule(QQ, ["a", "b", "c"]) sage: tensor.category_from_parents((E, E, E)) Category of tensor products of vector spaces with basis over Rational Field
- Each category
-
class
sage.categories.covariant_functorial_construction.
FunctorialConstructionCategory
(category, *args)¶ Bases:
sage.categories.category.Category
Abstract class for categories
obtained through a functorial construction
-
base_category
()¶ Return the base category of the category
self
.For any category
B
=obtained through a functorial construction
, the call
B.base_category()
returns the category.
EXAMPLES:
sage: Semigroups().Quotients().base_category() Category of semigroups
-
classmethod
category_of
(category, *args)¶ Return the image category of the functor
.
This is the main entry point for constructing the category
of parents
constructed from parents
in
.
INPUT:
cls
– the category class for the functorial constructioncategory
– a category*args
– further arguments for the functor
EXAMPLES:
sage: sage.categories.tensor.TensorProductsCategory.category_of(ModulesWithBasis(QQ)) Category of tensor products of vector spaces with basis over Rational Field sage: sage.categories.algebra_functor.AlgebrasCategory.category_of(FiniteMonoids(), QQ) Join of Category of finite dimensional algebras with basis over Rational Field and Category of monoid algebras over Rational Field and Category of finite set algebras over Rational Field
-
extra_super_categories
()¶ Return the extra super categories of a construction category.
Default implementation which returns
[]
.EXAMPLES:
sage: Sets().Subquotients().extra_super_categories() [] sage: Semigroups().Quotients().extra_super_categories() []
-
super_categories
()¶ Return the super categories of a construction category.
EXAMPLES:
sage: Sets().Subquotients().super_categories() [Category of sets] sage: Semigroups().Quotients().super_categories() [Category of subquotients of semigroups, Category of quotients of sets]
-
-
class
sage.categories.covariant_functorial_construction.
RegressiveCovariantConstructionCategory
(category, *args)¶ Bases:
sage.categories.covariant_functorial_construction.CovariantConstructionCategory
Abstract class for categories
obtained through a regressive covariant functorial construction
-
classmethod
default_super_categories
(category, *args)¶ Return the default super categories of
for
parents in
.
INPUT:
cls
– the category class for the functorcategory
– a category*args
– further arguments for the functor
OUTPUT:
A join category.
This implements the property that an induced subcategory is a subcategory.
EXAMPLES:
A subquotient of a monoid is a monoid, and a subquotient of semigroup:
sage: Monoids().Subquotients().super_categories() [Category of monoids, Category of subquotients of semigroups]
TESTS:
sage: C = Monoids().Subquotients() sage: C.__class__.default_super_categories(C.base_category(), *C._args) Category of unital subquotients of semigroups
-
classmethod