Ticket #213: examples.tst

File examples.tst, 2.1 KB (added by levandov, 13 years ago)
Line
1// paper: Ihsen Yengui, "Dynamical Groebner Bases" (2006), Journal of Algebra
2// EX.6
3
4ring r = (integer, 3,3), (x,y), lp;
5ring r = (integer, 27), (x,y), lp;
6poly g1 = 9;
7poly g2 = x+1;
8poly g3 = 3*y^2;
9poly g4 = y^3+13*y^2-12;
10ideal I = g1,g2,g3,g4;
11ideal J = std(I); // is GB, correct
12
13// Ex 7
14ring r = (integer, 4), (x,y), lp;
15poly f1 = x^4-x;
16poly f2 = y^3-1;
17poly f3 = 2*x*y;
18ideal I = f1,f2,f3;
19ideal J = std(I); // correct: 2x instead of 2xy
20
21// Ex. section 2.2 p.456
22ring r = (integer), (x,y), lp;
23poly f1 = 10*x*y+1;
24poly f2 = 6*x^2+3;
25ideal I = f1,f2;
26ideal J = std(I);
27poly F = 62*x^3*y + 11*x^2 + 10*x*y^2 + 56*x*y + y + 8;
28NF(F,J); // 0, correct
29//cofactors:
30matrix L = lift(I,F);
31module S = syz(I);
32L = NF(L,S);
33(11*x^2+y+8)*f1 + (-8*x*y)*f2 - F; // 0 => even shorter presentation
34L[1][1]*f1 + L[1][2]*f2 - F;
35
36// paper 2: A. Hadj Kacem and Ihsen Yengui, "Dynamical Groebner Bases over Dedekind rings" (2006), Journal of Algebra (submitted)
37
38// ex 9, page 7
39ring r = (integer, 4), (x,y), lp;
40poly f1 = 2*x*y;
41poly f2 = 3*y^3+3;
42poly f3 = x^2-3*x;
43ideal I = f1,f2,f3;
44ideal J = std(I); // correct: 2x instead of 2xy, leadcoeffs simplified
45module S = syz(I);
46module Y =   [-x*y^2-y^2,2*x^2+2*x,2], [-y^5-y^2, 4*x+2*x*y^3,0],[0,x^2-3*x,-3*y^3-3],[1-y^3,2*x*y,0];
47print(NF(Y,S)); // 0
48print(std(Y)-S); // 0
49
50// section 4, pp. 8-11
51ring r = (integer), (x,y,T), lp; // eliminating T
52ideal I = 3*x*y+1, (4+2*T)*y + 9, T^2+5;
53// a) GB
54ideal J = std(I);
55// b) syzygies
56module S = syz(I); // longer
57// todo: TRY with his approach via lifts ?
58module Y = [-(4+2*T)*y - 9, 3*x*y+1], [27*x*y - 9 - (4+2*T)*y + 3*(4+2*T)*x*y^2, 1- 9*x^2*y^2];
59module Z = [-(4+2*T)*y - 9, 3*x*y+1]; // the only generator; correct
60NF(Y,std(Z)); // 0
61// c) ideal membership
62poly F = (4*T-1)*x^2*y + 6*T*x*y^2 + 9*T*x^2 + 3*x - 4*y -9;
63NF(F,J); // 0, ok
64list D = division(F,J);
65print(transpose(D[1])*transpose(J) + F); // 0 => correct cofactors
66print(lift(I,F)); //
67matrix L1 = lift(I,J);
68matrix L; ideal K = liftstd(I,L); // fast
69matrix ZZ = L*D[1]; // total lift matrix
70transpose(ZZ)*transpose(I) + F; // 0