Semirings - Category Framework

Skip to content
Back to top
View this page
Edit this page

# Semirings

class sage.categories.semirings.Semirings(base_category)

  Bases: `CategoryWithAxiom_singleton`

  The category of semirings.

  A semiring \((S, +, *)\) is similar to a ring, but without the requirement that each element must have an additive inverse. In other words, it is a combination of a commutative additive monoid \((S, +)\) and a multiplicative monoid \((S, *)\), where \(*\) distributes over \(+\).

  See also

  Wikipedia article Semiring

  EXAMPLES:

  Sage

      sage: Semirings()
      Category of semirings
      sage: Semirings().super_categories()
      [Category of associative additive commutative additive
       associative additive unital distributive magmas and additive magmas,
       Category of monoids]

      sage: sorted(Semirings().axioms())
      ['AdditiveAssociative', 'AdditiveCommutative', 'AdditiveUnital',
       'Associative', 'Distributive', 'Unital']

      sage: Semirings() is (CommutativeAdditiveMonoids() & Monoids()).Distributive()
      True

      sage: Semirings().AdditiveInverse()
      Category of rings

  Python

      >>> from sage.all import *
      >>> Semirings()
      Category of semirings
      >>> Semirings().super_categories()
      [Category of associative additive commutative additive
       associative additive unital distributive magmas and additive magmas,
       Category of monoids]

      >>> sorted(Semirings().axioms())
      ['AdditiveAssociative', 'AdditiveCommutative', 'AdditiveUnital',
       'Associative', 'Distributive', 'Unital']

      >>> Semirings() is (CommutativeAdditiveMonoids() & Monoids()).Distributive()
      True

      >>> Semirings().AdditiveInverse()
      Category of rings