Additive monoids#
- class sage.categories.additive_monoids.AdditiveMonoids(base_category)[source]#
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
>>> from sage.all import * >>> from sage.categories.additive_monoids import AdditiveMonoids >>> C = AdditiveMonoids(); C Category of additive monoids >>> C.super_categories() [Category of additive unital additive magmas, Category of additive semigroups] >>> sorted(C.axioms()) ['AdditiveAssociative', 'AdditiveUnital'] >>> from sage.categories.additive_semigroups import AdditiveSemigroups >>> C is AdditiveSemigroups().AdditiveUnital() True
- AdditiveCommutative[source]#
alias of
CommutativeAdditiveMonoids
- AdditiveInverse[source]#
alias of
AdditiveGroups
- class Homsets(category, *args)[source]#
Bases:
HomsetsCategory
- extra_super_categories()[source]#
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]
>>> from sage.all import * >>> from sage.categories.additive_monoids import AdditiveMonoids >>> AdditiveMonoids().Homsets().extra_super_categories() [Category of additive semigroups] >>> AdditiveMonoids().Homsets().super_categories() [Category of homsets of additive unital additive magmas, Category of additive monoids]
Todo
This could be deduced from
AdditiveSemigroups.Homsets.extra_super_categories()
. See comment inObjects.SubcategoryMethods.Homsets()
.
- class ParentMethods[source]#
Bases:
object
- sum(args)[source]#
Return the sum of the elements in
args
, as an element ofself
.INPUT:
args
– a list (or iterable) of elements ofself
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
>>> from sage.all import * >>> S = CommutativeAdditiveMonoids().example() >>> (a,b,c,d) = S.additive_semigroup_generators() >>> S.sum((a,b,a,c,a,b)) 3*a + 2*b + c >>> S.sum(()) 0 >>> S.sum(()).parent() == S True