Changeset 07c623 in git
- Timestamp:
- Jan 9, 2001, 1:59:06 PM (23 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- a62b2c2f48531ed474d94c36f7e62d6598277c34
- Parents:
- a73d1e145f94377c4fd99fa811a12de12f912e25
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/primdec.lib
ra73d1e1 r07c623 1 1 /////////////////////////////////////////////////////////////////////////////// 2 version="$Id: primdec.lib,v 1.8 4 2001-01-08 16:21:56 pfister Exp $";2 version="$Id: primdec.lib,v 1.85 2001-01-09 12:59:06 pfister Exp $"; 3 3 category="Commutative Algebra"; 4 4 info=" 5 5 LIBRARY: 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)6 AUTHORS: 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) 9 9 10 10 OVERVIEW: 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. 20 22 21 23 PROCEDURES: … … 25 27 minAssChar(I...); the minimal associated primes using characteristic sets 26 28 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 28 31 equiRadical(I); the radical of the equidimensional part of the ideal I 29 32 prepareAss(I); list of radicals of the equidimensional components of I … … 46 49 /////////////////////////////////////////////////////////////////////////////// 47 50 48 proc sat1 (ideal id, poly p)51 static proc sat1 (ideal id, poly p) 49 52 "USAGE: sat1(id,j); id ideal, j polynomial 50 53 RETURN: saturation of id with respect to j (= union_(k=1...) of id:j^k) 51 54 NOTE: result is a std basis in the basering 52 EXAMPLE: example sat ; shows an example55 EXAMPLE: example sat1; shows an example 53 56 " 54 57 { … … 71 74 /////////////////////////////////////////////////////////////////////////////// 72 75 73 proc sat2 (ideal id, ideal h)76 static proc sat2 (ideal id, ideal h) 74 77 "USAGE: sat2(id,j); id ideal, j polynomial 75 78 RETURN: saturation of id with respect to j (= union_(k=1...) of id:j^k) … … 140 143 /////////////////////////////////////////////////////////////////////////////// 141 144 142 proc minSat(ideal inew, ideal h)145 static proc minSat(ideal inew, ideal h) 143 146 { 144 147 int i,k; … … 185 188 } 186 189 187 proc quotMin(list tsil)190 static proc quotMin(list tsil) 188 191 { 189 192 int i,j,k,action; … … 247 250 /////////////////////////////////////////////////////////////////////////////// 248 251 249 proc testFactor(list act,poly p)252 static proc testFactor(list act,poly p) 250 253 { 251 254 poly keep=p; … … 261 264 if(p-q!=0) 262 265 { 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"; 273 267 } 274 268 } 275 269 /////////////////////////////////////////////////////////////////////////////// 276 270 277 proc factor(poly p)271 static proc factor(poly p) 278 272 "USAGE: factor(p) p poly 279 273 RETURN: list=; … … 383 377 /////////////////////////////////////////////////////////////////////////////// 384 378 385 proc idealsEqual( ideal k, ideal j)379 static proc idealsEqual( ideal k, ideal j) 386 380 { 387 381 return(stdIdealsEqual(std(k),std(j))); 388 382 } 389 383 390 proc specialIdealsEqual( ideal k1, ideal k2)384 static proc specialIdealsEqual( ideal k1, ideal k2) 391 385 { 392 386 int j; … … 406 400 } 407 401 408 proc stdIdealsEqual( ideal k1, ideal k2)402 static proc stdIdealsEqual( ideal k1, ideal k2) 409 403 { 410 404 int j; … … 430 424 431 425 432 proc primaryTest (ideal i, poly p)426 static proc primaryTest (ideal i, poly p) 433 427 { 434 428 int m=1; … … 525 519 526 520 /////////////////////////////////////////////////////////////////////////////// 527 proc splitPrimary(list l,ideal ser,int @wr,list sact)521 static proc splitPrimary(list l,ideal ser,int @wr,list sact) 528 522 { 529 523 int i,j,k,s,r,w; … … 713 707 } 714 708 /////////////////////////////////////////////////////////////////////////////// 715 proc splitCharp(list l)709 static proc splitCharp(list l) 716 710 { 717 711 if((char(basering)==0)||(npars(basering)>0)) … … 790 784 /////////////////////////////////////////////////////////////////////////////// 791 785 792 proc zero_decomp (ideal j,ideal ser,int @wr,list #)786 static proc zero_decomp (ideal j,ideal ser,int @wr,list #) 793 787 "USAGE: zero_decomp(j,ser,@wr); j,ser ideals, @wr=0 or 1 794 788 (@wr=0 for primary decomposition, @wr=1 for computaion of associated … … 983 977 if(lead(primary[2*@k-1][@n])/var(zz)!=0) 984 978 { 985 979 jmap1[zz]=-1/leadcoef(primary[2*@k-1][@n])*primary[2*@k-1][@n] 986 980 +2/leadcoef(primary[2*@k-1][@n])*lead(primary[2*@k-1][@n]); 987 981 jmap2[zz]=primary[2*@k-1][@n]; … … 1185 1179 pr; 1186 1180 } 1187 1188 1181 /////////////////////////////////////////////////////////////////////////////// 1189 1182 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 #) 1183 static proc clearSB (ideal i,list #) 1280 1184 "USAGE: clearSB(i); i ideal which is SB ordered by monomial ordering 1281 1185 RETURN: ideal = minimal SB … … 1355 1259 /////////////////////////////////////////////////////////////////////////////// 1356 1260 1357 proc independSet (ideal j)1261 static proc independSet (ideal j) 1358 1262 "USAGE: independentSet(i); i ideal 1359 1263 RETURN: list = new varstring with the independent set at the end, … … 1423 1327 /////////////////////////////////////////////////////////////////////////////// 1424 1328 1425 proc maxIndependSet (ideal j)1329 static proc maxIndependSet (ideal j) 1426 1330 "USAGE: maxIndependentSet(i); i ideal 1427 1331 RETURN: list = new varstring with the maximal independent set at the end, … … 1491 1395 /////////////////////////////////////////////////////////////////////////////// 1492 1396 1493 proc prepareQuotientring (int nnp)1397 static proc prepareQuotientring (int nnp) 1494 1398 "USAGE: prepareQuotientring(nnp); nnp int 1495 1399 RETURN: string = to define Kvar(nnp+1),...,var(nvars)[..rest ] … … 1536 1440 1537 1441 /////////////////////////////////////////////////////////////////////////////// 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) 1442 static proc cleanPrimary(list l) 1555 1443 { 1556 1444 int i,j; … … 1570 1458 /////////////////////////////////////////////////////////////////////////////// 1571 1459 1572 proc minAssPrimes(ideal i, list #)1460 static proc minAssPrimes(ideal i, list #) 1573 1461 "USAGE: minAssPrimes(i); i ideal 1574 1462 minAssPrimes(i,1); i ideal (to use also the factorizing Groebner) … … 1698 1586 } 1699 1587 1700 proc union(list li)1588 static proc union(list li) 1701 1589 { 1702 1590 int i,j,k; … … 1772 1660 } 1773 1661 /////////////////////////////////////////////////////////////////////////////// 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 ///////////////////////////////////////////////////////////////////////////////1786 1662 proc equidim(ideal i,list #) 1787 1663 "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 1665 RETURN: 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. 1672 EXAMPLE:example equidim; shows an example 1796 1673 " 1797 1674 { 1675 if(ord_test(basering)!=1) 1676 { 1677 ERROR( 1678 "// Not implemented for this ordering, please change to global ordering." 1679 ); 1680 } 1798 1681 def P = basering; 1799 1682 list eq; … … 1890 1773 proc equidimMax(ideal i) 1891 1774 "USAGE: equidimMax(i); i ideal 1892 RETURN: ideal = ideal of equidimensional locus 1893 1775 RETURN: ideal of equidimensional locus (of maximal dimension) of i. 1776 EXAMPLE: example equidimMax; shows an example 1894 1777 " 1895 1778 { 1779 if(ord_test(basering)!=1) 1780 { 1781 ERROR( 1782 "// Not implemented for this ordering, please change to global ordering." 1783 ); 1784 } 1896 1785 def P = basering; 1897 1786 ideal eq; … … 1999 1888 2000 1889 /////////////////////////////////////////////////////////////////////////////// 2001 proc decomp(ideal i,list #)1890 static proc decomp(ideal i,list #) 2002 1891 "USAGE: decomp(i); i ideal (for primary decomposition) (resp. 2003 1892 decomp(i,1); (for the minimal associated primes) ) … … 2798 2687 2799 2688 /////////////////////////////////////////////////////////////////////////////// 2800 proc powerCoeffs(poly f,int e)2689 static proc powerCoeffs(poly f,int e) 2801 2690 //computes a polynomial with the same monomials as f but coefficients 2802 2691 //the p^e th power of the coefficients of f … … 2813 2702 /////////////////////////////////////////////////////////////////////////////// 2814 2703 2815 proc sep(poly f,int i, list #)2704 static proc sep(poly f,int i, list #) 2816 2705 "USAGE: input: a polynomial f depending on the i-th variable and optional 2817 2706 an integer k considering the polynomial f defined over Fp(t1,...,tm) … … 2861 2750 2862 2751 /////////////////////////////////////////////////////////////////////////////// 2863 proc zeroRad(ideal I)2752 static proc zeroRad(ideal I,list #) 2864 2753 "USAGE: zeroRad(I) , I a zero-dimensional ideal 2865 2754 RETURN: the radical of I … … 2867 2756 EXAMPLE: example zeroRad; shows an example 2868 2757 { 2869 2758 if(homog(I)==1){return(maxideal(1));} 2870 2759 //I needs to be a reduced standard basis 2871 2760 def R=basering; … … 2879 2768 ideal F=finduni(I);//F[i] generates I intersected with K[var(i)] 2880 2769 option(noredSB); 2770 if(size(#)>0){I=#[1];} 2881 2771 2882 2772 for(i=1;i<=n;i++) … … 2922 2812 2923 2813 /////////////////////////////////////////////////////////////////////////////// 2924 proc radicalKL (ideal i,ideal ser,list #)2925 { 2926 // i needs to be a reduced standard basis2814 static proc radicalKL (ideal i,ideal ser,list #) 2815 { 2816 attrib(i,"isSB",1); // i needs to be a reduced standard basis 2927 2817 //-------------------------------------------------------------------------- 2928 2818 //i is the zero-ideal … … 2934 2824 } 2935 2825 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 2936 2833 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); 2941 2836 ideal rad=ideal(1); 2942 2837 ideal te=ser; 2943 2944 poly @p,@q;2945 string @va,quotring,@ri;2946 int homo=homog(i);2947 attrib(i,"isSB",1);2948 2838 if(size(#)>0) 2949 2839 { 2950 2840 @wr=#[1]; 2951 2841 } 2952 int jdim=dim(i);2953 2954 2842 if(homo==1) 2955 2843 { 2956 if(jdim==0)2957 {2958 return(maxideal(1));2959 }2960 2844 for(@n=1;@n<=nvars(basering);@n++) 2961 2845 { … … 2964 2848 @hilb=hilb(i,1,@w); 2965 2849 } 2850 2851 2966 2852 //--------------------------------------------------------------------------- 2967 2853 //j is the ring … … 3174 3060 /////////////////////////////////////////////////////////////////////////////// 3175 3061 3176 proc radicalEHV(ideal i,ideal re,list #) 3177 { 3062 proc radicalEHV(ideal i) 3063 "USAGE: radicalEHV(i); i ideal. 3064 RETURN: ideal, the radical of i. 3065 NOTE: The algorithm of Eisenbud,Huneke,Vasconcelos is used. 3066 Works only in characteristic 0 or p large. 3067 EXAMPLE: 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 } 3178 3080 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; 3184 3082 3185 3083 option(redSB); … … 3187 3085 I=m[2]; 3188 3086 option(noredSB); 3189 if(size(reduce(re,m[1],1))==0) 3190 { 3191 return(re); 3192 } 3087 3193 3088 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 } 3121 example 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 3235 3131 /////////////////////////////////////////////////////////////////////////////// 3236 3132 3237 proc Ann(module M)3133 static proc Ann(module M) 3238 3134 { 3239 3135 M=prune(M); //to obtain a small embedding … … 3244 3140 3245 3141 //computes the equidimensional part of the ideal i of codimension e 3246 proc int_ass_primary_e(ideal i, int e)3142 static proc int_ass_primary_e(ideal i, int e) 3247 3143 { 3248 3144 if(homog(i)!=1) … … 3264 3160 //computes the annihilator of Ext^n(R/i,R) with given resolution re 3265 3161 //n is not necessarily the number of variables 3266 proc AnnExt_R(int n,list re)3162 static proc AnnExt_R(int n,list re) 3267 3163 { 3268 3164 if(n<nvars(basering)) … … 3282 3178 /////////////////////////////////////////////////////////////////////////////// 3283 3179 3284 proc analyze(list pr)3180 static proc analyze(list pr) 3285 3181 { 3286 3182 int ii,jj; … … 3312 3208 /////////////////////////////////////////////////////////////////////////////// 3313 3209 3314 proc simplifyIdeal(ideal i)3210 static proc simplifyIdeal(ideal i) 3315 3211 { 3316 3212 def r=basering; … … 3354 3250 ////////////////////////////////////////////////////// 3355 3251 3356 proc ini_mod(poly p)3252 static proc ini_mod(poly p) 3357 3253 { 3358 3254 if (p==0) … … 3387 3283 3388 3284 3389 proc min_ass_prim_charsets (ideal PS, int cho)3285 static proc min_ass_prim_charsets (ideal PS, int cho) 3390 3286 { 3391 3287 if((cho<0) and (cho>1)) … … 3416 3312 3417 3313 3418 proc min_ass_prim_charsets0 (ideal PS)3314 static proc min_ass_prim_charsets0 (ideal PS) 3419 3315 { 3420 3316 … … 3512 3408 3513 3409 3514 proc min_ass_prim_charsets1 (ideal PS)3410 static proc min_ass_prim_charsets1 (ideal PS) 3515 3411 { 3516 3412 def oldring=basering; … … 3635 3531 3636 3532 3637 proc prim_dec(ideal I, int choose)3533 static proc prim_dec(ideal I, int choose) 3638 3534 { 3639 3535 if((choose<0) or (choose>3)) … … 3860 3756 3861 3757 3862 proc pseudo_prim_dec_charsets (ideal I, ideal SI, int choo)3758 static proc pseudo_prim_dec_charsets (ideal I, ideal SI, int choo) 3863 3759 { 3864 3760 list L; // The list of minimal associated primes, … … 3910 3806 3911 3807 3912 proc pseudo_prim_dec_special_charsets (ideal SI,list V6, int choo)3808 static proc pseudo_prim_dec_special_charsets (ideal SI,list V6, int choo) 3913 3809 { 3914 3810 int i,j,l; … … 4008 3904 4009 3905 4010 proc pseudo_prim_dec_i (ideal SI, list L)3906 static proc pseudo_prim_dec_i (ideal SI, list L) 4011 3907 { 4012 3908 list Q; … … 4077 3973 4078 3974 4079 proc extraction (ideal SI, ideal SP)3975 static proc extraction (ideal SI, ideal SP) 4080 3976 { 4081 3977 list indsets=indepSet(SP,0); … … 4182 4078 4183 4079 4184 proc minsat(ideal SI, poly p)4080 static proc minsat(ideal SI, poly p) 4185 4081 { 4186 4082 ideal fac=factorize(p,1); //the irreducible factors of p … … 4228 4124 4229 4125 4230 proc minsat_ppd(ideal SI, ideal fac)4126 static proc minsat_ppd(ideal SI, ideal fac) 4231 4127 { 4232 4128 fac=sort(fac)[1]; … … 4272 4168 ///////////////////////////////////////////////////////////////// 4273 4169 4274 proc minquot(list tsil)4170 static proc minquot(list tsil) 4275 4171 { 4276 4172 int i,j,k,action; … … 4339 4235 ////////////////////////////////////////////////// 4340 4236 4341 proc special_ideals_equal( ideal k1, ideal k2)4237 static proc special_ideals_equal( ideal k1, ideal k2) 4342 4238 { 4343 4239 int j; … … 4359 4255 /////////////////////////////////////////////////////////////////////////////// 4360 4256 4361 proc convList(list l)4257 static proc convList(list l) 4362 4258 { 4363 4259 int i; … … 4372 4268 /////////////////////////////////////////////////////////////////////////////// 4373 4269 4374 proc reconvList(list l)4270 static proc reconvList(list l) 4375 4271 { 4376 4272 int i; … … 4392 4288 proc primdecGTZ(ideal i) 4393 4289 "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 4290 RETURN: 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. 4293 NOTE: Algorithm of Gianni, Traeger, Zacharias. 4294 Designed for characteristic 0, works also in char k > 0, if it 4398 4295 terminates (may result in an infinite loop in small characteristic!) 4399 4296 EXAMPLE: example primdecGTZ; shows an example 4400 4297 " 4401 4298 { 4299 if(ord_test(basering)!=1) 4300 { 4301 ERROR( 4302 "// Not implemented for this ordering, please change to global ordering." 4303 ); 4304 } 4402 4305 return(convList(decomp(i))); 4403 4306 } 4404 4307 example 4405 4308 { "EXAMPLE:"; echo = 2; 4406 ring r = 32003,(x,y,z),lp;4309 ring r = 0,(x,y,z),lp; 4407 4310 poly p = z2+1; 4408 poly q = z 4+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; 4410 4313 list pr = primdecGTZ(i); 4411 4314 pr; … … 4415 4318 proc primdecSY(ideal i, list #)) 4416 4319 "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 4324 RETURN: 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. 4327 NOTE: Algorithm of Shimoyama-Yokoyama. 4328 Due to a bug in the factorization, the result may be not completely 4329 decomposed in small characteristic. 4426 4330 EXAMPLE: example primdecSY; shows an example 4427 4331 " 4428 4332 { 4333 if(ord_test(basering)!=1) 4334 { 4335 ERROR( 4336 "// Not implemented for this ordering, please change to global ordering." 4337 ); 4338 } 4429 4339 if (size(#)==1) 4430 4340 { return(prim_dec(i,#[1])); } … … 4434 4344 example 4435 4345 { "EXAMPLE:"; echo = 2; 4436 ring r = 32003,(x,y,z),lp;4346 ring r = 0,(x,y,z),lp; 4437 4347 poly p = z2+1; 4438 poly q = z 4+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; 4440 4350 list pr = primdecSY(i); 4441 4351 pr; … … 4444 4354 proc minAssGTZ(ideal i) 4445 4355 "USAGE: minAssGTZ(i); i ideal 4446 RETURN: list = the minimal associated prime ideals of i4447 NOTE: designed for characteristic 0, works also in char k > 0 if it4448 terminates, may result in an infinite loop in small characteristic 4356 RETURN: a list, the minimal associated prime ideals of i. 4357 NOTE: Designed for characteristic 0, works also in char k > 0 if it 4358 terminates, may result in an infinite loop in small characteristic. 4449 4359 EXAMPLE: example minAssGTZ; shows an example 4450 4360 " 4451 4361 { 4362 if(ord_test(basering)!=1) 4363 { 4364 ERROR( 4365 "// Not implemented for this ordering, please change to global ordering." 4366 ); 4367 } 4452 4368 return(minAssPrimes(i,1)); 4453 4369 } 4454 4370 example 4455 4371 { "EXAMPLE:"; echo = 2; 4456 ring r = 32003,(x,y,z),dp;4372 ring r = 0,(x,y,z),dp; 4457 4373 poly p = z2+1; 4458 poly q = z 4+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); 4461 4377 pr; 4462 4378 } … … 4464 4380 /////////////////////////////////////////////////////////////////////////////// 4465 4381 proc 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. 4468 4384 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 i4471 NOTE: implemented for characteristic 0, works also in char k >> 0,4472 the result may be not compltely decomposed in small characteristic4385 which in some cases may considerably speed up the algorithm. 4386 RETURN: a list, the minimal associated prime ideals of i. 4387 NOTE: Due to a bug in the factorization, the result may be not completely 4388 decomposed in small characteristic. 4473 4389 EXAMPLE: example minAssChar; shows an example 4474 4390 " 4475 4391 { 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)); } 4480 4402 } 4481 4403 example 4482 4404 { "EXAMPLE:"; echo = 2; 4483 ring r = 32003,(x,y,z),dp;4405 ring r = 0,(x,y,z),dp; 4484 4406 poly p = z2+1; 4485 poly q = z 4+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); 4488 4410 pr; 4489 4411 } … … 4491 4413 proc equiRadical(ideal i) 4492 4414 "USAGE: equiRadical(i); i ideal 4493 RETURN: ideal, intersection of associated primes of i of maximal dimension4494 NOTE: designed for characteristic 0, works also in char k > 0 if it4495 terminates, may result in an infinite loop in small characteristic4415 RETURN: ideal, intersection of associated primes of i of maximal dimension. 4416 NOTE: A combination of the algorithms of Krick/Logar and Kemper is used. 4417 Works also in positive characteristic (Kempers algorithm). 4496 4418 EXAMPLE: example equiRadical; shows an example 4497 4419 " 4498 4420 { 4421 if(ord_test(basering)!=1) 4422 { 4423 ERROR( 4424 "// Not implemented for this ordering, please change to global ordering." 4425 ); 4426 } 4499 4427 return(radical(i,1)); 4500 4428 } 4501 4429 example 4502 4430 { "EXAMPLE:"; echo = 2; 4503 ring r = 32003,(x,y,z),dp;4431 ring r = 0,(x,y,z),dp; 4504 4432 poly p = z2+1; 4505 poly q = z 4+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; 4507 4435 ideal pr= equiRadical(i); 4508 4436 pr; … … 4510 4438 /////////////////////////////////////////////////////////////////////////////// 4511 4439 proc 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. 4441 RETURN: ideal, the radical of i. 4442 NOTE: A combination of the algorithms of Krick/Logar and Kemper is used. 4443 Works also in positive characteristic (Kempers algorithm). 4518 4444 EXAMPLE: example radical; shows an example 4519 4445 " 4520 4446 { 4447 if(ord_test(basering)!=1) 4448 { 4449 ERROR( 4450 "// Not implemented for this ordering, please change to global ordering." 4451 ); 4452 } 4521 4453 def @P=basering; 4522 4454 int j,il; … … 4526 4458 } 4527 4459 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]; 4528 4465 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); 4536 4469 if(di==0) 4537 4470 { 4538 i=zeroRad( i);4471 i=zeroRad(k,i); 4539 4472 return(phi(i)); 4540 4473 } 4541 list pr=facstd(i); 4474 option(redSB); 4475 list pr=facstd(k); 4542 4476 option(noredSB); 4477 option(set,vv); 4543 4478 int s=size(pr); 4544 4479 for(j=1;j<=s;j++) … … 4554 4489 example 4555 4490 { "EXAMPLE:"; echo = 2; 4556 ring r = 32003,(x,y,z),dp;4491 ring r = 0,(x,y,z),dp; 4557 4492 poly p = z2+1; 4558 poly q = z 4+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; 4560 4495 ideal pr= radical(i); 4561 4496 pr; … … 4564 4499 proc prepareAss(ideal i) 4565 4500 "USAGE: prepareAss(i); i ideal 4566 RETURN: list = the radicals of the maximal dimensional components of i4567 NOTE: uses algorithm of Eisenbud, Huneke and Vasconcelos4501 RETURN: a list, the radicals of the maximal dimensional components of i. 4502 NOTE: Uses algorithm of Eisenbud, Huneke and Vasconcelos. 4568 4503 EXAMPLE: example prepareAss; shows an example 4569 4504 " 4570 4505 { 4506 if(ord_test(basering)!=1) 4507 { 4508 ERROR( 4509 "// Not implemented for this ordering, please change to global ordering." 4510 ); 4511 } 4571 4512 ideal j=std(i); 4572 4513 int cod=nvars(basering)-dim(j); … … 4596 4537 example 4597 4538 { "EXAMPLE:"; echo = 2; 4598 ring r = 32003,(x,y,z),dp;4539 ring r = 0,(x,y,z),dp; 4599 4540 poly p = z2+1; 4600 poly q = z 4+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); 4603 4544 pr; 4604 4545 } … … 4606 4547 proc equidimMaxEHV(ideal i) 4607 4548 "USAGE: equidimMaxEHV(i); i ideal 4608 RETURN: ideal = equidimensional componente of i4609 NOTE: uses algorithm of Eisenbud, Huneke and Vasconcelos4549 RETURN: ideal, the equidimensional component (of maximal dimension) of i. 4550 NOTE: Uses algorithm of Eisenbud, Huneke and Vasconcelos. 4610 4551 EXAMPLE: example equidimMaxEHV; shows an example 4611 4552 " 4612 4553 { 4554 if(ord_test(basering)!=1) 4555 { 4556 ERROR( 4557 "// Not implemented for this ordering, please change to global ordering." 4558 ); 4559 } 4613 4560 ideal j=groebner(i); 4614 4561 int cod=nvars(basering)-dim(j); … … 4629 4576 example 4630 4577 { "EXAMPLE:"; echo = 2; 4631 ring r = 32003,(x,y,z),dp;4578 ring r = 0,(x,y,z),dp; 4632 4579 ideal i=intersect(ideal(z),ideal(x,y),ideal(x2,z2),ideal(x5,y5,z5)); 4633 4580 equidimMaxEHV(i); 4634 4581 } 4635 4582 4636 proc testPrimary(list pr, ideal k)4583 static proc testPrimary(list pr, ideal k) 4637 4584 "USAGE: testPrimary(pr,k); pr a list, result of primdecGTZ(k) or primdecSY(k) 4638 4585 RETURN: int, 1 if intersection of the primary ideals in pr is k, 0 if not … … 4662 4609 proc zerodec(ideal I) 4663 4610 "USAGE: zerodec(I); I ideal 4664 RETURN: alist of primary ideals, the zero-dimensional decomposition of I4611 RETURN: A list of primary ideals, the zero-dimensional decomposition of I 4665 4612 ASSUME: I is zero-dimensional, the characterisitic of the ground field is 0 4666 NOTE: the algorithm (of C. Monico), works well only for small total4667 number of solutions (i.e. vdim(std(I)) should be < 100)4668 and without parameters. In practice, it works also in big4669 characteristic p>0 but may failfor small p.4670 If printlevel > 0 (default = 0) additional information is displayed4613 NOTE: 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 4671 4618 EXAMPLE: example zerodec; shows an example 4672 4619 " 4673 4620 { 4621 if(ord_test(basering)!=1) 4622 { 4623 ERROR( 4624 "// Not implemented for this ordering, please change to global ordering." 4625 ); 4626 } 4674 4627 def R=basering; 4675 4628 poly q; … … 4762 4715 example 4763 4716 { "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); 4767 4720 pr; 4768 4721 } … … 4786 4739 time=timer; list pr1=zerodec(gls); timer-time;size(pr1); 4787 4740 time=timer; list pr =primdecGTZ(gls); timer-time;size(pr); 4741 time=timer; ideal ra =radical(gls); timer-time;size(pr); 4788 4742 4789 4743 //2.cyclic5 vdim=70, 20 Komponenten 4790 4744 //zerodec-time:36(28) (matrix:1(0) charpoly:18(19) factor:17(9) 4791 4745 //primdecGTZ-time: 28(5) 4746 //radical : 0 4792 4747 ring rs= 0,(a,b,c,d,e),dp; 4793 4748 poly f0= a + b + c + d + e + 1; … … 4907 4862 time=timer; list pr =primdecGTZ(gls); timer-time; 4908 4863 time=timer; list pr =primdecSY(gls); timer-time; 4864 time=timer; ideal ra =radical(gls); timer-time;size(pr); 4909 4865 */ 4910 4866
Note: See TracChangeset
for help on using the changeset viewer.