1 | LIB "tst.lib"; |
---|
2 | tst_init(); |
---|
3 | |
---|
4 | |
---|
5 | //====================== Exercise 2.1 ============================= |
---|
6 | ring R = 0, (x,y), dp; |
---|
7 | poly f1, f2, f3 = x2+y2, x2y2, x3y-xy3; |
---|
8 | if (not(defined(algDependent))) { LIB "algebra.lib"; } |
---|
9 | def L = algDependent(ideal(f1,f2,f3)); |
---|
10 | L[1]; |
---|
11 | def S = L[2]; |
---|
12 | setring S; |
---|
13 | ker; |
---|
14 | |
---|
15 | setring R; |
---|
16 | poly g, g1, g2 = x4+y4, x+y, xy; |
---|
17 | L = algebra_containment(g,ideal(g1,g2),1); |
---|
18 | def S2 = L[2]; |
---|
19 | setring S2; |
---|
20 | check; |
---|
21 | |
---|
22 | ring T = 0, x(1..3), dp; |
---|
23 | qring Q = groebner(x(1)*x(2)*x(3)-1); |
---|
24 | map phi = Q, x(2)*x(3), x(1)*x(3), x(1)*x(2); |
---|
25 | is_bijective(phi,Q); |
---|
26 | //-> 1 |
---|
27 | |
---|
28 | |
---|
29 | kill R,Q,S,S2,T,L; |
---|
30 | //====================== Exercise 2.2 ============================= |
---|
31 | ring R = 0, (w,x,y,z), dp; |
---|
32 | ideal I = y-x2, z-x3; |
---|
33 | ideal SI = groebner(I); |
---|
34 | ideal Ih = homog(SI,w); // generators are homogenized |
---|
35 | Ih; |
---|
36 | |
---|
37 | ideal J = homog(I,w); // generators are homogenized |
---|
38 | size(reduce(J,groebner(Ih),1)); // J is contained in Ih |
---|
39 | size(reduce(Ih,groebner(J),1)); // Ih is not contained in J |
---|
40 | if (not(defined(sat))){ LIB "elim.lib"; } |
---|
41 | ideal Iinf = sat(J,Ih)[1]; |
---|
42 | Iinf; |
---|
43 | |
---|
44 | |
---|
45 | kill R; |
---|
46 | //====================== Exercise 2.3 ============================= |
---|
47 | ring S = 0, (y,x), dp; |
---|
48 | ideal I = maxideal(3),maxideal(2),x,y,1; |
---|
49 | ring R = 0, (x,y,a(1..10)), (dp(2),dp(10)); |
---|
50 | ideal I = imap(S,I); |
---|
51 | matrix A[10][1] = a(1..10); |
---|
52 | poly f = (matrix(I)*A)[1,1]; |
---|
53 | ideal J = f, diff(f,x), diff(f,y); |
---|
54 | J = groebner(J); |
---|
55 | // check for generators for J that do not depend on x,y |
---|
56 | ideal JJ; |
---|
57 | for (int i=1; i<=size(J); i++) |
---|
58 | { |
---|
59 | if (J[i][1]<y) { JJ = JJ,J[i]; } |
---|
60 | } |
---|
61 | JJ = simplify(JJ,2); // erase zero generators |
---|
62 | size(JJ); |
---|
63 | //-> 1 |
---|
64 | homog(JJ); |
---|
65 | //-> 1 |
---|
66 | poly D = JJ[1]; |
---|
67 | deg(D); size(D); |
---|
68 | //-> 12 |
---|
69 | //-> 2040 |
---|
70 | |
---|
71 | |
---|
72 | kill i,R,S; |
---|
73 | //====================== Exercise 2.4 ============================= |
---|
74 | //======== Procedures are stored in the library file sol.lib ======= |
---|
75 | //================================================================== |
---|
76 | LIB "sol.lib"; |
---|
77 | example ideal_intersect; |
---|
78 | example ideal_quotient; |
---|
79 | example saturate; |
---|
80 | |
---|
81 | tst_status(1);$ |
---|
82 | |
---|