Quotient Ring Elements¶
AUTHORS:
- William Stein 
- class sage.rings.quotient_ring_element.QuotientRingElement(parent, rep, reduce=True)[source]¶
- 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– boolean (default:- True); if- True, then the internal representation of the element is- repreduced 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,) - >>> from sage.all import * >>> R = PolynomialRing(ZZ, names=('x',)); (x,) = R._first_ngens(1) >>> S = R.quo((Integer(4) + Integer(3)*x + x**Integer(2), Integer(1) + x**Integer(2)), names=('xbar',)); (xbar,) = S._first_ngens(1); S Quotient of Univariate Polynomial Ring in x over Integer Ring by the ideal (x^2 + 3*x + 4, x^2 + 1) >>> v = S.gens(); v (xbar,) - sage: loads(v[0].dumps()) == v[0] True - >>> from sage.all import * >>> loads(v[Integer(0)].dumps()) == v[Integer(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() # needs sage.libs.singular (xbar, ybar) - >>> from sage.all import * >>> R = PolynomialRing(QQ, Integer(2), names=('x', 'y',)); (x, y,) = R._first_ngens(2) >>> S = R.quo(x**Integer(2) + y**Integer(2)); S Quotient of Multivariate Polynomial Ring in x, y over Rational Field by the ideal (x^2 + y^2) >>> S.gens() # needs sage.libs.singular (xbar, ybar) - We name each of the generators. - sage: # needs sage.libs.singular sage: S.<a,b> = R.quotient(x^2 + y^2) sage: a a sage: b b sage: a^2 + b^2 == 0 True sage: b.lift() y sage: (a^3 + b^2).lift() -x*y^2 + y^2 - >>> from sage.all import * >>> # needs sage.libs.singular >>> S = R.quotient(x**Integer(2) + y**Integer(2), names=('a', 'b',)); (a, b,) = S._first_ngens(2) >>> a a >>> b b >>> a**Integer(2) + b**Integer(2) == Integer(0) True >>> b.lift() y >>> (a**Integer(3) + b**Integer(2)).lift() -x*y^2 + y^2 - is_unit()[source]¶
- Return - Trueif- selfis a unit in the quotient ring.- EXAMPLES: - sage: R.<x,y> = QQ[]; S.<a,b> = R.quo(1 - x*y); type(a) # needs sage.libs.singular <class 'sage.rings.quotient_ring.QuotientRing_generic_with_category.element_class'> sage: a*b # needs sage.libs.singular 1 sage: S(2).is_unit() # needs sage.libs.singular True - >>> from sage.all import * >>> R = QQ['x, y']; (x, y,) = R._first_ngens(2); S = R.quo(Integer(1) - x*y, names=('a', 'b',)); (a, b,) = S._first_ngens(2); type(a) # needs sage.libs.singular <class 'sage.rings.quotient_ring.QuotientRing_generic_with_category.element_class'> >>> a*b # needs sage.libs.singular 1 >>> S(Integer(2)).is_unit() # needs sage.libs.singular True - Check that Issue #29469 is fixed: - sage: a.is_unit() # needs sage.libs.singular True sage: (a+b).is_unit() # needs sage.libs.singular False - >>> from sage.all import * >>> a.is_unit() # needs sage.libs.singular True >>> (a+b).is_unit() # needs sage.libs.singular False 
 - lc()[source]¶
- Return the leading coefficient of this quotient ring element. - EXAMPLES: - sage: # needs sage.libs.singular sage: R.<x,y,z> = PolynomialRing(GF(7), 3, order='lex') sage: I = sage.rings.ideal.FieldIdeal(R) sage: Q = R.quo(I) sage: f = Q(z*y + 2*x) sage: f.lc() 2 - >>> from sage.all import * >>> # needs sage.libs.singular >>> R = PolynomialRing(GF(Integer(7)), Integer(3), order='lex', names=('x', 'y', 'z',)); (x, y, z,) = R._first_ngens(3) >>> I = sage.rings.ideal.FieldIdeal(R) >>> Q = R.quo(I) >>> f = Q(z*y + Integer(2)*x) >>> f.lc() 2 
 - lift()[source]¶
- If - selfis an element of \(R/I\), then return- selfas an element of \(R\).- EXAMPLES: - sage: R.<x,y> = QQ[]; S.<a,b> = R.quo(x^2 + y^2); type(a) # needs sage.libs.singular <class 'sage.rings.quotient_ring.QuotientRing_generic_with_category.element_class'> sage: a.lift() # needs sage.libs.singular x sage: (3/5*(a + a^2 + b^2)).lift() # needs sage.libs.singular 3/5*x - >>> from sage.all import * >>> R = QQ['x, y']; (x, y,) = R._first_ngens(2); S = R.quo(x**Integer(2) + y**Integer(2), names=('a', 'b',)); (a, b,) = S._first_ngens(2); type(a) # needs sage.libs.singular <class 'sage.rings.quotient_ring.QuotientRing_generic_with_category.element_class'> >>> a.lift() # needs sage.libs.singular x >>> (Integer(3)/Integer(5)*(a + a**Integer(2) + b**Integer(2))).lift() # needs sage.libs.singular 3/5*x 
 - lm()[source]¶
- Return the leading monomial of this quotient ring element. - EXAMPLES: - sage: # needs sage.libs.singular sage: R.<x,y,z> = PolynomialRing(GF(7), 3, order='lex') sage: I = sage.rings.ideal.FieldIdeal(R) sage: Q = R.quo(I) sage: f = Q(z*y + 2*x) sage: f.lm() xbar - >>> from sage.all import * >>> # needs sage.libs.singular >>> R = PolynomialRing(GF(Integer(7)), Integer(3), order='lex', names=('x', 'y', 'z',)); (x, y, z,) = R._first_ngens(3) >>> I = sage.rings.ideal.FieldIdeal(R) >>> Q = R.quo(I) >>> f = Q(z*y + Integer(2)*x) >>> f.lm() xbar 
 - lt()[source]¶
- Return the leading term of this quotient ring element. - EXAMPLES: - sage: # needs sage.libs.singular sage: R.<x,y,z> = PolynomialRing(GF(7), 3, order='lex') sage: I = sage.rings.ideal.FieldIdeal(R) sage: Q = R.quo(I) sage: f = Q(z*y + 2*x) sage: f.lt() 2*xbar - >>> from sage.all import * >>> # needs sage.libs.singular >>> R = PolynomialRing(GF(Integer(7)), Integer(3), order='lex', names=('x', 'y', 'z',)); (x, y, z,) = R._first_ngens(3) >>> I = sage.rings.ideal.FieldIdeal(R) >>> Q = R.quo(I) >>> f = Q(z*y + Integer(2)*x) >>> f.lt() 2*xbar 
 - monomials()[source]¶
- Return the monomials in - self.- OUTPUT: list of monomials - EXAMPLES: - sage: # needs sage.libs.singular sage: R.<x,y> = QQ[]; S.<a,b> = R.quo(x^2 + y^2); type(a) <class 'sage.rings.quotient_ring.QuotientRing_generic_with_category.element_class'> sage: a.monomials() [a] sage: (a + a*b).monomials() [a*b, a] sage: R.zero().monomials() [] - >>> from sage.all import * >>> # needs sage.libs.singular >>> R = QQ['x, y']; (x, y,) = R._first_ngens(2); S = R.quo(x**Integer(2) + y**Integer(2), names=('a', 'b',)); (a, b,) = S._first_ngens(2); type(a) <class 'sage.rings.quotient_ring.QuotientRing_generic_with_category.element_class'> >>> a.monomials() [a] >>> (a + a*b).monomials() [a*b, a] >>> R.zero().monomials() [] 
 - reduce(G)[source]¶
- Reduce this quotient ring element by a set of quotient ring elements - G.- INPUT: - G– 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: # needs sage.libs.singular sage: P.<a,b,c,d,e> = PolynomialRing(GF(2), 5, order='lex') sage: I1 = ideal([a*b + c*d + 1, a*c*e + d*e, ....: a*b*e + c*e, b*c + c*d*e + 1]) sage: Q = P.quotient(sage.rings.ideal.FieldIdeal(P)) sage: I2 = ideal([Q(f) for f in I1.gens()]) sage: f = Q((a*b + c*d + 1)^2 + e) sage: f.reduce(I2.gens()) ebar - >>> from sage.all import * >>> # needs sage.libs.singular >>> P = PolynomialRing(GF(Integer(2)), Integer(5), order='lex', names=('a', 'b', 'c', 'd', 'e',)); (a, b, c, d, e,) = P._first_ngens(5) >>> I1 = ideal([a*b + c*d + Integer(1), a*c*e + d*e, ... a*b*e + c*e, b*c + c*d*e + Integer(1)]) >>> Q = P.quotient(sage.rings.ideal.FieldIdeal(P)) >>> I2 = ideal([Q(f) for f in I1.gens()]) >>> f = Q((a*b + c*d + Integer(1))**Integer(2) + e) >>> f.reduce(I2.gens()) ebar - Notice that the result above is not minimal: - sage: I2.reduce(f) # needs sage.libs.singular 0 - >>> from sage.all import * >>> I2.reduce(f) # needs sage.libs.singular 0 
 - variables()[source]¶
- Return all variables occurring in - self.- OUTPUT: - A tuple of linear monomials, one for each variable occurring in - self.- EXAMPLES: - sage: # needs sage.libs.singular sage: R.<x,y> = QQ[]; S.<a,b> = R.quo(x^2 + y^2); type(a) <class 'sage.rings.quotient_ring.QuotientRing_generic_with_category.element_class'> sage: a.variables() (a,) sage: b.variables() (b,) sage: s = a^2 + b^2 + 1; s 1 sage: s.variables() () sage: (a + b).variables() (a, b) - >>> from sage.all import * >>> # needs sage.libs.singular >>> R = QQ['x, y']; (x, y,) = R._first_ngens(2); S = R.quo(x**Integer(2) + y**Integer(2), names=('a', 'b',)); (a, b,) = S._first_ngens(2); type(a) <class 'sage.rings.quotient_ring.QuotientRing_generic_with_category.element_class'> >>> a.variables() (a,) >>> b.variables() (b,) >>> s = a**Integer(2) + b**Integer(2) + Integer(1); s 1 >>> s.variables() () >>> (a + b).variables() (a, b)