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""" Bimodules """ #***************************************************************************** # Copyright (C) 2005 David Kohel <kohel@maths.usyd.edu> # William Stein <wstein@math.ucsd.edu> # 2008 Teresa Gomez-Diaz (CNRS) <Teresa.Gomez-Diaz@univ-mlv.fr> # 2008-2009 Nicolas M. Thiery <nthiery at users.sf.net> # # Distributed under the terms of the GNU General Public License (GPL) # http://www.gnu.org/licenses/ #****************************************************************************** from __future__ import print_function
from sage.categories.category import Category, CategoryWithParameters from sage.categories.left_modules import LeftModules from sage.categories.right_modules import RightModules
from sage.categories.rings import Rings _Rings = Rings()
#?class Bimodules(Category_over_base_rng, Category_over_base_rng): class Bimodules(CategoryWithParameters): """ The category of `(R,S)`-bimodules
For `R` and `S` rings, a `(R,S)`-bimodule `X` is a left `R`-module and right `S`-module such that the left and right actions commute: `r*(x*s) = (r*x)*s`.
EXAMPLES::
sage: Bimodules(QQ, ZZ) Category of bimodules over Rational Field on the left and Integer Ring on the right sage: Bimodules(QQ, ZZ).super_categories() [Category of left modules over Rational Field, Category of right modules over Integer Ring] """
def __init__(self, left_base, right_base, name=None): """ EXAMPLES::
sage: C = Bimodules(QQ, ZZ) sage: TestSuite(C).run() """ (isinstance(left_base, Category) and left_base.is_subcategory(Rings())) ): raise ValueError("the left base must be a ring or a subcategory of Rings()") (isinstance(right_base, Category) and right_base.is_subcategory(Rings())) ): raise ValueError("the right base must be a ring or a subcategory of Rings()")
def _make_named_class_key(self, name): r""" Return what the element/parent/... classes depend on.
Since :trac:`11935`, the element and parent classes of a bimodule only depend on the categories of the left and right base ring.
.. SEEALSO::
- :meth:`CategoryWithParameters` - :meth:`CategoryWithParameters._make_named_class_key`
EXAMPLES::
sage: Bimodules(QQ,ZZ)._make_named_class_key('parent_class') (Join of Category of number fields and Category of quotient fields and Category of metric spaces, Join of Category of euclidean domains and Category of infinite enumerated sets and Category of metric spaces)
sage: Bimodules(Fields(), ZZ)._make_named_class_key('element_class') (Category of fields, Join of Category of euclidean domains and Category of infinite enumerated sets and Category of metric spaces)
sage: Bimodules(QQ, Rings())._make_named_class_key('element_class') (Join of Category of number fields and Category of quotient fields and Category of metric spaces, Category of rings)
sage: Bimodules(Fields(), Rings())._make_named_class_key('element_class') (Category of fields, Category of rings) """ self._right_base_ring if isinstance(self._right_base_ring, Category) else self._right_base_ring.category())
@classmethod def an_instance(cls): """ Return an instance of this class.
EXAMPLES::
sage: Bimodules.an_instance() Category of bimodules over Rational Field on the left and Real Field with 53 bits of precision on the right """
def _repr_object_names(self): """ EXAMPLES::
sage: Bimodules(QQ, ZZ) # indirect doctest Category of bimodules over Rational Field on the left and Integer Ring on the right """ %(self._left_base_ring, self._right_base_ring)
def left_base_ring(self): """ Return the left base ring over which elements of this category are defined.
EXAMPLES::
sage: Bimodules(QQ, ZZ).left_base_ring() Rational Field """
def right_base_ring(self): """ Return the right base ring over which elements of this category are defined.
EXAMPLES::
sage: Bimodules(QQ, ZZ).right_base_ring() Integer Ring """
def _latex_(self): """ Return a latex representation of ``self``.
EXAMPLES::
sage: print(Bimodules(QQ, ZZ)._latex_()) {\mathbf{Bimodules}}_{\Bold{Q}, \Bold{Z}} """ latex(self._left_base_ring), latex(self._right_base_ring))
def super_categories(self): """ EXAMPLES::
sage: Bimodules(QQ, ZZ).super_categories() [Category of left modules over Rational Field, Category of right modules over Integer Ring] """
def additional_structure(self): r""" Return ``None``.
Indeed, the category of bimodules defines no additional structure: a left and right module morphism between two bimodules is a bimodule morphism.
.. SEEALSO:: :meth:`Category.additional_structure`
.. TODO:: Should this category be a :class:`CategoryWithAxiom`?
EXAMPLES::
sage: Bimodules(QQ, ZZ).additional_structure() """
class ParentMethods: pass
class ElementMethods: pass |