? f = x^3 - 2; ? k = nfinit(f); ? i = idealfactor(k,3); ? j = idealfactor(k,5);
Next we form matrix whose rows correspond to a product of two primes,
one dividing and one dividing
:
? m = matrix(2,2); ? m[1,] = i[1,]; ? m[1,2] = 1; ? m[2,] = j[1,];Note that we set m[1,2] = 1, so the exponent is 1 instead of
? ?idealchinese idealchinese(nf,x,y): x being a prime ideal factorization and y a vector of elements, gives an element b such that v_p(b-y_p)>=v_p(x) for all prime ideals p dividing x, and v_p(b)>=0 for all other p. ? idealchinese(k, m, [x,1]) [0, 0, -1]~ ? nfbasis(f) [1, x, x^2]Thus PARI finds the lift
? idealadd(k, i[1,1], -x^2 - x) [3 1 2] [0 1 0] [0 0 1] ? idealadd(k, j[1,1], -x^2-1) [5 2 1] [0 1 0] [0 0 1]