/usr/share/singular/LIB/fpadim.lib is in singular-data 1:4.1.0-p3+ds-2build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | ////////////////////////////////////////////////////////
version="version fpadim.lib 4.0.0.0 Jun_2013 "; // $Id: 07968341e0ff32e82db77111def22ca3444a47a3 $
category="Noncommutative";
info="
LIBRARY: fpadim.lib Algorithms for quotient algebras in the letterplace case
AUTHORS: Grischa Studzinski, grischa.studzinski@rwth-aachen.de
Support: Joint projects LE 2697/2-1 and KR 1907/3-1 of the Priority Programme SPP 1489:
@* 'Algorithmische und Experimentelle Methoden in Algebra, Geometrie und Zahlentheorie'
@* of the German DFG
OVERVIEW: Given the free algebra A = K<x_1,...,x_n> and a (finite) Groebner basis
GB = {g_1,..,g_w}, one is interested in the K-dimension and in the
explicit K-basis of A/<GB>.
Therefore one is interested in the following data:
@* - the Ufnarovskij graph induced by GB
@* - the mistletoes of A/<GB>
@* - the K-dimension of A/<GB>
@* - the Hilbert series of A/<GB>
The Ufnarovskij graph is used to determine whether A/<GB> has finite
K-dimension. One has to check if the graph contains cycles.
For the whole theory we refer to [ufna]. Given a
reduced set of monomials GB one can define the basis tree, whose vertex
set V consists of all normal monomials w.r.t. GB. For every two
monomials m_1, m_2 in V there is a direct edge from m_1 to m_2, if and
only if there exists x_k in {x_1,..,x_n}, such that m_1*x_k = m_2. The
set M = {m in V | there is no edge from m to another monomial in V} is
called the set of mistletoes. As one can easily see it consists of
the endpoints of the graph. Since there is a unique path to every
monomial in V the whole graph can be described only from the knowledge
of the mistletoes. Note that V corresponds to a basis of A/<GB>, so
knowing the mistletoes we know a K-basis. The name mistletoes was given
to those points because of these miraculous value and the algorithm is
named sickle, because a sickle is the tool to harvest mistletoes.
For more details see [studzins]. This package uses the Letterplace
format introduced by [lls]. The algebra can either be represented as a
Letterplace ring or via integer vectors: Every variable will only be
represented by its number, so variable one is represented as 1,
variable two as 2 and so on. The monomial x_1*x_3*x_2 for example will
be stored as (1,3,2). Multiplication is concatenation. Note that there
is no algorithm for computing the normal form needed for our case.
Note that the name fpadim.lib is short for dimensions of finite
presented algebras.
REFERENCES:
@* [ufna] Ufnarovskij: Combinatorical and asymptotic methods in algebra, 1990
@* [lls] Levandovskyy, La Scala: Letterplace ideals and non-commutative
Groebner bases, 2009
@* [studzins] Studzinski: Dimension computations in non-commutative,
associative algebras, Diploma thesis, RWTH Aachen, 2010
Assumptions:
@* - basering is always a Letterplace ring
@* - all intvecs correspond to Letterplace monomials
@* - if you specify a different degree bound d,
d <= attrib(basering,uptodeg) should hold.
@* In the procedures below, 'iv' stands for intvec representation
and 'lp' for the letterplace representation of monomials
PROCEDURES:
ivDHilbert(L,n[,d]); computes the K-dimension and the Hilbert series
ivDHilbertSickle(L,n[,d]); computes mistletoes, K-dimension and Hilbert series
ivDimCheck(L,n); checks if the K-dimension of A/<L> is infinite
ivHilbert(L,n[,d]); computes the Hilbert series of A/<L> in intvec format
ivKDim(L,n[,d]); computes the K-dimension of A/<L> in intvec format
ivMis2Base(M); computes a K-basis of the factor algebra
ivMis2Dim(M); computes the K-dimension of the factor algebra
ivOrdMisLex(M); orders a list of intvecs lexicographically
ivSickle(L,n[,d]); computes the mistletoes of A/<L> in intvec format
ivSickleHil(L,n[,d]); computes the mistletoes and Hilbert series of A/<L>
ivSickleDim(L,n[,d]); computes the mistletoes and the K-dimension of A/<L>
lpDHilbert(G[,d,n]); computes the K-dimension and Hilbert series of A/<G>
lpDHilbertSickle(G[,d,n]); computes mistletoes, K-dimension and Hilbert series
lpHilbert(G[,d,n]); computes the Hilbert series of A/<G> in lp format
lpDimCheck(G); checks if the K-dimension of A/<G> is infinite
lpKDim(G[,d,n]); computes the K-dimension of A/<G> in lp format
lpMis2Base(M); computes a K-basis of the factor algebra
lpMis2Dim(M); computes the K-dimension of the factor algebra
lpOrdMisLex(M); orders an ideal of lp-monomials lexicographically
lpSickle(G[,d,n]); computes the mistletoes of A/<G> in lp format
lpSickleHil(G[,d,n]); computes the mistletoes and Hilbert series of A/<G>
lpSickleDim(G[,d,n]); computes the mistletoes and the K-dimension of A/<G>
sickle(G[,m,d,h]); can be used to access all lp main procedures
ivL2lpI(L); transforms a list of intvecs into an ideal of lp monomials
iv2lp(I); transforms an intvec into the corresponding monomial
iv2lpList(L); transforms a list of intmats into an ideal of lp monomials
iv2lpMat(M); transforms an intmat into an ideal of lp monomials
lp2iv(p); transforms a polynomial into the corresponding intvec
lp2ivId(G); transforms an ideal into the corresponding list of intmats
lpId2ivLi(G); transforms a lp-ideal into the corresponding list of intvecs
SEE ALSO: freegb_lib
";
LIB "freegb.lib"; //for letterplace rings
LIB "general.lib";//for sorting mistletoes
/////////////////////////////////////////////////////////
//--------------- auxiliary procedures ------------------
static proc allVars(list L, intvec P, int n)
"USAGE: allVars(L,P,n); L a list of intmats, P an intvec, n an integer
RETURN: int, 0 if all variables are contained in the quotient algebra, 1 otherwise
"
{int i,j,r;
intvec V;
for (i = 1; i <= size(P); i++) {if (P[i] == 1){ j = i; break;}}
V = L[j][1..nrows(L[j]),1];
for (i = 1; i <= n; i++) {if (isInVec(i,V) == 0) {r = 1; break;}}
if (r == 0) {return(1);}
else {return(0);}
}
static proc checkAssumptions(int d, list L)
"PURPOSE: Checks, if all the Assumptions are holding
"
{if (typeof(attrib(basering,"isLetterplaceRing"))=="string") {ERROR("Basering is not a Letterplace ring!");}
if (d > attrib(basering,"uptodeg")) {ERROR("Specified degree bound exceeds ring parameter!");}
int i;
for (i = 1; i <= size(L); i++)
{if (entryViolation(L[i], attrib(basering,"lV")))
{ERROR("Not allowed monomial/intvec found!");}
}
return();
}
static proc createStartMat(int d, int n)
"USAGE: createStartMat(d,n); d, n integers
RETURN: intmat
PURPOSE:Creating the intmat with all normal monomials in n variables and of degree d to start with
NOTE: d has to be > 0
"
{intmat M[(n^d)][d];
int i1,i2,i3,i4;
for (i1 = 1; i1 <= d; i1++) //Spalten
{i2 = 1; //durchlaeuft Zeilen
while (i2 <= (n^d))
{for (i3 = 1; i3 <= n; i3++)
{for (i4 = 1; i4 <= (n^(i1-1)); i4++)
{
M[i2,i1] = i3;
i2 = i2 + 1;
}
}
}
}
return(M);
}
static proc createStartMat1(int n, intmat M)
"USAGE: createStartMat1(n,M); n an integer, M an intmat
RETURN: intmat, with all variables except those in M
"
{int i;
intvec V,Vt;
V = M[(1..nrows(M)),1];
for (i = 1; i <= size(V); i++) {if (isInVec(i,V) == 0) {Vt = Vt,i;}}
if (Vt == 0) {intmat S; return(S);}
else {Vt = Vt[2..size(Vt)]; intmat S [size(Vt)][1]; S[1..size(Vt),1] = Vt; return(S);}
}
static proc entryViolation(intmat M, int n)
"PURPOSE:checks, if all entries in M are variable-related
"
{if ((nrows(M) == 1) && (ncols(M) == 1)) {if (M[1,1] == 0){return(0);}}
int i,j;
for (i = 1; i <= nrows(M); i++)
{for (j = 1; j <= ncols(M); j++)
{if(!((1<=M[i,j])&&(M[i,j]<=n))) {return(1);}}
}
return(0);
}
static proc findDimen(intvec V, int n, list L, intvec P, list #)
"USAGE: findDimen(V,n,L,P,degbound); V,P intvecs, n, an integer, L a list,
@* degbound an optional integer
RETURN: int
PURPOSE:Computing the K-dimension of the quotient algebra
"
{int degbound = 0;
if (size(#) > 0) {if (#[1] > 0) {degbound = #[1];}}
int dimen,i,j,w,it;
intvec Vt,Vt2;
module M;
if (degbound == 0)
{for (i = 1; i <= n; i++)
{Vt = V, i; w = 0;
for (j = 1; j<= size(P); j++)
{if (P[j] <= size(Vt))
{Vt2 = Vt[(size(Vt)-P[j]+1)..size(Vt)];
if (isInMat(Vt2,L[j]) > 0) {w = 1; break;}
}
}
if (w == 0)
{vector Vtt;
for (it = 1; it <= size(Vt); it++){Vtt = Vtt + Vt[it]*gen(it);}
M = M,Vtt;
kill Vtt;
}
}
if (size(M) == 0) {return(0);}
else
{M = simplify(M,2);
for (i = 1; i <= size(M); i++)
{kill Vt; intvec Vt;
for (j =1; j <= size(M[i]); j++){Vt[j] = int(leadcoef(M[i][j]));}
dimen = dimen + 1 + findDimen(Vt,n,L,P);
}
return(dimen);
}
}
else
{if (size(V) > degbound) {ERROR("monomial exceeds degreebound");}
if (size(V) == degbound) {return(0);}
for (i = 1; i <= n; i++)
{Vt = V, i; w = 0;
for (j = 1; j<= size(P); j++)
{if (P[j] <= size(Vt))
{Vt2 = Vt[(size(Vt)-P[j]+1)..size(Vt)];
if (isInMat(Vt2,L[j]) > 0) {w = 1; break;}
}
}
if (w == 0) {vector Vtt;
for (it = 1; it <= size(Vt); it++){Vtt = Vtt + Vt[it]*gen(it);}
M = M,Vtt;
kill Vtt;
}
}
if (size(M) == 0) {return(0);}
else
{M = simplify(M,2);
for (i = 1; i <= size(M); i++)
{kill Vt; intvec Vt;
for (j =1; j <= size(M[i]); j++){Vt[j] = int(leadcoef(M[i][j]));}
dimen = dimen + 1 + findDimen(Vt,n,L,P,degbound);
}
return(dimen);
}
}
}
static proc findCycle(intvec V, list L, intvec P, int n, int ld, module M)
"USAGE:
RETURN: int, 1 if Ufn-graph contains a cycle, or 0 otherwise
PURPOSE:Searching the Ufnarovskij graph for cycles
"
{int i,j,w,r;intvec Vt,Vt2;
int it, it2;
if (size(V) < ld)
{for (i = 1; i <= n; i++)
{Vt = V,i; w = 0;
for (j = 1; j <= size(P); j++)
{if (P[j] <= size(Vt))
{Vt2 = Vt[(size(Vt)-P[j]+1)..size(Vt)];
if (isInMat(Vt2,L[j]) > 0)
{w = 1; break;}
}
}
if (w == 0) {r = findCycle(Vt,L,P,n,ld,M);}
if (r == 1) {break;}
}
return(r);
}
else
{j = size(M);
if (j > 0)
{
intmat Mt[j][nrows(M)];
for (it = 1; it <= j; it++)
{ for(it2 = 1; it2 <= nrows(M);it2++)
{Mt[it,it2] = int(leadcoef(M[it2,it]));}
}
Vt = V[(size(V)-ld+1)..size(V)];
//Mt; type(Mt);Vt;type(Vt);
if (isInMat(Vt,Mt) > 0) {return(1);}
else
{vector Vtt;
for (it =1; it <= size(Vt); it++)
{Vtt = Vtt + Vt[it]*gen(it);}
M = M,Vtt;
kill Vtt;
for (i = 1; i <= n; i++)
{Vt = V,i; w = 0;
for (j = 1; j <= size(P); j++)
{if (P[j] <= size(Vt))
{Vt2 = Vt[(size(Vt)-P[j]+1)..size(Vt)];
//L[j]; type(L[j]);Vt2;type(Vt2);
if (isInMat(Vt2,L[j]) > 0)
{w = 1; break;}
}
}
if (w == 0) {r = findCycle(Vt,L,P,n,ld,M);}
if (r == 1) {break;}
}
return(r);
}
}
else
{ Vt = V[(size(V)-ld+1)..size(V)];
vector Vtt;
for (it = 1; it <= size(Vt); it++)
{Vtt = Vtt + Vt[it]*gen(it);}
M = Vtt;
kill Vtt;
for (i = 1; i <= n; i++)
{Vt = V,i; w = 0;
for (j = 1; j <= size(P); j++)
{if (P[j] <= size(Vt))
{Vt2 = Vt[(size(Vt)-P[j]+1)..size(Vt)];
//L[j]; type(L[j]);Vt2;type(Vt2);
if (isInMat(Vt2,L[j]) > 0)
{w = 1; break;}
}
}
if (w == 0) {r = findCycle(Vt,L,P,n,ld,M);}
if (r == 1) {break;}
}
return(r);
}
}
}
static proc findHCoeff(intvec V,int n,list L,intvec P,intvec H,list #)
"USAGE: findHCoeff(V,n,L,P,H,degbound); L a list of intmats, degbound an integer
RETURN: intvec
PURPOSE:Computing the coefficient of the Hilbert series (upto degree degbound)
NOTE: Starting with a part of the Hilbert series we change the coefficient
@* depending on how many basis elements we found on the actual branch
"
{int degbound = 0;
if (size(#) > 0){if (#[1] > 0){degbound = #[1];}}
int i,w,j,it;
int h1 = 0;
intvec Vt,Vt2,H1;
module M;
if (degbound == 0)
{for (i = 1; i <= n; i++)
{Vt = V, i; w = 0;
for (j = 1; j<= size(P); j++)
{if (P[j] <= size(Vt))
{Vt2 = Vt[(size(Vt)-P[j]+1)..size(Vt)];
if (isInMat(Vt2,L[j]) > 0) {w = 1; break;}
}
}
if (w == 0)
{vector Vtt;
for (it = 1; it <= size(Vt); it++){Vtt = Vtt + Vt[it]*gen(it);}
M = M,Vtt;
kill Vtt;
}
}
if (size(M) == 0) {return(H);}
else
{M = simplify(M,2);
for (i = 1; i <= size(M); i++)
{kill Vt; intvec Vt;
for (j =1; j <= size(M[i]); j++) {Vt[j] = int(leadcoef(M[i][j]));}
h1 = h1 + 1; H1 = findHCoeff(Vt,n,L,P,H1);
}
if (size(H1) < (size(V)+2)) {H1[(size(V)+2)] = h1;}
else {H1[(size(V)+2)] = H1[(size(V)+2)] + h1;}
H1 = H1 + H;
return(H1);
}
}
else
{if (size(V) > degbound) {ERROR("monomial exceeds degreebound");}
if (size(V) == degbound) {return(H);}
for (i = 1; i <= n; i++)
{Vt = V, i; w = 0;
for (j = 1; j<= size(P); j++)
{if (P[j] <= size(Vt))
{Vt2 = Vt[(size(Vt)-P[j]+1)..size(Vt)];
if (isInMat(Vt2,L[j]) > 0) {w = 1; break;}
}
}
if (w == 0)
{vector Vtt;
for (it = 1; it <= size(Vt); it++){Vtt = Vtt + Vt[it]*gen(it);}
M = M,Vtt;
kill Vtt;
}
}
if (size(M) == 0) {return(H);}
else
{M = simplify(M,2);
for (i = 1; i <= size(M); i++)
{kill Vt; intvec Vt;
for (j =1; j <= size(M[i]); j++)
{Vt[j] = int(leadcoef(M[i][j]));}
h1 = h1 + 1; H1 = findHCoeff(Vt,n,L,P,H1,degbound);
}
if (size(H1) < (size(V)+2)) { H1[(size(V)+2)] = h1;}
else {H1[(size(V)+2)] = H1[(size(V)+2)] + h1;}
H1 = H1 + H;
return(H1);
}
}
}
static proc findHCoeffMis(intvec V, int n, list L, intvec P, list R,list #)
"USAGE: findHCoeffMis(V,n,L,P,R,degbound); degbound an optional integer, L a
@* list of Intmats, R
RETURN: list
PURPOSE:Computing the coefficients of the Hilbert series and the Mistletoes all
@* at once
"
{int degbound = 0;
if (size(#) > 0) {if (#[1] > 0) {degbound = #[1];}}
int i,w,j,h1;
intvec Vt,Vt2,H1; int it;
module M;
if (degbound == 0)
{for (i = 1; i <= n; i++)
{Vt = V, i; w = 0;
for (j = 1; j<= size(P); j++)
{if (P[j] <= size(Vt))
{Vt2 = Vt[(size(Vt)-P[j]+1)..size(Vt)];
if (isInMat(Vt2,L[j]) > 0) {w = 1; break;}
}
}
if (w == 0)
{vector Vtt;
for (it = 1; it <= size(Vt); it++){Vtt = Vtt + Vt[it]*gen(it);}
M = M,Vtt;
kill Vtt;
}
}
if (size(M) == 0) {if (size(R) < 2){R[2] = list(V);} else {R[2] = R[2] + list(V);} return(R);}
else
{M = simplify(M,2);
for (i = 1; i <= size(M); i++)
{kill Vt; intvec Vt;
for (j =1; j <= size(M[i]); j++)
{Vt[j] = int(leadcoef(M[i][j]));}
if (size(R[1]) < (size(V)+2)) { R[1][(size(V)+2)] = 1;}
else
{R[1][(size(V)+2)] = R[1][(size(V)+2)] + 1;}
R = findHCoeffMis(Vt,n,L,P,R);
}
return(R);
}
}
else
{if (size(V) > degbound) {ERROR("monomial exceeds degreebound");}
if (size(V) == degbound)
{if (size(R) < 2){R[2] = list (V);}
else{R[2] = R[2] + list (V);}
return(R);
}
for (i = 1; i <= n; i++)
{Vt = V, i; w = 0;
for (j = 1; j<= size(P); j++)
{if (P[j] <= size(Vt))
{Vt2 = Vt[(size(Vt)-P[j]+1)..size(Vt)];
if (isInMat(Vt2,L[j]) > 0) {w = 1; break;}
}
}
if (w == 0)
{vector Vtt;
for (it = 1; it <= size(Vt); it++){Vtt = Vtt + Vt[it]*gen(it);}
M = M,Vtt;
kill Vtt;
}
}
if (size(M) == 0) {if (size(R) < 2){R[2] = list(V);} else {R[2] = R[2] + list(V);} return(R);}
else
{M = simplify(M,2);
for (i = 1; i <= ncols(M); i++)
{kill Vt; intvec Vt;
for (j =1; j <= size(M[i]); j++)
{Vt[j] = int(leadcoef(M[i][j]));}
if (size(R[1]) < (size(V)+2)) { R[1][(size(V)+2)] = 1;}
else
{R[1][(size(V)+2)] = R[1][(size(V)+2)] + 1;}
R = findHCoeffMis(Vt,n,L,P,R,degbound);
}
return(R);
}
}
}
static proc findMisDim(intvec V,int n,list L,intvec P,list R,list #)
"USAGE:
RETURN: list
PURPOSE:Computing the K-dimension and the Mistletoes all at once
"
{int degbound = 0;
if (size(#) > 0) {if (#[1] > 0) {degbound = #[1];}}
int dimen,i,j,w;
intvec Vt,Vt2; int it;
module M;
if (degbound == 0)
{for (i = 1; i <= n; i++)
{Vt = V, i; w = 0;
for (j = 1; j<= size(P); j++)
{if (P[j] <= size(Vt))
{Vt2 = Vt[(size(Vt)-P[j]+1)..size(Vt)];
if (isInMat(Vt2,L[j]) > 0) {w = 1; break;}
}
}
if (w == 0)
{vector Vtt;
for (it = 1; it <= size(Vt); it++){Vtt = Vtt + Vt[it]*gen(it);}
M = M,Vtt;
kill Vtt;
}
}
if (size(M) == 0)
{if (size(R) < 2){R[2] = list (V);}
else{R[2] = R[2] + list(V);}
return(R);
}
else
{M = simplify(M,2);
for (i = 1; i <= size(M); i++)
{kill Vt; intvec Vt;
for (j =1; j <= size(M[i]); j++){Vt[j] = int(leadcoef(M[i][j]));}
R[1] = R[1] + 1; R = findMisDim(Vt,n,L,P,R);
}
return(R);
}
}
else
{if (size(V) > degbound) {ERROR("monomial exceeds degreebound");}
if (size(V) == degbound)
{if (size(R) < 2){R[2] = list (V);}
else{R[2] = R[2] + list (V);}
return(R);
}
for (i = 1; i <= n; i++)
{Vt = V, i; w = 0;
for (j = 1; j<= size(P); j++)
{if (P[j] <= size(Vt))
{Vt2 = Vt[(size(Vt)-P[j]+1)..size(Vt)];
if (isInMat(Vt2,L[j]) > 0) {w = 1; break;}
}
}
if (w == 0)
{vector Vtt;
for (it = 1; it <= size(Vt); it++){Vtt = Vtt + Vt[it]*gen(it);}
M = M,Vtt;
kill Vtt;
}
}
if (size(M) == 0)
{if (size(R) < 2){R[2] = list (V);}
else{R[2] = R[2] + list(V);}
return(R);
}
else
{M = simplify(M,2);
for (i = 1; i <= size(M); i++)
{kill Vt; intvec Vt;
for (j =1; j <= size(M[i]); j++){Vt[j] = int(leadcoef(M[i][j]));}
R[1] = R[1] + 1; R = findMisDim(Vt,n,L,P,R,degbound);
}
return(R);
}
}
}
static proc findmistletoes(intvec V, int n, list L, intvec P, list #)
"USAGE: findmistletoes(V,n,L,P,degbound); V a normal word, n the number of
@* variables, L the GB, P the occuring degrees,
@* and degbound the (optional) degreebound
RETURN: list
PURPOSE:Computing mistletoes starting in V
NOTE: V has to be normal w.r.t. L, it will not be checked for being so
"
{int degbound = 0;
if (size(#) > 0) {if (#[1] > 0) {degbound = #[1];}}
list R; intvec Vt,Vt2; int it;
int i,j;
module M;
if (degbound == 0)
{int w;
for (i = 1; i <= n; i++)
{Vt = V,i; w = 0;
for (j = 1; j <= size(P); j++)
{if (P[j] <= size(Vt))
{Vt2 = Vt[(size(Vt)-P[j]+1)..size(Vt)];
if (isInMat(Vt2,L[j]) > 0)
{w = 1; break;}
}
}
if (w == 0)
{vector Vtt;
for (it = 1; it <= size(Vt); it++){Vtt = Vtt + Vt[it]*gen(it);}
M = M,Vtt;
kill Vtt;
}
}
if (size(M)==0) {R = V; return(R);}
else
{M = simplify(M,2);
for (i = 1; i <= size(M); i++)
{kill Vt; intvec Vt;
for (j =1; j <= size(M[i]); j++){Vt[j] = int(leadcoef(M[i][j]));}
R = R + findmistletoes(Vt,n,L,P);
}
return(R);
}
}
else
{if (size(V) > degbound) {ERROR("monomial exceeds degreebound");}
if (size(V) == degbound) {R = V; return(R);}
int w;
for (i = 1; i <= n; i++)
{Vt = V,i; w = 0;
for (j = 1; j <= size(P); j++)
{if (P[j] <= size(Vt))
{Vt2 = Vt[(size(Vt)-P[j]+1)..size(Vt)];
if (isInMat(Vt2,L[j]) > 0){w = 1; break;}
}
}
if (w == 0)
{vector Vtt;
for (it = 1; it <= size(Vt); it++){Vtt = Vtt + Vt[it]*gen(it);}
M = M,Vtt;
kill Vtt;
}
}
if (size(M) == 0) {R = V; return(R);}
else
{M = simplify(M,2);
for (i = 1; i <= ncols(M); i++)
{kill Vt; intvec Vt;
for (j =1; j <= size(M[i]); j++)
{Vt[j] = int(leadcoef(M[i][j]));}
//Vt; typeof(Vt); size(Vt);
R = R + findmistletoes(Vt,n,L,P,degbound);
}
return(R);
}
}
}
static proc isInList(intvec V, list L)
"USAGE: isInList(V,L); V an intvec, L a list of intvecs
RETURN: int
PURPOSE:Finding the position of V in L, returns 0, if V is not in M
"
{int i,n;
n = 0;
for (i = 1; i <= size(L); i++) {if (L[i] == V) {n = i; break;}}
return(n);
}
static proc isInMat(intvec V, intmat M)
"USAGE: isInMat(V,M);V an intvec, M an intmat
RETURN: int
PURPOSE:Finding the position of V in M, returns 0, if V is not in M
"
{if (size(V) <> ncols(M)) {return(0);}
int i;
intvec Vt;
for (i = 1; i <= nrows(M); i++)
{Vt = M[i,1..ncols(M)];
if ((V-Vt) == 0){return(i);}
}
return(0);
}
static proc isInVec(int v,intvec V)
"USAGE: isInVec(v,V); v an integer,V an intvec
RETURN: int
PURPOSE:Finding the position of v in V, returns 0, if v is not in V
"
{int i,n;
n = 0;
for (i = 1; i <= size(V); i++) {if (V[i] == v) {n = i; break;}}
return(n);
}
proc ivL2lpI(list L)
"USAGE: ivL2lpI(L); L a list of intvecs
RETURN: ideal
PURPOSE:Transforming a list of intvecs into an ideal of Letterplace monomials.
@* For the encoding of the variables see the overview.
ASSUME: - Intvec corresponds to a Letterplace monomial
@* - basering has to be a Letterplace ring
EXAMPLE: example ivL2lpI; shows examples
"
{checkAssumptions(0,L);
int i; ideal G;
poly p;
for (i = 1; i <= size(L); i++)
{p = iv2lp(L[i]);
G[(size(G) + 1)] = p;
}
return(G);
}
example
{
"EXAMPLE:"; echo = 2;
ring r = 0,(x,y,z),dp;
def R = makeLetterplaceRing(5);// constructs a Letterplace ring
setring R; //sets basering to Letterplace ring
intvec u = 1,1,2; intvec v = 2,1,3; intvec w = 3,1,1;
// u = x^2y, v = yxz, w = zx^2 in intvec representation
list L = u,v,w;
ivL2lpI(L);// invokes the procedure, returns the ideal containing u,v,w
}
proc iv2lp(intvec I)
"USAGE: iv2lp(I); I an intvec
RETURN: poly
PURPOSE:Transforming an intvec into the corresponding Letterplace polynomial
@* For the encoding of the variables see the overview.
ASSUME: - Intvec corresponds to a Letterplace monomial
@* - basering has to be a Letterplace ring
NOTE: - Assumptions will not be checked!
EXAMPLE: example iv2lp; shows examples
"
{if (I[1] == 0) {return(1);}
int i = size(I);
if (i > attrib(basering,"uptodeg")) {ERROR("polynomial exceeds degreebound");}
int j; poly p = 1;
for (j = 1; j <= i; j++) {if (I[j] > 0) { p = lpMult(p,var(I[j]));}} //ignore zeroes, because they correspond to 1
return(p);
}
example
{
"EXAMPLE:"; echo = 2;
ring r = 0,(x,y,z),dp;
def R = makeLetterplaceRing(5); // constructs a Letterplace ring
setring R; //sets basering to Letterplace ring
intvec u = 1,1,2; intvec v = 2,1,3; intvec w = 3,1,1;
// u = x^2y, v = yxz, w = zx^2 in intvec representation
iv2lp(u); // invokes the procedure and returns the corresponding poly
iv2lp(v);
iv2lp(w);
}
proc iv2lpList(list L)
"USAGE: iv2lpList(L); L a list of intmats
RETURN: ideal
PURPOSE:Converting a list of intmats into an ideal of corresponding monomials
@* The rows of the intmat corresponds to an intvec, which stores the
@* monomial.
@* For the encoding of the variables see the overview.
ASSUME: - The rows of each intmat in L must correspond to a Letterplace monomial
@* - basering has to be a Letterplace ring
EXAMPLE: example iv2lpList; shows examples
"
{checkAssumptions(0,L);
ideal G;
int i;
for (i = 1; i <= size(L); i++){G = G + iv2lpMat(L[i]);}
return(G);
}
example
{
"EXAMPLE:"; echo = 2;
ring r = 0,(x,y,z),dp;
def R = makeLetterplaceRing(5); // constructs a Letterplace ring
setring R; // sets basering to Letterplace ring
intmat u[3][1] = 1,1,2; intmat v[1][3] = 2,1,3; intmat w[2][3] = 3,1,1,2,3,1;
// defines intmats of different size containing intvec representations of
// monomials as rows
list L = u,v,w;
print(u); print(v); print(w); // shows the intmats contained in L
iv2lpList(L); // returns the corresponding monomials as an ideal
}
proc iv2lpMat(intmat M)
"USAGE: iv2lpMat(M); M an intmat
RETURN: ideal
PURPOSE:Converting an intmat into an ideal of the corresponding monomials.
@* The rows of the intmat corresponds to an intvec, which stores the
@* monomial.
@* For the encoding of the variables see the overview.
ASSUME: - The rows of M must correspond to Letterplace monomials
@* - basering has to be a Letterplace ring
EXAMPLE: example iv2lpMat; shows examples
"
{list L = M;
checkAssumptions(0,L);
kill L;
ideal G; poly p;
int i; intvec I;
for (i = 1; i <= nrows(M); i++)
{ I = M[i,1..ncols(M)];
p = iv2lp(I);
G[size(G)+1] = p;
}
return(G);
}
example
{
"EXAMPLE:"; echo = 2;
ring r = 0,(x,y,z),dp;
def R = makeLetterplaceRing(5); // constructs a Letterplace ring
setring R; // sets basering to Letterplace ring
intmat u[3][1] = 1,1,2; intmat v[1][3] = 2,1,3; intmat w[2][3] = 3,1,1,2,3,1;
// defines intmats of different size containing intvec representations of
// monomials as rows
iv2lpMat(u); // returns the monomials contained in u
iv2lpMat(v); // returns the monomials contained in v
iv2lpMat(w); // returns the monomials contained in w
}
proc lpId2ivLi(ideal G)
"USAGE: lpId2ivLi(G); G an ideal
RETURN: list
PURPOSE:Transforming an ideal into the corresponding list of intvecs.
@* For the encoding of the variables see the overview.
ASSUME: - basering has to be a Letterplace ring
EXAMPLE: example lpId2ivLi; shows examples
"
{int i,j,k;
list M;
checkAssumptions(0,M);
for (i = 1; i <= size(G); i++) {M[i] = lp2iv(G[i]);}
return(M);
}
example
{
"EXAMPLE:"; echo = 2;
ring r = 0,(x,y),dp;
def R = makeLetterplaceRing(5); // constructs a Letterplace ring
setring R; // sets basering to Letterplace ring
ideal L = x(1)*x(2),y(1)*y(2),x(1)*y(2)*x(3);
lpId2ivLi(L); // returns the corresponding intvecs as a list
}
proc lp2iv(poly p)
"USAGE: lp2iv(p); p a poly
RETURN: intvec
PURPOSE:Transforming a monomial into the corresponding intvec.
@* For the encoding of the variables see the overview.
ASSUME: - basering has to be a Letterplace ring
NOTE: - Assumptions will not be checked!
EXAMPLE: example lp2iv; shows examples
"
{p = normalize(lead(p));
intvec I;
int i,j;
if (deg(p) > attrib(basering,"uptodeg")) {ERROR("Monomial exceeds degreebound");}
if (p == 1) {return(I);}
if (p == 0) {ERROR("Monomial is not allowed to equal zero");}
intvec lep = leadexp(p);
for ( i = 1; i <= attrib(basering,"lV"); i++) {if (lep[i] == 1) {I = i; break;}}
for (i = (attrib(basering,"lV")+1); i <= size(lep); i++)
{if (lep[i] == 1)
{ j = (i mod attrib(basering,"lV"));
if (j == 0) {I = I,attrib(basering,"lV");}
else {I = I,j;}
}
else { if (lep[i] > 1) {ERROR("monomial has a not allowed multidegree");}}
}
if (I[1] == 0) {ERROR("monomial has a not allowed multidegree");}
return(I);
}
example
{
"EXAMPLE:"; echo = 2;
ring r = 0,(x,y,z),dp;
def R = makeLetterplaceRing(5); // constructs a Letterplace ring
setring R; // sets basering to Letterplace ring
poly p = x(1)*x(2)*z(3); poly q = y(1)*y(2)*x(3)*x(4);
poly w= z(1)*y(2)*x(3)*z(4)*z(5);
// p,q,w are some polynomials we want to transform into their
// intvec representation
lp2iv(p); lp2iv(q); lp2iv(w);
}
proc lp2ivId(ideal G)
"USAGE: lp2ivId(G); G an ideal
RETURN: list
PURPOSE:Converting an ideal into an list of intmats,
@* the corresponding intvecs forming the rows.
@* For the encoding of the variables see the overview.
ASSUME: - basering has to be a Letterplace ring
EXAMPLE: example lp2ivId; shows examples
"
{G = normalize(lead(G));
intvec I; list L;
checkAssumptions(0,L);
int i,md;
for (i = 1; i <= size(G); i++) { if (md <= deg(G[i])) {md = deg(G[i]);}}
while (size(G) > 0)
{ideal Gt;
for (i = 1; i <= ncols(G); i++) {if (md == deg(G[i])) {Gt = Gt + G[i]; G[i] = 0;}}
if (size(Gt) > 0)
{G = simplify(G,2);
intmat M [size(Gt)][md];
for (i = 1; i <= size(Gt); i++) {M[i,1..md] = lp2iv(Gt[i]);}
L = insert(L,M);
kill M; kill Gt;
md = md - 1;
}
else {kill Gt; md = md - 1;}
}
return(L);
}
example
{
"EXAMPLE:"; echo = 2;
ring r = 0,(x,y,z),dp;
def R = makeLetterplaceRing(5); // constructs a Letterplace ring
setring R; // sets basering to Letterplace ring
poly p = x(1)*x(2)*z(3); poly q = y(1)*y(2)*x(3)*x(4);
poly w = z(1)*y(2)*x(3)*z(4);
// p,q,w are some polynomials we want to transform into their
// intvec representation
ideal G = p,q,w;
// define the ideal containing p,q and w
lp2ivId(G); // and return the list of intmats for this ideal
}
// -----------------main procedures----------------------
proc ivDHilbert(list L, int n, list #)
"USAGE: ivDHilbert(L,n[,degbound]); L a list of intmats, n an integer,
@* degbound an optional integer
RETURN: list
PURPOSE:Computing the K-dimension and the Hilbert series
ASSUME: - basering is a Letterplace ring
@* - all rows of each intmat correspond to a Letterplace monomial
@* for the encoding of the variables see the overview
@* - if you specify a different degree bound degbound,
@* degbound <= attrib(basering,uptodeg) should hold.
NOTE: - If L is the list returned, then L[1] is an integer corresponding to the
@* dimension, L[2] is an intvec which contains the coefficients of the
@* Hilbert series
@* - If degbound is set, there will be a degree bound added. By default there
@* is no degree bound
@* - n is the number of variables
@* - If I = L[2] is the intvec returned, then I[k] is the (k-1)-th coefficient of
@* the Hilbert series.
@* - If the K-dimension is known to be infinite, a degree bound is needed
EXAMPLE: example ivDHilbert; shows examples
"
{int degbound = 0;
if (size(#) > 0){if (typeof(#[1])=="int"){if (#[1] > 0){degbound = #[1];}}}
checkAssumptions(degbound,L);
intvec H; int i,dimen;
H = ivHilbert(L,n,degbound);
for (i = 1; i <= size(H); i++){dimen = dimen + H[i];}
L = dimen,H;
return(L);
}
example
{
"EXAMPLE:"; echo = 2;
ring r = 0,(x,y),dp;
def R = makeLetterplaceRing(5); // constructs a Letterplace ring
R;
setring R; // sets basering to Letterplace ring
//some intmats, which contain monomials in intvec representation as rows
intmat I1 [2][2] = 1,1,2,2; intmat I2 [1][3] = 1,2,1;
intmat J1 [1][2] = 1,1; intmat J2 [2][3] = 2,1,2,1,2,1;
print(I1);
print(I2);
print(J1);
print(J2);
list G = I1,I2; // ideal, which is already a Groebner basis
list I = J1,J2; // ideal, which is already a Groebner basis
//the procedure without a degree bound
ivDHilbert(G,2);
// the procedure with degree bound 5
ivDHilbert(I,2,5);
}
proc ivDHilbertSickle(list L, int n, list #)
"USAGE: ivDHilbertSickle(L,n[,degbound]); L a list of intmats, n an integer,
@* degbound an optional integer
RETURN: list
PURPOSE:Computing K-dimension, Hilbert series and mistletoes
ASSUME: - basering is a Letterplace ring.
@* - All rows of each intmat correspond to a Letterplace monomial.
@* for the encoding of the variables see the overview
@* - If you specify a different degree bound degbound,
@* degbound <= attrib(basering,uptodeg) should hold.
NOTE: - If L is the list returned, then L[1] is an integer, L[2] is an intvec
@* which contains the coefficients of the Hilbert series and L[3]
@* is a list, containing the mistletoes as intvecs.
@* - If degbound is set, a degree bound will be added. By default there
@* is no degree bound.
@* - n is the number of variables.
@* - If I = L[2] is the intvec returned, then I[k] is the (k-1)-th
@* coefficient of the Hilbert series.
@* - If the K-dimension is known to be infinite, a degree bound is needed
EXAMPLE: example ivDHilbertSickle; shows examples
"
{int degbound = 0;
if (size(#) > 0){if (typeof(#[1])=="int"){if (#[1] > 0){degbound = #[1];}}}
checkAssumptions(degbound,L);
int i,dimen; list R;
R = ivSickleHil(L,n,degbound);
for (i = 1; i <= size(R[1]); i++){dimen = dimen + R[1][i];}
R[3] = R[2]; R[2] = R[1]; R[1] = dimen;
return(R);
}
example
{
"EXAMPLE:"; echo = 2;
ring r = 0,(x,y),dp;
def R = makeLetterplaceRing(5); // constructs a Letterplace ring
R;
setring R; // sets basering to Letterplace ring
//some intmats, which contain monomials in intvec representation as rows
intmat I1 [2][2] = 1,1,2,2; intmat I2 [1][3] = 1,2,1;
intmat J1 [1][2] = 1,1; intmat J2 [2][3] = 2,1,2,1,2,1;
print(I1);
print(I2);
print(J1);
print(J2);
list G = I1,I2;// ideal, which is already a Groebner basis
list I = J1,J2; // ideal, which is already a Groebner basis
ivDHilbertSickle(G,2); // invokes the procedure without a degree bound
ivDHilbertSickle(I,2,3); // invokes the procedure with degree bound 3
}
proc ivDimCheck(list L, int n)
"USAGE: ivDimCheck(L,n); L a list of intmats, n an integer
RETURN: int, 0 if the dimension is finite, or 1 otherwise
PURPOSE:Decides, whether the K-dimension is finite or not
ASSUME: - basering is a Letterplace ring
@* - All rows of each intmat correspond to a Letterplace monomial
@* For the encoding of the variables see the overview.
NOTE: - n is the number of variables
EXAMPLE: example ivDimCheck; shows examples
"
{checkAssumptions(0,L);
int i,r;
intvec P,H;
for (i = 1; i <= size(L); i++)
{P[i] = ncols(L[i]);
if (P[i] == 1) {if (isInMat(H,L[i]) > 0) {ERROR("Quotient algebra is trivial");}}
}
if (size(L) == 0) {ERROR("GB is empty, quotient algebra corresponds to free algebra");}
kill H;
intmat S; int sd,ld; intvec V;
sd = P[1]; ld = P[1];
for (i = 2; i <= size(P); i++)
{if (P[i] < sd) {sd = P[i];}
if (P[i] > ld) {ld = P[i];}
}
sd = (sd - 1); ld = ld - 1;
if (ld == 0) { return(allVars(L,P,n));}
if (sd == 0) { for (i = 1; i <= size(L); i++){if (ncols(L[i]) == 1){S = createStartMat1(n,L[i]); break;}}}
else {S = createStartMat(sd,n);}
module M;
for (i = 1; i <= nrows(S); i++)
{V = S[i,1..ncols(S)];
if (findCycle(V,L,P,n,ld,M)) {r = 1; break;}
}
return(r);
}
example
{
"EXAMPLE:"; echo = 2;
ring r = 0,(x,y),dp;
def R = makeLetterplaceRing(5); // constructs a Letterplace ring
R;
setring R; // sets basering to Letterplace ring
//some intmats, which contain monomials in intvec representation as rows
intmat I1 [2][2] = 1,1,2,2; intmat I2 [1][3] = 1,2,1;
intmat J1 [1][2] = 1,1; intmat J2 [2][3] = 2,1,2,1,2,1;
print(I1);
print(I2);
print(J1);
print(J2);
list G = I1,I2;// ideal, which is already a Groebner basis
list I = J1,J2; // ideal, which is already a Groebner basis and which
ivDimCheck(G,2); // invokes the procedure, factor is of finite K-dimension
ivDimCheck(I,2); // invokes the procedure, factor is not of finite K-dimension
}
proc ivHilbert(list L, int n, list #)
"USAGE: ivHilbert(L,n[,degbound]); L a list of intmats, n an integer,
@* degbound an optional integer
RETURN: intvec, containing the coefficients of the Hilbert series
PURPOSE:Computing the Hilbert series
ASSUME: - basering is a Letterplace ring.
@* - all rows of each intmat correspond to a Letterplace monomial
@* for the encoding of the variables see the overview
@* - if you specify a different degree bound degbound,
@* degbound <= attrib(basering,uptodeg) should hold.
NOTE: - If degbound is set, a degree bound will be added. By default there
@* is no degree bound.
@* - n is the number of variables.
@* - If I is returned, then I[k] is the (k-1)-th coefficient of the Hilbert
@* series.
@* - If the K-dimension is known to be infinite, a degree bound is needed
EXAMPLE: example ivHilbert; shows examples
"
{int degbound = 0;
if (size(#) > 0) {if (typeof(#[1])=="int"){if (#[1] > 0) {degbound = #[1];}}}
intvec P,H; int i;
for (i = 1; i <= size(L); i++)
{P[i] = ncols(L[i]);
if (P[i] == 1) {if ( isInMat(H,L[i]) > 0) {ERROR("Quotient algebra is trivial");}}
}
if (size(L) == 0) {ERROR("GB is empty, quotient algebra corresponds to free algebra");}
H[1] = 1;
checkAssumptions(degbound,L);
if (degbound == 0)
{int sd;
intmat S;
sd = P[1];
for (i = 2; i <= size(P); i++) {if (P[i] < sd) {sd = P[i];}}
sd = (sd - 1);
if (sd == 0) { for (i = 1; i <= size(L); i++){if (ncols(L[i]) == 1){S = createStartMat1(n,L[i]); break;}}}
else {S = createStartMat(sd,n);}
if (intvec(S) == 0) {return(H);}
for (i = 1; i <= sd; i++) {H = H,(n^i);}
for (i = 1; i <= nrows(S); i++)
{intvec St = S[i,1..ncols(S)];
H = findHCoeff(St,n,L,P,H);
kill St;
}
return(H);
}
else
{for (i = 1; i <= size(P); i++)
{if (P[i] > degbound) {ERROR("degreebound is too small, GB contains elements of higher degree");}}
int sd;
intmat S;
sd = P[1];
for (i = 2; i <= size(P); i++) {if (P[i] < sd) {sd = P[i];}}
sd = (sd - 1);
if (sd == 0) { for (i = 1; i <= size(L); i++){if (ncols(L[i]) == 1){S = createStartMat1(n,L[i]); break;}}}
else {S = createStartMat(sd,n);}
if (intvec(S) == 0) {return(H);}
for (i = 1; i <= sd; i++) {H = H,(n^i);}
for (i = 1; i <= nrows(S); i++)
{intvec St = S[i,1..ncols(S)];
H = findHCoeff(St,n,L,P,H,degbound);
kill St;
}
return(H);
}
}
example
{
"EXAMPLE:"; echo = 2;
ring r = 0,(x,y),dp;
def R = makeLetterplaceRing(5); // constructs a Letterplace ring
R;
setring R; // sets basering to Letterplace ring
//some intmats, which contain monomials in intvec representation as rows
intmat I1 [2][2] = 1,1,2,2; intmat I2 [1][3] = 1,2,1;
intmat J1 [1][2] = 1,1; intmat J2 [2][3] = 2,1,2,1,2,1;
print(I1);
print(I2);
print(J1);
print(J2);
list G = I1,I2; // ideal, which is already a Groebner basis
list I = J1,J2; // ideal, which is already a Groebner basis
ivHilbert(G,2); // invokes the procedure without any degree bound
ivHilbert(I,2,5); // invokes the procedure with degree bound 5
}
proc ivKDim(list L, int n, list #)
"USAGE: ivKDim(L,n[,degbound]); L a list of intmats,
@* n an integer, degbound an optional integer
RETURN: int, the K-dimension of A/<L>
PURPOSE:Computing the K-dimension of A/<L>
ASSUME: - basering is a Letterplace ring.
@* - all rows of each intmat correspond to a Letterplace monomial
@* for the encoding of the variables see the overview
@* - if you specify a different degree bound degbound,
@* degbound <= attrib(basering,uptodeg) should hold.
NOTE: - If degbound is set, a degree bound will be added. By default there
@* is no degree bound.
@* - n is the number of variables.
@* - If the K-dimension is known to be infinite, a degree bound is needed
EXAMPLE: example ivKDim; shows examples
"
{int degbound = 0;
if (size(#) > 0) {if (typeof(#[1])=="int"){if (#[1] > 0) {degbound = #[1];}}}
intvec P,H; int i;
for (i = 1; i <= size(L); i++)
{P[i] = ncols(L[i]);
if (P[i] == 1) {if ( isInMat(H,L[i]) > 0) {ERROR("Quotient algebra is trivial");}}
}
if (size(L) == 0) {ERROR("GB is empty, quotient algebra corresponds to free algebra");}
kill H;
checkAssumptions(degbound,L);
if (degbound == 0)
{int sd; int dimen = 1;
intmat S;
sd = P[1];
for (i = 2; i <= size(P); i++) {if (P[i] < sd) {sd = P[i];}}
sd = (sd - 1);
if (sd == 0) { for (i = 1; i <= size(L); i++){if (ncols(L[i]) == 1){S = createStartMat1(n,L[i]); break;}}}
else {S = createStartMat(sd,n);}
if (intvec(S) == 0) {return(dimen);}
for (i = 1; i <= sd; i++) {dimen = dimen +(n^i);}
for (i = 1; i <= nrows(S); i++)
{intvec St = S[i,1..ncols(S)];
dimen = dimen + findDimen(St,n,L,P);
kill St;
}
return(dimen);
}
else
{for (i = 1; i <= size(P); i++)
{if (P[i] > degbound) {ERROR("degreebound is too small, GB contains elements of higher degree");}}
int sd; int dimen = 1;
intmat S;
sd = P[1];
for (i = 2; i <= size(P); i++) {if (P[i] < sd) {sd = P[i];}}
sd = (sd - 1);
if (sd == 0) { for (i = 1; i <= size(L); i++){if (ncols(L[i]) == 1){S = createStartMat1(n,L[i]); break;}}}
else {S = createStartMat(sd,n);}
if (intvec(S) == 0) {return(dimen);}
for (i = 1; i <= sd; i++) {dimen = dimen +(n^i);}
for (i = 1; i <= nrows(S); i++)
{intvec St = S[i,1..ncols(S)];
dimen = dimen + findDimen(St,n,L,P, degbound);
kill St;
}
return(dimen);
}
}
example
{
"EXAMPLE:"; echo = 2;
ring r = 0,(x,y),dp;
def R = makeLetterplaceRing(5); // constructs a Letterplace ring
R;
setring R; // sets basering to Letterplace ring
//some intmats, which contain monomials in intvec representation as rows
intmat I1 [2][2] = 1,1,2,2; intmat I2 [1][3] = 1,2,1;
intmat J1 [1][2] = 1,1; intmat J2 [2][3] = 2,1,2,1,2,1;
print(I1);
print(I2);
print(J1);
print(J2);
list G = I1,I2; // ideal, which is already a Groebner basis
list I = J1,J2; // ideal, which is already a Groebner basis
ivKDim(G,2); // invokes the procedure without any degree bound
ivKDim(I,2,5); // invokes the procedure with degree bound 5
}
proc ivMis2Base(list M)
"USAGE: ivMis2Base(M); M a list of intvecs
RETURN: ideal, a K-base of the given algebra
PURPOSE:Computing the K-base out of given mistletoes
ASSUME: - The mistletoes have to be ordered lexicographically -> OrdMisLex.
@* Otherwise there might some elements missing.
@* - basering is a Letterplace ring.
@* - mistletoes are stored as intvecs, as described in the overview
EXAMPLE: example ivMis2Base; shows examples
"
{
//checkAssumptions(0,M);
intvec L,A;
if (size(M) == 0){ERROR("There are no mistletoes, so it appears your dimension is infinite!");}
if (isInList(L,M) > 0) {print("1 is a mistletoe, therefore 1 is the only basis element"); return(list(intvec(0)));}
int i,j,d,s;
list Rt;
Rt[1] = intvec(0);
L = M[1];
for (i = size(L); 1 <= i; i--) {Rt = insert(Rt,intvec(L[1..i]));}
for (i = 2; i <= size(M); i++)
{A = M[i]; L = M[i-1];
s = size(A);
if (s > size(L))
{d = size(L);
for (j = s; j > d; j--) {Rt = insert(Rt,intvec(A[1..j]));}
A = A[1..d];
}
if (size(L) > s){L = L[1..s];}
while (A <> L)
{Rt = insert(Rt, intvec(A));
if (size(A) > 1)
{A = A[1..(size(A)-1)];
L = L[1..(size(L)-1)];
}
else {break;}
}
}
return(Rt);
}
example
{
"EXAMPLE:"; echo = 2;
ring r = 0,(x,y),dp;
def R = makeLetterplaceRing(5); // constructs a Letterplace ring
R;
setring R; // sets basering to Letterplace ring
intvec i1 = 1,2; intvec i2 = 2,1,2;
// the mistletoes are xy and yxy, which are already ordered lexicographically
list L = i1,i2;
ivMis2Base(L); // returns the basis of the factor algebra
}
proc ivMis2Dim(list M)
"USAGE: ivMis2Dim(M); M a list of intvecs
RETURN: int, the K-dimension of the given algebra
PURPOSE:Computing the K-dimension out of given mistletoes
ASSUME: - The mistletoes have to be ordered lexicographically -> OrdMisLex.
@* Otherwise the returned value may differ from the K-dimension.
@* - basering is a Letterplace ring.
@* - mistletoes are stored as intvecs, as described in the overview
EXAMPLE: example ivMis2Dim; shows examples
"
{checkAssumptions(0,M);
intvec L;
if (size(M) == 0){ERROR("There are no mistletoes, so it appears your dimension is infinite!");}
if (isInList(L,M) > 0) {print("1 is a mistletoe, therefore dim = 1"); return(1);}
int i,j,d,s;
d = 1 + size(M[1]);
for (i = 1; i < size(M); i++)
{j = 1;
s = size(M[i]); if (s > size(M[i+1])){s = size(M[i+1]);}
while ((M[i][j] == M[i+1][j]) && (j <= s)){j = j + 1;}
d = d + size(M[i+1])- j + 1;
}
return(d);
}
example
{
"EXAMPLE:"; echo = 2;
ring r = 0,(x,y),dp;
def R = makeLetterplaceRing(5); // constructs a Letterplace ring
R;
setring R; // sets basering to Letterplace ring
intvec i1 = 1,2; intvec i2 = 2,1,2;
// the mistletoes are xy and yxy, which are already ordered lexicographically
list L = i1,i2;
ivMis2Dim(L); // returns the dimension of the factor algebra
}
proc ivOrdMisLex(list M)
"USAGE: ivOrdMisLex(M); M a list of intvecs
RETURN: list, containing the ordered intvecs of M
PURPOSE:Orders a given set of mistletoes lexicographically
ASSUME: - basering is a Letterplace ring.
@* - intvecs correspond to monomials, as explained in the overview
NOTE: - This is preprocessing, it's not needed if the mistletoes are returned
@* from the sickle algorithm.
@* - Each entry of the list returned is an intvec.
EXAMPLE: example ivOrdMisLex; shows examples
"
{checkAssumptions(0,M);
return(sort(M)[1]);
}
example
{
"EXAMPLE:"; echo = 2;
ring r = 0,(x,y),dp;
def R = makeLetterplaceRing(5); // constructs a Letterplace ring
setring R; // sets basering to Letterplace ring
intvec i1 = 1,2,1; intvec i2 = 2,2,1; intvec i3 = 1,1; intvec i4 = 2,1,1,1;
// the corresponding monomials are xyx,y^2x,x^2,yx^3
list M = i1,i2,i3,i4;
M;
ivOrdMisLex(M);// orders the list of monomials
}
proc ivSickle(list L, int n, list #)
"USAGE: ivSickle(L,n,[degbound]); L a list of intmats, n an int, degbound an
@* optional integer
RETURN: list, containing intvecs, the mistletoes of A/<L>
PURPOSE:Computing the mistletoes for a given Groebner basis L, given by intmats
ASSUME: - basering is a Letterplace ring.
@* - all rows of each intmat correspond to a Letterplace monomial
@* as explained in the overview
@* - if you specify a different degree bound degbound,
@* degbound <= attrib(basering,uptodeg) should hold.
NOTE: - If degbound is set, a degree bound will be added. By default there
@* is no degree bound.
@* - n is the number of variables.
@* - If the K-dimension is known to be infinite, a degree bound is needed
EXAMPLE: example ivSickle; shows examples
"
{list M;
int degbound = 0;
if (size(#) > 0){if (typeof(#[1])=="int"){if (#[1] > 0){degbound = #[1];}}}
int i;
intvec P,H;
for (i = 1; i <= size(L); i++)
{P[i] = ncols(L[i]);
if (P[i] == 1) {if (isInMat(H,L[i]) > 0) {ERROR("Quotient algebra is trivial");}}
}
if (size(L) == 0) {ERROR("GB is empty, quotient algebra corresponds to free algebra");}
kill H;
checkAssumptions(degbound,L);
if (degbound == 0)
{intmat S; int sd;
sd = P[1];
for (i = 2; i <= size(P); i++) {if (P[i] < sd) {sd = P[i];}}
sd = (sd - 1);
if (sd == 0) { for (i = 1; i <= size(L); i++){if (ncols(L[i]) == 1){S = createStartMat1(n,L[i]); break;}}}
else {S = createStartMat(sd,n);}
if (intvec(S) == 0) {return(list (intvec(0)));}
for (i = 1; i <= nrows(S); i++)
{intvec St = S[i,1..ncols(S)];
M = M + findmistletoes(St,n,L,P);
kill St;
}
return(M);
}
else
{for (i = 1; i <= size(P); i++)
{if (P[i] > degbound) {ERROR("degreebound is too small, GB contains elements of higher degree");}}
intmat S; int sd;
sd = P[1];
for (i = 2; i <= size(P); i++) {if (P[i] < sd) {sd = P[i];}}
sd = (sd - 1);
if (sd == 0) { for (i = 1; i <= size(L); i++){if (ncols(L[i]) == 1){S = createStartMat1(n,L[i]); break;}}}
else {S = createStartMat(sd,n);}
if (intvec(S) == 0) {return(list (intvec(0)));}
for (i = 1; i <= nrows(S); i++)
{intvec St = S[i,1..ncols(S)];
M = M + findmistletoes(St,n,L,P,degbound);
kill St;
}
return(M);
}
}
example
{
"EXAMPLE:"; echo = 2;
ring r = 0,(x,y),dp;
def R = makeLetterplaceRing(5); // constructs a Letterplace ring
setring R; // sets basering to Letterplace ring
//some intmats, which contain monomials in intvec representation as rows
intmat I1 [2][2] = 1,1,2,2; intmat I2 [1][3] = 1,2,1;
intmat J1 [1][2] = 1,1; intmat J2 [2][3] = 2,1,2,1,2,1;
print(I1);
print(I2);
print(J1);
print(J2);
list G = I1,I2; // ideal, which is already a Groebner basis
list I = J1,J2; // ideal, which is already a Groebner basis
ivSickle(G,2); // invokes the procedure without any degree bound
ivSickle(I,2,5); // invokes the procedure with degree bound 5
}
proc ivSickleDim(list L, int n, list #)
"USAGE: ivSickleDim(L,n[,degbound]); L a list of intmats, n an integer, degbound
@* an optional integer
RETURN: list
PURPOSE:Computing mistletoes and the K-dimension
ASSUME: - basering is a Letterplace ring.
@* - all rows of each intmat correspond to a Letterplace monomial
@* as explained in the overview
@* - if you specify a different degree bound degbound,
@* degbound <= attrib(basering,uptodeg) should hold.
NOTE: - If L is the list returned, then L[1] is an integer, L[2] is a list,
@* containing the mistletoes as intvecs.
@* - If degbound is set, a degree bound will be added. By default there
@* is no degree bound.
@* - n is the number of variables.
@* - If the K-dimension is known to be infinite, a degree bound is needed
EXAMPLE: example ivSickleDim; shows examples
"
{list M;
int degbound = 0;
if (size(#) > 0){if (typeof(#[1])=="int"){if (#[1] > 0){degbound = #[1];}}}
int i,dimen; list R;
intvec P,H;
for (i = 1; i <= size(L); i++)
{P[i] = ncols(L[i]);
if (P[i] == 1) {if (isInMat(H,L[i]) > 0) {ERROR("Quotient algebra is trivial, dimension equals zero");}}
}
if (size(L) == 0) {ERROR("GB is empty, quotient algebra corresponds to free algebra");}
kill H;
checkAssumptions(degbound,L);
if (degbound == 0)
{int sd; dimen = 1;
intmat S;
sd = P[1];
for (i = 2; i <= size(P); i++) {if (P[i] < sd) {sd = P[i];}}
sd = (sd - 1);
if (sd == 0) { for (i = 1; i <= size(L); i++){if (ncols(L[i]) == 1){S = createStartMat1(n,L[i]); break;}}}
else {S = createStartMat(sd,n);}
if (intvec(S) == 0) {return(list(dimen,list(intvec(0))));}
for (i = 1; i <= sd; i++) {dimen = dimen +(n^i);}
R[1] = dimen;
for (i = 1; i <= nrows(S); i++)
{intvec St = S[i,1..ncols(S)];
R = findMisDim(St,n,L,P,R);
kill St;
}
return(R);
}
else
{for (i = 1; i <= size(P); i++)
{if (P[i] > degbound) {ERROR("degreebound is too small, GB contains elements of higher degree");}}
int sd; dimen = 1;
intmat S;
sd = P[1];
for (i = 2; i <= size(P); i++) {if (P[i] < sd) {sd = P[i];}}
sd = (sd - 1);
if (sd == 0) { for (i = 1; i <= size(L); i++){if (ncols(L[i]) == 1){S = createStartMat1(n,L[i]); break;}}}
else {S = createStartMat(sd,n);}
if (intvec(S) == 0) {return(list(dimen,list(intvec(0))));}
for (i = 1; i <= sd; i++) {dimen = dimen +(n^i);}
R[1] = dimen;
for (i = 1; i <= nrows(S); i++)
{intvec St = S[i,1..ncols(S)];
R = findMisDim(St,n,L,P,R,degbound);
kill St;
}
return(R);
}
}
example
{
"EXAMPLE:"; echo = 2;
ring r = 0,(x,y),dp;
def R = makeLetterplaceRing(5); // constructs a Letterplace ring
setring R; // sets basering to Letterplace ring
//some intmats, which contain monomials in intvec representation as rows
intmat I1 [2][2] = 1,1,2,2; intmat I2 [1][3] = 1,2,1;
intmat J1 [1][2] = 1,1; intmat J2 [2][3] = 2,1,2,1,2,1;
print(I1);
print(I2);
print(J1);
print(J2);
list G = I1,I2;// ideal, which is already a Groebner basis
list I = J1,J2; // ideal, which is already a Groebner basis
ivSickleDim(G,2); // invokes the procedure without any degree bound
ivSickleDim(I,2,5); // invokes the procedure with degree bound 5
}
proc ivSickleHil(list L, int n, list #)
"USAGE:ivSickleHil(L,n[,degbound]); L a list of intmats, n an integer,
@* degbound an optional integer
RETURN: list
PURPOSE:Computing the mistletoes and the Hilbert series
ASSUME: - basering is a Letterplace ring.
@* - all rows of each intmat correspond to a Letterplace monomial
@* as explained in the overview
@* - if you specify a different degree bound degbound,
@* degbound <= attrib(basering,uptodeg) should hold.
NOTE: - If L is the list returned, then L[1] is an intvec, L[2] is a list,
@* containing the mistletoes as intvecs.
@* - If degbound is set, a degree bound will be added. By default there
@* is no degree bound.
@* - n is the number of variables.
@* - If I = L[1] is the intvec returned, then I[k] is the (k-1)-th
@* coefficient of the Hilbert series.
@* - If the K-dimension is known to be infinite, a degree bound is needed
EXAMPLE: example ivSickleHil; shows examples
"
{int degbound = 0;
if (size(#) > 0) {if (typeof(#[1])=="int"){if (#[1] > 0) {degbound = #[1];}}}
intvec P,H; int i; list R;
for (i = 1; i <= size(L); i++)
{P[i] = ncols(L[i]);
if (P[i] == 1) {if ( isInMat(H,L[i]) > 0) {ERROR("Quotient algebra is trivial");}}
}
if (size(L) == 0) {ERROR("GB is empty, quotient algebra corresponds to free algebra");}
H[1] = 1;
checkAssumptions(degbound,L);
if (degbound == 0)
{int sd;
intmat S;
sd = P[1];
for (i = 2; i <= size(P); i++) {if (P[i] < sd) {sd = P[i];}}
sd = (sd - 1);
if (sd == 0) { for (i = 1; i <= size(L); i++){if (ncols(L[i]) == 1){S = createStartMat1(n,L[i]); break;}}}
else {S = createStartMat(sd,n);}
if (intvec(S) == 0) {return(list(H,list(intvec (0))));}
for (i = 1; i <= sd; i++) {H = H,(n^i);}
R[1] = H; kill H;
for (i = 1; i <= nrows(S); i++)
{intvec St = S[i,1..ncols(S)];
R = findHCoeffMis(St,n,L,P,R);
kill St;
}
return(R);
}
else
{for (i = 1; i <= size(P); i++)
{if (P[i] > degbound) {ERROR("degreebound is too small, GB contains elements of higher degree");}}
int sd;
intmat S;
sd = P[1];
for (i = 2; i <= size(P); i++) {if (P[i] < sd) {sd = P[i];}}
sd = (sd - 1);
if (sd == 0) { for (i = 1; i <= size(L); i++){if (ncols(L[i]) == 1){S = createStartMat1(n,L[i]); break;}}}
else {S = createStartMat(sd,n);}
if (intvec(S) == 0) {return(list(H,list(intvec(0))));}
for (i = 1; i <= sd; i++) {H = H,(n^i);}
R[1] = H; kill H;
for (i = 1; i <= nrows(S); i++)
{intvec St = S[i,1..ncols(S)];
R = findHCoeffMis(St,n,L,P,R,degbound);
kill St;
}
return(R);
}
}
example
{
"EXAMPLE:"; echo = 2;
ring r = 0,(x,y),dp;
def R = makeLetterplaceRing(5); // constructs a Letterplace ring
setring R; // sets basering to Letterplace ring
//some intmats, which contain monomials in intvec representation as rows
intmat I1[2][2] = 1,1,2,2; intmat I2[1][3] = 1,2,1;
intmat J1[1][2] = 1,1; intmat J2[2][3] = 2,1,2,1,2,1;
print(I1);
print(I2);
print(J1);
print(J2);
list G = I1,I2;// ideal, which is already a Groebner basis
list I = J1,J2; // ideal, which is already a Groebner basis
ivSickleHil(G,2); // invokes the procedure without any degree bound
ivSickleHil(I,2,5); // invokes the procedure with degree bound 5
}
proc lpDHilbert(ideal G, list #)
"USAGE: lpDHilbert(G[,degbound,n]); G an ideal, degbound, n optional integers
RETURN: list
PURPOSE:Computing K-dimension and Hilbert series, starting with a lp-ideal
ASSUME: - basering is a Letterplace ring. G is a Letterplace ideal.
@* - if you specify a different degree bound degbound,
@* degbound <= attrib(basering,uptodeg) should hold.
NOTE: - If L is the list returned, then L[1] is an integer corresponding to the
@* dimension, L[2] is an intvec which contains the coefficients of the
@* Hilbert series
@* - If degbound is set, there will be a degree bound added. 0 means no
@* degree bound. Default: attrib(basering,uptodeg).
@* - n can be set to a different number of variables.
@* Default: n = attrib(basering, lV).
@* - If I = L[2] is the intvec returned, then I[k] is the (k-1)-th
@* coefficient of the Hilbert series.
@* - If the K-dimension is known to be infinite, a degree bound is needed
EXAMPLE: example lpDHilbert; shows examples
"
{int degbound = attrib(basering,"uptodeg");int n = attrib(basering, "lV");
if (size(#) > 0){if (typeof(#[1])=="int"){if (#[1] >= 0){degbound = #[1];}}}
if (size(#) > 1){if (typeof(#[1])=="int"){if (#[2] > 0){n = #[2];}}}
list L;
L = lp2ivId(normalize(lead(G)));
return(ivDHilbert(L,n,degbound));
}
example
{
"EXAMPLE:"; echo = 2;
ring r = 0,(x,y),dp;
def R = makeLetterplaceRing(5); // constructs a Letterplace ring
setring R; // sets basering to Letterplace ring
ideal G = x(1)*x(2), y(1)*y(2),x(1)*y(2)*x(3); // ideal G contains a
//Groebner basis
lpDHilbert(G,5,2); // invokes procedure with degree bound 5 and 2 variables
// note that the optional parameters are not necessary, due to the finiteness
// of the K-dimension of the factor algebra
lpDHilbert(G); // procedure with ring parameters
lpDHilbert(G,0); // procedure without degreebound
}
proc lpDHilbertSickle(ideal G, list #)
"USAGE: lpDHilbertSickle(G[,degbound,n]); G an ideal, degbound, n optional
@* integers
RETURN: list
PURPOSE:Computing K-dimension, Hilbert series and mistletoes at once
ASSUME: - basering is a Letterplace ring. G is a Letterplace ideal.
@* - if you specify a different degree bound degbound,
@* degbound <= attrib(basering,uptodeg) should hold.
NOTE: - If L is the list returned, then L[1] is an integer, the K-dimension,
@* L[2] is an intvec, the Hilbert series and L[3] is an ideal,
@* the mistletoes
@* - If degbound is set, there will be a degree bound added. 0 means no
@* degree bound. Default: attrib(basering,uptodeg).
@* - n can be set to a different number of variables.
@* Default: n = attrib(basering, lV).
@* - If I = L[1] is the intvec returned, then I[k] is the (k-1)-th
@* coefficient of the Hilbert series.
@* - If the K-dimension is known to be infinite, a degree bound is needed
EXAMPLE: example lpDHilbertSickle; shows examples
"
{int degbound = attrib(basering,"uptodeg");int n = attrib(basering, "lV");
if (size(#) > 0){if (typeof(#[1])=="int"){if (#[1] >= 0){degbound = #[1];}}}
if (size(#) > 1){if (typeof(#[1])=="int"){if (#[2] > 0){n = #[2];}}}
list L;
L = lp2ivId(normalize(lead(G)));
L = ivDHilbertSickle(L,n,degbound);
L[3] = ivL2lpI(L[3]);
return(L);
}
example
{
"EXAMPLE:"; echo = 2;
ring r = 0,(x,y),dp;
def R = makeLetterplaceRing(5); // constructs a Letterplace ring
setring R; // sets basering to Letterplace ring
ideal G = x(1)*x(2), y(1)*y(2),x(1)*y(2)*x(3); // ideal G contains a
//Groebner basis
lpDHilbertSickle(G,5,2); //invokes procedure with degree bound 5 and 2 variables
// note that the optional parameters are not necessary, due to the finiteness
// of the K-dimension of the factor algebra
lpDHilbertSickle(G); // procedure with ring parameters
lpDHilbertSickle(G,0); // procedure without degreebound
}
proc lpHilbert(ideal G, list #)
"USAGE: lpHilbert(G[,degbound,n]); G an ideal, degbound, n optional integers
RETURN: intvec, containing the coefficients of the Hilbert series
PURPOSE:Computing the Hilbert series
ASSUME: - basering is a Letterplace ring. G is a Letterplace ideal.
@* - if you specify a different degree bound degbound,
@* degbound <= attrib(basering,uptodeg) should hold.
NOTE: - If degbound is set, there will be a degree bound added. 0 means no
@* degree bound. Default: attrib(basering,uptodeg).
@* - n is the number of variables, which can be set to a different number.
@* Default: attrib(basering, lV).
@* - If I is returned, then I[k] is the (k-1)-th coefficient of the Hilbert
@* series.
@* - If the K-dimension is known to be infinite, a degree bound is needed
EXAMPLE: example lpHilbert; shows examples
"
{int degbound = attrib(basering,"uptodeg");int n = attrib(basering, "lV");
if (size(#) > 0){if (typeof(#[1])=="int"){if (#[1] >= 0){degbound = #[1];}}}
if (size(#) > 1){if (typeof(#[1])=="int"){if (#[2] > 0){n = #[2];}}}
list L;
L = lp2ivId(normalize(lead(G)));
return(ivHilbert(L,n,degbound));
}
example
{
"EXAMPLE:"; echo = 2;
ring r = 0,(x,y),dp;
def R = makeLetterplaceRing(5); // constructs a Letterplace ring
setring R; // sets basering to Letterplace ring
ideal G = x(1)*x(2), y(1)*y(2),x(1)*y(2)*x(3); // ideal G contains a
//Groebner basis
lpHilbert(G,5,2); // invokes procedure with degree bound 5 and 2 variables
// note that the optional parameters are not necessary, due to the finiteness
// of the K-dimension of the factor algebra
lpDHilbert(G); // procedure with ring parameters
lpDHilbert(G,0); // procedure without degreebound
}
proc lpDimCheck(ideal G)
"USAGE: lpDimCheck(G);
RETURN: int, 1 if K-dimension of the factor algebra is infinite, 0 otherwise
PURPOSE:Checking a factor algebra for finiteness of the K-dimension
ASSUME: - basering is a Letterplace ring. G is a Letterplace ideal.
EXAMPLE: example lpDimCheck; shows examples
"
{int n = attrib(basering,"lV");
list L;
ideal R;
R = normalize(lead(G));
L = lp2ivId(R);
return(ivDimCheck(L,n));
}
example
{
"EXAMPLE:"; echo = 2;
ring r = 0,(x,y),dp;
def R = makeLetterplaceRing(5); // constructs a Letterplace ring
setring R; // sets basering to Letterplace ring
ideal G = x(1)*x(2), y(1)*y(2),x(1)*y(2)*x(3);
// Groebner basis
ideal I = x(1)*x(2), y(1)*x(2)*y(3), x(1)*y(2)*x(3);
// Groebner basis
lpDimCheck(G); // invokes procedure, factor algebra is of finite K-dimension
lpDimCheck(I); // invokes procedure, factor algebra is of infinite Kdimension
}
proc lpKDim(ideal G, list #)
"USAGE: lpKDim(G[,degbound, n]); G an ideal, degbound, n optional integers
RETURN: int, the K-dimension of the factor algebra
PURPOSE:Computing the K-dimension of a factor algebra, given via an ideal
ASSUME: - basering is a Letterplace ring. G is a Letterplace ideal.
@* - if you specify a different degree bound degbound,
@* degbound <= attrib(basering,uptodeg) should hold.
NOTE: - If degbound is set, there will be a degree bound added. 0 means no
@* degree bound. Default: attrib(basering, uptodeg).
@* - n is the number of variables, which can be set to a different number.
@* Default: attrib(basering, lV).
@* - If the K-dimension is known to be infinite, a degree bound is needed
EXAMPLE: example lpKDim; shows examples
"
{int degbound = attrib(basering, "uptodeg");int n = attrib(basering, "lV");
if (size(#) > 0){if (typeof(#[1])=="int"){if (#[1] >= 0){degbound = #[1];}}}
if (size(#) > 1){if (typeof(#[1])=="int"){if (#[2] > 0){n = #[2];}}}
list L;
L = lp2ivId(normalize(lead(G)));
return(ivKDim(L,n,degbound));
}
example
{
"EXAMPLE:"; echo = 2;
ring r = 0,(x,y),dp;
def R = makeLetterplaceRing(5); // constructs a Letterplace ring
setring R; // sets basering to Letterplace ring
ideal G = x(1)*x(2), y(1)*y(2),x(1)*y(2)*x(3);
// ideal G contains a Groebner basis
lpKDim(G); //procedure invoked with ring parameters
// the factor algebra is finite, so the degree bound given by the Letterplace
// ring is not necessary
lpKDim(G,0); // procedure without any degree bound
}
proc lpMis2Base(ideal M)
"USAGE: lpMis2Base(M); M an ideal
RETURN: ideal, a K-basis of the factor algebra
PURPOSE:Computing a K-basis out of given mistletoes
ASSUME: - basering is a Letterplace ring. G is a Letterplace ideal.
@* - M contains only monomials
NOTE: - The mistletoes have to be ordered lexicographically -> OrdMisLex.
EXAMPLE: example lpMis2Base; shows examples
"
{list L;
L = lpId2ivLi(M);
return(ivL2lpI(ivMis2Base(L)));
}
example
{
"EXAMPLE:"; echo = 2;
ring r = 0,(x,y),dp;
def R = makeLetterplaceRing(5); // constructs a Letterplace ring
setring R; // sets basering to Letterplace ring
ideal L = x(1)*y(2),y(1)*x(2)*y(3);
// ideal containing the mistletoes
lpMis2Base(L); // returns the K-basis of the factor algebra
}
proc lpMis2Dim(ideal M)
"USAGE: lpMis2Dim(M); M an ideal
RETURN: int, the K-dimension of the factor algebra
PURPOSE:Computing the K-dimension out of given mistletoes
ASSUME: - basering is a Letterplace ring. G is a Letterplace ideal.
@* - M contains only monomials
NOTE: - The mistletoes have to be ordered lexicographically -> OrdMisLex.
EXAMPLE: example lpMis2Dim; shows examples
"
{list L;
L = lpId2ivLi(M);
return(ivMis2Dim(L));
}
example
{
"EXAMPLE:"; echo = 2;
ring r = 0,(x,y),dp;
def R = makeLetterplaceRing(5); // constructs a Letterplace ring
setring R; // sets basering to Letterplace ring
ideal L = x(1)*y(2),y(1)*x(2)*y(3);
// ideal containing the mistletoes
lpMis2Dim(L); // returns the K-dimension of the factor algebra
}
proc lpOrdMisLex(ideal M)
"USAGE: lpOrdMisLex(M); M an ideal of mistletoes
RETURN: ideal, containing the mistletoes, ordered lexicographically
PURPOSE:A given set of mistletoes is ordered lexicographically
ASSUME: - basering is a Letterplace ring. G is a Letterplace ideal.
NOTE: This is preprocessing, it is not needed if the mistletoes are returned
@* from the sickle algorithm.
EXAMPLE: example lpOrdMisLex; shows examples
"
{return(ivL2lpI(sort(lpId2ivLi(M))[1]));}
example
{
"EXAMPLE:"; echo = 2;
ring r = 0,(x,y),dp;
def R = makeLetterplaceRing(5); // constructs a Letterplace ring
setring R; // sets basering to Letterplace ring
ideal M = x(1)*y(2)*x(3), y(1)*y(2)*x(3), x(1)*x(2), y(1)*x(2)*x(3)*x(4);
// some monomials
lpOrdMisLex(M); // orders the monomials lexicographically
}
proc lpSickle(ideal G, list #)
"USAGE: lpSickle(G[,degbound,n]); G an ideal, degbound, n optional integers
RETURN: ideal
PURPOSE:Computing the mistletoes of K[X]/<G>
ASSUME: - basering is a Letterplace ring. G is a Letterplace ideal.
@* - if you specify a different degree bound degbound,
@* degbound <= attrib(basering,uptodeg) should hold.
NOTE: - If degbound is set, there will be a degree bound added. 0 means no
@* degree bound. Default: attrib(basering,uptodeg).
@* - n is the number of variables, which can be set to a different number.
@* Default: attrib(basering, lV).
@* - If the K-dimension is known to be infinite, a degree bound is needed
EXAMPLE: example lpSickle; shows examples
"
{int degbound = attrib(basering,"uptodeg"); int n = attrib(basering, "lV");
if (size(#) > 0){if (typeof(#[1])=="int"){if (#[1] >= 0){degbound = #[1];}}}
if (size(#) > 1){if (typeof(#[1])=="int"){if (#[2] > 0){n = #[2];}}}
list L; ideal R;
R = normalize(lead(G));
L = lp2ivId(R);
L = ivSickle(L,n,degbound);
R = ivL2lpI(L);
return(R);
}
example
{
"EXAMPLE:"; echo = 2;
ring r = 0,(x,y),dp;
def R = makeLetterplaceRing(5); // constructs a Letterplace ring
setring R; // sets basering to Letterplace ring
ideal G = x(1)*x(2), y(1)*y(2),x(1)*y(2)*x(3); // ideal G contains a
//Groebner basis
lpSickle(G); //invokes the procedure with ring parameters
// the factor algebra is finite, so the degree bound given by the Letterplace
// ring is not necessary
lpSickle(G,0); // procedure without any degree bound
}
proc lpSickleDim(ideal G, list #)
"USAGE: lpSickleDim(G[,degbound,n]); G an ideal, degbound, n optional integers
RETURN: list
PURPOSE:Computing the K-dimension and the mistletoes
ASSUME: - basering is a Letterplace ring. G is a Letterplace ideal.
@* - if you specify a different degree bound degbound,
@* degbound <= attrib(basering,uptodeg) should hold.
NOTE: - If L is the list returned, then L[1] is an integer, the K-dimension,
@* L[2] is an ideal, the mistletoes.
@* - If degbound is set, there will be a degree bound added. 0 means no
@* degree bound. Default: attrib(basering,uptodeg).
@* - n is the number of variables, which can be set to a different number.
@* Default: attrib(basering, lV).
@* - If the K-dimension is known to be infinite, a degree bound is needed
EXAMPLE: example lpSickleDim; shows examples
"
{int degbound = attrib(basering,"uptodeg");int n = attrib(basering, "lV");
if (size(#) > 0){if (typeof(#[1])=="int"){if (#[1] >= 0){degbound = #[1];}}}
if (size(#) > 1){if (typeof(#[1])=="int"){if (#[2] > 0){n = #[2];}}}
list L;
L = lp2ivId(normalize(lead(G)));
L = ivSickleDim(L,n,degbound);
L[2] = ivL2lpI(L[2]);
return(L);
}
example
{
"EXAMPLE:"; echo = 2;
ring r = 0,(x,y),dp;
def R = makeLetterplaceRing(5); // constructs a Letterplace ring
setring R; // sets basering to Letterplace ring
ideal G = x(1)*x(2), y(1)*y(2),x(1)*y(2)*x(3); // ideal G contains a
//Groebner basis
lpSickleDim(G); // invokes the procedure with ring parameters
// the factor algebra is finite, so the degree bound given by the Letterplace
// ring is not necessary
lpSickleDim(G,0); // procedure without any degree bound
}
proc lpSickleHil(ideal G, list #)
"USAGE: lpSickleHil(G);
RETURN: list
PURPOSE:Computing the Hilbert series and the mistletoes
ASSUME: - basering is a Letterplace ring. G is a Letterplace ideal.
@* - if you specify a different degree bound degbound,
@* degbound <= attrib(basering,uptodeg) should hold.
NOTE: - If L is the list returned, then L[1] is an intvec, corresponding to the
@* Hilbert series, L[2] is an ideal, the mistletoes.
@* - If degbound is set, there will be a degree bound added. 0 means no
@* degree bound. Default: attrib(basering,uptodeg).
@* - n is the number of variables, which can be set to a different number.
@* Default: attrib(basering, lV).
@* - If I = L[1] is the intvec returned, then I[k] is the (k-1)-th
@* coefficient of the Hilbert series.
@* - If the K-dimension is known to be infinite, a degree bound is needed
EXAMPLE: example lpSickleHil; shows examples
"
{int degbound = attrib(basering,"uptodeg");int n = attrib(basering, "lV");
if (size(#) > 0){if (typeof(#[1])=="int"){if (#[1] >= 0){degbound = #[1];}}}
if (size(#) > 1){if (typeof(#[1])=="int"){if (#[2] > 0){n = #[2];}}}
list L;
L = lp2ivId(normalize(lead(G)));
L = ivSickleHil(L,n,degbound);
L[2] = ivL2lpI(L[2]);
return(L);
}
example
{
"EXAMPLE:"; echo = 2;
ring r = 0,(x,y),dp;
def R = makeLetterplaceRing(5); // constructs a Letterplace ring
setring R; // sets basering to Letterplace ring
ideal G = x(1)*x(2), y(1)*y(2),x(1)*y(2)*x(3); // ideal G contains a
//Groebner basis
lpSickleHil(G); // invokes the procedure with ring parameters
// the factor algebra is finite, so the degree bound given by the Letterplace
// ring is not necessary
lpSickleHil(G,0); // procedure without any degree bound
}
proc sickle(ideal G, list #)
"USAGE: sickle(G[,m, d, h, degbound]); G an ideal; m,d,h,degbound optional
@* integers
RETURN: list
PURPOSE:Allowing the user to access all procs with one command
ASSUME: - basering is a Letterplace ring. G is a Letterplace ideal.
@* - if you specify a different degree bound degbound,
@* degbound <= attrib(basering,uptodeg) should hold.
NOTE: The returned object will always be a list, but the entries of the
@* returned list may be very different
@* case m=1,d=1,h=1: see lpDHilbertSickle
@* case m=1,d=1,h=0: see lpSickleDim
@* case m=1,d=0,h=1: see lpSickleHil
@* case m=1,d=0,h=0: see lpSickle (this is the default case)
@* case m=0,d=1,h=1: see lpDHilbert
@* case m=0,d=1,h=0: see lpKDim
@* case m=0,d=0,h=1: see lpHilbert
@* case m=0,d=0,h=0: returns an error
@* - If degbound is set, there will be a degree bound added. 0 means no
@* degree bound. Default: attrib(basering,uptodeg).
@* - If the K-dimension is known to be infinite, a degree bound is needed
EXAMPLE: example sickle; shows examples
"
{int m,d,h,degbound;
m = 1; d = 0; h = 0; degbound = attrib(basering,"uptodeg");
if (size(#) > 0) {if (typeof(#[1])=="int"){if (#[1] < 1) {m = 0;}}}
if (size(#) > 1) {if (typeof(#[1])=="int"){if (#[2] > 0) {d = 1;}}}
if (size(#) > 2) {if (typeof(#[1])=="int"){if (#[3] > 0) {h = 1;}}}
if (size(#) > 3) {if (typeof(#[1])=="int"){if (#[4] >= 0) {degbound = #[4];}}}
if (m == 1)
{if (d == 0)
{if (h == 0) {return(lpSickle(G,degbound,attrib(basering,"lV")));}
else {return(lpSickleHil(G,degbound,attrib(basering,"lV")));}
}
else
{if (h == 0) {return(lpSickleDim(G,degbound,attrib(basering,"lV")));}
else {return(lpDHilbertSickle(G,degbound,attrib(basering,"lV")));}
}
}
else
{if (d == 0)
{if (h == 0) {ERROR("You request to do nothing, so relax and do so");}
else {return(lpHilbert(G,degbound,attrib(basering,"lV")));}
}
else
{if (h == 0) {return(lpKDim(G,degbound,attrib(basering,"lV")));}
else {return(lpDHilbert(G,degbound,attrib(basering,"lV")));}
}
}
}
example
{
"EXAMPLE:"; echo = 2;
ring r = 0,(x,y),dp;
def R = makeLetterplaceRing(5); // constructs a Letterplace ring
setring R; // sets basering to Letterplace ring
ideal G = x(1)*x(2), y(1)*y(2),x(1)*y(2)*x(3);
// G contains a Groebner basis
sickle(G,1,1,1); // computes mistletoes, K-dimension and the Hilbert series
sickle(G,1,0,0); // computes mistletoes only
sickle(G,0,1,0); // computes K-dimension only
sickle(G,0,0,1); // computes Hilbert series only
}
///////////////////////////////////////////////////////////////////////////////
proc tst_fpadim()
{
example ivDHilbert;
example ivDHilbertSickle;
example ivDimCheck;
example ivHilbert;
example ivKDim;
example ivMis2Base;
example ivMis2Dim;
example ivOrdMisLex;
example ivSickle;
example ivSickleHil;
example ivSickleDim;
example lpDHilbert;
example lpDHilbertSickle;
example lpHilbert;
example lpDimCheck;
example lpKDim;
example lpMis2Base;
example lpMis2Dim;
example lpOrdMisLex;
example lpSickle;
example lpSickleHil;
example lpSickleDim;
example sickle;
example ivL2lpI;
example iv2lp;
example iv2lpList;
example iv2lpMat;
example lp2iv;
example lp2ivId;
example lpId2ivLi;
}
/*
Here are some examples one may try. Just copy them into your console.
These are relations for braid groups, up to degree d:
LIB "fpadim.lib";
ring r = 0,(x,y,z),dp;
int d =10; // degree
def R = makeLetterplaceRing(d);
setring R;
ideal I = y(1)*x(2)*y(3) - z(1)*y(2)*z(3), x(1)*y(2)*x(3) - z(1)*x(2)*y(3),
z(1)*x(2)*z(3) - y(1)*z(2)*x(3), x(1)*x(2)*x(3) + y(1)*y(2)*y(3) +
z(1)*z(2)*z(3) + x(1)*y(2)*z(3);
option(prot);
option(redSB);option(redTail);option(mem);
ideal J = system("freegb",I,d,3);
lpDimCheck(J);
sickle(J,1,1,1,d);//Computes mistletoes, K-dimension and the Hilbert series
LIB "fpadim.lib";
ring r = 0,(x,y,z),dp;
int d =11; // degree
def R = makeLetterplaceRing(d);
setring R;
ideal I = y(1)*x(2)*y(3) - z(1)*y(2)*z(3), x(1)*y(2)*z(3) - z(1)*x(2)*y(3),
z(1)*x(2)*z(3) - y(1)*z(2)*x(3), x(1)*x(2)*x(3) + y(1)*y(2)*y(3) +
z(1)*z(2)*z(3) + x(1)*y(2)*z(3);
option(prot);
option(redSB);option(redTail);option(mem);
ideal J = system("freegb",I,d,3);
lpDimCheck(J);
sickle(J,1,1,1,d);
LIB "fpadim.lib";
ring r = 0,(x,y,z),dp;
int d = 6; // degree
def R = makeLetterplaceRing(d);
setring R;
ideal I = y(1)*x(2)*y(3) - z(1)*y(2)*z(3), x(1)*y(2)*x(3) - z(1)*x(2)*y(3),
z(1)*x(2)*z(3) - y(1)*z(2)*x(3), x(1)*x(2)*x(3) -2*y(1)*y(2)*y(3) + 3*z(1)*z(2)*z(3) -4*x(1)*y(2)*z(3) + 5*x(1)*z(2)*z(3)- 6*x(1)*y(2)*y(3) +7*x(1)*x(2)*z(3) - 8*x(1)*x(2)*y(3);
option(prot);
option(redSB);option(redTail);option(mem);
ideal J = system("freegb",I,d,3);
lpDimCheck(J);
sickle(J,1,1,1,d);
*/
/*
Here are some examples, which can also be found in [studzins]:
// takes up to 880Mb of memory
LIB "fpadim.lib";
ring r = 0,(x,y,z),dp;
int d =10; // degree
def R = makeLetterplaceRing(d);
setring R;
ideal I =
z(1)*z(2)*z(3)*z(4) + y(1)*x(2)*y(3)*x(4) - x(1)*y(2)*y(3)*x(4) - 3*z(1)*y(2)*x(3)*z(4), x(1)*x(2)*x(3) + y(1)*x(2)*y(3) - x(1)*y(2)*x(3), z(1)*y(2)*x(3)-x(1)*y(2)*z(3) + z(1)*x(2)*z(3);
option(prot);
option(redSB);option(redTail);option(mem);
ideal J = system("freegb",I,d,nvars(r));
lpDimCheck(J);
sickle(J,1,1,1,d); // dimension is 24872
LIB "fpadim.lib";
ring r = 0,(x,y,z),dp;
int d =10; // degree
def R = makeLetterplaceRing(d);
setring R;
ideal I = x(1)*y(2) + y(1)*z(2), x(1)*x(2) + x(1)*y(2) - y(1)*x(2) - y(1)*y(2);
option(prot);
option(redSB);option(redTail);option(mem);
ideal J = system("freegb",I,d,3);
lpDimCheck(J);
sickle(J,1,1,1,d);
*/
|