Changeset 7b4fc8 in git
- Timestamp:
- Apr 22, 2015, 7:17:40 PM (8 years ago)
- Branches:
- (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
- Children:
- 04b3ef1b32a87e188ccba4b8a4308a0e75f9b895
- Parents:
- d088e2c2f2336235f058b94a17c4d3453de98df5
- git-author:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2015-04-22 19:17:40+02:00
- git-committer:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2015-04-29 18:04:56+02:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/gradedModules.lib
rd088e2 r7b4fc8 53 53 mappingcone2(M,N) mapping cone2? 54 54 grlifting3(A,B) RND! chain lifting? probably wrong one 55 grlifting4(A,B) RND! chain lifting? newer from #hani# for mappingcone356 55 mappingcone3(A,B) mapping cone3? (using grlifting4 at the moment) 57 56 grrange(M) get the row-weightings 57 grneg(A) graded object given by -A 58 matrixpres(intvec a) matrix presentation of direct sum of Omega^a[i](i) 58 59 "; 59 60 … … 1458 1459 1459 1460 proc KeneshlouMatrixPresentation(intvec a) 1460 " 1461 PURPOSE: Direct sum of all omegas_i(i) with powers a[i] 1462 NOTE: Please document/name this proc properly 1463 " 1461 "USAGE: intvec a. 1462 RETURN: matrix 1463 PURPOSE:matrix presentation for direct sum of omega^a[i](i) 1464 EXAMPLE: example KeneshlouMatrixPresentation; shows an example 1464 1465 { 1465 1466 int n = size(a)-1; … … 1685 1686 1686 1687 proc grlifting(M,N) 1687 "generic random alpha : coker(M) -> coker(N) " 1688 "USAGE: graded objects M and N 1689 RETURN: map of chain complexes (as a list) 1690 PURPOSE: construct a map of chain complexes between free resolution of 1691 M=Img(M) and N=Img(N). 1692 EXAMPLE: example grlift; shows an example 1693 " 1688 1694 { ASSUME(1, grtest(M)); 1689 1695 ASSUME(1, grtest(N)); … … 1712 1718 P[1]= grrndmap( rM[1], rN[1] ); // alpha1 1713 1719 1714 grview(P[1]); print(P[1]); 1715 1716 // return(); 1717 1718 1720 if(t==2){return(P[1]);} 1721 1719 1722 for(k=2; k<=t; k++) 1720 1723 { 1721 "k: ", k; 1722 grview(rN[k-1]); 1723 grview(P[k-1]); 1724 1725 // grprod( grtranspose(P[k-1]), grtranspose(rN[k-1]) ); 1726 // grprod( grtranspose(rN[k-1]), grtranspose(P[k-1]) ); 1727 1728 // grprod( P[k-1], rN[k-1] ); 1729 1730 // grview( _ ); 1731 1732 // rM[k]; 1733 grview(rM[k-1]); 1734 1735 P[k] = grtranspose( grlift( grtranspose( rM[k-1] ), 1736 grtranspose( grprod( rN[k-1], P[k-1] ) ) ) ); // alpha0! 1737 1738 // P[k] = grlift( grprod(P[k-1],rM[k]), rN[k] ); // ?? 1739 grview(P[k]); 1724 P[k] = grlift( grprod(P[k-1],rM[k]), rN[k] ); 1725 grview(P[k]); 1740 1726 1741 1727 } … … 1791 1777 1792 1778 proc mappingcone(M,N) 1793 "??" 1779 "USAGE:M,N graded objects 1780 RETURN: chain complex (as a list) 1781 PURPOSE: construct a free resolution of the cokernel of a random map between 1782 M=Img(M), and N=Img(N). 1783 EXAMPLE: example mappingcone; shows an example 1784 1794 1785 { 1795 1786 ASSUME(1, grtest(M)); … … 1824 1815 example 1825 1816 { "EXAMPLE:"; echo = 2; 1817 //Veronese surface 1826 1818 1827 1819 ring r=32003, (x(0..4)),dp; 1828 def I=maxideal(1); 1829 module R=grobj(module(I), intvec(0)); 1830 resolution FR=mres(R,0); 1831 print(betti(FR,0),"betti"); 1832 module K=grobj(module(FR[1]),intvec(-1),intvec(0,0,0,0,0)); 1833 module S=grsyz(K); 1834 grview(S); 1835 module B=grobj(module([1,0,0],[0,1,0],[0,0,1]),intvec(1,1,1),intvec(1,1,1)); 1836 grview(B); 1837 1838 def Z=grlifting(B,S); 1839 Z; 1840 1841 def G=mappingcone(B,S); 1842 G; 1843 1844 1845 resolution E=grres(G[1],0); 1846 print(betti(E,0),"betti"); 1847 module W=grtranspose(G[1]); 1848 resolution U=grres(W,0); 1849 ideal P=groebner(flatten(U[2])); // flatten??? 1850 resolution L=mres(P,0); 1851 print(betti(L),"betti"); 1820 def A=KeneshlouMatrixPresentation(intvec(0,0,0,0,3)); 1821 def M=grgens(A); 1822 grview(M); 1823 1824 def B=KeneshlouMatrixPresentation(intvec(0,1,0,0,0)); 1825 def N=grgens(B); 1826 grview(N); 1827 1828 def R=grlifting(M,N); 1829 grview(R); 1830 def T=mappingcone(M,N); 1831 grview(T); 1832 1833 def U=grtranspose(T[1]); 1834 resolution G=mres(U,0); 1835 print(betti(G),"betti"); 1836 ideal I=groebner(flatten(G[2])); 1837 resolution GI=mres(I,0); 1838 print(betti(GI),"betti"); 1852 1839 } 1853 1840 … … 2028 2015 int r=size(v); 2029 2016 int s=size(w); 2030 m odule zero = (0:s);2017 matrix zero[r][s]; 2031 2018 2032 2019 module A=grconcat(P[i],rN[i]); 2033 2020 module B=grobj(zero,v,w); 2034 module C=grconcat(-rM[i-1],B); 2021 ASSUME( 0, grtest( grneg( rM[i-1]) ) ); 2022 module C=grconcat( grneg( rM[i-1] ) ,B); // FIXME: '-' is wrong! need a graded-enabled minus (e.g. grneg?) 2035 2023 module D=grconcat(grtranspose(C), grtranspose(A)); 2036 2024 … … 2039 2027 return(T); 2040 2028 } 2029 2030 2031 2041 2032 example 2042 2033 { "EXAMPLE:"; echo = 2; … … 2065 2056 def G=mappingcone2(SS,BB);G; 2066 2057 } 2067 */ 2068 2069 2070 2071 2072 /* 2073 -f1 0 -f2 0 2074 (p1 g1) p2 g2 p3 g3 2075 G0<-----F0+G1<------F1+G2<-------F2+G3<----- 2076 2077 */ 2078 2079 proc mappingcone2(A,B) 2080 "USAGE: (A,B), graded objects A and B (matrices defining maps) 2081 RETURN: chain complex (as a list) 2082 PURPOSE: construct the free resolution of cokernel of a random map between 2083 M=coker(A), and N=coker(B) 2084 EXAMPLE: example ???????? 2085 " 2086 2087 { 2088 ASSUME(1, grtest(A)); 2089 ASSUME(1, grtest(B)); 2090 2091 list P=grlifting3(A,B); 2092 list rM=grres(A,0,1); 2093 list rN=grres(B,0,1); 2094 2095 int i; 2096 list T; 2097 2098 T[1]=grconcat(P[1],rN[1]); 2099 2100 for(i=2;i<=size(P);i++) 2101 { 2102 intvec v=grrange(rM[i-1]); 2103 intvec w=grdeg(rN[i]); 2104 int r=size(v); 2105 int s=size(w); 2106 matrix zero[r][s]; 2107 2108 module A=grconcat(P[i],rN[i]); 2109 module B=grobj(zero,v,w); 2110 module C=grconcat(-rM[i-1],B); 2111 module D=grconcat(grtranspose(C), grtranspose(A)); 2112 2113 T[i]=grtranspose(D); 2114 } 2115 return(T); 2116 } 2058 2059 2117 2060 2118 2061 … … 2171 2114 2172 2115 } 2116 2117 2118 2173 2119 example 2174 2120 {"EXAMPLE:"; echo = 2; … … 2200 2146 } 2201 2147 2148 2149 proc grneg(A) 2150 "USAGE: A graded object 2151 RETURN: -A as graded object 2152 PURPOSE: graded map defined by -A. 2153 EXAMPLE: example grneg; shows an example 2154 " 2155 { 2156 ASSUME(0, grtest(A)); 2157 return(grobj(-A,grrange(A), grdeg(A) )); 2158 } 2159 2160 example 2161 { "EXAMPLE:"; echo = 2; 2162 ring r=0,(x,y,z),dp; 2163 def A=grobj([x2,yz,xyz],intvec(1,1,0)); 2164 grview(A); 2165 def F=grneg(A); 2166 grview(A); 2167 } 2168 2169 2170 2171 2202 2172 /* 2203 2173 -f1 0 -f2 0 2204 2174 (p1 g1) p2 g2 p3 g3 2205 2175 G0<-----F0+G1<------F1+G2<-------F2+G3<----- 2176 2206 2177 */ 2207 2178 2208 proc grneg(M) 2209 "negative map 2210 TODO for Hanieh: please document this and find good motivating examples for this proc!! 2211 " 2212 { 2213 return ( grobj(-M, grrange(M), grdeg(M) ) ); 2214 } 2215 2216 // note: not clear which grlifting3 should be used by the following 2217 // procedure!!? 2179 2218 2180 proc mappingcone3(A,B) 2219 2181 "USAGE: (A,B), graded objects A and B (matrices defining maps) … … 2262 2224 return(T); 2263 2225 } 2226 2227 2228 2264 2229 example 2265 2230 { "EXAMPLE:"; echo = 2; … … 2273 2238 grview(T); 2274 2239 2275 def F=grlifting 4(A,T); grview(F);2240 def F=grlifting3(A,T); grview(F); 2276 2241 2277 2242 /* BUG in the proc */ … … 2294 2259 grview(S); 2295 2260 2296 def H=grlifting 4(R,S); grview(H);2261 def H=grlifting3(R,S); grview(H); 2297 2262 2298 2263 /* BUG in the proc */ 2299 def G=mappingcone3(R,S); // ????????2264 def G=mappingcone3(R,S); 2300 2265 2301 2266 2302 2267 def I=KeneshlouMatrixPresentation(intvec(2,3,0,6,2)); 2303 2268 def J=KeneshlouMatrixPresentation(intvec(4,0,1,2,1)); 2304 // def N=grlifting 4(I,J);2269 // def N=grlifting3(I,J); 2305 2270 /* 2nd module does not lie in the first: */ // def NN=mappingcone3(I,J); // ???????? 2306 2271 … … 2308 2273 2309 2274 2310 // this is grlifting3 from #hani# (NOTE that this version is different 2311 // to the grlifting3 that came within this library!!! 2312 proc grlifting4(A,B) 2313 "USAGE: (A,B), graded objects A and B (matrices defining maps) 2314 RETURN: map of chain complexes (as a list) 2315 PURPOSE: construct a map of chain complexes between free resolution of 2316 M=coker(A) and N=coker(B). 2317 EXAMPLE: example grlifting4; shows an example 2318 " 2319 { 2320 ASSUME(1, grtest(A)); 2321 ASSUME(1, grtest(B)); 2322 2323 2324 list rM=grres(A,0,1); 2325 list rN=grres(B,0,1); 2326 int i,j,k; 2327 2328 for(i=1;i<=size(rM);i++) 2329 { 2330 if(size(rM[i])==0){break;} 2331 } 2332 2333 for(j=1;j<=size(rN);j++) 2334 { 2335 if(size(rN[j])==0){break;} 2336 } 2337 int t=min(i,j); 2338 2339 list P; 2340 2341 P[t]= grrndmap2( rM[t],rN[t] ); 2342 2343 if(t==1){return(P)}; 2344 2345 for(k=t-1; k>=1; k--) 2346 { 2347 def C = grtranspose(rM[k]); 2348 def T= grprod(rN[k],P[k+1]); 2349 def tT = grtranspose(T); 2350 2351 P[k]= grtranspose(grlift(C,tT)); 2352 2353 } 2354 return(P); 2355 } 2275 2276 2277 2278 2279 proc matrixpres(intvec a) 2280 "USAGE: intvec a. 2281 RETURN: matrix. 2282 PURPOSE:matrix presentation for direct sum of omega^a[i](i) 2283 EXAMPLE: example matrixpres; shows an example 2284 { 2285 int n = size(a)-1; 2286 // ring r = 32003,(x(0..n)),dp; 2287 ASSUME(0, nvars(basering)==(n+1)); 2288 int i,j; 2289 2290 // find first nonzero exponent a_i 2291 for(i=1;i<=size(a);i++) 2292 { 2293 if(a[i]!=0) {break; }; 2294 } 2295 2296 // all zeroes? 2297 if(i>size(a)) {return (grzero()); }; 2298 for(i=2;i<=n;i++) 2299 { 2300 if(a[i]!=0) {break; }; 2301 } 2302 2303 module N; 2304 2305 if(i>n) 2306 { // no middle part 2307 if(a[1]>0) 2308 { 2309 N=grtwist(a[1],-1); 2310 2311 if(a[n+1]>0) 2312 { N=grsum(N,grtwist(a[n+1],0));} 2313 } 2314 else 2315 { N=grtwist(a[n+1],0);} 2316 2317 return (N); // grorder(N)); 2318 } 2319 2320 else // i <= n: middle part is present, a_i != 0 2321 { // a = a1 ... | i:2, a_2 ..... i: n, a_n | .... i: n+1a_(n+1) 2322 module I = maxideal(1); 2323 attrib(I,"isHomog", intvec(0)); 2324 list L = mres(I, 0); 2325 list kos = grorder(L); 2326 // make sure that graded maps are represented by blocks corresponding to the betti diagram? 2327 int j=size(a)-i; 2328 def S = grpower(grshift(grobj( kos[j+2], attrib(kos[j+2], "isHomog")),j ), a[i]); 2329 2330 i++; 2331 2332 for(; i <= n; i++) 2333 { 2334 if(a[i]==0) { i++; continue; } 2335 int j=size(a)-i; 2336 S = grsum( S, grpower(grshift( grobj( kos[j+2], attrib(kos[j+2], "isHomog")), j), a[i]) ); 2337 } 2338 2339 // S is the middle (non-zero) part 2340 2341 if(a[1] > 0 ) 2342 { 2343 N=grsum(grtwist(a[1],-1), S); 2344 } 2345 else 2346 { N = S;} 2347 2348 if(a[n+1] > 0 ) 2349 { N=grsum(N, grtwist(a[n+1],0)); } 2350 2351 2352 return ((N)); // return (grorder(N)); 2353 } 2354 } 2355 2356 2356 example 2357 2357 {"EXAMPLE:"; echo = 2; 2358 2358 2359 ring r=32003,x(0..4),dp; 2360 2361 def A=KeneshlouMatrixPresentation(intvec(0,0,0,0,3)); 2362 grview(A); 2363 2364 def T= KeneshlouMatrixPresentation(intvec(0,1,0,0,0)); 2365 grview(T); 2366 2367 def F=grlifting4(A,T); 2368 grview(F); 2369 2370 def G=mappingcone3(A,T);grview(G); 2371 /* 2372 module W=grtranspose(G[1]); 2373 resolution U=mres(W,0); 2374 print(betti(U,0),"betti"); // ? 2375 ideal P=groebner(flatten(U[2])); 2376 resolution L=mres(P,0); 2377 print(betti(L),"betti"); 2378 */ 2379 2380 2381 def R=KeneshlouMatrixPresentation(intvec(0,0,0,2,0)); 2382 def S=KeneshlouMatrixPresentation(intvec(1,2,0,0,0)); 2383 2384 def H=grlifting4(R,S); grview(H); 2385 2386 def G=mappingcone3(R,S); // ???????? 2387 2388 def I=KeneshlouMatrixPresentation(intvec(2,3,0,6,2)); 2389 def J=KeneshlouMatrixPresentation(intvec(4,0,1,2,1)); 2390 /* 2nd module does not lie in the first: */ //def N=grlifting4(I,J); 2391 2392 } 2359 def R=matrixpres(intvec(1,4,0,0,0)); 2360 def S=matrixpres(intvec(0,0,3,0,0)); 2361 }
Note: See TracChangeset
for help on using the changeset viewer.