source: git/Tst/BuchDL/Ex_L5.tst @ 9558c5f

spielwiese
Last change on this file since 9558c5f was 9558c5f, checked in by Hans Schönemann <hannes@…>, 18 years ago
*hannes/lossen: very long examples from DL-Book git-svn-id: file:///usr/local/Singular/svn/trunk@8762 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 6.1 KB
Line 
1LIB "tst.lib";
2tst_init();
3
4
5//======================  Example 5.15 =============================
6ring Rxyz = 0, (x,y,z,t), (dp(3),ds(1));
7ideal I = x2-t27yz, xz-t13y, x-t14z2;
8module M = syz(I);
9print(M);
10//->   0,      -1, 
11//->   z2t14-x,zt14,
12//->   xz-yt13,x   
13ring Kxyz = 0, (x,y,z), dp;
14ideal I1 = imap(Rxyz,I); 
15module M1 = imap(Rxyz,M);  // reducing the syzygies
16M1 = std(M1);
17print(M1);
18//->   -z,-1,
19//->   x, 0,
20//->   0, x
21module M2 = syz(I1);   // syzygies on the reductions
22print(M2);
23//->   0, -1,
24//->   -1,0,
25//->   z, x
26reduce(M2,M1);
27//->   _[1]=z*gen(3)-gen(2)
28//->   _[2]=0
29
30setring Rxyz;
31ideal J = I, -y+tz3;
32M = syz(J);
33setring Kxyz;
34ideal J1 = imap(Rxyz,J);
35M1 = imap(Rxyz,M); // reducing the syzygies
36M1 = std(M1);
37print(M1);
38//->   0, -z,-1,0,
39//->   -1,x, 0, 0,
40//->   z, 0, x, y,
41//->   0, 0, 0, x
42M2 = syz(J1);    // syzygies on the reductions
43print(M2);
44//->   0, -1,0,
45//->   -1,0, 0,
46//->   z, x, y,
47//->   0, 0, x
48size(reduce(M2,M1));
49//->   0
50
51
52kill Rxyz,Kxyz;
53//================= Example 5.17 (new Session) ==========================
54ring Kwxyz = 0, (w,x,y,z), dp;
55ideal F = x2, xz, wx, w2y;
56
57proc displayHilbPoly(ideal G)
58"USAGE:  displayHilbPoly(G), G of type ideal
59ASSUME:  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.
62RETURN:  None.
63NOTE:    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
94displayHilbPoly(std(F));  // enter procedure first
95//->   3t+1
96
97
98kill Kwxyz;
99//================= Example 5.23 (new Session) ==========================
100if (not(defined(isFlat))){ LIB "homolog.lib"; }
101ring R = 0, t, dp;
102module phi = gen(2)*(t3-t);
103isFlat(phi);
104//->   0
105flatLocus(phi);
106//->   _[1]=t3-t
107
108ring S = 0, (x,t(1..2)), (dp(1),dp);
109ideal I = x2-t(1), x*t(1)-t(2), x*t(2)-t(1)^2;
110std(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)
115ring R1 = 0, t(1..2), dp;
116module 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);
120isFlat(phi);
121//->   0
122flatLocus(phi);
123//->   _[1]=t(1)^3-t(2)^2
124qring Q = std(t(1)^3-t(2)^2);
125module phi = imap(R1,phi);
126isFlat(phi);
127//->   0
128flatLocus(phi);
129//->   _[1]=t(2)
130//->   _[2]=t(1)
131
132
133kill R,S,R1,Q;
134//================= Example 5.32 (new Session) ==========================
135if (not(defined(KoszulHomology))){ LIB "homolog.lib"; }
136ring R = 0, (x,y,z), dp;
137ideal f = xz-z, xy-y, x;
138module I = 0;            // a presentation matrix of R=Q[x,y,z]
139print(KoszulHomology(f,I,0));            // 0th Koszul homology
140//->   z,y,x
141print(KoszulHomology(f,I,1));            // 1st Koszul homology
142//->   0
143
144ideal g = xy, xz, yz;
145print(KoszulHomology(g,I,0));            // 0th Koszul homology
146//->   yz,xz,xy
147print(KoszulHomology(g,I,1));            // 1st Koszul homology
148//->   -z,0,x,
149//->   z, y,0
150print(KoszulHomology(g,I,2));            // 2nd Koszul homology
151//->   0
152
153
154kill R;
155//================= Example 5.34 (new Session) ==========================
156//=============== continuation of Example 5.34 ==========================
157ring S = 32003, x(0..4), dp;
158module MI=maxideal(1);
159attrib(MI,"isHomog",intvec(-1)); 
160resolution kos = nres(MI,0);
161print(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
168matrix alpha0 = random(32002,10,3);
169module pres = module(alpha0)+kos[3];
170
171attrib(pres,"isHomog",intvec(1,1,1,1,1,1,1,1,1,1));
172resolution fcokernel = mres(pres,0);
173print(betti(fcokernel),"betti");
174//->              0     1     2     3
175//->   ------------------------------
176//->       1:     7    10     5     1
177//->   ------------------------------
178//->   total:     7    10     5     1
179
180module dir = transpose(pres);
181intvec w = -1,-1,-1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2;
182attrib(dir,"isHomog",w);
183resolution fdir = mres(dir,2);
184print(betti(fdir),"betti");
185//->              0     1     2
186//->   ------------------------
187//->      -2:    10     7     -
188//->      -1:     -     -     -
189//->       0:     -     -     1
190//->   ------------------------
191//->   total:    10     7     1
192
193if (not(defined(flatten))){ LIB "matrix.lib"; }
194ideal I = groebner(flatten(fdir[2]));
195resolution FI = mres(I,0);
196print(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
205int codimI = nvars(S)-dim(I);
206codimI;
207//->   2
208degree(I);
209//->   4
210nvars(S)-dim(groebner(minor(jacob(I),codimI) + I));
211//->   5
212
213if (not(defined(depth))){ LIB "homolog.lib"; }
214depth(I); // I is a presentation matrix of S/I
215//->   1
216dim(std(I));
217//->   3
218
219
220//================= Example 5.46 (new Session) ==========================
221if (not(defined(isCM))){ LIB "homolog.lib"; }
222ring R = 0, (x,y,z,w), dp;
223ideal I = xz-y2, wz-xy, wy-x2;
224ring R_loc = 0, (x,y,z,w), ds;
225ideal I = imap(R,I);
226isCM(I);
227//->   1
228
229
230kill R,S,w,codimI;
231//================= Example 5.49 (new Session) ==========================
232ring R = 0, (x,y,z,w), dp;
233ideal I = xz-y2, wz-xy, wy-x2;
234I=std(I);
235lead(I);               // the leading ideal
236//->   _[1]=y2
237//->   _[2]=xy
238//->   _[3]=x2
239
240tst_status(1);$
241
Note: See TracBrowser for help on using the repository browser.