source: git/Singular/LIB/schubert.lib @ 2d5ff5

fieker-DuValspielwiese
Last change on this file since 2d5ff5 was 2d5ff5, checked in by Hans Schoenemann <hannes@…>, 11 years ago
add: new lib schubert.lib
  • Property mode set to 100644
File size: 14.5 KB
Line 
1////////////////////////////////////////////////////////////////////////////////
2version="1.0";
3
4category="Algebraic Geometry";
5info="
6LIBRARY:    schubert.lib   Proceduces for Intersection Theory
7
8PROCEDURES:
9    projectiveSpace(n)     Chow ring of projective space of dimension n
10    grassmannian(k,n)      Chow ring of Grassmannian of k-planes on an n-space
11    projectiveBundle(f,d)  Chow ring of projective bundles
12    grassmannBundle(k,f,d) Chow ring of Grassmann bundles
13    integral(f)            compute intersection number
14    dual(f)                dual of a vector bundle
15    tensorBundle(f,g,d)    tensor of two vector bundles
16    symmPower(n,f,d)       n-th symmetric power of a vector bundle
17    chern(f,d)             total Chern class of a vector bundle
18    segre(f,d)             total Segre class of a vector bundle
19    rankBundle(f)          rank of a vector bundle
20
21KEYWORDS:        Intersection Theory, Enumerative Geometry, Schubert Calculus
22";
23
24////////////////////////////////////////////////////////////////////////////////
25
26LIB "general.lib";
27
28////////////////////////////////////////////////////////////////////////////////
29
30////////////////////////////////////////////////////////////////////////////////
31/// Procedures concerned with abstract varieties ///////////////////////////////
32////////////////////////////////////////////////////////////////////////////////
33
34////////////////////////////////////////////////////////////////////////////////
35
36proc projectiveSpace(int n)
37"USAGE: projectiveSpace(n); n int
38RETURN:     ring
39PURPOSE:    create a polynomial ring in one variable h, where h is the hyperplane
40            class of this projective space. The monomial ordering of this ring is
41            'wp' (weighted reverse lexicographical ordering) with vector (1).
42            Moreover, we export an ideal (say 'rels') generated by h^{n+1} and
43            the quotient ring modulo this ideal should be its Chow ring.
44EXAMPLE: example projectiveSpace; shows examples
45"
46{
47    ring CR = 0, (h), wp(1);
48    int d = n;
49    poly u = 1;
50    poly v = 1 + h;
51    list l;
52    int i;
53    for (i=1;i<=n;i++)
54    {
55        l=insert(l,1,size(l));
56        u=u+(-1)^i*schur(l,v);
57    }
58    ideal rels = h^(n+1);
59    rels = std(rels);
60    poly s = reduce(logg(u,d)+n,rels);
61    poly q = reduce(logg(v,d)+1,rels);
62    export (s,q,rels);
63    return (CR);
64}
65example
66{
67    "EXAMPLE:"; echo=2;
68    def P3 = projectiveSpace(3);
69    setring P3;
70    s; q; rels;
71}
72
73proc grassmannian(int k, int n)
74"USAGE: grassmannian(k,n); k int, n int
75RETURN:     ring
76PURPOSE:    create a polynomial ring in n variables, in which the first k
77            variables s(1),...,s(k) will be the Chern classes of the
78            tautological subbundle on Grassmannian G(k,n) and the next n-k
79            variables q(1),...,q(n-k) will be the Chern classes of the
80            tautological quotient bundle on G(k,n). The monomial ordering
81            of this ring is 'wp' (weighted reverse lexicographical ordering)
82            with vector (1..k,1..n-k).
83            Moreover, we export the Chern characters of the tautological
84            subbundle and quotient bundle on G(k,n) (say 's' and 'q'). They
85            are the polynomials. One more thing, we export an ideal
86            (say 'rels') generated by the relations between the Chern
87            variables and the quotient ring modulo this ideal should be Chow
88            ring of G(k,n).
89EXAMPLE: example grassmannian; shows examples
90"
91{
92    ring CR = 0, (q(1..n-k)), wp(1..n-k);
93    int d = k*(n-k);
94    int i,j,h;
95    poly v = 1;
96    poly u = 1;
97    for (j=1;j<=n-k;j++) {v=v+q(j);}
98    list l;
99    for (i=1;i<=k;i++)
100    {
101        l=insert(l,1,size(l));
102        u=u+(-1)^i*schur(l,v);
103    }
104    ideal rels;
105    for (h=k+1;h<=n;h++)
106    {
107        l=insert(l,1,size(l));
108        rels=rels,schur(l,v);
109    }
110    rels = std(rels);
111    poly s = reduce(logg(u,d)+k,rels);
112    poly q = reduce(logg(v,d)+n-k,rels);
113    export (s,q,rels);
114    return (CR);
115}
116example
117{
118    "EXAMPLE:"; echo=2;
119    def G24 = grassmannian(2,4);
120    setring G24;
121    s; q; rels;
122}
123
124////////////////////////////////////////////////////////////////////////////////
125
126proc projectiveBundle(poly f, int d)
127"USAGE: projectiveBundle(f,d); f poly, d int
128RETURN:     ring
129PURPOSE:    create a polynomial ring which we work on.
130            we export an ideal (say 'rels') generated by the relations between
131            the Chern variables and the quotient ring modulo this ideal should
132            be its Chow ring.
133EXAMPLE: example projectiveBundle; shows examples
134"
135{
136    def R = basering;
137    setring R;
138    int r = rankBundle(f);
139    poly c = chern(f,d);
140    ring P = 0, (z), wp(1);
141    def CR = P + R;
142    setring CR;
143    int dd = r-1 + d;
144    poly c = imap(R,c);
145    ideal rels = imap(R,rels);
146    poly g = z^r;
147    int i;
148    for (i=1;i<=r;i++) {g=g+z^(r-i)*part(c,i);}
149    rels=std(rels,g);
150    poly u = 1 + z;
151    poly Q = reduce(logg(u,dd)+1,rels);
152    export (rels,Q);
153    return (CR);
154}
155example
156{
157    "EXAMPLE:"; echo=2;
158    def G35 = grassmannian(3,5);
159    setring G35;
160    int d = 6;
161    poly f = symmPower(2,dual(s),6);
162    def PB = projectiveBundle(f,6);
163    setring PB;
164    int d = 14;
165    Q; rels;
166}
167////////////////////////////////////////////////////////////////////////////////
168
169proc grassmannBundle(int k, poly f, int d)
170"USAGE: grassmannBundle(k,f,d); k int, f poly, d int
171RETURN:     ring
172PURPOSE:    create a polynomial ring which we work on.
173            we export the Chern characters of the tautological subbundle and
174            quotient bundle on this Grassmann bundle (say 'S' and 'Q').
175            They are the polynomials. One more thing, we also export an ideal
176            (say 'rels') generated by the relations between the Chern variables
177            and the quotient ring modulo this ideal should be its Chow ring.
178EXAMPLE: example grassmannBundle; shows examples
179"
180{
181    def R = basering;
182    setring R;
183    int r = rankBundle(f);
184    ring G = 0, (S(1..k),Q(1..r-k)), wp(1..k,1..r-k);
185    def CR = G + R;
186    setring CR;
187    int dd = k*(r-k)+d;
188    poly f = imap(R,f);
189    ideal rels = imap(R,rels);
190    poly u = 1;
191    poly v = 1;
192    int i,j,h;
193    for (i=1;i<=k;i++) {u=u+S(i);} 
194    for (j=1;j<=r-k;j++) {v=v+Q(j);}
195    poly g = u*v;
196    ideal I = part(g,1)-part(expp(f,r),1);
197    for (h=2;h<=r;h++) {I = I,part(g,h)-part(expp(f,r),h);}
198    def J = I + rels;
199    ideal rels = std(J);
200    poly S = reduce(logg(u,dd)+k,rels);
201    poly Q = reduce(logg(v,dd)+r-k,rels);
202    export (rels,S,Q);
203    return (CR);
204}
205example
206{
207    "EXAMPLE:"; echo=2;
208    def G25 = grassmannian(2,5);
209    setring G25;
210    int d = 6;
211    poly f = dual(symmPower(2,q,6));
212    def GB = grassmannBundle(5,f,6);
213    setring GB;
214    int d = 14;
215    S; Q; rels;
216}
217
218////////////////////////////////////////////////////////////////////////////////
219
220////////////////////////////////////////////////////////////////////////////////
221/// Auxilary Static Procedures in this Library /////////////////////////////////
222////////////////////////////////////////////////////////////////////////////////
223/// - part
224/// - parts
225/// - logg
226/// - expp
227/// - adams
228/// - wedges
229/// - integral
230////////////////////////////////////////////////////////////////////////////////
231
232////////////////////////////////////////////////////////////////////////////////
233
234static proc part(poly f, int n)
235{
236    int i;
237    poly p;
238    for (i=1;i<=size(f);i++)
239    {
240        if (deg(f[i])==n)
241        {
242            p=p+f[i];
243        }
244    }
245    return (p);
246}
247
248////////////////////////////////////////////////////////////////////////////////
249
250static proc parts(poly f, int i, int j)
251{
252    int k;
253    poly p;
254    for (k=i;k<=j;k++)
255    {
256        p=p+part(f,k);
257    }
258    return (p);
259}
260
261////////////////////////////////////////////////////////////////////////////////
262
263static proc logg(poly f, int n)
264{
265    poly p;
266    int i,j,k,m;
267    if (n==0) {p=0;}
268    if (n==1) {p=part(f,1);}
269    else
270    {
271        list l=-part(f,1);
272        for (j=2;j<=n;j++)
273        {
274            poly q;
275            for (k=1;k<j;k++)
276            {
277                q=q+part(f,k)*l[j-k];
278            }
279            q=-j*part(f,j)-q;
280            l=insert(l,q,size(l));
281            kill q;
282        }
283        for (m=1;m<=n;m++)
284        {
285            p=p+1/factorial(m)*(-1)^m*l[m];
286        }
287    }
288    return (p);
289}
290
291////////////////////////////////////////////////////////////////////////////////
292
293static proc expp(poly f, int n)
294{
295    poly p;
296    int i,j,k;
297    if (deg(f)==0) {p=1;}
298    else
299    {
300        list l=1;
301        for (i=1;i<=n;i++)
302        {
303            poly q;
304            for (j=1;j<=i;j++)
305            {
306                q=q+factorial(j)*(-1)^(j-1)*l[i-j+1]*part(f,j)/i;
307            }
308            l=insert(l,q,size(l));
309            kill q;
310        }
311        for (k=1;k<=size(l);k++)
312        {
313            p=p+l[k];
314        }
315    }
316    return (p);
317}
318
319////////////////////////////////////////////////////////////////////////////////
320
321static proc adams(poly f, int n)
322{
323    poly p;
324    int i;
325    for (i=0;i<=deg(f);i++)
326    {
327        p=p+n^i*part(f,i);
328    }
329    return (p);
330}
331
332////////////////////////////////////////////////////////////////////////////////
333
334static proc wedges(int n, poly f, int d)
335{
336    int i,j;
337    list l;
338    if (n==0) {l=1;}
339    if (n==1) {l=1,f;}
340    else
341    {
342        l=1,f;
343        for (i=2;i<=n;i++)
344        {
345            poly q;
346            for (j=1;j<=i;j++)
347            {
348                q=q+((-1)^(i-j))*parts(l[j]*adams(f,i-j+1),0,d)/i;
349            }
350            l=insert(l,q,size(l));
351            kill q;
352        }
353    }
354    return (l);
355}
356
357////////////////////////////////////////////////////////////////////////////////
358
359static proc schur(list p, poly f)
360{
361    int i,j;
362    int n = size(p);
363    matrix M[n][n];
364    for (i=1;i<=n;i++)
365    {
366        for (j=1;j<=n;j++)
367        {
368            M[i,j] = part(f,p[i]+j-i);
369        }
370    }
371    return (det(M));
372}
373
374////////////////////////////////////////////////////////////////////////////////
375
376proc integral(poly f)
377"USAGE: integral(f); f poly
378RETURN:     int
379PURPOSE:    compute the intersection number.
380            That is the degree of top Chern class.
381EXAMPLE: example integral; shows examples
382"
383{
384    return (leadcoef(reduce(f,rels)));
385}
386example
387{
388    "EXAMPLE:"; echo=2;
389    def G25 = grassmannian(2,5);
390    setring G25;
391    integral(q(2)^3);
392}
393
394////////////////////////////////////////////////////////////////////////////////
395
396////////////////////////////////////////////////////////////////////////////////
397/// Procedures concerned with vector bundles ///////////////////////////////////
398////////////////////////////////////////////////////////////////////////////////
399
400////////////////////////////////////////////////////////////////////////////////
401
402proc symmPower(int n, poly f, int d)
403"USAGE: symmPower(n,f,d); n int, f poly, d int
404RETURN:     poly
405INPUT:      n -- integer
406            f -- Chern character of a given vector bundle
407            d -- dimension of current variety.
408OUTPUT:     a polynomial which is the Chern character of the n-th symmetric
409            power of the vector bundle defined by 'f'
410EXAMPLE: example symmPower(n,f,d); shows examples
411"
412{
413    int i,j,m;
414    int r = rankBundle(f);
415    poly result;
416    list s,w;
417    if (n==0) {result=1;}
418    if (n==1) {result=f;}
419    else
420    {
421        s = 1,f;
422        w = wedges(n,f,d);
423        for (i=2;i<=n;i++)
424        {
425            if (i<=r) {m=i;}
426            else {m=r;}
427            poly q;
428            for (j=1;j<=m;j++)
429            {
430                q = q + ((-1)^(j+1))*parts(w[j+1]*s[i-j+1],0,d);
431            }
432            s = insert(s,q,size(s));
433            kill q;
434        }
435        result = s[n+1];
436    }
437    return (result);
438}
439example
440{
441    "EXAMPLE:"; echo=2;
442    def G24 = grassmannian(2,4);
443    setring G24;
444    int d = 4;
445    symmPower(3,q,d);
446}
447////////////////////////////////////////////////////////////////////////////////
448
449proc dual(poly f)
450"USAGE: dual(f); f poly
451RETURN:     poly
452INPUT:      f -- Chern character of a vector bundle
453OUTPUT:     a polynomial which is the Chern character of the dual of the vector
454            bundle defined by 'f'.
455EXAMPLE: example dual(f); shows examples
456"
457{
458    return (adams(f,-1));
459}
460example
461{
462    "EXAMPLE:"; echo=2;
463    def G24 = grassmannian();
464    setring G24;
465    dual(s);
466}
467
468////////////////////////////////////////////////////////////////////////////////
469
470proc tensorBundle(poly f, poly g, int d)
471"USAGE: tensorBundle(f,g,d); f poly, g poly, d int
472RETURN:     poly
473INPUT:      f, g -- Chern characters of two vector bundles
474            d -- dimension of current variety.
475OUTPUT:     a polynomial which is the Chern character of the tensor of two
476            vector bundles defined by 'f' and 'g' respectively.
477EXAMPLE: example tensorBundle(f,g,d); shows examples
478"
479{
480    return (parts(f*g,0,d));
481}
482example
483{
484    "EXAMPLE:"; echo=2;
485    def G34 = grassmannian(3,4);
486    setring G34;
487    int d = 3;
488    tensorBundle(s,q,d);
489}
490
491////////////////////////////////////////////////////////////////////////////////
492
493proc chern(poly f, int d)
494"USAGE: chern(f,d); f poly, d int
495RETURN:     poly
496INPUT:      f -- Chern character of a given vector bundle
497            d -- dimension of current variety
498OUTPUT:     a polynomial which is the total Chern class of the vector bundle
499            defined by 'f'.
500EXAMPLE: example chern(f,d); shows examples
501"
502{
503    poly c = reduce(expp(f,d),rels);
504    return (c);
505}
506example
507{
508    "EXAMPLE:"; echo=2;
509    def G24 = grassmannian(2,4);
510    setring G24;
511    int d = 4;
512    chern(q,d);
513}
514
515////////////////////////////////////////////////////////////////////////////////
516
517proc segre(poly f, int d)
518"USAGE: segre(f,d); f poly, d int
519RETURN:     poly
520INPUT:      f -- Chern character of a given vector bundle
521            d -- dimension of current variety
522OUTPUT:     a polynomial which is the total Segre class of the vector bundle
523            defined by 'f'.
524EXAMPLE: example segre(f,d); shows examples
525"
526{
527    poly g = dual(chern(f,d));
528    if (g==1) {return (1);}
529    else
530    {
531        poly t,h;
532        int i,j;
533        for (i=0;i<=d;i++) {t = t + (1-g)^i;}
534        for (j=0;j<=d;j++) {h = h + part(t,j);}
535        return (reduce(h,rels));
536    }
537}
538example
539{
540    "EXAMPLE:"; echo=2;
541    def G24 = grassmannian(2,4);
542    setring G24;
543    int d = 4;
544    segre(q,d);
545}
546
547////////////////////////////////////////////////////////////////////////////////
548
549proc rankBundle(poly f)
550"USAGE: rankBundle(f); f poly
551RETURN:     poly
552INPUT:      f -- Chern character of a given vector bundle
553OUTPUT:     an integer which is the rank of the vector bundle defined by 'f'.
554EXAMPLE: example rankBundle(f); shows examples
555"
556{
557    return (int(part(f,0)));
558}
559example
560{
561    "EXAMPLE:"; echo=2;
562    def G24 = grassmannian(2,4);
563    setring G24;
564    int d = 4;
565    rankBundle(q);
566}
Note: See TracBrowser for help on using the repository browser.