Jeroen Demeyer on Thu, 9 Oct 2003 22:13:13 +0200 |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
Re: Oddities modulo multivariate polynomials |
On Thu, Oct 09, 2003 at 08:51:32AM +0200, Gerhard Niklasch wrote: > Hi Jeroen, > > > Could anyone please explain what is happening here: > > > > GP/PARI CALCULATOR Version 2.1.5 (released) > > i686 running linux (ix86 kernel) 32-bit version > > (readline v4.3 enabled, extended help available) > > > > ? Y /* Make sure Y is defined first */ > > %1 = Y > > ? (Y^2) % (X^3 - Y^2) > > %2 = X^3 > > ? (X^3) % (X^2 + 1) > > %3 = -X > > ? ((Y^2) % (X^3 - Y^2)) % (X^2 + 1) > > %4 = 0 > > > > How come the outputs of the two last statements are different? Is this > > a bug or am I doing something wrong? Any help would be appreciated. > > Hint: %2 is a polynomial in Y, of degree 0, with constant term X^3. > (\x will show this.) > > Thus the last '%' operation is performed in Q(X)[Y], not in Q[X], > and the result is correct for Q(X)[Y] (where (X^2+1) is a nonzero > constant and thus invertible - everything is divisible by it without > remainder.) > > Evaluate %2 at Y=0 or just extract the coefficient to get the desired > polynomial in X. > > (Just another facet of the general fact that PARI deals in polynomials > in one variable over fields, not in multivariate polynomials, unlike > most computer _algebra_ software.) Thanks for the reply. Allright now I think I understand what the problem is. Is there an easy way to solve this issue? Wat I really want to do is arithmetic in a ring of the form Fp[X,Y] / (f(X), g(X,Y)) This is: a finite field (with prime order, so it's just modulo p) with 2 variables modulo two polynomials. Can this be done with GP? If it can't be done directly, I'll probably try to hack something like that myself.