Skip to content

Commit

Permalink
Adding the category of commutative rings to the category of tensor pr…
Browse files Browse the repository at this point in the history
…oducts of commutative algebras.
  • Loading branch information
tscrim committed Aug 30, 2022
1 parent 12be2d9 commit 5776c61
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion src/sage/categories/commutative_algebras.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@
# http://www.gnu.org/licenses/
#******************************************************************************

from sage.misc.cachefunc import cached_method
from sage.categories.category_with_axiom import CategoryWithAxiom_over_base_ring
from sage.categories.algebras import Algebras
from sage.categories.commutative_rings import CommutativeRings
from sage.categories.tensor import TensorProductsCategory

class CommutativeAlgebras(CategoryWithAxiom_over_base_ring):
"""
Expand All @@ -36,7 +39,7 @@ class CommutativeAlgebras(CategoryWithAxiom_over_base_ring):
True
sage: TestSuite(CommutativeAlgebras(ZZ)).run()
Todo:
.. TODO::
- product ( = Cartesian product)
- coproduct ( = tensor product over base ring)
Expand All @@ -58,3 +61,32 @@ def __contains__(self, A):
"""
return super().__contains__(A) or \
(A in Algebras(self.base_ring()) and hasattr(A, "is_commutative") and A.is_commutative())

class TensorProducts(TensorProductsCategory):
"""
The category of commutative algebras constructed by tensor product of commutative algebras.
"""

@cached_method
def extra_super_categories(self):
"""
EXAMPLES::
sage: Algebras(QQ).Commutative().TensorProducts().extra_super_categories()
[Category of commutative rings]
sage: Algebras(QQ).Commutative().TensorProducts().super_categories()
[Category of tensor products of algebras over Rational Field,
Category of commutative algebras over Rational Field]
TESTS::
sage: X = algebras.Shuffle(QQ, 'ab')
sage: Y = algebras.Shuffle(QQ, 'bc')
sage: X in Algebras(QQ).Commutative()
True
sage: T = tensor([X, Y])
sage: T in CommutativeRings()
True
"""
return [CommutativeRings()]

0 comments on commit 5776c61

Please sign in to comment.