Commutative additive semigroups

class sage.categories.commutative_additive_semigroups.CommutativeAdditiveSemigroups(s=None)

Bases: sage.categories.category_singleton.Category_singleton

The category of additive abelian semigroups, i.e. sets with an associative and abelian operation +.

EXAMPLES:

sage: CommutativeAdditiveSemigroups()
Category of commutative additive semigroups
sage: CommutativeAdditiveSemigroups().super_categories()
[Category of additive magmas]
sage: CommutativeAdditiveSemigroups().all_super_categories()
[Category of commutative additive semigroups, Category of additive magmas, Category of sets, Category of sets with partial maps, Category of objects]

TESTS:

sage: C = CommutativeAdditiveSemigroups()
sage: TestSuite(C).run()
class ElementMethods
class CommutativeAdditiveSemigroups.ParentMethods
summation(x, y)

The binary addition operator of the semigroup

INPUT:

  • x, y – elements of this additive semigroup

Returns the sum of x and y

EXAMPLES:

sage: S = CommutativeAdditiveSemigroups().example()
sage: (a,b,c,d) = S.additive_semigroup_generators()
sage: S.summation(a, b)
a + b

A parent in CommutativeAdditiveSemigroups() must either implement summation() in the parent class or _add_ in the element class. By default, the addition method on elements x._add_(y) calls S.summation(x,y), and reciprocally.

As a bonus effect, S.summation by itself models the binary function from S to S:

sage: bin = S.summation
sage: bin(a,b)
a + b

Here, S.summation is just a bound method. Whenever possible, it is recommended to enrich S.summation with extra mathematical structure. Lazy attributes can come handy for this.

Todo: add an example.

summation_from_element_class_add(x, y)

The binary addition operator of the semigroup

INPUT:

  • x, y – elements of this additive semigroup

Returns the sum of x and y

EXAMPLES:

sage: S = CommutativeAdditiveSemigroups().example()
sage: (a,b,c,d) = S.additive_semigroup_generators()
sage: S.summation(a, b)
a + b

A parent in CommutativeAdditiveSemigroups() must either implement summation() in the parent class or _add_ in the element class. By default, the addition method on elements x._add_(y) calls S.summation(x,y), and reciprocally.

As a bonus effect, S.summation by itself models the binary function from S to S:

sage: bin = S.summation
sage: bin(a,b)
a + b

Here, S.summation is just a bound method. Whenever possible, it is recommended to enrich S.summation with extra mathematical structure. Lazy attributes can come handy for this.

Todo: add an example.

CommutativeAdditiveSemigroups.super_categories()

EXAMPLES:

sage: CommutativeAdditiveSemigroups().super_categories()
[Category of additive magmas]

Previous topic

Commutative additive monoids

Next topic

Commutative algebra ideals

This Page