The category of sets $$(S,+,*)$$ with an additive operation ‘+’ and a multiplicative operation $$*$$

EXAMPLES:

sage: from sage.categories.magmas_and_additive_magmas import MagmasAndAdditiveMagmas
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
Category of rngs
Category of semirings
Category of rings


This category is really meant to represent the intersection of the categories of Magmas and AdditiveMagmas; 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

class CartesianProducts(category, *args)
extra_super_categories()

Implement the fact that this structure is stable under Cartesian products.

Distributive
class SubcategoryMethods

Bases: object

Distributive()

Return the full subcategory of the objects of self where $$*$$ is distributive on $$+$$.

A magma and additive magma $$M$$ is distributive if, for all $$x,y,z \in M$$,

$x * (y+z) = x*y + x*z \text{ and } (x+y) * z = x*z + y*z$

EXAMPLES:

sage: from sage.categories.magmas_and_additive_magmas import MagmasAndAdditiveMagmas
Category of distributive magmas and additive magmas


Note

Given that Sage does not know that MagmasAndAdditiveMagmas is the intersection of Magmas and AdditiveMagmas, 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'


Return None.

Indeed, this category is meant to represent the join of AdditiveMagmas and Magmas. As such, it defines no additional structure.

EXAMPLES:

sage: from sage.categories.magmas_and_additive_magmas import MagmasAndAdditiveMagmas

sage: from sage.categories.magmas_and_additive_magmas import MagmasAndAdditiveMagmas