1#############################################################################
2##
3##  GrothendieckGroup.gd                                     Modules package
4##
5##  Copyright 2011, Mohamed Barakat, University of Kaiserslautern
6##
7##  Declarations for elements of the Grothendieck group of a projective space.
8##
9#############################################################################
10
11####################################
12#
13# categories:
14#
15####################################
16
17#! @Description
18#!  The ⪆ category of elements of the Grothendieck group.
19#!  The filters guarantee that the filter IsElementOfGrothendieckGroup lies in IsRingElement.
20#! @Returns P
21#! @ChapterInfo Grothendieck group, Category
22DeclareCategory( "IsElementOfGrothendieckGroup",
23        IsExtAElement and
24        IsExtLElement and
25        IsExtRElement and
26        IsAdditiveElementWithInverse and
27        IsMultiplicativeElementWithInverse and
28        IsAssociativeElement and
29        IsAdditivelyCommutativeElement and
30        IsAttributeStoringRep );
31
32##  <#GAPDoc Label="IsElementOfGrothendieckGroupOfProjectiveSpace">
33##  <ManSection>
34##    <Filt Type="Category" Arg="P" Name="IsElementOfGrothendieckGroupOfProjectiveSpace"/>
35##    <Returns><C>true</C> or <C>false</C></Returns>
36##    <Description>
37##      The &GAP; category of elements of the Grothendieck group of the projective space.
38##    <Listing Type="Code"><![CDATA[
39DeclareCategory( "IsElementOfGrothendieckGroupOfProjectiveSpace",
40        IsElementOfGrothendieckGroup );
41##  ]]></Listing>
42##    </Description>
43##  </ManSection>
44##  <#/GAPDoc>
45
46##  <#GAPDoc Label="IsPolynomialModuloSomePower">
47##  <ManSection>
48##    <Filt Type="Category" Arg="P" Name="IsPolynomialModuloSomePower"/>
49##    <Returns><C>true</C> or <C>false</C></Returns>
50##    <Description>
51##      The &GAP; category of polynomials modulo some power.
52##    <Listing Type="Code"><![CDATA[
53DeclareCategory( "IsPolynomialModuloSomePower",
54        IsExtAElement and
55        IsExtLElement and
56        IsExtRElement and
57        IsAdditiveElementWithInverse and
58        IsMultiplicativeElementWithInverse and
59        IsAssociativeElement and
60        IsAdditivelyCommutativeElement and
61	## all the above guarantees IsPolynomialModuloSomePower => IsRingElement (in GAP4)
62        IsAttributeStoringRep );
63##  ]]></Listing>
64##    </Description>
65##  </ManSection>
66##  <#/GAPDoc>
67
68##  <#GAPDoc Label="IsChernPolynomialWithRank">
69##  <ManSection>
70##    <Filt Type="Category" Arg="P" Name="IsChernPolynomialWithRank"/>
71##    <Returns><C>true</C> or <C>false</C></Returns>
72##    <Description>
73##      The &GAP; category of Chern polynomials with rank.
74##    <Listing Type="Code"><![CDATA[
75DeclareCategory( "IsChernPolynomialWithRank",
76        IsExtAElement and
77        IsExtLElement and
78        IsExtRElement and
79        IsAdditiveElementWithInverse and
80        IsMultiplicativeElementWithInverse and
81        IsAssociativeElement and
82        IsAdditivelyCommutativeElement and
83	## all the above guarantees IsChernPolynomialWithRank => IsRingElement (in GAP4)
84        IsAttributeStoringRep );
85##  ]]></Listing>
86##    </Description>
87##  </ManSection>
88##  <#/GAPDoc>
89
90##  <#GAPDoc Label="IsChernCharacter">
91##  <ManSection>
92##    <Filt Type="Category" Arg="P" Name="IsChernCharacter"/>
93##    <Returns><C>true</C> or <C>false</C></Returns>
94##    <Description>
95##      The &GAP; category of Chern characters.
96##    <Listing Type="Code"><![CDATA[
97DeclareCategory( "IsChernCharacter",
98        IsExtAElement and
99        IsExtLElement and
100        IsExtRElement and
101        IsAdditiveElementWithInverse and
102        IsMultiplicativeElementWithInverse and
103        IsAssociativeElement and
104        IsAdditivelyCommutativeElement and
105	## all the above guarantees IsChernCharacter => IsRingElement (in GAP4)
106        IsAttributeStoringRep );
107##  ]]></Listing>
108##    </Description>
109##  </ManSection>
110##  <#/GAPDoc>
111
112####################################
113#
114# properties:
115#
116####################################
117
118##  <#GAPDoc Label="IsIntegral:ElementOfGrothendieckGroup">
119##  <ManSection>
120##    <Prop Arg="P" Name="IsIntegral" Label="for elements of the Grothendieck group"/>
121##    <Returns><C>true</C> or <C>false</C></Returns>
122##    <Description>
123##      Check if the element of the Grothendieck group of a projective space is integral.
124##    </Description>
125##  </ManSection>
126##  <#/GAPDoc>
127##
128DeclareProperty( "IsIntegral",
129        IsElementOfGrothendieckGroupOfProjectiveSpace );
130
131##  <#GAPDoc Label="IsIntegral:ChernPolynomial">
132##  <ManSection>
133##    <Prop Arg="C" Name="IsIntegral" Label="for Chern polynomials"/>
134##    <Returns><C>true</C> or <C>false</C></Returns>
135##    <Description>
136##      Check if the Chern polynomial is integral.
137##    </Description>
138##  </ManSection>
139##  <#/GAPDoc>
140##
141DeclareProperty( "IsIntegral",
142        IsChernPolynomialWithRank );
143
144##  <#GAPDoc Label="IsIntegral:ChernCharacter">
145##  <ManSection>
146##    <Prop Arg="ch" Name="IsIntegral" Label="for Chern characters"/>
147##    <Returns><C>true</C> or <C>false</C></Returns>
148##    <Description>
149##      Check if the Chern character is integral.
150##    </Description>
151##  </ManSection>
152##  <#/GAPDoc>
153##
154DeclareProperty( "IsIntegral",
155        IsChernCharacter );
156
157##  <#GAPDoc Label="IsNumerical">
158##  <ManSection>
159##    <Oper Arg="chi, dim" Name="IsNumerical" Label="for univariate polynomials"/>
160##    <Returns><C>true</C> or <C>false</C></Returns>
161##    <Description>
162##      Check if the univariate polynomial is numerical.
163##    </Description>
164##  </ManSection>
165##  <#/GAPDoc>
166##
167DeclareOperation( "IsNumerical",
168        [ IsUnivariatePolynomial ] );
169
170####################################
171#
172# attributes:
173#
174####################################
175
176##  <#GAPDoc Label="GrothendieckGroup">
177##  <ManSection>
178##    <Attr Arg="P" Name="GrothendieckGroup"/>
179##    <Returns>a &ZZ;-module</Returns>
180##    <Description>
181##      The Grothendieck group of the element of the Grothendieck group of the projective space.
182##    </Description>
183##  </ManSection>
184##  <#/GAPDoc>
185##
186DeclareAttribute( "GrothendieckGroup",
187        IsElementOfGrothendieckGroupOfProjectiveSpace );
188
189##  <#GAPDoc Label="UnderlyingModuleElement">
190##  <ManSection>
191##    <Attr Arg="P" Name="UnderlyingModuleElement"/>
192##    <Returns>a list of integers</Returns>
193##    <Description>
194##      The element of the Grothendieck group considered as an abstract &ZZ;-module.
195##    </Description>
196##  </ManSection>
197##  <#/GAPDoc>
198##
199DeclareAttribute( "UnderlyingModuleElement",
200        IsElementOfGrothendieckGroupOfProjectiveSpace );
201
202##  <#GAPDoc Label="AssociatedPolynomial">
203##  <ManSection>
204##    <Attr Arg="P" Name="AssociatedPolynomial"/>
205##    <Returns>a univariate polynomial</Returns>
206##    <Description>
207##      The polynomial associated to the element of the Grothendieck group of the projective space <A>P</A>.
208##    </Description>
209##  </ManSection>
210##  <#/GAPDoc>
211##
212DeclareAttribute( "AssociatedPolynomial",
213        IsElementOfGrothendieckGroupOfProjectiveSpace );
214
215##  <#GAPDoc Label="AmbientDimension:ElementOfGrothendieckGroup">
216##  <ManSection>
217##    <Attr Arg="P" Name="AmbientDimension" Label="for Grothendieck group elements"/>
218##    <Returns>a nonnegative integer</Returns>
219##    <Description>
220##      The ambient dimension of the element of the Grothendieck group of the projective space,
221##      i.e, the dimension of the projective space over which <A>P</A> is defined.
222##    </Description>
223##  </ManSection>
224##  <#/GAPDoc>
225##
226DeclareAttribute( "AmbientDimension",
227        IsElementOfGrothendieckGroupOfProjectiveSpace );
228
229##  <#GAPDoc Label="Dimension:ElementOfGrothendieckGroup">
230##  <ManSection>
231##    <Attr Arg="P" Name="Dimension" Label="for Grothendieck group elements"/>
232##    <Returns>a nonnegative integer</Returns>
233##    <Description>
234##      The dimension of the element of the Grothendieck group of the projective space.
235##    </Description>
236##  </ManSection>
237##  <#/GAPDoc>
238##
239DeclareAttribute( "Dimension",
240        IsElementOfGrothendieckGroupOfProjectiveSpace );
241
242##  <#GAPDoc Label="DegreeOfElementOfGrothendieckGroupOfProjectiveSpace">
243##  <ManSection>
244##    <Attr Arg="P" Name="DegreeOfElementOfGrothendieckGroupOfProjectiveSpace"/>
245##    <Returns>a nonnegative integer</Returns>
246##    <Description>
247##      The degree of the element of the Grothendieck group of the projective space. A short hand is the operation <C>Degree</C>.
248##    </Description>
249##  </ManSection>
250##  <#/GAPDoc>
251##
252DeclareAttribute( "DegreeOfElementOfGrothendieckGroupOfProjectiveSpace",
253        IsElementOfGrothendieckGroupOfProjectiveSpace );
254
255##  <#GAPDoc Label="RankOfObject:ElementOfGrothendieckGroup">
256##  <ManSection>
257##    <Attr Arg="P" Name="RankOfObject" Label="for Grothendieck group elements"/>
258##    <Returns>a nonnegative integer</Returns>
259##    <Description>
260##      The rank of the element of the Grothendieck group of the projective space. A short hand is the operation <C>Rank</C>.
261##    </Description>
262##  </ManSection>
263##  <#/GAPDoc>
264##
265DeclareAttribute( "RankOfObject",
266        IsElementOfGrothendieckGroupOfProjectiveSpace );
267
268##  <#GAPDoc Label="ChernPolynomial:ElementOfGrothendieckGroup">
269##  <ManSection>
270##    <Attr Arg="P" Name="ChernPolynomial" Label="for Grothendieck group elements"/>
271##    <Returns>a Chern polynomial with rank</Returns>
272##    <Description>
273##      The Chern polynomial (with rank) of the element of the Grothendieck group of the projective space.
274##    </Description>
275##  </ManSection>
276##  <#/GAPDoc>
277##
278DeclareAttribute( "ChernPolynomial",
279        IsElementOfGrothendieckGroupOfProjectiveSpace );
280
281##  <#GAPDoc Label="ElementOfGrothendieckGroupOfProjectiveSpace">
282##  <ManSection>
283##    <Attr Arg="P" Name="ElementOfGrothendieckGroupOfProjectiveSpace"/>
284##    <Returns>an element of the Grothendieck group of a projective space</Returns>
285##    <Description>
286##      The element of the Grothendieck group of the projective space of the Chern polynomial.
287##    </Description>
288##  </ManSection>
289##  <#/GAPDoc>
290##
291DeclareAttribute( "ElementOfGrothendieckGroupOfProjectiveSpace",
292        IsChernPolynomialWithRank );
293
294##  <#GAPDoc Label="TotalChernClass">
295##  <ManSection>
296##    <Attr Arg="C" Name="TotalChernClass"/>
297##    <Returns>a polynomial modulo some power</Returns>
298##    <Description>
299##      The total Chern class of the (Chern polynomial with rank).
300##    </Description>
301##  </ManSection>
302##  <#/GAPDoc>
303##
304DeclareAttribute( "TotalChernClass",
305        IsChernPolynomialWithRank );
306
307##  <#GAPDoc Label="AmbientDimension:ChernPolynomial">
308##  <ManSection>
309##    <Attr Arg="C" Name="AmbientDimension" Label="for Chern polynomials"/>
310##    <Returns>a nonnegative integer</Returns>
311##    <Description>
312##      The ambient dimension of the (Chern polynomial with rank),
313##      i.e, the dimension of the projective space over which <A>C</A> is defined.
314##    </Description>
315##  </ManSection>
316##  <#/GAPDoc>
317##
318DeclareAttribute( "AmbientDimension",
319        IsChernPolynomialWithRank );
320
321##  <#GAPDoc Label="Dimension:ChernPolynomial">
322##  <ManSection>
323##    <Attr Arg="C" Name="Dimension Label="for Chern polynomials""/>
324##    <Returns>a nonnegative integer</Returns>
325##    <Description>
326##      The dimension of the (Chern polynomial with rank).
327##    </Description>
328##  </ManSection>
329##  <#/GAPDoc>
330##
331DeclareAttribute( "Dimension",
332        IsChernPolynomialWithRank );
333
334##  <#GAPDoc Label="DegreeOfChernPolynomial">
335##  <ManSection>
336##    <Attr Arg="C" Name="DegreeOfChernPolynomial"/>
337##    <Returns>a nonnegative integer</Returns>
338##    <Description>
339##      The degree of the (Chern polynomial with rank). A short hand is <C>Degree</C>.
340##    </Description>
341##  </ManSection>
342##  <#/GAPDoc>
343##
344DeclareAttribute( "DegreeOfChernPolynomial",
345        IsChernPolynomialWithRank );
346
347##  <#GAPDoc Label="RankOfObject:ChernPolynomial">
348##  <ManSection>
349##    <Attr Arg="C" Name="RankOfObject" Label="for Chern polynomials"/>
350##    <Returns>a nonnegative integer</Returns>
351##    <Description>
352##      The rank of the (Chern polynomial with rank). A short hand is <C>Rank</C>.
353##    </Description>
354##  </ManSection>
355##  <#/GAPDoc>
356##
357DeclareAttribute( "RankOfObject",
358        IsChernPolynomialWithRank );
359
360##  <#GAPDoc Label="ChernCharacter:ChernPolynomial">
361##  <ManSection>
362##    <Attr Arg="C" Name="ChernCharacter" Label="for Chern polynomials"/>
363##    <Returns>a Chern character</Returns>
364##    <Description>
365##      The Chern character of a Chern polynomial with rank.
366##    </Description>
367##  </ManSection>
368##  <#/GAPDoc>
369##
370DeclareAttribute( "ChernCharacter",
371        IsChernPolynomialWithRank );
372
373##  <#GAPDoc Label="HilbertPolynomial:ChernPolynomial">
374##  <ManSection>
375##    <Attr Arg="C" Name="HilbertPolynomial" Label="for Chern polynomials"/>
376##    <Returns>a univariate polynomial</Returns>
377##    <Description>
378##      The Hilbert polynomial of the Chern polynomial with rank.
379##    </Description>
380##  </ManSection>
381##  <#/GAPDoc>
382##
383DeclareAttribute( "HilbertPolynomial",
384        IsChernPolynomialWithRank );
385
386##  <#GAPDoc Label="Dual:ChernPolynomial">
387##  <ManSection>
388##    <Attr Arg="C" Name="Dual" Label="for Chern polynomials"/>
389##    <Returns>a Chern polynomial with rank</Returns>
390##    <Description>
391##      The of the (Chern polynomial with rank).
392##    </Description>
393##  </ManSection>
394##  <#/GAPDoc>
395##
396DeclareAttribute( "Dual",
397        IsChernPolynomialWithRank );
398
399##  <#GAPDoc Label="ChernCharacterPolynomial">
400##  <ManSection>
401##    <Attr Arg="C" Name="ChernCharacterPolynomial"/>
402##    <Returns>a polynomial modulo some power</Returns>
403##    <Description>
404##      The Chern character polynomial of the Chern character.
405##    </Description>
406##  </ManSection>
407##  <#/GAPDoc>
408##
409DeclareAttribute( "ChernCharacterPolynomial",
410        IsChernCharacter );
411
412##  <#GAPDoc Label="AmbientDimension:ChernCharacter">
413##  <ManSection>
414##    <Attr Arg="ch" Name="AmbientDimension" Label="for Chern characters"/>
415##    <Returns>a nonnegative integer</Returns>
416##    <Description>
417##      The ambient dimension of the Chern character,
418##      i.e, the dimension of the projective space over which <A>ch</A> is defined.
419##    </Description>
420##  </ManSection>
421##  <#/GAPDoc>
422##
423DeclareAttribute( "AmbientDimension",
424        IsChernCharacter );
425
426##  <#GAPDoc Label="Dimension:ChernCharacter">
427##  <ManSection>
428##    <Attr Arg="ch" Name="Dimension" Label="for Chern characters"/>
429##    <Returns>a nonnegative integer</Returns>
430##    <Description>
431##      The dimension of the Chern character.
432##    </Description>
433##  </ManSection>
434##  <#/GAPDoc>
435##
436DeclareAttribute( "Dimension",
437        IsChernCharacter );
438
439##  <#GAPDoc Label="RankOfObject:ChernCharacter">
440##  <ManSection>
441##    <Attr Arg="ch" Name="RankOfObject" Label="for Chern characters"/>
442##    <Returns>a nonnegative integer</Returns>
443##    <Description>
444##      The rank of the Chern character. A short hand is <C>Rank</C>.
445##    </Description>
446##  </ManSection>
447##  <#/GAPDoc>
448##
449DeclareAttribute( "RankOfObject",
450        IsChernCharacter );
451
452DeclareAttribute( "ChernPolynomial",
453        IsChernCharacter );
454
455##  <#GAPDoc Label="HilbertPolynomial:ChernCharacter">
456##  <ManSection>
457##    <Attr Arg="ch" Name="HilbertPolynomial" Label="for Chern characters"/>
458##    <Returns>a univariate polynomial</Returns>
459##    <Description>
460##      The Hilbert polynomial of the Chern character.
461##    </Description>
462##  </ManSection>
463##  <#/GAPDoc>
464##
465DeclareAttribute( "HilbertPolynomial",
466        IsChernCharacter );
467
468####################################
469#
470# global functions and operations:
471#
472####################################
473
474DeclareGlobalFunction( "VariableForChernPolynomial" );
475
476DeclareGlobalFunction( "VariableForChernCharacter" );
477
478DeclareGlobalFunction( "ExpressSymmetricPolynomialInElementarySymmetricPolynomials" );
479
480DeclareGlobalFunction( "ExpressSumOfPowersInElementarySymmetricPolynomials" );
481
482# constructors:
483
484DeclareOperation( "CreateElementOfGrothendieckGroupOfProjectiveSpace",
485        [ IsHomalgModuleElement ] );
486
487DeclareOperation( "CreateElementOfGrothendieckGroupOfProjectiveSpace",
488        [ IsList, IsHomalgModule ] );
489
490DeclareOperation( "CreateElementOfGrothendieckGroupOfProjectiveSpace",
491        [ IsUnivariatePolynomial, IsHomalgModule ] );
492
493DeclareOperation( "CreateElementOfGrothendieckGroupOfProjectiveSpace",
494        [ IsUnivariatePolynomial, IsInt ] );
495
496DeclareOperation( "CreateElementOfGrothendieckGroupOfProjectiveSpace",
497        [ IsUnivariatePolynomial ] );
498
499DeclareOperation( "CreateElementOfGrothendieckGroupOfProjectiveSpace",
500        [ IsList, IsInt ] );
501
502DeclareOperation( "CreateElementOfGrothendieckGroupOfProjectiveSpace",
503        [ IsList ] );
504
505DeclareOperation( "CreatePolynomialModuloSomePower",
506        [ IsUnivariatePolynomial, IsInt ] );
507
508DeclareOperation( "CreateChernPolynomial",
509        [ IsInt, IsPolynomialModuloSomePower ] );
510
511DeclareOperation( "CreateChernPolynomial",
512        [ IsInt, IsUnivariatePolynomial, IsInt ] );
513
514DeclareOperation( "CreateChernCharacter",
515        [ IsPolynomialModuloSomePower ] );
516
517DeclareOperation( "CreateChernCharacter",
518        [ IsUnivariatePolynomial, IsInt ] );
519
520# basic operations:
521
522DeclareOperation( "ChernPolynomial",
523        [ IsUnivariatePolynomial, IsInt, IsRingElement ] );
524
525DeclareOperation( "ChernPolynomial",
526        [ IsUnivariatePolynomial, IsInt ] );
527
528DeclareOperation( "ElementarySymmetricPolynomial",
529        [ IsInt, IsList ] );
530
531DeclareOperation( "CoefficientsOfElementOfGrothendieckGroupOfProjectiveSpace",
532        [ IsUnivariatePolynomial ] );
533
534DeclareOperation( "Coefficients",
535        [ IsElementOfGrothendieckGroupOfProjectiveSpace ] );
536
537DeclareOperation( "Coefficients",
538        [ IsElementOfGrothendieckGroupOfProjectiveSpace, IsString ] );
539
540DeclareOperation( "Value",
541        [ IsElementOfGrothendieckGroupOfProjectiveSpace, IsRat ] );
542
543DeclareOperation( "ChernPolynomial",
544        [ IsElementOfGrothendieckGroupOfProjectiveSpace, IsRingElement ] );
545
546DeclareOperation( "Coefficients",
547        [ IsPolynomialModuloSomePower ] );
548
549DeclareOperation( "Value",
550        [ IsPolynomialModuloSomePower, IsRingElement ] );
551
552DeclareOperation( "Coefficients",
553        [ IsChernPolynomialWithRank ] );
554
555DeclareOperation( "Value",
556        [ IsChernPolynomialWithRank, IsRingElement ] );
557
558DeclareOperation( "Coefficients",
559        [ IsChernCharacter ] );
560