Changeset 07c623 in git


Ignore:
Timestamp:
Jan 9, 2001, 1:59:06 PM (23 years ago)
Author:
Gerhard Pfister <pfister@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
a62b2c2f48531ed474d94c36f7e62d6598277c34
Parents:
a73d1e145f94377c4fd99fa811a12de12f912e25
Message:
Fehler aus Radikal entfernt


git-svn-id: file:///usr/local/Singular/svn/trunk@5029 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/primdec.lib

    ra73d1e1 r07c623  
    11///////////////////////////////////////////////////////////////////////////////
    2 version="$Id: primdec.lib,v 1.84 2001-01-08 16:21:56 pfister Exp $";
     2version="$Id: primdec.lib,v 1.85 2001-01-09 12:59:06 pfister Exp $";
    33category="Commutative Algebra";
    44info="
    55LIBRARY: primdec.lib   Primary Decomposition and Radical of Ideals
    6 AUTHORS:  Gerhard Pfister, email: pfister@mathematik.uni-kl.de (GTZ)
    7           Wolfram Decker, email: decker@math.uni-sb.de         (SY)
    8           Hans Schoenemann, email: hannes@mathematik.uni-kl.de (SY)
     6AUTHORS:  Gerhard Pfister, pfister@mathematik.uni-kl.de (GTZ)
     7@*        Wolfram Decker, decker@math.uni-sb.de         (SY)
     8@*        Hans Schoenemann, hannes@mathematik.uni-kl.de (SY)
    99
    1010OVERVIEW:
    11  Algorithms for primary decomposition based on the ideas of
    12  Gianni,Trager,Zacharias was written by Gerhard Pfister.                       
    13  Algorithms for primary decomposition based on the ideas of
    14  Shimoyama/Yokoyama was written by Wolfram Decker and Hans Schoenemann.   
    15  These procedures are implemented to be used in characteristic 0.
    16  They also work in positive characteristic >> 0.
    17  In small characteristic and for algebraic extensions, primdecGTZ and
    18  minAssGTZ may not terminate and primdecSY and
    19  minAssChar may not give a complete decomposition.
     11    Algorithms for primary decomposition based on the ideas of
     12    Gianni,Trager,Zacharias was written by Gerhard Pfister.
     13    Algorithms for primary decomposition based on the ideas of
     14    Shimoyama/Yokoyama was written by Wolfram Decker and Hans Schoenemann.
     15 @* These procedures are implemented to be used in characteristic 0
     16    They also work in positive characteristic >> 0.
     17 @* In small characteristic and for algebraic extensions, primdecGTZ and
     18    minAssGTZ may not terminate and primdecSY and minAssChar may not give
     19    a complete decomposition.
     20    Algorithms for the computation of the radical based on the ideas of
     21    Krick/Logar and Kemper was written by Gerhard Pfister.
    2022
    2123PROCEDURES:
     
    2527 minAssChar(I...); the minimal associated primes using characteristic sets
    2628 testPrimary(L,k); tests the result of the primary decomposition
    27  radical(I);       computes the radical of the ideal I
     29 radical(I);       computes the radical of I via  Krick/Logar and Kemper
     30 radicalEHV(I);    computes the radical of I via  Eisenbud,Huneke,Vasconcelos
    2831 equiRadical(I);   the radical of the equidimensional part of the ideal I
    2932 prepareAss(I);    list of radicals of the equidimensional components of I
     
    4649///////////////////////////////////////////////////////////////////////////////
    4750
    48 proc sat1 (ideal id, poly p)
     51static proc sat1 (ideal id, poly p)
    4952"USAGE:   sat1(id,j);  id ideal, j polynomial
    5053RETURN:  saturation of id with respect to j (= union_(k=1...) of id:j^k)
    5154NOTE:    result is a std basis in the basering
    52 EXAMPLE: example sat; shows an example
     55EXAMPLE: example sat1; shows an example
    5356"
    5457{
     
    7174///////////////////////////////////////////////////////////////////////////////
    7275
    73 proc sat2 (ideal id, ideal h)
     76static proc sat2 (ideal id, ideal h)
    7477"USAGE:   sat2(id,j);  id ideal, j polynomial
    7578RETURN:  saturation of id with respect to j (= union_(k=1...) of id:j^k)
     
    140143///////////////////////////////////////////////////////////////////////////////
    141144
    142 proc minSat(ideal inew, ideal h)
     145static proc minSat(ideal inew, ideal h)
    143146{
    144147   int i,k;
     
    185188}
    186189
    187 proc quotMin(list tsil)
     190static proc quotMin(list tsil)
    188191{
    189192   int i,j,k,action;
     
    247250///////////////////////////////////////////////////////////////////////////////
    248251
    249 proc testFactor(list act,poly p)
     252static proc testFactor(list act,poly p)
    250253{
    251254  poly keep=p;
     
    261264   if(p-q!=0)
    262265   {
    263       "ERROR IN FACTOR";
    264       basering;
    265 
    266       act;
    267       keep;
    268       pause();
    269 
    270       p;
    271       q;
    272       pause();
     266      "ERROR IN FACTOR, please inform the authors";
    273267   }
    274268}
    275269///////////////////////////////////////////////////////////////////////////////
    276270
    277 proc factor(poly p)
     271static proc factor(poly p)
    278272"USAGE:   factor(p) p poly
    279273RETURN:  list=;
     
    383377///////////////////////////////////////////////////////////////////////////////
    384378
    385 proc idealsEqual( ideal k, ideal j)
     379static proc idealsEqual( ideal k, ideal j)
    386380{
    387381   return(stdIdealsEqual(std(k),std(j)));
    388382}
    389383
    390 proc specialIdealsEqual( ideal k1, ideal k2)
     384static proc specialIdealsEqual( ideal k1, ideal k2)
    391385{
    392386   int j;
     
    406400}
    407401
    408 proc stdIdealsEqual( ideal k1, ideal k2)
     402static proc stdIdealsEqual( ideal k1, ideal k2)
    409403{
    410404   int j;
     
    430424
    431425
    432 proc primaryTest (ideal i, poly p)
     426static proc primaryTest (ideal i, poly p)
    433427{
    434428   int m=1;
     
    525519
    526520///////////////////////////////////////////////////////////////////////////////
    527 proc splitPrimary(list l,ideal ser,int @wr,list sact)
     521static proc splitPrimary(list l,ideal ser,int @wr,list sact)
    528522{
    529523   int i,j,k,s,r,w;
     
    713707}
    714708///////////////////////////////////////////////////////////////////////////////
    715 proc splitCharp(list l)
     709static proc splitCharp(list l)
    716710{
    717711  if((char(basering)==0)||(npars(basering)>0))
     
    790784///////////////////////////////////////////////////////////////////////////////
    791785
    792 proc zero_decomp (ideal j,ideal ser,int @wr,list #)
     786static proc zero_decomp (ideal j,ideal ser,int @wr,list #)
    793787"USAGE:   zero_decomp(j,ser,@wr); j,ser ideals, @wr=0 or 1
    794788         (@wr=0 for primary decomposition, @wr=1 for computaion of associated
     
    983977                if(lead(primary[2*@k-1][@n])/var(zz)!=0)
    984978                {
    985                    jmap1[zz]=-1/leadcoef(primary[2*@k-1][@n])*primary[2*@k-1][@n]
     979                 jmap1[zz]=-1/leadcoef(primary[2*@k-1][@n])*primary[2*@k-1][@n]
    986980                   +2/leadcoef(primary[2*@k-1][@n])*lead(primary[2*@k-1][@n]);
    987981                    jmap2[zz]=primary[2*@k-1][@n];
     
    11851179   pr;
    11861180}
    1187 
    11881181///////////////////////////////////////////////////////////////////////////////
    11891182
    1190 proc ggt (ideal i)
    1191 "USAGE:   ggt(i); i list of polynomials
    1192 RETURN:  poly = ggt(i[1],...,i[size(i)])
    1193 NOTE:
    1194 EXAMPLE: example ggt; shows an example
    1195 "
    1196 {
    1197   int k;
    1198   poly p=i[1];
    1199   if(deg(p)==0)
    1200   {
    1201     return(1);
    1202   }
    1203 
    1204 
    1205   for (k=2;k<=size(i);k++)
    1206   {
    1207      if(deg(i[k])==0)
    1208      {
    1209         return(1)
    1210      }
    1211      p=GCD(p,i[k]);
    1212      if(deg(p)==0)
    1213      {
    1214         return(1);
    1215      }
    1216   }
    1217   return(p);
    1218 }
    1219 example
    1220 { "EXAMPLE:"; echo = 2;
    1221    ring  r = 0,(x,y,z),lp;
    1222    poly  p = (x+y)*(y+z);
    1223    poly  q = (z4+2)*(y+z);
    1224    ideal l=p,q;
    1225    poly  pr= ggt(l);
    1226    pr;
    1227 }
    1228 ///////////////////////////////////////////////////////////////////////////////
    1229 proc gcdTest(ideal act)
    1230 {
    1231   int i,j;
    1232   if(size(act)<=1)
    1233   {
    1234      return(0);
    1235   }
    1236   for (i=1;i<=size(act)-1;i++)
    1237   {
    1238      for(j=i+1;j<=size(act);j++)
    1239      {
    1240         if(deg(std(ideal(act[i],act[j]))[1])>0)
    1241         {
    1242            return(0);
    1243         }
    1244      }
    1245   }
    1246   return(1);
    1247 }
    1248 
    1249 ///////////////////////////////////////////////////////////////////////////////
    1250 proc coeffLcm(ideal h)
    1251 {
    1252    string @pa=parstr(basering);
    1253    if(size(@pa)==0)
    1254    {
    1255       return(lcm(h));
    1256    }
    1257    def bsr= basering;
    1258    string @id=string(h);
    1259    execute("ring @r=0,("+@pa+","+varstr(bsr)+"),(C,dp);");
    1260    execute ("ideal @i="+@id+";");
    1261    poly @p=lcm(@i);
    1262    string @ps=string(@p);
    1263    setring bsr;
    1264    execute ("poly @p="+@ps+";");
    1265    return(@p);
    1266 }
    1267 example
    1268 {
    1269    "EXAMPLE:"; echo = 2;
    1270    ring  r =( 0,a,b),(x,y,z),lp;
    1271    poly  p = (a+b)*(y-z);
    1272    poly  q = (a+b)*(y+z);
    1273    ideal l=p,q;
    1274    poly  pr= coeffLcm(l);
    1275    pr;
    1276 }
    1277 ///////////////////////////////////////////////////////////////////////////////
    1278 
    1279 proc clearSB (ideal i,list #)
     1183static proc clearSB (ideal i,list #)
    12801184"USAGE:   clearSB(i); i ideal which is SB ordered by monomial ordering
    12811185RETURN:  ideal = minimal SB
     
    13551259///////////////////////////////////////////////////////////////////////////////
    13561260
    1357 proc independSet (ideal j)
     1261static proc independSet (ideal j)
    13581262"USAGE:   independentSet(i); i ideal
    13591263RETURN:  list = new varstring with the independent set at the end,
     
    14231327///////////////////////////////////////////////////////////////////////////////
    14241328
    1425 proc maxIndependSet (ideal j)
     1329static proc maxIndependSet (ideal j)
    14261330"USAGE:   maxIndependentSet(i); i ideal
    14271331RETURN:  list = new varstring with the maximal independent set at the end,
     
    14911395///////////////////////////////////////////////////////////////////////////////
    14921396
    1493 proc prepareQuotientring (int nnp)
     1397static proc prepareQuotientring (int nnp)
    14941398"USAGE:   prepareQuotientring(nnp); nnp int
    14951399RETURN:  string = to define Kvar(nnp+1),...,var(nvars)[..rest ]
     
    15361440
    15371441///////////////////////////////////////////////////////////////////////////////
    1538 
    1539 proc projdim(list l)
    1540 {
    1541    int i=size(l)+1;
    1542 
    1543    while(i>2)
    1544    {
    1545       i--;
    1546       if((size(l[i])>0)&&(deg(l[i][1])>0))
    1547       {
    1548          return(i);
    1549       }
    1550    }
    1551 }
    1552 
    1553 ///////////////////////////////////////////////////////////////////////////////
    1554 proc cleanPrimary(list l)
     1442static proc cleanPrimary(list l)
    15551443{
    15561444   int i,j;
     
    15701458///////////////////////////////////////////////////////////////////////////////
    15711459
    1572 proc minAssPrimes(ideal i, list #)
     1460static proc minAssPrimes(ideal i, list #)
    15731461"USAGE:   minAssPrimes(i); i ideal
    15741462         minAssPrimes(i,1); i ideal  (to use also the factorizing Groebner)
     
    16981586}
    16991587
    1700 proc union(list li)
     1588static proc union(list li)
    17011589{
    17021590  int i,j,k;
     
    17721660}
    17731661///////////////////////////////////////////////////////////////////////////////
    1774 proc radicalOld(ideal i)
    1775 {
    1776    list pr=minAssPrimes(i,1);
    1777    int j;
    1778    ideal k=pr[1];
    1779    for(j=2;j<=size(pr);j++)
    1780    {
    1781       k=intersect(k,pr[j]);
    1782    }
    1783    return(k);
    1784 }
    1785 ///////////////////////////////////////////////////////////////////////////////
    17861662proc equidim(ideal i,list #)
    17871663"USAGE:  equidim(i) or equidim(i,1) ; i ideal
    1788          equidim(i,1) uses the algorithm of Eisenbud, Hunecke and Vasconcelos         
    1789  RETURN: list = list of equidimensional ideals a1,...,as such that
    1790          i is the intersection of a1,...,as. as is the equidimensional
    1791          locus of i, ai are the lower dimensional equidimensional loci
    1792          with (perhaps) modified embedded components,i.e. an embedded
    1793          component q (primary ideal) of i can be replaced in the decompo-
    1794          sition by a primary ideal q1 with the same radical as q
    1795  EXAMPLE:example equidim; shows an example
     1664         equidim(i,1) uses the algorithm of Eisenbud, Hunecke and Vasconcelos
     1665RETURN: list of equidimensional ideals a_1,...,a_s such that the following
     1666         holds:
     1667@*       a_s is the equidimensional locus of i, a1,...a_s-1 are the lower
     1668         dimensional equidimensional loci  with (perhaps) modified embedded
     1669         components. I.e. an embedded component q (primary ideal) of i can be
     1670         replaced in the decomposition by a primary ideal q1 with the same
     1671         radical as q.
     1672EXAMPLE:example equidim; shows an example
    17961673"
    17971674{
     1675  if(ord_test(basering)!=1)
     1676  {
     1677      ERROR(
     1678      "// Not implemented for this ordering, please change to global ordering."
     1679      );
     1680  }
    17981681  def  P = basering;
    17991682  list eq;
     
    18901773proc equidimMax(ideal i)
    18911774"USAGE:  equidimMax(i); i ideal           
    1892  RETURN:  ideal = ideal of equidimensional locus
    1893  EXAMPLE: example equidimMax; shows an example
     1775RETURN:  ideal of equidimensional locus (of maximal dimension) of i.
     1776EXAMPLE: example equidimMax; shows an example
    18941777"
    18951778{
     1779  if(ord_test(basering)!=1)
     1780  {
     1781      ERROR(
     1782      "// Not implemented for this ordering, please change to global ordering."
     1783      );
     1784  }
    18961785  def  P = basering;
    18971786  ideal eq;
     
    19991888
    20001889///////////////////////////////////////////////////////////////////////////////
    2001 proc decomp(ideal i,list #)
     1890static proc decomp(ideal i,list #)
    20021891"USAGE:   decomp(i); i ideal  (for primary decomposition)   (resp.
    20031892         decomp(i,1);        (for the minimal associated primes) )
     
    27982687
    27992688///////////////////////////////////////////////////////////////////////////////
    2800 proc powerCoeffs(poly f,int e)
     2689static proc powerCoeffs(poly f,int e)
    28012690//computes a polynomial with the same monomials as f but coefficients
    28022691//the p^e th power of the coefficients of f
     
    28132702///////////////////////////////////////////////////////////////////////////////
    28142703
    2815 proc sep(poly f,int i, list #)
     2704static proc sep(poly f,int i, list #)
    28162705"USAGE:  input: a polynomial f depending on the i-th variable and optional
    28172706         an integer k considering the polynomial f defined over Fp(t1,...,tm)
     
    28612750
    28622751///////////////////////////////////////////////////////////////////////////////
    2863 proc zeroRad(ideal I)
     2752static proc zeroRad(ideal I,list #)
    28642753"USAGE:  zeroRad(I) , I a zero-dimensional ideal
    28652754 RETURN: the radical of I
     
    28672756 EXAMPLE: example zeroRad; shows an example
    28682757{
    2869    
     2758   if(homog(I)==1){return(maxideal(1));}
    28702759   //I needs to be a reduced standard basis
    28712760   def R=basering;
     
    28792768   ideal F=finduni(I);//F[i] generates I intersected with K[var(i)]
    28802769   option(noredSB);
     2770   if(size(#)>0){I=#[1];}
    28812771
    28822772   for(i=1;i<=n;i++)
     
    29222812
    29232813///////////////////////////////////////////////////////////////////////////////
    2924 proc radicalKL (ideal i,ideal ser,list #)
    2925 {
    2926   // i needs to be a reduced standard basis
     2814static proc radicalKL (ideal i,ideal ser,list #)
     2815{
     2816  attrib(i,"isSB",1);   // i needs to be a reduced standard basis
    29272817  //--------------------------------------------------------------------------
    29282818  //i is the zero-ideal
     
    29342824   }
    29352825
     2826   list indep,fett;
     2827   intvec @w,@hilb;
     2828   int @wr,@n,@m,lauf,di;
     2829   ideal fac,@h,collectrad,lsau;
     2830   poly @q;
     2831   string @va,quotring;
     2832
    29362833   def  @P = basering;
    2937    list indep,allindep,restindep,fett,@mu;
    2938    intvec @vh,isat,@w,@hilb;
    2939    int @wr,@k,@n,@m,@n1,@n2,@n3,lauf,di;
    2940    ideal @j,@j1,fac,@h,collectrad,htrad,lsau;
     2834   int jdim=dim(i);
     2835   int  homo=homog(i);
    29412836   ideal rad=ideal(1);
    29422837   ideal te=ser;
    2943 
    2944    poly @p,@q;
    2945    string @va,quotring,@ri;
    2946    int  homo=homog(i);
    2947    attrib(i,"isSB",1);
    29482838   if(size(#)>0)
    29492839   {
    29502840      @wr=#[1];
    29512841   }
    2952    int jdim=dim(i);
    2953 
    29542842   if(homo==1)
    29552843   {
    2956       if(jdim==0)
    2957       {
    2958          return(maxideal(1));
    2959       }
    29602844      for(@n=1;@n<=nvars(basering);@n++)
    29612845      {
     
    29642848      @hilb=hilb(i,1,@w);     
    29652849   }
     2850
     2851
    29662852  //---------------------------------------------------------------------------
    29672853  //j is the ring
     
    31743060///////////////////////////////////////////////////////////////////////////////
    31753061
    3176 proc radicalEHV(ideal i,ideal re,list #)
    3177 {
     3062proc radicalEHV(ideal i)
     3063"USAGE:   radicalEHV(i); i ideal.
     3064RETURN:  ideal, the radical of i.
     3065NOTE:    The algorithm of Eisenbud,Huneke,Vasconcelos is used.
     3066         Works only in characteristic 0 or p large.
     3067EXAMPLE: example radicalEHV; shows an example
     3068"
     3069{
     3070   if(ord_test(basering)!=1)
     3071   {
     3072      ERROR(
     3073      "// Not implemented for this ordering, please change to global ordering."
     3074      );
     3075   }
     3076   if((char(basering)<100)&&(char(basering)!=0))
     3077   {
     3078      "WARNING: The characteristic is too small, the result may be wrong";
     3079   }
    31783080   ideal J,I,I0,radI0,L,radI1,I2,radI2;
    3179    int l,il;
    3180    if(size(#)>0)
    3181    {
    3182       il=#[1];
    3183    }
     3081   int l;
    31843082
    31853083   option(redSB);
     
    31873085        I=m[2];
    31883086   option(noredSB);
    3189    if(size(reduce(re,m[1],1))==0)
    3190    {
    3191       return(re);
    3192    }
     3087
    31933088   int cod=nvars(basering)-dim(m[1]);
    3194    if((nvars(basering)<=5)&&(size(m[2])<=5)
    3195        &&((char(basering)==0)||(char(basering)>181)))
    3196    {
    3197       if(cod==size(m[2]))
    3198       {
    3199         J=minor(jacob(I),cod);
    3200         return(quotient(I,J));
    3201       }
    3202 
    3203       for(l=1;l<=cod;l++)
    3204       {
    3205          I0[l]=I[l];
    3206       }
    3207       if(dim(std(I0))+cod==nvars(basering))
    3208       {
    3209          J=minor(jacob(I0),cod);
    3210          radI0=quotient(I0,J);
    3211          L=quotient(radI0,I);
    3212          radI1=quotient(radI0,L);
    3213 
    3214          if(size(reduce(radI1,m[1],1))==0)
    3215          {
    3216             return(I);
    3217          }
    3218          if(il==1)
    3219          {
    3220 
    3221             return(radI1);
    3222          }
    3223 
    3224          I2=sat(I,radI1)[1];
    3225 
    3226          if(deg(I2[1])<=0)
    3227          {
    3228             return(radI1);
    3229          }
    3230          return(intersect(radI1,radicalEHV(I2,re,il)));
    3231       }
    3232    }
    3233    return(radicalKL(m[1],re,il));
    3234 }
     3089
     3090   if(cod==size(m[2]))
     3091   {
     3092     J=minor(jacob(I),cod);
     3093     return(quotient(I,J));
     3094   }
     3095
     3096   for(l=1;l<=cod;l++)
     3097   {
     3098      I0[l]=I[l];
     3099   }
     3100   if(dim(std(I0))+cod==nvars(basering))
     3101   {
     3102      J=minor(jacob(I0),cod);
     3103      radI0=quotient(I0,J);
     3104      L=quotient(radI0,I);
     3105      radI1=quotient(radI0,L);
     3106
     3107      if(size(reduce(radI1,m[1],1))==0)
     3108      {
     3109         return(I);
     3110      }
     3111
     3112      I2=sat(I,radI1)[1];
     3113
     3114      if(deg(I2[1])<=0)
     3115      {
     3116         return(radI1);
     3117      }
     3118      return(intersect(radI1,radicalEHV(I2)));
     3119   }
     3120}
     3121example
     3122{ "EXAMPLE:";  echo = 2;
     3123   ring  r = 0,(x,y,z),dp;
     3124   poly  p = z2+1;
     3125   poly  q = z3+2;
     3126   ideal i = p*q^2,y-z2;
     3127   ideal pr= radicalEHV(i);
     3128   pr;
     3129}
     3130
    32353131///////////////////////////////////////////////////////////////////////////////
    32363132
    3237 proc Ann(module M)
     3133static proc Ann(module M)
    32383134{
    32393135  M=prune(M);  //to obtain a small embedding
     
    32443140
    32453141//computes the equidimensional part of the ideal i of codimension e
    3246 proc int_ass_primary_e(ideal i, int e)
     3142static proc int_ass_primary_e(ideal i, int e)
    32473143{
    32483144  if(homog(i)!=1)
     
    32643160//computes the annihilator of Ext^n(R/i,R) with given resolution re
    32653161//n is not necessarily the number of variables
    3266 proc AnnExt_R(int n,list re)
     3162static proc AnnExt_R(int n,list re)
    32673163{
    32683164  if(n<nvars(basering))
     
    32823178///////////////////////////////////////////////////////////////////////////////
    32833179
    3284 proc analyze(list pr)
     3180static proc analyze(list pr)
    32853181{
    32863182   int ii,jj;
     
    33123208///////////////////////////////////////////////////////////////////////////////
    33133209
    3314 proc simplifyIdeal(ideal i)
     3210static proc simplifyIdeal(ideal i)
    33153211{
    33163212  def r=basering;
     
    33543250//////////////////////////////////////////////////////
    33553251
    3356 proc ini_mod(poly p)
     3252static proc ini_mod(poly p)
    33573253{
    33583254  if (p==0)
     
    33873283
    33883284
    3389 proc min_ass_prim_charsets (ideal PS, int cho)
     3285static proc min_ass_prim_charsets (ideal PS, int cho)
    33903286{
    33913287  if((cho<0) and (cho>1))
     
    34163312
    34173313
    3418 proc min_ass_prim_charsets0 (ideal PS)
     3314static proc min_ass_prim_charsets0 (ideal PS)
    34193315{
    34203316
     
    35123408
    35133409
    3514 proc min_ass_prim_charsets1 (ideal PS)
     3410static proc min_ass_prim_charsets1 (ideal PS)
    35153411{
    35163412  def oldring=basering;
     
    36353531
    36363532
    3637 proc prim_dec(ideal I, int choose)
     3533static proc prim_dec(ideal I, int choose)
    36383534{
    36393535   if((choose<0) or (choose>3))
     
    38603756
    38613757
    3862 proc pseudo_prim_dec_charsets (ideal I, ideal SI, int choo)
     3758static proc pseudo_prim_dec_charsets (ideal I, ideal SI, int choo)
    38633759{
    38643760  list L;          // The list of minimal associated primes,
     
    39103806
    39113807
    3912 proc pseudo_prim_dec_special_charsets (ideal SI,list V6, int choo)
     3808static proc pseudo_prim_dec_special_charsets (ideal SI,list V6, int choo)
    39133809{
    39143810  int i,j,l;
     
    40083904
    40093905
    4010 proc pseudo_prim_dec_i (ideal SI, list L)
     3906static proc pseudo_prim_dec_i (ideal SI, list L)
    40113907{
    40123908  list Q;
     
    40773973
    40783974
    4079 proc extraction (ideal SI, ideal SP)
     3975static proc extraction (ideal SI, ideal SP)
    40803976{
    40813977  list indsets=indepSet(SP,0);
     
    41824078
    41834079
    4184 proc minsat(ideal SI, poly p)
     4080static proc minsat(ideal SI, poly p)
    41854081{
    41864082  ideal fac=factorize(p,1);       //the irreducible factors of p
     
    42284124
    42294125
    4230 proc minsat_ppd(ideal SI, ideal fac)
     4126static proc minsat_ppd(ideal SI, ideal fac)
    42314127{
    42324128  fac=sort(fac)[1];
     
    42724168/////////////////////////////////////////////////////////////////
    42734169
    4274 proc minquot(list tsil)
     4170static proc minquot(list tsil)
    42754171{
    42764172   int i,j,k,action;
     
    43394235//////////////////////////////////////////////////
    43404236
    4341 proc special_ideals_equal( ideal k1, ideal k2)
     4237static proc special_ideals_equal( ideal k1, ideal k2)
    43424238{
    43434239   int j;
     
    43594255///////////////////////////////////////////////////////////////////////////////
    43604256
    4361 proc convList(list l)
     4257static proc convList(list l)
    43624258{
    43634259   int i;
     
    43724268///////////////////////////////////////////////////////////////////////////////
    43734269
    4374 proc reconvList(list l)
     4270static proc reconvList(list l)
    43754271{
    43764272   int i;
     
    43924288proc primdecGTZ(ideal i)
    43934289"USAGE:   primdecGTZ(i); i ideal
    4394 RETURN:  a list, say pr, of primary ideals and their associated primes
    4395          pr[i][1], resp. pr[i][2] is the i-th primary resp. prime component
    4396 NOTE:    Algorithm of Gianni, Traeger, Zacharias
    4397          designed for characteristic 0, works also in char k > 0, if it
     4290RETURN:  a list pr of primary ideals and their associated primes:
     4291@*       -  pr[i][1] the i-th primary component,
     4292@*       -  pr[i][2] the i-th prime component.
     4293NOTE:    Algorithm of Gianni, Traeger, Zacharias.
     4294         Designed for characteristic 0, works also in char k > 0, if it
    43984295         terminates (may result in an infinite loop in small characteristic!)
    43994296EXAMPLE: example primdecGTZ; shows an example
    44004297"
    44014298{
     4299   if(ord_test(basering)!=1)
     4300   {
     4301      ERROR(
     4302      "// Not implemented for this ordering, please change to global ordering."
     4303      );
     4304   }
    44024305   return(convList(decomp(i)));
    44034306}
    44044307example
    44054308{ "EXAMPLE:";  echo = 2;
    4406    ring  r = 32003,(x,y,z),lp;
     4309   ring  r = 0,(x,y,z),lp;
    44074310   poly  p = z2+1;
    4408    poly  q = z4+2;
    4409    ideal i = p^2*q^3,(y-z3)^3,(x-yz+z4)^4;
     4311   poly  q = z3+2;
     4312   ideal i = p*q^2,y-z2;
    44104313   list pr = primdecGTZ(i);
    44114314   pr;
     
    44154318proc primdecSY(ideal i, list #))
    44164319"USAGE:   primdecSY(i); i ideal, c int
    4417          if c=0, the given ordering of the variables is used.
    4418          if c=1, minAssChar tries to use an optimal ordering,
    4419          if c=2, minAssGTZ is used
    4420          if c=3, minAssGTZ and facstd is used
    4421 RETURN:  a list, say pr, of primary ideals and their associated primes
    4422          pr[i][1], resp. pr[i][2] is the i-th primary resp. prime component
    4423 NOTE:    Algorithm of Shimoyama-Yokoyama
    4424          implemented for characteristic 0, works also in char k > 0,
    4425          the result may be not completely decomposed in small characteristic
     4320@*         if c=0, the given ordering of the variables is used.
     4321@*         if c=1, minAssChar tries to use an optimal ordering,
     4322@*         if c=2, minAssGTZ is used
     4323@*         if c=3, minAssGTZ and facstd is used
     4324RETURN:  a list pr of primary ideals and their associated primes:
     4325@*         -  pr[i][1] the i-th primary component,
     4326@*         -  pr[i][2] the i-th prime component.
     4327NOTE:    Algorithm of Shimoyama-Yokoyama.
     4328         Due to a bug in the factorization, the result may be not completely
     4329         decomposed in small characteristic.
    44264330EXAMPLE: example primdecSY; shows an example
    44274331"
    44284332{
     4333   if(ord_test(basering)!=1)
     4334   {
     4335      ERROR(
     4336      "// Not implemented for this ordering, please change to global ordering."
     4337      );
     4338   }
    44294339   if (size(#)==1)
    44304340   { return(prim_dec(i,#[1])); }
     
    44344344example
    44354345{ "EXAMPLE:";  echo = 2;
    4436    ring  r = 32003,(x,y,z),lp;
     4346   ring  r = 0,(x,y,z),lp;
    44374347   poly  p = z2+1;
    4438    poly  q = z4+2;
    4439    ideal i = p^2*q^3,(y-z3)^3,(x-yz+z4)^4;
     4348   poly  q = z3+2;
     4349   ideal i = p*q^2,y-z2;
    44404350   list pr = primdecSY(i);
    44414351   pr;
     
    44444354proc minAssGTZ(ideal i)
    44454355"USAGE:   minAssGTZ(i); i ideal
    4446 RETURN:  list = the minimal associated prime ideals of i
    4447 NOTE:    designed for characteristic 0, works also in char k > 0 if it
    4448          terminates, may result in an infinite loop in small characteristic
     4356RETURN:  a list, the minimal associated prime ideals of i.
     4357NOTE:    Designed for characteristic 0, works also in char k > 0 if it
     4358         terminates, may result in an infinite loop in small characteristic.
    44494359EXAMPLE: example minAssGTZ; shows an example
    44504360"
    44514361{
     4362   if(ord_test(basering)!=1)
     4363   {
     4364      ERROR(
     4365      "// Not implemented for this ordering, please change to global ordering."
     4366      );
     4367   }
    44524368   return(minAssPrimes(i,1));
    44534369}
    44544370example
    44554371{ "EXAMPLE:";  echo = 2;
    4456    ring  r = 32003,(x,y,z),dp;
     4372   ring  r = 0,(x,y,z),dp;
    44574373   poly  p = z2+1;
    4458    poly  q = z4+2;
    4459    ideal i = p^2*q^3,(y-z3)^3,(x-yz+z4)^4;
    4460    list pr= minAssGTZ(i);
     4374   poly  q = z3+2;
     4375   ideal i = p*q^2,y-z2;
     4376   list pr = minAssGTZ(i);
    44614377   pr;
    44624378}
     
    44644380///////////////////////////////////////////////////////////////////////////////
    44654381proc minAssChar(ideal i, list #)
    4466 "USAGE:   minAssChar(i[,c]); i ideal,
    4467          if c=0, the given ordering of the variables is used.
     4382"USAGE:   minAssChar(i[,c]); i ideal.
     4383         If c=0, the given ordering of the variables is used.
    44684384         Otherwise, the system tries to find an optimal ordering,
    4469          which in some cases may considerably speed up the algorithm
    4470 RETURN:  list = the minimal associated prime ideals of i
    4471 NOTE:    implemented for characteristic 0, works also in char k >> 0,
    4472          the result may be not compltely decomposed in small characteristic
     4385         which in some cases may considerably speed up the algorithm.
     4386RETURN:  a list, the minimal associated prime ideals of i.
     4387NOTE:    Due to a bug in the factorization, the result may be not completely
     4388         decomposed in small characteristic.
    44734389EXAMPLE: example minAssChar; shows an example
    44744390"
    44754391{
    4476   if (size(#)==1)
    4477   { return(min_ass_prim_charsets(i,#[1])); }
    4478   else
    4479   { return(min_ass_prim_charsets(i,1)); }
     4392   if(ord_test(basering)!=1)
     4393   {
     4394      ERROR(
     4395      "// Not implemented for this ordering, please change to global ordering."
     4396      );
     4397   }
     4398   if (size(#)==1)
     4399   { return(min_ass_prim_charsets(i,#[1])); }
     4400   else
     4401   { return(min_ass_prim_charsets(i,1)); }
    44804402}
    44814403example
    44824404{ "EXAMPLE:";  echo = 2;
    4483    ring  r = 32003,(x,y,z),dp;
     4405   ring  r = 0,(x,y,z),dp;
    44844406   poly  p = z2+1;
    4485    poly  q = z4+2;
    4486    ideal i = p^2*q^3,(y-z3)^3,(x-yz+z4)^4;
    4487    list pr= minAssChar(i);
     4407   poly  q = z3+2;
     4408   ideal i = p*q^2,y-z2;
     4409   list pr = minAssChar(i);
    44884410   pr;
    44894411}
     
    44914413proc equiRadical(ideal i)
    44924414"USAGE:   equiRadical(i); i ideal
    4493 RETURN:  ideal, intersection of associated primes of i of maximal  dimension
    4494 NOTE:    designed for characteristic 0, works also in char k > 0 if it
    4495          terminates, may result in an infinite loop in small characteristic
     4415RETURN:  ideal, intersection of associated primes of i of maximal dimension.
     4416NOTE:    A combination of the algorithms of Krick/Logar and Kemper is used.
     4417         Works also in positive characteristic (Kempers algorithm).
    44964418EXAMPLE: example equiRadical; shows an example
    44974419"
    44984420{
     4421   if(ord_test(basering)!=1)
     4422   {
     4423      ERROR(
     4424      "// Not implemented for this ordering, please change to global ordering."
     4425      );
     4426   }
    44994427   return(radical(i,1));
    45004428}
    45014429example
    45024430{ "EXAMPLE:";  echo = 2;
    4503    ring  r = 32003,(x,y,z),dp;
     4431   ring  r = 0,(x,y,z),dp;
    45044432   poly  p = z2+1;
    4505    poly  q = z4+2;
    4506    ideal i = p^2*q^3,(y-z3)^3,(x-yz+z4)^4;
     4433   poly  q = z3+2;
     4434   ideal i = p*q^2,y-z2;
    45074435   ideal pr= equiRadical(i);
    45084436   pr;
     
    45104438///////////////////////////////////////////////////////////////////////////////
    45114439proc radical(ideal i,list #)
    4512 "USAGE:   radical(i); i ideal
    4513 RETURN:  ideal = the radical of i
    4514 NOTE:    a combination of the algorithms of Krick/Logar and
    4515          Eisenbud/Huneke/Vasconcelos
    4516          designed for characteristic 0, works also in char k > 0 if it
    4517          terminates, may result in an infinite loop in small characteristic
     4440"USAGE:   radical(i); i ideal.
     4441RETURN:  ideal, the radical of i.
     4442NOTE:    A combination of the algorithms of Krick/Logar and Kemper is used.
     4443         Works also in positive characteristic (Kempers algorithm).
    45184444EXAMPLE: example radical; shows an example
    45194445"
    45204446{
     4447   if(ord_test(basering)!=1)
     4448   {
     4449      ERROR(
     4450      "// Not implemented for this ordering, please change to global ordering."
     4451      );
     4452   }
    45214453   def @P=basering;
    45224454   int j,il;
     
    45264458   }
    45274459   ideal re=1;
     4460   intvec vv = option(get);
     4461   list qr=simplifyIdeal(i);
     4462
     4463   map phi=@P,qr[2];
     4464   ideal k=qr[1];
    45284465   option(redSB);
    4529    list qr=simplifyIdeal(i);
    4530 
    4531    map phi=@P,qr[2];
    4532    i=qr[1];
    4533 
    4534    i=std(i);
    4535    int di=dim(i);
     4466   k=groebner(k);
     4467   option(noredSB);
     4468   int di=dim(k);
    45364469   if(di==0)
    45374470   {
    4538      i=zeroRad(i);
     4471     i=zeroRad(k,i);
    45394472     return(phi(i));
    45404473   }
    4541    list pr=facstd(i);
     4474   option(redSB);
     4475   list pr=facstd(k);
    45424476   option(noredSB);
     4477   option(set,vv);
    45434478   int s=size(pr);
    45444479   for(j=1;j<=s;j++)
     
    45544489example
    45554490{ "EXAMPLE:";  echo = 2;
    4556    ring  r = 32003,(x,y,z),dp;
     4491   ring  r = 0,(x,y,z),dp;
    45574492   poly  p = z2+1;
    4558    poly  q = z4+2;
    4559    ideal i = p^2*q^3,(y-z3)^3,(x-yz+z4)^4;
     4493   poly  q = z3+2;
     4494   ideal i = p*q^2,y-z2;
    45604495   ideal pr= radical(i);
    45614496   pr;
     
    45644499proc prepareAss(ideal i)
    45654500"USAGE:   prepareAss(i); i ideal
    4566 RETURN:  list = the radicals of the maximal dimensional components of i
    4567 NOTE:    uses algorithm of Eisenbud, Huneke and Vasconcelos
     4501RETURN:  a list, the radicals of the maximal dimensional components of i.
     4502NOTE:    Uses algorithm of Eisenbud, Huneke and Vasconcelos.
    45684503EXAMPLE: example prepareAss; shows an example
    45694504"
    45704505{
     4506  if(ord_test(basering)!=1)
     4507  {
     4508      ERROR(
     4509      "// Not implemented for this ordering, please change to global ordering."
     4510      );
     4511  }
    45714512  ideal j=std(i);
    45724513  int cod=nvars(basering)-dim(j);
     
    45964537example
    45974538{ "EXAMPLE:";  echo = 2;
    4598    ring  r = 32003,(x,y,z),dp;
     4539   ring  r = 0,(x,y,z),dp;
    45994540   poly  p = z2+1;
    4600    poly  q = z4+2;
    4601    ideal i = p^2*q^3,(y-z3)^3,(x-yz+z4)^4;
    4602    list pr= prepareAss(i);
     4541   poly  q = z3+2;
     4542   ideal i = p*q^2,y-z2;
     4543   list pr = prepareAss(i);
    46034544   pr;
    46044545}
     
    46064547proc equidimMaxEHV(ideal i)
    46074548"USAGE:  equidimMaxEHV(i); i ideal
    4608 RETURN:  ideal = equidimensional componente of i
    4609 NOTE:    uses algorithm of Eisenbud, Huneke and Vasconcelos
     4549RETURN:  ideal, the equidimensional component (of maximal dimension) of i.
     4550NOTE:    Uses algorithm of Eisenbud, Huneke and Vasconcelos.
    46104551EXAMPLE: example equidimMaxEHV; shows an example
    46114552"
    46124553{
     4554  if(ord_test(basering)!=1)
     4555  {
     4556      ERROR(
     4557      "// Not implemented for this ordering, please change to global ordering."
     4558      );
     4559  }
    46134560  ideal j=groebner(i);
    46144561  int cod=nvars(basering)-dim(j);
     
    46294576example
    46304577{ "EXAMPLE:";  echo = 2;
    4631    ring  r = 32003,(x,y,z),dp;
     4578   ring  r = 0,(x,y,z),dp;
    46324579   ideal i=intersect(ideal(z),ideal(x,y),ideal(x2,z2),ideal(x5,y5,z5));
    46334580   equidimMaxEHV(i);
    46344581}
    46354582
    4636 proc testPrimary(list pr, ideal k)
     4583static proc testPrimary(list pr, ideal k)
    46374584"USAGE:   testPrimary(pr,k); pr a list, result of primdecGTZ(k) or primdecSY(k)
    46384585RETURN:  int, 1 if intersection of the primary ideals in pr is k, 0 if not
     
    46624609proc zerodec(ideal I)
    46634610"USAGE:   zerodec(I); I ideal
    4664 RETURN:  a list of primary ideals, the zero-dimensional decomposition of I
     4611RETURN:  A list of primary ideals, the zero-dimensional decomposition of I
    46654612ASSUME:  I is zero-dimensional, the characterisitic of the ground field is 0
    4666 NOTE:    the algorithm (of C. Monico), works well only for small total
    4667          number of solutions (i.e. vdim(std(I)) should be < 100)
    4668          and without parameters. In practice, it works also in big
    4669          characteristic p>0 but may fail for small p.
    4670          If printlevel > 0 (default = 0) additional information is displayed
     4613NOTE:    The algorithm (of C. Monico), works well only for small total number
     4614         of solutions (vdim(std(I)) should be < 100) and without parameters.
     4615         In practice, it works also in big characteristic p>0 but may fail
     4616         for small p.
     4617@*         If printlevel > 0 (default = 0) additional information is displayed
    46714618EXAMPLE: example zerodec; shows an example
    46724619"
    46734620{
     4621   if(ord_test(basering)!=1)
     4622   {
     4623      ERROR(
     4624      "// Not implemented for this ordering, please change to global ordering."
     4625      );
     4626   }
    46744627   def R=basering;
    46754628   poly q;
     
    47624715example
    47634716{ "EXAMPLE:";  echo = 2;
    4764    ring r=0,(x,y),dp;
    4765    ideal i=x2-2,y2-2;
    4766    list pr=zerodec(i);
     4717   ring r  = 0,(x,y),dp;
     4718   ideal i = x2-2,y2-2;
     4719   list pr = zerodec(i);
    47674720   pr;
    47684721}
     
    47864739time=timer; list pr1=zerodec(gls); timer-time;size(pr1);
    47874740time=timer; list pr =primdecGTZ(gls); timer-time;size(pr);
     4741time=timer; ideal ra =radical(gls); timer-time;size(pr);
    47884742
    47894743//2.cyclic5  vdim=70, 20 Komponenten
    47904744//zerodec-time:36(28)  (matrix:1(0) charpoly:18(19) factor:17(9)
    47914745//primdecGTZ-time: 28(5)
     4746//radical : 0
    47924747ring rs= 0,(a,b,c,d,e),dp;
    47934748poly f0= a + b + c + d + e + 1;
     
    49074862time=timer; list pr =primdecGTZ(gls); timer-time;
    49084863time=timer; list pr =primdecSY(gls); timer-time;
     4864time=timer; ideal ra =radical(gls); timer-time;size(pr);
    49094865*/
    49104866
Note: See TracChangeset for help on using the changeset viewer.