AUTHORS:
William Stein
Simon King (2011-04): Put it into the category framework, use thenew coercion model.
Simon King (2011-04): Quotients of non-commutative rings bytwosided ideals.
Todo
The following skipped tests should be removed once trac ticket #13999 is fixed:
sage: TestSuite(S).run(skip=['_test_nonzero_equal', '_test_elements', '_test_zero'])
In trac ticket #11068, non-commutative quotient rings \(R/I\) wereimplemented. The only requirement is that the two-sided ideal \(I\)provides a reduce
method so that I.reduce(x)
is the normalform of an element \(x\) with respect to \(I\) (i.e., we haveI.reduce(x) == I.reduce(y)
if \(x-y \in I\), andx - I.reduce(x) in I
). Here is a toy example:
sage: from sage.rings.noncommutative_ideals import Ideal_ncsage: from itertools import productsage: class PowerIdeal(Ideal_nc):....: def __init__(self, R, n):....: self._power = n....: self._power = n....: Ideal_nc.__init__(self, R, [R.prod(m) for m in product(R.gens(), repeat=n)])....: def reduce(self,x):....: R = self.ring()....: return add([c*R(m) for m,c in x if len(m)<self._power],R(0))sage: F.<x,y,z> = FreeAlgebra(QQ, 3)sage: I3 = PowerIdeal(F,3); I3Twosided Ideal (x^3, x^2*y, x^2*z, x*y*x, x*y^2, x*y*z, x*z*x, x*z*y,x*z^2, y*x^2, y*x*y, y*x*z, y^2*x, y^3, y^2*z, y*z*x, y*z*y, y*z^2,z*x^2, z*x*y, z*x*z, z*y*x, z*y^2, z*y*z, z^2*x, z^2*y, z^3) ofFree Algebra on 3 generators (x, y, z) over Rational Field
Free algebras have a custom quotient method that serves at creatingfinite dimensional quotients defined by multiplication matrices. Weare bypassing it, so that we obtain the default quotient:
sage: Q3.<a,b,c> = F.quotient(I3)sage: Q3Quotient of Free Algebra on 3 generators (x, y, z) over Rational Field bythe ideal (x^3, x^2*y, x^2*z, x*y*x, x*y^2, x*y*z, x*z*x, x*z*y, x*z^2,y*x^2, y*x*y, y*x*z, y^2*x, y^3, y^2*z, y*z*x, y*z*y, y*z^2, z*x^2, z*x*y,z*x*z, z*y*x, z*y^2, z*y*z, z^2*x, z^2*y, z^3)sage: (a+b+2)^416 + 32*a + 32*b + 24*a^2 + 24*a*b + 24*b*a + 24*b^2sage: Q3.is_commutative()False
Even though \(Q_3\) is not commutative, there is commutativity forproducts of degree three:
sage: a*(b*c)-(b*c)*a==F.zero()True
If we quotient out all terms of degree two then of course the resultingquotient ring is commutative:
sage: I2 = PowerIdeal(F,2); I2Twosided Ideal (x^2, x*y, x*z, y*x, y^2, y*z, z*x, z*y, z^2) of Free Algebraon 3 generators (x, y, z) over Rational Fieldsage: Q2.<a,b,c> = F.quotient(I2)sage: Q2.is_commutative()Truesage: (a+b+2)^416 + 32*a + 32*b
Since trac ticket #7797, there is an implementation of free algebrasbased on Singular’s implementation of the Letterplace Algebra. Ourletterplace wrapper allows to provide the above toy example moreeasily:
sage: from itertools import productsage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace')sage: Q3 = F.quo(F*[F.prod(m) for m in product(F.gens(), repeat=3)]*F)sage: Q3Quotient of Free Associative Unital Algebra on 3 generators (x, y, z) over Rational Field by the ideal (x*x*x, x*x*y, x*x*z, x*y*x, x*y*y, x*y*z, x*z*x, x*z*y, x*z*z, y*x*x, y*x*y, y*x*z, y*y*x, y*y*y, y*y*z, y*z*x, y*z*y, y*z*z, z*x*x, z*x*y, z*x*z, z*y*x, z*y*y, z*y*z, z*z*x, z*z*y, z*z*z)sage: Q3.0*Q3.1-Q3.1*Q3.0xbar*ybar - ybar*xbarsage: Q3.0*(Q3.1*Q3.2)-(Q3.1*Q3.2)*Q3.00sage: Q2 = F.quo(F*[F.prod(m) for m in product(F.gens(), repeat=2)]*F)sage: Q2.is_commutative()True
- sage.rings.quotient_ring.QuotientRing(R, I, names=None, **kwds)#
Creates a quotient ring of the ring \(R\) by the twosided ideal \(I\).
Variables are labeled by
names
(if the quotient ring is a quotientof a polynomial ring). Ifnames
isn’t given, ‘bar’ will be appendedto the variable names in \(R\).INPUT:
R
– a ring.I
– a twosided ideal of \(R\).names
– (optional) a list of strings to be used as names forthe variables in the quotient ring \(R/I\).further named arguments that will be passed to the constructorof the quotient ring instance.
OUTPUT: \(R/I\) - the quotient ring \(R\) mod the ideal \(I\)
ASSUMPTION:
I
has a methodI.reduce(x)
returning the normal formof elements \(x\in R\). In other words, it is required thatI.reduce(x)==I.reduce(y)
\(\iff x-y \in I\), andx-I.reduce(x) in I
, for all \(x,y\in R\).EXAMPLES:
Some simple quotient rings with the integers:
sage: R = QuotientRing(ZZ,7*ZZ); RQuotient of Integer Ring by the ideal (7)sage: R.gens()(1,)sage: 1*R(3); 6*R(3); 7*R(3)340
sage: S = QuotientRing(ZZ,ZZ.ideal(8)); SQuotient of Integer Ring by the ideal (8)sage: 2*S(4)0
With polynomial rings (note that the variable name of the quotientring can be specified as shown below):
sage: P.<x> = QQ[]sage: R.<xx> = QuotientRing(P, P.ideal(x^2 + 1))sage: RUnivariate Quotient Polynomial Ring in xx over Rational Field with modulus x^2 + 1sage: R.gens(); R.gen()(xx,)xxsage: for n in range(4): xx^n1xx-1-xx
sage: P.<x> = QQ[]sage: S = QuotientRing(P, P.ideal(x^2 - 2))sage: SUnivariate Quotient Polynomial Ring in xbar over Rational Field withmodulus x^2 - 2sage: xbar = S.gen(); S.gen()xbarsage: for n in range(3): xbar^n1xbar2
Sage coerces objects into ideals when possible:
sage: P.<x> = QQ[]sage: R = QuotientRing(P, x^2 + 1); RUnivariate Quotient Polynomial Ring in xbar over Rational Field withmodulus x^2 + 1
By Noether’s hom*omorphism theorems, the quotient of a quotient ringof \(R\) is just the quotient of \(R\) by the sum of the ideals. In thisexample, we end up modding out the ideal \((x)\) from the ring\(\QQ[x,y]\):
sage: R.<x,y> = PolynomialRing(QQ,2)sage: S.<a,b> = QuotientRing(R,R.ideal(1 + y^2))sage: T.<c,d> = QuotientRing(S,S.ideal(a))sage: TQuotient of Multivariate Polynomial Ring in x, y over Rational Field by the ideal (x, y^2 + 1)sage: R.gens(); S.gens(); T.gens()(x, y)(a, b)(0, d)sage: for n in range(4): d^n1d-1-d
- class sage.rings.quotient_ring.QuotientRingIdeal_generic(ring, gens, coerce=True)#
Bases: sage.rings.ideal.Ideal_generic
See Also8.3: Ideals and Quotient Rings4.3: Quotient Rings: New Rings from OldQuotient Rings - General Rings, Ideals, and MorphismsRing Theory | Brilliant Math & Science WikiSpecialized class for quotient-ring ideals.
EXAMPLES:
sage: Zmod(9).ideal([-6,9])Ideal (3, 0) of Ring of integers modulo 9
- class sage.rings.quotient_ring.QuotientRingIdeal_principal(ring, gens, coerce=True)#
Bases: sage.rings.ideal.Ideal_principal, sage.rings.quotient_ring.QuotientRingIdeal_generic
Specialized class for principal quotient-ring ideals.
EXAMPLES:
sage: Zmod(9).ideal(-33)Principal ideal (3) of Ring of integers modulo 9
- class sage.rings.quotient_ring.QuotientRing_generic(R, I, names, category=None)#
Bases: sage.rings.quotient_ring.QuotientRing_nc, sage.rings.ring.CommutativeRing
Creates a quotient ring of a commutative ring \(R\) by the ideal \(I\).
EXAMPLES:
sage: R.<x> = PolynomialRing(ZZ)sage: I = R.ideal([4 + 3*x + x^2, 1 + x^2])sage: S = R.quotient_ring(I); SQuotient of Univariate Polynomial Ring in x over Integer Ring by the ideal (x^2 + 3*x + 4, x^2 + 1)
- class sage.rings.quotient_ring.QuotientRing_nc(R, I, names, category=None)#
Bases: sage.rings.ring.Ring, sage.structure.parent_gens.ParentWithGens
The quotient ring of \(R\) by a twosided ideal \(I\).
This class is for rings that do not inherit fromCommutativeRing.
EXAMPLES:
Here is a quotient of a free algebra by a twosided hom*ogeneous ideal:
sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace')sage: I = F*[x*y+y*z,x^2+x*y-y*x-y^2]*Fsage: Q.<a,b,c> = F.quo(I); QQuotient of Free Associative Unital Algebra on 3 generators (x, y, z) over Rational Field by the ideal (x*y + y*z, x*x + x*y - y*x - y*y)sage: a*b-b*csage: a^3-b*c*a - b*c*b - b*c*c
A quotient of a quotient is just the quotient of the original topring by the sum of two ideals:
sage: J = Q*[a^3-b^3]*Qsage: R.<i,j,k> = Q.quo(J); RQuotient of Free Associative Unital Algebra on 3 generators (x, y, z) over Rational Field by the ideal (-y*y*z - y*z*x - 2*y*z*z, x*y + y*z, x*x + x*y - y*x - y*y)sage: i^3-j*k*i - j*k*j - j*k*ksage: j^3-j*k*i - j*k*j - j*k*k
For rings that do inherit from CommutativeRing,we provide a subclass QuotientRing_generic, for backwardscompatibility.
EXAMPLES:
sage: R.<x> = PolynomialRing(ZZ,'x')sage: I = R.ideal([4 + 3*x + x^2, 1 + x^2])sage: S = R.quotient_ring(I); SQuotient of Univariate Polynomial Ring in x over Integer Ring by the ideal (x^2 + 3*x + 4, x^2 + 1)
sage: R.<x,y> = PolynomialRing(QQ)sage: S.<a,b> = R.quo(x^2 + y^2)sage: a^2 + b^2 == 0Truesage: S(0) == a^2 + b^2True
Again, a quotient of a quotient is just the quotient of the original topring by the sum of two ideals.
sage: R.<x,y> = PolynomialRing(QQ,2)sage: S.<a,b> = R.quo(1 + y^2)sage: T.<c,d> = S.quo(a)sage: TQuotient of Multivariate Polynomial Ring in x, y over Rational Field by the ideal (x, y^2 + 1)sage: T.gens()(0, d)
- Element#
alias of sage.rings.quotient_ring_element.QuotientRingElement
- ambient()#
Returns the cover ring of the quotient ring: that is, the originalring \(R\) from which we modded out an ideal, \(I\).
EXAMPLES:
sage: Q = QuotientRing(ZZ,7*ZZ)sage: Q.cover_ring()Integer Ring
sage: P.<x> = QQ[]sage: Q = QuotientRing(P, x^2 + 1)sage: Q.cover_ring()Univariate Polynomial Ring in x over Rational Field
- characteristic()#
Return the characteristic of the quotient ring.
Todo
Not yet implemented!
EXAMPLES:
sage: Q = QuotientRing(ZZ,7*ZZ)sage: Q.characteristic()Traceback (most recent call last):...NotImplementedError
- construction()#
Returns the functorial construction of
self
.EXAMPLES:
sage: R.<x> = PolynomialRing(ZZ,'x')sage: I = R.ideal([4 + 3*x + x^2, 1 + x^2])sage: R.quotient_ring(I).construction()(QuotientFunctor, Univariate Polynomial Ring in x over Integer Ring)sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace')sage: I = F*[x*y+y*z,x^2+x*y-y*x-y^2]*Fsage: Q = F.quo(I)sage: Q.construction()(QuotientFunctor, Free Associative Unital Algebra on 3 generators (x, y, z) over Rational Field)
- cover()#
The covering ring hom*omorphism \(R \to R/I\), equipped with asection.
EXAMPLES:
sage: R = ZZ.quo(3*ZZ)sage: pi = R.cover()sage: piRing morphism: From: Integer Ring To: Ring of integers modulo 3 Defn: Natural quotient mapsage: pi(5)2sage: l = pi.lift()
sage: R.<x,y> = PolynomialRing(QQ)sage: Q = R.quo( (x^2,y^2) )sage: pi = Q.cover()sage: pi(x^3+y)ybarsage: l = pi.lift(x+y^3)sage: lxsage: l = pi.lift(); lSet-theoretic ring morphism: From: Quotient of Multivariate Polynomial Ring in x, y over Rational Field by the ideal (x^2, y^2) To: Multivariate Polynomial Ring in x, y over Rational Field Defn: Choice of lifting mapsage: l(x+y^3)x
- cover_ring()#
Returns the cover ring of the quotient ring: that is, the originalring \(R\) from which we modded out an ideal, \(I\).
EXAMPLES:
sage: Q = QuotientRing(ZZ,7*ZZ)sage: Q.cover_ring()Integer Ring
sage: P.<x> = QQ[]sage: Q = QuotientRing(P, x^2 + 1)sage: Q.cover_ring()Univariate Polynomial Ring in x over Rational Field
- defining_ideal()#
Returns the ideal generating this quotient ring.
EXAMPLES:
In the integers:
sage: Q = QuotientRing(ZZ,7*ZZ)sage: Q.defining_ideal()Principal ideal (7) of Integer Ring
An example involving a quotient of a quotient. By Noether’shom*omorphism theorems, this is actually a quotient by a sum of twoideals:
sage: R.<x,y> = PolynomialRing(QQ,2)sage: S.<a,b> = QuotientRing(R,R.ideal(1 + y^2))sage: T.<c,d> = QuotientRing(S,S.ideal(a))sage: S.defining_ideal()Ideal (y^2 + 1) of Multivariate Polynomial Ring in x, y over Rational Fieldsage: T.defining_ideal()Ideal (x, y^2 + 1) of Multivariate Polynomial Ring in x, y over Rational Field
- gen(i=0)#
Returns the \(i\)-th generator for this quotient ring.
EXAMPLES:
sage: R = QuotientRing(ZZ,7*ZZ)sage: R.gen(0)1
sage: R.<x,y> = PolynomialRing(QQ,2)sage: S.<a,b> = QuotientRing(R,R.ideal(1 + y^2))sage: T.<c,d> = QuotientRing(S,S.ideal(a))sage: TQuotient of Multivariate Polynomial Ring in x, y over Rational Field by the ideal (x, y^2 + 1)sage: R.gen(0); R.gen(1)xysage: S.gen(0); S.gen(1)absage: T.gen(0); T.gen(1)0d
- ideal(*gens, **kwds)#
Return the ideal of
self
with the given generators.EXAMPLES:
sage: R.<x,y> = PolynomialRing(QQ)sage: S = R.quotient_ring(x^2+y^2)sage: S.ideal()Ideal (0) of Quotient of Multivariate Polynomial Ring in x, y over Rational Field by the ideal (x^2 + y^2)sage: S.ideal(x+y+1)Ideal (xbar + ybar + 1) of Quotient of Multivariate Polynomial Ring in x, y over Rational Field by the ideal (x^2 + y^2)
- is_commutative()#
Tell whether this quotient ring is commutative.
Note
This is certainly the case if the cover ring is commutative.Otherwise, if this ring has a finite number of generators, itis tested whether they commute. If the number of generators isinfinite, a
NotImplementedError
is raised.AUTHOR:
Simon King (2011-03-23): See trac ticket #7797.
EXAMPLES:
Any quotient of a commutative ring is commutative:
sage: P.<a,b,c> = QQ[]sage: P.quo(P.random_element()).is_commutative()True
The non-commutative case is more interesting:
sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace')sage: I = F*[x*y+y*z,x^2+x*y-y*x-y^2]*Fsage: Q = F.quo(I)sage: Q.is_commutative()Falsesage: Q.1*Q.2==Q.2*Q.1False
In the next example, the generators apparently commute:
sage: J = F*[x*y-y*x,x*z-z*x,y*z-z*y,x^3-y^3]*Fsage: R = F.quo(J)sage: R.is_commutative()True
- is_field(proof=True)#
Returns
True
if the quotient ring is a field. Checks to see if thedefining ideal is maximal.
- is_integral_domain(proof=True)#
With
proof
equal toTrue
(the default), this function mayraise aNotImplementedError
.When
proof
isFalse
, ifTrue
is returned, then self isdefinitely an integral domain. If the function returnsFalse
,then eitherself
is not an integral domain or it was unable todetermine whether or notself
is an integral domain.EXAMPLES:
sage: R.<x,y> = QQ[]sage: R.quo(x^2 - y).is_integral_domain()Truesage: R.quo(x^2 - y^2).is_integral_domain()Falsesage: R.quo(x^2 - y^2).is_integral_domain(proof=False)Falsesage: R.<a,b,c> = ZZ[]sage: Q = R.quotient_ring([a, b])sage: Q.is_integral_domain()Traceback (most recent call last):...NotImplementedErrorsage: Q.is_integral_domain(proof=False)False
- is_noetherian()#
Return
True
if this ring is Noetherian.EXAMPLES:
sage: R = QuotientRing(ZZ, 102*ZZ)sage: R.is_noetherian()Truesage: P.<x> = QQ[]sage: R = QuotientRing(P, x^2+1)sage: R.is_noetherian()True
If the cover ring of
self
is not Noetherian, we currentlyhave no way of testing whetherself
is Noetherian, so weraise an error:sage: R.<x> = InfinitePolynomialRing(QQ)sage: R.is_noetherian()Falsesage: I = R.ideal([x[1]^2, x[2]])sage: S = R.quotient(I)sage: S.is_noetherian()Traceback (most recent call last):...NotImplementedError
- lift(x=None)#
Return the lifting map to the cover, or the imageof an element under the lifting map.
Note
The category framework imposes that
Q.lift(x)
returnsthe image of an element \(x\) under the lifting map. Forbackwards compatibility, we letQ.lift()
return thelifting map.EXAMPLES:
sage: R.<x,y> = PolynomialRing(QQ, 2)sage: S = R.quotient(x^2 + y^2)sage: S.lift()Set-theoretic ring morphism: From: Quotient of Multivariate Polynomial Ring in x, y over Rational Field by the ideal (x^2 + y^2) To: Multivariate Polynomial Ring in x, y over Rational Field Defn: Choice of lifting mapsage: S.lift(S.0) == xTrue
- lifting_map()#
Return the lifting map to the cover.
EXAMPLES:
sage: R.<x,y> = PolynomialRing(QQ, 2)sage: S = R.quotient(x^2 + y^2)sage: pi = S.cover(); piRing morphism: From: Multivariate Polynomial Ring in x, y over Rational Field To: Quotient of Multivariate Polynomial Ring in x, y over Rational Field by the ideal (x^2 + y^2) Defn: Natural quotient mapsage: L = S.lifting_map(); LSet-theoretic ring morphism: From: Quotient of Multivariate Polynomial Ring in x, y over Rational Field by the ideal (x^2 + y^2) To: Multivariate Polynomial Ring in x, y over Rational Field Defn: Choice of lifting mapsage: L(S.0)xsage: L(S.1)y
Note that some reduction may be applied so that the lift of areduction need not equal the original element:
sage: z = pi(x^3 + 2*y^2); z-xbar*ybar^2 + 2*ybar^2sage: L(z)-x*y^2 + 2*y^2sage: L(z) == x^3 + 2*y^2False
Test that there also is a lift for rings that are noinstances of Ring (see trac ticket #11068):
sage: MS = MatrixSpace(GF(5),2,2)sage: I = MS*[MS.0*MS.1,MS.2+MS.3]*MSsage: Q = MS.quo(I)sage: Q.lift()Set-theoretic ring morphism: From: Quotient of Full MatrixSpace of 2 by 2 dense matrices over Finite Field of size 5 by the ideal( [0 1] [0 0], [0 0] [1 1]) To: Full MatrixSpace of 2 by 2 dense matrices over Finite Field of size 5 Defn: Choice of lifting map
- ngens()#
Returns the number of generators for this quotient ring.
Todo
Note that
ngens
counts 0 as a generator. Doesthis make sense? That is, since 0 only generates itself and thefact that this is true for all rings, is there a way to “knock itoff” of the generators list if a generator of some original ring ismodded out?EXAMPLES:
sage: R = QuotientRing(ZZ,7*ZZ)sage: R.gens(); R.ngens()(1,)1
sage: R.<x,y> = PolynomialRing(QQ,2)sage: S.<a,b> = QuotientRing(R,R.ideal(1 + y^2))sage: T.<c,d> = QuotientRing(S,S.ideal(a))sage: TQuotient of Multivariate Polynomial Ring in x, y over Rational Field by the ideal (x, y^2 + 1)sage: R.gens(); S.gens(); T.gens()(x, y)(a, b)(0, d)sage: R.ngens(); S.ngens(); T.ngens()222
- retract(x)#
The image of an element of the cover ring under the quotient map.
INPUT:
x
– An element of the cover ring
OUTPUT:
The image of the given element in
self
.EXAMPLES:
sage: R.<x,y> = PolynomialRing(QQ, 2)sage: S = R.quotient(x^2 + y^2)sage: S.retract((x+y)^2)2*xbar*ybar
- term_order()#
Return the term order of this ring.
EXAMPLES:
sage: P.<a,b,c> = PolynomialRing(QQ)sage: I = Ideal([a^2 - a, b^2 - b, c^2 - c])sage: Q = P.quotient(I)sage: Q.term_order()Degree reverse lexicographic term order
- sage.rings.quotient_ring.is_QuotientRing(x)#
Tests whether or not
x
inherits from QuotientRing_nc.EXAMPLES:
sage: from sage.rings.quotient_ring import is_QuotientRingsage: R.<x> = PolynomialRing(ZZ,'x')sage: I = R.ideal([4 + 3*x + x^2, 1 + x^2])sage: S = R.quotient_ring(I)sage: is_QuotientRing(S)Truesage: is_QuotientRing(R)False
sage: F.<x,y,z> = FreeAlgebra(QQ, implementation='letterplace')sage: I = F*[x*y+y*z,x^2+x*y-y*x-y^2]*Fsage: Q = F.quo(I)sage: is_QuotientRing(Q)Truesage: is_QuotientRing(F)False