The usual notation is used to form quotient rings. For quotients of polynomial rings, a Gröbner basis is computed and used to reduce ring elements to normal form after arithmetic operations.
i1 : R = ZZ/11
o1 = R
o1 : QuotientRing
|
i2 : 6_R + 7_R
o2 = 2
o2 : R
|
i3 : S = QQ[x,y,z]/(x^2-y, y^3-z)
o3 = S
o3 : QuotientRing
|
i4 : {1,x,x^2,x^3,x^4,x^5,x^6,x^7,x^8}
2 2
o4 = {1, x, y, x*y, y , x*y , z, x*z, y*z}
o4 : List
|
In the example above you might have wondered whether typing
x would give an element of
S or an element of
QQ[x,y,z]. Our convention is that typing
x gives an element of the last ring that has been assigned to a global variable. Here is another example.
i5 : T = ZZ/101[r,s,t]
o5 = T
o5 : PolynomialRing
|
i6 : T/(r^3+s^3+t^3)
T
o6 = ------------
3 3 3
r + s + t
o6 : QuotientRing
|
i7 : r^3+s^3+t^3
3 3 3
o7 = r + s + t
o7 : T
|
Notice that this time, the variables end up in the ring
T, because we didn't assign the quotient ring to a global variable. The command
use would install the variables for us, or we could assign the ring to a global variable.
i8 : U = ooo
o8 = U
o8 : QuotientRing
|
i9 : r^3+s^3+t^3
o9 = 0
o9 : U
|
The functions
lift and
substitute can be used to transfer elements between the polynomial ring and its quotient ring.
i10 : lift("r"_U,T)
o10 = r
o10 : T
|
i11 : substitute("r"_T,U)
o11 = r
o11 : U
|
A random element of degree
n can be obtained with
random.
i12 : random(2,S)
9 9 2 1 1 2
o12 = -x*y + -y + -x*z + -y*z + z
2 4 2 2
o12 : S
|
In a program we can tell whether a ring is a quotient ring.
i13 : isQuotientRing ZZ
o13 = false
|
i14 : isQuotientRing S
o14 = true
|
We can recover the ring of which a given ring is a quotient.
i15 : ambient S
o15 = QQ[x..z]
o15 : PolynomialRing
|
We can also recover the coefficient ring, as we could for the original polynomial ring.
i16 : coefficientRing S
o16 = QQ
o16 : Ring
|
Here's how we can tell whether the defining relations of a quotient ring were homogeneous.
i17 : isHomogeneous S
o17 = false
|
i18 : isHomogeneous U
o18 = true
|
We can obtain the characteristic of a ring with
char.
i19 : char (ZZ/11)
o19 = 11
|
i20 : char S
o20 = 0
|
i21 : char U
o21 = 101
|
The presentation of the quotient ring can be obtained as a matrix with
presentation.
i22 : presentation S
o22 = | x2-y y3-z |
1 2
o22 : Matrix (QQ[x..z]) <--- (QQ[x..z])
|
If a quotient ring has redundant defining relations, a new ring can be made in which these are eliminated with
trim.
i23 : R = ZZ/101[x,y,z]/(x-y,y-z,z-x)
o23 = R
o23 : QuotientRing
|
i24 : trim R
ZZ
---[x..z]
101
o24 = --------------
(y - z, x - z)
o24 : QuotientRing
|
For more information see
QuotientRing.