Macaulay2 / M2

The primary source code repository for Macaulay2, a system for computing in commutative algebra, algebraic geometry and related fields.
https://macaulay2.com
330 stars 228 forks source link

bug in gb over ZZ ? (using custom ordering) #290

Open jakobkroeker opened 9 years ago

jakobkroeker commented 9 years ago

if the following example is legal input, and my test ist correct, there is a bug:


R = ZZ[x_1..x_3, Weights => {-1, 2, -1}, Global=>false ]

I = ideal(1+x_1,2*x_1)

gI = ideal gens gb I;
assert( ( (gens I)%gI) == 0 );
ggI = ideal gens gb gI;
assert(numColumns (gens gI) == numColumns(gens ggI));
assert( leadingTermsEquivalent( gI, ggI ) ) ;
gI
ggI

output


      R = ZZ[x_1..x_3, Weights => {-1, 2, -1}, Global=>false ]

o64 = R

o64 : PolynomialRing

i65 : 
      I = ideal(1+x_1,2*x_1)

o65 = ideal (1 + x , 2x )
                  1    1

o65 : Ideal of R

i66 : 
      gI = ideal gens gb I;

o66 : Ideal of R

i67 : assert( ( (gens I)%gI) == 0 );

i68 : ggI = ideal gens gb gI;

o68 : Ideal of R

i69 : assert(numColumns (gens gI) == numColumns(gens ggI));
stdio:357:1:(3): error: assertion failed

i70 : assert( leadingTermsEquivalent( gI, ggI ) ) ;
stdio:358:1:(3): error: assertion failed

i71 : gI

o71 = ideal (x , 1)
              1

o71 : Ideal of R

i72 : ggI

o72 = ideal 1

o72 : Ideal of R

remark: leadingTermsEquivalent defined as

leadingTermsEquivalent := (I,J)->
(
    if (numColumns (gens I) != numColumns(gens J)) then return false;   
    for i in 0..(numColumns (gens I))-1 do
    (
        if not (leadTerm(I_i) % leadTerm(J_i) ==0 ) then
        (
            return false;
        );
        if not (leadTerm(J_i) % leadTerm(I_i) ==0 ) then
        (
            return false;
        );
    );   
    return (true);
);
DanGrayson commented 9 years ago

Since the monomials are not well ordered by this ordering, why should anything be true about the Groebner basis?

mikestillman commented 9 years ago

The algorithm uses the Mora algorithm. The bug is happening after the GB is complete, and during minimalization of the basis. I'm assigning this bug to myself.

mikestillman commented 9 years ago

Oops, actually, my last comment is for #292, I think. I'll still assign this to myself.

mikestillman commented 9 years ago

This might duplicate #291, I need to look into it.