AUTHORS:
Every Sage object lies in a category. Categories in Sage are modeled on the mathematical idea of category, and are distinct from Python classes, which are a programming construct.
In most cases, typing x.category() returns the
category to which belongs. If
is a category
and
is any object,
tries to make an
object in
from
.
EXAMPLES: We create a couple of categories.
sage: Sets()
Category of sets
sage: GSets(AbelianGroup([2,4,9]))
Category of G-sets for Multiplicative Abelian Group isomorphic to C2 x C4 x C9
sage: Semigroups()
Category of semigroups
sage: VectorSpaces(FiniteField(11))
Category of vector spaces over Finite Field of size 11
sage: Ideals(IntegerRing())
Category of ring ideals in Integer Ring
The default category for elements of an objects
is the category of all objects of
. For
example,
sage: V = VectorSpace(RationalField(), 3)
sage: x = V.gen(1)
sage: x.category()
Category of elements of Vector space of dimension 3 over Rational Field
The base class for all categories.
Returns True if self is naturally embedded as a subcategory of c.
EXAMPLES:
sage: Rings = Rings()
sage: AbGrps = AbelianGroups()
sage: Rings.is_subcategory(AbGrps)
True
sage: AbGrps.is_subcategory(Rings)
False
The is_subcategory function takes into account the base.
sage: M3 = VectorSpaces(FiniteField(3))
sage: M9 = VectorSpaces(FiniteField(9, 'a'))
sage: M3.is_subcategory(M9)
False
The category of sets.
For pickling.