1 | LIB "tst.lib"; |
---|
2 | tst_init(); |
---|
3 | |
---|
4 | |
---|
5 | //====================== Example 5.15 ============================= |
---|
6 | ring Rxyz = 0, (x,y,z,t), (dp(3),ds(1)); |
---|
7 | ideal I = x2-t27yz, xz-t13y, x-t14z2; |
---|
8 | module M = syz(I); |
---|
9 | print(M); |
---|
10 | //-> 0, -1, |
---|
11 | //-> z2t14-x,zt14, |
---|
12 | //-> xz-yt13,x |
---|
13 | ring Kxyz = 0, (x,y,z), dp; |
---|
14 | ideal I1 = imap(Rxyz,I); |
---|
15 | module M1 = imap(Rxyz,M); // reducing the syzygies |
---|
16 | M1 = std(M1); |
---|
17 | print(M1); |
---|
18 | //-> -z,-1, |
---|
19 | //-> x, 0, |
---|
20 | //-> 0, x |
---|
21 | module M2 = syz(I1); // syzygies on the reductions |
---|
22 | print(M2); |
---|
23 | //-> 0, -1, |
---|
24 | //-> -1,0, |
---|
25 | //-> z, x |
---|
26 | reduce(M2,M1); |
---|
27 | //-> _[1]=z*gen(3)-gen(2) |
---|
28 | //-> _[2]=0 |
---|
29 | |
---|
30 | setring Rxyz; |
---|
31 | ideal J = I, -y+tz3; |
---|
32 | M = syz(J); |
---|
33 | setring Kxyz; |
---|
34 | ideal J1 = imap(Rxyz,J); |
---|
35 | M1 = imap(Rxyz,M); // reducing the syzygies |
---|
36 | M1 = std(M1); |
---|
37 | print(M1); |
---|
38 | //-> 0, -z,-1,0, |
---|
39 | //-> -1,x, 0, 0, |
---|
40 | //-> z, 0, x, y, |
---|
41 | //-> 0, 0, 0, x |
---|
42 | M2 = syz(J1); // syzygies on the reductions |
---|
43 | print(M2); |
---|
44 | //-> 0, -1,0, |
---|
45 | //-> -1,0, 0, |
---|
46 | //-> z, x, y, |
---|
47 | //-> 0, 0, x |
---|
48 | size(reduce(M2,M1)); |
---|
49 | //-> 0 |
---|
50 | |
---|
51 | |
---|
52 | kill Rxyz,Kxyz; |
---|
53 | //================= Example 5.17 (new Session) ========================== |
---|
54 | ring Kwxyz = 0, (w,x,y,z), dp; |
---|
55 | ideal F = x2, xz, wx, w2y; |
---|
56 | |
---|
57 | proc displayHilbPoly(ideal G) |
---|
58 | "USAGE: displayHilbPoly(G), G of type ideal |
---|
59 | ASSUME: G must be a homogeneous Groebner basis for an ideal of the |
---|
60 | active ring in the SINGULAR session; say, G generates the |
---|
61 | homogeneous ideal I of R. |
---|
62 | RETURN: None. |
---|
63 | NOTE: Displays the Hilbert polynomial of R/I. |
---|
64 | " |
---|
65 | { |
---|
66 | int d = dim(G)-1; // degree of Hibert polynomial |
---|
67 | intvec co = hilb(G,2); // representation II of Hilbert series |
---|
68 | int s = size(co)-1; // s = deg(Q_M) +1 |
---|
69 | ring Qt = 0, t, dp; // change active ring to Q[t] |
---|
70 | poly QM = 0; |
---|
71 | for (int i=1; i<=s; i=i+1) |
---|
72 | { |
---|
73 | QM = QM+co[i]*t^(i-1); |
---|
74 | } |
---|
75 | poly QMi = QM; // the polynomial Q_M(t) |
---|
76 | int ifac = 1; |
---|
77 | list a; |
---|
78 | for (i=1; i<=d+1; i=i+1) |
---|
79 | { |
---|
80 | a = insert(a, subst(QMi,t,1)/ifac, i-1); |
---|
81 | QMi = diff((QMi),t); |
---|
82 | ifac = ifac*i; |
---|
83 | } |
---|
84 | poly PM = (-1)^(d)*a[d+1]; |
---|
85 | poly bin = 1; |
---|
86 | for (i=1; i<=d; i=i+1) |
---|
87 | { |
---|
88 | bin = bin*(t+i)/i; // compute binomial coeff. by recursion |
---|
89 | PM = PM+(-1)^(d-i)*a[d+1-i]*bin; |
---|
90 | } |
---|
91 | print(PM); |
---|
92 | } |
---|
93 | |
---|
94 | displayHilbPoly(std(F)); // enter procedure first |
---|
95 | //-> 3t+1 |
---|
96 | |
---|
97 | |
---|
98 | kill Kwxyz; |
---|
99 | //================= Example 5.23 (new Session) ========================== |
---|
100 | if (not(defined(isFlat))){ LIB "homolog.lib"; } |
---|
101 | ring R = 0, t, dp; |
---|
102 | module phi = gen(2)*(t3-t); |
---|
103 | isFlat(phi); |
---|
104 | //-> 0 |
---|
105 | flatLocus(phi); |
---|
106 | //-> _[1]=t3-t |
---|
107 | |
---|
108 | ring S = 0, (x,t(1..2)), (dp(1),dp); |
---|
109 | ideal I = x2-t(1), x*t(1)-t(2), x*t(2)-t(1)^2; |
---|
110 | std(I); |
---|
111 | //-> _[1]=t(1)^3-t(2)^2 |
---|
112 | //-> _[2]=x*t(2)-t(1)^2 |
---|
113 | //-> _[3]=x*t(1)-t(2) |
---|
114 | //-> _[4]=x^2-t(1) |
---|
115 | ring R1 = 0, t(1..2), dp; |
---|
116 | module phi = gen(1)*(t(1)^3-t(2)^2), |
---|
117 | gen(2)*(t(1)^3-t(2)^2), |
---|
118 | gen(2)*t(2)-gen(1)*t(1)^2, |
---|
119 | gen(2)*t(1)-gen(1)*t(2); |
---|
120 | isFlat(phi); |
---|
121 | //-> 0 |
---|
122 | flatLocus(phi); |
---|
123 | //-> _[1]=t(1)^3-t(2)^2 |
---|
124 | qring Q = std(t(1)^3-t(2)^2); |
---|
125 | module phi = imap(R1,phi); |
---|
126 | isFlat(phi); |
---|
127 | //-> 0 |
---|
128 | flatLocus(phi); |
---|
129 | //-> _[1]=t(2) |
---|
130 | //-> _[2]=t(1) |
---|
131 | |
---|
132 | |
---|
133 | kill R,S,R1,Q; |
---|
134 | //================= Example 5.32 (new Session) ========================== |
---|
135 | if (not(defined(KoszulHomology))){ LIB "homolog.lib"; } |
---|
136 | ring R = 0, (x,y,z), dp; |
---|
137 | ideal f = xz-z, xy-y, x; |
---|
138 | module I = 0; // a presentation matrix of R=Q[x,y,z] |
---|
139 | print(KoszulHomology(f,I,0)); // 0th Koszul homology |
---|
140 | //-> z,y,x |
---|
141 | print(KoszulHomology(f,I,1)); // 1st Koszul homology |
---|
142 | //-> 0 |
---|
143 | |
---|
144 | ideal g = xy, xz, yz; |
---|
145 | print(KoszulHomology(g,I,0)); // 0th Koszul homology |
---|
146 | //-> yz,xz,xy |
---|
147 | print(KoszulHomology(g,I,1)); // 1st Koszul homology |
---|
148 | //-> -z,0,x, |
---|
149 | //-> z, y,0 |
---|
150 | print(KoszulHomology(g,I,2)); // 2nd Koszul homology |
---|
151 | //-> 0 |
---|
152 | |
---|
153 | |
---|
154 | kill R; |
---|
155 | //================= Example 5.34 (new Session) ========================== |
---|
156 | //=============== continuation of Example 5.34 ========================== |
---|
157 | ring S = 32003, x(0..4), dp; |
---|
158 | module MI=maxideal(1); |
---|
159 | attrib(MI,"isHomog",intvec(-1)); |
---|
160 | resolution kos = nres(MI,0); |
---|
161 | print(betti(kos),"betti"); |
---|
162 | //-> 0 1 2 3 4 5 |
---|
163 | //-> ------------------------------------------ |
---|
164 | //-> -1: 1 5 10 10 5 1 |
---|
165 | //-> ------------------------------------------ |
---|
166 | //-> total: 1 5 10 10 5 1 |
---|
167 | |
---|
168 | matrix alpha0 = random(32002,10,3); |
---|
169 | module pres = module(alpha0)+kos[3]; |
---|
170 | |
---|
171 | attrib(pres,"isHomog",intvec(1,1,1,1,1,1,1,1,1,1)); |
---|
172 | resolution fcokernel = mres(pres,0); |
---|
173 | print(betti(fcokernel),"betti"); |
---|
174 | //-> 0 1 2 3 |
---|
175 | //-> ------------------------------ |
---|
176 | //-> 1: 7 10 5 1 |
---|
177 | //-> ------------------------------ |
---|
178 | //-> total: 7 10 5 1 |
---|
179 | |
---|
180 | module dir = transpose(pres); |
---|
181 | intvec w = -1,-1,-1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2; |
---|
182 | attrib(dir,"isHomog",w); |
---|
183 | resolution fdir = mres(dir,2); |
---|
184 | print(betti(fdir),"betti"); |
---|
185 | //-> 0 1 2 |
---|
186 | //-> ------------------------ |
---|
187 | //-> -2: 10 7 - |
---|
188 | //-> -1: - - - |
---|
189 | //-> 0: - - 1 |
---|
190 | //-> ------------------------ |
---|
191 | //-> total: 10 7 1 |
---|
192 | |
---|
193 | if (not(defined(flatten))){ LIB "matrix.lib"; } |
---|
194 | ideal I = groebner(flatten(fdir[2])); |
---|
195 | resolution FI = mres(I,0); |
---|
196 | print(betti(FI),"betti"); |
---|
197 | //-> 0 1 2 3 4 |
---|
198 | //-> ------------------------------------ |
---|
199 | //-> 0: 1 - - - - |
---|
200 | //-> 1: - - - - - |
---|
201 | //-> 2: - 7 10 5 1 |
---|
202 | //-> ------------------------------------ |
---|
203 | //-> total: 1 7 10 5 1 |
---|
204 | |
---|
205 | int codimI = nvars(S)-dim(I); |
---|
206 | codimI; |
---|
207 | //-> 2 |
---|
208 | degree(I); |
---|
209 | //-> 4 |
---|
210 | nvars(S)-dim(groebner(minor(jacob(I),codimI) + I)); |
---|
211 | //-> 5 |
---|
212 | |
---|
213 | if (not(defined(depth))){ LIB "homolog.lib"; } |
---|
214 | depth(I); // I is a presentation matrix of S/I |
---|
215 | //-> 1 |
---|
216 | dim(std(I)); |
---|
217 | //-> 3 |
---|
218 | |
---|
219 | |
---|
220 | //================= Example 5.46 (new Session) ========================== |
---|
221 | if (not(defined(isCM))){ LIB "homolog.lib"; } |
---|
222 | ring R = 0, (x,y,z,w), dp; |
---|
223 | ideal I = xz-y2, wz-xy, wy-x2; |
---|
224 | ring R_loc = 0, (x,y,z,w), ds; |
---|
225 | ideal I = imap(R,I); |
---|
226 | isCM(I); |
---|
227 | //-> 1 |
---|
228 | |
---|
229 | |
---|
230 | kill R,S,w,codimI; |
---|
231 | //================= Example 5.49 (new Session) ========================== |
---|
232 | ring R = 0, (x,y,z,w), dp; |
---|
233 | ideal I = xz-y2, wz-xy, wy-x2; |
---|
234 | I=std(I); |
---|
235 | lead(I); // the leading ideal |
---|
236 | //-> _[1]=y2 |
---|
237 | //-> _[2]=xy |
---|
238 | //-> _[3]=x2 |
---|
239 | |
---|
240 | tst_status(1);$ |
---|
241 | |
---|