Roland Dreier on Thu, 25 Feb 1999 14:50:34 -0600 (CST)


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Strange polresultant behavior


I'm getting the following strange behavior from gp version 2.0.13.  I have
two polynomials in two variables, x and y (over the field with 5
elements).  I take their resultant with respect to x to get a big
polynomial in y.  I then take a root of this polynomial and plug it in for
y in the original two polynomials to get two polynomials in x.  Unless I'm
confused, the resultant of these two new polynomials should be zero -- it
doesn't matter whether I plug the root in after taking the resultant or
before.  But for certain polynomials, I don't get zero.

I apologize for the huge size of the polynomials involved here, but I
don't know what's going on and I can't seem to find a smaller example.

Here's the output:

                       GP/PARI CALCULATOR Version 2.0.13 (alpha)
                    i586 running linux (ix86 kernel) 32-bit version
                      (readline enabled, extended help available)

                              Copyright (C) 1989-1998 by
              C. Batut, K. Belabas, D. Bernardi, H. Cohen and M. Olivier.

Type ? for help, \q to quit.
Type ?12 for how to get moral (and possibly technical) support.

   realprecision = 28 significant digits
   seriesprecision = 16 significant terms
   format = g0.28

parisize = 40000000, primelimit = 500000
? \rresult-bug
calculating resultant...
resultant degree = 3174
substitute into resultant: 0
substitute then take resultant: Mod(Mod(2, 5)*y + Mod(2, 5), Mod(1, 5)*y^2
+ Mod(3, 5))

result-bug is the file:
{
v1 = [[4, 2, 3, 1, 3, 2, 1, 2, 1, 0, 3, 3, 1, 3, 2, 1, 4, 2, 4, 0, 3, 1,
2, 1, 3, 4, 4, 3, 4, 0, 2, 1, 4], [], [], [], [], [4, 3, 0, 1, 4, 0, 2, 1,
4, 4, 3, 0, 3, 4, 4, 1, 0, 2, 3, 3, 0, 4, 3, 0, 3, 1, 0, 3, 2, 3, 1, 3,
3], [0], [0], [0], [0], [1, 0, 3, 2, 1, 0, 2, 4, 0, 3, 1, 2, 4, 2, 4, 1,
3, 3, 3, 2, 2, 0, 1, 3, 1, 1, 1, 4, 0, 3, 1, 0, 1]];
v2 = [[3, 2, 1, 2, 0, 1, 4, 1, 1, 3, 3, 0, 0, 3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,
3, 0, 2, 2, 0, 4, 2, 1, 2, 2, 3, 0, 1, 0, 4, 4, 4, 0, 3, 1, 2, 1, 2, 0, 1,
1, 0, 0, 0, 2, 4, 0, 1, 2, 2, 3, 0, 1, 3, 2, 4, 0, 1]];
p1=Pol(vector(length(v1),j,Pol(v1[j], y))) * Mod(1,5);
p2=Pol(vector(length(v2),j,Pol(v2[j], y))) * Mod(1,5);
print("calculating resultant...");
res=polresultant(p1,p2,x);
print("resultant degree = ", poldegree(res));
fac=(y^2 + 3) * Mod(1, 5);
elt=Mod(Mod(1,5) * y, fac);
print("substitute into resultant: ", subst(res, y, elt));
print("substitute then take resultant: ", polresultant(subst(p1, y, elt),
subst(p2, y, elt), x));
}