1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812
|
newPackage(
"CompleteIntersectionResolutions",
Version => "2.2",
Date => "December 16, 2019",
Authors => {{Name => "David Eisenbud",
Email => "de@msri.org",
HomePage => "http://www.msri.org/~de"}},
Headline => "Analyzing Resolutions over a Complete Intersection",
Keywords => {"Commutative Algebra"},
PackageImports => {"Truncations"},
PackageExports => {"MCMApproximations","BGG"},
--note: this package requires MCMApproximations.m2
--in the version of August 21,2018
DebuggingMode => false
)
export{
--things related to Ext over a complete intersection
"ExtModule",
"evenExtModule",
"OutRing",
"oddExtModule",
"ExtModuleData",
"newExt", -- replacement for global Ext
"Lift", -- option for newExt
--tools used to construct the "higher matrix factorization"
--of a high syzygy or more generally a Maximal Cohen-Macaulay module
"matrixFactorization",
"makeT",
"koszulExtension",
"highSyzygy",
--scripts to unpack the info in a matrix factorization
"BRanks",
"ARanks",
"bMaps",
"dMaps",
"psiMaps",
"hMaps",
"mfBound",
"finiteBettiNumbers",
"infiniteBettiNumbers",
--Routines that make other resolutions
"Shamash",
"EisenbudShamash",
"EisenbudShamashTotal",
"layeredResolution",
"makeFiniteResolution",
"makeFiniteResolutionCodim2",
"TateResolution",
--modules over the exterior algebra
"exteriorTorModule",
"exteriorExtModule",
"makeHomotopies",
"makeHomotopies1",
"makeHomotopiesOnHomology",
"exteriorHomologyModule",
"BGGL",
"extVsCohomology",
"freeExteriorSummand",
--Representing a module as Ext_R(M,k)
"moduleAsExt",
"hfModuleAsExt",
"complexity",
--some routines to test particular conjectures
"regularitySequence",
"extIsOnePolynomial",
--some families of examples
"twoMonomials",
"sumTwoMonomials",
--some utilities
"splittings",
"S2",
"hf",
"isQuasiRegular",
"makeModule",
"isLinear",
"cosyzygyRes",
"stableHom",
"isStablyTrivial",
"dualWithComponents",
"HomWithComponents",
"tensorWithComponents",
"toArray",
"expo",
--Symbols
"Check", -- optional arg for matrixFactorization
"Layered", -- optional arg for matrixFactorization
"Augmentation", -- optional arg for matrixFactorization
"Grading", --optional arg for EisenbudShamashTotal
"Optimism" -- optional arg for highSyzygy etc
}
regularitySequence = method()
regularitySequence(List, Module) := (R,M) ->(
--R = complete intersection list R_(i+1) = R_i/f_(i+1), i= 0..c.
--M = module over R_c
--returns the list of pairs {reg evenExtModule M_i, reg oddExtModule M_i}
--where M_i is the MCM approximation of M over R_i
if M == 0 then return{- infinity, {}, - infinity, {}};
em := null;
om := null;
c := length R-1;
(MList,kkk,p) := setupModules(R,M);
MM := apply(c+1, j->source approximation(pushForward(p_c_j, M),Total =>false));
MM = select(MM, m-> not isFreeModule m);
<<"reg even ext, soc degs even ext, reg odd ext, soc degs odd ext"<<endl<<endl;
scan(reverse MM, m-> (
em = evenExtModule m;
om = oddExtModule m;
<<{regularity em, socleDegrees em, regularity om, socleDegrees om})
<<endl);
)
Shamash = method()
Shamash(Matrix, ChainComplex,ZZ) := (ff, F, len) ->(
--Given a 1 x 1 matrix ff over a ring R and a chain complex F
--admitting a homotopy for ff_0, produce the Shamash complex
-- F as a chain complex Fbar over Rbar = R/ideal ff.
R := ring ff;
deg := (degrees source ff)_0_0;
H := makeHomotopies(ff,F);
--simplify the notation for the map from F_j to F_i
d := (i,j) -> if (even(i-j) or (i-j<(-1)) or (F_i==0) or (F_j==0))
then map(F_i,F_j,0) else
map(F_i,F_j, H#{{(1+i-j)//2},j});
-- error();
--make the modules
G := apply(1+len, i->directSum(
if even i then apply(1+i//2, j->R^{ -deg*((i-2*j)//2)}**F_(2*j))
else apply((i+1)//2, j->R^{ -deg*(i-(2*j+1))//2}**F_(1+2*j))));
--make maps G_(i) to G_(i-1)
D := i-> if even i then
--if i is even then G_i = F_0++..++F_i, a total of i//2 terms, and G_(i-1) = F_1++.. has i//2-1 terms
map(G_(i-1),G_i,matrix apply(i//2, p-> apply(1+i//2, q-> d(2*p+1,2*q)))) else
map(G_(i-1),G_i,matrix apply(1+(i-1)//2, p-> apply(1+i//2, q-> d(2*p,2*q+1))));
Rbar := ring ff/ideal ff;
chainComplex apply(len, i-> Rbar**D(i+1))
)
Shamash(Ring, ChainComplex,ZZ) := (Rbar, F, len) ->(
P := map(Rbar,ring F);
ff := gens trim ker P;
if numcols ff != 1 then error"given ring must be quotient of ring of complex by one element";
FF := Shamash(ff, F,len);
P = map(Rbar, ring FF, vars Rbar);
P FF
)
EisenbudShamash = method()
EisenbudShamash (Ring, ChainComplex, ZZ) := (R, F, len) ->(
--Given a 1 x c matrix ff over a ring S and a chain complex F over S,
--admitting higher homotopies
-- for the entries of ff, produce the Shamash complex
-- G as a chain complex R = S/ideal ff.
if R === ring F then return F;
ff := gens ker map(R,ring F, vars R);
F' := F[min F];
h := makeHomotopies(ff,F');
(chainComplex apply(len, i-> dpart(R,h,F',i+1)))[-min F]
)
EisenbudShamash (Matrix, ChainComplex, ZZ) := (ff, F, len) ->
EisenbudShamash((ring F)/(ideal ff), F, len)
Gpart = method()
Gpart(Ring, ChainComplex, ZZ, ZZ) := (R, F, i,j) ->(
-- j-th part of i-th module in Shamash(ff, F), in the order
-- F_i, D_1**F_(i-2), ...
ff := gens ker map(R,ring F, vars R);
c := numcols ff;
ffdegs := (degrees ff)_1;
if j < 0 then return R^0;
if i-2*j<min F then return R^0;
degshift := 0;
directSum apply(expo(c,j), e-> (
degshift = sum apply(c, cc-> e_cc*ffdegs_cc);
R^{-degshift}**(R**F_(i-2*j))))
)
Gpart(Ring, ChainComplex, ZZ) := (R, F, i) ->(
ff := gens ker map(R,ring F, vars R);
range := toList(min F..i//2);
if range == {} then return R^0;
directSum(apply(range, j-> Gpart(R, F, i, j)))
)
concatHorizontal = L -> (
--concatenates a list of matrices
m := map(target L_0,(ring L_0)^0,0);
scan(L, ell -> m = m|ell);
m)
concatVertical = LL -> (
m := LL_0;
LL' := drop(LL,1);
scan(LL', ell -> m = m||ell);
m)
dpart = method()
dpart(Ring, HashTable, ChainComplex, List) := (R, h , F, L) ->(
--Let G = Shamash(ff, F), and {i,j,k} = L.
--The function returns the map
--from the j-th summand of G_i to the k-th summand of G_(i-1).
i := L_0;
j := L_1;
k := L_2;
ff := gens ker map(R,ring F, vars R);
c := numcols ff;
ffdegs := (degrees ff)_1;
degshift := e -> sum apply(c, cc-> e_cc*ffdegs_cc);
G0 := Gpart(R, F,i-1,k);
G1 := Gpart(R, F,i,j);
if G0==0 or G1==0 then return map(G0,G1,0);
--i-2*j>=0, but u-v might have negative components.
LL := apply(expo(c,k), v->
concatHorizontal(
apply(expo(c,j), u->
if h#?{u-v,i-2*j} then R**h#{u-v,i-2*j} else
map(R^{-degshift v}**(R**F_(i-1-2*k)),R^{-degshift u}**(R**F_(i-2*j)),0)
)
)
);
map(G0,G1,concatVertical LL)
)
dpart(Ring, HashTable, ChainComplex, ZZ) := (R,h,F,i)->(
-- i-th differential of Shamash
LL := apply(1+(i-1)//2, k-> concatHorizontal apply(1+i//2, j-> dpart(R,h,F,{i,j,k})));
map(Gpart(R, F, i-1), Gpart(R, F, i), concatVertical LL)
)
layeredResolution = method(Options =>{Verbose=>false, Check=>false})
--version that produces the finite layered resolution
layeredResolution(Matrix, Module) := opts ->(ff, M) ->(
--ff is a 1 x c matrix over a Gorenstein ring S
--M is an S-module annihilated by I = ideal ff.
--returns a pair (L,aug), where aug: L_0 \to M is the augmentation.
--Here L_0 = L'_0 ++ B_0, and L' is the resolution of M', the
--MCM approximation of M over R' = S/(ideal ff'), and ff' = ff_{0..(c-2)}.
L := null;
cod := numcols ff;
if cod <=1 then (
L = res M;
-- <<{rank L_0, rank L_1} << " in codimension "<< cod<<endl;
return (L, map(M,L_0,id_(L_0))));
S := ring ff;
R := S/(ideal ff);
ff' := ff_{0..cod-2};
R' := S/(ideal ff');
p:= map(R,R');
q := map(R',S);
MR := prune R**M;
MR' := prune(R'**M);
(alpha, beta) := approximation MR';
B0 := source beta;
M'u := source alpha;--unpruned!
M' := prune M'u;
pruneMapM' := M'.cache.pruningMap; -- goes from M' to M'u
gamma := map(MR', M'++B0, (alpha*pruneMapM')|beta);
BB1 := ker gamma;
B1 := minimalPresentation BB1;
-- assert(isFreeModule B1);
psib := inducedMap(M' ++ B0, BB1)*(B1.cache.pruningMap);
psi := psib^[0];
b := psib^[1];
-- assert(source psi == B1 and source b == B1);
-- assert(target psi == M' and target b == B0);
M'S := pushForward(q,M');
bS := substitute(b,S);
B0S := target bS;
B1S := source bS;
if opts.Verbose === true then << {rank B1S, rank B0S} << " in codimension " << cod<<endl;
KK := koszul(ff');
B := chainComplex{bS};
(L',aug') := layeredResolution(ff', M'S, Verbose => opts.Verbose);
assert(target aug' == M'S);
psiS0 := map(M'S, B1S, sub(matrix psi,S));
psiS := psiS0//aug';
Psi1 := extend(L',B[1],matrix psiS);
Psi2 := Psi1**KK;
Psi := extend(L',L'**KK, id_(L'_0))*Psi2;
L = cone Psi; -- L', the target of Psi, is the first summand, so this is L_0==L'_0++B_0
assert(L_0 == L'_0 ++ B_0);
m := (sub(matrix (alpha*pruneMapM'),S)*matrix aug') |sub(matrix beta,S);
aug := map(M,L'_0++B_0,m);
--Check exactness
-- scan(length L -1, s->assert( HH_(s+1) L == 0));
(L,aug)
)
layeredResolution(Matrix, Module, ZZ) := opts -> (ff, M, len) ->(
--ff is a 1 x c matrix over a Gorenstein ring S and ff' = ff_{0..(c-2)}, ff'' = ff_{c-1}.
--R = S/ideal ff
--R' = S/ideal ff'
--NOTE R =!= R'/ideal ff''; we need to use a map to go between them.
--M is an MCM R-module.
--The script returns a pair (L,aug), where L is the first len steps of an R-free resolution of M
--and aug: L_0 \to M is the augmentation.
-- Let
-- B_1 --> B_0 ++ M' --> M
-- be the MCM approximation of M over R'.
-- If L' is the layered R'-free resolution of M', then
-- L_0 = R\otimes (L'_0 ++ B_0),
-- L_1 = R\otimes (L'_1 ++ B_1).
-- and L is the Shamash construction applied to the box complex.
-- The resolution is returned over the ring R.
cod := numcols ff;
R := ring M;
S := if cod >0 then ring ff else R;
StoR := map(R,S);
MS := pushForward(StoR, M);
if cod == 0 then (
L := res(M,LengthLimit => len);
return (L, map(M, L_0, id_(L_0))));
ff' := ff_{0..cod-2};
R' := S/ideal ff';
ff'' := R'** ff_{cod-1};
R'toR := map(R,R');
MR':= pushForward(R'toR,M);
-- print "M";
-- print presentation M;
(alpha, beta) := approximation MR';
B0 := source beta;
M' := source alpha;
-- print "M'";
-- print presentation M';
gamma := map(MR', M'++B0, (alpha|beta));
BB1 := ker gamma;
B1 := minimalPresentation BB1;
psib := inducedMap(M' ++ B0, BB1)*(B1.cache.pruningMap);
psi := psib^[0];
b := psib^[1];
(L',aug') := layeredResolution(ff',M', len);
B := chainComplex {b};
Psi := extend(L', B[1], matrix(psi//aug'));
box := cone Psi;
L = Shamash(R, box, len);
print betti L;
aug := map(M, L_0,
R'toR matrix(
map(MR',M'++B0, (alpha|beta))*map(M'++ B0, box_0, aug'++id_(B0))));
(L, aug)
)
dualWithComponents = method()
dualWithComponents Module := M -> (
if not isDirectSum M then return dual M else (
directSum(components M/dualWithComponents)))
tensorWithComponents = method()
tensorWithComponents(Module, Module) := (M,N) ->(
if not isDirectSum M and not isDirectSum N then return M**N else
directSum flatten apply(components M, m->apply(components N, n->(
tensorWithComponents(m,n)))))
HomWithComponents = method()
HomWithComponents (Module, Module) := (M,N) ->(
if not isDirectSum M and not isDirectSum N then return Hom(M,N) else
directSum flatten apply(components M, m->apply(components N, n->(
HomWithComponents(m,n)))))
stableHom = method()
stableHom(Module, Module) := (M,N)->(
--returns the map from Hom(M,N) to the stable Hom
H := Hom(M,N);
if isFreeModule M then return map((ring M)^0, H, 0);
p := map(N, cover N, 1);
map(coker Hom(M,p), Hom(M,N), 1))
isStablyTrivial = method()
isStablyTrivial Matrix := f ->(
-- f: M \to N is given.
-- represent f as an element of Hom, that is, as a map (ring M)^1 \to Hom(M,N)
--then apply stableHom.
f1 := homomorphism' f;
(stableHom(source f, target f)*f1) == 0)
isQuasiRegular = method()
isQuasiRegular(Matrix, Module) := (ff,E) ->(
len := rank source ff;
if len > dim E then return false;
T := null;
for i from 0 to len-1 do (
T = ker(ff_{i}**id_(E/(ideal(ff_{0..i-1})*E)));
if dim T > 0 then return false
else if i==len-1 then return true
))
isQuasiRegular(List, Module) := (fList, E) ->isQuasiRegular(matrix{fList}, E)
isQuasiRegular(Sequence, Module) := (fseq, E) ->isQuasiRegular(toList fseq, E)
hf=method()
hf(Sequence, Module) := (range,P) -> (
apply(toList range,i->hilbertFunction(i, P)))
hf(List, Module) := (range,P) -> (
apply(range,i->hilbertFunction(i, P)))
submoduleByDegrees = method()
submoduleByDegrees(Module,ZZ):= (A,n)->(
F := cover A;
L := flatten degrees F;
L1:= positions(L,d->d<=n);
image (inducedMap(A,cover A)*F_L1)
)
toArray = method()
toArray List := L -> splice [toSequence L]
toArray ZZ := n->[n]
transpose Module := M -> coker transpose presentation M
--this is Auslander's transpose functor
ExtModule = method()
ExtModule Module := M -> (
--If M is a module over a complete intersection R
--of codim c, the script returns
--Ext^*(M,(ring M)^1/(ideal vars ring M))
--graded in POSITIVE degrees
--as a module over the polynomial ring kk[X_1..X_(codim R)],
--where the vars have degree 2
R := ring M;
kk := coefficientRing R;
kkk := (ring M)^1/(ideal vars ring M);
E := Ext(M,kkk);
TE := ring E;
c := numgens source presentation R;
X := local X;
T := kk[X_0..X_(c-1), Degrees => toList(c:{2})];
v := map(T,
ring E,
vars T | matrix{toList ((numgens R):0_T)},
DegreeMap => i -> {-first i} );
prune coker v presentation E)
evenExtModule = method(Options =>{OutRing => 0})
evenExtModule Module := opts -> M -> (
--If M is a module over a complete intersection R
--of codim c, the script returns
--Ext^(even)(M,(ring M)^1/(ideal vars ring M))
--as a module generated in degree 0
--over the polynomial ring kk[X_1..X_(codim R)],
--where the vars have degree 1
--unless the option Outring => outring is given, with outring being
--a polynomial ring with numGens ring E, in chich case this ring is used.
E := ExtModule M;
P := positions(flatten degrees E, even);
Ee:=prune image (E_P);
T := ring E;
if class opts#OutRing === PolynomialRing then T1 := opts#OutRing else
(
kk:= coefficientRing T;
X := symbol X;
T1 = kk[X_0..X_(numgens T -1)]
);
v1 := map(T1, T, vars T1, DegreeMap => i->{(first i)//2});
coker v1 presentation Ee
)
oddExtModule = method(Options =>{OutRing => 0})
oddExtModule Module := opts -> M -> (
--If M is a module over a complete intersection R
--of codim c, the script returns
--Ext^(odd)(M,(ring M)^1/(ideal vars ring M))
--as a module generated in degree 0
--over the polynomial ring kk[X_1..X_(codim R)],
--where the vars have degree 1
E := ExtModule M;
P := positions(flatten degrees E, odd);
Eo:=prune image (E_P);
T := ring E;
if class opts#OutRing === PolynomialRing then T1 := opts#OutRing else
(
kk:= coefficientRing T;
X := symbol X;
T1 = kk[X_0..X_(numgens T -1)]
);
v1 := map(T1, T,vars T1, DegreeMap => i->{(first i)//2});
coker v1 presentation Eo
)
makeT = method()
makeT(Matrix, ChainComplex,ZZ) := (ff,F,i) ->(
-*
If ff is an c x 1 matrix and
F is a chain complex
over R = S/(ideal ff),
of codim c this returns a list of the c ci-operators
F_i \to F_{i-2}
corresponding to the entries of ff.
*-
c := numcols ff;
degsff := flatten((degrees ff)_1);
R := ring F;
S := ring ff;
complete F;
minF := min F;
d0 := sub(F.dd_i, S);
d1 := sub(F.dd_(i-1), S);
Ftar := target d1;
Fsour := source d0;
d2 := d1*d0;
T := (d2//(ff**Ftar));
I := id_(source ff);
u := apply(c, j-> (I^{j}**Ftar)*T);
--check: is d1*d0 = sum ff_{i}*u_i
if d1*d0 != map(Ftar, Fsour, sum(c, i-> u_i**ff_{i})) then
error{"doesn't add up"};
ret := map(R,S);
apply(u, u1 -> ret u1)
)
splittings = method()
splittings (Matrix, Matrix) := (a,b) -> (
-*
Assuming that (a,b) are the maps of a right exact
sequence
a b
0--> A ----> B ----> C ----> 0
with B, C free,
-- the script produces a list {tau,sigma}
the script produces a list {sigma, tau)
sigma: B --> A a splitting of a and
with tau: C --> B a splitting of b;
that is
a*sigma+tau*b = 1_B
sigma*a = 1_A
b*tau = 1_C
*-
if not isFreeModule source b then error("source b not free");
if not isFreeModule target b then error("target b not free");
(tau,remtau) := quotientRemainder(id_(target b),b);
if remtau !=0 then error("second map not splittable");
(sigma,remsigma) := quotientRemainder(id_(source b) - (tau*b),a);
if remsigma !=0 then error("first map not splittable");
{map(source a, target a, sigma), map(source b, target b,tau)}
)
cosyzygyRes = method()
cosyzygyRes (ZZ,Module) := (p,M)-> (
--returns a p+1-step resolution F of the
--p-th cosyzygy of M (so F.dd_p is the presentation
--matrix of M.)
--This is zero if the module
--is annihilated by a nonzerodivisor. Makes most sense for
--an MCM over a Gorenstein ring.
E:=res (transpose M, LengthLimit => p+1);
chainComplex apply(p+1, j->transpose E.dd_(p+1-j))
)
cosyzygyRes Module := M -> cosyzygyRes(2,M)
flattenDirectSum = method()
flattenDirectSum Module := M->(
if M.cache.?components then(
L := M.cache.components;
directSum flatten apply(L, N -> if N.cache.?components then N.cache.components else N))
else M)
flattenDirectSum Matrix := phi->
map(flattenDirectSum target phi, flattenDirectSum source phi, matrix phi)
lmfa = method(Options=>
{Check => false, Verbose =>false,Augmentation =>true})
lmfa(Matrix,Module) := opts -> (ff,M) ->(
--this is a rewrite of "layeredMFAug". Now it's called from "matrixFactorization"
--with the default option Layered == true,
--and does not need to be free-standing.
--inductive construction of a (possibly non-minimal) MF from any MCM module
--Inputs:
--gg = {{f1,..,fc}} is a 1 x c matrix
--whose entries are a sufficiently
--general regular sequence in S.
--R#c := S/(ideal ff).
--M an MCM over S/ideal ff.
--
--If opts#check == true (the default value) then various
--tests are performed along the way.
--Outputs:
--d: a triangular map of direct-sum modules,
--the matrix factorization differential.
--
--h: a map, the sum of the
--the partial homotopies.
--
--gamma, map from the target of d to the module M.
--
--Description:
--Atar#p = (target BS#1++..++target BS#p)
--Asour#p = (source BS#1++..++source BS#p), and
--
--d: Atar#c <-- Asour#c
--and h#p: Asour#p <--- Atar#p over S.
--The map
--d is a special upper triangular
--lifting to S of the presentation matrix
--of M over R#c.
--
--The map h#p is a homotopy for ff#p on the restriction
--dpartial#p: Atar#p <-- Asour#p of d, over the ring R#(p-1),
--so dpartial#p * h#p = ff#p mod (ff#1..ff#(p-1).
--
--In addition, h#p * dpartial#p induces f#p on B1#p.
--M is an R := S/ideal ff module.
S := ring ff;
R := ring M;
pR := map(R,S);
c := numcols ff;
MS := pushForward(pR,M);
--MS will be the target of gamma
--check that MS is MCM of the right codim
if opts.Check == true then(
FS := res MS;
if length FS != c then
error"module is not MCM mod the regular sequence");
---
--deal with the case where M is a free module over R
if isFreeModule M then (
d := map(MS,S^0,0);
h := map(S^0,S^0,0);
gamma := map(MS,MS,1);
return {d,h,gamma}
);
--Prepare the modules for the inductive step
ff' := ff_{0..c-2};
R' := S/ideal ff';
pR' := map(R',S);
MR' := pushForward(map(R,R'),M);
(alpha, beta) := approximation MR';
M'u := source alpha;-- the MCM over R', unpruned
M' := prune M'u;
M'p := M'.cache.pruningMap; --this is a map M'-->M'u
--problem: M', the source of alpha is not pruned; but
M'S := pushForward(pR',M'); -- target of gamma'
--but M'S, the pushforward, is!
alphaS := map(MS, M'S, substitute(matrix (alpha*M'p), S));
B0':= source beta;
betaS := map(MS, S**B0', substitute(matrix beta, S));
K :=kernel(alpha|beta);
B1' := prune K;
--check that B1' is free
if opts.Check == true then(
if not isFreeModule B1' then
error "should have been free");
--
--now replace the subquotient module K with B1'
p := B1'.cache.pruningMap; -- goes from B1' to K
bpsi := ((M'p)^(-1)++id_(B0'))* inducedMap(M'u++B0',K)*p;
psi'' := (M'++B0')^[0]*bpsi; --target is M'; psi' will have target == target d'
b' := map(S**B0', S**source bpsi,
substitute(matrix ((M'++B0')^[1]*bpsi), S));
if M' == 0 then (
hcR' := (ff_{c-1}**id_(R'**target b'))//(R'**b');
hc := map(source b', ,lift((matrix hcR',S)));
return{b',hc,beta});
--
(d',h',gamma') := toSequence lmfa(ff',M');
A0' := target d';
A1' := source d';
if opts.Verbose == true then print (d',h',gamma');
--the following need to be maps over S
--note: ring psi'' = R'
pR'S := map(R',S);
gamma'R' := map(R'**target gamma', R'**source gamma', substitute(matrix gamma', R'));
gamma'S := map(S**target gamma', S**source gamma', substitute(matrix gamma', S));
psi' := map(pushForward(map(ring gamma', S),source gamma'),
pushForward(pR'S, source psi''),
substitute(matrix (psi''//(gamma'R')), S)
);
zer0 := map(S**B0',A1',0);
--
dtar := flattenDirectSum(A0'++S**B0');
dsour := flattenDirectSum(A1'++S**B1');
--
d = map(dtar, dsour, (d'|psi')||(zer0|b'));
gamma = map(MS,(source gamma'S)++S**B0',
matrix(alphaS)*matrix(gamma'S)|betaS);
if opts.Verbose == true then print annihilator(coker d ** R');
if opts.Check == true then assert((ff_{c-1}**target d**R')%(d**R') == 0);
hc = (ff_{c-1}**id_(R'**target d))//(R'**d);
if opts.Check == true then assert((ff_{c-1}**id_(R'**target d)) % (R'**d) == 0);
zer1 := map(S**B1',S**source h', 0);
h = (h'||zer1)|map(source d,,lift(matrix hc, S)); --order reversed from prev code
if opts.Augmentation == true then {d,h,gamma} else {d,h}
)
matrixFactorization = method(Options=>
{Check => false,
Verbose => false,
Layered => true,
Augmentation => true})
matrixFactorization(Matrix, Module) := opts -> (ff, M) -> (
--Inputs:
--ff = {{f1,..,fc}} is a 1 x c matrix
--whose entries are a sufficiently
--general regular sequence in S.
--R#c := S/(ideal ff).
--M an MCM R#c-module.
--
--If opts#check == true (the default value) then various
--tests are performed along the way.
--
--In case M is a "high Syzygy" setting Layered =>false leads to a faster computation.
--
--Outputs:
--d: a triangular map of direct-sum modules,
--the matrix factorization differential.
--
--h: a map, the sum of the
--the partial homotopies.
--
--gamma: a map from ++B_i to MS = pushForward(map(R,S), M)
--
--Description of the computation in the case Layered => false:
--Atar#p = (target BS#1++..++target BS#p)
--Asour#p = (source BS#1++..++source BS#p), and
--
--d: Atar#c <-- Asour#c
--and h#p: Asour#p <--- Atar#p over S.
--The map
--d is a special upper triangular
--lifting to S of the presentation matrix
--of M over R#c.
--
--The map h#p is a homotopy for ff#p on the restriction
--dpartial#p: Atar#p <-- Asour#p of d, over the ring R#(p-1),
--so dpartial#p * h#p = ff#p mod (ff#1..ff#(p-1).
--
--In addition, h#p * dpartial#p induces f#p on B1#p.
--
--Notation:
--B1#i is the i-th matrix (ie, complex)
--of the matrix factorization tower,
--regarded as a map over R#(i-1);
--A#(p-1) is the matrix over R#p obtained inductively
--as the induced map on the complex
--ker A1#(p) -->> B1#(p), where A1#p is A#p lifted to R#(p-1).
--inc#(p,0): source A#(p-1) \to source A#p -- inclusion
--inc'#(p,0): splits inc#(p,0)
--inc#(p,1) and inc'#(p,1): same for targets
--proj#(p,0):source A1#p -->> source B1#p
--proj'#(p,0):its splitting
--proj#(p,1), proj'#(p,1): same for targets.
--the general case, where M is simply MCM over R:
if opts.Layered == true then return
lmfa(ff,M,
Check => opts.Check,
Verbose => opts.Verbose,
Augmentation => opts.Augmentation);
--Now the "old" code, handling the case where M is a "high syzygy". For some
--reason this is much faster when both are defined.
--Initialize local variables
spl:= null; -- a dummy variable for splittings
h := new MutableHashTable;
A := new MutableHashTable;
A1 := new MutableHashTable;
--A1#p is A#p substituted into R#(p-1)
B1 := new MutableHashTable;
--B1#p would be B#p over R#(p-1) (there is no B)
BS := new MutableHashTable; --same over S
dpartial := new MutableHashTable;
psi:= new MutableHashTable;--psi#p: B1#p-->target A#(p-1)
psiS:= new MutableHashTable;--psi#p: B1#p-->target A#(p-1)
inc := new MutableHashTable; --the #p versison are over R#(p-1)
inc' := new MutableHashTable;
inc'S := new MutableHashTable;
proj := new MutableHashTable;
projS := new MutableHashTable;
proj' := new MutableHashTable;
E := null; -- cosyzygy complex over R#p
E1 := new MutableHashTable;
--E1#i will be E.dd_i substituted into R#(p-1)
--Substance begins HERE.
fail := false; --flag to escape if a CI op is not surjective
--Put the regular sequence and the factor rings into hash tables:
--ci#i is the i-th element; R#i is codim i.
c := numcols ff;
S := ring ff;
ci := hashTable apply(toList(1..c),
p->{p,ff_{p-1}});--values are 1x1 matrices
degs := hashTable apply(toList(1..c),
p->{p,(degree ci#p_0_0)_0});--values are ZZ
R := hashTable apply(toList(0..c),
p->(if p==0 then {0,S}
else {p,S/ideal apply(toList(1..p), j->ci#(j))}));
--MAIN LOOP: work from p = c down to p = 1, creating the B1#p etc
A#c = presentation M; --initialize
scan(reverse toList(1..c), p->(
E = cosyzygyRes(2, coker A#p);
--sub into R#(p-1)
A1#p = substitute (A#p, R#(p-1));
scan(toList(1..3), i->E1#i = sub(E.dd_i,R#(p-1)));
--define the ci operators proj#(p,j), A1#c --> B#c
--and their kernels inc#(p,j) over R#(c-1).
scan(2, j->(
proj#(p,j) = map(R#(p-1)^{ -degs#p}**target E1#(j+1),
source E1#(j+2),
E1#(j+1)*E1#(j+2)//((target E1#(j+1)**ci#p)));
inc#(p,j) = syz proj#(p,j)
));
--if one of the proj#(p,j) is not surjective then
--set fail = true and break from loop
scan(2,j->
if not isSurjective proj#(p,j) then(
<< "CI operator not surjective at level codim " << c << endl;
<< "on example M = coker " << endl;
<<toString presentation M <<endl;
fail = true;
break;
));
if fail == true then break;
--make the splittings to/from A1#p, over R#(p-1)
scan(2, j-> (
spl :=splittings(inc#(p,j),proj#(p,j));
inc'#(p,j) = spl_0;
proj'#(p,j) = spl_1));
--make B1#p, A#(p-1), and
--the map psi#p: source B1#p -> target A1#(p-1)
B1#p = proj#(p,0)*A1#p*proj'#(p,1); -- B#p over R#(p-1)
A#(p-1) = inc'#(p,0)*A1#p*inc#(p,1);
psi#p = inc'#(p,0)*A1#p*proj'#(p,1);
));
--END OF MAIN LOOP
--Now put together the maps for output. All the work is done except
--for the creation of the homotopies.
if fail == true then error("cannot complete MF");
--lift all the relevant maps to S
scan(toList(1..c), p-> (
BS#p = substitute(B1#p, S);
psiS#(p)= substitute(psi#p, S);
scan(2, j->(
projS#(p,j)= substitute(proj#(p,j), S);
inc'S#(p,j)= substitute(inc'#(p,j), S)
))
));
--make psi(q,p): BS#(q,0) <-- BS#(p,1) (note direction!)
scan(toList(1..c), p->scan(toList(1..c), q->(
if q>p then psi#(q,p) = map(target BS#q,source BS#p, 0)
else if q == p then psi#(q,p) = BS#p
--if q< p then psi#(q,p) is a composition of
--a projection and a sequence of inclusions.
else if q<p then(
spl = psiS#p;
scan(reverse toList(q+1..p-1), j ->
spl = inc'S#(j,0)*spl);
psi#(q,p) = projS#(q,0)*spl
)
)));
--construct the triangular differential d:Asour --> Atar,
--first as a list of lists of matrices
Atar := directSum(apply(toList(1..c), p->target BS#p));
Asour := directSum(apply(toList(1..c), p->source BS#p));
LL := apply(toList(1..c),
q->apply(toList(1..c),
p->psi#(q,p)));
d := map(Atar, Asour, matrix LL);
--make homotopies h#p for ci#p on A1#p.
--BUG: tensoring with R#(p-1) destroys the cache of components
--of a direct sum, so
--define dpartial#p over S, to be
--the restriction of d to the first p summands.
scan(toList(1..c), p->(
dpartial#p = map(
target Atar^(toArray toList(0..p-1)),
source Asour_(toArray toList(0..p-1)),
Atar^(toArray toList(0..p-1))*
d*
Asour_(toArray toList(0..p-1)));
h#p = map(source dpartial#p,
tensorWithComponents(S^{ -degs#p},target dpartial#p),
substitute(
(R#(p-1)**(target dpartial#p**ci#p))//
(R#(p-1)**dpartial#p),
S));
--optionally check that dpartial and h have the right relationship
if opts#Check==true then(
if not isHomogeneous h#p
then error "homotopy not homogeneous";
if 0 != R#(p-1)**dpartial#p*h#p -
R#(p-1)**(target dpartial#p)**ci#p
then error "homotopy not good";
if 0!= R#(p-1)**(target h#p)^[p-1]*h#p*dpartial#p-
R#(p-1)**(target h#p)^[p-1]**ci#p
then error "homotopy on B not good";
)
));
Hhash := hashTable pairs h;
Hlist := apply(keys Hhash, i-> Hhash#i);
htar := target last Hlist;
Hlist1 := apply(#Hlist, m -> htar_(toArray toList(0..m))*Hlist_m);
h = Hlist1_0;
scan(#Hlist1 -1, i-> h=h|Hlist1_(i+1));
h = map(htar, directSum (Hlist1/source), h);
gamma := map(pushForward(map(R,S) M,target d, id_(target d)));
if opts.Check == true then assert(gamma*d == 0);
if opts.Augmentation == true then {d,h,gamma} else {d,h}
)
BRanks = method()
BRanks List := MF -> (
B0 := components target MF_0;
-- B0 := (target MF_0).cache.components;
B1 := components source MF_0;
-- B1 := (source MF_0).cache.components;
apply(#B0, i-> {rank B0_i, rank B1_i}
))
ARanks = method()
ARanks List := MF -> (
--list of pairs {rank A_0(p), rank A_1(p)} (=partial sums of the BRanks)
B := BRanks MF;
A := {B_0};
scan(#B-1, i-> A = A|{B_(i+1)+last A});
A)
--routines for taking apart d:
bMaps = method()
bMaps List := MF -> (
d := MF_0;
if #components target d == 1 then return {d};
apply(#BRanks MF, i-> (
(target d)^[i]*d*(source d)_[i]))
)
dMaps = method()
dMaps List := MF -> (
d := MF_0;
if #components target d === 1 then return {d};
apply(#BRanks MF, i-> (
(target d)^(toArray toList(0..i))*d*(source d)_(toArray toList(0..i))))
)
psiMaps = method()
psiMaps List := MF -> (
--psiMaps_p is the map B_1(p+1) -- A_0(p)
d := MF_0;
if #components target d === 1 then return {map(target d,(ring d)^0, 0)};
apply(#BRanks MF-1, i-> (
(target d)^(toArray toList(0..i))*d*(source d)_(toArray {i+1})))
)
hMaps = method()
hMaps List := mf-> (
--makes a list of the components of h, preserving the direct sum decompositions
--of the sources and targets of the components.
h := mf_1;
apply(#components source h,
p -> (
map(directSum ((components target h)_(toList(0..p))),
directSum(((components source h)/components)_p),
--(target h)^(toArray toList(0..p))*h*((source h)_[p]))))
h_[p]^(toArray toList(0..p)))))
)
-- the commented line was necessary when we had ^[ ] being frobeniusPower in our init.m2
///
restart
loadPackage("CompleteIntersectionResolutions", Reload =>true)
setRandomSeed 0
kk=ZZ/101
S = kk[a,b]
ff = matrix"a4,b4"
R = S/ideal ff
N = coker vars R
M = highSyzygy N
mf = matrixFactorization(ff, M)
(hMaps mf)_0
(hMaps mf)_1
///
ExtModuleData = method()
ExtModuleData Module := M -> (
--Suppose that M is a module over a complete intersection R
--of codim c, so that
--E := ExtModule M
--is a module generated in degrees >=0
--over a polynomial ring T
--generated in degree 2, and
--E0 := evenExtModule M and
--E1 := oddExtModule M
--are modules generated in degree >= 0
-- over a polynomial ring T' with generators
--in degree 1.
--
--The script returns
--{E0,E1,reg0,reg1}
--where regi = regularity Ei
--and prints a message if reg0 != reg1
--If we set r = max(2*reg0, 1+2*reg1),
--and F is a resolution of M, then
--coker F.dd_(r+1)
--is the first szygy module of M such that
--regularity evenExtModule M =0 AND
--regularity oddExtModule M =0
--We have been using regularity ExtModule M
--as a substitute for r,
--but that's not always the same.
E := ExtModule M;
P0 := positions(flatten degrees E, even);
P1 := positions(flatten degrees E, odd);
E0':=prune image (E_P0);
E1':=prune image (E_P1);
T' := ring E;
kk:= coefficientRing T';
X := symbol X;
T := kk[X_0..X_(numgens T' -1)];
v1 := map(T, T' ,vars T, DegreeMap => i->{(first i)//2});
E0 := coker v1 presentation E0';
E1 := coker v1 presentation E1';
r0 := max(0, regularity E0);
r1 := max(0, regularity E1);
--I've temporarily commented out the following because
--of the bug in Ext (12/29/12)
if abs(r0-r1)>1 then (
<<"regularities of even and odd Ext modules differ by more than 1" <<endl;
-- <<"module with presentation matrix" <<endl;
<<toString presentation M);
{E0,E1,r0,r1}
)
mfBound = method()
mfBound Module := M0 ->(
--gives (conjectural) bound for which syzygy
--of M0 will be a high syzygy
E := ExtModuleData M0;
max(2*E_2, 1+2*E_3)
)
highSyzygy = method(Options=>{Optimism => 0})
highSyzygy Module := opts -> M0 ->(
--with increment => 0 (the default) this gives our conjectural
--bound, which is best possible.
-- But if that's not good enough, use Optimism=>-1 etc
len := 1+mfBound M0-opts#Optimism;
F := res(M0, LengthLimit => len);
coker F.dd_len)
finiteBettiNumbers = method()
finiteBettiNumbers List := MF -> (
--MF should be the output of matrixFactorization
B := BRanks MF;
c := #B;
sourceRanks := B/last;
targetRanks := B/first;
apply(c+1, j->
sum(1..c,
i-> (targetRanks_(i-1)*binomial(i-1,j)+
sourceRanks_(i-1)*binomial(i-1,j-1))
))
)
infiniteBettiNumbers = method()
infiniteBettiNumbers (List,ZZ) := (MF,len) -> (
--MF should be the output of matrixFactorization
B := BRanks MF;
c := #B;
sourceRanks := B/last;
targetRanks := B/first;
apply(len+1, j->
if j%2 ==0 then
sum(1..c,
i-> (targetRanks_(i-1)*binomial(c-i+j//2,c-i)))
else
sum(1..c,
i-> (sourceRanks_(i-1)*binomial(c-i+(j-1)//2,c-i)))
)
)
--The following functions are used in makeHomotopies
expo = method()
expo(ZZ,ZZ) := (n,d) ->(
--the next three lines define a function that returns
--a list of all lists of n non-neg ints adding up to d.
if n <= 0 then return {};
x:=local x;
T := ZZ/2[x_0..x_(n-1)];
flatten((flatten entries basis(d, T^1))/exponents)
)
lessThan = (L1,L2) -> (
--returns true if L1<L2 in the termwise partial order
for i from 0 to #L1-1 do if L1#i>L2#i then return false;
if L1==L2 then return false
else return true)
expo(ZZ,List):= (n,L) ->(
if n <= 0 then return {};
--returns the list of all elements of expo(n,d) that
--are <L in the termwise partial order
d := sum L;
LL := flatten(for i from 0 to d-1 list expo(n,i));
select(LL, M->lessThan(M,L))
)
-*
makeHomotopies = method()
makeHomotopies (Matrix, ChainComplex) := (f,F) ->
makeHomotopies(f,F, max F)
makeHomotopies(Matrix, ChainComplex, ZZ) := (f,F,d) ->(
--given a 1 x lenf matrix f and a chain complex
-- F_min <-...,
--the script attempts to make a family of higher homotopies
--on F for the elements of f.
--The output is a hash table {{J,i}=>s), where
--J is a list of non-negative integers, of length = ncols f
--and s is a map F_i->F_(i+2|J|-1) satisfying the conditions
--s_0 = differential of F
-- s_0s_{i}+s_{i}s_0 = f_i
-- and, for each index list I with |I|<=d,
-- sum s_J s_K = 0, when the sum is over all J+K = I
S := ring f;
if source f == 0 then return hashTable{};
if numrows f != 1 then error"expected a 1 x ? matrix";
flist := flatten entries f;
lenf := #flist;
degs := apply(flist, fi -> degree fi); -- list of degrees (each is a list)
minF := min F;
maxF := max F;
if d>max F then d=maxF;
e0 := (expo(lenf,0))_0;
e1 := expo(lenf,1);
H := new MutableHashTable;
--make the 0 homotopies into F_minF;
for i from minF to d+1 do H#{e0,i} = F.dd_i;
scan(#flist, j->H#{e1_j,minF-1}= map(F_minF, F_(minF-1), 0));
--the rest of the first homotopies
for i from minF to d do
scan(#flist,
j->H#{e1_j,i}= (-H#{e1_j,i-1}*H#{e0,i}+flist_j*id_(F_i))//H#{e0,i+1}
);
--the higher homotopies
for k from 2 to d do(
e := expo(lenf,k);
apply(e, L ->(
k := sum L;
H#{L,minF-1}= map(F_(minF+2*k-2),F_(minF-1),0);
for i from minF to d-2*k+1 do
H#{L,i} = sum(expo(lenf,L),
M->(H#{L-M,i+2*sum(M)-1}*H#{M,i}))//H#{e0,i+2*k-1};
)));
--correct the degrees, and return a HashTable
H1 := hashTable apply(keys H, k->
{k, map(F_(k_1+2*sum (k_0)-1),
tensorWithComponents( S^{-sum(#k_0,i->(k_0)_i*degs_i)},F_(k_1)),
H#k)});
H1)
*-
makeHomotopies = method()
makeHomotopies (Matrix, ChainComplex) := (f,F) ->
makeHomotopies(f,F, max F)
makeHomotopies(Matrix, ChainComplex, ZZ) := (f,F,d) ->(
--given a 1 x lenf matrix f and a chain complex
-- F_min <-...,
--the script attempts to make a family of higher homotopies
--on F for the elements of f.
--The output is a hash table {{J,i}=>s), where
--J is a list of non-negative integers, of length = ncols f
--and s is a map F_i->F_(i+2|J|-1) satisfying the conditions
--s_0 = differential of F
-- s_0s_{i}+s_{i}s_0 = f_i
-- and, for each index list I with |I|<=d,
-- sum s_J s_K = 0, when the sum is over all J+K = I
S := ring f;
if source f == 0 then return hashTable{};
if numrows f != 1 then error"expected a 1 x ? matrix";
flist := flatten entries f;
lenf := #flist;
degs := apply(flist, fi -> degree fi); -- list of degrees (each is a list)
minF := min F;
maxF := max F;
if d>max F then d=maxF;
e0 := (expo(lenf,0))_0;
e1 := expo(lenf,1);
H := new MutableHashTable;
--make the 0 homotopies into F_minF;
for i from minF to d+1 do H#{e0,i} = F.dd_i;
scan(#flist, j->H#{e1_j,minF-1}= map(F_minF, F_(minF-1), 0));
--the rest of the first homotopies
for i from minF to d do
scan(#flist,
j->H#{e1_j,i}= (-H#{e1_j,i-1}*H#{e0,i}+flist_j*id_(F_i))//H#{e0,i+1}
);
--the higher homotopies
for k from 2 to d do(
e := expo(lenf,k);
apply(e, L ->(
k := sum L;
H#{L,minF-1}= map(F_(minF+2*k-2),F_(minF-1),0);
for i from minF to d-2*k+1 do
H#{L,i} = -sum(expo(lenf,L),
M->(H#{L-M,i+2*sum(M)-1}*H#{M,i}))//H#{e0,i+2*k-1};
)));
--correct the degrees, and return a HashTable
H1 := hashTable apply(keys H, k->
{k, map(F_(k_1+2*sum (k_0)-1),
tensorWithComponents( S^{-sum(#k_0,i->(k_0)_i*degs_i)},F_(k_1)),
H#k)});
H1)
makeHomotopies1 = method()
makeHomotopies1 (Matrix, ChainComplex) := (f,F) ->(
makeHomotopies1 (f,F, length F))
makeHomotopies1 (Matrix, ChainComplex, ZZ) := (f,F,b) ->(
--given a 1 x lenf matrix f and a chain complex
-- F_min <-...,
--the script attempts to make a family of first homotopies
--on F for the elements of f.
--The output is a hash table {{J,i}=>s), where
--J is an integer 0 <= J < lenf,
--min F <= i < b
--and s is a map F_i->F_(i+1) satisfying the conditions
-- ds_{i}+s_{i}d = f_i.
-- if the given b is > max F, then b is replaced by max F.
S := ring f;
flist := flatten entries f;
degs := apply(flist, fi -> degree fi); -- list of degrees (each is a list)
minF := min F;
maxF := max F;
if b>max F then b=maxF;
rem := 0;
h := null;
H := new MutableHashTable;
--make the initial homotopies from F_minF 0.
scan(#flist, j->H#{j,minF-1}= map(F_minF, F_(minF-1), 0));
--now compute the rest of the homotopies. Note that the grading is not yet right
for i from minF to b do
scan(#flist, j->(
(h,rem) =
quotientRemainder(-H#{j,i-1}*F.dd_i+flist_j*id_(F_i),
F.dd_(i+1));
if rem != 0 then (
<<"homotopy " <<{j,i} <<" doesn't exist."<<endl;
);
H#{j,i} = h));
--fix the grading and return a HashTable:
H1 := hashTable apply(keys H, k->
{k, map(F_(k_1+1),
tensorWithComponents(S^{-degs_(k_0)},F_(k_1)),
H#k)});
H1
)
makeHomotopiesOnHomology = method()
makeHomotopiesOnHomology (Matrix, ChainComplex) := (ff,C)->(
--returns a pair (H,h) whose first element is the hashTable of homology of C
--and whose second element is the hashTable of 1-step homotopies for ff
h0 := makeHomotopies1(ff,C);
homDegs := sort unique ((keys h0)/(k->k_1));
m := max homDegs;
H := hashTable({{m+1, HH_(m+1) C}} | apply(homDegs, i->{i, HH_i C}));
h := hashTable apply(keys h0, k->{k,
map(H#(k_1+1), H#(k_1),
(matrix h0#k//(generators H#(k_1+1)) *generators H#(k_1)))
});
(H,h)
)
exteriorHomologyModule = method()
exteriorHomologyModule(Matrix,ChainComplex) := (ff, C) ->(
-*
Assuming that the elements of the 1xc matrix ff are null-homotopic
on C, the script returns their direct sum as a module over
a new ring, consisting of ring C with c exterior variables adjoined.
*-
--Construct the homology of C and the action of the homotopies on it
(H,h) := makeHomotopiesOnHomology(ff,C);
--now make a ring "like ring C" but with some exterior variables.
S :=ring C;
kk := coefficientRing S;
numS := numgens S;
J := ideal S;
X := symbol X;
e := symbol e;
n := numgens S;
Sdegs := apply((degrees vars S)_1, i->{i_0,0});
c := rank source ff;
Edegs := apply((degrees ff)_1, i->{i_0,1});
SE0 := kk[X_0..X_(n-1),e_0..e_(c-1),
SkewCommutative=>toList(numS..numS+c-1),
Degrees =>Sdegs|Edegs];
S0 := (ring presentation S);
bringJ := map(SE0, S0, {X_0..X_(n-1)},DegreeMap=>i->{i_0,0});
SE := SE0/bringJ(J);
E := (vars SE)_{numS..numS+c-1};
F := apply(c, j->source E_{j});
--bring H,h over to SE with appropriate degrees (second degree = homological degree)
toSE := map(SE, S, toList(X_0..X_(numS-1)), DegreeMap=>i->{i_0,0});
HE := hashTable apply(keys H, k->
{k, SE^{{0,-k}}**subquotient(toSE generators H#k, toSE relations H#k)});
hE := hashTable (apply(keys h, hk-> {hk, map(HE#(hk_1+1), HE#(hk_1), toSE matrix h#hk)}));
phi := hashTable apply(keys h, k ->
{k, map(HE#(1+k_1),
F_(k_0)**HE#(k_1),
hE#k)
}
);
makeModule(HE,E,phi)
)
makeModule = method()
makeModule(HashTable, Matrix, HashTable) := (T,E,phi) ->(
-- in this version:
-- RE is a bigraded ring
-- E: \oplus RE^{d_i} \to RE^1 is a matrix of c variables from RE
-- T is a hashTable of m pairs {i, t_i}, where the t_i are RE-modules
-- phi is a hash-table of maps phi#{j,i}: t_i**F_j\to t_(i+1)
-- where F_j = source (E_j = matrix {{e_j}})
-- such that the maps
-- p#{j,i} = (E_j || -phi#{j,i}): t_i**F_j \to t_i++t_(i+1),
-- are homogeneous.
-- The script returns M = \oplus_i T_i
-- as an RE-module,
-- computed as the quotient of P := \oplus T_i
-- obtained by factoring out the sum of the images of the maps p#{j,i}
-- In our application, (T#i)_1 has second degree i.
sourceKeys := (sort unique (keys phi/(k->k_1)));
targetKeys := (sort unique (keys phi/(k->1+k_1)));
if length sourceKeys ==0 then return T#(min sourceKeys); -- handles case of only 1 module
Pkeys := {min targetKeys-1}|targetKeys;
m := length Pkeys;
c := rank source E;
P := directSum apply(Pkeys , i -> T#i);
fir := new Array from 0..m-2;
las := new Array from 1..m-1;
F := apply(c, j-> source E_{j});
Q := apply(c, j-> directSum apply(sourceKeys, i-> F_j**T#i));
f := apply(c, j ->
map(P, Q_j,
P_las * directSum apply(sourceKeys, i->phi#{j,i})
));
g := apply(c, j ->
map(P,Q_j,
P_fir*directSum apply(sourceKeys, i->E_{j}**T#i)
));
M := P/sum(apply (c, j->image(f_j-g_j)));
M
)
exteriorTorModule = method()
exteriorTorModule(Matrix, Module) := (f,M) -> (
--Write Tor_S(M,k) as a module over Tor(S/(f),k) = \wedge V:
--f is a matrix with entries that are homotopic to zero on F
--Typically, F is a resolution of a module annihilated by
--the entries of f.
S := ring M;
n := numgens S;
k := coefficientRing S;
F := complete res M;
H := makeHomotopies1(f,F);
e := symbol e;
E := k[e_0..e_(numcols f -1), SkewCommutative => true];
red := map(E,S, {n:0},DegreeMap=>d->{0});
--problem: the following indexes T starting with 0. But we shouldn't need it!
T := hashTable apply(toList(0..max F),i->{i,E^{ -i}**red F_i});
goodkeys := select(keys H, k->k_1>=0);
Hk := hashTable apply(goodkeys, h-> (h, red H#h));
--Hk(j,i) is the homotopy for f_j from F_i**k to F_(i+1)**k,
--defined for i from 0 to max F-1.
TE :=makeModule(T, vars E, Hk);
TE
)
exteriorTorModule(Matrix,Module,Module) := (ff,M,N) ->(
--M,N are modules in a ring S;
--ff is a sequence of elements in S that annihilate M and N;
--The script defines a new ring
--SE =kk[X_0..X_(n-1), e_0..e_c] mod the defining relations of S,
--with degree e_j = degree f_j.
--which is is an exterior algebra over S on c:=numcols ff generators e_0..e_(c-1),
--
--the script returns Tor^S(M,N) as an SE-module with structure induced
--by the homotopies of the resolution of the first factor; note that
--this is NOT symmetric in the two factors.
--NOTE:
--h0#{i,j} is the homotopy for f_i starting from the j-th step of the resolution.
Mres := res M;
complete Mres;
exteriorHomologyModule(ff, Mres**N)
)
exteriorExtModule = method()
exteriorExtModule(Matrix, Module) := (f,M) -> (
--dual of exteriorTorModule
E := exteriorTorModule(f, M);
omega := (ring E)^{numgens ring E};
Hom(E,omega))
exteriorExtModule(Matrix, Module, Module) := (ff, M,N)->(
--M,N are modules in a ring S;
--ff is a sequence of elements in S that annihilate M and N;
--The script defines a new ring
--SE =kk[X_0..X_(n-1), e_0..e_c] mod the defining relations of S,
--with degree e_j = degree f_j.
--which is is an exterior algebra over S on c:=numcols ff generators e_0..e_(c-1),
--
--the script returns Ext_S(M,N) as an SE-module with structure induced
--by the homotopies of the resolution of the first factor; note that
--this is NOT symmetric in the two factors.
--NOTE:
--h0#{i,j} is the homotopy for f_i starting from the j-th step of the resolution.
Mres := complete res M;
exteriorHomologyModule(ff, Hom(Mres,N))
)
isLinear = method()
isLinear(Matrix) := phi ->(
L := (flatten entries phi)/degree;
flag := true;
scan(flatten L, ell-> if ell>1 then (flag = false;break));
flag)
freeExteriorSummand = method()
freeExteriorSummand(Module) := M -> (
--M should be a module over an exterior algebra E.
--script finds a basis of M/(ann_M soc E).
E := ring M;
mm := ideal vars E;
soc := (ideal 0_E):mm;
nongens := (0_E*M):soc;
freegens := (basis (M/nongens))//inducedMap(M/nongens,M)
)
S2 = method()
S2(ZZ,Module) := Matrix => (b,M)-> (
--returns a map M --> M', where M' = \oplus_{d>=b} H^0(\tilde M).
--the map is equal to the S2-ification AT LEAST in degrees >=b.
S := ring M;
r:= regularity M;
if b>r+1 then return id_(truncate(b,M));
tbasis := basis(r+1-b,S^1); --(vars S)^[r-b];
t := map(S^1, module ideal tbasis, tbasis);
s:=Hom(t,M)
--could truncate source and target; but if we do it with
--the following line then we get subquotients AND AN ERROR!
-- inducedMap(truncate(b,target s),truncate(b,source s),s)
)
TateResolution = method()
TateResolution(Module,ZZ,ZZ) := (M,low,high) ->(
d := transpose ((res(M, LengthLimit => high)).dd_high);
F := res (coker d, LengthLimit =>(high-low+2));
complete F;
T := (chainComplex reverse apply(high-low+1, j->transpose (F.dd_j)))[-low];
T
)
TateResolution(Module,ZZ) := (M,b) -> TateResolution(M,b,b)
TateResolution(Module) := M-> TateResolution(M,-5,5)
------------
-*special purpose code
--
----- look for small examples
--This code searches for pairs of monomials of degree d
-- in the given ring (mod the c d-th powers of the variables)
--of complexity c (that is,
--dim Ext(R/(m1, m2),k)=c), and tallies the sequence of B ranks
--for a high syzygy of R/(m1,m2).
--Conclusion: in every one of these cases, the sequences
--{rank target B(i)} and {rank source B(i)} are *strictly increasing
--for i = 2..4 (and weakly increasing between i = 1,2.)
--also, the multiplicity is always 8, 12 or 17.
*-
twoMonomials = method(Options => {Optimism => 0})
twoMonomials(ZZ,ZZ) := opts-> (c,d)->(
Blist := null;
M0:=null;
MF:=null;
B:= null;
x := symbol x;
S := ZZ/101[x_0..x_(c-1)];
f := map(S^1, S^{c: -d}, (i,j) -> x_j^d);
ff := f*random(source f, source f);
R := S/ideal f;
L := flatten entries basis R;
for e from 2 to c*(d-1) do(
L1 := select(L, m -> (degree m)_0 == e);
--make all pairs
pL1 :=(unique flatten apply(L1, i-> apply(L1, j-> set(i,j))))/toList;
time Blist = apply(pL1, m -> (
M0 = R^1/ideal m;
--<< m << endl;
MF = matrixFactorization(ff, highSyzygy(opts, M0));
B = BRanks MF;
-- scan(c-1, j-> (
-- if last B_(j+1)-last(B_j)<0 then(
-- print m;
-- error();
-- )));
if B_0 != {0,0} then
{B,toList m}
else null
)
);
Blist = select(Blist, i-> i=!=null);
<< e <<endl;
<< tally(Blist/(k->k_0))<<endl;<<endl;
<<flush
)
)
--sumtwoMonomials(c,d)
--tallies the sequences of B-ranks that occur for sums of pairs of
--monomials in R = S/(d-th powers of the variables), with
--full complexity (=c); that is,
--for an appropriate syzygy M of
--M0 = R/(two monomials of the same degree)
sumTwoMonomials = method()
sumTwoMonomials(ZZ,ZZ) := (c,d) ->(
Blist := null;
M0:=null;
MF:=null;
B:= null;
x := symbol x;
S := ZZ/32003[x_0..x_(c-1)];
f := map(S^1, S^{c: -d}, (i,j) -> x_j^d);
ff := f*random(source f, source f);
R := S/ideal f;
L := flatten entries basis R;
for e from 2 to c*(d-1) do(
--make all pairs
L1 := select(L, m -> (degree m)_0 == e);
pL1 :=(unique flatten apply(L1, i-> apply(L1, j-> set(i,j))))/toList;
ppL1 := select(pL1, j->#j == 2);
time Blist = apply(ppL1, m -> (
M0 = R^1/ideal(m_0+m_1);
--<< m << endl;
MF = matrixFactorization(ff, highSyzygy M0);
B = BRanks MF;
scan(c-1, j-> (
if last B_(j+1)-last(B_j)<0 then(
print m;
error("example of decreasing source ranks");
)));
if B_0 != {0,0} then
{B,toList m}
else null
)
);
Blist = select(Blist, i-> i=!=null);
<< e <<endl;
<< tally(Blist/(k->k_0))<<endl;<<endl;
)
)
--helper routines for moduleAsExt
hfModuleAsExt = method()
hfModuleAsExt(ZZ, Module,ZZ) := (m,M,n) ->(
--compute what should be the total Betti numbers
--in the resolution of the module whose ext module
--is the tensor product of the
--exterior algebra on numgens ring M generators
--with M. Give m values (starting from
--numgens ring M + reg M).
rr := ring M;
reg := regularity M;
MM := minimalPresentation truncate(reg, M)**rr^{reg};
h := apply(m+n+1, j->hilbertFunction(j,MM));
n1 := if even n then n else n+1;
apply(n1//2+1..m,i-> if even(i) then
sum(n1//2+1, j->binomial(n,2*j)*h_(i//2-j))
else
sum(n1//2, j->binomial(n,2*j+1)*h_((i-1)//2-j)))
)
insertT = method()
insertT (Matrix, List) := (phi,Ti) -> (
--phi is a matrix of linear forms in vars x_1..x_c.
--Ti is a list of lists, each a
--1-rowed matrix of scalars over R
--corresponding to one of the x_i.
--replace each entry of phi by the
--appropriate linear combination of these matrices
--and the output is a matrix of scalars over R.
R := ring Ti_0;
v := vars ring phi;
n := numgens ring phi;
L := entries phi; -- list of lists of lin forms in Ops
matrix apply(#L, i ->
apply(#L_i,
j-> sum(n, k->(sub(diff(v, L_i_j),R))_{k}**Ti_k)))
);
moduleAsExt = method()
moduleAsExt(Module,Ring) := (M,R) ->(
--caveat: if the CI defining R has gens of varying degrees, then
--the result of this routine would not be homogeneous. The script will
--return an error. However, we could deal with the local case -- saved for the future.
--the problem is that the CI operators have different internal
--degrees, so when we replace a matrix of linear forms over Ops with the
--CI operators over R, it may not be possible to make the degrees consistent.
n := numgens R;
rr := ring M;
c := numgens rr;
ff := presentation R;
-- get degree d of first entry of the
-- complete intersection defining rr
d := (degrees source ff)_0_0;
scan(flatten (degrees ff)_1,
e -> if e !=d then
error"all degrees of the CI need to be equal");
reg := regularity M;
--truncate M at the regularity to get MM
MM := minimalPresentation truncate(1+reg, M)**rr^{reg};
F := res MM;
m := length F;
--now prepare the CI operators as maps of resolutions
K := res(coker vars R, LengthLimit => m+1);
T1 := apply (m, i->makeT(ff, K, 2+i));
T := apply (m, i->apply(c, j->
map(K_i,
R^{d}**K_(i+2),
T1_i_j)));
--T_i_j: is the matrix of the CI map K_(2+i) \to K_i
--corresponding to ff_j.
V := apply(m+1, i->R^(rank F_i));
tar := directSum apply(m+1, i->(
R^{ d*(m-i)}**V_i**K_(m-i)));
sour := directSum apply(m+1, i->(
R^{ d*(m-i)}**V_i**K_(m-i+1)));
--the part of the differential made from the differential of K
d1 := sum apply(m+1, i->
(tar_[i])*(R^{ d*(m-i)}**V_i**K.dd_(m-i+1))*(sour^[i]));
--the part made by substituting T's for vars of rr
phi := symbol phi;
psi := symbol psi;
gamma := symbol gamma;
gamma1 := symbol gamma1;
d2 := sum apply(m, i->(
phi = transpose (F.dd_(i+1));
gamma1 = insertT (phi,T_(m-i-1));
gamma = map(R^{d*(m-i-1)}**V_(i+1)**(K_(m-i-1)),
R^{d*(m-i)}**V_i**(K_(m-i+1)),
gamma1);
psi = gamma;
tar_[i+1] * psi * sour^[i]));
assert isHomogeneous(d1+d2);
prune coker(d1+d2))
koszulExtension = method()
koszulExtension(ChainComplex,ChainComplex,Matrix,Matrix) := (FF, BB, psi1, ff) ->(
--with BB a two-term complex B_1-->B_0 and FF a resolution
--of a module annihilated by ideal ff, and
--psi1: B_1-->F_0,
--the script produces the extension map
--KK(ff)**B[1] --> F
--and returns the cone on this map.
S := ring ff;
KK := koszul ff;
--first make the Koszul extension from the complex BB1: FF_0 --> 0
BB1 := chainComplex map(S^0,FF_0,0);
phi11 := map (FF_0, (KK**BB1)_1,id_(FF_0)|map(FF_0,KK_1**BB1_0,0));
psi11 := extend(FF, KK**BB1[1], id_(FF_0));
--then compose with KK tensored with the map BB[1] --> BB1[1]
phi := map(BB1[1],BB[1],i-> (if i ==-1 then 0;if i==0 then psi1));
psi := psi11*(KK**phi);
cone psi
)
makeFiniteResolution = method()
makeFiniteResolution(Matrix, List) := (ff,MF) -> (
S := ring MF_0;
B := bMaps MF;
psi := psiMaps MF;
c' := complexity MF; -- the old version of the complexity was one less.
c := rank source ff; -- the codim
R := S/ideal(ff_{0..(c-c'-1)}); -- codim c-c'
--ring over which the finite resolution first occurs.
toR := map(R,S);
A := chainComplex toR B_(0);
scan(c'-1, p ->
A = koszulExtension(
A,chainComplex toR B_(p+1), toR psi_(p), toR ff_{(c-c')..(c-c'+p)}));
scan(length A-1, i-> if( prune HH_(i+1) A) != 0 then error"A not acyclic");
A
)
makeFiniteResolutionCodim2 = method(Options => {Check => false})
makeFiniteResolutionCodim2(Matrix,List) := opts -> (ff,MF) -> (
--given a codim 2 matrix factorization, makes all the maps
--that are relevant, as in 4.2.3 of Eisenbud-Peeva
--"Minimal Free Resolutions and Higher Matrix Factorizations"
c := rank source ff; -- the codim
if c !=2 then error"requires a codim 2 complete intersection";
S := ring MF_0;
bb := bMaps MF;
ps := psiMaps MF;
h := hMaps MF;
--problem: h_0 ought, I think to be a homotopy for bb_0:B11-->B01, and it's not.
--somehow the "makeFiniteResolution code escapes this problem. How??
c' := complexity MF; -- the complexity
if c'<2 then return {MF_0,MF_1};
--from here on c=c'=2, and we build the maps over S
--write Bsp for B_s(p)
B01 := target bb_0;
B02 := target bb_1;
B11 := source bb_0;
B12 := source bb_1;
f1 := (entries ff)_0_0 ;-- first elt of the reg seq
f2 := (entries ff)_0_1 ;-- second elt of the reg seq
deg1 := (degree f1)_0 ;
B02' := S^{ -deg1}**B02;
B12' := S^{ -deg1}**B12;
--next two lines are really cosmetic
B13 := B02';
B23 := B12';
F0 := B01++B02;
F1 := directSum{B11,B12,B13};
F2 := B23;
F3 := S^0;
hh0 := h_0;
hh1' := h_1;
d1 := map(F0,F1,(bb_0 | ps_0 | map(B01,B02',0)) || (map(B02,B11,0)| bb_1 | f1*map(B02,B02',1)));
d2 := map(F1,F2, map(B11,B12', h_0*ps_0) || -f1*map(B12,B12',1) || (S^{ -deg1}**bb_1));
d3 := map(F2,F3,0);
F := chainComplex{d1,d2,d3};
--check homology
if opts.Check == true then (
apply(length F, i->(
if prune (HH_(i+1) F) != 0 then
( << "complex has homology at step " << i+1 <<endl;
error()))));
homot := makeHomotopies1(ff, F);
--note that the following are various components of homotopies related to f2!
hf1 := homot#{1,0};
hf2 := homot#{1,1};
hh1 := hf1^[0,1];
vv1 := homot#{1,1};
vv := vv1_[0];
out := hashTable{"resolution" => F,
"partial" => bb_0,
"b" => bb_1,
"mu" => hh0,
"h1" => hh1,
"h1'" =>hh1',
"alpha" => hh1_[0]^[0],
"tau" => hh1_[1]^[0],
"sigma" => hh1_[1]^[1],
"u" => -hf1_[0]^[2],
"v" => vv,
"psi" => ps_0,
"X" => -hf1_[1]^[2],
"Y" => hf2_[1]
};
--make sure the formula for the f1 homotopy works:
hconst := {
map(F_1,S^{ -deg1}**F_0,
(map(B11,B01,out#"alpha") | map(B11,B02, out#"tau")) ||
(map(B12,B01,out#"v"*out#"mu") | map(B12,B02, out#"sigma"))||
(map(B13,B01,-out#"u") | map(B13,B02, -out#"X"))
),
map(S^{deg1}**F_2, F_1, out#"v" | out#"Y" | out#"sigma")
};
if opts.Check == true then(
assert(F.dd_1*hconst_0 == map(F0, S^{ -deg1}**F_0, f2*id_(F_0)));
assert(hconst_0*F.dd_1+F.dd_2*hconst_1 == f2*id_(F_1));
assert(hconst_1*F.dd_2 == map(S^{deg1}**F_2, F_2, f2*id_(F_2)));
if hh1 !=hh1' then
<<"Note that h1 != h1' (homotopies for ff_0)"<<endl);
out
)
///
restart
loadPackage("CompleteIntersectionResolutions", Reload=>true)
n= 2
x = symbol x;
S = ZZ/101[x_0..x_(n-1)]
ff = matrix{apply(gens S, a->a^3)}
R = S/ideal ff
pRS = map(R,S)
R1 = S/ideal(ff_{0})
p1 = map(R,R1)
(alpha, beta) = approximation(coker vars R1)
pushForward(map(R1,S),source alpha)
target alpha
target beta
F = (layeredResolution(ff, coker vars S))_0
apply(length F+1, i-> prune HH_i F)
lmf = lmfa (ff, coker vars R)
makeFiniteResolution(ff,lmf)
makeFiniteResolutionCodim2(ff, lmf, Check=>true)
///
complexity = method()
--complexity of a module over a CI ring
complexity Module := M-> dim evenExtModule M
complexity List := mf -> (
br := BRanks mf;
-- L := select(br, pair->pair_0!=0);
L := select(br, pair->pair_1!=0);
#L)
BGGL = (P,S) ->(
--given an exterior module P,
--returns the linear complex L(P)
E := ring P;
fake := map(S,E,vars S);
B := basis P;
dlist := flatten degrees source B;
dmin := min dlist;
dmax := max dlist;
Blist := apply(toList(dmin..dmax), i-> basis(i,P));
maplist1 := apply(dmax-dmin,j->
fake(((Blist_j)**vars E)//Blist_(j+1))*(sub(source Blist_j,S)**
transpose vars S
)
);
maplist := apply(dmax-dmin, i->
map(S^{rank source Blist_(i+1):i+1},
S^{rank source Blist_i:i},
maplist1_i));
(chainComplex reverse maplist)[dmax]**S^{dmin}
)
extVsCohomology = method()
extVsCohomology(Matrix, Module) := (ff,N) ->(
--N is an R=S/(ff)-module
--M is a high syzy of N
--compares the coho tables of the even and odd parts of Ext(M,k)
--with the tate resolution of Ext_S(M,k) as a module
--over the exterior alg.
S:= ring ff;
p := map(ring N,S);
M := N; --highSyzygy N;
MS := pushForward(p,M);
Ee := evenExtModule M;
Eo := oddExtModule M;
exter := ring Ee;
E := exteriorExtModule(ff,MS);
T := exteriorTorModule(ff,MS);
TE := (betti (S^{-5})[6])**betti TateResolution(E,-5,5);
TEe := (cohomologyTable(presentation (Ee), ring E,-5,5));
TEo:= cohomologyTable(presentation (Eo), ring E,-5,5);
<<"Tate Resolution of Ext_S(M,k) as exterior module:"<<endl;
<<"Note that maps go left to right"<<endl;
<<TE<<endl;
<<"---"<<endl;
<<"Cohomology table of evenExtModule M:"<<endl;
<<TEe<<endl;
<<"---"<<endl;
<<"Cohomology table of oddExtModule M:"<<endl;
<<TEo<<endl;
(E,T))
extIsOnePolynomial = method()
extIsOnePolynomial Module := M ->(
Ee := evenExtModule M;
Eo := oddExtModule M;
pe := hilbertPolynomial(Ee, Projective => false);
po := hilbertPolynomial(Eo, Projective => false);
z := local z;
U := QQ[z];
V := ring pe;
s := map(U,V,{U_0});
pe = s pe;
po = s po;
H := sub(pe, {z =>z/2});
(H, H == sub(po, {z =>z/2-1/2}))
)
--make the Eisenbud-Shamash resolution as a Z/2 graded differential
--module over the polynomial ring.
EisenbudShamashTotal = method(Options => {Check =>false,
Variables=>getSymbol "s",
Grading =>2}
)
EisenbudShamashTotal Module := o -> Mbar -> (
--setup
Rbar := ring Mbar;
ff := presentation Rbar;
c := numcols ff;
if o.Check == true then (
assert(codim ideal ff == c)
);
R := ring ff;
kk := coefficientRing R;
n := numgens R;
bar := map(Rbar,R);
RM := pushForward(bar, Mbar); -- M as R-module
RF := res RM;
if o.Check == true then (
assert(isHomogeneous RM and (RF)_(n+1) == 0)
);
H := makeHomotopies(ff, RF);
H' := hashTable select(pairs H, p-> p_1 !=0);--recall:
H = H';
--H#{J,i}: F_i(-degs_J) -> F_(i+2|J|-1),
--where J is a list of c pos ints and
--degs_J is the sum of the degrees of f_j, j\in J
--assert(source H#{{0,1},1} == F_1** R^{-2})
--move to a bigraded ring with variables corresponding to the
--CI operators
s := o.Variables;
S := kk[s_0..s_(c-1),gens R, Degrees =>
apply(c, i->{-2, -(degree ff_i)_0})|apply(n, i->{0, (degree R_i)_0})];
RtoS := map(S,R,DegreeMap => i->{0,i_0});
SF := chainComplex apply(length RF, i->
map (
S^{{-i,0}}**RtoS (RF_i),
S^{{-i-1,0}}**RtoS RF_(i+1),
RtoS (RF.dd_(i+1)),
Degree => {-1,0}
)
);
if o.Check == true then (
assert(isHomogeneous SF)
);
--a subroutine
monomialFromExponent := L -> product apply(#L,i->S_(i)^(L_i)) ;
SH := hashTable apply(pairs H, u->(
u_0,map(SF_(u_0_1+2*sum(u_0_0)-1),
SF_(u_0_1),
-- -1^(sum u_0_0-1)*(monomialFromExponent u_0_0)*RtoS H#(u_0),
(monomialFromExponent u_0_0)*RtoS H#(u_0),
Degree => {-1,0})));
if o.Check == true then (
assert all(values SH, phi-> isHomogeneous phi)
);
--Separate the homotopies into subsets:
--ke_i are keys {J,j} in H
--corresponding to possible homotopies whose *target* is F_i.
ke := apply(length SF + 1, i->select(keys SH, k -> (
k_1 === i - 2*sum k_0 + 1 and
0 <= min (i, k_1) and
length SF >= max (i,k_1))));
--dualize and separate the free modules of SF into even and odd parts:
SF0 := directSum apply (select(0..length SF, i->i%2==0), i-> dual SF_i);
SF1 := directSum apply (select(0..length SF, i->i%2==1), i-> dual SF_i);
p := null;
--make the maps
evenToOdd := apply((length SF+2)//2, -- 3 in the example
(i-> apply(ke_(2*i), u -> (
p = dual map(SF_(2*i), SF_(u_1), SH#{u_0,u_1});
SF1_[(u_1-1)//2]*p*SF0^[i]
))));
if o.Check == true then (
assert all(flatten evenToOdd, phi -> isHomogeneous phi)
);
oddToEven := apply((length SF+1)//2,
(i-> apply(ke_(2*i+1), u -> ( --the interesting key is {{1,1},1}
p = dual map(SF_(2*i+1), SF_(u_1), SH#{u_0,u_1});
SF0_[u_1//2]*p*SF1^[i]
))));
if o.Check == true then assert(
all (flatten evenToOdd |flatten oddToEven, phi -> isHomogeneous phi == true)
);
--the following maps would have degree {-1,0}
--d0 := map(SF1,SF0,sum flatten evenToOdd);
--d1 := map(SF0,SF1,sum flatten oddToEven);
--fix the degrees to make them {0,0}, keeping SF0 in degree 0:
d0 := map(S^{{-1,0}}**SF1,SF0,sum flatten evenToOdd, Degree =>{0,0});
d1 := map(SF0,SF1**S^{{1,0}},sum flatten oddToEven, Degree=>{0,0});
if o.Check == true then(
assert (target d1 == source d0);
-- and homology(d0**N,d1**N) is the even part of Ext(Mbar,N)
assert (target d0 == S^{{-2,0}}**source d1);
-- and S^{{1,0}}**homology(S^{{-2,0}}**d1**N,d0**N) is the odd part.
);
if o.Grading == 2 then return (d0,d1); --Grading => 2 is the default.
--if o.Grading !=2, reduce to singly graded maps
S1 := kk[gens S, Degrees => apply(numcols ff, i->-degree ff_i)|gens R/degree];
red := map(S1,S,DegreeMap => d->{d_1});
(red d0, red d1)
)
///
--a series of examples we used to test EisenbudShamashTotal
restart
loadPackage ("CompleteIntersectionResolutions", Reload=>true)
kk = ZZ/101
--simple example to get the degrees of Ext right
U = kk[a]
gg = matrix"a3"
Ubar = U/ideal gg
Mbar = coker vars Ubar
---simplest matrix factorization example in 2 vars
U = kk[a,b]
gg = matrix"a2+2ab+3b2"
Ubar = U/ideal gg
Mbar = image vars Ubar
--- simplest example with a higher homotopy (key {{1,1},1})
U = kk[a,b,c,d]
gg = matrix"a4,b4"
Ubar = U/ideal gg
use Ubar
Mbar = coker matrix"ab,b2,bc,bd,cd,"--has a 1,1 homotopy
---complete intersection of two quadrics in PP^3
U = kk[a,b,c,d]
gg = matrix"a2,b2"
Ubar = U/ideal gg
use Ubar
Mbar = coker matrix"ab,bc,bd,cd"
--more complicated module
setRandomSeed 0
U = kk[x_0..x_2]
I = ideal apply(2, i->x_i^2)
gg = gens I
Ubar = U/I
bar = map(Ubar, U)
Mbar = prune coker random(Ubar^2, Ubar^{-2,-3})
newExt(Mbar, coker vars Ubar, Check=>true, Lift =>true)
--
(d0,d1)= EisenbudShamashTotal (Mbar, Check=>true, Variables => getSymbol "X", Grading => 1)
(d0,d1)= EisenbudShamashTotal (Mbar, Check=>true, Grading => 2)
--(d0,d1)= EisenbudShamashTotal Mbar
S = ring d0
gens S
(gens S)/degree
UtoS = map(S,U,DegreeMap => d ->prepend(0,d))
assert(target d1 == source d0)
assert(target d0 == S^{{-2,0}}**source d1)
sg = sum(numcols gg, i->S_i*UtoS gg_i_0)
assert (0==d1*d0-diagonalMatrix toList(numrows d1:sg) )
Sbar= S/ideal UtoS gg
UbartoSbar= map(Sbar,Ubar,DegreeMap => d->prepend(0,d))
kSbar = coker UbartoSbar(vars Ubar)
bar = map(Sbar,S)
d1bar = bar d1
d0bar = bar d0
isHomogeneous(Heven = homology(d0bar**kSbar,d1bar**kSbar))
isHomogeneous(Hodd = homology(S^{{-2,0}}**d1bar**kSbar,d0bar**kSbar))
E1 = Sbar^{{1,0}}**prune Hodd
E0 = prune Heven
E = Ext(Mbar,coker vars Ubar)
assert (sort(degrees E0 |degrees E1)==sort degrees E)
isHomogeneous(Heven = homology(d0bar,d1bar))
isHomogeneous(Hodd = homology(S^{{-2,0}}**d1bar,d0bar))
E1 = Sbar^{{1,0}}**prune Hodd
E0 = prune Heven
E = prune Ext(Mbar,Ubar^1)
assert (sort(degrees E0 |degrees E1)==sort degrees E)
UbartoSbar = map(Sbar, Ubar, DegreeMap=>d->prepend(0,d))
SMbar = coker UbartoSbar presentation Mbar
isHomogeneous(Heven = homology(d0bar**SMbar,d1bar**SMbar))
isHomogeneous(Hodd = homology(S^{{-2,0}}**d1bar**SMbar,d0bar**SMbar))
E1 = Sbar^{{1,0}}**prune Hodd
E0 = prune Heven
E = prune Ext(Mbar,Mbar)
assert (sort(degrees E0 |degrees E1)==sort degrees E)
///
///
uninstallPackage"CompleteIntersectionResolutions"
restart
installPackage "CompleteIntersectionResolutions"
check "CompleteIntersectionResolutions"
///
newExt = method(Options =>
{Lift => false,
Check => false,
Grading => 2,
Variables=>getSymbol "s"}
)
newExt(Module,Module) :=o -> (Mbar,Nbar) -> (
--check that the circumstances are ok:
if not ring Mbar === ring Nbar then error"Expected modules over the same ring";
if not (isHomogeneous Mbar and isHomogeneous Nbar) then error"expected homogeneous modules";
p := presentation ring Mbar;
if not numcols p == codim ideal p then error"Expected modules over a complete intersection";
(d0,d1) := EisenbudShamashTotal (Mbar,
Grading => o.Grading,
Variables =>o.Variables,
Check=>o.Check);
Rbar := ring Mbar;
R := ring presentation Rbar;
I := ideal presentation Rbar;
--now do Ext(Mbar,K) our way:
S := ring d0;
RtoS := map(S,R, DegreeMap => d->prepend(0,d));
Sbar := S/(RtoS I);
RbartoSbar := map(Sbar,Rbar, DegreeMap => d->prepend(0,d));
SbarNbar := coker RbartoSbar presentation Nbar;
E := prune (
HH_1 chainComplex {d0**SbarNbar, d1**SbarNbar}++
Sbar^{{1,0}}**HH_1 chainComplex {Sbar^{{-2,0}}**d1**SbarNbar, d0**SbarNbar}
);
if o.Check == true then(
EE := Ext(Mbar,Nbar);
S' := ring EE; -- note that S' is the polynomial ring
StoSbar := map(Sbar,S);
ES := prune pushForward(StoSbar, E);
A := res ES;
B := res EE;
assert all(length A+1, i-> sort degrees A_i == sort degrees B_i)
);
--and optionally move it back to the polynomial ring
if o.Lift == true then(
StoSbar = map(Sbar,S);
ES = prune pushForward(StoSbar, E);
return ES;
);
E)
-----------------------------
--------Documentation-----------documentation--DOCUMENT
--------------------------------
--<<docTemplate
-*
restart
loadPackage ("CompleteIntersectionResolutions", Reload=>true)
uninstallPackage "CompleteIntersectionResolutions"
installPackage "CompleteIntersectionResolutions"
viewHelp "CompleteIntersectionResolutions"
viewHelp EisenbudShamashTotal
check "CompleteIntersectionResolutions"
*-
beginDocumentation()
doc///
Key
CompleteIntersectionResolutions
Headline
"Resolution over a Complete Intersection"
Description
Text
The resolution of a module over a hypersurface ring
(graded or local) is always periodic of period at most 2
(Eisenbud, "Homological Algebra Over A Complete Intersection",
Trans. Am. Math. Soc. 260 (1980) 35--64),
but the asymptotic structure of minimal resolutions over a
complete intersection is a topic of active research.
Most of our routines for constructing resolutions over complete intersections
work with a polynomial ring S and a complete
intersection R = S/(ideal ff), where
$$
ff = matrix\{\{f_1,\dots,f_c\}\}
$$
is a 1-rowed
matrix whose entries are (sufficiently general) generators
of a complete intersection ideal, usually all of the same degree.
Text
The new ideas implemented in this package come from the following sources:
"Minimal free resolutions over complete intersections"
by David Eisenbud and Irena Peeva (2016).
Lecture Notes in Mathematics, 2152.
Springer, Cham, 2016. x+107 pp. ISBN: 978-3-319-26436-3; 978-3-319-26437-0),
arXiv:1306.2615
"Layered Resolutions of Maximal Cohen-Macaulay modules"
by David Eisenbud and Irena Peeva (preprint)
"Tor as a module over an exterior algebra"
by David Eisenbud, Irena Peeva, and Frank-Olaf Schreyer (preprint).
The routines fall into several groups:
--
Text
@SUBSECTION "Routines to analyze Ext_R(M,k) as a module over the ring of operators"@
Text
@UL {
{TO "ExtModule"},
{TO "evenExtModule"},
{TO "oddExtModule"},
{TO "ExtModuleData"},
{TO "complexity"},
{TO "newExt"}
}@
Text
@SUBSECTION "Representing a module as Ext_R(M,k)"@
Text
@UL {
{TO "moduleAsExt"},
{TO "hfModuleAsExt"}
}@
Text
@SUBSECTION "Routines Related to Particular Conjectures"@
Text
@UL {
{TO "regularitySequence"},
{TO "extIsOnePolynomial"}
}@
Text
@SUBSECTION "Routines that make resolutions of various kinds"@
Text
@UL {
{TO "TateResolution"},
{TO "Shamash"},
{TO "EisenbudShamash"},
{TO "EisenbudShamashTotal"},
{TO "layeredResolution"},
{TO "makeFiniteResolution"},
{TO "makeFiniteResolutionCodim2"},
}@
Text
@SUBSECTION "Tools for construction of higher matrix factorizations"@
Text
@UL {
{TO "matrixFactorization"},
{TO "highSyzygy"},
{TO "koszulExtension"},
{TO "makeT"}
}@
Text
@SUBSECTION "Tools to unpack the info in higher matrix factorizations"@
Text
@UL {
{TO "BRanks"},
{TO "ARanks"},
{TO "bMaps"},
{TO "dMaps"},
{TO "psiMaps"},
{TO "hMaps"},
{TO "mfBound"},
{TO "finiteBettiNumbers"},
{TO "infiniteBettiNumbers"}
}@
Text
@SUBSECTION "Ext_S(M,k), Tor^S(M,k), homology and linear resolutions as modules over the exterior algebra"@
Text
@UL {
{TO "exteriorExtModule"},
{TO "exteriorTorModule"},
{TO "exteriorHomologyModule"},
{TO "BGGL"},
{TO "extVsCohomology"},
{TO "freeExteriorSummand"}
}@
Text
@SUBSECTION "Routines for general module theory"@
Text
@UL {
{TO "S2"},
{TO "isQuasiRegular"},
{TO "stableHom"},
{TO "isStablyTrivial"},
{TO "makeModule"},
{TO "isLinear"}
}@
Text
@SUBSECTION "Utilities"@
Text
@UL {
{TO "cosyzygyRes"},
{TO "dualWithComponents"},
{TO "HomWithComponents"},
{TO "tensorWithComponents"},
{TO "toArray"},
{TO "expo"}
}@
Text
@SUBSECTION "Some families of Examples"@
Text
@UL {
{TO "twoMonomials"},
{TO "sumTwoMonomials"}
}@
Text
The construction of the
matrix factorizations for high syzygies of a module N,
introduced in the
paper
"Matrix Factorizations in Higher Codimension"
by Eisenbud and Peeva. The routine ``mfBound'' determines
which syzygy to take.
The routine matrixFactorization constructs
the higher matrix factorization
of a module over R defined by Eisenbud and Peeva in the 2016 Springer Lecture Notes
``Minimal Free Resolutions over Complete Intersections''.
The ranks of the stack of matrices b_p that are used
in the construction of the matrix factorization, and the various matrices
themselves, are obtained from the routines BRanks, ARanks, bMaps, dMaps, psiMaps, hMaps
(the notation is explained in the Lecture Notes).
Here is an example of a matrix factorization in codimension 2:
Example
setRandomSeed 0
c = 2;
S = ZZ/101[x_1..x_c, a_(1,1)..a_(c,c)];
X = matrix{{x_1..x_c}};
ff = X*map(source X, , genericMatrix(S,a_(1,1),c,c));
R = S/ideal ff;
mbound = mfBound coker (R**X)
F = res(coker (R**X) , LengthLimit =>mbound+1);
M = coker F.dd_(mbound+1);
MF = matrixFactorization(ff,M)
netList BRanks MF
netList ARanks MF
netList bMaps MF
netList dMaps MF
netList psiMaps MF
netList hMaps MF
Text
The routines infiniteBettiNumbers and finiteBettiNumbers compute the Betti numbers of
M over R and over S from the BRanks. The minimal free
resolution of M as a module over R/(f_1..f_s), where
s=c-complexity M, is reconstructed (in a special form)
from the matrix factorization MF by the routine
makeFiniteResolution(ff,MF).
Example
betti res M
infiniteBettiNumbers(MF,7)
betti res pushForward(map(R,S),M)
finiteBettiNumbers MF
G = makeFiniteResolution (ff,MF)
G' = res(pushForward(map(R,S),M))
Text
The group of routines ExtModule, evenExtModule, oddExtmodule,
extModuleData (which call the routine
Ext(M,N) of Avramov-Grayson) are useful for analyzing the
module Ext_R(M,k). TateResolution returns
a specified part of the Tate resolution of a
maximal Cohen-Macaulay module M
first calling the routine cosyzygy.
The routines moduleAsExt and hfModuleAsExt give
partial converse constructions (following Avramov-Jorgensen)
The routines twoMonomials and sumTwoMonomials provide some
interesting examples.
The routine makeT constructs CI operators on a resolution
over a complete intersection, while the routine makeHomotopies
constructs a set of higher homotopies on the resolution
of a module M for a sequence of
elements in the annihilator of M(makeHomotopies1 constructs
just the ordinare ``first'' homotopies).
The routine exteriorTorModule constructs the module $Tor^S(M,k)$
as a module over the exterior algebra $\wedge(k^n)$.
The routine S2 takes a graded module M and returns the map
$$
M -> \oplus_{-p}^\infty H^0(sheaf M(p)).
$$
Caveat
Unless the complete intersection is homogeneous
AND generated by elements of a single degree,
it may not be possible to choose sufficiently general HOMOGENEOUS generators
for some of our construction routines to work,
even when the ideal of the complete intersection is homogeneous, so our examples
in the routines for are primarily using complete intersections of equal degree.
The theory takes place in the local case, however, where this is not a problem.
///
doc ///
Key
newExt
(newExt,Module,Module)
[newExt, Check]
[newExt, Lift]
[newExt,Grading]
[newExt,Variables]
Headline
Global Ext for modules over a complete Intersection
Usage
E = newExt(M,N)
Inputs
M:Module
over a complete intersection Rbar
N:Module
over Rbar
Outputs
E:Module
over a ring S made from ring presentation Rbar with codim Rbar new variables
Description
Text
Let Rbar = R/(f1..fc), a complete intersection of codimension c, and let M,N
be Rbar-modules. We assume that the pushForward of M to R has finite free resolution.
The script then computes the total Ext(M,N) as a module over
S = kk(s_1..s_c,gens R), using EisenbudShamashTotal.
If Check => true, then the result is compared with the built-in global Ext written
by Avramov and Grayson (but note the difference, explained below).
If Lift => false the result is returned over and extension of Rbar; if Lift => true
the result is returned over and extension of R.
If Grading => 2, the default, then the result is bigraded (this is necessary when
Check=>true
The default Variables => symbol "s" gives the new variables the name s_i, i=0..c-1.
(note that the builtin Ext uses X_1..X_c.
On Some examples newExt is faster than Ext;
on others it's slower.
A simple example: if R = k[x_1..x_n] and I is contained in the cube
of the maximal ideal, then Ext(k,k) is a free
S/(x_1..x_n) = k[s_0..s_(c-1)]- module with binomial(n,i) generators in degree i
Example
n = 3;c=2;
R = ZZ/101[x_0..x_(n-1)]
Rbar = R/(ideal apply(c, i-> R_i^3))
Mbar = Nbar = coker vars Rbar
E = newExt(Mbar,Nbar)
tally degrees E
annihilator E
Text
An example where the built-n global Ext is hard to compare directly
with our method of computation: I *guess* that the sign choices in the built-in
amount essentially to a change of variable
in the new variables, and spoil an easy comparison.
But for example the bi-graded betti numbers are equal.
this seems to start with c=3.
Example
setRandomSeed 0
n = 3
c = 3
kk = ZZ/101
R = kk[x_0..x_(n-1)]
I = ideal apply(c, i->R_i^2)
ff = gens I
Rbar = R/I
bar = map(Rbar, R)
K = coker vars Rbar
Mbar = prune coker random(Rbar^2, Rbar^{-2,-2})
ES = newExt(Mbar,K,Lift => true)
S = ring ES
Text
compare with the built-in Ext
Example
EE = Ext(Mbar,K);
S' = ring EE -- note that S' is the polynomial ring
Text
The two verstions of Ext appear to be the same up to change of variables:
Example
A = res ES
B = res EE
all(length A+1, i-> sort degrees A_i == sort degrees B_i)
Text
but they have apparently different annihilators
Example
ann EE
ann ES
Text
and in fact they are not isomorphic:
Example
EEtoES = map(ring ES,ring EE, gens ring ES)
EE' = coker EEtoES presentation EE
H = Hom(EE',ES);
Q = positions(degrees target presentation H, i-> i == {0,0})
f = sum(Q, p-> random (S^1, S^1)**homomorphism H_{p})
Text
If EE and ES were isomorphic, we would expect coker f to be 0, and it's not.
prune coker f
SeeAlso
Ext
EisenbudShamashTotal
///
doc///
Key
regularitySequence
(regularitySequence, List,Module)
Headline
regularity of Ext modules for a sequence of MCM approximations
Usage
L = regularitySequence (R,M)
Inputs
R:List
list of rings R_i = S/(f_0..f_{(i-1)}), complete intersections
M:Module
module over R_c where c = length R - 1.
Outputs
L:List
List of pairs {regularity evenExtModule M_i, regularity oddExtModule M_i)
Description
Text
Computes the non-free parts M_i of the MCM approximation to M over R_i,
stopping when M_i becomes free, and
returns the list whose elements are the pairs of regularities, starting
with M_{(c-1)}
Note that the first pair is for the
Example
c = 3;d=2
R = setupRings(c,d);
Rc = R_c
M = coker matrix{{Rc_0,Rc_1,Rc_2},{Rc_1,Rc_2,Rc_0}}
regularitySequence(R,M)
SeeAlso
approximation
auslanderInvariant
///
doc ///
Key
dualWithComponents
(dualWithComponents, Module)
Headline
dual module preserving direct sum information
Usage
N = dualWithComponents M
Inputs
M:Module
Outputs
N:Module
Description
Text
If M is a direct sum module (isDirectSum M == true) then
N is the direct sum of the duals of the components (and this is done recursively).
This SHOULD be built into dual M, but isn't as of M2, v. 1.7
SeeAlso
HomWithComponents
tensorWithComponents
///
doc ///
Key
HomWithComponents
(HomWithComponents, Module, Module)
Headline
computes Hom, preserving direct sum information
Usage
H = Hom(M,N)
Inputs
M:Module
N:Module
Outputs
H:Module
Description
Text
If M and/or N are direct sum modules (isDirectSum M == true) then
H is the direct sum of the Homs between the components.
This SHOULD be built into Hom(M,N), but isn't as of M2, v. 1.7
SeeAlso
tensorWithComponents
dualWithComponents
///
doc ///
Key
tensorWithComponents
(tensorWithComponents, Module, Module)
Headline
forms the tensor product, preserving direct sum information
Usage
T = tensor(M,N)
Inputs
M:Module
N:Module
Outputs
T:Module
Description
Text
If M and/or N are direct sum modules (isDirectSum M == true) then
T is the direct sum of the tensor products between the components.
This SHOULD be built into M**N, but isn't as of M2, v. 1.7
SeeAlso
HomWithComponents
dualWithComponents
///
doc///
Key
makeHomotopiesOnHomology
(makeHomotopiesOnHomology, Matrix, ChainComplex)
Headline
Homology of a complex as exterior module
Usage
(H,h) = makeHomotopiesOnHomology(ff, C)
Inputs
ff:Matrix
matrix of elements homotopic to 0 on C
C:ChainComplex
Outputs
H:HashTable
Homology of C, indexed by places in the C
h:HashTable
homotopies for elements of f on the homology of C
Description
Text
The script calls makeHomotopies1 to produce homotopies for the ff_i on C,
and then computes their action on the Homology of C.
SeeAlso
exteriorTorModule
exteriorExtModule
///
doc ///
Key
makeModule
(makeModule, HashTable, Matrix, HashTable)
Headline
makes a Module out of a collection of modules and maps
Usage
M = makeModule(H,E,phi)
Inputs
H:HashTable
graded components that are modules, to make into as single module
E:Matrix
Matrix of variables whose action will defined
phi:HashTable
maps between the graded components that will be the action of the variables in E
Outputs
M:Module
graded modules whose components are given by H
Description
Text
The Hashtable H should have consecutive integer keys i_0..i_0, say, with values
H#i that are modules over a ring SE whose variables include the elements of E.
E: \oplus SE^{d_i} \to SE^1 is a matrix of c variables from SE
H is a hashTable of m pairs {i, t_i}, where the t_i are RE-modules,
and the i are consecutive integer.
phi is a hash-table of homogeneous maps phi#{j,i}: H#i**F_j\to H#(i+1)
where F_j = source (E_{j} = matrix {{e_j}}).
Thus the maps
p#{j,i} = (E_j || -phi#{j,i}): t_i**F_j \to t_i++t_{(i+1)},
are homogeneous.
The script returns M = \oplus_i T_
as an SE-module,
computed as the quotient of P := \oplus T_i
obtained by factoring out the sum of the images of the maps p#{j,i}
The Hashtable phi has keys of the form {j,i} where j runs from 0 to c-1,
i and i+1 are keys of H,
and phi#{j,i} is the map from (source E_{i})**H#i to H#(i+1) that will be
identified with the action of E_{j}.
The script is used in both the singly graded case, for example in
exteriorTorModule(ff,M)
and in the bigraded case, for example in
exteriorTorModule(ff,M,N).
In the following we use makeModule to construct by hand
a free module of rank 1 over the exterior algebra on x,y,
starting with the construction of a module over a bihomogeneous ring.
Example
SE = ZZ/101[a,b,c,x,y,Degrees=>toList(3:{1,0})|toList(2:{1,1}), SkewCommutative=>{x,y}]
RE = SE/ideal"a2,b2,c2"
T = hashTable {{0,RE^1},{1,RE^{2:{ -1,-1}}}, {2,RE^{{ -2,-2}}}}
E = matrix{{x,y}}
F=apply(2, j-> source E_{j})
phi = hashTable{ {{0,0}, map(T#1, F_0**T#0, T#1_{0})},{{1,0}, map(T#1, F_1**T#0, T#1_{1})},{{0,1}, map(T#2, F_0**T#1, T#1^{1})}, {{1,1}, -map(T#2, F_1**T#1, T#1^{0})}}
apply(keys phi, k->isHomogeneous phi#k)
X = makeModule(T,E,phi)
isHomogeneous X
q = map(ZZ/101[x,y, SkewCommutative => true, DegreeMap => d->{d_1}], ring X, {3:0,x,y})
prune coker q presentation X
SeeAlso
exteriorHomologyModule
exteriorTorModule
exteriorExtModule
///
doc ///
Key
exteriorHomologyModule
(exteriorHomologyModule, Matrix, ChainComplex)
Headline
Make the homology of a complex into a module over an exterior algebra
Usage
M = exteriorHomologyModule(ff, C)
Inputs
ff:Matrix
Matrix of elements that are homotopic to 0 on C
C:ChainComplex
Outputs
M:Module
Description
Text
Assuming that the elements of the 1xc matrix ff are null-homotopic
on C, the script returns the direct sum of the homology of C as a module over
a new ring, consisting of ring C with c exterior variables adjoined.
The script is the main component of exteriorTorModule
SeeAlso
exteriorTorModule
makeHomotopiesOnHomology
///
doc ///
Key
extVsCohomology
(extVsCohomology, Matrix, Module)
Headline
compares Ext_S(M,k) as exterior module with coh table of sheaf Ext_R(M,k)
Usage
(E,T) = extVsCohomology(ff,N)
Inputs
ff:Matrix
regular sequence in a regular ring S
N:Module
graded module over R = S/ideal(ff) (usually a high syzygy)
Outputs
E:Module
T:Module
Ext and Tor as exterior modules
Description
Text
Given a matrix ff containing a regular sequence in a polynomial ring S over k,
set R = S/(ideal ff). If N is a graded R-module, and M is the module N regarded
as an S-module, the script returns E = Ext_S(M,k) and T = Tor^S(M,k)
as modules over an exterior algebra.
The script prints the Tate resolution of E; and the cohomology table of the sheaf associated
to Ext_R(N,k) over the ring of CI operators, which is a polynomial ring over k on c variables.
The output can be used to (sometimes) check whether
the submodule of Ext_S(M,k) generated in degree 0 splits (as an exterior module
Example
S = ZZ/101[a,b,c]
ff = matrix "a2,b2,c2"
R = S/(ideal ff)
N = highSyzygy(R^1/ideal(a*b,c))
E = extVsCohomology(ff,highSyzygy N);
SeeAlso
highSyzygy
exteriorExtModule
///
doc ///
Key
makeFiniteResolution
(makeFiniteResolution, Matrix,List)
Headline
finite resolution of a matrix factorization module M
Usage
A = makeFiniteResolution(ff,mf)
Inputs
mf:List
output of matrixFactorization
ff:Matrix
the regular sequence used for the matrixFactorization computation
Outputs
A:ChainComplex
A is the minimal finite resolution of M over R.
Description
Text
Suppose that f_1..f_c is a homogeneous regular sequence
of forms of the same degree in a
polynomial ring S and M is a high syzygy module over
S/(f_1,..,f_c) = R(c), and mf = (d,h) is the output
of matrixFactorization(M,ff). If the complexity of M
is c', then M has a finite free resolution over
R = S/(f_1,..,f_{(c-c')}) (and, more generally, has
complexity c-d over S/(f_1,..,f_{(c-d)}) for d>=c').
The complex A is the minimal finite free resolution
of M over A, constructed as an iterated Koszul extension,
made from the maps in bMaps mf and psiMaps mf, as described
in Eisenbud-Peeva.
Example
setRandomSeed 0
S = ZZ/101[a,b,c];
ff = matrix"a3,b3";
R = S/ideal ff;
M = highSyzygy (R^1/ideal vars R);
mf = matrixFactorization (ff, M)
G = makeFiniteResolution(ff,mf)
F = res pushForward(map(R,S),M)
G.dd_1
F.dd_1
G.dd_2
F.dd_2
Text
If the complexity of M is not maximal, then the finite
resolution takes place over an intermediate complete
intersection:
Example
S = ZZ/101[a,b,c,d]
ff1 = matrix"a3,b3,c3,d3"
ff =ff1*random(source ff1, source ff1)
R = S/ideal ff
M = highSyzygy (R^1/ideal"a2b2")
complexity M
mf = matrixFactorization (ff, M)
complexity mf
BRanks mf
G = makeFiniteResolution(ff,mf);
codim ring G
R1 = ring G
F = res prune pushForward(map(R,R1),M)
betti F
betti G
SeeAlso
matrixFactorization
bMaps
psiMaps
hMaps
complexity
///
doc ///
Key
makeFiniteResolutionCodim2
(makeFiniteResolutionCodim2, Matrix,List)
[makeFiniteResolutionCodim2, Check]
Headline
Maps associated to the finite resolution of a high syzygy module in codim 2
Usage
maps = makeFiniteResolutionCodim2(ff,mf)
Inputs
mf:List
matrix factorization
ff:Matrix
regular sequence
Outputs
maps:HashTable
many maps
Description
Text
Given a codim 2 matrix factorization, makes all the components of
the differential and of the homotopies
that are relevant to the finite resolution, as in 4.2.3 of Eisenbud-Peeva
"Minimal Free Resolutions and Higher Matrix Factorizations"
Example
kk=ZZ/101
S = kk[a,b]
ff = matrix"a4,b4"
R = S/ideal ff
N = R^1/ideal"a2, ab, b3"
N = coker vars R
M = highSyzygy N
MS = pushForward(map(R,S),M)
mf = matrixFactorization(ff, M)
G = makeFiniteResolutionCodim2(ff,mf)
F = G#"resolution"
SeeAlso
makeFiniteResolution
///
doc ///
Key
complexity
(complexity, Module)
(complexity, List)
Headline
complexity of a module over a complete intersection
Usage
c = complexity M
c = complexity mf
Inputs
M:Module
module over a complete intersection
mf:List
output of a matrix factorization computation
Outputs
c:ZZ
1+dimension of Ext(M,k) over the ring of CI operators
Description
Text
The minimal resolution of a module over a complete intersection has betti numbers
that grow as a polynomial of degree at most equal to the codimension-1.
The complexity is one more than the degree of this polynomial.
Example
setRandomSeed 0
S = ZZ/101[a,b,c,d];
ff1 = matrix"a3,b3,c3,d3";
ff =ff1*random(source ff1, source ff1);
R = S/ideal ff;
M = highSyzygy (R^1/ideal"a2b2");
complexity M
mf = matrixFactorization (ff, M)
complexity mf
betti res (R^1/ideal"a2b2", LengthLimit=>10)
SeeAlso
matrixFactorization
makeFiniteResolution
///
doc ///
Key
koszulExtension
(koszulExtension, ChainComplex,ChainComplex,Matrix,Matrix)
Headline
creates the Koszul extension complex of a map
Usage
MM = koszulExtension(FF,BB,psi1,ff)
Inputs
FF:ChainComplex
resolution over S
BB:ChainComplex
two-term complex BB_1-->BB_0
psi1:Matrix
from BB_1 to FF_0
ff:Matrix
regular sequence annihilating the module resolved by FF
Outputs
MM:ChainComplex
the mapping cone of the induced map B[-1]\otimes KK(ff) to W extending psi
Description
Text
Implements the construction in the paper
"Matrix Factorizations in Higher Codimension"
by Eisenbud and Peeva.
SeeAlso
makeFiniteResolution
///
doc ///
Key
moduleAsExt
(moduleAsExt, Module, Ring)
Headline
Find a module with given asymptotic resolution
Usage
M = moduleAsExt(MM,R)
Inputs
M:Module
module over polynomial ring with c variables
R:Ring
(graded) complete intersection ring of codimension c, embedding dimension n
Outputs
N:Module
module over R such that Ext_R(N,k) = M\otimes \wedge(k^n) in large homological degree.
Description
Text
The routine ``moduleAsExt'' is a partial inverse to the
routine ExtModule, computed following ideas of Avramov and Jorgensen:
given a module
E over a polynomial ring k[x_1..x_c], it provides a module
N over a specified polynomial ring in n variables such that
Ext(N,k) agrees with $E'=E\otimes \wedge(k^n)$ after truncation.
Here the grading on E is taken to be even, while $\wedge(k^n)$
has generators in degree 1. The routine hfModuleAsExt computes
the resulting hilbert function for E'. This uses ideas of
Avramov and Jorgensen. Note that the module Ext(N,k) (truncated)
will automatically be free over the exterior algebra $\wedge(k^n)$
generated by Ext^1(k,k); not a typical Ext module.
More precisely:
Suppose that $R = k[a_1,\dots, a_n]/(f_1,\dots,f_c)$ let
$KK = k[x_1,\dots,x_c]$, and let $\Lambda = \wedge k^n$.
$E = KK\otimes\Lambda$, so that the minimal
$R$-free resolution of $k$ has underlying module $R\otimes E^*$,
where $E^*$ is the graded vector space dual of $E$.
Let MM be the result of truncating M at its regularity and shifting it
so that it is generated in degree 0. Let $F$ be a $KK$-free resolution of $MM$,
and write $F_i = KK\otimes V_i.$
Since linear forms over $KK$ correspond to CI operators of degree -2 on the
resolution G of k over R, we may form a map
$$
d_1+d_2: \sum_{i=0}^m G_{i+1}\otimes V_{m-i}^* \to \sum_{i=0}^m G_i\otimes V_{m-i}^*
$$
where $d_1$ is the direct sum of the differentials $(G_{i+1}\to G_i)\otimes V_i^*$
and $d_2$ is the direct sum of the maps $\phi_i$ defined from the differentials of $F$
by substituting CI operators for linear forms,
$\phi_i: G_{i+1}\otimes V_i \to G_{i-1}\otimes V_{i-1}$.
The script returns the module N that is the cokernel of $d_1+d_2$.
The module $Ext_R(N,k)$ agrees, after a few steps, with the module derived from
$MM$ by tensoring it with $\Lambda$, that is, with the moduleß
$$
MM' = \sum_j (MM'(j)\otimes \Lambda_j)
$$
so that $MM'_p = (MM_p\otimes Lambda_0) \oplus (MM_{p-1}\otimes Lambda_1) \oplus\cdots$.
The function hfModuleAsExt computes the Hilbert function of MM' numerically
from that of MM.
Example
kk = ZZ/101;
S = kk[a,b,c];
ff = matrix{{a^4, b^4,c^4}};
R = S/ideal ff;
Ops = kk[x_1,x_2,x_3];
MM = Ops^1/(x_1*ideal(x_2^2,x_3));
N = moduleAsExt(MM,R);
betti res( N, LengthLimit => 10)
hfModuleAsExt(12,MM,3)
Caveat
The elements f_1..f_c must be homogeneous of the same degree.
The script could be rewritten to accommodate different degrees,
but only by going to the local category
SeeAlso
ExtModule
evenExtModule
oddExtModule
ExtModuleData
hfModuleAsExt
///
doc ///
Key
hfModuleAsExt
(hfModuleAsExt, ZZ, Module, ZZ)
Headline
predict betti numbers of moduleAsExt(M,R)
Usage
seq = hfModuleAsExt(numValues,M,numgensR)
Inputs
numValues:ZZ
number of values to compute
M:Module
module over the ring of operators
numgensR:ZZ
number of generators of the target ring
Outputs
seq:Sequence
sequence of numValues integers, the expected total Betti numbers
Description
Text
Given a module M over the ring of operators $k[x_1..x_c]$, the
call
$N = moduleAsExt(M,R)$
produces a module N over the ring R whose ext module is
the exterior algebra on n=numgensR generators tensored with M.
This script computes numValues values of the
Hilbert function of
$$
M \otimes \wedge k^n,
$$
which should be equal to the total betti numbers of N.
Example
kk = ZZ/101;
S = kk[a,b,c];
ff = matrix{{a^4, b^4,c^4}};
R = S/ideal ff;
Ops = kk[x_1,x_2,x_3];
MM = Ops^1/(x_1*ideal(x_2^2,x_3));
N = moduleAsExt(MM,R);
betti res( N, LengthLimit => 10)
hfModuleAsExt(12,MM,3)
SeeAlso
moduleAsExt
///
doc ///
Key
Optimism
Headline
Option to highSyzygy
Usage
highSyzygy(M, Optimism => 1)
Inputs
Optimism:ZZ
Description
Text
If highSyzygy(M) chooses the p-th syzygy,
then highSyzygy(M,Optimism=>r) chooses the (p-r)-th syzygy.
(Positive Optimism chooses a lower "high" syzygy, negative
Optimism a higher "high" syzygy.
Caveat
Are there cases when positive Optimism is justified?
SeeAlso
mfBound
highSyzygy
///
doc ///
Key
Check
Headline
Option for matrixFactorization
Usage
matrixFactorization(ff,m,Check => true)
Inputs
Check:Boolean
Description
Text
Makes matrixFactorization perform various checks as it computes.
SeeAlso
matrixFactorization
///
doc ///
Key
Lift
Headline
Option for newExt
Usage
newExt(M,N,Check =>true)
Inputs
Check:Boolean
Description
Text
Makes newExt perform various checks as it computes.
SeeAlso
newExt
///
doc ///
Key
Grading
Headline
Option for EisenbudShamashTotal, newExt
Usage
EisenbudShamashTotal(Mbar,Grading => 2)
Inputs
Check:ZZ
Description
Text
if Grading =>1, then the output is converted to single-grading, useful in
the package Clifford
SeeAlso
EisenbudShamashTotal
newExt
///
doc ///
Key
Augmentation
Headline
Option for matrixFactorization
Usage
matrixFactorization(ff,m,Augmentation => true)
Inputs
Check:Boolean
Description
Text
Makes matrixFactorization return an augmentation map as well as d,h.
Default value is false
SeeAlso
matrixFactorization
///
doc ///
Key
Layered
Headline
Option for matrixFactorization
Usage
matrixFactorization(ff,m,Layered => true)
Inputs
Check:Boolean
Description
Text
Makes matrixFactorization use the "layered" algorithm, which works for
any MCM module, but returns something non-minimal if the module is not a "high syzygy"
in a suitable sense. Default is "true".
Note that when the module is a high syzygy, Layered=> false is much faster.
SeeAlso
matrixFactorization
///
doc ///
Key
highSyzygy
(highSyzygy, Module)
[highSyzygy, Optimism]
Headline
Returns a syzygy module one beyond the regularity of Ext(M,k)
Usage
M = highSyzygy M0
Inputs
M0:Module
over a complete intersection ring
Outputs
M:Module
a syzygy module of M0
Description
Text
A "high syzygy" over a complete intersection is one
such that general ci-operators have split kernels
when applied recursively on cosyzygy chains of
previous kernels.
If p = mfBound M0, then highSyzygy M0
returns the p-th syzygy of M0.
(if F is a resolution of M this is the cokernel
of F.dd_{p+1}). Optimism => r as optional
argument, highSyzygy(M0,Optimism=>r)
returns the (p-r)-th syzygy. The script is
useful with matrixFactorization(ff, highSyzygy M0).
Example
setRandomSeed 100
S = ZZ/101[x,y,z]
f = matrix"x3,y3+x3,z3+x3+y3"
ff = f*random(source f, source f)
R = S/ideal f
M0 = R^1/ideal"x2z2,xyz"
betti res (M0, LengthLimit => 7)
mfBound M0
M = betti res highSyzygy M0
netList BRanks matrixFactorization(ff, highSyzygy M0)
Text
In this case as in all others we have examined,
greater "Optimism" is not
justified, and thus
matrixFactorization(ff, highSyzygy(M0, Optimism=>1));
would produce an error.
Caveat
A bug in the total Ext script means that the oddExtModule
is sometimes zero, and this can cause a wrong value to be
returned.
SeeAlso
evenExtModule
oddExtModule
mfBound
matrixFactorization
///
doc ///
Key
mfBound
(mfBound, Module)
Headline
determines how high a syzygy to take for "matrixFactorization"
Usage
p = mfBound M
Inputs
M:Module
over a complete intersection
Outputs
p:ZZ
Description
Text
If p = mfBound M, then the p-th syzygy of M,
which is computed by highSyzygy(M),
should (this is a conjecture)
be a "high Syzygy" in the sense required
for matrixFactorization. In examples, the estimate
seems sharp (except when M is already a high syzygy).
The actual formula used is:
mfBound M = max(2*r_{even}, 1+2*r_{odd})
where r_{even} = regularity evenExtModule M and
r_{odd} = regularity oddExtModule M. Here
evenExtModule M is the even degree part of
Ext(M, (residue class field)).
SeeAlso
highSyzygy
evenExtModule
oddExtModule
matrixFactorization
///
doc ///
Key
ExtModuleData
(ExtModuleData, Module)
Headline
Even and odd Ext modules and their regularity
Usage
L = ExtModuleData M
Inputs
M:Module
Module over a complete intersection S
Outputs
L:List
L = \{evenExtModule, oddExtModule, reg0, reg1\}
Description
Text
Suppose that M is a module over a complete intersection R
so that
E := ExtModule M
is a module generated in degrees >=0
over a polynomial ring T'
generated in degree 2, and
E0 := evenExtModule M and
E1 := oddExtModule M
are modules generated in degree >= 0
over a polynomial ring T with generators
in degree 1.
The script returns
L = \{E0,E1, regularity E0, regularity E1\}
and prints a message if |reg0-reg1|>1.
If we set r = max(2*reg0, 1+2*reg1),
and F is a resolution of M, then
coker F.dd_{(r+1)}
is the first szygy module of M such that
regularity evenExtModule M =0 AND
regularity oddExtModule M =0
We have been using regularity ExtModule M
as a substitute for r,
but that's not always the same.
The regularities of the even and odd Ext modules *can* differ by more than 1.
An example can be produced with
setRandomSeed 0
S = ZZ/101[a,b,c,d]
ff =matrix"a4,b4,c4,d4"
R = S/ideal ff
N = coker random(R^{0,1}, R^{ -1,-2,-3,-4}) --gives reg Ext^even = 4, reg Ext^odd = 3
L = ExtModuleData N;
but takes some time to compute.
Example
setRandomSeed 100
S = ZZ/101[a,b,c,d];
f = map(S^1, S^4, (i,j) -> S_j^3)
R = S/ideal f;
M = R^1/ideal"ab2+cd2";
betti (F = res(M, LengthLimit => 5))
E = ExtModuleData M;
E_2
E_3
r = max(2*E_2,2*E_3+1)
Er = ExtModuleData coker F.dd_r;
regularity Er_0
regularity Er_1
regularity evenExtModule(coker F.dd_(r-1))
ff = f*random(source f, source f);
matrixFactorization(ff, coker F.dd_(r+1));
Text
This succeeds, but we could get an error from
matrixFactorization(ff, coker F.dd_r)
if one of the CI operators were not surjective.
Caveat
ExtModule creates a ring inside the script, so if it's run
twice you get modules over different rings. This should be
changed.
SeeAlso
ExtModule
evenExtModule
oddExtModule
///
doc ///
Key
isLinear
(isLinear, Matrix)
Headline
check whether matrix entries have degree 1
Usage
b = isLinear M
Inputs
M:Matrix
Outputs
b:Boolean
Description
Text
Note that a linear matrix, in this sense, can still
have different target degrees (in which case the
cokernel decomposes into a direct sum by generator
degree.)
///
doc ///
Key
TateResolution
(TateResolution, Module, ZZ,ZZ)
(TateResolution, Module, ZZ)
(TateResolution, Module)
Headline
TateResolution of a module over an exterior algebra
Usage
F = TateResolution(M,lower,upper)
Inputs
M:Module
lower:ZZ
upper:ZZ
lower and upper bounds for the resolution
Outputs
F:ChainComplex
Description
Text
Forms an interval, lower..upper,
of a doubly infinite free resolution of
a a Cohen-Macaulay
module over a Gorenstein ring, such as
any module over an exterior algebra (actually,
any module over any ring.)
Example
E = ZZ/101[a,b,c, SkewCommutative=>true]
M = coker map(E^2, E^{-1}, matrix"ab;bc")
presentation M
TateResolution(M,-2,7)
Caveat
In a previous version of this script,
this command returned a betti table; now use
"betti TateResolution" instead.
///
doc ///
Key
makeT
(makeT,Matrix, ChainComplex,ZZ)
-- (makeT,Matrix, ChainComplex,Matrix, ZZ)
Headline
make the CI operators on a complex
Usage
T = makeT(ff,F,i)
T = makeT(ff,F,t0,i)
Inputs
ff:Matrix
1xc matrix whose entries are a complete intersection in S
F:ChainComplex
over S/ideal ff
t0:Matrix
CI-operator on F for ff_0 to be preserved
i:ZZ
define CI operators from F_i \to F_{i-2}
Outputs
L:List
of CI operators F_i \to F_{i-2} corresponding to entries of ff
Description
Text
substitute matrices of two differentials of F into S = ring ff,
compose them, and divide by entries of ff, in order.
If the second Matrix argument t0 is present, use it
as the first CI operator.
The degrees of the targets of the T_j are
changed by the degrees of the f_j to make the T_j
homogeneous.
Example
S = ZZ/101[x,y,z];
ff = matrix"x3,y3,z3";
R = S/ideal ff;
M = coker matrix"x,y,z;y,z,x";
betti (F = res M)
T = makeT(ff,F,3);
netList T
isHomogeneous T_2
Caveat
Script assumes that ring F == (ring ff)/(ideal ff).
It might be more useful to return the operators as matrices
over S rather than over R, since this is what we'd need
for things like matrixFactorization (where this process
currently done on the fly, not calling makeT)
///
doc ///
Key
ExtModule
(ExtModule, Module)
Headline
Ext^*(M,k) over a complete intersection as module over CI operator ring
Usage
E = ExtModule M
Inputs
M:Module
over a complete intersection ring
Outputs
E:Module
over a polynomial ring with gens in even degree
Description
Text
Uses code of Avramov-Grayson described in Macaulay2 book
Example
kk= ZZ/101
S = kk[x,y,z]
I1 = ideal "x3y"
R1 = S/I1
M1 = R1^1/ideal(x^2)
betti res (M1, LengthLimit =>5)
E = ExtModule M1
apply(toList(0..10), i->hilbertFunction(i, E))
Eeven = evenExtModule(M1)
apply(toList(0..5), i->hilbertFunction(i, Eeven))
Eodd = oddExtModule(M1)
apply(toList(0..5), i->hilbertFunction(i, Eodd))
--
use S
I2 = ideal"x3,yz"
R2 = S/I2
M2 = R2^1/ideal"x2,y,z"
betti res (M2, LengthLimit =>10)
E = ExtModule M2
apply(toList(0..10), i->hilbertFunction(i, E))
Eeven = evenExtModule M2
apply(toList(0..5), i->hilbertFunction(i, Eeven))
Eodd = oddExtModule M2
apply(toList(0..5), i->hilbertFunction(i, Eodd))
SeeAlso
evenExtModule
oddExtModule
///
doc ///
Key
OutRing
Headline
Option allowing specification of the ring over which the output is defined
SeeAlso
evenExtModule
oddExtModule
///
doc ///
Key
evenExtModule
(evenExtModule, Module)
[evenExtModule, OutRing]
Headline
even part of Ext^*(M,k) over a complete intersection as module over CI operator ring
Usage
E = evenExtModule M
Inputs
M:Module
over a complete intersection ring
Outputs
E:Module
over a polynomial ring with gens in degree 1
Description
Text
Extracts the even degree part from ExtModule M
If the optional argument OutRing => T is given, and class T === PolynomialRing,
then the output will be a module over T.
Example
kk= ZZ/101
S = kk[x,y,z]
I2 = ideal"x3,yz"
R2 = S/I2
M2 = R2^1/ideal"x2,y,z"
betti res (M2, LengthLimit =>10)
E = ExtModule M2
apply(toList(0..10), i->hilbertFunction(i, E))
Eeven = evenExtModule M2
apply(toList(0..5), i->hilbertFunction(i, Eeven))
SeeAlso
ExtModule
oddExtModule
OutRing
///
doc ///
Key
oddExtModule
(oddExtModule, Module)
[oddExtModule,OutRing]
Headline
odd part of Ext^*(M,k) over a complete intersection as module over CI operator ring
Usage
E = oddExtModule M
Inputs
M:Module
over a complete intersection ring
Outputs
E:Module
over a polynomial ring with gens in degree 1
Description
Text
Extracts the odd degree part from ExtModule M.
If the optional argument OutRing => T is given, and class T === PolynomialRing,
then the output will be a module over T.
Example
kk= ZZ/101
S = kk[x,y,z]
I2 = ideal"x3,yz"
R2 = S/I2
M2 = R2^1/ideal"x2,y,z"
betti res (M2, LengthLimit =>10)
E = ExtModule M2
apply(toList(0..10), i->hilbertFunction(i, E))
Eodd = oddExtModule M2
apply(toList(0..5), i->hilbertFunction(i, Eodd))
SeeAlso
ExtModule
evenExtModule
OutRing
///
doc ///
Key
makeHomotopies
(makeHomotopies,Matrix,ChainComplex,ZZ)
(makeHomotopies,Matrix,ChainComplex)
Headline
returns a system of higher homotopies
Usage
H = makeHomotopies(f,F,b)
Inputs
f:Matrix
1xn matrix of elements of S
F:ChainComplex
admitting homotopies for the entries of f
b:ZZ
how far back to compute the homotopies (defaults to length of F)
Outputs
H:HashTable
gives the higher homotopy from F_i corresponding to a monomial with exponent
vector L as the value $H#\{L,i\}$
Description
Text
Given a $1\times n$ matrix f, and a chain complex F,
the script attempts to make a family of higher homotopies
on F for the elements of f, in the sense described, for
example, in Eisenbud "Enriched Free Resolutions and Change
of Rings".
The output is a hash table with entries of the form $\{J,i\}=>s$,
where
J is a list of non-negative integers, of length n
and $H\#\{J,i\}: F_i->F_{i+2|J|-1}$ are maps satisfying
the conditions
$$
H\#\{e0,i\} = d;
$$
and
$$
H#\{e0,i+1\}*H#\{e,i\}+H#\{e,i-1\}H#\{e0,i\} = f_i,
$$
where $e0 = \{0,\dots,0\}$ and $e$ is the index of degree 1
with a 1 in the $i$-th place;
and, for each index list I with |I|<=d,
$$
sum_{J<I} H#\{I\setminus J, \} H#\{J, \} = 0.
$$
To make the maps homogeneous, $H\#\{J,i\}$ is actually a map from
a an appropriate negative twist of F to a shift of S.
Example
kk=ZZ/101
S = kk[a,b,c,d]
F = res ideal vars S
f = matrix{{a,b,c}}
homot = makeHomotopies(f,F,2)
Text
In this case the higher homotopies are 0:
Example
L = sort select(keys homot, k->(homot#k!=0 and sum(k_0)>1))
Text
On the other hand, if
we take a complete intersection and something
contained in it in a more complicated situation,
the program gives nonzero higher homotopies:
Example
kk= ZZ/32003;
S = kk[a,b,c,d];
M = S^1/(ideal"a2,b2,c2,d2");
F = res M
setRandomSeed 0
f = random(S^1,S^{2:-5});
homot = makeHomotopies(f,F,5)
Text
We can see that all 6 potential higher homotopies are nontrivial:
Example
L = sort select(keys homot, k->(homot#k!=0 and sum(k_0)>1))
#L
netList L
Text
For example we have:
Example
homot#(L_0)
Text
But all the homotopies are minimal in this case:
Example
k1 = S^1/(ideal vars S);
select(keys homot,k->(k1**homot#k)!=0)
SeeAlso
makeHomotopies1
///
doc ///
Key
makeHomotopies1
(makeHomotopies1, Matrix,ChainComplex,ZZ)
(makeHomotopies1, Matrix,ChainComplex)
Headline
returns a system of first homotopies
Usage
H = makeHomotopies1(f,F,d)
Inputs
f:Matrix
1xn matrix of elements of S
F:ChainComplex
admitting homotopies for the entries of f
d:ZZ
how far back to compute the homotopies (defaults to length of F)
Outputs
H:HashTable
gives the homotopy from F_i corresponding to f_j
as the value $H#\{j,i\}$
Description
Text
Same as makeHomotopies, but only computes the ordinary
homotopies, not the higher ones. Used in exteriorTorModule
SeeAlso
makeHomotopies
exteriorTorModule
///
doc ///
Key
S2
(S2,ZZ,Module)
Headline
Universal map to a module satisfying Serre's condition S2
Usage
f = S2(b,M)
Inputs
b:ZZ
degree bound to which to carry the computation
M:Module
Outputs
f:Matrix
defining a map M-->M' that agrees with the
S2-ification of M in degrees $\geq b$
Description
Text
If M is a graded module over a ring S, then the S2-ification
of M is \sum_{d \in ZZ} H^0((sheaf M)(d)), which may be computed
as lim_{d->\infty} Hom(I_d,M), where I_d is any sequence
of ideals contained in higher and higher powers of S_+.
There is a natural restriction map
f: M = Hom(S,M) \to Hom(I_d,M).
We compute all this using the ideals
I_d generated by the d-th powers
of the variables in S.
Since the result may not be finitely generated (this happens
if and only if M has an associated prime of dimension 1), we
compute only up to a specified degree bound b. For the result to
be correct down to degree b, it is sufficient to compute
Hom(I,M)
where I \subset (S_+)^{r-b}.
Example
kk=ZZ/101
S = kk[a,b,c,d]
M = truncate(3,S^1)
betti matrix S2(0,M)
betti matrix S2(1,M)
M = S^1/intersect(ideal"a,b,c", ideal"b,c,d",ideal"c,d,a",ideal"d,a,b")
prune source S2(0,M)
prune target S2(0,M)
Text
At one time DE hoped that, if M were a module over the complete intersection R with
residue field k,
then the natural map from "complete" Ext module "(widehat Ext)_R(M,k)"
to the S2-ification of Ext_R(M,k) would be surjective; equivalently, if
N were a sufficiently negative syzygy of M, then the first local cohomology module
of Ext_R(M,k) would be zero. This is false, as shown by the following example:
Example
S = ZZ/101[x_0..x_2];
ff = apply(3, i->x_i^2);
R = S/ideal ff;
M = cokernel matrix {{x_0, x_1*x_2}};
b = 5;
Mb = prune syzygyModule(-b,M);
E = prune evenExtModule Mb;
S2map = S2(0,E);
SE = prune target S2map;
extra = prune coker S2map;
KE = prune ker S2map;
betti res(Mb, LengthLimit => 10)
apply (5, i-> hilbertFunction(i, KE))
apply (5, i-> hilbertFunction(i, E))
apply (5, i-> hilbertFunction(i, SE))
apply (5, i-> hilbertFunction(i, extra))
SeeAlso
"IntegralClosure"
"IntegralClosure::makeS2"
"BGG"
"cohomology"
"HH^ZZ SumOfTwists"
Caveat
Text
S2-ification is related to computing cohomology and to
computing integral closure; there are scripts in
those packages that produce an S2-ification, but one takes
a ring as argument and the other doesn't produce the
comparison map.
///
doc///
Key
splittings
(splittings, Matrix, Matrix)
Headline
compute the splittings of a split right exact sequence
Usage
x = splittings(a,b)
Inputs
a:Matrix
maps into the kernel of b
b:Matrix
representing a surjection from target a to a free module
Outputs
L:List
L = \{sigma,tau\}, splittings of a,b respectively
Description
Text
Assuming that (a,b) are the maps of a right exact
sequence
$0\to A\to B\to C \to 0$
with B, C free,
the script produces a pair of maps sigma, tau
with $tau: C \to B$ a splitting of b and
$sigma: B \to A$ a splitting of a; that is,
$a*sigma+tau*b = 1_B$
$sigma*a = 1_A$
$b*tau = 1_C$
Example
kk= ZZ/101
S = kk[x,y,z]
setRandomSeed 0
t = random(S^{2:-1,2:-2}, S^{3:-1,4:-2})
ss = splittings(syz t, t)
ss/betti
///
doc ///
Key
toArray
(toArray, List)
(toArray, ZZ)
Headline
makes an array from a List or from a single integer
Usage
arr = toArray L
arr = toArray n
Inputs
L:List
n:ZZ
Outputs
arr:Array
///
doc ///
Key
matrixFactorization
(matrixFactorization, Matrix, Module)
[matrixFactorization, Check]
[matrixFactorization,Augmentation]
[matrixFactorization,Layered]
[matrixFactorization,Verbose]
Headline
Maps in a higher codimension matrix factorization
Usage
MF = matrixFactorization(ff,M)
Inputs
ff:Matrix
a sufficiently general regular sequence in a ring S
M:Module
a maximal Cohen-Macaulay module over S/ideal ff
Outputs
MF:List
\{d,h,gamma\}, where d:A_1 \to A_0 and h: \oplus A_0(p) \to A_1
is the direct sum of partial homotopies, and gamma: A_0 ->M is the
augmentation (returned only if Augmentation =>true)
Description
Text
The input module M should be a maximal Cohen-Macaulay module over
R = S/ideal ff. If M is in fact a "high syzygy", then the function
matrixFactorization(ff,M,Layered=>false) uses a different, faster algorithm which
only works in the high syzygy case.
In all examples we know,
M can be considered a "high syzygy" as long as Ext^{even}_R(M,k) and Ext^{odd}_R(M,k)
have negative regularity
over the ring of CI operators (regraded with variables of degree 1. However, the best
result we can prove is that it suffices to have regularity < -(2*dim R+1).
When the optional input Check==true (the default is Check==false),
the properties in the definition of Matrix Factorization are verified
The output is a list of maps \{d,h\} or \{d,h,gamma\}, where gamma is an augmentation,
that is, a map from target d to M.
The map d is a special lifting to S of a presentation of
M over R. To explain the contents, we introduce some notation
(from
Eisenbud and Peeva, "Minimal free resolutions over complete intersections"
Lecture Notes in Mathematics, 2152.
Springer, Cham, 2016. x+107 pp. ISBN: 978-3-319-26436-3; 978-3-319-26437-0).
R(i) = S/(ff_0,..,ff_{i-1}). Here 0<= i <= c, and R = R(c)
and S = R(0).
B(i) = the matrix (over S) representing d_i: B_1(i) \to B_0(i)
d(i): A_1(i) \to A_0(i) the restriction of d = d(c).
where A(i) = \oplus_{i=1}^p B(i)
The map h is a direct sum of maps target d(p) \to source d(p)
that are homotopies for ff_p on the restriction
d(p): over the ring R#(p-1) = S/(ff#1..ff#(p-1),
so d(p) * h#p = ff#p mod (ff#1..ff#(p-1).
In addition, h#p * d(p) induces ff#p on B1#p
mod (ff#1..ff#(p-1).
Here is a simple example:
Example
setRandomSeed 0
kk = ZZ/101
S = kk[a,b,u,v]
ff = matrix"au,bv"
R = S/ideal ff
M0 = R^1/ideal"a,b"
M = highSyzygy M0
MF = matrixFactorization(ff,M);
netList BRanks MF
netList bMaps MF
betti res(M, LengthLimit => 7)
infiniteBettiNumbers (MF,7)
betti res pushForward(map(R,S),M)
finiteBettiNumbers MF
SeeAlso
finiteBettiNumbers
infiniteBettiNumbers
highSyzygy
bMaps
BRanks
///
doc///
Key
finiteBettiNumbers
(finiteBettiNumbers, List)
Headline
betti numbers of finite resolution computed from a matrix factorization
Usage
L = finiteBettiNumbers MF
Inputs
MF:List
List of HashTables as computed by "matrixFactorization"
Outputs
L:List
List of betti numbers
Description
Text
Uses the ranks of the B matrices in a matrix factorization
for a module M over S/(f_1,..,f_c) to compute the betti numbers
of the minimal resolution of M over S, which is the sum
of the Koszul complexes K(f_1..f_{j-1}) tensored with B(j)
Example
setRandomSeed 0
kk = ZZ/101
S = kk[a,b,u,v]
ff = matrix"au,bv"
R = S/ideal ff
M0 = R^1/ideal"a,b"
F = res(M0, LengthLimit =>3)
M = coker F.dd_3;
MF = matrixFactorization(ff,M);
betti res pushForward(map(R,S),M)
finiteBettiNumbers MF
infiniteBettiNumbers(MF,5)
betti res (M, LengthLimit => 5)
SeeAlso
matrixFactorization
infiniteBettiNumbers
///
doc ///
Key
infiniteBettiNumbers
(infiniteBettiNumbers, List, ZZ)
Headline
betti numbers of finite resolution computed from a matrix factorization
Usage
L = finiteBettiNumbers (MF,len)
Inputs
MF:List
List of HashTables as computed by "matrixFactorization"
len:ZZ
length of betti number sequence to produce
Outputs
L:List
List of betti numbers
Description
Text
Uses the ranks of the B matrices in a matrix factorization
for a module M over S/(f_1,..,f_c) to compute the betti numbers
of the minimal resolution of M over R, which is the sum
of the divided power algebras on c-j+1 variables tensored with B(j).
Example
setRandomSeed 0
kk = ZZ/101
S = kk[a,b,u,v]
ff = matrix"au,bv"
R = S/ideal ff
M0 = R^1/ideal"a,b"
F = res(M0, LengthLimit =>3)
M = coker F.dd_3;
MF = matrixFactorization(ff,M);
betti res pushForward(map(R,S),M)
finiteBettiNumbers MF
infiniteBettiNumbers(MF,5)
betti res (M, LengthLimit => 5)
SeeAlso
matrixFactorization
finiteBettiNumbers
///
doc///
Key
exteriorTorModule
(exteriorTorModule, Matrix, Module)
(exteriorTorModule,Matrix,Module,Module)
Headline
Tor as a module over an exterior algebra or bigraded algebra
Usage
T = exteriorTorModule(f,F)
T = exteriorTorModule(f,M,N)
Inputs
f:Matrix
1 x c, entries must be homotopic to 0 on F
M:Module
S-module annihilated by ideal f
N:Module
S-module annihilated by ideal f
Outputs
T:Module
Tor^S(M,N) as a Module over an exterior algebra
Description
Text
If M,N are S-modules annihilated by the elements of the matrix
ff = (f_1..f_c), and k is the residue field of S, then
the script exteriorTorModule(f,M)
returns Tor^S(M, k) as a module over an exterior
algebra k<e_1,...,e_c>, where the e_i have degree 1, while
exteriorTorModule(f,M,N)
returns Tor^S(M,N) as a module over a bigraded ring SE = S<e_1,..,e_c>,
where the e_i have degrees {d_i,1}, where d_i is the degree of f_i.
The module structure, in either case, is defined by the homotopies
for the f_i on the resolution of M, computed by the script
makeHomotopies1.
The scripts call makeModule
to compute a (non-minimal) presentation of this module.
From the description by matrix factorizations and the paper
"Tor as a module over an exterior algebra" of Eisenbud, Peeva and Schreyer it follows that
when M is a high syzygy and F is its resolution,
then the presentation of Tor(M,S^1/mm) always has generators
in degrees 0,1, corresponding to the targets and sources of the
stack of maps B(i), and that the resolution is componentwise linear in a suitable sense.
In the following example, these facts are verified. The Tor module does NOT
split into the direct sum of the submodules generated in degrees 0 and 1, however.
Example
kk = ZZ/101
S = kk[a,b,c]
f = matrix"a4,b4,c4"
R = S/ideal f
p = map(R,S)
M = coker map(R^2, R^{3:-1}, {{a,b,c},{b,c,a}})
betti (FF =res( M, LengthLimit =>6))
MS = prune pushForward(p, coker FF.dd_6);
T = exteriorTorModule(f,MS);
betti T
betti res (PT = prune T)
ann PT
PT0 = image (inducedMap(PT,cover PT)* ((cover PT)_{0..12}));
PT1 = image (inducedMap(PT,cover PT)* ((cover PT)_{13..30}));
betti res prune PT0
betti res prune PT1
betti res prune PT
SeeAlso
makeModule
///
doc///
Key
exteriorExtModule
(exteriorExtModule, Matrix, Module)
(exteriorExtModule,Matrix,Module,Module)
Headline
Ext(M,k) or Ext(M,N) as a module over an exterior algebra
Usage
E = exteriorExtModule(f,M)
Inputs
f:Matrix
1 x c, entries must be homotopic to 0 on F
M:Module
annihilated by the elements of ff
N:Module
annihilated by the elements of ff
Outputs
E:Module
Module over an exterior algebra with variables corresponding to elements of f
Description
Text
If M,N are S-modules annihilated by the elements of the matrix
ff = (f_1..f_c), and k is the residue field of S, then
the script exteriorExtModule(f,M)
returns Ext_S(M, k) as a module over an exterior
algebra E = k<e_1,...,e_c>, where the e_i have degree 1.
It is computed as the E-dual of exteriorTorModule.
The script
exteriorTorModule(f,M,N)
returns Ext_S(M,N) as a module over a bigraded ring SE = S<e_1,..,e_c>,
where the e_i have degrees {d_i,1}, where d_i is the degree of f_i.
The module structure, in either case, is defined by the homotopies
for the f_i on the resolution of M, computed by the script
makeHomotopies1.The script calls makeModule
to compute a (non-minimal) presentation of this module.
Example
kk = ZZ/101
S = kk[a,b,c]
f = matrix"a4,b4,c4"
R = S/ideal f
p = map(R,S)
M = coker map(R^2, R^{3:-1}, {{a,b,c},{b,c,a}})
betti (FF =res( M, LengthLimit =>6))
MS = prune pushForward(p, coker FF.dd_6);
resFld := pushForward(p, coker vars R);
T = exteriorTorModule(f,MS);
E = exteriorExtModule(f,MS);
hf(-4..0,E)
betti res MS
betti res (PE = prune E)
betti res (PT = prune T)
E1 = prune exteriorExtModule(f, MS, resFld);
ring E1
exRing = kk[e_0,e_1,e_2, SkewCommutative =>true]
Text
We can also construct the exteriorExtModule as a bigraded module,
over a ring SE that has both polynomial variables like S and exterior
variables like E. The polynomial variables have degrees {1,0}. The
exterior variables have degrees {deg ff_i, 1}.
Example
E1 = prune exteriorExtModule(f, MS, resFld);
ring E1
exRing = kk[e_0,e_1,e_2, SkewCommutative =>true]
Text
To see that this is really the same module, with a more complex grading,
we can bring it over to a pure exterior algebra. Note that the necessary map of rings
must contain a DegreeMap option. In general we could only take the degrees of
the generators of the exterior algebra to be the gcd of the deg ff_i ; in the
example above this is 1.
Example
q = map(exRing, ring E1, {3:0,e_0,e_1,e_2}, DegreeMap => d -> {d_1})
E2 = coker q presentation E1;
hf(-5..5,E2) == hf(-5..5,E)
SeeAlso
exteriorTorModule
makeModule
///
doc ///
Key
freeExteriorSummand
(freeExteriorSummand,Module)
Headline
find the free summands of a module over an exterior algebra
Usage
F = freeExteriorSummand M
Inputs
M:Module
over an exterior algebra
Outputs
F:Matrix
Map from a free module to M. Image is the largest free summand
Description
Text
Example
kk= ZZ/101
E = kk[e,f,g, SkewCommutative => true]
M = E^1++module ideal vars E++E^{-1}
freeExteriorSummand M
///
doc ///
Key
cosyzygyRes
(cosyzygyRes, ZZ, Module)
(cosyzygyRes, Module)
Headline
cosyzygy chain of a Cohen-Macaulay module over a Gorenstein ring
Usage
F = cosyzygyRes(len, M)
Inputs
len:ZZ
how long a chain of cosyzygies
M:Module
Should be a CM module over a Gorenstein ring
Outputs
F:ChainComplex
last map is presentation of M
Description
Text
the script returns the dual of the complex F obtained by
resolving the cokernel of the transpose of
the presentation of M
for len steps. Thus M is the len-th syzygy of the module
resolved by F. When the first argument len is omitted,
the value defaults to len = 2.
Example
S = ZZ/101[a,b,c];
R = S/ideal"a3,b3,c3";
M = module ideal vars R;
betti presentation M
betti (F = cosyzygyRes(3,M))
cosyzygyRes M
///
doc ///
Key
BRanks
(BRanks, List)
Headline
ranks of the modules B_i(d) in a matrixFactorization
Usage
br = BRanks MF
Inputs
MF:List
output of a matrixFactorization computation
Outputs
br: List
list of pairs {rank B_1(d), rank B_0(d)}
Description
Example
c = 2
S = ZZ/32003[x_0..x_(c-1),a_(0,0)..a_(c-1,c-1)];
A = genericMatrix(S,a_(0,0),c,c);
f = matrix{{x_0..x_(c-1)}}*map(S^{c:-1},S^{c:-2},A)
R = S/ideal f;
kR = R^1/ideal(x_0..x_(c-1))
MF = matrixFactorization(f,highSyzygy kR)
netList BRanks MF
netList dMaps MF
netList bMaps MF
netList psiMaps MF
SeeAlso
matrixFactorization
bMaps
dMaps
psiMaps
hMaps
///
doc ///
Key
ARanks
(ARanks, List)
Headline
ranks of the modules A_i(d) in a matrixFactorization
Usage
AR = ARanks MF
Inputs
MF:List
output of a matrixFactorization computation
Outputs
AR: List
list of pairs {rank A_1(p), rank A_0(p)}
Description
Text
See example in the description of BRanks
SeeAlso
matrixFactorization
BRanks
bMaps
dMaps
psiMaps
hMaps
///
doc ///
Key
bMaps
(bMaps, List)
Headline
list the maps d_p:B_1(p)-->B_0(p) in a matrixFactorization
Usage
bmaps = bMaps mf
Inputs
mf:List
output of a matrixFactorization computation
Outputs
bmaps: List
list of matrices $d_p: B_1(p)\to B_0(p)$
Description
Text
See the documentation for matrixFactorization for an example.
SeeAlso
matrixFactorization
BRanks
dMaps
psiMaps
hMaps
///
doc ///
Key
dMaps
(dMaps, List)
Headline
list the maps d(p):A_1(p)--> A_0(p) in a matrixFactorization
Usage
amaps = dMaps mf
Inputs
mf:List
output of a matrixFactorization computation
Outputs
amaps: List
list maps $d_p: B_1(p)\to B_0(p)$
Description
Text
See the documentation for matrixFactorization for an example.
SeeAlso
matrixFactorization
BRanks
bMaps
psiMaps
hMaps
///
doc ///
Key
hMaps
(hMaps, List)
Headline
list the maps h(p): A_0(p)--> A_1(p) in a matrixFactorization
Usage
hMaps = hMaps mf
Inputs
mf:List
output of a matrixFactorization computation
Outputs
hMaps: List
list matrices $h_p: A_0(p)\to A_1(p)$. The sources and targets of these
maps have the components B_s(p).
Description
Text
See the documentation for matrixFactorization for an example.
SeeAlso
matrixFactorization
dMaps
BRanks
bMaps
psiMaps
///
doc ///
Key
psiMaps
(psiMaps, List)
Headline
list the maps psi(p): B_1(p) --> A_0(p-1) in a matrixFactorization
Usage
psmaps = psiMaps mf
Inputs
mf:List
output of a matrixFactorization computation
Outputs
psmaps: List
list matrices $d_p: B_1(p)\to A_0(p-1)$
Description
Text
See the documentation for matrixFactorization for an example.
SeeAlso
matrixFactorization
BRanks
bMaps
dMaps
hMaps
///
doc ///
Key
sumTwoMonomials
(sumTwoMonomials, ZZ,ZZ)
Headline
tally the sequences of BRanks for certain examples
Usage
sumTwoMonomials(c,d)
Inputs
c:ZZ
codimension in which to work
d:ZZ
degree of the monomials to take
Outputs
T:Tally
Description
Text
tallies the sequences of B-ranks that occur for sums of pairs of
monomials in R = S/(d-th powers of the variables), with
full complexity (=c); that is,
for an appropriate syzygy M of
M0 = R/(m1+m2)
where m1 and m2 are monomials of the same degree.
Example
setRandomSeed 0
sumTwoMonomials(2,3)
SeeAlso
twoMonomials
///
doc ///
Key
twoMonomials
(twoMonomials, ZZ,ZZ)
[twoMonomials,Optimism]
Headline
tally the sequences of BRanks for certain examples
Usage
T = TwoMonomials(c,d)
Inputs
c:ZZ
codimension in which to work
d:ZZ
degree of the monomials to take
Outputs
T:Tally
Description
Text
tallies the sequences of B-ranks that occur for
ideals generated by pairs of
monomials in R = S/(d-th powers of the variables), with
full complexity (=c); that is,
for an appropriate syzygy M of
M0 = R/(m1, m2)
where m1 and m2 are monomials of the same degree.
Example
setRandomSeed 0
twoMonomials(2,3)
SeeAlso
twoMonomials
///
doc ///
Key
BGGL
Headline
Exterior module to linear complex
Usage
L = BGGL(P,S)
Inputs
P:Module
module over an exterior algebra
S:Ring
polynomial ring on the same number of vars
Outputs
L:ChainComplex
linear chain complex over S corresponding to P
Description
Text
Implements the left adjoint BGG functor. The more primitive
function SymExt does this only for linearly presented exterior
modules.
Example
E = ZZ/101[a,b,c,d, SkewCommutative => true]
P = E^1/ideal(a*b,c)
betti res P
hf(0..3, P)
S = ZZ/101[x,y,z,w]
betti BGGL(P,S)
Caveat
This script really belongs in the BGG package.
///
doc ///
Key
hf
(hf, Sequence, Module)
(hf, List, Module)
Headline
Computes the hilbert function in a range of degrees
Usage
H = hf(s,P)
Inputs
s:Sequence
or List
P:Module
graded module
Outputs
H:List
///
doc ///
Key
isQuasiRegular
(isQuasiRegular, Matrix, Module)
(isQuasiRegular, Sequence, Module)
(isQuasiRegular, List, Module)
Headline
tests a matrix or sequence or list for quasi-regularity on a module
Usage
t = isQuasiRegular(ff,M)
Inputs
ff:Matrix
ff:List
ff:Sequence
M:Module
Outputs
t:Boolean
Description
Text
ff is quasi-regular if the length of ff is <= dim M and the annihilator of ff_i on
M/(ff_0..ff_{(i-1))}M has finite length for all i=0..(length ff)-1.
Example
kk=ZZ/101;
S = kk[a,b,c];
E = S^1/ideal"ab"++S^1/ideal vars S;
f1 =matrix"a";
f2 =matrix"a+b,c";
f3 = matrix"a+b";
f4 = matrix"a+b, a2+b";
isQuasiRegular(f1,E)
isQuasiRegular(f2,E)
isQuasiRegular(f3,E)
isQuasiRegular(f4,E)
///
doc ///
Key
stableHom
(stableHom, Module, Module)
Headline
map from Hom(M,N) to the stable Hom module
Usage
p = stableHom(M,N)
Inputs
M:Module
N:Module
Outputs
p:Matrix
projection from Hom(M,N) to the stable Hom
Description
Text
The stable Hom is Hom(M,N)/T where T is the submodule of homomorphisms
that factor through a free cover of N (or, equivalently, through any projective)
SeeAlso
isStablyTrivial
///
doc ///
Key
isStablyTrivial
(isStablyTrivial, Matrix)
Headline
returns true if the map goes to 0 under stableHom
Usage
b = isStablyTrivial f
Inputs
f:Matrix
map M to N
Outputs
b:Boolean
true iff f factors through a projective
Description
Text
A possible obstruction to the commutativity of the CI operators in codim c,
even asymptotically,
would be the non-triviality of the map
M_{(k+4)} --> M_k \otimes \wedge^2(S^c)
in the stable category of maximal Cohen-Macaulay modules.
In the following example, studied in the paper
"Tor as a module over an exterior algebra" of
Eisenbud, Peeva and Schreyer,
the map is non-trivial...but it is stably trivial.
The same goes for higher values of k (which take longer to compute).
(note that in this case, with c = 3, two of the three alternating products are
actually equal to 0, so we test only the third.)
Note that T is well-defined up to homotopy; so T^2 is well-defined
mod mm^2.
Example
kk = ZZ/101
S = kk[a,b,c]
ff = matrix"a2,b2,c2"
R = S/ideal ff
M = R^1/ideal"a,bc"
k = 1
m = k+5
F = res(M, LengthLimit => m)
syzygies = apply(1..m, i->coker F.dd_i);
t1 = makeT(ff,F,k+4);
t2 = makeT(ff,F,k+2);
T2Components = flatten for i from 0 to 1 list(for j from i+1 to 2 list map(F_k, F_(k+4), t2_i*t1_j-t2_j*t1_i));
g = map(syzygies_k, syzygies_(k+4), T2Components_2)
isStablyTrivial g
SeeAlso
stableHom
///
doc ///
Key
Shamash
(Shamash, Matrix, ChainComplex, ZZ)
(Shamash, Ring, ChainComplex, ZZ)
Headline
Computes the Shamash Complex
Usage
FF = Shamash(ff,F,len)
FF = Shamash(Rbar,F,len)
Inputs
ff:Matrix
1 x 1 Matrix over ring F.
Rbar:Ring
ring F mod ideal ff
F:ChainComplex
defined over ring ff
len: ZZ
Outputs
FF: ChainComplex
chain complex over (ring F)/(ideal ff)
Description
Text
Let R = ring F = ring ff, and Rbar = R/(ideal f), where ff = matrix{{f}}
is a 1x1 matrix whose entry is a nonzerodivisor in R.
The complex F should admit a system of higher homotopies for the entry of ff,
returned by the call makeHomotopies(ff,F).
The complex FF has terms
FF_{2*i} = Rbar**(F_0 ++ F_2 ++ .. ++ F_i)
FF_{2*i+1} = Rbar**(F_1 ++ F_3 ++..++F_{2*i+1})
and maps made from the higher homotopies.
For the case of a complete
intersection of higher codimension, or to see the components of the resolution as summands
of FF_j, use the routine EisenbudShamash instead.
Example
S = ZZ/101[x,y,z]
R = S/ideal"x3,y3"
M = R^1/ideal(x,y,z)
F = res M
ff = matrix{{z^3}}
R1 = R/ideal ff
betti F
FF = Shamash(ff,F,4)
GG = Shamash(R1,F,4)
betti FF
betti GG
ring GG
apply(length GG, i->prune HH_i FF)
Caveat
F is assumed to be a homological complex starting from F_0.
The matrix ff must be 1x1.
SeeAlso
EisenbudShamash
makeHomotopies
///
doc ///
Key
EisenbudShamash
(EisenbudShamash, Matrix, ChainComplex, ZZ)
(EisenbudShamash, Ring, ChainComplex, ZZ)
Headline
Computes the Eisenbud-Shamash Complex
Usage
FF = Shamash(ff,F,len)
FF = Shamash(Rbar,F,len)
Inputs
ff:Matrix
1 x c Matrix over ring F.
Rbar:Ring
ring F mod ideal ff
F:ChainComplex
starting from F_0, defined over the same ring as ff
len: ZZ
Outputs
FF:ChainComplex
chain complex over (ring F)/(ideal ff)
Description
Text
Let R = ring F = ring ff, and Rbar = R/(ideal ff).
The complex F should admit a system of higher homotopies for the entries of ff,
returned by the call makeHomotopies(ff,F).
When the entries of ff form a regular sequence on ring F, the Shamash
complex is a resolution.
Example
x = symbol x
S = ZZ/101[x_0..x_4]
F = res coker vars S
ff = matrix{{x_0^2,x_1^3}}
R = S/(ideal ff)
len = 10
time G = EisenbudShamash(ff,F,len)
apply(length G -1, i->prune HH_(i+1) G)
Text
The complex G has terms that are abstractly
G_i = F_i ++ D_1**F_{i-2} ++ D_2**F_{i-4}...
where D_i is the i-th divided power of the free module source ff.
In fact the term D_i**F_j is the direct sum of copies of F_j, indexed by
the basis t^{e} of the divided power, each twisted by
the degree of t^{e}. This basis is in 1-1 correspondence with the partitions
of c = numcols ff,
with i parts, produced by the function expo(c,i), as can be seen in the following:
Example
betti F
G5 = (G_5).cache.components
Text
Thus, c = 2, so D_i = R^{i+1}, and
G5 is the direct sum F_5 ++ R^2**F_3 ++ R^3**F_1. Moreover,
D_1 has two exponents,
Example
expo(numcols ff, 1)
Text
So G5_1 will have two components, both isomorphic to R**F_3 = R^{10}:
Example
G51 = (G5_1).cache.components
Text
All the decompositions seem to impose a certain overhead, and in the case
where it applies, namely c=1, the routine Shamash is faster:
Example
S = ZZ/101[a..f]
R = S/ideal"a3,b3"
M = coker vars R
F = res M
betti F
ff = matrix"c3"
R1 = R/ideal ff
FF = time Shamash(R1,F,4)
GG = time EisenbudShamash(ff,F,4)
Text
The function also deals correctly with complexes F where min F is not 0:
Example
GG = time EisenbudShamash(R1,F[2],4)
SeeAlso
makeHomotopies
Shamash
expo
///
doc ///
Key
layeredResolution
(layeredResolution, Matrix, Module)
(layeredResolution, Matrix, Module, ZZ)
[layeredResolution,Verbose]
[layeredResolution,Check]
Headline
layered finite and infinite layered resolutions of CM modules
Usage
(FF, aug) = layeredResolution(ff,M)
(FF, aug) = layeredResolution(ff,M,len)
Inputs
ff:Matrix
1 x c matrix whose entries are a regular sequence in the Gorenstein ring S
M:Module
MCM module over R, represented as an S-module in the first case and as an R-module in the second
len:ZZ
length of the segment of the resolution to be computed over R, in the second form.
Outputs
FF:ChainComplex
resolution of M over S in the first case; length len segment of the resolution over R in the second.
Description
Text
The resolutions computed are those described in the paper "Layered Resolutions of Cohen-Macaulay modules"
by Eisenbud and Peeva. They are both minimal when M is a suffiently high syzygy of a module N.
If the option Verbose=>true is set, then (in the case of the resolution over S) the ranks of the
modules B_s in the resolution are output.
Here is an example computing 5 terms of an infinite resolution:
Example
S = ZZ/101[a,b,c]
ff = matrix"a3, b3, c3"
R = S/ideal ff
M = syzygyModule(2,coker vars R)
(FF, aug) = layeredResolution(ff,M,5)
betti FF
betti res(M, LengthLimit=>5)
C = chainComplex flatten {{aug} |apply(4, i-> FF.dd_(i+1))}
apply(4, i ->FF.dd_(i+1))
apply(5, j-> prune HH_j C == 0)
Text
And one computing the whole finite resolution:
Example
MS = pushForward(map(R,S), M);
(GG, aug) = layeredResolution(ff,MS)
(GG, aug) = layeredResolution(ff,MS, Verbose =>true)
betti GG
betti res MS
C = chainComplex flatten {{aug} |apply(length GG -1, i-> GG.dd_(i+1))}
apply(length GG +1 , j-> prune HH_j C == 0)
///
doc ///
Key
extIsOnePolynomial
(extIsOnePolynomial, Module)
Headline
check whether the Hilbert function of Ext(M,k) is one polynomial
Usage
(p,t) = extIsOnePolynomial M
Inputs
M:Module
module over a complete intersection
Outputs
p:RingElement
p(z)=pe(z/2), where pe is the Hilbert poly of Ext^{even}(M,k)
t:Boolean
true if the even and odd polynomials match to form one polynomial
Description
Text
Computes the Hilbert polynomials pe(z), po(z) of evenExtModule and oddExtModule.
It returns pe(z/2), and compares to see whether this is equal to po(z/2-1/2).
Avramov, Seceleanu and Zheng have proven that if the ideal of quadratic leading
forms of a complete intersection of codimension c generate an ideal of codimension
at least c-1, then the betti numbers of any module grow, eventually, as a
single polynomial (instead of requiring separate polynomials for even and
odd terms.) This script checks the result in the homogeneous case (in which
case the condition is necessary and sufficient.)
Example
R1=ZZ/101[a,b,c]/ideal(a^2,b^2,c^5)
R2=ZZ/101[a,b,c]/ideal(a^3,b^3)
extIsOnePolynomial coker random(R1^{0,1},R1^{3:-1})
extIsOnePolynomial coker random(R2^{0,1},R2^{3:-1})
SeeAlso
evenExtModule
oddExtModule
///
-*
doc///
Key
layeredMFaug
(layeredMFaug, Matrix, Module)
[layeredMFaug, Check]
[layeredMFaug, Verbose]
Headline
layered resolution of an MCM module, with augmentation
Usage
D = layeredMFaug (ff,M)
Inputs
ff:Matrix
1 x c matrix containing a regular sequence in a polynomial ring S
M:Module
MCM module over S/(ideal ff)
Check:Boolean
Verbose:Boolean
Outputs
D:Sequence
D = (d,h,gamma)
Description
Text
Constructs a matrix factorization for any
MCM over a complete intersection (not necessarily
a high syzyg) via the
``layered'' algorithm. If the Verbose option is set to
true, then the computation at each layer is displayed.
For example, here is an Ulrich module in codimension 2:
We take points p,q on an elliptic quartic curve in P^3
and consider the module M = O(p-q).
The equations of the curve are two general quadrics vanishing on p and q:
Example
kk = ZZ/32003
S = kk[x_0..x_3]
p = ideal (x_0-x_1,x_0-x_2,x_0-x_3)
q = ideal (x_0-2*x_1,x_0-x_2,x_0-x_3)
points = intersect(p,q);
ff = gens points*random(source gens points, S^{2:-2});
IE = ideal ff;
R = S/IE;
pR = sub(p,R);
qR = sub(q,R);
M = prune Hom(module pR, module qR); -- an R-module
Text
We can check directly that this is an Ulrich module, by
pushing it forward to S and seeing that it has a linear
resolution of length 2:
Example
betti res pushForward(map(R,S),M)
Text
We compute the layered resolution and the associated homotopies and augmentation,
giving the matrix factorization:
Example
(d,h,gamma) = layeredMFaug(ff,M, Verbose =>true);
betti d
betti h
Text
The answer is computed inductively; first (d',h'), the layeredMf
is computed for
the MCM approximation M' of M over R' = S/(ff_0..ff_(codim -2)),
and then this is combined with the ordinary matrix factorization (dc,h)
for M over R'.
We can see the parts of the result as follows. First (d',h').
Note that this is a codim 1 matrix factorization in this case
(in general it would be codim c-1):
Example
d' = (target d)^[0]*d*(source d)_[0];
betti d'
psi = (target d)^[0]*d*(source d)_[1];
betti psi
h' = (target h)^[0]*h*(source h)_[0];
betti h'
Text
and we see the homotopy properties of the matrix factorization too:
Example
0 == d'*h' - diagonalMatrix toList(8:ff_0_0)
0 == (S/ideal IE_0)**(d*h_[1] - S^{-1}**diagonalMatrix toList(8: ff_1_0))
Text
in this case we could not have computed the matrix factorization directly;
neither M nor its first syzygy satisfies the needed surjectivity conditions,
but the second syzygy does:
Example
M2 = syzygyModule(2,M);
mf = matrixFactorization(ff,M2)
SeeAlso
matrixFactorization
///
doc///
Key
layeredMF
(layeredMF, Matrix, Module)
[layeredMF, Check]
[layeredMF, Verbose]
Headline
layered resolution of an MCM module, with augmentation
Usage
D = layeredMFaug (ff,M)
Inputs
ff:Matrix
1 x c matrix containing a regular sequence in a polynomial ring S
M:Module
MCM module over S/(ideal ff)
Check:Boolean
Verbose:Boolean
Outputs
D:Sequence
D = (d,h)
Description
Text
Constructs the layered resolution with auxiliary maps.
///
*-
doc ///
Key
expo
(expo, ZZ, ZZ)
(expo, ZZ, List)
Headline
returns a set corresponding to the basis of a divided power
Usage
B = expo(c,N)
B = expo(c,L)
Inputs
N:ZZ
c:ZZ
L:List
of c non-negative integers
Outputs
B:List
partitions with c non-negative parts
Description
Text
The form expo(c,N) returns partitions of N with c non-negative parts.
The form expo(c, L) returns partitions with non-negative parts that are
componentwise <= L (and any sum <= sum L).
The list expo(c,N) may be thought of as the list of exponent vectors of the
monomials of degree N in c variables. This is used in the construction of the
Eisenbud-Shamash resolution.
The list expo(c, L), on the other hand, may be thought of as the list of divisors
of e^L = e_0^{L_0} ... e_c^{L_c}. This is used in the construction of the higher
homotopies on a complex.
Example
expo(3,5)
expo(3, {3,2,1})
SeeAlso
EisenbudShamash
makeHomotopies
///
doc ///
Key
EisenbudShamashTotal
(EisenbudShamashTotal, Module)
[EisenbudShamashTotal,Check]
[EisenbudShamashTotal,Variables]
[EisenbudShamashTotal,Grading]
Headline
Precursor complex of total Ext
Usage
(d0,d1) = EisenbudShamashTotal M
Inputs
M:Module
over a complete intersection
Outputs
d0:Matrix
map of free modules over an enlarged ring
d1:Matrix
map of free modules over an enlarged ring
Description
Text
Assume that M is defined over a ring of the form
Rbar = R/(f_0..f_{c-1}), a complete intersection, and that
M has a finite free resolution G over R. In this case M has a
free resolution F over Rbar
whose dual, F^* is a finitely generated, Z-graded free module
over a ring Sbar\cong kk[s_0..s_{c-1},gens Rbar],
where the degrees of the s_i are {-2, -degree f_i}.
This resolution is is constructed from the
dual of G,
together with the duals of the higher homotopies on G defined by Eisenbud.
The function returns the differentials d0:F^*_{even} \to F^*_{odd} and
d1:F^*_{odd}\to F^*_{even}.
The maps d0,d1 form a matrix factorization
of sum(c, i->s_i*f_i). The have the property that for any Rbar module N,
HH_1 chainComplex \{d0**N, d1**N\} = Ext^{even}_{Rbar}(M,N)
S^{{1,0}}**HH_1 chainComplex \{S^{{-2,0}}**d1**N, d0**N\} = Ext^{odd}_{Rbar}(M,N)
This is encoded in the script newExt
Option defaults:
Check=>false
Variables=>getSymbol "s",
Grading =>2}
If Grading =>1, then a singly graded result is returned (just forgetting the
homological grading.)
Example
n = 3
c = 2
kk = ZZ/101
R = kk[x_0..x_(n-1)]
I = ideal(x_0^2, x_2^3)
ff = gens I
Rbar = R/I
bar = map(Rbar, R)
Mbar = prune coker random(Rbar^1, Rbar^{-2})
(d0,d1) = EisenbudShamashTotal(Mbar,Grading =>1)
d0*d1
d1*d0
S = ring d0
phi = map(S,R)
IS = phi I
Sbar = S/IS
SMbar = Sbar**Mbar
Text
Hom(d0,Sbar) and Hom(d1,Sbar) together form the resolution of Mbar;
thus the homology of one composition is 0, while the other is Mbar
Example
prune HH_1 chainComplex{dual (Sbar**d0), dual(Sbar**d1)} == 0
Mbar' = Sbar^1/(Sbar_0, Sbar_1)**SMbar
ideal presentation prune HH_1 chainComplex{dual (Sbar**d1), dual(Sbar**d0)} == ideal presentation Mbar'
SeeAlso
Ext
newExt
makeHomotopies
///
------TESTs------
TEST///
--An example where the built-n global Ext is hard to compare directly
--with our method of computation: I *guess* that the sign choices in the built-in
--amount essentially to a change of variable
--in the new variables, an spoil an easy comparison.
--But for example the bi-graded betti numbers are equal.
--this seems to start with c=3.
restart
loadPackage "CompleteIntersectionResolutions"
setRandomSeed 0
n = 3
c = 3
kk = ZZ/101
R = kk[x_0..x_(n-1)]
I = ideal apply(c, i->R_i^2)
ff = gens I
Rbar = R/I
bar = map(Rbar, R)
K = coker vars Rbar
Mbar = prune coker random(Rbar^2, Rbar^{-2,-2})
--now do Ext(Mbar,K) our way:
ES = newExt(Mbar,K,Lift => true)
S = ring ES
--compare with the built-in:
EE = Ext(Mbar,K);
S' = ring EE -- note that S' is the polynomial ring
--The two verstions of Ext appear to be the same up to change of variables:
A = res ES
B = res EE
assert all(length A+1, i-> sort degrees A_i == sort degrees B_i)
--but they have apparently different annihilators
ann EE
ann ES
--and in fact they are not isomorphic:
EEtoES = map(ring ES,ring EE, gens ring ES)
EE' = coker EEtoES presentation EE
H = Hom(EE',ES);
Q = positions(degrees target presentation H, i-> i == {0,0})
f = sum(Q, p-> random (S^1, S^1)**homomorphism H_{p})
assert (prune coker f != 0)
Mbar = prune coker random(Rbar^2, Rbar^{-2,-2}) -- this gives trouble
///
TEST///
--restart
--loadPackage "CompleteIntersectionResolutions"
setRandomSeed 0
n = 3
c = 2
kk = ZZ/101
R = kk[x_0..x_(n-1)]
I = ideal apply(c, i->x_i^2)
ff = gens I
Rbar = R/I
bar = map(Rbar, R)
Mbar = prune coker random(Rbar^2, Rbar^{-2,-3})
(d0,d1) = EisenbudShamashTotal(Mbar, Check => true)
S = ring d0
RtoS = map(S,R)
SI = RtoS I
Sbar = S/SI
RbartoSbar = map(Sbar,Rbar,DegreeMap => d->prepend(0,d))
N = prune coker RbartoSbar presentation Mbar;
E = prune (
HH_1 chainComplex {d0**N, d1**N}++
Sbar^{{1,0}}**HH_1 chainComplex {Sbar^{{-2,0}}**d1**N, d0**N}
);
EE = Ext(Mbar,Mbar);
gens ring E
EEtoE = map (Sbar, ring EE, gens Sbar)
assert isHomogeneous EEtoE
E' = coker EEtoE presentation EE;
H = Hom(E,E');
Q = positions(degrees target presentation H, i-> i == {0,0})
f = sum(Q, p-> random (Sbar^1, Sbar^1)**homomorphism H_{p})
assert (prune coker f == 0)
///
TEST///
---complete intersection of two quadrics in PP^3
kk = ZZ/101
U = kk[a,b,c,d]
gg = matrix"a2,b2"
Ubar = U/ideal gg
use Ubar
Mbar = coker matrix"ab,bc,bd,cd"
--
(d0,d1)= EisenbudShamashTotal (Mbar, Check=>true, Variables => getSymbol "X", Grading => 1)
(d0,d1)= EisenbudShamashTotal Mbar
S = ring d0
UtoS = map(S,U,DegreeMap => d ->{0,d_0})
assert(target d1 == source d0)
assert(target d0 == S^{{-2,0}}**source d1)
sg = sum(numcols gg, i->S_i*UtoS gg_i_0)
assert (0==d1*d0-diagonalMatrix toList(numrows d1:sg) )
Sbar= S/ideal UtoS gg
UbartoSbar= map(Sbar,Ubar,DegreeMap => d->prepend(0,d))
kSbar = coker UbartoSbar(vars Ubar)
bar = map(Sbar,S)
d1bar = bar d1
d0bar = bar d0
isHomogeneous(Heven = homology(d0bar**kSbar,d1bar**kSbar))
isHomogeneous(Hodd = homology(S^{{-2,0}}**d1bar**kSbar,d0bar**kSbar))
E1 = Sbar^{{1,0}}**prune Hodd
E0 = prune Heven
E = Ext(Mbar,coker vars Ubar)
assert (sort(degrees E0 |degrees E1)==sort degrees E)
isHomogeneous(Heven = homology(d0bar,d1bar))
isHomogeneous(Hodd = homology(S^{{-2,0}}**d1bar,d0bar))
E1 = Sbar^{{1,0}}**prune Hodd
E0 = prune Heven
E = prune Ext(Mbar,Ubar^1)
assert (sort(degrees E0 |degrees E1)==sort degrees E)
///
TEST/// -- tests of the "with components" functions
S = ZZ/101[a,b]
M = S^{1,2}
N = S^{3,5}
M' = (S^{1}++S^{2})
N' = S^{3}++S^{5}
H = Hom(M,N)
T = M**N
D = dual M
H' = HomWithComponents (M',N')
T' = tensorWithComponents(M',N')
D' = dualWithComponents M'
assert( H == H' and T == T' and D == D')
assert(HomWithComponents(M',N') == tensorWithComponents(dualWithComponents M', N'))
assert(components HomWithComponents(M',N') == components tensorWithComponents(dualWithComponents M', N'))
M = S^{1,2}/ideal(a^2)
M' = S^{1}/ideal(a^2)++S^{2}/ideal(a^2)
M == M'
(T = M**N) == M'**N'
assert(T == tensorWithComponents(M',N'))
M= S^0
M'=S^0++S^0
assert(M**M == tensorWithComponents (M',M'))
///
TEST///
setRandomSeed 0
R1=ZZ/101[a,b,c]/ideal(a^2,b^2,c^5)
R2=ZZ/101[a,b,c]/ideal(a^3,b^3)
(p,t) = extIsOnePolynomial coker random(R1^{0,1},R1^{3:-1});
assert(t === true)
z = (ring p)_0
assert(p ===(1/2)*z^2-(1/2)*z+3)
(p,t) = extIsOnePolynomial coker random(R2^{0,1},R2^{3:-1});
z = (ring p)_0
assert(t === false)
assert(p ===(3*z - 2))
///
TEST///
assert (expo(2,4) == {{4, 0}, {3, 1}, {2, 2}, {1, 3}, {0, 4}})
expo(3,0)
///
TEST///
setRandomSeed 100
c = 2
d = 2
R = setupRings(c,d)
(M,k,p) = setupModules(R,coker vars R_c);
regularitySequence(R,coker vars R_c)
///
///TEST
S1 = ZZ/101[a,b,c]
len = 4
--codim 0
ff = matrix{{}}
M = S1^1
(FF, aug) = layeredResolution(ff,M,len)
betti FF == betti res(M, LengthLimit=>len)
--codim 1
use S1
ff = matrix"a3"
R1 = S1/ideal ff
M = syzygyModule(3,coker vars R1)
(FF, aug) = layeredResolution(ff,M,len)
betti FF == betti res(M, LengthLimit=>len)
--codim 2
use S1
ff = matrix"a3, b3"
R1 = S1/ideal ff
M = syzygyModule(2,coker vars R1)
(FF, aug) = layeredResolution(ff,M,len)
assert(betti FF == betti res(M, LengthLimit=>len))
--codim 3
use S1
len = 5
ff = matrix"a3, b3, c3"
R1 = S1/ideal ff
M = syzygyModule(2,coker vars R1)
(FF, aug) = layeredResolution(ff,M,len)
assert(betti FF == betti res(M, LengthLimit=>len))
C = chainComplex flatten {{aug} |apply(len-1, i-> FF.dd_(i+1))}
scan(len, j-> assert(prune HH_j C == 0))
///
TEST///
S = ZZ/101[a,b,c]
ff1 = matrix"a3,b3,c3"
setRandomSeed 0
ff = ff1*random(source ff1, source ff1)
R = S/(ideal ff)
M = coker matrix {{R_0,R_1,R_2},{R_1,R_2,R_0}}
F = res coker vars R
F0 = res (M, LengthLimit =>3)
makeT(ff, F0, 4)
min F0
--generateAssertions"makeT(ff, F0, 2)"
assert( (makeT(ff, F0, 2)) === {map((R)^{{-3},{-3}},(R)^{{-3},{-3},{-3},{-3},{-3}},{{39, 0, 0, -26, 0},
--------------------------------------------------------------------------------------------------------
{0, 39, 0, 0, 26}}),map((R)^{{-3},{-3}},(R)^{{-3},{-3},{-3},{-3},{-3}},{{33, 0, 0, 31, 0}, {0, 33, 0, 0,
--------------------------------------------------------------------------------------------------------
-31}}),map((R)^{{-3},{-3}},(R)^{{-3},{-3},{-3},{-3},{-3}},{{8, 0, 0, -31, 0}, {0, 8, 0, 0, 31}})} );
///
///TEST
S = ZZ/101[x,y,z]
R = S/ideal"x3,y3"
M = R^1/ideal(x,y,z)
F = res M
ff = matrix{{z^3}}
FF = Shamash(ff,F,4)
scan(length FF -1, i->assert(0==(HH_(i+1)FF)))
Rbar = R/ideal(z^3)
assert (Shamash(Rbar,F,4) == (map(Rbar,ring FF))FF)
///
TEST///
kk=ZZ/101
S = kk[a,b]
ff = matrix"a4,b4"
R = S/ideal ff
N = coker vars R
M = highSyzygy N
mf = matrixFactorization(ff, M)
h = (hMaps mf)_1
h' = map(target h, source h,
matrix apply (#components target h, j->(apply(#components source h, i-> h^[j]_[i])))
)
assert(h==h')
components target h
components source h
assert(h == h')
h = (hMaps mf)_0
h' = map(target h, source h,
matrix apply (#components target h, j->(apply(#components source h, i-> h^[j]_[i])))
)
assert(h == h')
///
TEST///
S = ZZ/101[a,b,c];
ff = matrix"a3,b3";
R = S/ideal ff;
M = highSyzygy (R^1/ideal vars R)
mf = matrixFactorization (ff, M)
G = makeFiniteResolution(ff,mf)
F = res pushForward(map(R,S),M)
assert(betti G == betti F)
///
TEST///
kk = ZZ/101;
S = kk[a,b,c];
ff = matrix{{a^4, b^4,c^4}};
R = S/ideal ff;
Ops = kk[x_1,x_2,x_3];
MM = Ops^1/(x_1*ideal(x_2^2,x_3));
N = moduleAsExt(MM,R);
assert( hf(-7..6, N) == {0, 18, 48, 108, 177, 222, 254, 227, 180, 128, 66, 33, 11, 0})
assert(hfModuleAsExt(12,MM,3) == (23, 25, 27, 29, 31, 33, 35, 37, 39, 41));
///
TEST///
--Example 0
kk = ZZ/101
S = kk[a,b]
ff = matrix"ab"
R = S/ideal ff
M0 = R^1/ideal"a,b"
assert(2==regularity ExtModule M0)
len = 2
F = res(M0, LengthLimit =>len)
MF = matrixFactorization(ff, coker F.dd_len, Check=>true)
use S
assert(BRanks MF=={{2,2}})
///
TEST///
--Example 0a
kk = ZZ/101
S = kk[a,b,c]
ff = matrix"ac-b2"
R = S/ideal ff
m = matrix"a,b;b,c"
betti m
M0 = coker m
MF = matrixFactorization(ff,highSyzygy M0)
BRanks MF=={{2,2}}
///
TEST///
--Example1
kk = ZZ/101
S = kk[a,b,u,v]
ff = matrix"au,bv"
R = S/ideal ff
M0 = R^1/ideal"a,b"
MF = matrixFactorization(ff,highSyzygy M0)
toString MF == "{matrix {{0, u, v, 0}, {-a, b, 0, 0}, {0, 0, -a, b}}, matrix {{b, -u, 0, 0, 0}, {a, 0, 0, v, 0}, {0, 0, b, -u, 0}, {0, 0, a, 0, v}}}"
assert(BRanks MF =={{2,2}, {1,2}})
///
TEST///--Example2
kk = ZZ/101
S = kk[a,b]
ff = matrix{{a^3,b^3}}
R = S/ideal ff;
M0=R^1/ideal"ab"
MF = matrixFactorization (ff, highSyzygy M0)
assert(BRanks MF == {{2, 2}, {1, 2}})
///
TEST///
--Example3
kk = ZZ/101
S = kk[a,b,c]
ff = matrix"a3,b3,c3"
betti ff
ff1 = ff*random(S^{3: -3}, S^{3: -3})
R = S/ideal ff;
M0= R^1/ideal"ab"
use S
MF = matrixFactorization (ff1, highSyzygy M0)
BRanks MF
assert(BRanks MF == {{2, 2}, {1, 2}})
///
TEST///
--Example4
S = ZZ/101[a,b,c,d]
mm= ideal vars S
ff = (matrix"a3,b3,c3,d3")
ff1 = ff*random(source ff, source ff);
R = S/(ideal ff);
M0 = coker map(R^1, R^{-2,-3}, matrix"a2,bcd")
MF = matrixFactorization(ff1,highSyzygy M0);
assert(BRanks MF=={{8, 8}, {8, 12}, {9, 16}, {11, 21}});
///
TEST///
--Formerly bad example. Now seems fine
S = ZZ/32003[x_0..x_2]
f = matrix{{x_0^5, x_1^5, x_2^5}}
ff = f*random(source f, source f)
R = S/ideal f
m1 = {x_0^2*x_2^4, x_0*x_1^4*x_2}
M0 = R^1/ideal(m1_0+m1_1);
MF = matrixFactorization(ff, highSyzygy M0);
assert(BRanks MF=={{6, 6}, {5, 7}, {5, 8}})
///
TEST///
kk= ZZ/101
S = kk[x,y,z]
t = random(S^{2:-1,2:-2}, S^{3:-1,4:-2})
t = id_(S^2)
betti t
isSurjective t
ss = splittings(syz t, t)
ss/betti
(A,B) = (syz t, t)
spl = splittings(A,B)
sigma = spl_0; tau=spl_1;
assert(A*sigma+tau*B == id_(source B));
assert(sigma*tau==0);
assert(B*tau == id_(target B));
assert(sigma*A == id_(source A));
///
TEST///
S = ZZ/101[a,b,c];
M = S^2/ideal"a,b"++S^3/ideal"b,c";
N = coker random (S^{0,1}, S^{-1});
g = homomorphism' id_M;
assert(id_M == homomorphism g)
assert(isStablyTrivial id_M == false)
assert(isStablyTrivial(map(M, cover M, 1))==true)
///
///TEST
setRandomSeed 0
S = ZZ/101[a,b,c,d]
ff1 = matrix"a3,b3,c3,d3"
ff =ff1*random(source ff1, source ff1)
R = S/ideal ff
M = highSyzygy (R^1/ideal"a2b2")
assert(complexity M==2)
mf = matrixFactorization (ff, M)
assert(complexity mf ==2)
BRanks mf
assert(BRanks mf == {{2, 2}, {1, 2}})
G = makeFiniteResolution(ff,mf);
R1 = ring G
F = res prune pushForward(map(R,R1),M);
assert(betti F == betti G)
///
///TEST
S = ZZ/101[x,y,z];
ff = matrix"x3,y3,z3";
R = S/ideal ff;
M = coker matrix"x,y,z;y,z,x";
betti (F = res M)
assert( (makeT(ff,F,3)) === {map(R^{{-4},{-4},{-4}},R^{{-4},{-4},{-4},{-4},{-4},{-4}},{{0, 0, 0, 0, 1,
--------------------------------------------------------------------------------------------------------
0}, {0, 0, 0, -1, 0, 0}, {0, 0, 0, 0, 0,
--------------------------------------------------------------------------------------------------------
1}}),map(R^{{-4},{-4},{-4}},R^{{-4},{-4},{-4},{-4},{-4},{-4}},{{0, 1, 0, 0, 0, 0}, {1, 0, 0, 0, 0, 0},
--------------------------------------------------------------------------------------------------------
{0, 0, 1, 0, 0, 0}}),map(R^{{-4},{-4},{-4}},R^{{-4},{-4},{-4},{-4},{-4},{-4}},{{0, -1, 0, 0, -1, 0},
--------------------------------------------------------------------------------------------------------
{-1, 0, 0, 1, 0, 0}, {0, 0, -1, 0, 0, -1}})} );
///
///TEST -- of ExtModule, evenExtModule, oddExtModule, ExtModuleData
kk = ZZ/101
S = kk[a,b,c]
R = S/ideal"a2,b3,c4"
M = R^1/ideal"a,b,c"
assert ((rank ExtModule M ==8) and (isFreeModule ExtModule M))
assert (rank evenExtModule M == 4)
assert (rank oddExtModule M == 4)
E = ExtModuleData M
assert (rank E_0 == 4 and rank E_1 == 4 and E_2==1 and E_3==1)
///
TEST ///--of S2
S = ZZ/101[a,b,c];
M = S^1/intersect(ideal"a,b", ideal"b,c",ideal"c,a");
--assert( (hf(-7..1,coker S2(-5,M))) === (0, 3, 3, 3, 3, 3, 3, 2, 0))
assert( (betti prune matrix S2(-5,M)) === new BettiTally from {(0,{-6},-6) => 3, (1,{0},0) => 1} )
///
TEST/// --test of splittings
setRandomSeed 100
kk= ZZ/101
S = kk[x,y,z]
t = random(S^{2:-1,2:-2}, S^{3:-1,4:-2})
(A,B) = (syz t, t);
ss = splittings(A,B);
sigma = ss_0;
tau = ss_1;
assert(A*sigma+tau*B == id_(source B));
assert(sigma*tau==0);
assert(B*tau == id_(target B));
assert(sigma*A == id_(source A));
(a,b) = (transpose ss_0, transpose ss_1);
ss=splittings(a,b);
sigma = ss_0;
tau = ss_1;
assert(a*sigma+tau*b == id_(source b));
assert(sigma*tau==0);
assert(b*tau == id_(target b));
assert(sigma*a == id_(source a));
///
TEST///
kk=ZZ/101;
S = kk[a,b,c];
ff = matrix{{a^2,b^2}};
R = S/ideal ff;
red = map(R,S);
F = res (ideal (vars R)_{0..2}, LengthLimit => 3);
MS2 = pushForward(red, coker F.dd_3);
MS1 = pushForward(red, coker F.dd_2);
T = exteriorTorModule(ff, MS2, MS1);
assert(apply(10, d->rank source basis({d,1}, T))==
apply(10, d->rank source basis(d, Tor_1(MS2, MS1))));
T1 = exteriorTorModule(ff, MS2);
assert(apply(10, d->rank source basis(d, T1))==
apply(10, d->rank source basis(Tor_d(MS2,coker vars ring MS2))))
Ex1 = exteriorHomologyModule(ff, (coker vars ring ff)**dual res MS2);
assert(apply(10, d->rank source basis(-d, Ex1))=={0, 0, 5, 7, 1, 3, 0, 0, 0, 0});
///
TEST///
kk=ZZ/101
S = kk[a,b,c]
extring = kk[e_0,e_1, Degrees =>{2:1}, SkewCommutative =>true]
simplify = t ->(
toe := map(extring, ring t, {3:0, e_0,e_1}, DegreeMap => i->{i_1});
toe presentation t)
ff = matrix{{a^2,b^2}}
R = S/ideal ff
red = map(R,S)
F = complete res (ideal (vars R)_{0..2}, LengthLimit => 7)
M = apply(7, i-> coker F.dd_(i+1));
MS = M/(Mi -> pushForward(red, Mi));
C = (complete res MS_1)**MS_0;
T0 = apply(7, i -> exteriorTorModule(ff,MS_i));
T1 = apply(7, i -> exteriorTorModule(ff, MS_i, coker vars S));
T2 = apply(7, i -> exteriorHomologyModule(ff, (complete res MS_i)**coker vars S));
assert( (apply(T0, t->isHomogeneous t)) === {true,true,true,true,true,true,true} );
assert( (apply(T1, t->isHomogeneous t)) === {true,true,true,true,true,true,true} );
assert( (apply(T2, t->isHomogeneous t)) === {true,true,true,true,true,true,true} );
assert(apply (7, i->betti prune coker simplify T1_i == betti prune presentation T0_i)==
{true,true,true,true,true,true,true} );
assert(apply (7, i-> betti prune coker simplify T2_i == betti prune presentation T0_i)==
{true,true,true,true,true,true,true} );
///
TEST///
SE = ZZ/101[a,b,c,x,y,Degrees=>toList(3:{1,0})|toList(2:{1,1}), SkewCommutative=>{x,y}]
RE = SE/ideal"a2,b2,c2"
T = hashTable {{0,RE^1},{1,RE^{2:{ -1,-1}}}, {2,RE^{{ -2,-2}}}}
E = matrix{{x,y}}
F=apply(2, j-> source E_{j})
phi = hashTable{
{{0,0}, map(T#1, F_0**T#0, T#1_{0})},
{{1,0}, map(T#1, F_1**T#0, T#1_{1})},
{{0,1}, map(T#2, F_0**T#1, T#1^{1})},
{{1,1}, -map(T#2, F_1**T#1, T#1^{0})}
}
assert(apply(keys phi, k->isHomogeneous phi#k) == {true, true, true, true});
X = makeModule(T,E,phi);
assert(isHomogeneous X==true);
q = map(ZZ/101[x,y, SkewCommutative => true, DegreeMap => d->{d_1}], ring X, {3:0,x,y})
E = prune coker q presentation X;
assert(isFreeModule E);
assert(rank E==1);
///
///TEST
R = ZZ/101[a,b,c]/ideal"a3,b3,c3"
M = R^1/ideal"ab,ac,bc"
U = ZZ/101[A,B,C]
Ee = evenExtModule(M, OutRing => U)
Eo = oddExtModule(M, OutRing => U)
assert(ring Ee === U)
assert(ring Eo === U)
///
TEST///
S = ZZ/101[a,b,c];
ff = matrix"a3, b3,c3" ;
R = S/ideal ff;
q = map(R,S);
M0= coker random(R^2, R^{4:-1});
M = pushForward(q,syzygyModule(3,M0));
assert(betti (layeredResolution(ff,M))_0 == betti res M)
///
TEST///
S = ZZ/101[x,y,z]
ff = matrix {apply(gens S, x->x^3)}
F = res (ideal gens S)^2
R = S/ideal ff
F = res coker vars R
makeHomotopiesOnHomology(vars R, F)
///
TEST///
assert(expo(2,2) == {{2, 0}, {1, 1}, {0, 2}})
assert(expo(2,{2,1}) == {{0, 0}, {1, 0}, {0, 1}, {2, 0}, {1, 1}})
///
///
--test times of newExt
restart
loadPackage "CompleteIntersectionResolutions"
n= 5
c=2
kk=ZZ/101
R = kk[x_0..x_(n-1)]
ff = random(R^1, R^{c:-2})
I = ideal ff
Rbar = R/I
M = coker random(Rbar^2, Rbar^{4:-1})
elapsedTime Ext(M,M);
elapsedTime newExt(M,M);
--on this example newExt is faster, but on some the comparison goes the other way, too.
///
end--
restart
loadPackage"CompleteIntersectionResolutions"
debug CompleteIntersectionResolutions
path
restart
uninstallPackage "CompleteIntersectionResolutions"
restart
installPackage "CompleteIntersectionResolutions"
check "CompleteIntersectionResolutions"
notify=true
loadPackage("CompleteIntersectionResolutions", Reload =>true)
viewHelp CompleteIntersectionResolutions
|