Quotient Ring Elements

AUTHORS:

  • William Stein
class sage.rings.quotient_ring_element.QuotientRingElement(parent, rep, reduce=True)

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()
(xbar, ybar)

We name each of the generators.

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
__cmp__(other)

EXAMPLES:

sage: R.<x,y> = QQ[]; S.<a,b> = R.quo(x^2 + y^2); type(a)
<class 'sage.rings.quotient_ring_element.QuotientRingElement'>
sage: a > b
True
sage: b > a
False
sage: a == a
True

TESTS:

sage: a.__cmp__(a+1-1)
0
sage: a.__cmp__(b)
1
__float__()

EXAMPLES:

sage: R.<x,y> = QQ[]; S.<a,b> = R.quo(x^2 + y^2); type(a)
<class 'sage.rings.quotient_ring_element.QuotientRingElement'>
sage: float(S(2/3))
0.66666666666666663
sage: float(a)
...
TypeError
__init__(parent, rep, reduce=True)

An element of a quotient ring R/I. See QuotientRingElement for full documentation.

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,)
__int__()

Try to convert self (an element of R/I) to an integer by converting its lift in R to an integer. Return a TypeError if no such conversion can be found.

EXAMPLES:

sage: R.<x,y> = QQ[]; S.<a,b> = R.quo(x^2 + y^2); type(a)
<class 'sage.rings.quotient_ring_element.QuotientRingElement'>
sage: int(S(-3))                # indirect doctest
-3
sage: type(int(S(-3)))
<type 'int'>
sage: int(a)
...
TypeError
__invert__()

EXAMPLES:

sage: R.<x,y> = QQ[]; S.<a,b> = R.quo(x^2 + y^2); type(a)
<class 'sage.rings.quotient_ring_element.QuotientRingElement'>
sage: ~S(2/3)
3/2

TESTS:

sage: S(2/3).__invert__()
3/2
sage: a.__invert__()
...
NotImplementedError
__long__()

EXAMPLES:

sage: R.<x,y> = QQ[]; S.<a,b> = R.quo(x^2 + y^2); type(a)
<class 'sage.rings.quotient_ring_element.QuotientRingElement'>
sage: long(S(-3))            # indirect doctest
-3L
__neg__()

EXAMPLES:

sage: R.<x,y> = QQ[]; S.<a,b> = R.quo(x^2 + y^2); type(a)
<class 'sage.rings.quotient_ring_element.QuotientRingElement'>
sage: -a                     # indirect doctest
-a
sage: -(a+b)
-a - b
__nonzero__()

Return True if quotient ring element is non-zero in the quotient ring R/I, by determining whether the element is in I.

EXAMPLES:

sage: R.<x,y> = QQ[]; S.<a,b> = R.quo(x^2 + y^2); type(a)
<class 'sage.rings.quotient_ring_element.QuotientRingElement'>
sage: bool(a)
True
sage: bool(S(0))
False

TESTS:

sage: S(0).__nonzero__()
False
sage: (a-a).__nonzero__()
False
__pos__()

TESTS:

sage: R.<x,y> = QQ[]; S.<a,b> = R.quo(x^2 + y^2); type(a)
<class 'sage.rings.quotient_ring_element.QuotientRingElement'>
sage: (a+b).__pos__()
a + b
sage: c = a+b; c.__pos__() is c
True
__weakref__
list of weak references to the object (if defined)
_add_(right)

Add quotient ring element self to another quotient ring element, right. If the quotient is R/I, the addition is carried out in R and then reduced to R/I.

EXAMPLES:

sage: R.<x,y> = QQ[]; S.<a,b> = R.quo(x^2 + y^2); type(a)
<class 'sage.rings.quotient_ring_element.QuotientRingElement'>
sage: a + b
a + b

TESTS:

sage: a._add_(b)
a + b
_div_(right)

Divide quotient ring element self by another quotient ring element, right. If the quotient is R/I, the division is carried out in R and then reduced to R/I.

TODO: This is not implemented in general – see the first ‘test’ below for an illustration.

EXAMPLES:

sage: R.<x,y> = QQ[]; S.<a,b> = R.quo(x^2 + y^2); type(a)
<class 'sage.rings.quotient_ring_element.QuotientRingElement'>
sage: a / S(2)
1/2*a

TESTS:

sage: (a*b)._div_(b)
...
NotImplementedError
sage: a._div_(S(2))
1/2*a
sage: S(2).is_unit()
True
sage: a.is_unit()
...
NotImplementedError
_integer_(Z=None)

EXAMPLES:

sage: R.<x,y> = QQ[]; S.<a,b> = R.quo(x^2 + y^2); type(a)
<class 'sage.rings.quotient_ring_element.QuotientRingElement'>
sage: ZZ(S(-3))
-3

TESTS:

sage: type(S(-3)._integer_())
<type 'sage.rings.integer.Integer'>
_magma_init_(magma)

Returns the Magma representation of this quotient ring element.

EXAMPLES:

sage: P.<x,y> = PolynomialRing(GF(2))
sage: Q = P.quotient(sage.rings.ideal.FieldIdeal(P))
sage: xbar, ybar = Q.gens()
sage: magma(xbar)             # optional -- magma
x
sage: xbar._magma_init_(magma)  # optional -- magma
'_sage_[...]!_sage_ref...'
_mul_(right)

Multiply quotient ring element self by another quotient ring element, right. If the quotient is R/I, the multiplication is carried out in R and then reduced to R/I.

