Additive monoids#

class sage.categories.additive_monoids.AdditiveMonoids(base_category)#

Bases: CategoryWithAxiom_singleton

The category of additive monoids.

An additive monoid is a unital additive semigroup, that is a set endowed with a binary operation \(+\) which is associative and admits a zero (see Wikipedia article Monoid).

EXAMPLES:

sage: from sage.categories.additive_monoids import AdditiveMonoids
sage: C = AdditiveMonoids(); C
Category of additive monoids
sage: C.super_categories()
[Category of additive unital additive magmas, Category of additive semigroups]
sage: sorted(C.axioms())
['AdditiveAssociative', 'AdditiveUnital']
sage: from sage.categories.additive_semigroups import AdditiveSemigroups
sage: C is AdditiveSemigroups().AdditiveUnital()
True
AdditiveCommutative#

alias of CommutativeAdditiveMonoids

AdditiveInverse#

alias of AdditiveGroups

class Homsets(category, *args)#

Bases: HomsetsCategory

extra_super_categories()#

Implement the fact that a homset between two monoids is associative.

EXAMPLES:

sage: from sage.categories.additive_monoids import AdditiveMonoids
sage: AdditiveMonoids().Homsets().extra_super_categories()
[Category of additive semigroups]
sage: AdditiveMonoids().Homsets().super_categories()
[Category of homsets of additive unital additive magmas, Category of additive monoids]
class ParentMethods#

Bases: object

sum(args)#

Return the sum of the elements in args, as an element of self.

INPUT:

  • args – a list (or iterable) of elements of self

EXAMPLES:

sage: S = CommutativeAdditiveMonoids().example()
sage: (a,b,c,d) = S.additive_semigroup_generators()
sage: S.sum((a,b,a,c,a,b))
3*a + 2*b + c
sage: S.sum(())
0
sage: S.sum(()).parent() == S
True