The usual notation is used to form quotient rings. For quotients of polynomial rings, a Groebner basis is computed and used to reduce ring elements to normal form after arithmetic operations.
i1 : R = ZZ/11 |
i2 : 6_R + 7_R |
i3 : S = QQ[x,y,z]/(x^2-y, y^3-z) |
i4 : {1,x,x^2,x^3,x^4,x^5,x^6,x^7,x^8} |
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] |
i6 : T/(r^3+s^3+t^3) |
i7 : r^3+s^3+t^3 |
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 |
i9 : r^3+s^3+t^3 |
The functions lift and promote can be used to transfer elements between the polynomial ring and its quotient ring.
i10 : lift(U_"r",T) |
i11 : promote(T_"r",U) |
A random element of degree n can be obtained with random.
i12 : random(2,S) |
In a program we can tell whether a ring is a quotient ring.
i13 : isQuotientRing ZZ |
i14 : isQuotientRing S |
We can recover the ring of which a given ring is a quotient.
i15 : ambient S |
We can also recover the coefficient ring, as we could for the original polynomial ring.
i16 : coefficientRing S |
Here's how we can tell whether the defining relations of a quotient ring were homogeneous.
i17 : isHomogeneous S |
i18 : isHomogeneous U |
We can obtain the characteristic of a ring with char.
i19 : char (ZZ/11) |
i20 : char S |
i21 : char U |
The presentation of the quotient ring can be obtained as a matrix with presentation.
i22 : presentation S |
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) |
i24 : trim R |
For more information see QuotientRing.