sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.38k stars 470 forks source link

primary decomposition doesn't work when ideal is in a quotient polynomial ring #16381

Open williamstein opened 10 years ago

williamstein commented 10 years ago

I was trying to do a simple example on page 51 of Atiyah-Macdonald using Sage, and it fails:

R.<x,y,z> = QQ[]
I = R.ideal([x*y - z^2])
A.<xbar,ybar,zbar> = R.quotient(I)
p = A.ideal([x,z])
p.primary_decomposition()

boom! ---

Error in lines 5-5
Traceback (most recent call last):
  File "/projects/71755b5a-fde1-45bc-9ca8-d06d5b9749f1/.sagemathcloud/sage_server.py", line 733, in execute
    exec compile(block+'\n', '', 'single') in namespace, locals
  File "", line 1, in <module>
  File "/usr/local/sage/sage-6.2.rc0/local/lib/python2.7/site-packages/sage/rings/polynomial/multi_polynomial_ideal.py", line 604, in __call__
    return self.f(self._instance, *args, **kwds)
  File "/usr/local/sage/sage-6.2.rc0/local/lib/python2.7/site-packages/sage/rings/polynomial/multi_polynomial_ideal.py", line 1146, in primary_decomposition
    return [I for I, _ in self.complete_primary_decomposition(algorithm)]
  File "/usr/local/sage/sage-6.2.rc0/local/lib/python2.7/site-packages/sage/rings/polynomial/multi_polynomial_ideal.py", line 604, in __call__
    return self.f(self._instance, *args, **kwds)
  File "/usr/local/sage/sage-6.2.rc0/local/lib/python2.7/site-packages/sage/rings/polynomial/multi_polynomial_ideal.py", line 505, in wrapper
    return func(*args, **kwds)
  File "/usr/local/sage/sage-6.2.rc0/local/lib/python2.7/site-packages/sage/rings/polynomial/multi_polynomial_ideal.py", line 1068, in complete_primary_decomposition
    P = primdecSY(self)
  File "function.pyx", line 1285, in sage.libs.singular.function.SingularFunction.__call__ (sage/libs/singular/function.cpp:13025)
TypeError: Cannot call Singular function 'primdecSY' with ring parameter of type '<class 'sage.rings.quotient_ring.QuotientRing_generic_with_category'>'

Upstream: Reported upstream. Developers acknowledge bug.

Component: commutative algebra

Keywords: sd59

Author: Martin Albrecht

Branch/Commit: u/malb/trac_16381 @ c237b07

Issue created by migration from https://trac.sagemath.org/ticket/16381

malb commented 10 years ago
comment:1

So we'd want somthing like this?

sage: R.<x,y,z> = QQ[]
sage: I = R.ideal([x*y - z^2])
sage: A.<xbar,ybar,zbar> = R.quotient(I)
sage: J = A.ideal([x,z])
# primary decomposition starts here
sage: J = Ideal(f.lift() for f in p.gens())
sage: Q = Sequence(Ideal(A(f) for f in q.gens()) for q in (I + J).primary_decomposition())
malb commented 10 years ago

Author: Martin Albrecht

malb commented 10 years ago

Changed keywords from none to sd59

malb commented 10 years ago

Branch: u/malb/trac_16381

malb commented 10 years ago

Commit: c237b07

malb commented 10 years ago

New commits:

c237b07fixing #16381: primary decomposition for quotient rings
miguelmarco commented 10 years ago
comment:5

Am i missing something or singular can give incorrect anwers in this case? :

                     SINGULAR                                 /  Development
 A Computer Algebra System for Polynomial Computations       /   version 3-1-6
                                                           0<
 by: W. Decker, G.-M. Greuel, G. Pfister, H. Schoenemann     \   Dec 2012
FB Mathematik der Universitaet, D-67653 Kaiserslautern        \
> ring r=0,(x,y,z),dp;
> ideal i=z2-x2-y2;
> qring  q = i;
> setring q;
> ideal j0=y2;
> ideal j1=x-z;
> ideal j2=x+z;
> LIB "primdec.lib";
// ** loaded /home/mmarco/sage/local/share/singular/primdec.lib (14732,2012-03-30)
// ** loaded /home/mmarco/sage/local/share/singular/ring.lib (15322,2012-10-12)
// ** loaded /home/mmarco/sage/local/share/singular/absfact.lib (14191,2011-05-04)
// ** loaded /home/mmarco/sage/local/share/singular/triang.lib (13499,2010-10-15)
// ** loaded /home/mmarco/sage/local/share/singular/matrix.lib (13658,2010-11-16)
// ** loaded /home/mmarco/sage/local/share/singular/nctools.lib (14246,2011-05-26)
// ** loaded /home/mmarco/sage/local/share/singular/inout.lib (13499,2010-10-15)
// ** loaded /home/mmarco/sage/local/share/singular/random.lib (14661,2012-03-05)
// ** loaded /home/mmarco/sage/local/share/singular/poly.lib (14852,2012-04-30)
// ** loaded /home/mmarco/sage/local/share/singular/elim.lib (14661,2012-03-05)
// ** loaded /home/mmarco/sage/local/share/singular/general.lib (14191,2011-05-04)
> primdecGTZ(j0);
[1]:
   [1]:
      _[1]=y2
   [2]:
      _[1]=y

but j0 is the inttersection of j1 and j2, which are prime ideals:

> intersect(j1,j2);
_[1]=x2-z2
_[2]=xy2+y2z
> factorize(xy2+y2z);
[1]:
   _[1]=1
   _[2]=x+z
   _[3]=y
[2]:
   1,1,2
> primdecGTZ(j1);
[1]:
   [1]:
      _[1]=x-z
   [2]:
      _[1]=x-z
> primdecGTZ(j2);
[1]:
   [1]:
      _[1]=x+z
   [2]:
      _[1]=x+z
malb commented 10 years ago

Upstream: Reported upstream. No feedback yet.

malb commented 10 years ago

Changed upstream from Reported upstream. No feedback yet. to Reported upstream. Developers acknowledge bug.

malb commented 10 years ago
comment:7

It's confirmed as a bug in upstream.

ea1d0bf8-c27a-4548-8cb7-de0b1d02441a commented 9 years ago
comment:9

Primary decomposition in quotient rings is not yet supported by Singular, see documentation.

Consider that Singular usually never checks if used parameters are valid or allowed!! Their philosophy is/was that the user should know what he is doing, a very unfortunate one from my point of view.

Parameter check is now (since ver 4.0 ) done for primary decomposition. Maybe I will add support for primary decomposition in quotient rings, so bug me continuously to get this done.