20.1 Categories

Module: sage.categories.category

Categories

Author: David Kohel and William Stein

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 $ x$ belongs. If $ C$ is a category and $ x$ is any object, $ C(x)$ tries to make an object in $ C$ from $ x$ .

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 $ x$ of an objects $ O$ is the category of all objects of $ O$ . 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

Module-level Functions

is_Category( x)

Returns True if x is a category.

See About this document... for information on suggesting changes.