### Navigation

- index
- modules |
- next |
- previous |
- Category Theory »

# Distributive Magmas and Additive Magmas

class `sage.categories.distributive_magmas_and_additive_magmas.``DistributiveMagmasAndAdditiveMagmas`(base_category)

  Bases: `sage.categories.category_with_axiom.CategoryWithAxiom_singleton`

  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
      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()

  class `AdditiveAssociative`(base_category)

    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()

    class `AdditiveCommutative`(base_category)

      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()

      class `AdditiveUnital`(base_category)

        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()

        class `Associative`(base_category)

          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()

          `AdditiveInverse`

            alias of `Rngs`

          `Unital`

            alias of `Semirings`

  class `DistributiveMagmasAndAdditiveMagmas.``CartesianProducts`(category, *args)

    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()

    `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'})

  class `DistributiveMagmasAndAdditiveMagmas.``ParentMethods`

### Navigation

- index
- modules |
- next |
- previous |
- Category Theory »