# polynomial decomposition

Assume i have some multivariate polynomials P1,...,Pn and a polynomial P. Sage is able to tell whether P is in the ideal generated by P1,...,Pn by writing P in R.ideal([P1,...,Pn]), where R is the polynomial ring containing the Pi. When the answer is True, i would like to obtain a certificate, that is a list of polynomials Q1,...,Qn such that P = P1*Q1 + ... + Pn*Qn. Is there an easy way to get this ? If possible i would like the Qi to have small coefficients.

edit retag close merge delete

Sort by ยป oldest newest most voted

You can use singular but it seems to be not interfaced directly

sage: R.<x1,x2,x3> = QQ[]
sage: P0 = x2*x2 + x3**2*x1
sage: P1 = x1*x1*x3 + x2*x1**3 +x3**3
sage: P2 = x1**3 + x2**3 + x3**3
sage: Q = 2*P0 + (x1*x2-3)*P1 + x1*P2
sage: I = R.ideal([P0,P1,P2])
sage: I_sg = singular(I)
sage: M = I_sg.lift(Q).sage()
sage: M[0,0]*P0 + M[1,0]*P1 + M[2,0]*P2 == Q
True

more

1

Thanks. Actually, you do not need to use singular directly, a lift method exists for polynomials and you do not need to use the ideal (which i find not natural since the result depends on the generators, not only on the ideal), but you can use directly the list of polynomials:

sage: R.<x1,x2,x3> = QQ[]
sage: P0 = x2*x2 + x3**2*x1
sage: P1 = x1*x1*x3 + x2*x1**3 +x3**3
sage: P2 = x1**3 + x2**3 + x3**3
sage: Q = 2*P0 + (x1*x2-3)*P1 + x1*P2
sage: M = Q.lift([P0,P1,P2])
sage: M[0]*P0 + M[1]*P1 + M[2]*P2 == Q
True


However, your solution works with the ring ZZ, while mine only works for fields...

( 2016-01-02 15:42:04 +0200 )edit