EXAMPLES:

sage: R.<x,y> = QQ[]; S.<a,b> = R.quo(x^2 + y^2); type(a)
<class 'sage.rings.quotient_ring_element.QuotientRingElement'>
sage: a * b
a*b

TESTS:

sage: a._mul_(b)
a*b
sage: a._mul_(a)
-b^2
_rational_()

EXAMPLES:

sage: R.<x,y> = QQ[]; S.<a,b> = R.quo(x^2 + y^2); type(a)
<class 'sage.rings.quotient_ring_element.QuotientRingElement'>
sage: QQ(S(-2/3))
-2/3

TESTS:

sage: type(S(-2/3)._rational_())
<type 'sage.rings.rational.Rational'>
_reduce_()

Reduce the element modulo the defining ideal of the quotient ring. This internal method replaces the cached representative by one in reduced form.

(Note that this has nothing to do with pickling.)

TESTS:

sage: R.<x,y> = QQ[]; S.<a,b> = R.quo(x^2 + y^2); type(a)
<class 'sage.rings.quotient_ring_element.QuotientRingElement'>
sage: a._reduce_()
sage: a._QuotientRingElement__rep
x
_repr_()

String representation.

TESTS:

sage: R.<x,y> = QQ[]; S.<a,b> = R.quo(x^2 + y^2); type(a)
<class 'sage.rings.quotient_ring_element.QuotientRingElement'>
sage: (a-2*a*b)._repr_()
'-2*a*b + a'
_singular_(singular=Singular)

Return Singular representation of self.

INPUT:

  • singular - a non-standard interpreter may be provided

EXAMPLE:

sage: P.<x,y>  = PolynomialRing(GF(2),2)
sage: I = sage.rings.ideal.FieldIdeal(P)
sage: Q = P.quo(I)
sage: Q._singular_()
//   characteristic : 2
//   number of vars : 2
//        block   1 : ordering dp
//                  : names    x y
//        block   2 : ordering C
// quotient ring from ideal
_[1]=x2+x
_[2]=y2+y
sage: xbar = Q(x); xbar
xbar
sage: xbar._singular_()
x
sage: Q(xbar._singular_()) # a round-trip
xbar

TESTS:

sage: R.<x,y> = QQ[]; S.<a,b> = R.quo(x^2 + y^2); type(a)
<class 'sage.rings.quotient_ring_element.QuotientRingElement'>
sage: (a-2/3*b)._singular_()
x-2/3*y
sage: S((a-2/3*b)._singular_())
a - 2/3*b
_sub_(right)

Subtract quotient ring element right from quotient ring element self. If the quotient is R/I, the subtraction is carried out in R and then reduced to R/I.

EXAMPLES:

sage: R.<x,y> = QQ[]; S.<a,b> = R.quo(x^2 + y^2); type(a)
<class 'sage.rings.quotient_ring_element.QuotientRingElement'>
sage: a - b
a - b

TESTS:

sage: a._sub_(b)
a - b
is_unit()

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

TODO: This is not fully implemented, as illustrated in the example below. So far, self is determined to be unit only if its representation in the cover ring R is also a unit.

EXAMPLES:

sage: R.<x,y> = QQ[]; S.<a,b> = R.quo(1 - x*y); type(a)
<class 'sage.rings.quotient_ring_element.QuotientRingElement'>
sage: a*b
1
sage: a.is_unit()
...
NotImplementedError
sage: S(1).is_unit()
True
lc()

Return the leading coefficent of this quotient ring element.

EXAMPLE:

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

TESTS:

sage: R.<x,y> = QQ[]; S.<a,b> = R.quo(x^2 + y^2); type(a)
<class 'sage.rings.quotient_ring_element.QuotientRingElement'>
sage: (a+3*a*b+b).lc()
3
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)
<class 'sage.rings.quotient_ring_element.QuotientRingElement'>
sage: a.lift()
x
sage: (3/5*(a + a^2 + b^2)).lift()
3/5*x
lm()

Return the leading monomial of this quotient ring element.

EXAMPLE:

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

TESTS:

sage: R.<x,y> = QQ[]; S.<a,b> = R.quo(x^2 + y^2); type(a)
<class 'sage.rings.quotient_ring_element.QuotientRingElement'>
sage: (a+3*a*b+b).lm()
a*b
lt()

Return the leading term of this quotient ring element.

EXAMPLE:

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

TESTS:

sage: R.<x,y> = QQ[]; S.<a,b> = R.quo(x^2 + y^2); type(a)
<class 'sage.rings.quotient_ring_element.QuotientRingElement'>
sage: (a+3*a*b+b).lt()
3*a*b
monomials()

EXAMPLES:

sage: R.<x,y> = QQ[]; S.<a,b> = R.quo(x^2 + y^2); type(a)
<class 'sage.rings.quotient_ring_element.QuotientRingElement'>
sage: a.monomials()
[a]
sage: (a+a*b).monomials()
[a*b, a]
reduce(G)

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

INPUT:

  • G - a list of quotient ring elements

EXAMPLE:

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
variables()

EXAMPLES:

sage: R.<x,y> = QQ[]; S.<a,b> = R.quo(x^2 + y^2); type(a)
<class 'sage.rings.quotient_ring_element.QuotientRingElement'>
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]

Previous topic

Quotient Rings

Next topic

Standard Commutative Rings

This Page