-
Notifications
You must be signed in to change notification settings - Fork 120
/
ReesAlgebra.jl
164 lines (145 loc) · 5.77 KB
/
ReesAlgebra.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
########################################################################
# Rees algebras of modules
#
# Following Eisenbud, Huneke, Ulrich: "What is the Rees algebra
# of a module?"; arXiv:math/0209187v1
########################################################################
@doc raw"""
rees_algebra(f::ModuleFPHom{<:ModuleFP, <:FreeMod}; check::Bool=true)
For a *versal* [^1] morphism ``f : M → F`` of a module ``M`` into a free
module ``F`` this computes the Rees algebra of ``M`` according to
[EHU03](@cite)[^2].
!!! note If `check` is set to `true`, the method will check the sufficient
criterion "``fᵀ : F* → M*`` surjective" to verify that ``f`` is versal.
Since no general criterion is known, this will abort with an error message
in the non-affirmative case.
[^1]: A morphism of ``M`` into a free module ``F`` as above is called versal if any other morphism ``g : M → F'`` from ``M`` to another free module ``F'`` factors through ``f``.
[^2]: See arXiv:math/0209187v1 for a free version.
"""
function rees_algebra(f::ModuleFPHom{<:ModuleFP, <:FreeMod, Nothing};
check::Bool=true,
var_names::Vector{String}=["s$i" for i in 0:ngens(domain(f))-1]
)
if check
f_dual = dual(f)
is_surjective(f_dual) || error("it can not be verified that the map is versal")
end
M = domain(f)
R = base_ring(M)
F = codomain(f)
R === base_ring(F) || error("modules must be defined over the same ring")
P = presentation(M)::ComplexOfMorphisms
p = map(P, 0)
FM = P[0]
r = rank(FM)
r == length(var_names) || error("wrong number of variable names given")
sym_FM, s = polynomial_ring(R, Symbol.(var_names))
sym_F, t = polynomial_ring(R, [Symbol("t$i") for i in 1:rank(F)])
imgs = Vector{elem_type(sym_F)}()
for v in gens(FM)
w = coordinates(f(p(v)))
push!(imgs, sum(w[i]*t[i] for i in 1:length(t)))
end
sym_g = hom(sym_FM, sym_F, imgs)
K = kernel(sym_g)
rees, _ = quo(sym_FM, K)
return rees
end
function rees_algebra(M::FreeMod;
var_names::Vector{String}=["s$i" for i in 0:ngens(M)-1]
)
R = base_ring(M)
r = rank(M)
S, s = polynomial_ring(R, Symbol.(var_names))
return S
end
function rees_algebra(M::SubquoModule;
var_names::Vector{String}=["s$i" for i in 0:ngens(M)-1],
check::Bool=true
)
success, p, sigma = is_projective(M)
if success
# The easy case: The Rees algebra is simply a polynomial ring
# modulo linear equations in the variables parametrized by the base.
R = base_ring(M)
r = ngens(M)
S, s = polynomial_ring(R, Symbol.(var_names))
A = matrix(compose(sigma, p)) # The projector matrix:
# M is a direct summand of a free module via p : F ↔ M : sigma.
# Hence, the composition sigma ∘ p is the internal projection
# of F onto M as a direct summand.
#
# For a point x ∈ Spec(R) one has A(x) a matrix with entries in a field 𝕜
# Its span is the subspace M(x) ⊂ 𝕜ʳ, the fiber of M at x.
# Polynomial functions on that fiber are polynomial functions
# on 𝕜ⁿ in variables s₀,…,sᵣ₋₁, but restricted to M(x). Hence, we
# can calculate modulo the ideal generated by linear forms
# l = a₁s₁ + … + aᵣ₋₁sᵣ₋₁ vanishing on M(x).
#
# Since A(x) is a projector (A² = A), we find that the span M(x)
# is annihilated by the matrix B = 1 - A and that the columns of B
# generate that ideal.
B = one(A) - A
I = ideal(S, [sum(B[j, i]*s[j] for j in 1:length(s)) for i in 1:ncols(B)])
Q, sq = quo(S, I)
return Q
end
# The complicated case. We construct a versal morphism f : M → F to a
# free module along the lines of Proposition 1.3 of [1] (in its published version).
return rees_algebra(_versal_morphism_to_free_module(M), check=false)
end
### Auxiliary methods needed for the Rees algebras
### The following function is implemented along the lines of Proposition 1.3 of [1] in
# its published version.
function _versal_morphism_to_free_module(M::SubquoModule)
R = base_ring(M)
R1 = FreeMod(R, 1)
M_double_dual, psi = double_dual(M, codomain=R1)
M_dual = domain(element_to_homomorphism(zero(M_double_dual)))
pres_M_dual = presentation(M_dual)::ComplexOfMorphisms
g = map(pres_M_dual, 0) # The projection of a free module onto M_dual
g_dual = dual(g, codomain=R1, codomain_dual=M_double_dual)
return compose(psi, g_dual)
end
function is_isomorphism(f::ModuleFPHom)
return is_injective(f) && is_surjective(f)
end
### Auxiliary deflections for MPolyQuos to make arithmetic work in the Rees algebras
function simplify!(
a::MPolyQuoRingElem{AbstractAlgebra.Generic.MPoly{T}}
) where {T<:Union{<:MPolyRingElem, <:MPolyQuoRingElem,
<:MPolyLocRingElem,
<:MPolyQuoLocRingElem}
}
return a
end
function iszero(
a::MPolyQuoRingElem{AbstractAlgebra.Generic.MPoly{T}}
) where {T<:Union{<:MPolyRingElem, <:MPolyQuoRingElem,
<:MPolyLocRingElem,
<:MPolyQuoLocRingElem}
}
phi = flatten(base_ring(parent(a)))
I = phi(modulus(parent(a)))
return phi(lift(a)) in I
end
function isone(
a::MPolyQuoRingElem{AbstractAlgebra.Generic.MPoly{T}}
) where {T<:Union{<:MPolyRingElem, <:MPolyQuoRingElem,
<:MPolyLocRingElem,
<:MPolyQuoLocRingElem}
}
phi = flatten(base_ring(parent(a)))
I = phi(modulus(parent(a)))
return phi(lift(a) - one(domain(phi))) in I
end
function ==(a::MPolyQuoRingElem{AbstractAlgebra.Generic.MPoly{T}},
b::MPolyQuoRingElem{AbstractAlgebra.Generic.MPoly{T}}
) where {T<:Union{<:MPolyRingElem, <:MPolyQuoRingElem,
<:MPolyLocRingElem,
<:MPolyQuoLocRingElem}
}
phi = flatten(base_ring(parent(a)))
I = phi(modulus(parent(a)))
return phi(lift(a) - lift(b)) in I
end