Macaulay2 » Documentation
Packages » Macaulay2Doc » matrices » Matrix » quotient(Matrix,Matrix)
next | previous | forward | backward | up | index | toc

quotient(Matrix,Matrix) -- factor a map through another with the same target

Description

This function produces a matrix h such that f - g*h is the reduction of f modulo a Gröbner basis for the image of g. See quotient' for the dual notion.

If the remainder f - g*h is zero, then the quotient f//g satisfies the equation f === g * (f//g). Otherwise, the equation g * h + r === f will hold, where r is the map provided by remainder.

i1 : R = ZZ[x,y]

o1 = R

o1 : PolynomialRing
i2 : M = (ker vars R)^2

o2 = image {1} | -y 0  |
           {1} | x  0  |
           {1} | 0  -y |
           {1} | 0  x  |

                             4
o2 : R-module, submodule of R
i3 : f = map(R^2, M, random(R^2, R^{2:-2}))

o3 = | 8x2+xy+3y2  3x2+7xy+8y2 |
     | 7x2+8xy+3y2 8x2+5xy+7y2 |

             2
o3 : Matrix R  <-- M
i4 : g = vars R ++ vars R

o4 = | x y 0 0 |
     | 0 0 x y |

             2      4
o4 : Matrix R  <-- R
i5 : h = quotient(f, g)

o5 = {1} | 8x+y  3x+7y |
     {1} | 3y    8y    |
     {1} | 7x+8y 8x+5y |
     {1} | 3y    7y    |

             4
o5 : Matrix R  <-- M
i6 : g * h == f

o6 = true

Note, however, that currently the function remainder only works if the source of f is free.

i7 : f = random(R^2, R^{2:-1})

o7 = | 8x+5y 6x+3y |
     | 2x+3y 6x+8y |

             2      2
o7 : Matrix R  <-- R
i8 : f = f + id_(R^2)

o8 = | 8x+5y+1 6x+3y   |
     | 2x+3y   6x+8y+1 |

             2      2
o8 : Matrix R  <-- R
i9 : h = quotient(f, g)

o9 = {1} | 8 6 |
     {1} | 5 3 |
     {1} | 2 6 |
     {1} | 3 8 |

             4      2
o9 : Matrix R  <-- R
i10 : r = remainder(f, g)

o10 = | 1 0 |
      | 0 1 |

              2      2
o10 : Matrix R  <-- R
i11 : g * h + r == f

o11 = true

factor a ring element or matrix through a set of generators

If either f or g is a ring element, then it is taken to be a scalar matrix acting on H. 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 Gröbner basis as so far computed is used. In these latter two cases, no Gröbner bases will be computed.

i12 : g = matrix{{x^2+y^2,x*y}}

o12 = | x2+y2 xy |

              1      2
o12 : Matrix R  <-- R
i13 : h = (x-y)^2 // g

o13 = {2} | 1  |
      {2} | -2 |

              2      1
o13 : Matrix R  <-- R

factor a number through a set of generators

One common use is the following. If an ideal contains 1, then we may write 1 in terms of the generators of the ideal. First we make an ideal.

i14 : A = ZZ/101[x,y,z]

o14 = A

o14 : PolynomialRing
i15 : F = x^4 - y*z*(1-x)^2 - z - y^3

       4    2       3
o15 = x  - x y*z - y  + 2x*y*z - y*z - z

o15 : A
i16 : I = ideal(F, diff(x,F), diff(y,F), diff(z,F))

              4    2       3                       3                     2   
o16 = 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)

o16 : Ideal of A

Transposing the (row) matrix of generators of the ideal puts the generators on separate lines and shows the degrees.

i17 : transpose gens I

o17 = {-4} | x4-x2yz-y3+2xyz-yz-z |
      {-3} | 4x3-2xyz+2yz         |
      {-3} | -x2z-3y2+2xz-z       |
      {-3} | -x2y+2xy-y-1         |

              4      1
o17 : Matrix A  <-- A

Next we test whether 1 is in the ideal.

i18 : 1 % I == 0

o18 = true

We see that 1 is in the ideal. Now we represent 1 in terms of the generators of I.

i19 : h = 1 // gens I

o19 = {4} | -46x3y2-4x2y3+11x4z+4x3yz-2x2y2z+22x3z2+50x2yz2+8x3y+36x2y2-xy3+1
      {3} | -39x4y2+x3y3-28x5z-x4yz-50x3y2z+45x4z2+38x3yz2-2x4y-9x3y2-25x2y3+
      {3} | 49x3y3+35x2y4+30x4yz-35x3y2z-33x2y3z-41x3yz2+17x2y2z2+31x3y2-12x2
      {3} | -26x3y2z-33x2y3z+15x4z2+33x3yz2+34x2y2z2+30x3z3-42x2yz3-35x3yz-29
      -----------------------------------------------------------------------
      4x3z+48xy2z+11x2z2-26xyz2-12x3-49x2y-7xy2+5y3-44x2z+12xyz-16y2z-13xz2-4
      47x4z-12x2y2z-28x3z2-44x2yz2+3x4-13x3y+8x2y2+24xy3+11x3z-32x2yz+41xy2z-
      y3+34xy4+29x3yz-16xy3z+30x2yz2-25xy2z2+4x3y+50x2y2+36xy3+32y4-19x2yz-4x
      x2y2z+15xy3z+20x3z2+2x2yz2-9xy2z2+26x2z3-38xyz3+25x3y-13x3z-25x2yz-50xy
      -----------------------------------------------------------------------
      6yz2+19x2-28xy-y2+22xz+9yz-15z2-49x-11y-
      22x2z2+4xyz2-30x3+7x2y-12xy2+45x2z-17xyz
      y2z+39y3z+38xyz2+49y2z2-40x2y+43xy2+34y3
      2z-37y3z-27x2z2-43xyz2+19y2z2-15xz3+yz3+
      -----------------------------------------------------------------------
      35z+28                                                                
      +21y2z+29xz2+2yz2-13x2+28xy-20y2-17xz+26yz-7x-19y-47z                 
      -26x2z+27xyz-3y2z+49xz2+5yz2-2x2+50xy-30y2+15xz-38yz-40z2+35x-43y+26z-
      x2y-14x2z+49xyz+7y2z+15xz2-39yz2-46z3-2xy+47xz+20yz+9z2+y+6z-1        
      -----------------------------------------------------------------------
         |
         |
      34 |
         |

              4      1
o19 : Matrix A  <-- A
i20 : gens I * h

o20 = | 1 |

              1      1
o20 : Matrix A  <-- A

quotient with remainder of a matrix by a number or ring element

i21 : matrix{{1,2},{3,4}} // 2

o21 = | 0 1 |
      | 1 2 |

               2       2
o21 : Matrix ZZ  <-- ZZ

See also

Ways to use this method:


The source of this document is in /build/reproducible-path/macaulay2-1.25.05+ds/M2/Macaulay2/packages/Macaulay2Doc/functions/quotient-remainder-doc.m2:126:0.