If f is a matrix, and g is a matrix or Groebner basis, then quotient(f,g) is an alternate notation for f//g.
If either f or g is a ring element, then it is taken to be the identity matrix on H. If both are ring elements, then the result is also a ring element. If g is a MonomialIdeal, then it is taken to be the matrix of generators of g. Finally, if g is a GroebnerBasis object, then the Groebner basis as so far computed is used. In these latter two cases, no Groebner bases will be computed.
The resulting matrix h is such that
f - g*h is the reduction of
f modulo a Groebner basis for the image of
g.
If the remainder
f - g*h is zero, then the quotient
f//g satisfies the equation
f = g * (f//g).
One common use is the following. If an ideal contains 1, then write 1 in terms of the generators of the ideal.
i1 : A = ZZ/101[x,y,z]
o1 = A
o1 : PolynomialRing
|
i2 : F = x^4 - y*z*(1-x)^2 - z - y^3
4 2 3
o2 = x - x y*z - y + 2x*y*z - y*z - z
o2 : A
|
i3 : I = ideal(F,diff(x,F),diff(y,F),diff(z,F))
4 2 3 3 2
o3 = ideal (x - x y*z - y + 2x*y*z - y*z - z, 4x - 2x*y*z + 2y*z, - x z -
------------------------------------------------------------------------
2 2
3y + 2x*z - z, - x y + 2x*y - y - 1)
o3 : Ideal of A
|
i4 : 1 % I
o4 = 0
o4 : A
|
So we see that 1 is in the ideal. Now let us find the representation of 1 in terms of the four generators of
I.
i5 : g = gens I
o5 = | x4-x2yz-y3+2xyz-yz-z 4x3-2xyz+2yz -x2z-3y2+2xz-z -x2y+2xy-y-1 |
1 4
o5 : Matrix A <--- A
|
i6 : f = matrix{{1_A}}
o6 = | 1 |
1 1
o6 : Matrix A <--- A
|
i7 : h = f // g
o7 = {4} | 34x3-37x2y+47xy2+38y3-6x2z+45xyz+26x2+41xy-15y2+12xz+
{3} | 42x4-16x3y-37x2y2+41xy3-49x3z+14x2yz+44x3+15x2y+4xy2-
{3} | -45x3y+46x2y2+18xy3+21y4+2x2yz-15xy2z+25x2y+20xy2+5y3
{3} | 28x3z+23x2yz+9xy2z-40y3z+x2z2+43xyz2+x2y+38xy2-21x2z+
------------------------------------------------------------------------
29yz+45z2-6x+11y-13z+16 |
41y3-3x2z+18xyz-43xz2-49x2-28xy-y2+28xz-32yz+43z2-4x-20z |
-26x2z-15xyz+24y2z-15yz2-2x2+40xy+30y2+19xz+16yz-45x+3y-32z+8 |
42xyz-25y2z+6xz2-16yz2-45z3-2xy-25y2-34xz-6yz+45z2+y-24z-1 |
4 1
o7 : Matrix A <--- A
|
i8 : g * (f//g)
o8 = | 1 |
1 1
o8 : Matrix A <--- A
|
We may also find h directly.
i9 : 1 // (gens I)
o9 = {4} | 34x3-37x2y+47xy2+38y3-6x2z+45xyz+26x2+41xy-15y2+12xz+
{3} | 42x4-16x3y-37x2y2+41xy3-49x3z+14x2yz+44x3+15x2y+4xy2-
{3} | -45x3y+46x2y2+18xy3+21y4+2x2yz-15xy2z+25x2y+20xy2+5y3
{3} | 28x3z+23x2yz+9xy2z-40y3z+x2z2+43xyz2+x2y+38xy2-21x2z+
------------------------------------------------------------------------
29yz+45z2-6x+11y-13z+16 |
41y3-3x2z+18xyz-43xz2-49x2-28xy-y2+28xz-32yz+43z2-4x-20z |
-26x2z-15xyz+24y2z-15yz2-2x2+40xy+30y2+19xz+16yz-45x+3y-32z+8 |
42xyz-25y2z+6xz2-16yz2-45z3-2xy-25y2-34xz-6yz+45z2+y-24z-1 |
4 1
o9 : Matrix A <--- A
|
One may also use
// to compute the inverse of an invertible matrix.
i10 : M = matrix{{1,x,y},{x,0,y},{1,2,3}}
o10 = | 1 x y |
| x 0 y |
| 1 2 3 |
3 3
o10 : Matrix A <--- A
|
i11 : M = substitute(M, frac A)
o11 = | 1 x y |
| x 0 y |
| 1 2 3 |
ZZ 3 ZZ 3
o11 : Matrix (frac --- [x, y, z]) <--- (frac --- [x, y, z])
101 101
|
i12 : det M
2
o12 = - 3x + 3x*y - 2y
o12 : frac(A)
|
i13 : Minv = id_(target M) // M
o13 = {1} | -3y/(46x2-46xy-3y) (47x+36y)/(47x2-47xy-36y)
{1} | (-14x-29y)/(-14x2+14xy-43y) (35y-4)/(4x2-4xy-31y)
{1} | 3x/(46x2-46xy-3y) (14x-28)/(-42x2+42xy-28y)
-----------------------------------------------------------------------
3xy/(-9x2+9xy-6y) |
(-15xy+15y)/(45x2-45xy+30y) |
-3x2/(-9x2+9xy-6y) |
ZZ 3 ZZ 3
o13 : Matrix (frac --- [x, y, z]) <--- (frac --- [x, y, z])
101 101
|
i14 : M * Minv
o14 = | -31/-31 0 0 |
| 0 46/46 0 |
| 0 0 9/9 |
ZZ 3 ZZ 3
o14 : Matrix (frac --- [x, y, z]) <--- (frac --- [x, y, z])
101 101
|