source: git/Tst/BuchDL/Ex_L2.tst @ 1ebec3

spielwiese
Last change on this file since 1ebec3 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: 2.8 KB
Line 
1LIB "tst.lib";
2tst_init();
3
4
5//======================  Example 2.28 =============================
6//================== Output depends on random ======================
7ring R = 0, x(0..3), dp;
8matrix A[4][1] = x(0),x(1),0,0;
9LIB "random.lib";  // loads other libraries incl. matrix.lib
10                   // and elim.lib, too
11matrix B = randommat(4,2,maxideal(1),100);
12
13
14matrix M = concat(B,A);  // from matrix.lib
15print(M);
16
17ideal I = minor(M,3);
18ideal GI = groebner(I);
19int codimI = nvars(R)-dim(GI);
20codimI;
21//->    2
22
23ideal singI = groebner(minor(jacob(GI),codimI) + I);
24nvars(R) - dim(singI);
25//->    3
26
27print(betti(singI,0),"betti");
28//->               0     1
29//->    ------------------
30//->        0:     1     -
31//->        1:     -     -
32//->        2:     -     4
33//->        3:     -    20
34//->    ------------------
35//->    total:     1    24
36
37ideal singI_sat = sat(singI,maxideal(1))[1]; // from elim.lib
38print(betti(singI_sat,0),"betti");
39//->               0     1
40//->    ------------------
41//->        0:     1     2
42//->        1:     -     1
43//->    ------------------
44//->    total:     1     3
45
46singI_sat;
47//->    singI_sat[1]=x(1)
48//->    singI_sat[2]=x(0)
49//->    singI_sat[3]=3297*x(2)^2-2680*x(2)*x(3)-5023*x(3)^2
50
51ideal IL = x(0),x(1);   
52reduce(I,groebner(IL),1);
53//->   _[1]=0
54//->   _[2]=0
55//->   _[3]=0
56//->   _[4]=0
57
58ideal I' = sat(I,IL)[1];   // result is Groebner basis
59
60degree(GI);
61//->   // dimension (proj.)  = 1
62//->   // degree (proj.)   = 6
63
64degree(I');
65//->   // dimension (proj.)  = 1
66//->   // degree (proj.)   = 5
67
68int codimI' = nvars(R)-dim(I');
69ideal singI' = minor(jacob(I'),codimI') + I';
70nvars(R) - dim(groebner(singI'));
71//->    4
72
73
74kill R,codimI,codimI';
75//==================  Example 2.33 (New Session)  =========================
76ring P1P3 = 0, (s,t,w,x,y,z), (dp(2),dp);
77ideal J = w-s3, x-s2t, y-st2, z-t3;
78J = groebner(J);
79J;
80//->   J[1]=y2-xz
81//->   J[2]=xy-wz
82//->   J[3]=x2-wy
83//->   J[4]=sz-ty
84//->   [...]
85//->   J[10]=s3-w
86
87ring P1 = 0, (s,t), dp;
88ideal ZERO;
89ideal PARA = s3, s2t, st2, t3;
90ring P3 = 0, (w,x,y,z), dp;
91ideal IC = preimage(P1,PARA,ZERO);
92print(IC);
93//->   y2-xz,
94//->   xy-wz,
95//->   x2-wy
96
97ideal P =  w-y, x, z;
98size(reduce(IC,groebner(P),1));  // ideal membership test
99//->   2
100
101ring P2 = 0, (a,b,c), dp;
102ideal PIC = preimage(P3,P,IC);
103PIC;
104//->   PIC[1]=b3-a2c-2b2c+bc2
105
106setring P3;
107ideal Q = w, y, z;
108size(reduce(IC,groebner(Q),1));   // check: Q not on C
109//->   1
110setring P2;
111ideal QIC = preimage(P3,Q,IC);
112QIC;
113//->   QIC[1]=b3-ac2
114
115
116kill P1,P3,P1P3,P2;
117//==================  Example 2.34 (New Session)  =========================
118ring S2 = 0, x(1..3), dp;
119ideal SPHERE = x(1)^2+x(2)^2+x(3)^2-1;
120ideal MAP = x(1)*x(2), x(1)*x(3), x(2)*x(3);
121ring R3 = 0, y(1..3), dp;
122ideal ST = preimage(S2, MAP, SPHERE);
123print(ST);
124//->   y(1)^2*y(2)^2+y(1)^2*y(3)^2+y(2)^2*y(3)^2-y(1)*y(2)*y(3)
125
126
127
128tst_status(1);$
129
Note: See TracBrowser for help on using the repository browser.