Changeset ebecf83 in git
- Timestamp:
- May 15, 1998, 6:25:48 PM (26 years ago)
- Branches:
- (u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '38dfc5131670d387a89455159ed1e071997eec94')
- Children:
- b7792751599796c0e032684a87f5a80b650a5eb1
- Parents:
- ac6554110ea01f1f5b8bb9a4d561299931b8ba7d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/primdec.lib
rac6554 rebecf83 1 // $Id: primdec.lib,v 1.1 8 1998-05-14 18:45:13 SingularExp $2 /////////////////////////////////////////////////////// 3 // primdec.lib 4 // algorithms for primary decomposition based on 5 // the ideas of Gianni,Trager,Zacharias 6 // written by Gerhard Pfister 7 // 8 // algorithms for primary decomposition based on 9 // the ideas of Shimoyama/Yokoyama 10 // written by Wolfram Decker and Hans Schoenemann 11 ////////////////////////////////////////////////////// 12 13 version="$Id: primdec.lib,v 1.1 8 1998-05-14 18:45:13 SingularExp $";1 // $Id: primdec.lib,v 1.19 1998-05-15 16:25:48 obachman Exp $ 2 //////////////////////////////////////////////////////////////////////////////// 3 // primdec.lib // 4 // algorithms for primary decomposition based on // 5 // the ideas of Gianni,Trager,Zacharias // 6 // written by Gerhard Pfister // 7 // // 8 // algorithms for primary decomposition based on // 9 // the ideas of Shimoyama/Yokoyama // 10 // written by Wolfram Decker and Hans Schoenemann // 11 //////////////////////////////////////////////////////////////////////////////// 12 13 version="$Id: primdec.lib,v 1.19 1998-05-15 16:25:48 obachman Exp $"; 14 14 info=" 15 LIBRARY: primdec.lib: PROCEDURE FOR PRIMARY DECOMPOSITION (I) 16 17 minAssPrimes (ideal I) 18 //computes the minimal associated primes of the ideal I 19 20 primdecGTZ (ideal I) 21 // Computes a complete primary decomposition via Gianni,Trager,Zacharias 22 23 radical(ideal I) 24 //computes the radical of the ideal I 25 26 equiRadical(ideal I) 27 //computes the radical of the equidimensional part of the ideal I 28 29 prepareAss(ideal I) 30 //computes the radicals of the equidimensional parts of I 31 32 min_ass_prim_charsets (ideal I, int choose) 33 // minimal associated primes via the characteristic set 34 // package written by Michael Messollen. 35 // The integer choose must be either 0 or 1. 36 // If choose=0, the given ordering of the variables is used. 37 // If choose=1, the system tries to find an \"optimal ordering\", 38 // which in some cases may considerably speed up the algorithm 39 40 // You may also may want to try one of the algorithms for 41 // minimal associated primes in the the library 42 // primdec.lib, written by Gerhard Pfister. 43 // These algorithms are variants of the algorithm 44 // of Gianni-Trager-Zacharias 45 46 primdecSY (ideal I, int choose) 47 48 // Computes a complete primary decomposition via 49 // a variant of the pseudoprimary approach of 50 // Shimoyama-Yokoyama. 51 // The integer choose must be either 0, 1, 2 or 3. 52 // If choose=0, min_ass_prim_charsets with the given 53 // ordering of the variables is used. 54 // If choose=1, min_ass_prim_charsets with the \"optimized\" 55 // ordering of the variables is used. 56 // If choose=2, minAssPrimes from primdec.lib is used 57 // If choose=3, minAssPrimes+factorizing Buchberger from primdec.lib is used 15 LIBRARY: primdec.lib: PROCEDURE FOR PRIMARY DECOMPOSITION 16 17 minAssGTZ(I); computes the minimal associated primes via Gianni,Trager,Zacharias 18 19 minAssChar(I); computes the minimal associated primes using characteristic sets 20 21 primdecGTZ(I); computes a complete primary decomposition via Gianni,Trager,Zacharias 22 23 primdecSY(I); computes a complete primary decomposition via Shimoyama-Yokoyama 24 25 testPrimary(L,k); tests whether the result of the primary decomposition is correct 26 27 radical(I); computes the radical of the ideal I 28 29 equiRadical(I); computes the radical of the equidimensional part of the ideal I 30 31 prepareAss(I); computes the radicals of the equidimensional parts of I 32 58 33 "; 59 34 … … 62 37 LIB "poly.lib"; 63 38 LIB "random.lib"; 39 /////////////////////////////////////////////////////////////////////////////// 40 41 /////////////////////////////////////////////////////////////////////////////// 42 // 43 // Gianni/Trager/Zacharias 44 // 45 // 64 46 /////////////////////////////////////////////////////////////////////////////// 65 47 … … 213 195 ideal fac=tsil[2]; 214 196 poly f=tsil[3]; 215 197 216 198 ideal star=quotient(laedi,f); 217 199 action=1; … … 228 210 g=1; 229 211 verg=laedi; 230 212 231 213 for(j=1;j<=size(fac);j++) 232 214 { … … 237 219 } 238 220 verg=quotient(laedi,g); 239 221 240 222 if(specialIdealsEqual(verg,star)==1) 241 223 { … … 251 233 } 252 234 } 253 l=star,fac,f; 235 l=star,fac,f; 254 236 return(l); 255 237 } … … 259 241 { 260 242 poly keep=p; 261 243 262 244 int i; 263 245 poly q=act[1][1]^act[2][1]; … … 272 254 "ERROR IN FACTOR"; 273 255 basering; 274 256 275 257 act; 276 258 keep; 277 259 pause; 278 260 279 261 p; 280 262 q; … … 438 420 439 421 440 ////////////////////////////////////////////////////////////////////////////////441 442 proc testPrimary(list pr, ideal k)443 "USAGE: testPrimary(pr,k) pr list, k ideal;444 RETURN: int = 1, if the intersection of the ideals in pr is k, 0 if not445 NOTE:446 EXAMPLE: example testPrimary ; shows an example447 "448 {449 int i;450 ideal j=pr[1];451 for (i=2;i<=size(pr)/2;i++)452 {453 j=intersect(j,pr[2*i-1]);454 }455 return(idealsEqual(j,k));456 }457 example458 { "EXAMPLE:"; echo = 2;459 ring s = 0,(x,y,z),lp;460 ideal i=x3-x2-x+1,xy-y;461 ideal i1=x-1;462 ideal i2=x-1;463 ideal i3=y,x2-2x+1;464 ideal i4=y,x-1;465 ideal i5=y,x+1;466 ideal i6=y,x+1;467 list pr=i1,i2,i3,i4,i5,i6;468 testPrimary(pr,i);469 pr[5]=y+1,x+1;470 testPrimary(pr,i);471 }472 473 ////////////////////////////////////////////////////////////////////////////////474 proc printPrimary( list l, list #)475 "USAGE: printPrimary(l) l list;476 RETURN: nothing477 NOTE:478 EXAMPLE: example printPrimary; shows an example479 "480 {481 if(size(#)>0)482 {483 " ";484 " The primary decomposition of the ideal ";485 #[1];486 " ";487 " is: ";488 " ";489 }490 int k;491 for (k=1;k<=size(l)/2;k=k+1)492 {493 " ";494 "primary ideal: ";495 l[2*k-1];496 " ";497 "associated prime ideal ";498 l[2*k];499 " ";500 }501 }502 example503 { "EXAMPLE:"; echo = 2;504 }505 506 ////////////////////////////////////////////////////////////////////////////////507 422 508 423 … … 565 480 m=m-1; 566 481 } 567 //check whether i[m] =(c*var(n)+h)^e modulo prm for some 482 //check whether i[m] =(c*var(n)+h)^e modulo prm for some 568 483 //h in K[var(n+1),...,var(nvars(basering))], c in K 569 484 //if not (0) is returned, else var(n)+h is added to prm 570 485 571 486 e=deg(lead(i[m])); 572 // t=hilfe1(i,prm,m,n);573 487 t=leadcoef(i[m])*e*var(n)+(i[m]-lead(i[m]))/var(n)^(e-1); 574 488 … … 588 502 } 589 503 590 proc hilfe(ideal i,ideal prm,int m)591 {592 poly t;593 int e;594 595 if(size(i[m])==1)596 {597 t=var(n);598 }599 else600 {601 e=deg(lead(i[m]));602 603 if(deg(poly(e))>=0)604 {605 t=leadcoef(i[m])*e*var(n)+(i[m]-lead(i[m]))/var(n)^(e-1);606 i[m]=poly(e)^e*leadcoef(i[m])^(e-1)*i[m];607 }608 else609 {610 i[m]=i[m]/leadcoef(i[m]);611 t=reduce(coef(i[m],var(n))[2,e+1],prm);612 t=var(n)+factorize(t,1)[1];613 }614 }615 return(t);616 }617 proc hilfe1(ideal i,ideal prm,int m,int n)618 {619 poly t;620 int e;621 if(size(i[m])==1)622 {623 t=var(n);624 }625 else626 {627 e=deg(lead(i[m]));628 i[m]=i[m]/leadcoef(i[m]);629 t=reduce(coeffs(i[m],var(n))[1,1],prm);630 if(size(t)==0){return(var(n));}631 t=var(n)+factorize(t,1)[1];632 }633 return(t);634 }635 504 636 505 /////////////////////////////////////////////////////////////////////////////// … … 788 657 { 789 658 attrib(l[2*i-1],"isSB",1); 790 659 791 660 if((size(ser)>0)&&(size(reduce(ser,l[2*i-1],1))==0)&&(deg(l[2*i-1][1])>0)) 792 661 { 793 662 "Achtung in split"; 794 663 795 664 l[2*i-1]=ideal(1); 796 665 l[2*i]=ideal(1); … … 857 726 return(primary); 858 727 } 859 860 j=interred(j); 728 729 j=interred(j); 861 730 attrib(j,"isSB",1); 862 731 if(vdim(j)==deg(j[1])) 863 { 732 { 864 733 act=factor(j[1]); 865 734 for(@k=1;@k<=size(act[1]);@k++) … … 879 748 primary[2*@k]=interred(@qh); 880 749 attrib( primary[2*@k-1],"isSB",1); 881 750 882 751 if((size(ser)>0)&&(size(reduce(ser,primary[2*@k-1],1))==0)) 883 752 { 884 753 primary[2*@k-1]=ideal(1); 885 primary[2*@k]=ideal(1); 754 primary[2*@k]=ideal(1); 886 755 } 887 756 } … … 957 826 } 958 827 else 959 { 828 { 960 829 primary[1]=j; 961 830 if((size(#)>0)&&(act[2][1]>1)) … … 976 845 if(size(#)==0) 977 846 { 978 847 979 848 primary=splitPrimary(primary,ser,@wr,act); 980 849 981 850 } 982 851 … … 1001 870 } 1002 871 } 1003 872 1004 873 @k=0; 1005 874 ideal keep; … … 1027 896 jmap2[zz]=primary[2*@k-1][@n]; 1028 897 @qht[@n]=var(zz); 1029 898 1030 899 } 1031 900 } … … 1039 908 phi1=@P,jmap1; 1040 909 phi=@P,jmap; 1041 910 1042 911 for(@n=1;@n<=nva;@n++) 1043 912 { … … 1048 917 1049 918 @qh=phi(@qht); 1050 919 1051 920 if(npars(@P)>0) 1052 921 { … … 1076 945 kill @Phelp1; 1077 946 @qh=clearSB(@qh); 1078 attrib(@qh,"isSB",1); 947 attrib(@qh,"isSB",1); 1079 948 ser1=phi1(ser); 1080 949 @lh=zero_decomp (@qh,phi(ser1),@wr); 1081 950 // @lh=zero_decomp (@qh,psi(ser),@wr); 1082 1083 951 952 1084 953 kill lres0; 1085 954 list lres0; … … 1676 1545 " 1677 1546 { 1678 #[1]=1;1679 1547 def @P=basering; 1680 1548 list qr=simplifyIdeal(i); 1681 1549 map phi=@P,qr[2]; 1682 1550 i=qr[1]; 1683 1551 1684 1552 execute "ring gnir = ("+charstr(basering)+"),("+varstr(basering)+"),(" 1685 1553 +ordstr(basering)+");"; … … 1793 1661 poly q = z4+2; 1794 1662 ideal i = p^2*q^3,(y-z3)^3,(x-yz+z4)^4; 1795 LIB "prim aryDecomposition.lib";1663 LIB "primdec.lib"; 1796 1664 list pr= minAssPrimes(i); 1797 1665 pr; 1798 1666 pr= minAssPrimes(i,1); 1799 1667 } 1800 1801 ///////////////////////////////////////////////////////////////////////////////1802 1668 1803 1669 proc union(list li) … … 1885 1751 } 1886 1752 return(k); 1887 }1888 ///////////////////////////////////////////////////////////////////////////////1889 proc equiRadical(ideal i)1890 {1891 return(radical(i,1));1892 1753 } 1893 1754 … … 1929 1790 } 1930 1791 } 1931 1792 1932 1793 homo=homog(i); 1933 1794 1934 1795 if(homo==1) 1935 1796 { … … 1978 1839 option(redSB); 1979 1840 1980 ideal ser=fetch(@P,ser); 1841 ideal ser=fetch(@P,ser); 1981 1842 1982 1843 if(homo==1) … … 2032 1893 } 2033 1894 } 2034 1895 2035 1896 //---------------------------------------------------------------- 2036 1897 //j is the ring … … 2070 1931 return(primary); 2071 1932 } 2072 1933 2073 1934 //------------------------------------------------------------------ 2074 1935 //the zero-dimensional case … … 2124 1985 indep=maxIndependSet(@j); 2125 1986 } 2126 1987 2127 1988 ideal jkeep=@j; 2128 1989 … … 2148 2009 ideal jwork=std(imap(gnir,@j),@hilb); 2149 2010 } 2150 2011 2151 2012 } 2152 2013 else … … 2159 2020 di=dim(jwork); 2160 2021 keepdi=di; 2161 2022 2162 2023 setring gnir; 2163 2024 for(@m=1;@m<=size(indep);@m++) … … 2175 2036 attrib(@j,"isSB",1); 2176 2037 ideal ser=fetch(gnir,ser); 2177 2038 2178 2039 } 2179 2040 else … … 2192 2053 } 2193 2054 ideal ser=phi(ser); 2194 2195 } 2196 option(noredSB); 2055 2056 } 2057 option(noredSB); 2197 2058 if((deg(@j[1])==0)||(dim(@j)<jdim)) 2198 2059 { … … 2250 2111 } 2251 2112 //the primary decomposition of j*K(var(nnp+1),..,var(nva))[..the rest..] 2252 option(redSB); 2113 option(redSB); 2253 2114 list uprimary= zero_decomp(@j,ser,@wr); 2254 2115 option(noredSB); … … 2312 2173 //mentioned above is really computed 2313 2174 for(@n=@n3/2+1;@n<=@n2/2;@n++) 2314 { 2175 { 2315 2176 if(specialIdealsEqual(quprimary[2*@n-1],quprimary[2*@n])) 2316 2177 { … … 2327 2188 } 2328 2189 } 2329 2190 2330 2191 if(size(@h)>0) 2331 2192 { … … 2337 2198 if(@wr!=1) 2338 2199 { 2339 @q=minSat(jwork,@h)[2]; 2200 @q=minSat(jwork,@h)[2]; 2340 2201 } 2341 2202 else … … 2357 2218 } 2358 2219 jwork=std(jwork,@q); 2359 keepdi=dim(jwork); 2220 keepdi=dim(jwork); 2360 2221 if(keepdi<di) 2361 2222 { … … 2382 2243 { 2383 2244 keepdi=di-1; 2384 } 2245 } 2385 2246 //--------------------------------------------------------------- 2386 2247 //notice that j=sat(j,gh) intersected with (j,gh^n) … … 2413 2274 2414 2275 if(size(ser)>0) 2415 { 2416 ser=intersect(htest,ser); 2276 { 2277 ser=intersect(htest,ser); 2417 2278 } 2418 2279 else 2419 2280 { 2420 2281 ser=htest; 2421 } 2282 } 2422 2283 setring gnir; 2423 2284 ser=imap(@Phelp,ser); 2424 2285 } 2425 2286 if(size(reduce(ser,peek,1))!=0) 2426 { 2287 { 2427 2288 for(@m=1;@m<=size(restindep);@m++) 2428 2289 { 2429 2290 // if(restindep[@m][3]>=keepdi) 2430 // { 2291 // { 2431 2292 isat=0; 2432 2293 @n2=0; 2433 2294 option(redSB); 2434 2295 2435 2296 if(restindep[@m][1]==varstr(basering)) 2436 2297 //this is the good case, nothing to do, just to have the same notations … … 2459 2320 } 2460 2321 option(noredSB); 2461 2322 2462 2323 for (lauf=1;lauf<=size(@j);lauf++) 2463 2324 { … … 2508 2369 } 2509 2370 //the primary decomposition of j*K(var(nnp+1),..,var(nva))[..the rest..] 2510 2371 2511 2372 option(redSB); 2512 2373 list uprimary= zero_decomp(@j,ser,@wr); 2513 2374 option(noredSB); 2514 2515 2375 2376 2516 2377 //we need the intersection of the ideals in the list quprimary with the 2517 2378 //polynomialring, i.e. let q=(f1,...,fr) in the quotientring such an ideal … … 2548 2409 @n2=size(quprimary); 2549 2410 @n3=@n2; 2550 2411 2551 2412 for(@n1=1;@n1<=size(collectprimary)/2;@n1++) 2552 2413 { … … 2561 2422 } 2562 2423 } 2563 2564 2424 2425 2565 2426 //here the intersection with the polynomialring 2566 2427 //mentioned above is really computed … … 2601 2462 ser=imap(@Phelp,ser); 2602 2463 } 2603 2464 2604 2465 // } 2605 } 2466 } 2606 2467 if(size(reduce(ser,peek,1))!=0) 2607 2468 { … … 2623 2484 } 2624 2485 } 2625 2486 2626 2487 } 2627 2488 //------------------------------------------------------------ … … 2629 2490 //the final result: primary 2630 2491 //------------------------------------------------------------ 2631 2492 2632 2493 setring @P; 2633 2494 primary=imap(gnir,quprimary); … … 2649 2510 2650 2511 /////////////////////////////////////////////////////////////////////////////// 2651 proc primdecGTZ(ideal i)2652 {2653 return(decomp(i));2654 }2655 ///////////////////////////////////////////////////////////////////////////////2656 proc primdecSY(ideal i,int j)2657 {2658 return(prim_dec(i,j));2659 }2660 ///////////////////////////////////////////////////////////////////////////////2661 2662 proc radical(ideal i,list #)2663 {2664 def @P=basering;2665 int j,il;2666 if(size(#)>0)2667 {2668 il=#[1];2669 }2670 ideal re=1;2671 option(redSB);2672 list qr=simplifyIdeal(i);2673 map phi=@P,qr[2];2674 i=qr[1];2675 2676 list pr=facstd(i);2677 2678 if(size(pr)==1)2679 {2680 attrib(pr[1],"isSB",1);2681 if((dim(pr[1])==0)&&(homog(pr[1])==1))2682 {2683 ideal @res=maxideal(1);2684 return(phi(@res));2685 }2686 if(dim(pr[1])>1)2687 {2688 execute "ring gnir = ("+charstr(basering)+"),2689 ("+varstr(basering)+"),(C,lp);";2690 ideal i=fetch(@P,i);2691 list @pr=facstd(i);2692 setring @P;2693 pr=fetch(gnir,@pr);2694 }2695 }2696 option(noredSB);2697 int s=size(pr);2698 2699 if(s==1)2700 {2701 i=radicalEHV(i,ideal(1),il);2702 return(phi(i));2703 }2704 intvec pos;2705 pos[s]=0;2706 if(il==1)2707 {2708 int ndim,k;2709 attrib(pr[1],"isSB",1);2710 int odim=dim(pr[1]);2711 int count=1;2712 2713 for(j=2;j<=s;j++)2714 {2715 attrib(pr[j],"isSB",1);2716 ndim=dim(pr[j]);2717 if(ndim>odim)2718 {2719 for(k=count;k<=j-1;k++)2720 {2721 pos[k]=1;2722 }2723 count=j;2724 odim=ndim;2725 }2726 if(ndim<odim)2727 {2728 pos[j]=1;2729 }2730 }2731 }2732 for(j=1;j<=s;j++)2733 {2734 if(pos[j]==0)2735 {2736 re=intersect(re,radicalEHV(pr[s+1-j],re,il));2737 }2738 }2739 return(phi(re));2740 }2741 2512 2742 2513 proc intersect1(ideal i,ideal j) … … 2751 2522 return(phi(j)); 2752 2523 } 2753 2524 2754 2525 2755 2526 /////////////////////////////////////////////////////////////////////////////// 2756 2527 proc radicalKL (list m,ideal ser,list #) 2757 "USAGE: decomp(i); i ideal (for primary decomposition) (resp.2758 decomp(i,1); (for the minimal associated primes) )2759 RETURN: list = list of primary ideals and their associated primes2760 (at even positions in the list)2761 (resp. a list of the minimal associated primes)2762 NOTE: Algorithm of Gianni, Traeger, Zacharias2763 EXAMPLE: example decomp; shows an example2764 "2765 2528 { 2766 2529 ideal i=m[2]; … … 2773 2536 return(ideal(0)); 2774 2537 } 2775 2538 2776 2539 def @P = basering; 2777 2540 list indep,allindep,restindep,fett,@mu; … … 2833 2596 2834 2597 return(ideal(@p)); 2835 } 2598 } 2836 2599 //------------------------------------------------------------------ 2837 2600 //the case of a complete intersection … … 2849 2612 if (jdim==0) 2850 2613 { 2851 @j1=finduni(@j); 2614 @j1=finduni(@j); 2852 2615 for(@k=1;@k<=size(@j1);@k++) 2853 2616 { … … 2864 2627 return(@j); 2865 2628 } 2866 2629 2867 2630 //------------------------------------------------------------------ 2868 2631 //search for a maximal independent set indep,i.e. … … 2873 2636 2874 2637 indep=maxIndependSet(@j); 2875 2638 2876 2639 di=dim(@j); 2877 2640 … … 3002 2765 { 3003 2766 fac=ideal(0); 3004 for(lauf=1;lauf<=ncols(@h);lauf++) 2767 for(lauf=1;lauf<=ncols(@h);lauf++) 3005 2768 { 3006 2769 if(deg(@h[lauf])>0) … … 3016 2779 } 3017 2780 3018 2781 3019 2782 @mu=mstd(quotient(@j+ideal(@q),rad)); 3020 2783 @j=@mu[1]; 3021 2784 attrib(@j,"isSB",1); 3022 2785 3023 2786 } 3024 2787 if((deg(rad[1])>0)&&(deg(collectrad[1])>0)) … … 3035 2798 3036 2799 te=simplify(reduce(te*rad,@j),2); 3037 2800 3038 2801 if((dim(@j)<di)||(size(te)==0)) 3039 2802 { … … 3049 2812 { 3050 2813 return(rad); 3051 } 2814 } 3052 2815 // rad=intersect(rad,radicalKL(@mu,rad,@wr)); 3053 2816 rad=intersect(rad,radicalKL(@mu,ideal(1),@wr)); … … 3058 2821 } 3059 2822 3060 3061 example 3062 { "EXAMPLE:"; echo = 2; 3063 } 3064 2823 /////////////////////////////////////////////////////////////////////////////// 3065 2824 3066 2825 proc radicalEHV(ideal i,ideal re,list #) … … 3072 2831 il=#[1]; 3073 2832 } 3074 2833 3075 2834 option(redSB); 3076 2835 list m=mstd(i); … … 3089 2848 return(quotient(I,J)); 3090 2849 } 3091 2850 3092 2851 for(l=1;l<=cod;l++) 3093 2852 { … … 3107 2866 if(il==1) 3108 2867 { 3109 2868 3110 2869 return(radI1); 3111 2870 } … … 3117 2876 return(radI1); 3118 2877 } 3119 return(intersect(radI1,radicalEHV(I2,re,il))); 2878 return(intersect(radI1,radicalEHV(I2,re,il))); 3120 2879 } 3121 2880 } 3122 2881 return(radicalKL(m,re,il)); 3123 2882 } 2883 /////////////////////////////////////////////////////////////////////////////// 3124 2884 3125 2885 proc Ann(module M) … … 3129 2889 return(ann); 3130 2890 } 2891 /////////////////////////////////////////////////////////////////////////////// 3131 2892 3132 2893 //computes the equidimensional part of the ideal i of codimension e … … 3145 2906 } 3146 2907 return(ann); 3147 } 3148 3149 //computes all equidimensional parts of the ideal i 3150 proc prepareAss(ideal i) 3151 { 3152 ideal j=std(i); 3153 int cod=nvars(basering)-dim(j); 3154 int e; 3155 list er; 3156 ideal ann; 3157 if(homog(i)==1) 3158 { 3159 list re=sres(i,0); //the resolution 3160 re=minres(re); //minimized resolution 3161 } 3162 else 3163 { 3164 list re=mres(i,0); //fehler in sres 3165 } 3166 for(e=cod;e<=nvars(basering);e++) 3167 { 3168 ann=AnnExt_R(e,re); 3169 3170 if(nvars(basering)-dim(std(ann))==e) 3171 { 3172 er[size(er)+1]=equiRadical(ann); 3173 } 3174 } 3175 return(er); 3176 } 2908 } 2909 2910 /////////////////////////////////////////////////////////////////////////////// 3177 2911 3178 2912 //computes the annihilator of Ext^n(R/i,R) with given resolution re … … 3192 2926 ideal ann=Ann(transpose(re[n])); 3193 2927 } 3194 return(ann); 3195 } 2928 return(ann); 2929 } 2930 /////////////////////////////////////////////////////////////////////////////// 3196 2931 3197 2932 proc quotient1(module a,module b) … … 3204 2939 re=intersect1(re,quotient(a,module(b[i]))); 3205 2940 } 3206 return(re); 3207 } 3208 3209 2941 return(re); 2942 } 2943 2944 2945 /////////////////////////////////////////////////////////////////////////////// 3210 2946 3211 2947 proc analyze(list pr) 3212 { 2948 { 3213 2949 int ii,jj; 3214 2950 for(ii=1;ii<=size(pr)/2;ii++) … … 3230 2966 } 3231 2967 } 3232 } 3233 } 3234 2968 } 2969 } 2970 2971 /////////////////////////////////////////////////////////////////////////////// 2972 // 2973 // Shimoyama-Yokoyama 2974 // 2975 /////////////////////////////////////////////////////////////////////////////// 3235 2976 3236 2977 proc simplifyIdeal(ideal i) 3237 2978 { 3238 2979 def r=basering; 3239 2980 3240 2981 int j,k; 3241 2982 map phi; 3242 2983 poly p; 3243 2984 3244 2985 ideal iwork=i; 3245 2986 ideal imap1=maxideal(1); 3246 2987 ideal imap2=maxideal(1); 3247 2988 3248 2989 3249 2990 for(j=1;j<=nvars(basering);j++) … … 3260 3001 iwork[k]=var(j); 3261 3002 imap1=maxideal(1); 3262 imap2[j]=-p; 3003 imap2[j]=-p; 3263 3004 break; 3264 3005 } … … 3268 3009 } 3269 3010 3270 3011 3271 3012 /////////////////////////////////////////////////////// 3272 3013 // ini_mod … … 3866 3607 } 3867 3608 } 3868 3609 dimSP=dim(SP); 3869 3610 for(j=size(m);j>=1; j--) 3870 3611 { … … 4063 3804 { 4064 3805 f=polys[k]; 4065 3806 degf=deg(f); 4066 3807 } 4067 3808 } … … 4273 4014 return(0); 4274 4015 } 4275 4276 4277 4016 4017 4018 proc quotient2(module a,module b) 4278 4019 { 4279 4020 string s="ring @newr=("+charstr(basering)+"),(@t,"+varstr(basering)+"),dp;"; … … 4291 4032 setring @newP; 4292 4033 ideal re=imap(@newr,re); 4293 return(re); 4294 } 4295 //Im homogenen Fall system("LaScala",i) verwenden 4034 return(re); 4035 } 4036 /////////////////////////////////////////////////////////////////////////////// 4037 4038 proc convList(list l) 4039 { 4040 int i; 4041 list re,he; 4042 for(i=1;i<=size(l)/2;i++) 4043 { 4044 he=l[2*i-1],l[2*i]; 4045 re[i]=he; 4046 } 4047 return(re); 4048 } 4049 /////////////////////////////////////////////////////////////////////////////// 4050 4051 proc reconvList(list l) 4052 { 4053 int i; 4054 list re; 4055 for(i=1;i<=size(l);i++) 4056 { 4057 re[2*i-1]=l[i][1]; 4058 re[2*i]=l[i][2]; 4059 } 4060 return(re); 4061 } 4062 4063 /////////////////////////////////////////////////////////////////////////////// 4064 // 4065 // The main procedures 4066 // 4067 /////////////////////////////////////////////////////////////////////////////// 4068 4069 proc primdecGTZ(ideal i) 4070 "USAGE: primdecGTZ(i); i ideal 4071 RETURN: list = list of primary ideals 4072 and their associated primes 4073 NOTE: Algorithm of Gianni, Traeger, Zacharias 4074 EXAMPLE: example primdecGTZ; shows an example 4075 " 4076 { 4077 return(convList(decomp(i))); 4078 } 4079 example 4080 { "EXAMPLE:"; echo = 2; 4081 ring r = 32003,(x,y,z),lp; 4082 poly p = z2+1; 4083 poly q = z4+2; 4084 ideal i = p^2*q^3,(y-z3)^3,(x-yz+z4)^4; 4085 list pr= primdecGTZ(i); 4086 pr; 4087 } 4088 /////////////////////////////////////////////////////////////////////////////// 4089 4090 proc primdecSY(ideal i) 4091 "USAGE: primdecSY(i); i ideal 4092 RETURN: list = list of primary ideals 4093 and their associated primes 4094 NOTE: Algorithm of Shimoyama-Yokoyama 4095 EXAMPLE: example primdecSY; shows an example 4096 " 4097 { 4098 return(prim_dec(i,1)); 4099 } 4100 example 4101 { "EXAMPLE:"; echo = 2; 4102 ring r = 32003,(x,y,z),lp; 4103 poly p = z2+1; 4104 poly q = z4+2; 4105 ideal i = p^2*q^3,(y-z3)^3,(x-yz+z4)^4; 4106 list pr= primdecSY(i); 4107 pr; 4108 } 4109 /////////////////////////////////////////////////////////////////////////////// 4110 proc minAssGTZ(ideal i) 4111 "USAGE: minAssGTZ(i); i ideal 4112 RETURN: list = the minimal associated prime ideals of i 4113 NOTE: 4114 EXAMPLE: example minAssGTZ; shows an example 4115 " 4116 { 4117 return(minAssPrimes(i,1)); 4118 } 4119 example 4120 { "EXAMPLE:"; echo = 2; 4121 ring r = 32003,(x,y,z),dp; 4122 poly p = z2+1; 4123 poly q = z4+2; 4124 ideal i = p^2*q^3,(y-z3)^3,(x-yz+z4)^4; 4125 list pr= minAssGTZ(i); 4126 pr; 4127 } 4128 4129 /////////////////////////////////////////////////////////////////////////////// 4130 proc minAssChar(ideal i) 4131 "USAGE: minAssChar(i); i ideal 4132 RETURN: list = the minimal associated prime ideals of i 4133 NOTE: 4134 EXAMPLE: example minAssChar; shows an example 4135 " 4136 4137 { 4138 return(min_ass_prim_charsets(i,1)); 4139 } 4140 example 4141 { "EXAMPLE:"; echo = 2; 4142 ring r = 32003,(x,y,z),dp; 4143 poly p = z2+1; 4144 poly q = z4+2; 4145 ideal i = p^2*q^3,(y-z3)^3,(x-yz+z4)^4; 4146 list pr= minAssChar(i); 4147 pr; 4148 } 4149 4150 /////////////////////////////////////////////////////////////////////////////// 4151 proc equiRadical(ideal i) 4152 "USAGE: equiRadical(i); i ideal 4153 RETURN: ideal = the intersection of associated primes 4154 of i of dimension of i 4155 NOTE: 4156 EXAMPLE: example equiRadical; shows an example 4157 " 4158 { 4159 return(radical(i,1)); 4160 } 4161 example 4162 { "EXAMPLE:"; echo = 2; 4163 ring r = 32003,(x,y,z),dp; 4164 poly p = z2+1; 4165 poly q = z4+2; 4166 ideal i = p^2*q^3,(y-z3)^3,(x-yz+z4)^4; 4167 ideal pr= equiRadical(i); 4168 pr; 4169 } 4170 /////////////////////////////////////////////////////////////////////////////// 4171 proc radical(ideal i,list #) 4172 "USAGE: radical(i); i ideal 4173 RETURN: ideal = the radical of i 4174 NOTE: a combination of the algorithms of Krick/Logar 4175 and Eisenbud/Huneke/Vasconcelos 4176 EXAMPLE: example radical; shows an example 4177 " 4178 { 4179 def @P=basering; 4180 int j,il; 4181 if(size(#)>0) 4182 { 4183 il=#[1]; 4184 } 4185 ideal re=1; 4186 option(redSB); 4187 list qr=simplifyIdeal(i); 4188 map phi=@P,qr[2]; 4189 i=qr[1]; 4190 4191 list pr=facstd(i); 4192 4193 if(size(pr)==1) 4194 { 4195 attrib(pr[1],"isSB",1); 4196 if((dim(pr[1])==0)&&(homog(pr[1])==1)) 4197 { 4198 ideal @res=maxideal(1); 4199 return(phi(@res)); 4200 } 4201 if(dim(pr[1])>1) 4202 { 4203 execute "ring gnir = ("+charstr(basering)+"), 4204 ("+varstr(basering)+"),(C,lp);"; 4205 ideal i=fetch(@P,i); 4206 list @pr=facstd(i); 4207 setring @P; 4208 pr=fetch(gnir,@pr); 4209 } 4210 } 4211 option(noredSB); 4212 int s=size(pr); 4213 4214 if(s==1) 4215 { 4216 i=radicalEHV(i,ideal(1),il); 4217 return(phi(i)); 4218 } 4219 intvec pos; 4220 pos[s]=0; 4221 if(il==1) 4222 { 4223 int ndim,k; 4224 attrib(pr[1],"isSB",1); 4225 int odim=dim(pr[1]); 4226 int count=1; 4227 4228 for(j=2;j<=s;j++) 4229 { 4230 attrib(pr[j],"isSB",1); 4231 ndim=dim(pr[j]); 4232 if(ndim>odim) 4233 { 4234 for(k=count;k<=j-1;k++) 4235 { 4236 pos[k]=1; 4237 } 4238 count=j; 4239 odim=ndim; 4240 } 4241 if(ndim<odim) 4242 { 4243 pos[j]=1; 4244 } 4245 } 4246 } 4247 for(j=1;j<=s;j++) 4248 { 4249 if(pos[j]==0) 4250 { 4251 re=intersect(re,radicalEHV(pr[s+1-j],re,il)); 4252 } 4253 } 4254 return(phi(re)); 4255 } 4256 example 4257 { "EXAMPLE:"; echo = 2; 4258 ring r = 32003,(x,y,z),dp; 4259 poly p = z2+1; 4260 poly q = z4+2; 4261 ideal i = p^2*q^3,(y-z3)^3,(x-yz+z4)^4; 4262 ideal pr= radical(i); 4263 pr; 4264 } 4265 /////////////////////////////////////////////////////////////////////////////// 4266 proc prepareAss(ideal i) 4267 "USAGE: prepareAss(i); i ideal 4268 RETURN: list = the radicals of the equidimensional parts of i 4269 NOTE: algorithm of Eisenbud,Huneke and Vasconcelos 4270 EXAMPLE: example prepareAss; shows an example 4271 " 4272 { 4273 ideal j=std(i); 4274 int cod=nvars(basering)-dim(j); 4275 int e; 4276 list er; 4277 ideal ann; 4278 if(homog(i)==1) 4279 { 4280 list re=sres(i,0); //the resolution 4281 re=minres(re); //minimized resolution 4282 } 4283 else 4284 { 4285 list re=mres(i,0); 4286 } 4287 for(e=cod;e<=nvars(basering);e++) 4288 { 4289 ann=AnnExt_R(e,re); 4290 4291 if(nvars(basering)-dim(std(ann))==e) 4292 { 4293 er[size(er)+1]=equiRadical(ann); 4294 } 4295 } 4296 return(er); 4297 } 4298 example 4299 { "EXAMPLE:"; echo = 2; 4300 ring r = 32003,(x,y,z),dp; 4301 poly p = z2+1; 4302 poly q = z4+2; 4303 ideal i = p^2*q^3,(y-z3)^3,(x-yz+z4)^4; 4304 list pr= prepareAss(i); 4305 pr; 4306 } 4307 4308 proc testPrimary(list pr, ideal k) 4309 "USAGE: testPrimary(pr,k) pr=primdecGTZ(k) or primdecSY(k) 4310 RETURN: int = 1, if the intersection of the primary ideals 4311 in pr is k, 0 if not 4312 NOTE: 4313 EXAMPLE: example testPrimary ; shows an example 4314 " 4315 { 4316 int i; 4317 pr=reconvList(pr); 4318 ideal j=pr[1]; 4319 for (i=2;i<=size(pr)/2;i++) 4320 { 4321 j=intersect(j,pr[2*i-1]); 4322 } 4323 return(idealsEqual(j,k)); 4324 } 4325 example 4326 { "EXAMPLE:"; echo = 2; 4327 ring r = 32003,(x,y,z),dp; 4328 poly p = z2+1; 4329 poly q = z4+2; 4330 ideal i = p^2*q^3,(y-z3)^3,(x-yz+z4)^4; 4331 list pr= primdecGTZ(i); 4332 testPrimary(pr,i); 4333 } 4334
Note: See TracChangeset
for help on using the changeset viewer.