> > - - multivariate polynomials:
> >   given an ideal I = (f_1,...,f_r) and some g in I, find s_1,...,s_r such
> >   that g = s_1 f_1 + ... + s_r f_r (this doesn't seem to be available
> >   even for Groebner basis)
>
> You're right that this doesn't seem to be available, which is a strange
> oversight.  It *must* be easily available within Singular though, so it's
> probably a few lines of code to add it to SAGE.

See attachment.


-- 
name: Martin Albrecht
_pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99
_www: http://www.informatik.uni-bremen.de/~malb
_jab: [EMAIL PROTECTED]


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://sage.math.washington.edu/sage/ and http://sage.scipy.org/sage/
-~----------~----~----~----~------~----~------~--~---

# HG changeset patch
# User 'Martin Albrecht <[EMAIL PROTECTED]>'
# Date 1170879646 28800
# Node ID 289e32a37192e033c54e2edcc4b78b81a1f8bec2
# Parent  b5f4f6a1d90dd14f32e2641a1a87d86b81e625e6
added lift method.

diff -r b5f4f6a1d90d -r 289e32a37192 sage/rings/multi_polynomial_element.py
--- a/sage/rings/multi_polynomial_element.py	Tue Feb 06 21:34:28 2007 -0800
+++ b/sage/rings/multi_polynomial_element.py	Wed Feb 07 12:20:46 2007 -0800
@@ -49,6 +49,8 @@ from sage.structure.factorization import
 from sage.structure.factorization import Factorization
 
 from sage.rings.polynomial_singular_interface import Polynomial_singular_repr
+
+from sage.structure.sequence import Sequence
 
 import multi_polynomial_ring
 import polynomial_ring
@@ -1023,7 +1025,33 @@ class MPolynomial_polydict(Polynomial_si
         F = Factorization(v)
         F.sort()
         return F
-        
+
+    def lift(self,I):
+        """
+        given an ideal I = (f_1,...,f_r) and some g (== self) in I,
+        find s_1,...,s_r such that g = s_1 f_1 + ... + s_r f_r
+
+        ALGORITHM: Use Singular.
+
+        EXAMPLE:
+            sage: A.<x,y> = PolynomialRing(QQ,2,order='degrevlex')
+            sage: I = A.ideal([x^10 + x^9*y^2, y^8 - x^2*y^7 ])
+            sage: f = x*y^13 + y^12
+            sage: M = f.lift(I)
+            sage: M
+            [y^4 + x*y^5 + x^2*y^3 + x^3*y^4 + x^4*y^2 + x^5*y^3 + x^6*y + x^7*y^2 + x^8, y^7]
+            sage: sum( map( mul , zip( M, I.gens() ) ) ) == f
+            True
+        """
+        fs = self._singular_()
+        Is = I._singular_()
+        P = I.ring()
+        try:
+            M = Is.lift(fs)._sage_(P)
+        except TypeError:
+            raise ArithmeticError, "f is not in I"
+        return Sequence(M.list(), P, check=False, immutable=True)
+            
     def gcd(self, f):
         """
         Compute the greatest common divisor of this polynomial and f.

Reply via email to