Oops, continuing: more precisely, we wish to find a q in Q[Y1, Y2] such that q(f1, f2) = g. In this case, we have q(Y1, Y2) = Y1^2 + Y1*Y2 - Y2 as a solution, as f1^2 + f1*f2 - f2 = g
As far as I can see, I can't easily use the lift function for this, as the ideal's polynomials will always be linear in the resulting expression for g. Cheers, Johan On Apr 5, 2:08 pm, "Johan S. R. Nielsen" <santaph...@gmail.com> wrote: > Thanks for the swift reply! That is a neat function, but I don't think > it is what I need. I was being too unclear, so here is an example: > > Let R = Q[x], f1 = x^2 + 1 and f2 = x + 3 and g = x4+x3+4x2+x+3. We > wish to write g as a polynomial in f1 and f2 over Q; more precisely, > we wish to find a q > > On Apr 5, 1:42 pm, Mike Hansen <mhan...@gmail.com> wrote: > > > On Tue, Apr 5, 2011 at 1:24 PM, Johan S. R. Nielsen > > > <santaph...@gmail.com> wrote: > > > Let's say that I have a multivariate polynomial ring R which contains > > > the polynomials p, f1, ..., fn. I also know that p is in the ideal J = > > > <f1,..., fn>. Now I wish to write p as a polynomial in the f- > > > polynomials. How can I do that with Sage? > > > The main tool for you to use is the lift method. > > > sage: R.<x0,x1,x2,x3> = PolynomialRing(QQ) > > sage: f = x0^2*x1 + x1^2*x2 + x2^2*x3 + x3^2*x0 > > sage: (f0, f1, f2, f3) = [f.derivative(v) for v in [x0, x1, x2, x3]] > > sage: I = R.ideal(f0, f1, f2, f3) > > sage: p = x0*f0 + x1*f1 + x2*f2 + x3*f3; p > > 3*x0^2*x1 + 3*x1^2*x2 + 3*x2^2*x3 + 3*x0*x3^2 > > sage: p in I > > True > > sage: p.lift(I) > > [x0, x1, x2, x3] > > sage: p.lift(I.gens()) #Also works > > [x0, x1, x2, x3] > > > Those are the coefficients in front of the f-polynomials used to form p. > > > --Mike > > -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org