Rngs

class sage.categories.rngs.Rngs(base_category)[source]

Bases: CategoryWithAxiom_singleton

The category of rngs.

An rng \((S, +, *)\) is similar to a ring but not necessarily unital. In other words, it is a combination of a commutative additive group \((S, +)\) and a multiplicative semigroup \((S, *)\), where \(*\) distributes over \(+\).

EXAMPLES:

sage: C = Rngs(); C
Category of rngs
sage: sorted(C.super_categories(), key=str)
[Category of associative additive commutative additive associative additive unital distributive magmas and additive magmas,
 Category of commutative additive groups]

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

sage: C is (CommutativeAdditiveGroups() & Semigroups()).Distributive()
True
sage: C.Unital()
Category of rings
>>> from sage.all import *
>>> C = Rngs(); C
Category of rngs
>>> sorted(C.super_categories(), key=str)
[Category of associative additive commutative additive associative additive unital distributive magmas and additive magmas,
 Category of commutative additive groups]

>>> sorted(C.axioms())
['AdditiveAssociative', 'AdditiveCommutative', 'AdditiveInverse',
 'AdditiveUnital', 'Associative', 'Distributive']

>>> C is (CommutativeAdditiveGroups() & Semigroups()).Distributive()
True
>>> C.Unital()
Category of rings
class ParentMethods[source]

Bases: object

ideal_monoid()[source]

The monoid of the ideals of this ring.

Note

The code is copied from the base class of rings. This is since there are rings that do not inherit from that class, such as matrix algebras. See Issue #7797.

EXAMPLES:

sage: # needs sage.modules
sage: MS = MatrixSpace(QQ, 2, 2)
sage: isinstance(MS, Ring)
False
sage: MS in Rings()
True
sage: MS.ideal_monoid()
Monoid of ideals of Full MatrixSpace of 2 by 2 dense matrices
over Rational Field
>>> from sage.all import *
>>> # needs sage.modules
>>> MS = MatrixSpace(QQ, Integer(2), Integer(2))
>>> isinstance(MS, Ring)
False
>>> MS in Rings()
True
>>> MS.ideal_monoid()
Monoid of ideals of Full MatrixSpace of 2 by 2 dense matrices
over Rational Field

Note that the monoid is cached:

sage: MS.ideal_monoid() is MS.ideal_monoid()                            # needs sage.modules
True
>>> from sage.all import *
>>> MS.ideal_monoid() is MS.ideal_monoid()                            # needs sage.modules
True
principal_ideal(gen, coerce=True)[source]

Return the principal ideal generated by gen.

EXAMPLES:

sage: R.<x,y> = ZZ[]
sage: R.principal_ideal(x+2*y)
Ideal (x + 2*y) of Multivariate Polynomial Ring in x, y over Integer Ring
>>> from sage.all import *
>>> R = ZZ['x, y']; (x, y,) = R._first_ngens(2)
>>> R.principal_ideal(x+Integer(2)*y)
Ideal (x + 2*y) of Multivariate Polynomial Ring in x, y over Integer Ring
zero_ideal()[source]

Return the zero ideal of this ring (cached).

EXAMPLES:

sage: ZZ.zero_ideal()
Principal ideal (0) of Integer Ring
sage: QQ.zero_ideal()
Principal ideal (0) of Rational Field
sage: QQ['x'].zero_ideal()
Principal ideal (0) of Univariate Polynomial Ring in x over Rational Field
>>> from sage.all import *
>>> ZZ.zero_ideal()
Principal ideal (0) of Integer Ring
>>> QQ.zero_ideal()
Principal ideal (0) of Rational Field
>>> QQ['x'].zero_ideal()
Principal ideal (0) of Univariate Polynomial Ring in x over Rational Field

The result is cached:

sage: ZZ.zero_ideal() is ZZ.zero_ideal()
True
>>> from sage.all import *
>>> ZZ.zero_ideal() is ZZ.zero_ideal()
True
Unital[source]

alias of Rings