# Distributive Magmas and Additive Magmas¶

The category of sets $$(S,+,*)$$ with $$*$$ distributing on $$+$$.

This is similar to a ring, but $$+$$ and $$*$$ are only required to be (additive) magmas.

EXAMPLES:

sage: from sage.categories.distributive_magmas_and_additive_magmas import DistributiveMagmasAndAdditiveMagmas
Category of distributive magmas and additive magmas
sage: C.super_categories()
[Category of magmas and additive magmas]


TESTS:

sage: from sage.categories.magmas_and_additive_magmas import MagmasAndAdditiveMagmas
True
sage: C is (Magmas() & AdditiveMagmas()).Distributive()
True
sage: TestSuite(C).run()


TESTS:

sage: C = Sets.Finite(); C
Category of finite sets
sage: type(C)
<class 'sage.categories.finite_sets.FiniteSets_with_category'>
sage: type(C).__base__.__base__
<class 'sage.categories.category_with_axiom.CategoryWithAxiom_singleton'>

sage: TestSuite(C).run()


TESTS:

sage: C = Sets.Finite(); C
Category of finite sets
sage: type(C)
<class 'sage.categories.finite_sets.FiniteSets_with_category'>
sage: type(C).__base__.__base__
<class 'sage.categories.category_with_axiom.CategoryWithAxiom_singleton'>

sage: TestSuite(C).run()


TESTS:

sage: C = Sets.Finite(); C
Category of finite sets
sage: type(C)
<class 'sage.categories.finite_sets.FiniteSets_with_category'>
sage: type(C).__base__.__base__
<class 'sage.categories.category_with_axiom.CategoryWithAxiom_singleton'>

sage: TestSuite(C).run()

class Associative(base_category)

TESTS:

sage: C = Sets.Finite(); C
Category of finite sets
sage: type(C)
<class 'sage.categories.finite_sets.FiniteSets_with_category'>
sage: type(C).__base__.__base__
<class 'sage.categories.category_with_axiom.CategoryWithAxiom_singleton'>

sage: TestSuite(C).run()


alias of Rngs

Unital

alias of Semirings

TESTS:

sage: from sage.categories.covariant_functorial_construction import CovariantConstructionCategory
sage: class FooBars(CovariantConstructionCategory):
...       _functor_category = "FooBars"
sage: Category.FooBars = lambda self: FooBars.category_of(self)
sage: C = FooBars(ModulesWithBasis(ZZ))
sage: C
Category of foo bars of modules with basis over Integer Ring
sage: C.base_category()
Category of modules with basis over Integer Ring
sage: latex(C)
\mathbf{FooBars}(\mathbf{ModulesWithBasis}_{\Bold{Z}})
sage: import __main__; __main__.FooBars = FooBars # Fake FooBars being defined in a python module
sage: TestSuite(C).run()

extra_super_categories()

Implement the fact that a cartesian product of magmas distributing over additive magmas is a magma distributing over an additive magma.

EXAMPLES:

sage: C = (Magmas() & AdditiveMagmas()).Distributive().CartesianProducts()
sage: C.extra_super_categories();
[Category of distributive magmas and additive magmas]
sage: C.axioms()
frozenset(['Distributive'])