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} | 44x2y2+43x3z+42x2yz-30x3-26x2y-11xy2+21x2z-7xyz+30x2+15xy-36y2+42x
{3} | -11x3y2-36x4z+40x3yz-43x4-44x3y+9x2y2+20x3z+27x2yz+43x3-29x2y+22xy
{3} | 19x2y3-48x3yz-14x2y2z+10x3y-25x2y2-30xy3-7x2yz+36xy2z-10x2y-5xy2+1
{3} | -41x2y2z-24x3z2-7x2yz2+25x3y+5x3z+38x2yz+45xy2z+18x2z2+39xyz2+x2y-
------------------------------------------------------------------------
z+37yz-2x+2y+9z+31 |
2+40x2z+40xyz-50x2+50xy-20y2-28xz-6yz-33x-19y-47z |
2y3-14xyz-46y2z-2x2-33xy+33y2-19xz-3yz+35x-44y+24z-34 |
25x2z+35xyz-16y2z+25xz2-3yz2-2xy+8yz-33z2+y+3z-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} | 44x2y2+43x3z+42x2yz-30x3-26x2y-11xy2+21x2z-7xyz+30x2+15xy-36y2+42x
{3} | -11x3y2-36x4z+40x3yz-43x4-44x3y+9x2y2+20x3z+27x2yz+43x3-29x2y+22xy
{3} | 19x2y3-48x3yz-14x2y2z+10x3y-25x2y2-30xy3-7x2yz+36xy2z-10x2y-5xy2+1
{3} | -41x2y2z-24x3z2-7x2yz2+25x3y+5x3z+38x2yz+45xy2z+18x2z2+39xyz2+x2y-
------------------------------------------------------------------------
z+37yz-2x+2y+9z+31 |
2+40x2z+40xyz-50x2+50xy-20y2-28xz-6yz-33x-19y-47z |
2y3-14xyz-46y2z-2x2-33xy+33y2-19xz-3yz+35x-44y+24z-34 |
25x2z+35xyz-16y2z+25xz2-3yz2-2xy+8yz-33z2+y+3z-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 |
3 3
o11 : Matrix (frac A) <--- (frac A)
|
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) |
3 3
o13 : Matrix (frac A) <--- (frac A)
|
i14 : M * Minv
o14 = | -31/-31 0 0 |
| 0 46/46 0 |
| 0 0 9/9 |
3 3
o14 : Matrix (frac A) <--- (frac A)
|