Bases: sage.categories.category_with_axiom.CategoryWithAxiom_singleton
The category of sets 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
sage: C = DistributiveMagmasAndAdditiveMagmas(); C
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
sage: C is MagmasAndAdditiveMagmas().Distributive()
True
sage: C is (Magmas() & AdditiveMagmas()).Distributive()
True
sage: TestSuite(C).run()
Bases: sage.categories.category_with_axiom.CategoryWithAxiom_singleton
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()
Bases: sage.categories.category_with_axiom.CategoryWithAxiom_singleton
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()
Bases: sage.categories.category_with_axiom.CategoryWithAxiom_singleton
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()
Bases: sage.categories.category_with_axiom.CategoryWithAxiom_singleton
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()
Bases: sage.categories.cartesian_product.CartesianProductsCategory
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()
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'})