Changeset 31b08bd in git
- Timestamp:
- Oct 28, 2017, 2:04:52 PM (6 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 155bf7cc084494f5f1ef07735c609dd4e3d14b6b
- Parents:
- fa3c79e96fac38774ea42d0424e07cacb3b567a5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/fpadim.lib
rfa3c79 r31b08bd 49 49 @* [ufna] Ufnarovskij: Combinatorical and asymptotic methods in algebra, 1990 50 50 @* [lls] Levandovskyy, La Scala: Letterplace ideals and non-commutative 51 51 Groebner bases, 2009 52 52 @* [studzins] Studzinski: Dimension computations in non-commutative, 53 53 associative algebras, Diploma thesis, RWTH Aachen, 2010 54 54 55 55 ASSUMPTIONS: … … 57 57 @* - all intvecs correspond to Letterplace monomials 58 58 @* - if you specify a different degree bound d, 59 59 d <= attrib(basering,uptodeg) holds 60 60 @* In the procedures below, 'iv' stands for intvec representation 61 61 and 'lp' for the letterplace representation of monomials 62 62 63 63 PROCEDURES: … … 148 148 {for (i3 = 1; i3 <= n; i3++) 149 149 {for (i4 = 1; i4 <= (n^(i1-1)); i4++) 150 151 152 150 {M[i2,i1] = i3; 151 i2 = i2 + 1; 152 } 153 153 } 154 154 } … … 196 196 for (j = 1; j<= size(P); j++) 197 197 {if (P[j] <= size(Vt)) 198 199 200 198 {Vt2 = Vt[(size(Vt)-P[j]+1)..size(Vt)]; 199 if (isInMat(Vt2,L[j]) > 0) {w = 1; break;} 200 } 201 201 } 202 202 if (w == 0) 203 203 {vector Vtt; 204 205 206 204 for (it = 1; it <= size(Vt); it++){Vtt = Vtt + Vt[it]*gen(it);} 205 M = M,Vtt; 206 kill Vtt; 207 207 } 208 208 } … … 212 212 for (i = 1; i <= size(M); i++) 213 213 {kill Vt; intvec Vt; 214 215 214 for (j =1; j <= size(M[i]); j++){Vt[j] = int(leadcoef(M[i][j]));} 215 dimen = dimen + 1 + findDimen(Vt,n,L,P); 216 216 } 217 217 return(dimen); … … 225 225 for (j = 1; j<= size(P); j++) 226 226 {if (P[j] <= size(Vt)) 227 228 229 227 {Vt2 = Vt[(size(Vt)-P[j]+1)..size(Vt)]; 228 if (isInMat(Vt2,L[j]) > 0) {w = 1; break;} 229 } 230 230 } 231 231 if (w == 0) {vector Vtt; 232 233 234 232 for (it = 1; it <= size(Vt); it++){Vtt = Vtt + Vt[it]*gen(it);} 233 M = M,Vtt; 234 kill Vtt; 235 235 } 236 236 } … … 240 240 for (i = 1; i <= size(M); i++) 241 241 {kill Vt; intvec Vt; 242 243 242 for (j =1; j <= size(M[i]); j++){Vt[j] = int(leadcoef(M[i][j]));} 243 dimen = dimen + 1 + findDimen(Vt,n,L,P,degbound); 244 244 } 245 245 return(dimen); … … 260 260 for (j = 1; j <= size(P); j++) 261 261 {if (P[j] <= size(Vt)) 262 263 264 265 262 {Vt2 = Vt[(size(Vt)-P[j]+1)..size(Vt)]; 263 if (isInMat(Vt2,L[j]) > 0) 264 {w = 1; break;} 265 } 266 266 } 267 267 if (w == 0) {r = findCycle(Vt,L,P,n,ld,M);} … … 277 277 for (it = 1; it <= j; it++) 278 278 { for(it2 = 1; it2 <= nrows(M);it2++) 279 279 {Mt[it,it2] = int(leadcoef(M[it2,it]));} 280 280 } 281 281 Vt = V[(size(V)-ld+1)..size(V)]; … … 284 284 else 285 285 {vector Vtt; 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 286 for (it =1; it <= size(Vt); it++) 287 {Vtt = Vtt + Vt[it]*gen(it);} 288 M = M,Vtt; 289 kill Vtt; 290 for (i = 1; i <= n; i++) 291 {Vt = V,i; w = 0; 292 for (j = 1; j <= size(P); j++) 293 {if (P[j] <= size(Vt)) 294 {Vt2 = Vt[(size(Vt)-P[j]+1)..size(Vt)]; 295 //L[j]; type(L[j]);Vt2;type(Vt2); 296 if (isInMat(Vt2,L[j]) > 0) 297 {w = 1; break;} 298 } 299 } 300 if (w == 0) {r = findCycle(Vt,L,P,n,ld,M);} 301 if (r == 1) {break;} 302 } 303 return(r); 304 304 } 305 305 } … … 313 313 for (i = 1; i <= n; i++) 314 314 {Vt = V,i; w = 0; 315 316 317 318 319 320 321 322 323 324 315 for (j = 1; j <= size(P); j++) 316 {if (P[j] <= size(Vt)) 317 {Vt2 = Vt[(size(Vt)-P[j]+1)..size(Vt)]; 318 //L[j]; type(L[j]);Vt2;type(Vt2); 319 if (isInMat(Vt2,L[j]) > 0) 320 {w = 1; break;} 321 } 322 } 323 if (w == 0) {r = findCycle(Vt,L,P,n,ld,M);} 324 if (r == 1) {break;} 325 325 } 326 326 return(r); … … 336 336 " 337 337 { 338 intvec rV; 339 int k,k1,t; 340 int j = V[size(V)]; 341 if (T[j,i] > 0) {return(V);} 342 else 343 { 344 for (k = 1; k <= ncols(T); k++) 338 intvec rV; 339 int k,k1,t; 340 int j = V[size(V)]; 341 if (T[j,i] > 0) {return(V);} 342 else 345 343 { 346 t = 0; 347 if (T[j,k] > 0) 348 { 349 for (k1 = 1; k1 <= size(V); k1++) {if (V[k1] == k) {t = 1; break;}} 350 if (t == 0) 344 for (k = 1; k <= ncols(T); k++) 351 345 { 352 rV = V; 353 rV[size(rV)+1] = k; 354 rV = findCycleDFS(i,T,rV); 355 if (rV[1] > -1) {return(rV);} 356 } 357 } 358 } 359 } 360 return(intvec(-1)); 346 t = 0; 347 if (T[j,k] > 0) 348 { 349 for (k1 = 1; k1 <= size(V); k1++) {if (V[k1] == k) {t = 1; break;}} 350 if (t == 0) 351 { 352 rV = V; 353 rV[size(rV)+1] = k; 354 rV = findCycleDFS(i,T,rV); 355 if (rV[1] > -1) {return(rV);} 356 } 357 } 358 } 359 } 360 return(intvec(-1)); 361 361 } 362 362 … … 381 381 for (j = 1; j<= size(P); j++) 382 382 {if (P[j] <= size(Vt)) 383 384 385 383 {Vt2 = Vt[(size(Vt)-P[j]+1)..size(Vt)]; 384 if (isInMat(Vt2,L[j]) > 0) {w = 1; break;} 385 } 386 386 } 387 387 if (w == 0) 388 388 {vector Vtt; 389 390 391 389 for (it = 1; it <= size(Vt); it++){Vtt = Vtt + Vt[it]*gen(it);} 390 M = M,Vtt; 391 kill Vtt; 392 392 } 393 393 } … … 397 397 for (i = 1; i <= size(M); i++) 398 398 {kill Vt; intvec Vt; 399 400 399 for (j =1; j <= size(M[i]); j++) {Vt[j] = int(leadcoef(M[i][j]));} 400 h1 = h1 + 1; H1 = findHCoeff(Vt,n,L,P,H1); 401 401 } 402 402 if (size(H1) < (size(V)+2)) {H1[(size(V)+2)] = h1;} … … 413 413 for (j = 1; j<= size(P); j++) 414 414 {if (P[j] <= size(Vt)) 415 416 417 415 {Vt2 = Vt[(size(Vt)-P[j]+1)..size(Vt)]; 416 if (isInMat(Vt2,L[j]) > 0) {w = 1; break;} 417 } 418 418 } 419 419 if (w == 0) 420 420 {vector Vtt; 421 422 423 421 for (it = 1; it <= size(Vt); it++){Vtt = Vtt + Vt[it]*gen(it);} 422 M = M,Vtt; 423 kill Vtt; 424 424 } 425 425 } … … 429 429 for (i = 1; i <= size(M); i++) 430 430 {kill Vt; intvec Vt; 431 432 433 431 for (j =1; j <= size(M[i]); j++) 432 {Vt[j] = int(leadcoef(M[i][j]));} 433 h1 = h1 + 1; H1 = findHCoeff(Vt,n,L,P,H1,degbound); 434 434 } 435 435 if (size(H1) < (size(V)+2)) { H1[(size(V)+2)] = h1;} … … 458 458 for (j = 1; j<= size(P); j++) 459 459 {if (P[j] <= size(Vt)) 460 461 462 460 {Vt2 = Vt[(size(Vt)-P[j]+1)..size(Vt)]; 461 if (isInMat(Vt2,L[j]) > 0) {w = 1; break;} 462 } 463 463 } 464 464 if (w == 0) 465 465 {vector Vtt; 466 467 468 466 for (it = 1; it <= size(Vt); it++){Vtt = Vtt + Vt[it]*gen(it);} 467 M = M,Vtt; 468 kill Vtt; 469 469 } 470 470 } … … 474 474 for (i = 1; i <= size(M); i++) 475 475 {kill Vt; intvec Vt; 476 477 478 479 480 481 476 for (j =1; j <= size(M[i]); j++) 477 {Vt[j] = int(leadcoef(M[i][j]));} 478 if (size(R[1]) < (size(V)+2)) { R[1][(size(V)+2)] = 1;} 479 else 480 {R[1][(size(V)+2)] = R[1][(size(V)+2)] + 1;} 481 R = findHCoeffMis(Vt,n,L,P,R); 482 482 } 483 483 return(R); … … 495 495 for (j = 1; j<= size(P); j++) 496 496 {if (P[j] <= size(Vt)) 497 498 499 497 {Vt2 = Vt[(size(Vt)-P[j]+1)..size(Vt)]; 498 if (isInMat(Vt2,L[j]) > 0) {w = 1; break;} 499 } 500 500 } 501 501 if (w == 0) 502 502 {vector Vtt; 503 504 505 503 for (it = 1; it <= size(Vt); it++){Vtt = Vtt + Vt[it]*gen(it);} 504 M = M,Vtt; 505 kill Vtt; 506 506 } 507 507 } … … 511 511 for (i = 1; i <= ncols(M); i++) 512 512 {kill Vt; intvec Vt; 513 514 515 516 517 518 513 for (j =1; j <= size(M[i]); j++) 514 {Vt[j] = int(leadcoef(M[i][j]));} 515 if (size(R[1]) < (size(V)+2)) { R[1][(size(V)+2)] = 1;} 516 else 517 {R[1][(size(V)+2)] = R[1][(size(V)+2)] + 1;} 518 R = findHCoeffMis(Vt,n,L,P,R,degbound); 519 519 } 520 520 return(R); … … 539 539 for (j = 1; j<= size(P); j++) 540 540 {if (P[j] <= size(Vt)) 541 542 543 541 {Vt2 = Vt[(size(Vt)-P[j]+1)..size(Vt)]; 542 if (isInMat(Vt2,L[j]) > 0) {w = 1; break;} 543 } 544 544 } 545 545 if (w == 0) 546 546 {vector Vtt; 547 548 549 547 for (it = 1; it <= size(Vt); it++){Vtt = Vtt + Vt[it]*gen(it);} 548 M = M,Vtt; 549 kill Vtt; 550 550 } 551 551 } … … 559 559 for (i = 1; i <= size(M); i++) 560 560 {kill Vt; intvec Vt; 561 562 561 for (j =1; j <= size(M[i]); j++){Vt[j] = int(leadcoef(M[i][j]));} 562 R[1] = R[1] + 1; R = findMisDim(Vt,n,L,P,R); 563 563 } 564 564 return(R); … … 576 576 for (j = 1; j<= size(P); j++) 577 577 {if (P[j] <= size(Vt)) 578 579 580 578 {Vt2 = Vt[(size(Vt)-P[j]+1)..size(Vt)]; 579 if (isInMat(Vt2,L[j]) > 0) {w = 1; break;} 580 } 581 581 } 582 582 if (w == 0) 583 583 {vector Vtt; 584 585 586 584 for (it = 1; it <= size(Vt); it++){Vtt = Vtt + Vt[it]*gen(it);} 585 M = M,Vtt; 586 kill Vtt; 587 587 } 588 588 } … … 596 596 for (i = 1; i <= size(M); i++) 597 597 {kill Vt; intvec Vt; 598 599 598 for (j =1; j <= size(M[i]); j++){Vt[j] = int(leadcoef(M[i][j]));} 599 R[1] = R[1] + 1; R = findMisDim(Vt,n,L,P,R,degbound); 600 600 } 601 601 return(R); … … 624 624 for (j = 1; j <= size(P); j++) 625 625 {if (P[j] <= size(Vt)) 626 627 628 629 626 {Vt2 = Vt[(size(Vt)-P[j]+1)..size(Vt)]; 627 if (isInMat(Vt2,L[j]) > 0) 628 {w = 1; break;} 629 } 630 630 } 631 631 if (w == 0) 632 632 {vector Vtt; 633 634 635 633 for (it = 1; it <= size(Vt); it++){Vtt = Vtt + Vt[it]*gen(it);} 634 M = M,Vtt; 635 kill Vtt; 636 636 } 637 637 } … … 641 641 for (i = 1; i <= size(M); i++) 642 642 {kill Vt; intvec Vt; 643 644 643 for (j =1; j <= size(M[i]); j++){Vt[j] = int(leadcoef(M[i][j]));} 644 R = R + findmistletoes(Vt,n,L,P); 645 645 } 646 646 return(R); … … 655 655 for (j = 1; j <= size(P); j++) 656 656 {if (P[j] <= size(Vt)) 657 658 659 657 {Vt2 = Vt[(size(Vt)-P[j]+1)..size(Vt)]; 658 if (isInMat(Vt2,L[j]) > 0){w = 1; break;} 659 } 660 660 } 661 661 if (w == 0) 662 662 {vector Vtt; 663 664 665 663 for (it = 1; it <= size(Vt); it++){Vtt = Vtt + Vt[it]*gen(it);} 664 M = M,Vtt; 665 kill Vtt; 666 666 } 667 667 } … … 671 671 for (i = 1; i <= ncols(M); i++) 672 672 {kill Vt; intvec Vt; 673 674 675 676 673 for (j =1; j <= size(M[i]); j++) 674 {Vt[j] = int(leadcoef(M[i][j]));} 675 //Vt; typeof(Vt); size(Vt); 676 R = R + findmistletoes(Vt,n,L,P,degbound); 677 677 } 678 678 return(R); … … 683 683 static proc growthAlg(intmat T, list #) 684 684 " 685 real algorithm for checking the growth of an algebra 686 " 687 { 688 int s = 1; 689 if (size(#) > 0) { s = #[1];} 690 int j; 691 int n = ncols(T); 692 intvec NV,C; NV[n] = 0; int m,i; 693 intmat T2[n][n] = T[1..n,1..n]; intmat N[n][n]; 694 if (T2 == N) 695 { 685 real algorithm for checking the growth of an algebra 686 " 687 { 688 int s = 1; 689 if (size(#) > 0) { s = #[1];} 690 int j; 691 int n = ncols(T); 692 intvec NV,C; NV[n] = 0; int m,i; 693 intmat T2[n][n] = T[1..n,1..n]; intmat N[n][n]; 694 if (T2 == N) 695 { 696 for (i = 1; i <= n; i++) 697 { 698 if (m < T[n+1,i]) { m = T[n+1,i];} 699 } 700 return(m); 701 } 702 703 //first part: the diagonals 704 for (i = s; i <= n; i++) 705 { 706 if (T[i,i] > 0) 707 { 708 if ((T[i,i] >= 1) && (T[n+1,i] > 0)) {return(-1);} 709 if ((T[i,i] == 1) && (T[n+1,i] == 0)) 710 { 711 T[i,i] = 0; 712 T[n+1,i] = 1; 713 return(growthAlg(T)); 714 } 715 } 716 } 717 718 //second part: searching for the last but one vertices 719 T2 = T2*T2; 720 for (i = s; i <= n; i++) 721 { 722 if ((intvec(T[i,1..n]) <> intvec(0)) && (intvec(T2[i,1..n]) == intvec(0))) 723 { 724 for (j = 1; j <= n; j++) 725 { 726 if ((T[i,j] > 0) && (m < T[n+1,j])) {m = T[n+1,j];} 727 } 728 T[n+1,i] = T[n+1,i] + m; 729 T[i,1..n] = NV; 730 return(growthAlg(T)); 731 } 732 } 733 m = 0; 734 735 //third part: searching for circles 736 for (i = s; i <= n; i++) 737 { 738 T2 = T[1..n,1..n]; 739 C = findCycleDFS(i,T2, intvec(i)); 740 if (C[1] > 0) 741 { 742 for (j = 2; j <= size(C); j++) 743 { 744 T[i,1..n] = T[i,1..n] + T[C[j],1..n]; 745 T[C[j],1..n] = NV; 746 } 747 for (j = 2; j <= size(C); j++) 748 { 749 T[1..n,i] = T[1..n,i] + T[1..n,C[j]]; 750 T[1..n,C[j]] = NV; 751 } 752 T[i,i] = T[i,i] - size(C) + 1; 753 m = 0; 754 for (j = 1; j <= size(C); j++) 755 { 756 m = m + T[n+1,C[j]]; 757 } 758 for (j = 1; j <= size(C); j++) 759 { 760 T[n+1,C[j]] = m; 761 } 762 return(growthAlg(T,i)); 763 } 764 else {ERROR("No Cycle found, something seems wrong! Please contact the authors.");} 765 } 766 767 m = 0; 696 768 for (i = 1; i <= n; i++) 697 769 { 698 if (m < T[n+1,i]) { m = T[n+1,i];} 770 if (m < T[n+1,i]) 771 { 772 m = T[n+1,i]; 773 } 699 774 } 700 775 return(m); 701 } 702 703 //first part: the diagonals 704 for (i = s; i <= n; i++) 705 { 706 if (T[i,i] > 0) 776 } 777 778 static proc GlDimSuffix(intvec v, intvec g) 779 { 780 //Computes the shortest r such that g is a suffix for vr 781 //only valid for lex orderings? 782 intvec r,gt,vt,lt,g2; 783 int lg,lv,l,i,c,f; 784 lg = size(g); lv = size(v); 785 if (lg <= lv) 707 786 { 708 if ((T[i,i] >= 1) && (T[n+1,i] > 0)) {return(-1);} 709 if ((T[i,i] == 1) && (T[n+1,i] == 0)) 710 { 711 T[i,i] = 0; 712 T[n+1,i] = 1; 713 return(growthAlg(T)); 714 } 715 } 716 } 717 718 //second part: searching for the last but one vertices 719 T2 = T2*T2; 720 for (i = s; i <= n; i++) 721 { 722 if ((intvec(T[i,1..n]) <> intvec(0)) && (intvec(T2[i,1..n]) == intvec(0))) 723 { 724 for (j = 1; j <= n; j++) 725 { 726 if ((T[i,j] > 0) && (m < T[n+1,j])) {m = T[n+1,j];} 727 } 728 T[n+1,i] = T[n+1,i] + m; 729 T[i,1..n] = NV; 730 return(growthAlg(T)); 731 } 732 } 733 m = 0; 734 735 //third part: searching for circles 736 for (i = s; i <= n; i++) 737 { 738 T2 = T[1..n,1..n]; 739 C = findCycleDFS(i,T2, intvec(i)); 740 if (C[1] > 0) 787 l = lv-lg; 788 } 789 else 741 790 { 742 for (j = 2; j <= size(C); j++) 743 { 744 T[i,1..n] = T[i,1..n] + T[C[j],1..n]; 745 T[C[j],1..n] = NV; 746 } 747 for (j = 2; j <= size(C); j++) 748 { 749 T[1..n,i] = T[1..n,i] + T[1..n,C[j]]; 750 T[1..n,C[j]] = NV; 751 } 752 T[i,i] = T[i,i] - size(C) + 1; 753 m = 0; 754 for (j = 1; j <= size(C); j++) 755 { 756 m = m + T[n+1,C[j]]; 757 } 758 for (j = 1; j <= size(C); j++) 759 { 760 T[n+1,C[j]] = m; 761 } 762 return(growthAlg(T,i)); 763 } 764 else {ERROR("No Cycle found, something seems wrong! Please contact the authors.");} 765 } 766 767 m = 0; 768 for (i = 1; i <= n; i++) 769 { 770 if (m < T[n+1,i]) 771 { 772 m = T[n+1,i]; 773 } 774 } 775 return(m); 776 } 777 778 static proc GlDimSuffix(intvec v, intvec g) 779 { 780 //Computes the shortest r such that g is a suffix for vr 781 //only valid for lex orderings? 782 intvec r,gt,vt,lt,g2; 783 int lg,lv,l,i,c,f; 784 lg = size(g); lv = size(v); 785 if (lg <= lv) 786 { 787 l = lv-lg; 788 } 789 else 790 { 791 l = 0; g2 = g[(lv+1)..lg]; 792 g = g[1..lv]; lg = size(g); 793 c = 1; 794 } 795 while (l < lv) 791 l = 0; g2 = g[(lv+1)..lg]; 792 g = g[1..lv]; lg = size(g); 793 c = 1; 794 } 795 while (l < lv) 796 796 { 797 797 vt = v[(l+1)..lv]; 798 798 gt = g[1..(lv-l)]; 799 799 lt = size(gt); 800 800 for (i = 1; i <= lt; i++) 801 801 { 802 803 802 if (vt[i]<>gt[i]) {l++; break;} 803 } 804 804 if (lt <=i ) { f = 1; break;} 805 805 } 806 if (f == 0) {return(g);}807 r = g[(lv-l+1)..lg];808 if (c == 1) {r = r,g2;}809 return(r);806 if (f == 0) {return(g);} 807 r = g[(lv-l+1)..lg]; 808 if (c == 1) {r = r,g2;} 809 return(r); 810 810 } 811 811 812 812 static proc isNormal(intvec V, list G) 813 813 { 814 int i,j,k,l; 815 k = 0; 816 for (i = 1; i <= size(G); i++) 817 { 818 if ( size(G[i]) <= size(V) ) 819 { 820 while ( size(G[i])+k <= size(V) ) 814 int i,j,k,l; 815 k = 0; 816 for (i = 1; i <= size(G); i++) 817 { 818 if ( size(G[i]) <= size(V) ) 821 819 { 822 if ( G[i] == V[(1+k)..size(V)] ) {return(1);} 823 } 824 } 825 } 826 return(0); 820 while ( size(G[i])+k <= size(V) ) 821 { 822 if ( G[i] == V[(1+k)..size(V)] ) {return(1);} 823 } 824 } 825 } 826 return(0); 827 827 } 828 828 829 829 static proc findDChain(list L) 830 830 { 831 list Li; int i,j;832 for (i = 1; i <= size(L); i++) {Li[i] = size(L[i]);}833 Li = sort(Li); Li = Li[1];834 return(Li[size(Li)]);831 list Li; int i,j; 832 for (i = 1; i <= size(L); i++) {Li[i] = size(L[i]);} 833 Li = sort(Li); Li = Li[1]; 834 return(Li[size(Li)]); 835 835 } 836 836 … … 879 879 " 880 880 { 881 int n = size(P);882 if (n <= 0) {return(1);}883 if (size(I) < n) {return(0);}884 intvec IP = I[1..n];885 if (IP == P) {return(1);}886 else {return(0);}881 int n = size(P); 882 if (n <= 0) {return(1);} 883 if (size(I) < n) {return(0);} 884 intvec IP = I[1..n]; 885 if (IP == P) {return(1);} 886 else {return(0);} 887 887 } 888 888 … … 893 893 " 894 894 { 895 int n = size(S);896 if (n <= 0) {return(1);}897 int m = size(I);898 if (m < n) {return(0);}899 intvec IS = I[(m-n+1)..m];900 if (IS == S) {return(1);}901 else {return(0);}895 int n = size(S); 896 if (n <= 0) {return(1);} 897 int m = size(I); 898 if (m < n) {return(0);} 899 intvec IS = I[(m-n+1)..m]; 900 if (IS == S) {return(1);} 901 else {return(0);} 902 902 } 903 903 … … 908 908 " 909 909 { 910 int n = size(IF);911 int m = size(I);912 913 if (n <= 0) {914 return(1);915 }916 if (m < n) {917 return(0);918 }919 920 for (int i = 0; (n + i) <= m; i++){921 intvec IIF = I[(1 + i)..(n + i)];922 if (IIF == IF) {923 return(1);924 }925 }926 return(0);910 int n = size(IF); 911 int m = size(I); 912 913 if (n <= 0) { 914 return(1); 915 } 916 if (m < n) { 917 return(0); 918 } 919 920 for (int i = 0; (n + i) <= m; i++){ 921 intvec IIF = I[(1 + i)..(n + i)]; 922 if (IIF == IF) { 923 return(1); 924 } 925 } 926 return(0); 927 927 } 928 928 … … 1055 1055 EXAMPLE: example lpId2ivLi; shows examples 1056 1056 " 1057 {int i,j,k;1058 1059 1060 1061 1062 } 1063 example1064 { 1065 1066 1067 1068 1069 1070 1071 } 1072 1073 proc lp2iv(poly p)1057 nt i,j,k; 1058 list M; 1059 checkAssumptions(0,M); 1060 for (i = 1; i <= size(G); i++) {M[i] = lp2iv(G[i]);} 1061 return(M); 1062 1063 ample 1064 1065 "EXAMPLE:"; echo = 2; 1066 ring r = 0,(x,y),dp; 1067 def R = makeLetterplaceRing(5); // constructs a Letterplace ring 1068 setring R; // sets basering to Letterplace ring 1069 ideal L = x(1)*x(2),y(1)*y(2),x(1)*y(2)*x(3); 1070 lpId2ivLi(L); // returns the corresponding intvecs as a list 1071 1072 1073 oc lp2iv(poly p) 1074 1074 "USAGE: lp2iv(p); p a poly 1075 1075 RETURN: intvec … … 1316 1316 static proc imPermcol (intmat A, int c1, int c2) 1317 1317 { 1318 1319 1320 1321 1322 1318 intmat B = A; 1319 int k = nrows(B); 1320 B[1..k,c1] = A[1..k,c2]; 1321 B[1..k,c2] = A[1..k,c1]; 1322 return (B); 1323 1323 } 1324 1324 1325 1325 static proc imPermrow (intmat A, int r1, int r2) 1326 1326 { 1327 1328 1329 1330 1331 1327 intmat B = A; 1328 int k = ncols(B); 1329 B[r1,1..k] = A[r2,1..k]; 1330 B[r2,1..k] = A[r1,1..k]; 1331 return (B); 1332 1332 } 1333 1333 … … 1443 1443 @* the adjacency matrix of the Ufnarovskij graph induced by G 1444 1444 ASSUME: - basering is a Letterplace ring 1445 1445 - G are the leading monomials of a Groebner basis 1446 1446 " 1447 1447 { … … 1479 1479 if (typeof(#[1]) == "int") { 1480 1480 if (#[1] == 1) { 1481 1482 1483 1481 list ret = UG; 1482 ret[2] = ivL2lpI(SW); // the vertices 1483 return (ret); 1484 1484 } 1485 1485 } … … 1526 1526 @*: the adjacency matrix of the graph of normal words induced by G 1527 1527 ASSUME: - basering is a Letterplace ring 1528 1528 - G are the leading monomials of a Groebner basis 1529 1529 " 1530 1530 { … … 1538 1538 for (i = 1; i <= size(LG); i++) 1539 1539 { 1540 E = leadexp(LG[i]); 1541 if (E == intvec(0)) {V = V,monomial(intvec(0));} 1542 else 1543 { 1544 for (j = 1; j < d; j++) 1540 E = leadexp(LG[i]); 1541 if (E == intvec(0)) {V = V,monomial(intvec(0));} 1542 else 1545 1543 { 1546 Et = E[(j*v+1)..(d*v)]; 1547 if (Et == intvec(0)) {break;} 1548 else {V = V, monomial(Et);} 1549 } 1550 } 1544 for (j = 1; j < d; j++) 1545 { 1546 Et = E[(j*v+1)..(d*v)]; 1547 if (Et == intvec(0)) {break;} 1548 else {V = V, monomial(Et);} 1549 } 1550 } 1551 1551 } 1552 1552 V = simplify(V,2+4); 1553 1554 1555 1553 printf("V = %p", V); 1554 1555 1556 1556 // construct incidence matrix 1557 1557 1558 1558 list LV = lpId2ivLi(V); 1559 1559 intvec Ip,Iw; … … 1562 1562 for (i = 1; i <= n; i++) 1563 1563 { 1564 // printf("for1 (i=%p, n=%p)", i, n); 1565 p = V[i]; Ip = lp2iv(p); 1566 for (j = 1; j <= n; j++) 1567 { 1568 // printf("for2 (j=%p, n=%p)", j, n); 1569 k = 1; b = 1; 1570 q = V[j]; 1571 w = lpNF(lpMult(p,q),LG); 1572 if (w <> 0) 1564 // printf("for1 (i=%p, n=%p)", i, n); 1565 p = V[i]; Ip = lp2iv(p); 1566 for (j = 1; j <= n; j++) 1573 1567 { 1574 Iw = lp2iv(w); 1575 while (k <= n) 1576 { 1577 // printf("while (k=%p, n=%p)", k, n); 1578 if (isPF(LV[k],Iw) > 0) 1579 {if (isPF(LV[k],Ip) == 0) {b = 0; k = n+1;} else {k++;} 1580 } 1581 else {k++;} 1582 } 1583 T[i,j] = b; 1584 // print("Incidence Matrix:"); 1585 // print(T); 1586 } 1587 } 1568 // printf("for2 (j=%p, n=%p)", j, n); 1569 k = 1; b = 1; 1570 q = V[j]; 1571 w = lpNF(lpMult(p,q),LG); 1572 if (w <> 0) 1573 { 1574 Iw = lp2iv(w); 1575 while (k <= n) 1576 { 1577 // printf("while (k=%p, n=%p)", k, n); 1578 if (isPF(LV[k],Iw) > 0) 1579 {if (isPF(LV[k],Ip) == 0) {b = 0; k = n+1;} else {k++;} 1580 } 1581 else {k++;} 1582 } 1583 T[i,j] = b; 1584 // print("Incidence Matrix:"); 1585 // print(T); 1586 } 1587 } 1588 1588 } 1589 1589 return(T); … … 1596 1596 @*: -1 means it is infinite 1597 1597 ASSUME: - basering is a Letterplace ring 1598 1598 - G is a Groebner basis 1599 1599 " 1600 1600 { … … 1612 1612 @* -2 means it is negative infinite 1613 1613 ASSUME: - basering is a Letterplace ring 1614 1614 - G is a Groebner basis 1615 1615 " 1616 1616 { … … 1677 1677 while (size(G1) > 0) { 1678 1678 if (attrib(R, "lV") > 1) { 1679 1680 1681 1679 ring R = lpDelVar(lp2iv(G1[1])[1]); 1680 ideal G1 = imap(save,G1); 1681 G1 = simplify(G1, 2); // remove zero generators 1682 1682 } else { 1683 1684 1683 // only the field is left (no variables) 1684 return(0); 1685 1685 } 1686 1686 } … … 1694 1694 } else { 1695 1695 if (i == size(G)) { // if last iteration 1696 1697 1698 1699 1700 1696 print("Using gk dim"); // DEBUG 1697 int gkDim = lpGkDim(G); 1698 if (gkDim >= 0) { 1699 return (gkDim); 1700 } 1701 1701 } 1702 1702 } … … 1739 1739 int n = ncols(A); 1740 1740 for (int i = 1; i < n; i++) { 1741 1742 1743 1741 if (A[i,i] == 1) { 1742 return (1); 1743 } 1744 1744 } 1745 1745 return (0); … … 1781 1781 GNC[i,j] = 1; 1782 1782 } else { 1783 1783 // Li p. 177 1784 1784 // search for a right divisor 'w' of uv in G 1785 1785 // then check if G doesn't divide the subword uv-1 1786 1786 1787 1787 // look for a right divisor in LG 1788 1788 for (int k = 1; k <= size(LG); k++) { 1789 1790 1791 1792 1793 1794 1795 1796 1797 1789 if (isSF(LG[k], uv)) { 1790 // w = LG[k] 1791 if(!ivdivides(LG, uv[1..(size(uv)-1)])) { 1792 // G doesn't divide uv-1 1793 GNC[i,j] = 1; 1794 break; 1795 } 1796 } 1797 } 1798 1798 } 1799 1799 } … … 2147 2147 " 2148 2148 { 2149 //checkAssumptions(0,M);2149 //checkAssumptions(0,M); 2150 2150 intvec L,A; 2151 2151 if (size(M) == 0){ERROR("There are no mistletoes, so it appears your dimension is infinite!");} … … 2158 2158 for (i = 2; i <= size(M); i++) 2159 2159 {A = M[i]; L = M[i-1]; 2160 s = size(A);2161 if (s > size(L))2162 {d = size(L);2163 for (j = s; j > d; j--) {Rt = insert(Rt,intvec(A[1..j]));}2164 A = A[1..d];2165 }2166 if (size(L) > s){L = L[1..s];}2167 while (A <> L)2168 {Rt = insert(Rt, intvec(A));2169 if (size(A) > 1)2170 {A = A[1..(size(A)-1)];2171 L = L[1..(size(L)-1)];2172 }2173 else {break;}2174 }2160 s = size(A); 2161 if (s > size(L)) 2162 {d = size(L); 2163 for (j = s; j > d; j--) {Rt = insert(Rt,intvec(A[1..j]));} 2164 A = A[1..d]; 2165 } 2166 if (size(L) > s){L = L[1..s];} 2167 while (A <> L) 2168 {Rt = insert(Rt, intvec(A)); 2169 if (size(A) > 1) 2170 {A = A[1..(size(A)-1)]; 2171 L = L[1..(size(L)-1)]; 2172 } 2173 else {break;} 2174 } 2175 2175 } 2176 2176 return(Rt); … … 2231 2231 PURPOSE:Orders a given set of mistletoes lexicographically 2232 2232 ASSUME: - basering is a Letterplace ring. 2233 2233 - intvecs correspond to monomials 2234 2234 NOTE: - This is preprocessing, it's not needed if the mistletoes are returned 2235 2235 @* from the sickle algorithm. … … 2946 2946 /* vl: new stuff for conversion to Magma and to SD 2947 2947 todo: doc, example 2948 */2948 */ 2949 2949 proc extractVars(r) 2950 2950 { … … 2955 2955 for (i = 1; i<=nvars(r);i++) 2956 2956 { 2957 2958 2959 2960 2961 2957 candidate = string(var(i))[1,find(string(var(i)),"(")-1]; 2958 if (!inList(result, candidate)) 2959 { 2960 result = insert(result,candidate,size(result)); 2961 } 2962 2962 } 2963 2963 return(result); … … 2977 2977 if (size(s)!=pos) 2978 2978 { 2979 2979 s = s[1,pos-1]+s[pos+1,size(s)-pos]; // The last (")") 2980 2980 } 2981 2981 else 2982 2982 { 2983 2984 2983 s = s[1,pos-1]; 2984 } 2985 2985 } 2986 2986 return(s); … … 3046 3046 3047 3047 /*proc lpSubstituteExpandRing(poly f, list s1, list s2) {*/ 3048 3048 /*int minDegBound = calcSubstDegBound(f,s1,s2);*/ 3049 3049 /**/ 3050 3051 3052 3053 3050 /*def R = basering; // curr lp ring*/ 3051 /*setring ORIGINALRING; // non lp ring TODO*/ 3052 /*def R1 = makeLetterplaceRing(minDegBound);*/ 3053 /*setring R1;*/ 3054 3054 /**/ 3055 3055 /*poly g = lpSubstitute(imap(R,f), imap(R,s1), imap(R,s2));*/ 3056 3056 /**/ 3057 3057 /*return (R1); // return the new ring*/ 3058 3058 /*}*/ 3059 3059 … … 3066 3066 @* - G is a groebner basis, 3067 3067 @* - the current ring has a sufficient degbound (can be calculated with 3068 @* calcSubstDegBound())3068 @* calcSubstDegBound()) 3069 3069 EXAMPLE: example lpSubstitute; shows examples 3070 3070 " … … 3085 3085 int subindex = indexof(s1, varindex); 3086 3086 if (subindex > 0) { 3087 3088 3087 s2[subindex] = lpNF(s2[subindex],G); 3088 fis = lpMult(fis, s2[subindex]); 3089 3089 } else { 3090 3090 fis = lpMult(fis, lpNF(iv2lp(varindex),G)); 3091 3091 } 3092 3092 /*fis = lpNF(fis,G);*/ … … 3169 3169 int subindex = indexof(s1, varindex); 3170 3170 if (subindex > 0) { 3171 3171 tmpDegBound = tmpDegBound + deg(s2[subindex]); 3172 3172 } else { 3173 3173 tmpDegBound = tmpDegBound + 1; 3174 3174 } 3175 3175 } … … 3207 3207 3208 3208 /* 3209 Here are some examples one may try. Just copy them into your console.3210 These are relations for braid groups, up to degree d:3211 3212 3213 LIB "fpadim.lib";3214 ring r = 0,(x,y,z),dp;3215 int d =10; // degree3216 def R = makeLetterplaceRing(d);3217 setring R;3218 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),3219 z(1)*x(2)*z(3) - y(1)*z(2)*x(3), x(1)*x(2)*x(3) + y(1)*y(2)*y(3) +3220 z(1)*z(2)*z(3) + x(1)*y(2)*z(3);3221 option(prot);3222 option(redSB);option(redTail);option(mem);3223 ideal J = system("freegb",I,d,3);3224 lpDimCheck(J);3225 sickle(J,1,1,1,d);//Computes mistletoes, K-dimension and the Hilbert series3226 3227 3228 3229 LIB "fpadim.lib";3230 ring r = 0,(x,y,z),dp;3231 int d =11; // degree3232 def R = makeLetterplaceRing(d);3233 setring R;3234 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),3235 z(1)*x(2)*z(3) - y(1)*z(2)*x(3), x(1)*x(2)*x(3) + y(1)*y(2)*y(3) +3236 z(1)*z(2)*z(3) + x(1)*y(2)*z(3);3237 option(prot);3238 option(redSB);option(redTail);option(mem);3239 ideal J = system("freegb",I,d,3);3240 lpDimCheck(J);3241 sickle(J,1,1,1,d);3242 3243 3244 3245 LIB "fpadim.lib";3246 ring r = 0,(x,y,z),dp;3247 int d = 6; // degree3248 def R = makeLetterplaceRing(d);3249 setring R;3250 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),3251 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);3252 option(prot);3253 option(redSB);option(redTail);option(mem);3254 ideal J = system("freegb",I,d,3);3255 lpDimCheck(J);3256 sickle(J,1,1,1,d);3257 */3209 Here are some examples one may try. Just copy them into your console. 3210 These are relations for braid groups, up to degree d: 3211 3212 3213 LIB "fpadim.lib"; 3214 ring r = 0,(x,y,z),dp; 3215 int d =10; // degree 3216 def R = makeLetterplaceRing(d); 3217 setring R; 3218 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), 3219 z(1)*x(2)*z(3) - y(1)*z(2)*x(3), x(1)*x(2)*x(3) + y(1)*y(2)*y(3) + 3220 z(1)*z(2)*z(3) + x(1)*y(2)*z(3); 3221 option(prot); 3222 option(redSB);option(redTail);option(mem); 3223 ideal J = system("freegb",I,d,3); 3224 lpDimCheck(J); 3225 sickle(J,1,1,1,d);//Computes mistletoes, K-dimension and the Hilbert series 3226 3227 3228 3229 LIB "fpadim.lib"; 3230 ring r = 0,(x,y,z),dp; 3231 int d =11; // degree 3232 def R = makeLetterplaceRing(d); 3233 setring R; 3234 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), 3235 z(1)*x(2)*z(3) - y(1)*z(2)*x(3), x(1)*x(2)*x(3) + y(1)*y(2)*y(3) + 3236 z(1)*z(2)*z(3) + x(1)*y(2)*z(3); 3237 option(prot); 3238 option(redSB);option(redTail);option(mem); 3239 ideal J = system("freegb",I,d,3); 3240 lpDimCheck(J); 3241 sickle(J,1,1,1,d); 3242 3243 3244 3245 LIB "fpadim.lib"; 3246 ring r = 0,(x,y,z),dp; 3247 int d = 6; // degree 3248 def R = makeLetterplaceRing(d); 3249 setring R; 3250 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), 3251 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); 3252 option(prot); 3253 option(redSB);option(redTail);option(mem); 3254 ideal J = system("freegb",I,d,3); 3255 lpDimCheck(J); 3256 sickle(J,1,1,1,d); 3257 */ 3258 3258 3259 3259 /* 3260 Here are some examples, which can also be found in [studzins]: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 */3260 Here are some examples, which can also be found in [studzins]: 3261 3262 // takes up to 880Mb of memory 3263 LIB "fpadim.lib"; 3264 ring r = 0,(x,y,z),dp; 3265 int d =10; // degree 3266 def R = makeLetterplaceRing(d); 3267 setring R; 3268 ideal I = 3269 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); 3270 option(prot); 3271 option(redSB);option(redTail);option(mem); 3272 ideal J = system("freegb",I,d,nvars(r)); 3273 lpDimCheck(J); 3274 sickle(J,1,1,1,d); // dimension is 24872 3275 3276 3277 LIB "fpadim.lib"; 3278 ring r = 0,(x,y,z),dp; 3279 int d =10; // degree 3280 def R = makeLetterplaceRing(d); 3281 setring R; 3282 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); 3283 option(prot); 3284 option(redSB);option(redTail);option(mem); 3285 ideal J = system("freegb",I,d,3); 3286 lpDimCheck(J); 3287 sickle(J,1,1,1,d); 3288 */ 3289 3289 3290 3290 3291 3291 /* 3292 Example for computing GK dimension: 3293 returns a ring which contains an ideal I 3294 run gkDim(I) inside this ring and it should return 2n (the GK dimension 3295 of n-th Weyl algebra including evaluation operators). 3296 3297 proc createWeylEx(int n, int d) 3298 " 3299 " 3300 { 3301 int baseringdef; 3302 if (defined(basering)) // if a basering is defined, it should be saved for later use 3303 { 3304 def save = basering; 3305 baseringdef = 1; 3306 } 3307 ring r = 0,(d(1..n),x(1..n),e(1..n)),dp; 3308 def R = makeLetterplaceRing(d); 3309 setring R; 3310 ideal I; int i,j; 3311 3312 for (i = 1; i <= n; i++) 3313 { 3314 for (j = i+1; j<= n; j++) 3292 Example for computing GK dimension: 3293 returns a ring which contains an ideal I 3294 run gkDim(I) inside this ring and it should return 2n (the GK dimension 3295 of n-th Weyl algebra including evaluation operators). 3296 3297 proc createWeylEx(int n, int d) 3298 " 3299 " 3300 { 3301 int baseringdef; 3302 if (defined(basering)) // if a basering is defined, it should be saved for later use 3303 { 3304 def save = basering; 3305 baseringdef = 1; 3306 } 3307 ring r = 0,(d(1..n),x(1..n),e(1..n)),dp; 3308 def R = makeLetterplaceRing(d); 3309 setring R; 3310 ideal I; int i,j; 3311 3312 for (i = 1; i <= n; i++) 3313 { 3314 for (j = i+1; j<= n; j++) 3315 { 3316 I[size(I)+1] = lpMult(var(i),var(j)); 3317 } 3318 } 3319 3320 for (i = 1; i <= n; i++) 3321 { 3322 for (j = i+1; j<= n; j++) 3323 { 3324 I[size(I)+1] = lpMult(var(n+i),var(n+j)); 3325 } 3326 } 3327 for (i = 1; i <= n; i++) 3328 { 3329 for (j = 1; j<= n; j++) 3330 { 3331 I[size(I)+1] = lpMult(var(i),var(n+j)); 3332 } 3333 } 3334 for (i = 1; i <= n; i++) 3335 { 3336 for (j = 1; j<= n; j++) 3337 { 3338 I[size(I)+1] = lpMult(var(i),var(2*n+j)); 3339 } 3340 } 3341 for (i = 1; i <= n; i++) 3342 { 3343 for (j = 1; j<= n; j++) 3344 { 3345 I[size(I)+1] = lpMult(var(2*n+i),var(n+j)); 3346 } 3347 } 3348 for (i = 1; i <= n; i++) 3349 { 3350 for (j = 1; j<= n; j++) 3351 { 3352 I[size(I)+1] = lpMult(var(2*n+i),var(2*n+j)); 3353 } 3354 } 3355 I = simplify(I,2+4); 3356 I = letplaceGBasis(I); 3357 export(I); 3358 if (baseringdef == 1) {setring save;} 3359 return(R); 3360 } 3361 3362 proc TestGKAuslander3() 3363 { 3364 ring r = (0,q),(z,x,y),(dp(1),dp(2)); 3365 def R = makeLetterplaceRing(5); // constructs a Letterplace ring 3366 R; setring R; // sets basering to Letterplace ring 3367 ideal I; 3368 I = q*x(1)*y(2) - y(1)*x(2), z(1)*y(2) - y(1)*z(2), z(1)*x(2) - x(1)*z(2); 3369 I = letplaceGBasis(I); 3370 lpGkDim(I); // must be 3 3371 I = x(1)*y(2)*z(3) - y(1)*x(2), z(1)*y(2) - y(1)*z(2), z(1)*x(2) - x(1)*z(2);//gkDim = 2 3372 I = letplaceGBasis(I); // not finite BUT contains a poly in x,y only 3373 lpGkDim(I); // must be 4 3374 3375 ring r = 0,(y,x,z),dp; 3376 def R = makeLetterplaceRing(10); // constructs a Letterplace ring 3377 R; setring R; // sets basering to Letterplace ring 3378 ideal I; 3379 I = x(1)*y(2)*z(3) - y(1)*x(2), z(1)*y(2) - y(1)*z(2), z(1)*x(2) - x(1)*z(2);//gkDim = 2 3380 I = letplaceGBasis(I); // computed as it would be homogenized; infinite 3381 poly p = x(1)*y(2)*y(3)*x(4)-y(1)*x(2)*x(3)*y(4); 3382 lpNF(p, I); // 0 as expected 3383 3384 // with inverse of z 3385 ring r = 0,(iz,z,x,y),dp; 3386 def R = makeLetterplaceRing(11); // constructs a Letterplace ring 3387 R; setring R; // sets basering to Letterplace ring 3388 ideal I; 3389 I = x(1)*y(2)*z(3) - y(1)*x(2), z(1)*y(2) - y(1)*z(2), z(1)*x(2) - x(1)*z(2), 3390 iz(1)*y(2) - y(1)*iz(2), iz(1)*x(2) - x(1)*iz(2), iz(1)*z(2)-1, z(1)*iz(2) -1; 3391 I = letplaceGBasis(I); // 3392 setring r; 3393 def R2 = makeLetterplaceRing(23); // constructs a Letterplace ring 3394 setring R2; // sets basering to Letterplace ring 3395 ideal I = imap(R,I); 3396 lpGkDim(I); 3397 3398 3399 ring r = 0,(t,z,x,y),(dp(2),dp(2)); 3400 def R = makeLetterplaceRing(20); // constructs a Letterplace ring 3401 R; setring R; // sets basering to Letterplace ring 3402 ideal I; 3403 I = x(1)*y(2)*z(3) - y(1)*x(2)*t(3), z(1)*y(2) - y(1)*z(2), z(1)*x(2) - x(1)*z(2), 3404 t(1)*y(2) - y(1)*t(2), t(1)*x(2) - x(1)*t(2), t(1)*z(2) - z(1)*t(2);//gkDim = 2 3405 I = letplaceGBasis(I); // computed as it would be homogenized; infinite 3406 LIB "elim.lib"; 3407 ideal Inoz = nselect(I,intvec(2,6,10,14,18,22,26,30)); 3408 for(int i=1; i<=20; i++) 3315 3409 { 3316 I[size(I)+1] = lpMult(var(i),var(j)); 3317 } 3318 } 3319 3320 for (i = 1; i <= n; i++) 3321 { 3322 for (j = i+1; j<= n; j++) 3323 { 3324 I[size(I)+1] = lpMult(var(n+i),var(n+j)); 3325 } 3326 } 3327 for (i = 1; i <= n; i++) 3328 { 3329 for (j = 1; j<= n; j++) 3330 { 3331 I[size(I)+1] = lpMult(var(i),var(n+j)); 3332 } 3333 } 3334 for (i = 1; i <= n; i++) 3335 { 3336 for (j = 1; j<= n; j++) 3337 { 3338 I[size(I)+1] = lpMult(var(i),var(2*n+j)); 3339 } 3340 } 3341 for (i = 1; i <= n; i++) 3342 { 3343 for (j = 1; j<= n; j++) 3344 { 3345 I[size(I)+1] = lpMult(var(2*n+i),var(n+j)); 3346 } 3347 } 3348 for (i = 1; i <= n; i++) 3349 { 3350 for (j = 1; j<= n; j++) 3351 { 3352 I[size(I)+1] = lpMult(var(2*n+i),var(2*n+j)); 3353 } 3354 } 3355 I = simplify(I,2+4); 3356 I = letplaceGBasis(I); 3357 export(I); 3358 if (baseringdef == 1) {setring save;} 3359 return(R); 3360 } 3361 3362 proc TestGKAuslander3() 3363 { 3364 ring r = (0,q),(z,x,y),(dp(1),dp(2)); 3365 def R = makeLetterplaceRing(5); // constructs a Letterplace ring 3366 R; setring R; // sets basering to Letterplace ring 3367 ideal I; 3368 I = q*x(1)*y(2) - y(1)*x(2), z(1)*y(2) - y(1)*z(2), z(1)*x(2) - x(1)*z(2); 3369 I = letplaceGBasis(I); 3370 lpGkDim(I); // must be 3 3371 I = x(1)*y(2)*z(3) - y(1)*x(2), z(1)*y(2) - y(1)*z(2), z(1)*x(2) - x(1)*z(2);//gkDim = 2 3372 I = letplaceGBasis(I); // not finite BUT contains a poly in x,y only 3373 lpGkDim(I); // must be 4 3374 3375 ring r = 0,(y,x,z),dp; 3376 def R = makeLetterplaceRing(10); // constructs a Letterplace ring 3377 R; setring R; // sets basering to Letterplace ring 3378 ideal I; 3379 I = x(1)*y(2)*z(3) - y(1)*x(2), z(1)*y(2) - y(1)*z(2), z(1)*x(2) - x(1)*z(2);//gkDim = 2 3380 I = letplaceGBasis(I); // computed as it would be homogenized; infinite 3381 poly p = x(1)*y(2)*y(3)*x(4)-y(1)*x(2)*x(3)*y(4); 3382 lpNF(p, I); // 0 as expected 3383 3384 // with inverse of z 3385 ring r = 0,(iz,z,x,y),dp; 3386 def R = makeLetterplaceRing(11); // constructs a Letterplace ring 3387 R; setring R; // sets basering to Letterplace ring 3388 ideal I; 3389 I = x(1)*y(2)*z(3) - y(1)*x(2), z(1)*y(2) - y(1)*z(2), z(1)*x(2) - x(1)*z(2), 3390 iz(1)*y(2) - y(1)*iz(2), iz(1)*x(2) - x(1)*iz(2), iz(1)*z(2)-1, z(1)*iz(2) -1; 3391 I = letplaceGBasis(I); // 3392 setring r; 3393 def R2 = makeLetterplaceRing(23); // constructs a Letterplace ring 3394 setring R2; // sets basering to Letterplace ring 3395 ideal I = imap(R,I); 3396 lpGkDim(I); 3397 3398 3399 ring r = 0,(t,z,x,y),(dp(2),dp(2)); 3400 def R = makeLetterplaceRing(20); // constructs a Letterplace ring 3401 R; setring R; // sets basering to Letterplace ring 3402 ideal I; 3403 I = x(1)*y(2)*z(3) - y(1)*x(2)*t(3), z(1)*y(2) - y(1)*z(2), z(1)*x(2) - x(1)*z(2), 3404 t(1)*y(2) - y(1)*t(2), t(1)*x(2) - x(1)*t(2), t(1)*z(2) - z(1)*t(2);//gkDim = 2 3405 I = letplaceGBasis(I); // computed as it would be homogenized; infinite 3406 LIB "elim.lib"; 3407 ideal Inoz = nselect(I,intvec(2,6,10,14,18,22,26,30)); 3408 for(int i=1; i<=20; i++) 3409 { 3410 Inoz=subst(Inoz,t(i),1); 3411 } 3412 ideal J = x(1)*y(2)*y(3)*x(4)-y(1)*x(2)*x(3)*y(4); 3413 J = letplaceGBasis(J); 3414 3415 poly p = x(1)*y(2)*y(3)*x(4)-y(1)*x(2)*x(3)*y(4); 3416 lpNF(p, I); // 0 as expected 3417 3418 ring r2 = 0,(x,y),dp; 3419 def R2 = makeLetterplaceRing(50); // constructs a Letterplace ring 3420 setring R2; 3421 ideal J = x(1)*y(2)*y(3)*x(4)-y(1)*x(2)*x(3)*y(4); 3422 J = letplaceGBasis(J); 3410 Inoz=subst(Inoz,t(i),1); 3411 } 3412 ideal J = x(1)*y(2)*y(3)*x(4)-y(1)*x(2)*x(3)*y(4); 3413 J = letplaceGBasis(J); 3414 3415 poly p = x(1)*y(2)*y(3)*x(4)-y(1)*x(2)*x(3)*y(4); 3416 lpNF(p, I); // 0 as expected 3417 3418 ring r2 = 0,(x,y),dp; 3419 def R2 = makeLetterplaceRing(50); // constructs a Letterplace ring 3420 setring R2; 3421 ideal J = x(1)*y(2)*y(3)*x(4)-y(1)*x(2)*x(3)*y(4); 3422 J = letplaceGBasis(J); 3423 3423 } 3424 3424 … … 3457 3457 lpGkDim(J); // 3 == correct 3458 3458 3459 */3459 */
Note: See TracChangeset
for help on using the changeset viewer.