Bill Allombert on Mon, 13 Apr 2020 19:20:36 +0200


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

Re: [PariGP] arithmetic modulo polynomials - best syntax question


On Mon, Apr 13, 2020 at 06:46:43PM +0200, Dr. Wolfgang Lindner wrote:
> Dear group,
> 
> testing congruence modulo a polynomial I try to show that:
> 
>         in Z/5Z[X] the polynomials f=1+x+x^2  and  g=1-x+3*x^3
>         are _not_ congruent modulo p=X^2.
> 
> I like the very straightforward and compact syntax of Pari/GP.
> So I tried to show the above task on several ways.

The mathematically correct way to proceed is

f=1+x+x^2
g=1-x+3*x^3
p=x^2

in Z[X] then

f5=f*Mod(1,5)
g5=g*Mod(1,5)
p5=p*Mod(1,5)
in Z/5Z[X]

then you can do
(f5-g5)%p5

which gives
Mod(2,5)*x

in Z/5Z[X] so they are not congruent.

Cheers,
Bill.