-
Notifications
You must be signed in to change notification settings - Fork 126
/
attributes.jl
257 lines (183 loc) · 8.81 KB
/
attributes.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
###################################################################
###################################################################
# 1: Attributes that work the same tor toric and non-toric settings
###################################################################
###################################################################
#####################################################
# 1.1 Tate sections and Tate polynomial
#####################################################
@doc raw"""
weierstrass_section_f(w::WeierstrassModel)
Return the polynomial ``f`` used for the
construction of the Weierstrass model.
```jldoctest
julia> w = su5_weierstrass_model_over_arbitrary_3d_base()
Assuming that the first row of the given grading is the grading under Kbar
Weierstrass model over a not fully specified base
julia> weierstrass_section_f(w);
```
"""
weierstrass_section_f(w::WeierstrassModel) = w.weierstrass_f
@doc raw"""
weierstrass_section_g(w::WeierstrassModel)
Return the polynomial ``g`` used for the
construction of the Weierstrass model.
```jldoctest
julia> w = su5_weierstrass_model_over_arbitrary_3d_base()
Assuming that the first row of the given grading is the grading under Kbar
Weierstrass model over a not fully specified base
julia> weierstrass_section_g(w);
```
"""
weierstrass_section_g(w::WeierstrassModel) = w.weierstrass_g
#####################################################
# 1.2 Weierstrass polynomial
#####################################################
@doc raw"""
weierstrass_polynomial(w::WeierstrassModel)
Return the Weierstrass polynomial of the Weierstrass model.
```jldoctest
julia> w = su5_weierstrass_model_over_arbitrary_3d_base()
Assuming that the first row of the given grading is the grading under Kbar
Weierstrass model over a not fully specified base
julia> weierstrass_polynomial(w);
```
"""
weierstrass_polynomial(w::WeierstrassModel) = w.weierstrass_polynomial
#####################################################
# 1.3 Base, ambient space and fiber ambient space
#####################################################
@doc raw"""
base_space(w::WeierstrassModel)
Return the base space of the Weierstrass model.
```jldoctest
julia> w = su5_weierstrass_model_over_arbitrary_3d_base()
Weierstrass model over a not fully specified base
julia> base_space(w)
Scheme of a toric variety with fan spanned by RayVector{QQFieldElem}[[1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0], [0, 0, 0, 0, 0, 1], [0, 1, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0], [0, 0, 0, 1, 0, 0]]
"""
function base_space(w::WeierstrassModel)
base_fully_specified(w) || @vprint :WeierstrassModel 1 "Base space was not fully specified. Returning AUXILIARY base space.\n"
return w.base_space
end
@doc raw"""
ambient_space(w::WeierstrassModel)
Return the base space of the Weierstrass model.
```jldoctest
julia> w = su5_weierstrass_model_over_arbitrary_3d_base()
Assuming that the first row of the given grading is the grading under Kbar
Weierstrass model over a not fully specified base
julia> ambient_space(w)
Scheme of a toric variety
```
"""
function ambient_space(w::WeierstrassModel)
base_fully_specified(w) || @vprint :WeierstrassModel 1 "Base space was not fully specified. Returning AUXILIARY ambient space.\n"
return w.ambient_space
end
@doc raw"""
fiber_ambient_space(w::WeierstrassModel)
Return the fiber ambient space of the Weierstrass model.
```jldoctest
julia> w = su5_weierstrass_model_over_arbitrary_3d_base()
Assuming that the first row of the given grading is the grading under Kbar
Weierstrass model over a not fully specified base
julia> fiber_ambient_space(w)
Scheme of a toric variety
```
"""
fiber_ambient_space(w::WeierstrassModel) = w.fiber_ambient_space
###################################################################
###################################################################
# 2: Attributes that currently only works in toric settings
###################################################################
###################################################################
#####################################################
# 2.1 Calabi-Yau hypersurface
#####################################################
@doc raw"""
calabi_yau_hypersurface(w::WeierstrassModel)
Return the Calabi-Yau hypersurface in the toric ambient space
which defines the Weierstrass model.
```jldoctest
julia> w = su5_weierstrass_model_over_arbitrary_3d_base()
Assuming that the first row of the given grading is the grading under Kbar
Weierstrass model over a not fully specified base
julia> calabi_yau_hypersurface(w)
Closed subvariety of a normal toric variety
```
"""
@attr ClosedSubvarietyOfToricVariety function calabi_yau_hypersurface(w::WeierstrassModel)
@req typeof(base_space(w)) <: ToricCoveredScheme "Calabi-Yau hypersurface currently only supported for toric varieties/schemes as base space"
base_fully_specified(w) || @vprint :WeierstrassModel 1 "Base space was not fully specified. Returning hypersurface in AUXILIARY ambient space.\n"
return closed_subvariety_of_toric_variety(underlying_toric_variety(ambient_space(w)), [weierstrass_polynomial(w)])
end
#####################################################
# 2.2 Turn Weierstrass model into Tate model
#####################################################
# Currently no plan to include
#####################################################
# 2.3 Discriminant and singular loci
#####################################################
@doc raw"""
discriminant(w::WeierstrassModel)
Return the discriminant ``\Delta = 4 f^3 + 27 g^2``.
```jldoctest
julia> w = su5_weierstrass_model_over_arbitrary_3d_base()
Assuming that the first row of the given grading is the grading under Kbar
Weierstrass model over a not fully specified base
julia> discriminant(w);
```
"""
@attr MPolyRingElem function discriminant(w::WeierstrassModel)
@req typeof(base_space(w)) <: ToricCoveredScheme "Discriminant of Weierstrass model is currently only supported for toric varieties/schemes as base space"
return 4 * w.weierstrass_f^3 + 27 * w.weierstrass_g^2
end
@doc raw"""
singular_loci(w::WeierstrassModel)
Return the singular loci of the Weierstrass model, along with the order of
vanishing of ``(f, g, \Delta)`` at each locus and the refined Tate fiber type.
For the time being, we either explicitly or implicitly focus on toric varieties
as base spaces. Explicitly, in case the user provides such a variety as base space,
and implicitly, in case we work over a non-fully specified base. This has the
advantage that we can "filter out" trivial singular loci.
Specifically, recall that every closed subvariety of a simplicial toric variety is
of the form ``V(I)``, where ``I`` is a homogeneous ideal of the Cox ring. Let ``B``
be the irrelevant ideal of this toric variety. Then, by proposition 5.2.6. of
[CLS11](@cite), ``V(I)`` is trivial/empty iff ``B^l \subseteq I`` for a suitable ``l \geq 0``.
This can be checked by checking if the saturation ``I:B^\infty`` is the ideal generated by ``1``.
By treating a not-fully specified base space implicitly as toric space, we can extend this
result straightforwardly to this situation also. This is the reason for constructing this
auxiliary base space.
```jldoctest
julia> w = su5_weierstrass_model_over_arbitrary_3d_base()
Assuming that the first row of the given grading is the grading under Kbar
Weierstrass model over a not fully specified base
julia> length(singular_loci(w))
2
```
"""
@attr Vector{<:Tuple{<:MPolyIdeal{<:MPolyRingElem}, Tuple{Int64, Int64, Int64}, String}} function singular_loci(w::WeierstrassModel)
@req typeof(base_space(w)) <: ToricCoveredScheme "Singular loci of Weierstrass model is currently only supported for toric varieties/schemes as base space"
B = irrelevant_ideal(base_space(w))
d_primes = primary_decomposition(ideal([discriminant(w)]))
nontrivial_d_primes = Tuple{<:MPolyIdeal{<:MPolyRingElem}, <:MPolyIdeal{<:MPolyRingElem}}[]
for k in 1:length(d_primes)
if _is_nontrivial(d_primes[k][2], B)
push!(nontrivial_d_primes, d_primes[k])
end
end
f_primes = primary_decomposition(ideal([weierstrass_section_f(w)]))
g_primes = primary_decomposition(ideal([weierstrass_section_g(w)]))
kodaira_types = Tuple{<:MPolyIdeal{<:MPolyRingElem}, Tuple{Int64, Int64, Int64}, String}[]
for d_prime in nontrivial_d_primes
f_index = findfirst(fp -> fp[2] == d_prime[2], f_primes)
g_index = findfirst(gp -> gp[2] == d_prime[2], g_primes)
f_order = !isnothing(f_index) ? saturation_with_index(f_primes[f_index][1], d_prime[2])[2] : 0
g_order = !isnothing(g_index) ? saturation_with_index(g_primes[g_index][1], d_prime[2])[2] : 0
d_order = saturation_with_index(d_prime[1], d_prime[2])[2]
ords = (f_order, g_order, d_order)
push!(kodaira_types, (d_prime[2], ords, _kodaira_type(d_prime[2], weierstrass_section_f(w), weierstrass_section_g(w), discriminant(w), ords)))
end
return kodaira_types
end