Magmas and Additive Magmas¶
-
class
sage.categories.magmas_and_additive_magmas.
MagmasAndAdditiveMagmas
(s=None)¶ Bases:
sage.categories.category_singleton.Category_singleton
The category of sets
with an additive operation ‘+’ and a multiplicative operation
EXAMPLES:
sage: from sage.categories.magmas_and_additive_magmas import MagmasAndAdditiveMagmas sage: C = MagmasAndAdditiveMagmas(); C Category of magmas and additive magmas
This is the base category for the categories of rings and their variants:
sage: C.Distributive() Category of distributive magmas and additive magmas sage: C.Distributive().Associative().AdditiveAssociative().AdditiveCommutative().AdditiveUnital().AdditiveInverse() Category of rngs sage: C.Distributive().Associative().AdditiveAssociative().AdditiveCommutative().AdditiveUnital().Unital() Category of semirings sage: C.Distributive().Associative().AdditiveAssociative().AdditiveCommutative().AdditiveUnital().AdditiveInverse().Unital() Category of rings
This category is really meant to represent the intersection of the categories of
Magmas
andAdditiveMagmas
; however Sage’s infrastructure does not allow yet to model this:sage: Magmas() & AdditiveMagmas() Join of Category of magmas and Category of additive magmas sage: Magmas() & AdditiveMagmas() # todo: not implemented Category of magmas and additive magmas
TESTS:
sage: TestSuite(MagmasAndAdditiveMagmas()).run()
-
Distributive
¶ alias of
DistributiveMagmasAndAdditiveMagmas
-
class
SubcategoryMethods
¶ -
Distributive
()¶ Return the full subcategory of the objects of
self
whereis distributive on
.
A
magma
andadditive magma
is distributive if, for all
,
EXAMPLES:
sage: from sage.categories.magmas_and_additive_magmas import MagmasAndAdditiveMagmas sage: C = MagmasAndAdditiveMagmas().Distributive(); C Category of distributive magmas and additive magmas
Note
Given that Sage does not know that
MagmasAndAdditiveMagmas
is the intersection ofMagmas
andAdditiveMagmas
, this method is not available for:sage: Magmas() & AdditiveMagmas() Join of Category of magmas and Category of additive magmas
Still, the natural syntax works:
sage: (Magmas() & AdditiveMagmas()).Distributive() Category of distributive magmas and additive magmas
thanks to a workaround implemented in
Magmas.SubcategoryMethods.Distributive()
:sage: (Magmas() & AdditiveMagmas()).Distributive.__module__ 'sage.categories.magmas'
TESTS:
sage: TestSuite(C).run() sage: Fields().Distributive.__module__ 'sage.categories.magmas_and_additive_magmas'
-
-
MagmasAndAdditiveMagmas.
additional_structure
()¶ Return
None
.Indeed, this category is meant to represent the join of
AdditiveMagmas
andMagmas
. As such, it defines no additional structure.See also
EXAMPLES:
sage: from sage.categories.magmas_and_additive_magmas import MagmasAndAdditiveMagmas sage: MagmasAndAdditiveMagmas().additional_structure()
-
MagmasAndAdditiveMagmas.
super_categories
()¶ EXAMPLES:
sage: from sage.categories.magmas_and_additive_magmas import MagmasAndAdditiveMagmas sage: MagmasAndAdditiveMagmas().super_categories() [Category of magmas, Category of additive magmas]
-