Non Negative Integer Semiring

class sage.rings.semirings.non_negative_integer_semiring.NonNegativeIntegerSemiring

Bases: sage.sets.non_negative_integers.NonNegativeIntegers

A class for the semiring of the non negative integers

This parent inherits from the infinite enumerated set of non negative integers and endows it with its natural semiring structure.

EXAMPLES:

sage: NonNegativeIntegerSemiring()
Non negative integer semiring

For convenience, NN is a chortcut for NonNegativeIntegerSemiring():

sage: NN is NonNegativeIntegerSemiring()
True

sage: NN.category()
Join of Category of semirings and Category of infinite enumerated sets

Here is a piece of the Cayley graph for the multiplicative structure:

sage: G = NN.cayley_graph(elements=range(9), generators=[0,1,2,3,5,7])
sage: G
Looped multi-digraph on 9 vertices
sage: G.plot()

This is the Hasse diagram of the divisibility order on NN.

sage: Poset(NN.cayley_graph(elements=range(13), generators=[0,1,2,3,5,7,11])).show()

Note: as for NonNegativeIntegers, NN is currently just a “facade” parent; namely its elements are plain Sage Integers with Integer Ring as parent:

sage: x = NN(15); type(x)
<type 'sage.rings.integer.Integer'>
sage: x.parent()
Integer Ring
sage: x+3
18

TESTS:

sage: # TODO : remove this skip, see #9065
sage: TestSuite(NN).run(skip=["_test_one","_test_zero"])
additive_semigroup_generators()

Returns the additive semigroup generators of self.

EXAMPLES:

sage: NN.additive_semigroup_generators()
Family (0, 1)

Previous topic

Standard Semirings

Next topic

Algebras

This Page