1#############################################################################
2##
3##  ToricDivisors.gd         ToricVarieties package
4##
5##  Copyright 2011- 2016, Sebastian Gutsche, TU Kaiserslautern
6##                        Martin Bies,       ITP Heidelberg
7##
8#! @Chapter Toric divisors
9##
10#############################################################################
11
12#############################
13##
14#! @Section The GAP category
15##
16#############################
17
18#! @Description
19#!  The <A>GAP</A> category of torus invariant Weil divisors.
20#! @Returns true or false
21#! @Arguments M
22DeclareCategory( "IsToricDivisor",
23                 IsObject );
24
25#!
26DeclareAttribute( "twitter",
27                 IsToricDivisor );
28
29#################################
30##
31#! @Section Properties
32##
33#################################
34
35#! @Description
36#!  Checks if the torus invariant Weil divisor <A>divi</A> is Cartier i.e. if it is locally principal.
37#! @Returns true or false
38#! @Arguments divi
39DeclareProperty( "IsCartier",
40                 IsToricDivisor );
41
42#! @Description
43#!  Checks if the torus invariant Weil divisor <A>divi</A> is principal
44#!  which in the toric invariant case means that it is the divisor of a character.
45#! @Returns true or false
46#! @Arguments divi
47DeclareProperty( "IsPrincipal",
48                 IsToricDivisor );
49
50#! @Description
51#!  Checks if the Weil divisor <A>divi</A> represents a prime divisor,
52#!  i.e. if it is a standard generator of the divisor group.
53#! @Returns true or false
54#! @Arguments divi
55DeclareProperty( "IsPrimedivisor",
56                 IsToricDivisor );
57
58#! @Description
59#!  Checks if the divisor <A>divi</A> is basepoint free.
60#! @Returns true or false
61#! @Arguments divi
62DeclareProperty( "IsBasepointFree",
63                 IsToricDivisor );
64
65#! @Description
66#!  Checks if the divisor <A>divi</A> is ample, i.e. if it is colored red, yellow and green.
67#! @Returns true or false
68#! @Arguments divi
69DeclareProperty( "IsAmple",
70                 IsToricDivisor );
71
72#! @Description
73#!  Checks if the divisor <A>divi</A> is very ample.
74#! @Returns true or false
75#! @Arguments divi
76DeclareProperty( "IsVeryAmple",
77                 IsToricDivisor );
78
79#! @Description
80#!  Checks if the divisor <A>divi</A> is nef.
81#! @Returns true or false
82#! @Arguments divi
83DeclareProperty( "IsNumericallyEffective",
84                 IsToricDivisor );
85
86#################################
87##
88#! @Section Attributes
89##
90#################################
91
92#! @Description
93#!  Returns the Cartier data of the divisor <A>divi</A>, if it is Cartier, and fails otherwise.
94#! @Returns a list
95#! @Arguments divi
96DeclareAttribute( "CartierData",
97                 IsToricDivisor );
98
99#! @Description
100#!  Returns the character corresponding to the principal divisor <A>divi</A>.
101#! @Returns a homalg module element
102#! @Arguments divi
103DeclareAttribute( "CharacterOfPrincipalDivisor",
104                 IsToricDivisor );
105
106#! @Description
107#!  Returns the class group element corresponding to the divisor <A>divi</A>.
108#! @Returns a homalg module element
109#! @Arguments divi
110DeclareAttribute( "ClassOfDivisor",
111                 IsToricDivisor );
112
113#! @Description
114#!  Returns the polytope corresponding to the divisor <A>divi</A>.
115#! @Returns a polytope
116#! @Arguments divi
117DeclareAttribute( "PolytopeOfDivisor",
118                  IsToricDivisor );
119
120#! @Description
121#!  Returns a basis of the global section module of the quasi-coherent sheaf of the divisor <A>divi</A>.
122#! @Returns a list
123#! @Arguments divi
124DeclareAttribute( "BasisOfGlobalSections",
125                  IsToricDivisor );
126
127#! @Description
128#!  Returns an integer <A>n</A> such that $n \cdot $divi is very ample.
129#! @Returns an integer
130#! @Arguments divi
131DeclareAttribute( "IntegerForWhichIsSureVeryAmple",
132                  IsToricDivisor );
133
134#! @Description
135#!  Returns the toric variety which contains the prime divisors of the divisor <A>divi</A>.
136#! @Returns a variety
137#! @Arguments divi
138DeclareAttribute( "AmbientToricVariety",
139                  IsToricDivisor );
140
141#! @Description
142#!  Returns an element which represents the divisor <A>divi</A> in the Weil group.
143#! @Returns a homalg module element
144#! @Arguments divi
145DeclareAttribute( "UnderlyingGroupElement",
146                  IsToricDivisor );
147
148#! @Description
149#!  Returns the closure of the torus orbit corresponding to the prime divisor <A>divi</A>.
150#!  Not implemented for other divisors. Maybe we should add the support here.
151#!  Is this even a toric variety? Exercise left to the reader.
152#! @Returns a variety
153#! @Arguments divi
154DeclareAttribute( "UnderlyingToricVariety",
155                  IsToricDivisor );
156
157#! @Description
158#!  Returns the degree of the divisor <A>divi</A>. This is not to be confused with the (divisor) class of <A>divi</A>!
159#! @Returns an integer
160#! @Arguments divi
161DeclareAttribute( "DegreeOfDivisor",
162                  IsToricDivisor );
163
164#! @Description
165#!  Returns the variety corresponding to the polytope of the divisor <A>divi</A>.
166#! @Returns a variety
167#! @Arguments divi
168DeclareAttribute( "VarietyOfDivisorpolytope",
169                  IsToricDivisor );
170
171#! @Description
172#!  Returns the monoms in the Cox ring of degree equal to the (divisor) class of the divisor <A>divi</A>.
173#! @Returns a list
174#! @Arguments divi
175DeclareAttribute( "MonomsOfCoxRingOfDegree",
176                  IsToricDivisor );
177
178#! @Description
179#!  A basepoint free divisor <A>divi</A> defines a map from its ambient variety in a projective space.
180#!  This method returns the Cox ring of such a projective space.
181#! @Returns a ring
182#! @Arguments divi
183DeclareAttribute( "CoxRingOfTargetOfDivisorMorphism",
184                  IsToricDivisor );
185
186#! @Description
187#!  A basepoint free divisor <A>divi</A> defines a map from its ambient variety in a projective space.
188#!  This method returns the morphism between the cox ring of this projective space to the cox ring of the
189#!  ambient variety of <A>divi</A>.
190#! @Returns a ring map
191#! @Arguments divi
192DeclareAttribute( "RingMorphismOfDivisor",
193                  IsToricDivisor );
194
195#################################
196##
197#! @Section Methods
198##
199#################################
200
201#! @Description
202#!  Returns a very ample multiple of the ample divisor <A>divi</A>. The method will fail if divisor is not ample.
203#! @Returns a divisor
204#! @Arguments divi
205DeclareOperation( "VeryAmpleMultiple",
206                  [ IsToricDivisor ] );
207
208#! @Description
209#!  Returns characters for closed embedding defined via the ample divisor <A>divi</A>.
210#!  The method fails if the divisor <A>divi</A> is not ample.
211#! @Returns a list
212#! @Arguments divi
213DeclareOperation( "CharactersForClosedEmbedding",
214                  [ IsToricDivisor ] );
215
216#! @Description
217#!  Returns the sum of the divisors <A>divi1</A> and <A>divi2</A>.
218#! @Returns a divisor
219#! @Arguments divi1,divi2
220DeclareOperation( "\+",
221                  [ IsToricDivisor, IsToricDivisor ] );
222
223#! @Description
224#!  Returns the divisor <A>divi1</A> minus <A>divi2</A>.
225#! @Returns a divisor
226#! @Arguments divi1,divi2
227DeclareOperation( "\-",
228                  [ IsToricDivisor, IsToricDivisor ] );
229
230#! @Description
231#!  Returns <A>k</A> times the divisor <A>divi</A>.
232#! @Returns a divisor
233#! @Arguments k,divi
234DeclareOperation( "\*",
235                  [ IsInt, IsToricDivisor ] );
236
237#! @Description
238#!  Returns the monoms of the Cox ring of the variety <A>vari</A> with degree equal to the class
239#!  group element <A>elem</A>. The variable <A>elem</A> can also be a list.
240#! @Returns a list
241#! @Arguments vari, elem
242DeclareOperation( "MonomsOfCoxRingOfDegree",
243                  [ IsToricVariety, IsHomalgElement ] );
244
245DeclareOperation( "MonomsOfCoxRingOfDegree",
246                  [ IsToricVariety, IsList ] );
247
248#! @Description
249#!  Computes a divisor of the variety <A>divi</A> which is member of the divisor class presented by <A>elem</A>.
250#!  The variable <A>elem</A> can be a homalg element or a list presenting an element.
251#! @Returns a divisor
252#! @Arguments vari, elem
253DeclareOperation( "DivisorOfGivenClass",
254                  [ IsToricVariety, IsHomalgElement ] );
255
256DeclareOperation( "DivisorOfGivenClass",
257                  [ IsToricVariety, IsList ] );
258
259#! @Description
260#!  Adds the divisor <A>divi</A> to the Weil divisor list of its ambient variety.
261#! @Returns
262#! @Arguments divi
263DeclareOperation( "AddDivisorToItsAmbientVariety",
264                  [ IsToricDivisor ] );
265
266#! @Description
267#!  Returns the polytope of the divisor <A>divi</A>. Another name for **PolytopeOfDivisor**
268#!  for compatibility and shortness.
269#! @Returns a polytope
270#! @Arguments divi
271DeclareOperation( "Polytope",
272                  [ IsToricDivisor ] );
273
274#! @Description
275#!  Given a toric divisor <A>divi</A>, it induces a toric morphism. The target of this morphism is a toric variety.
276#!  This method returns the Cox ring of this target. The variables are named according to <A>string</A>.
277#! @Returns a ring
278#! @Arguments divi, string
279DeclareOperation( "CoxRingOfTargetOfDivisorMorphism",
280                  [ IsToricDivisor, IsString ] );
281
282# DeclareOperation( "\=",
283#                   [ IsToricDivisor, IsToricDivisor ] );
284
285
286##################################
287##
288#! @Section Constructors
289##
290##################################
291
292#! @Description
293#!  Returns the divisor of the toric variety <A>vari</A> which corresponds to the character <A>elem</A>.
294#! @Returns a divisor
295#! @Arguments elem, vari
296DeclareOperation( "DivisorOfCharacter",
297                  [ IsHomalgElement, IsToricVariety ] );
298
299#! @Description
300#!  Returns the divisor of the toric variety <A>vari</A> which corresponds to the character which is created
301#!  by the list <A>lis</A>.
302#! @Returns a divisor
303#! @Arguments lis, vari
304DeclareOperation( "DivisorOfCharacter",
305                  [ IsList, IsToricVariety ] );
306
307#! @Description
308#!  Returns the divisor of the toric variety <A>vari</A> which corresponds to the Weil group element <A>elem</A>.
309#!  by the list <A>lis</A>.
310#! @Returns a divisor
311#! @Arguments elem, vari
312DeclareOperation( "CreateDivisor",
313                  [ IsHomalgElement, IsToricVariety ] );
314
315#! @Description
316#!  Returns the divisor of the toric variety <A>vari</A> which corresponds to the Weil group element
317#!  which is created by the list <A>lis</A>.
318#! @Returns a divisor
319#! @Arguments lis, vari
320DeclareOperation( "CreateDivisor",
321                  [ IsList, IsToricVariety ] );
322