source: git/Tst/BuchDL/Ex_L4.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: 5.9 KB
Line 
1LIB "tst.lib";
2tst_init();
3
4
5//======================  Example 4.9 =============================
6ring R = 0, (w,x,y,z), dp;
7matrix m[2][3] = w,x,y,x,y,z;
8ideal I = minor(m,2);
9I;
10//->   I[1]=-y2+xz
11//->   I[2]=xy-wz
12//->   I[3]=x2-wy
13qring Q = groebner(I);
14resolution F=mres(maxideal(1),0);
15//->   // ** full resolution in a qring may be infinite,
16//->         setting max length to 6
17print(betti(F),"betti");
18//->              0     1     2     3     4     5     6
19//->   ------------------------------------------------
20//->       0:     1     4     9    18    36    72   144
21//->   ------------------------------------------------
22//->   total:     1     4     9    18    36    72   144
23
24
25kill F;  //------- Alternatively:
26resolution F = mres(maxideal(1),7);
27print(betti(F),"betti");
28//->              0     1     2     3     4     5     6     7
29//->   ------------------------------------------------------
30//->       0:     1     4     9    18    36    72   144   288
31//->   ------------------------------------------------------
32//->   total:     1     4     9    18    36    72   144   288
33
34print(F[1],"");
35//->   z,y,x,w
36print(F[2]);
37//->   y, 0, 0, x, 0, 0, w, 0, 0,
38//->   -z,y, 0, 0, x, 0, 0, w, 0,
39//->   0, -z,y, -z,0, x, 0, 0, w,
40//->   0, 0, -z,0, -z,-y,-z,-y,-x
41
42if (not(defined(Ext))){ LIB "homolog.lib"; }
43module M = Ext(7,F[1],F[1]);
44//->   // dimension of Ext^7:  0
45//->   // vdim of Ext^7:       288
46
47
48kill Q,R;
49//======================  Example 4.11 (new session) =======================
50ring S = 0, x(0..3), dp;
51resolution kos = mres(maxideal(1),0);
52print(betti(kos),"betti");
53//->              0     1     2     3     4
54//->   ------------------------------------
55//->       0:     1     4     6     4     1
56//->   ------------------------------------
57//->   total:     1     4     6     4     1
58
59matrix alpha1 = random(1000,4,1);  // randomly created intmat
60matrix tphi = transpose(kos[4]);
61matrix psi = kos[3];
62matrix talpha1tilde = transpose(psi*alpha1);
63matrix talpha0 = lift(tphi,talpha1tilde);
64print(talpha0);
65
66
67kill S;
68//======================  Example 4.13 (new session) =======================
69ring S = 32003, x(0..4), dp;
70module MI=maxideal(1);
71attrib(MI,"isHomog",intvec(-1)); 
72resolution kos = nres(MI,0);
73print(betti(kos),"betti");
74//->              0     1     2     3     4     5
75//->   ------------------------------------------
76//->      -1:     1     5    10    10     5     1
77//->   ------------------------------------------
78//->   total:     1     5    10    10     5     1
79
80matrix alpha0 = random(32002,10,3);
81module pres = module(alpha0)+kos[3];
82
83attrib(pres,"isHomog",intvec(1,1,1,1,1,1,1,1,1,1));
84resolution fcokernel = mres(pres,0);
85print(betti(fcokernel),"betti");
86//->              0     1     2     3
87//->   ------------------------------
88//->       1:     7    10     5     1
89//->   ------------------------------
90//->   total:     7    10     5     1
91
92module dir = transpose(pres);
93intvec w = -1,-1,-1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2;
94attrib(dir,"isHomog",w);
95resolution fdir = mres(dir,2);
96print(betti(fdir),"betti");
97//->              0     1     2
98//->   ------------------------
99//->      -2:    10     7     -
100//->      -1:     -     -     -
101//->       0:     -     -     1
102//->   ------------------------
103//->   total:    10     7     1
104
105if (not(defined(flatten))){ LIB "matrix.lib"; }
106ideal I = groebner(flatten(fdir[2]));
107resolution FI = mres(I,0);
108print(betti(FI),"betti");
109//->              0     1     2     3     4
110//->   ------------------------------------
111//->       0:     1     -     -     -     -
112//->       1:     -     -     -     -     -
113//->       2:     -     7    10     5     1
114//->   ------------------------------------
115//->   total:     1     7    10     5     1
116
117int codimI = nvars(S)-dim(I);
118codimI;
119//->   2
120degree(I);
121//->   4
122nvars(S)-dim(groebner(minor(jacob(I),codimI) + I));
123//->   5
124
125
126kill S,w,codimI;
127//======================  Example 4.14 (new session) =======================
128if (not(defined(dsum))){ LIB "matrix.lib"; }
129ring S = 32003, x(0..4), dp;
130resolution kos = nres(maxideal(1),0);
131betti(kos);
132//->   1,5,10,10,5,1
133matrix kos5 = kos[5];
134matrix tphi = transpose(dsum(kos5,kos5));
135matrix kos3 = kos[3];
136matrix psi = dsum(kos3,kos3);
137matrix beta1 = random(32002,20,2);
138matrix tbeta1tilde = transpose(psi*beta1);
139matrix tbeta0 = lift(tphi,tbeta1tilde);
140if (not(defined(Ext_R))){ LIB "homolog.lib"; }
141def E = Ext_R(1,kos[4]);
142//->   // dimension of Ext^1:  -1
143matrix kos4 = kos[4];
144matrix tkos4pluskos4 = transpose(dsum(kos4,kos4));
145matrix tgammamin1 = random(32002,20,1);
146matrix tgamma0 = tkos4pluskos4*tgammamin1;
147matrix talpha0 = concat(tbeta0,tgamma0);
148matrix zero[20][1];
149matrix tpsi = transpose(psi);
150matrix tpresg = concat(tpsi,zero);
151matrix pres = module(transpose(talpha0))
152                + module(transpose(tpresg));
153module dir = transpose(pres);
154dir = prune(dir);
155homog(dir); 
156//->   1
157intvec deg_dir = attrib(dir,"isHomog");
158attrib(dir,"isHomog",deg_dir-2);        // set degrees
159resolution fdir = mres(prune(dir),2);
160print(betti(fdir),"betti");
161//->              0     1     2
162//->   ------------------------
163//->      -2:    20    10     -
164//->      -1:     -     1     -
165//->       0:     -     -     -
166//->       1:     -     -     -
167//->       2:     -     -     1
168//->   ------------------------
169//->   total:    20    11     1
170ideal I = groebner(flatten(fdir[2]));
171resolution FI = mres(I,0);
172print(betti(FI),"betti");
173//->              0     1     2     3     4
174//->   ------------------------------------
175//->       0:     1     -     -     -     -
176//->       1:     -     -     -     -     -
177//->       2:     -     -     -     -     -
178//->       3:     -     1     -     -     -
179//->       4:     -    10    18    10     2
180//->   ------------------------------------
181//->   total:     1    11    18    10     2
182
183
184//------- check smoothness ----------
185int codimI = nvars(S)-dim(I);
186codimI;
187//-> 2
188nvars(S)-dim(groebner(minor(jacob(I),codimI) + I));
189//-> 5
190
191tst_status(1);$
192
Note: See TracBrowser for help on using the repository browser.