# Quotient Ring Elements#

AUTHORS:

• William Stein

class sage.rings.quotient_ring_element.QuotientRingElement(parent, rep, reduce=True)#

Bases: RingElement

An element of a quotient ring $$R/I$$.

INPUT:

• parent - the ring $$R/I$$

• rep - a representative of the element in $$R$$; this is used as the internal representation of the element

• reduce - bool (optional, default: True) - if True, then the internal representation of the element is rep reduced modulo the ideal $$I$$

EXAMPLES:

sage: R.<x> = PolynomialRing(ZZ)
sage: S.<xbar> = R.quo((4 + 3*x + x^2, 1 + x^2)); S
Quotient of Univariate Polynomial Ring in x over Integer Ring
by the ideal (x^2 + 3*x + 4, x^2 + 1)
sage: v = S.gens(); v
(xbar,)

sage: loads(v[0].dumps()) == v[0]
True

sage: R.<x,y> = PolynomialRing(QQ, 2)
sage: S = R.quo(x^2 + y^2); S
Quotient of Multivariate Polynomial Ring in x, y over Rational Field
by the ideal (x^2 + y^2)
sage: S.gens()                                                                  # optional - sage.libs.singular
(xbar, ybar)


We name each of the generators.

sage: S.<a,b> = R.quotient(x^2 + y^2)                                           # optional - sage.libs.singular
sage: a                                                                         # optional - sage.libs.singular
a
sage: b                                                                         # optional - sage.libs.singular
b
sage: a^2 + b^2 == 0                                                            # optional - sage.libs.singular
True
sage: b.lift()                                                                  # optional - sage.libs.singular
y
sage: (a^3 + b^2).lift()                                                        # optional - sage.libs.singular
-x*y^2 + y^2

is_unit()#

Return True if self is a unit in the quotient ring.

EXAMPLES:

sage: R.<x,y> = QQ[]; S.<a,b> = R.quo(1 - x*y); type(a)                     # optional - sage.libs.singular
<class 'sage.rings.quotient_ring.QuotientRing_generic_with_category.element_class'>
sage: a*b                                                                   # optional - sage.libs.singular
1
sage: S(2).is_unit()                                                        # optional - sage.libs.singular
True


Check that github issue #29469 is fixed:

sage: a.is_unit()                                                           # optional - sage.libs.singular
True
sage: (a+b).is_unit()                                                       # optional - sage.libs.singular
False

lc()#

Return the leading coefficient of this quotient ring element.

EXAMPLES:

sage: R.<x,y,z> = PolynomialRing(GF(7), 3, order='lex')                     # optional - sage.rings.finite_rings
sage: I = sage.rings.ideal.FieldIdeal(R)                                    # optional - sage.rings.finite_rings
sage: Q = R.quo(I)                                                          # optional - sage.rings.finite_rings
sage: f = Q(z*y + 2*x)                                                      # optional - sage.rings.finite_rings
sage: f.lc()                                                                # optional - sage.rings.finite_rings
2

lift()#

If self is an element of $$R/I$$, then return self as an element of $$R$$.

EXAMPLES:

sage: R.<x,y> = QQ[]; S.<a,b> = R.quo(x^2 + y^2); type(a)                   # optional - sage.libs.singular
<class 'sage.rings.quotient_ring.QuotientRing_generic_with_category.element_class'>
sage: a.lift()                                                              # optional - sage.libs.singular
x
sage: (3/5*(a + a^2 + b^2)).lift()                                          # optional - sage.libs.singular
3/5*x

lm()#

Return the leading monomial of this quotient ring element.

EXAMPLES:

sage: R.<x,y,z> = PolynomialRing(GF(7), 3, order='lex')                     # optional - sage.rings.finite_rings
sage: I = sage.rings.ideal.FieldIdeal(R)                                    # optional - sage.rings.finite_rings
sage: Q = R.quo(I)                                                          # optional - sage.rings.finite_rings
sage: f = Q(z*y + 2*x)                                                      # optional - sage.rings.finite_rings
sage: f.lm()                                                                # optional - sage.rings.finite_rings
xbar

lt()#

Return the leading term of this quotient ring element.

EXAMPLES:

sage: R.<x,y,z> = PolynomialRing(GF(7), 3, order='lex')                     # optional - sage.rings.finite_rings
sage: I = sage.rings.ideal.FieldIdeal(R)                                    # optional - sage.rings.finite_rings
sage: Q = R.quo(I)                                                          # optional - sage.rings.finite_rings
sage: f = Q(z*y + 2*x)                                                      # optional - sage.rings.finite_rings
sage: f.lt()                                                                # optional - sage.rings.finite_rings
2*xbar

monomials()#

Return the monomials in self.

OUTPUT:

A list of monomials.

EXAMPLES:

sage: R.<x,y> = QQ[]; S.<a,b> = R.quo(x^2 + y^2); type(a)                   # optional - sage.libs.singular
<class 'sage.rings.quotient_ring.QuotientRing_generic_with_category.element_class'>
sage: a.monomials()                                                         # optional - sage.libs.singular
[a]
sage: (a + a*b).monomials()                                                 # optional - sage.libs.singular
[a*b, a]
sage: R.zero().monomials()                                                  # optional - sage.libs.singular
[]

reduce(G)#

Reduce this quotient ring element by a set of quotient ring elements G.

INPUT:

• G - a list of quotient ring elements

Warning

This method is not guaranteed to return unique minimal results. For quotients of polynomial rings, use reduce() on the ideal generated by G, instead.

EXAMPLES:

sage: P.<a,b,c,d,e> = PolynomialRing(GF(2), 5, order='lex')                 # optional - sage.rings.finite_rings
sage: I1 = ideal([a*b + c*d + 1, a*c*e + d*e,                               # optional - sage.rings.finite_rings
....:             a*b*e + c*e, b*c + c*d*e + 1])
sage: Q = P.quotient(sage.rings.ideal.FieldIdeal(P))                        # optional - sage.rings.finite_rings
sage: I2 = ideal([Q(f) for f in I1.gens()])                                 # optional - sage.rings.finite_rings
sage: f = Q((a*b + c*d + 1)^2  + e)                                         # optional - sage.rings.finite_rings
sage: f.reduce(I2.gens())                                                   # optional - sage.rings.finite_rings
ebar


Notice that the result above is not minimal:

sage: I2.reduce(f)                                                          # optional - sage.rings.finite_rings
0

variables()#

Return all variables occurring in self.

OUTPUT:

A tuple of linear monomials, one for each variable occurring in self.

EXAMPLES:

sage: R.<x,y> = QQ[]; S.<a,b> = R.quo(x^2 + y^2); type(a)                   # optional - sage.libs.singular
<class 'sage.rings.quotient_ring.QuotientRing_generic_with_category.element_class'>
sage: a.variables()                                                         # optional - sage.libs.singular
(a,)
sage: b.variables()                                                         # optional - sage.libs.singular
(b,)
sage: s = a^2 + b^2 + 1; s                                                  # optional - sage.libs.singular
1
sage: s.variables()                                                         # optional - sage.libs.singular
()
sage: (a + b).variables()                                                   # optional - sage.libs.singular
(a, b)