|
D.15.19.1 chinrempoly
Procedure from library nfmodstd.lib (see nfmodstd_lib).
- Usage:
- chinrempoly(l, m); l list, m list
- Return:
- a polynomial (resp. ideal/module) which is congruent to l[i] modulo m[i]
for all i
- Note:
- The procedure applies chinese remaindering to the first argument w.r.t. the
moduli given in the second. The elements in the first list must be of the same
type which can be polynomial, ideal, or module. The moduli must be of type
polynomial. The elements in the second list must be distinct and co-prime.
Example:
| LIB "nfmodstd.lib";
ring rr=97,x,dp;
poly f=x^7-7*x + 3;
ideal J=factorize(f,1);
J;
==> J[1]=x+37
==> J[2]=x3-46x2+17x-8
==> J[3]=x3+9x2+20x-20
list m=J[1..ncols(J)];
list l= x^2+2*x+3, x^2+5, x^2+7;
ideal I=chinrempoly(l,m);
I;
==> I[1]=24x6+19x4-20x3+43x2-16x+45
ring s=0,x,dp;
list m= x^2+2*x+3, x^3+5, x^4+x^3+7;
list l=x^3 + 2, x^4 + 7, x^5 + 11;
ideal I=chinrempoly(l,m);
I;
==> I[1]=18113/107610x8+5826/17935x7-5257/107610x6+3975/7174x5+246151/107610x\
4+131573/53805x3-910/633x2-36239/21522x+146695/7174
int p=prime(536546513);
ring r = p, (x,y,a), (dp(2),dp(1));
poly minpolynomial = a^2+1;
ideal kf=factorize(minpolynomial,1); //return factors without multiplicity
kf;
==> kf[1]=a-222052315
==> kf[2]=a+222052315
ideal k=(a+1)*x2+y, 3x-ay+ a+2;
option(redSB);
ideal k1=k,kf[1];
ideal k2 =k,kf[2];
k1=std(k1);
k2=std(k2);
list l=k1,k2;
list m=kf[1..ncols(kf)];
ideal I=chinrempoly(l,m);
I=simplify(I,2);
I;
==> I[1]=x-178848838ya+178848838a-178848837
==> I[2]=y2-268273248ya+268273250y-4a-3
l = module(k1[2..ncols(k1)]), module(k2[2..ncols(k2)]);
module M = chinrempoly(l,m);
M;
==> M[1]=x*gen(1)-178848838ya*gen(1)+178848838a*gen(1)-178848837*gen(1)
==> M[2]=y2*gen(1)-268273248ya*gen(1)+268273250y*gen(1)-4a*gen(1)-3*gen(1)
| See also:
chinrem.
|