diff --git a/docs/src/AlgebraicGeometry/Schemes/AffineSchemes.md b/docs/src/AlgebraicGeometry/Schemes/AffineSchemes.md index d9b691894353..3b319b4fa80c 100644 --- a/docs/src/AlgebraicGeometry/Schemes/AffineSchemes.md +++ b/docs/src/AlgebraicGeometry/Schemes/AffineSchemes.md @@ -17,7 +17,7 @@ defined over the integers, a finite field or algebraic field extensions of ``\ma ### General constructors -Besides `Spec(R)` for `R` of either one of the types `MPolyRing`, `MPolyQuoRing`, `MPolyLocRing`, or +Besides `Spec(R)` for `R` of either one of the types `MPolyRing`, `MPolyQuoRing`, `MPolyLocRing`, or `MPolyQuoLocRing`, we have the following constructors: ```@docs Spec(R::MPolyRing, I::MPolyIdeal) @@ -90,7 +90,7 @@ OO(X::AbsSpec) ### Type getters We support functions which return the types of -schemes, associated rings, and their elements. See the +schemes, associated rings, and their elements. See the source code for details. @@ -100,7 +100,7 @@ source code for details. is_open_embedding(X::AbsSpec, Y::AbsSpec) is_closed_embedding(X::AbsSpec, Y::AbsSpec) isempty(X::AbsSpec) -issubset(X::AbsSpec, Y::AbsSpec) +is_subscheme(X::AbsSpec, Y::AbsSpec) ``` diff --git a/experimental/Schemes/CoherentSheaves.jl b/experimental/Schemes/CoherentSheaves.jl index 355f3c9b599f..715fcb4b19fb 100644 --- a/experimental/Schemes/CoherentSheaves.jl +++ b/experimental/Schemes/CoherentSheaves.jl @@ -16,7 +16,7 @@ abstract type AbsCoherentSheaf{ } <: AbsPreSheaf{ SpaceType, OpenType, OutputType, RestrictionType - } + } end ### Interface for coherent sheaves @@ -29,11 +29,11 @@ Return the scheme on which this sheaf is defined. scheme(F::AbsCoherentSheaf) = space(underlying_presheaf(F)) @doc raw""" - sheaf_of_rings(F::AbsCoherentSheaf) + sheaf_of_rings(F::AbsCoherentSheaf) Return the sheaf of rings over which ``ℱ`` is defined. """ -function sheaf_of_rings(F::AbsCoherentSheaf) +function sheaf_of_rings(F::AbsCoherentSheaf) error("method not implemented for coherent sheaves of type $(typeof(F))") end @@ -44,7 +44,7 @@ function Base.show(io::IO, ::MIME"text/plain", M::AbsCoherentSheaf) io = pretty(io) X = scheme(M) cov = default_covering(X) - D = M.ID + D = M.ID print(io, "Coherent sheaf of modules") if has_attribute(M, :name) print(io, " ", get_attribute(M, :name)) @@ -84,7 +84,7 @@ function Base.show(io::IO, M::AbsCoherentSheaf) end -### The following provides a function for the internal checks that +### The following provides a function for the internal checks that # a given set U is open in and admissible for sheaves of modules on X. # # We allow the following cases: @@ -127,13 +127,13 @@ function _is_open_for_modules(X::AbsCoveredScheme) any(x->x===U, affine_charts(X)) || return false any(x->x===V, affine_charts(X)) || return false G = default_covering(X)[U, V] - return issubset(U, gluing_domains(G)[1]) + return is_subscheme(U, gluing_domains(G)[1]) end function is_open_func( U::AbsSpec, V::Union{<:PrincipalOpenSubset, <:SimplifiedSpec} ) - issubset(U, V) && return true + is_subscheme(U, V) && return true any(x->x===U, affine_charts(X)) || return false inc_V_flat = _flatten_open_subscheme(V, default_covering(X)) A = ambient_scheme(codomain(inc_V_flat)) @@ -146,7 +146,7 @@ function _is_open_for_modules(X::AbsCoveredScheme) return is_subset(U, pre_V) end function is_open_func( - U::Union{<:PrincipalOpenSubset, <:SimplifiedSpec}, + U::Union{<:PrincipalOpenSubset, <:SimplifiedSpec}, V::AbsSpec ) any(x->x===V, affine_charts(X)) || return false @@ -178,7 +178,7 @@ to the following: One can call the restriction maps of ``ℳ`` across charts implicitly using the identifications given by the gluings in the `default_covering`. """ -@attributes mutable struct SheafOfModules{SpaceType, OpenType, +@attributes mutable struct SheafOfModules{SpaceType, OpenType, OutputType, RestrictionType } <: AbsCoherentSheaf{ @@ -188,18 +188,18 @@ identifications given by the gluings in the `default_covering`. ID::IdDict{AbsSpec, ModuleFP} # the modules on the basic patches of the default covering OOX::StructureSheafOfRings # the structure sheaf on X M::PreSheafOnScheme # the underlying presheaf of modules for caching - C::Covering # The covering of X on which the modules had first been described, a.k.a. the + C::Covering # The covering of X on which the modules had first been described, a.k.a. the # `default_covering` of this sheaf ℱ. ### Sheaves of modules on covered schemes - function SheafOfModules(X::AbsCoveredScheme, + function SheafOfModules(X::AbsCoveredScheme, MD::IdDict{AbsSpec, ModuleFP}, # A dictionary of modules on the `affine_charts` of `X` - MG::IdDict{Tuple{AbsSpec, AbsSpec}, MatrixElem}; # A dictionary for pairs `(U, V)` of - # `affine_charts` of `X` such that - # A = MG[(U, V)] has entries aᵢⱼ with - # gᵢ = ∑ⱼ aᵢⱼ ⋅ fⱼ on U ∩ V with gᵢ the + MG::IdDict{Tuple{AbsSpec, AbsSpec}, MatrixElem}; # A dictionary for pairs `(U, V)` of + # `affine_charts` of `X` such that + # A = MG[(U, V)] has entries aᵢⱼ with + # gᵢ = ∑ⱼ aᵢⱼ ⋅ fⱼ on U ∩ V with gᵢ the # restrictions of the generators of M[U] - # and fⱼ the restrictions of the generators + # and fⱼ the restrictions of the generators # of MD[V]. The aᵢⱼ are elements of 𝒪(U ∩ V) # represented as a subset of V. check::Bool=true, @@ -212,8 +212,8 @@ identifications given by the gluings in the `default_covering`. end ) OOX = OO(X) - # Make sure that all patches and gluings of the - # given `default_covering` of the sheaf ℱ to be created + # Make sure that all patches and gluings of the + # given `default_covering` of the sheaf ℱ to be created # are compatible with the data in the dictionaries. all(x->haskey(MD, x), patches(default_cov)) || error("all patches in the default covering must have a prescribed module") all(x->any(y->(x===y), patches(default_cov)), keys(MD)) || error("all prescribed modules must appear in the default covering") @@ -222,16 +222,16 @@ identifications given by the gluings in the `default_covering`. ### Lookup and production pattern for sheaves of modules # - # When asked to produce a module on an open affine U, the functions + # When asked to produce a module on an open affine U, the functions # below lead to the following behaviour. # # U₁ an `affine_chart` of `X` # _________/|\______________ (`patches` of `default_covering(X)`) - # / | \ - # V₁ V₂______ | two `PrincipalOpenSubset`s of U₁ + # / | \ + # V₁ V₂______ | two `PrincipalOpenSubset`s of U₁ # /|\ /|\ \ | covering the latter - # / | \ / | \ | | - # W₁ W₂ W₃ A₁ A₂ A₃ C₁ D₁ `PrincipalOpenSubset`s of, respectively, + # / | \ / | \ | | + # W₁ W₂ W₃ A₁ A₂ A₃ C₁ D₁ `PrincipalOpenSubset`s of, respectively, # | V₁, V₂, and U₁ # | # E @@ -241,39 +241,39 @@ identifications given by the gluings in the `default_covering`. # Suppose the patches of the `default_covering` of ℱ (i.e. now the local variable # `default_cov`) are V₁ together with A₁, A₂, and A₃. # - # 1) Look up whether U is in the list of patches of `default_cov`, e.g. U = V₁ + # 1) Look up whether U is in the list of patches of `default_cov`, e.g. U = V₁ # or U = A₂. If yes, return the value of the dictionary. # - # 2) See whether U hangs below some V in the ancestry tree with V + # 2) See whether U hangs below some V in the ancestry tree with V # in `default_cov`; e.g. U = E or U = W₃. If yes, restrict from V. # - # 3) Otherwise, U is covered by patches {Aᵢ}, i ∈ I, from `default_cov` and - # contained in one affine chart U₁ of X + # 3) Otherwise, U is covered by patches {Aᵢ}, i ∈ I, from `default_cov` and + # contained in one affine chart U₁ of X # U₁ ⊃ U ⊃ Aᵢ. - # We distinguish two sub-cases. + # We distinguish two sub-cases. # - # 3.1) U appears in the refinement tree T of W whose leafs consist - # entirely of the Aᵢs and the latter cover U. For instance, this - # could be the case for U = V₂ with the Aᵢ covering it. - # Let T' be the subtree starting from U and let {Aⱼ}, j ∈ J be the - # leafs of this subtree. We then recursively build up the modules on - # the nodes in T'. Note that this requires some further obvious - # covering properties on the subtree T'. + # 3.1) U appears in the refinement tree T of W whose leafs consist + # entirely of the Aᵢs and the latter cover U. For instance, this + # could be the case for U = V₂ with the Aᵢ covering it. + # Let T' be the subtree starting from U and let {Aⱼ}, j ∈ J be the + # leafs of this subtree. We then recursively build up the modules on + # the nodes in T'. Note that this requires some further obvious + # covering properties on the subtree T'. # - # 3.2) U does not appear in the refinement tree T above; e.g. - # when U = C₁ or U = D₁. Then we first have to build the module on - # U₁ and restrict from there. + # 3.2) U does not appear in the refinement tree T above; e.g. + # when U = C₁ or U = D₁. Then we first have to build the module on + # U₁ and restrict from there. # - # The point 3) is not implemented, yet. Instead, the current code - # requires to take refinements hanging under nodes in `default_cov`. + # The point 3) is not implemented, yet. Instead, the current code + # requires to take refinements hanging under nodes in `default_cov`. ### Production of the modules on open sets; to be cached function production_func( F::AbsPreSheaf, U::AbsSpec ) - # Since the other cases are caught by the methods below, - # U can only be an affine_chart of X. + # Since the other cases are caught by the methods below, + # U can only be an affine_chart of X. # # See whether we have anything cached for U haskey(MD, U) && return MD[U] @@ -289,7 +289,7 @@ identifications given by the gluings in the `default_covering`. # Check whether we can directly produce the module haskey(MD, U) && return MD[U] - # If not: See whether we are below a prescribed module in the + # If not: See whether we are below a prescribed module in the # refinement tree if has_ancestor(x->haskey(MD, x), U) V = ambient_scheme(U) @@ -310,7 +310,7 @@ identifications given by the gluings in the `default_covering`. # Check whether we can directly produce the module haskey(MD, U) && return MD[U] - # If not: See whether we are below a prescribed module in the + # If not: See whether we are below a prescribed module in the # refinement tree if has_ancestor(x->haskey(MD, x), U) V = original(U) @@ -326,14 +326,14 @@ identifications given by the gluings in the `default_covering`. ### Production of the restriction maps; to be cached function restriction_func(F::AbsPreSheaf, V::AbsSpec, U::AbsSpec) - # Since the other cases are caught by the methods below, both U and V + # Since the other cases are caught by the methods below, both U and V # must be `affine_chart`s of X with U contained in V along some gluing. if any(W->(W === U), affine_charts(X)) && any(W->(W === V), affine_charts(X)) MV = F(V) MU = F(U) A = MG[(V, U)] # The transition matrix UU, _ = gluing_domains(default_covering(X)[U, V]) - psi = OOX(UU, U) # Needs to exist by the checks of is_open_func, even though + psi = OOX(UU, U) # Needs to exist by the checks of is_open_func, even though # in general UU ⊂ U! return hom(MV, MU, [sum([psi(A[i, j]) * MU[j] for j in 1:ngens(MU)], init=zero(MU)) for i in 1:ngens(MV)], OOX(V, U)) else @@ -342,12 +342,12 @@ identifications given by the gluings in the `default_covering`. end function restriction_func(F::AbsPreSheaf, V::AbsSpec, U::PrincipalOpenSubset) - # If V was not an affine_chart of X, some other function would have - # been triggered. + # If V was not an affine_chart of X, some other function would have + # been triggered. # First the easy case: Inheritance from an ancestor in the tree. if ambient_scheme(U) === V - # If the restriction was more complicated than what follows, then + # If the restriction was more complicated than what follows, then # it would have been cached earlier and this call would not have happened # This is the end of the recursion induced in the next elseif below. res = hom(F(V), F(U), gens(F(U)), OOX(W, U)) @@ -361,26 +361,26 @@ identifications given by the gluings in the `default_covering`. W = __find_chart(U, default_covering(X)) A = MG[(V, W)] # The transition matrix WW, _ = gluing_domains(default_covering(X)[W, V]) - # From W to U (and hence also from WW to U) the generators of the modules - # in F might have changed. Thus, we have to expect a non-trivial transition - # from the top-level down to U. The transition matrix A is only given with + # From W to U (and hence also from WW to U) the generators of the modules + # in F might have changed. Thus, we have to expect a non-trivial transition + # from the top-level down to U. The transition matrix A is only given with # respect to the generators of F(W), so we have to map them manually down. # The call to F(W, U) will be handled by the above if-clauses. - return hom(F(V), F(U), - [sum([OOX(WW, U)(A[i, j])*F(W, U)(F(W)[j]) for j in 1:ngens(F(W))], init=zero(F(U))) - for i in 1:ngens(F(V))], + return hom(F(V), F(U), + [sum([OOX(WW, U)(A[i, j])*F(W, U)(F(W)[j]) for j in 1:ngens(F(W))], init=zero(F(U))) + for i in 1:ngens(F(V))], OOX(V, U) ) end function restriction_func(F::AbsPreSheaf, V::AbsSpec, U::SimplifiedSpec) - # If V was not an affine_chart of X, some other function would have - # been triggered. + # If V was not an affine_chart of X, some other function would have + # been triggered. @assert any(x->x===V, affine_charts(X)) "first argument must be an affine chart" # First the easy case: Inheritance from an ancestor in the tree. if original(U) === V - # If the restriction was more complicated than what follows, then + # If the restriction was more complicated than what follows, then # it would have been cached earlier and this call would not have happened # This is the end of the recursion induced in the next elseif below. W = original(U) @@ -395,27 +395,27 @@ identifications given by the gluings in the `default_covering`. W = __find_chart(U, default_covering(X)) A = MG[(V, W)] # The transition matrix WW, _ = gluing_domains(default_covering(X)[W, V]) - # From W to U (and hence also from WW to U) the generators of the modules - # in F might have changed. Thus, we have to expect a non-trivial transition - # from the top-level down to U. The transition matrix A is only given with + # From W to U (and hence also from WW to U) the generators of the modules + # in F might have changed. Thus, we have to expect a non-trivial transition + # from the top-level down to U. The transition matrix A is only given with # respect to the generators of F(W), so we have to map them manually down. # The call to F(W, U) will be handled by the above if-clauses. - return hom(F(V), F(U), + return hom(F(V), F(U), [sum([OOX(WW, U)(A[i, j])*F(W, U)(F(W)[j]) for j in 1:ngens(F(W))], init=zero(F(U))) - for i in 1:ngens(F(V))], + for i in 1:ngens(F(V))], OOX(V, U) ) end - function restriction_func(F::AbsPreSheaf, - V::Union{<:PrincipalOpenSubset, <:SimplifiedSpec}, + function restriction_func(F::AbsPreSheaf, + V::Union{<:PrincipalOpenSubset, <:SimplifiedSpec}, U::AbsSpec ) # We know that V can not be an ancestor of U, but U must be an affine chart. - # Probably even an ancestor of V itself. + # Probably even an ancestor of V itself. W = __find_chart(V, default_covering(X)) if W === U - # U and V must actually be isomorphic, but the modules of F might be - # represented in different ways. We have to construct the inverse of + # U and V must actually be isomorphic, but the modules of F might be + # represented in different ways. We have to construct the inverse of # the restriction map from U to V. gens_U = F(U, V).(gens(F(U))) M, inc = sub(F(V), gens_U) @@ -429,13 +429,13 @@ identifications given by the gluings in the `default_covering`. end return hom(F(V), F(U), img_gens, OOX(V, U)) else - # U must be properly contained in the gluing domains of the + # U must be properly contained in the gluing domains of the # gluing of the affine chart of V with U. error("case not implemented") end - # Problem: We can assume that we know how to pass from generators - # of W = __find_chart(V, default_covering(X)) to those on V, but we do not - # know the inverse to this. But the transition matrix to U is given + # Problem: We can assume that we know how to pass from generators + # of W = __find_chart(V, default_covering(X)) to those on V, but we do not + # know the inverse to this. But the transition matrix to U is given # with respect to the generators on W. error("case not implemented") end @@ -449,7 +449,7 @@ identifications given by the gluings in the `default_covering`. return compose(F(V, W), F(W, U)) end - # Below follow the more complicated cases. + # Below follow the more complicated cases. success, _ = _have_common_ancestor(U, V) if success W = __find_chart(U, default_covering(X)) @@ -460,7 +460,7 @@ identifications given by the gluings in the `default_covering`. for v in gens(F(V)) w = preimage(inc, v) # We know that inc is actually an isomorphism c = coordinates(w) - w = sum(OOX(V, U)(c[i])*gens_U[i] + w = sum(OOX(V, U)(c[i])*gens_U[i] for i in 1:length(gens_U) ) push!(img_gens, w) @@ -477,11 +477,11 @@ identifications given by the gluings in the `default_covering`. WV = ambient_scheme(V_flat) WU = __find_chart(U, default_covering(X)) WV = __find_chart(V, default_covering(X)) - # The problem is: The generators of F(WU) may be different from - # those of F(U) and similarly for V. But the transition matrices - # are only described for those on WU and WV. Thus we need to - # implicitly do a base change. This is done by forwarding the generators - # of F(WU) to F(U) and expressing it in terms of the generators there. + # The problem is: The generators of F(WU) may be different from + # those of F(U) and similarly for V. But the transition matrices + # are only described for those on WU and WV. Thus we need to + # implicitly do a base change. This is done by forwarding the generators + # of F(WU) to F(U) and expressing it in terms of the generators there. gens_U = F(WU, U).(gens(F(WU))) # This will be caught by the preceding clauses gens_V = F(WV, V).(gens(F(WV))) sub_V, inc = sub(F(V), gens_V) @@ -491,8 +491,8 @@ identifications given by the gluings in the `default_covering`. for v in gens(F(V)) w = preimage(inc, v) # We know that inc is actually an isomorphism c = coordinates(w) - w = sum(sum(OOX(V, U)(c[i])*OOX(WW, U)(A[i, j])*gens_U[j] - for i in 1:length(gens_V)) + w = sum(sum(OOX(V, U)(c[i])*OOX(WW, U)(A[i, j])*gens_U[j] + for i in 1:length(gens_V)) for j in 1:length(gens_U) ) push!(img_gens, w) @@ -507,7 +507,7 @@ identifications given by the gluings in the `default_covering`. return compose(F(V, W), F(W, U)) end - # Below follow the more complicated cases. + # Below follow the more complicated cases. success, _ = _have_common_ancestor(U, V) if success W = __find_chart(U, default_covering(X)) @@ -518,7 +518,7 @@ identifications given by the gluings in the `default_covering`. for v in gens(F(V)) w = preimage(inc, v) # We know that inc is actually an isomorphism c = coordinates(w) - w = sum(OOX(V, U)(c[i])*gens_U[i] + w = sum(OOX(V, U)(c[i])*gens_U[i] for i in 1:length(gens_U) ) push!(img_gens, w) @@ -535,11 +535,11 @@ identifications given by the gluings in the `default_covering`. WV = ambient_scheme(V_flat) WU = __find_chart(U, default_covering(X)) WV = __find_chart(V, default_covering(X)) - # The problem is: The generators of F(WU) may be different from - # those of F(U) and similarly for V. But the transition matrices - # are only described for those on WU and WV. Thus we need to - # implicitly do a base change. This is done by forwarding the generators - # of F(WU) to F(U) and expressing it in terms of the generators there. + # The problem is: The generators of F(WU) may be different from + # those of F(U) and similarly for V. But the transition matrices + # are only described for those on WU and WV. Thus we need to + # implicitly do a base change. This is done by forwarding the generators + # of F(WU) to F(U) and expressing it in terms of the generators there. gens_U = F(WU, U).(gens(F(WU))) # This will be caught by the preceding clauses gens_V = F(WV, V).(gens(F(WV))) sub_V, inc = sub(F(V), gens_V) @@ -549,8 +549,8 @@ identifications given by the gluings in the `default_covering`. for v in gens(F(V)) w = preimage(inc, v) # We know that inc is actually an isomorphism c = coordinates(w) - w = sum(sum(OOX(V, U)(c[i])*OOX(WW, U)(A[i, j])*gens_U[j] - for i in 1:length(gens_V)) + w = sum(sum(OOX(V, U)(c[i])*OOX(WW, U)(A[i, j])*gens_U[j] + for i in 1:length(gens_V)) for j in 1:length(gens_U) ) push!(img_gens, w) @@ -565,7 +565,7 @@ identifications given by the gluings in the `default_covering`. return compose(F(V, W), F(W, U)) end - # Below follow the more complicated cases. + # Below follow the more complicated cases. success, _ = _have_common_ancestor(U, V) if success W = __find_chart(U, default_covering(X)) @@ -576,7 +576,7 @@ identifications given by the gluings in the `default_covering`. for v in gens(F(V)) w = preimage(inc, v) # We know that inc is actually an isomorphism c = coordinates(w) - w = sum(OOX(V, U)(c[i])*gens_U[i] + w = sum(OOX(V, U)(c[i])*gens_U[i] for i in 1:length(gens_U) ) push!(img_gens, w) @@ -593,11 +593,11 @@ identifications given by the gluings in the `default_covering`. WV = ambient_scheme(V_flat) WU = __find_chart(U, default_covering(X)) WV = __find_chart(V, default_covering(X)) - # The problem is: The generators of F(WU) may be different from - # those of F(U) and similarly for V. But the transition matrices - # are only described for those on WU and WV. Thus we need to - # implicitly do a base change. This is done by forwarding the generators - # of F(WU) to F(U) and expressing it in terms of the generators there. + # The problem is: The generators of F(WU) may be different from + # those of F(U) and similarly for V. But the transition matrices + # are only described for those on WU and WV. Thus we need to + # implicitly do a base change. This is done by forwarding the generators + # of F(WU) to F(U) and expressing it in terms of the generators there. gens_U = F(WU, U).(gens(F(WU))) # This will be caught by the preceding clauses gens_V = F(WV, V).(gens(F(WV))) sub_V, inc = sub(F(V), gens_V) @@ -607,8 +607,8 @@ identifications given by the gluings in the `default_covering`. for v in gens(F(V)) w = preimage(inc, v) # We know that inc is actually an isomorphism c = coordinates(w) - w = sum(sum(OOX(V, U)(c[i])*OOX(WW, U)(A[i, j])*gens_U[j] - for i in 1:length(gens_V)) + w = sum(sum(OOX(V, U)(c[i])*OOX(WW, U)(A[i, j])*gens_U[j] + for i in 1:length(gens_V)) for j in 1:length(gens_U) ) push!(img_gens, w) @@ -625,7 +625,7 @@ identifications given by the gluings in the `default_covering`. return compose(F(V, W), F(W, U)) end - # Below follow the more complicated cases. + # Below follow the more complicated cases. success, _ = _have_common_ancestor(U, V) if success W = __find_chart(U, default_covering(X)) @@ -636,7 +636,7 @@ identifications given by the gluings in the `default_covering`. for v in gens(F(V)) w = preimage(inc, v) # We know that inc is actually an isomorphism c = coordinates(w) - w = sum(OOX(V, U)(c[i])*gens_U[i] + w = sum(OOX(V, U)(c[i])*gens_U[i] for i in 1:length(gens_U) ) push!(img_gens, w) @@ -653,11 +653,11 @@ identifications given by the gluings in the `default_covering`. WV = ambient_scheme(V_flat) WU = __find_chart(U, default_covering(X)) WV = __find_chart(V, default_covering(X)) - # The problem is: The generators of F(WU) may be different from - # those of F(U) and similarly for V. But the transition matrices - # are only described for those on WU and WV. Thus we need to - # implicitly do a base change. This is done by forwarding the generators - # of F(WU) to F(U) and expressing it in terms of the generators there. + # The problem is: The generators of F(WU) may be different from + # those of F(U) and similarly for V. But the transition matrices + # are only described for those on WU and WV. Thus we need to + # implicitly do a base change. This is done by forwarding the generators + # of F(WU) to F(U) and expressing it in terms of the generators there. gens_U = F(WU, U).(gens(F(WU))) # This will be caught by the preceding clauses gens_V = F(WV, V).(gens(F(WV))) sub_V, inc = sub(F(V), gens_V) @@ -667,8 +667,8 @@ identifications given by the gluings in the `default_covering`. for v in gens(F(V)) w = preimage(inc, v) # We know that inc is actually an isomorphism c = coordinates(w) - w = sum(sum(OOX(V, U)(c[i])*OOX(WW, U)(A[i, j])*gens_U[j] - for i in 1:length(gens_V)) + w = sum(sum(OOX(V, U)(c[i])*OOX(WW, U)(A[i, j])*gens_U[j] + for i in 1:length(gens_V)) for j in 1:length(gens_U) ) push!(img_gens, w) @@ -704,7 +704,7 @@ restrictions_dict(M::SheafOfModules) = M.ID @doc raw""" twisting_sheaf(IP::AbsProjectiveScheme{<:Field}, d::Int) -For a `ProjectiveScheme` ``ℙ`` return the ``d``-th twisting sheaf +For a `ProjectiveScheme` ``ℙ`` return the ``d``-th twisting sheaf ``𝒪(d)`` as a `CoherentSheaf` on ``ℙ``. # Examples @@ -796,7 +796,7 @@ end @doc raw""" cotangent_sheaf(X::AbsCoveredScheme) -For an `AbsCoveredScheme` ``X``, return the sheaf ``Ω¹(X)`` of Kaehler-differentials +For an `AbsCoveredScheme` ``X``, return the sheaf ``Ω¹(X)`` of Kaehler-differentials on ``X`` as a `CoherentSheaf`. """ @@ -863,17 +863,17 @@ end ######################################################################## # Hom-Sheaves # ######################################################################## -#= - Hom sheaves ℋom(ℱ, 𝒢) are special. +#= + Hom sheaves ℋom(ℱ, 𝒢) are special. - First of all, they can be made completely lazy, as their modules + First of all, they can be made completely lazy, as their modules on U ⊂ X can be created from ℱ(U) and 𝒢(U) on the fly and the same holds for their transition- and restriction functions. - Second, Hom sheaves come with a domain, a codomain, and an + Second, Hom sheaves come with a domain, a codomain, and an interpretation mapping of their sections as homomorphisms. - We realize hom sheaves in this way, taking only ℱ and 𝒢 as input + We realize hom sheaves in this way, taking only ℱ and 𝒢 as input in the constructor. =# @@ -906,8 +906,8 @@ end cod_res = G(V, U) f = gens(F(V)) rf = dom_res.(f) - # The following two lines will work, because a set of generators for ℱ(V) - # always restricts to a set of generators for ℱ(U). Due to changes of + # The following two lines will work, because a set of generators for ℱ(V) + # always restricts to a set of generators for ℱ(U). Due to changes of # charts, this might be a non-trivial change of bases, however. dom_sub, inc = sub(F(U), rf) B = [coordinates(e, dom_sub) for e in ambient_representatives_generators(F(U))] @@ -921,7 +921,7 @@ end return hom(MV, MU, images, OOX(V, U)) # TODO: Set check=false? end - + Mpre = PreSheafOnScheme(X, production_func, restriction_func, OpenType=AbsSpec, OutputType=ModuleFP, RestrictionType=Map, @@ -964,7 +964,7 @@ codomain(M::HomSheaf) = M.codomain function production_func(FF::AbsPreSheaf, U::AbsSpec) result, inc, pr = direct_sum([F(U) for F in summands]..., task=:both) set_attribute!(result, :inclusions, inc) # TODO: Workaround as long as the maps are not cached. - set_attribute!(result, :projections, pr) + set_attribute!(result, :projections, pr) return result end @@ -975,17 +975,17 @@ codomain(M::HomSheaf) = M.codomain pr_V = get_attribute(MV, :projections)::Vector inc_U = get_attribute(MU, :inclusions)::Vector pr_U = get_attribute(MU, :projections)::Vector - + parts = [] # TODO: Can we do better with type annotation? for i in 1:length(inc_V) - push!(parts, hom(MV, MU, + push!(parts, hom(MV, MU, inc_U[i].(summands[i](V, U).(pr_V[i].(gens(MV)))), OOX(V, U) )) end return sum(parts) end - + Mpre = PreSheafOnScheme(X, production_func, restriction_func, OpenType=AbsSpec, OutputType=ModuleFP, RestrictionType=Map, @@ -1028,7 +1028,7 @@ end @doc raw""" free_module(R::StructureSheafOfRings, n::Int) -Return the sheaf of free ``𝒪``-modules ``𝒪ⁿ`` for a structure +Return the sheaf of free ``𝒪``-modules ``𝒪ⁿ`` for a structure sheaf of rings ``𝒪 = R``. """ function free_module(R::StructureSheafOfRings, n::Int) @@ -1063,7 +1063,7 @@ end @doc raw""" dual(M::SheafOfModules) -For a `SheafOfModules` ``ℳ`` on an `AbsCoveredScheme` ``X``, return +For a `SheafOfModules` ``ℳ`` on an `AbsCoveredScheme` ``X``, return the ``𝒪_X``-dual ``ℋ om_{𝒪_X}(ℳ , 𝒪_X)`` of ``ℳ``. """ @attr function dual(M::SheafOfModules) @@ -1086,15 +1086,15 @@ end ######################################################################## #= -# Let f : X ↪ Y be a closed embedding with ideal sheaf ℐ on Y and ℳ -# a sheaf of modules on X. For an open set U ⊂ Y we have -# f_* ℳ (U) to be the 𝒪_X(f⁻¹(U))-module ℳ (f⁻¹(U)), but seen as -# an 𝒪_Y(U)-module via the natural restriction of functions. +# Let f : X ↪ Y be a closed embedding with ideal sheaf ℐ on Y and ℳ +# a sheaf of modules on X. For an open set U ⊂ Y we have +# f_* ℳ (U) to be the 𝒪_X(f⁻¹(U))-module ℳ (f⁻¹(U)), but seen as +# an 𝒪_Y(U)-module via the natural restriction of functions. # -# Mathematically, this is almost an implicit operation. But since we -# do not have natural bi-module structures, we need to set up a new -# sheaf of modules on Y, together with canonical identifications -# with the modules on X. +# Mathematically, this is almost an implicit operation. But since we +# do not have natural bi-module structures, we need to set up a new +# sheaf of modules on Y, together with canonical identifications +# with the modules on X. # # It is clear that this can and should be made lazy. # =# @@ -1122,7 +1122,7 @@ end ### Production of the modules on open sets; to be cached function production_func(FF::AbsPreSheaf, U::AbsSpec) # In case X was empty, return the zero module and store nothing in the identifications. - if isempty(X) + if isempty(X) ident[U] = nothing return FreeMod(OOY(U), 0) end @@ -1141,7 +1141,7 @@ end end function production_func(FF::AbsPreSheaf, U::PrincipalOpenSubset) # In case X was empty, return the zero module and store nothing in the identifications. - if isempty(X) + if isempty(X) ident[U] = nothing return FreeMod(OOY(U), 0) end @@ -1171,9 +1171,9 @@ end MYU = FF(U) incV_list = maps_with_given_codomain(inc, V) incU_list = maps_with_given_codomain(inc, U) - # return the zero homomorphism in case one of the two sets has + # return the zero homomorphism in case one of the two sets has # empty preimage. - if iszero(length(incV_list)) || iszero(length(incU_list)) + if iszero(length(incV_list)) || iszero(length(incU_list)) return hom(MYV, MYU, elem_type(MYU)[zero(MYU) for i in 1:ngens(MYV)], OOY(V, U)) end incV = first(incV_list) @@ -1182,7 +1182,7 @@ end img_gens = res_orig.(gens(M(domain(incV)))) return hom(MYV, MYU, (x->preimage(ident[U], x)).(img_gens), OOY(V, U)) end - + ident = IdDict{AbsSpec, Union{Map, Nothing}}() Blubber = PreSheafOnScheme(Y, production_func, restriction_func, @@ -1211,26 +1211,26 @@ end ######################################################################## #= -# Let f : X → Y be a morphism and ℳ -# a sheaf of modules on Y. For an open set U ⊂ X we have -# f^* ℳ (U) to be the 𝒪_X(U)-module +# Let f : X → Y be a morphism and ℳ +# a sheaf of modules on Y. For an open set U ⊂ X we have +# f^* ℳ (U) to be the 𝒪_X(U)-module # # 𝒪_X ⊗_{f⁻¹𝒪_Y} f⁻¹ℳ # # where f⁻¹(ℱ) denotes the sheaf associated to U ↦ lim_{V ⊃ f(U)} ℱ(V). -# On the algebraic side, this merely means carrying out a change of bases -# for the module ℳ (V) where V is some affine open containing f(U). -# To find the latter might be a subtle task for general morphisms of -# schemes. In fact, f will in general only be given with respect to -# fixed coverings CX of X and CY of Y. Since the pullback of sheaves -# is a local question on X, we need to restrict to sufficiently small -# neighborhoods such that -# -# fᵢ : Uᵢ → Vᵢ +# On the algebraic side, this merely means carrying out a change of bases +# for the module ℳ (V) where V is some affine open containing f(U). +# To find the latter might be a subtle task for general morphisms of +# schemes. In fact, f will in general only be given with respect to +# fixed coverings CX of X and CY of Y. Since the pullback of sheaves +# is a local question on X, we need to restrict to sufficiently small +# neighborhoods such that +# +# fᵢ : Uᵢ → Vᵢ # -# is a local affine representative of the map f. But then the Uᵢ might -# not be `affine_charts` of X, anymore. Thus, we can a priori only -# construct the modules locally on X and the `production_func` has +# is a local affine representative of the map f. But then the Uᵢ might +# not be `affine_charts` of X, anymore. Thus, we can a priori only +# construct the modules locally on X and the `production_func` has # to take care of extending them to the `affine_charts` if necessary. # # Again, it is clear that this can and should be made lazy. @@ -1238,12 +1238,12 @@ end # # TODO: PullbackSheaf is not yet fully functional. # -# Missing parts: +# Missing parts: # -# - If ℳ is given only on the patches of a refinement Vⱼ, j ∈ J of -# the `default_covering` of X, then there is no method implemented -# to create a module for ℳ (U) when U ⊂ X is an `affine_chart` of X. -# The user is hence forced to work in the refinement only. +# - If ℳ is given only on the patches of a refinement Vⱼ, j ∈ J of +# the `default_covering` of X, then there is no method implemented +# to create a module for ℳ (U) when U ⊂ X is an `affine_chart` of X. +# The user is hence forced to work in the refinement only. @attributes mutable struct PullbackSheaf{SpaceType, OpenType, OutputType, RestrictionType @@ -1255,8 +1255,8 @@ end OOX::StructureSheafOfRings # the sheaf of rings in the domain OOY::StructureSheafOfRings # the sheaf of rings in the codomain M::AbsCoherentSheaf # the sheaf of modules on Y - pullback_of_sections::IdDict{AbsSpec, Union{Map, Nothing}} # a dictionary caching the natural - # pullback maps along the maps in the `covering_morphism` of f + pullback_of_sections::IdDict{AbsSpec, Union{Map, Nothing}} # a dictionary caching the natural + # pullback maps along the maps in the `covering_morphism` of f F::PreSheafOnScheme # the internal caching instance doing the bookkeeping function PullbackSheaf(f::AbsCoveredSchemeMorphism, M::AbsCoherentSheaf) @@ -1272,16 +1272,16 @@ end ### Production of the modules on open sets. # - # Since the morphism f might have an underlying CoveringMorphism ϕ with - # a non-trivial refinement of the `default_covering` of X as a domain, - # we can not expect to easily produce f^*(M) on the `affine_charts` of X. - # Instead, we can produce it on affine opens U ⊂ X which are hanging + # Since the morphism f might have an underlying CoveringMorphism ϕ with + # a non-trivial refinement of the `default_covering` of X as a domain, + # we can not expect to easily produce f^*(M) on the `affine_charts` of X. + # Instead, we can produce it on affine opens U ⊂ X which are hanging # below the patches in `domain(ϕ)`. # - # For everything else, we proceed as in case 3) of the general - # SheafOfModules, see above. + # For everything else, we proceed as in case 3) of the general + # SheafOfModules, see above. # - # Again, this case is not implemented for the time being. + # Again, this case is not implemented for the time being. function production_func(FF::AbsPreSheaf, U::AbsSpec) # See whether U is a patch of the domain covering and pull back directly @@ -1296,7 +1296,7 @@ end error("case not implemented") end - function production_func(FF::AbsPreSheaf, + function production_func(FF::AbsPreSheaf, U::Union{<:PrincipalOpenSubset, <:SimplifiedSpec} ) # See whether U is a patch of the domain covering and pull back directly @@ -1307,7 +1307,7 @@ end return MU end - # If not, check whether we are hanging below such a patch in the + # If not, check whether we are hanging below such a patch in the # refinement tree. if has_ancestor(y->any(x->(x===y), patches(domain(fcov))), U) V = __find_chart(U, domain(fcov)) @@ -1322,27 +1322,27 @@ end ### Restriction for pulled back sheaves of modules # - # For U ⊂ V ⊂ X, f : X → Y, M on Y and F = f^*M we do the following + # For U ⊂ V ⊂ X, f : X → Y, M on Y and F = f^*M we do the following # to compute the restriction morphism F(V) → F(U). - # Let ϕ be the `covering_morphism` behind f. + # Let ϕ be the `covering_morphism` behind f. # # f : X → Y - # + # # ∪ ∪ # ϕ[V] # f*ℱ (V) V → V' ↦ ℱ (V') - # + # # ↓ f*ρ ∪ ∪ ↓ ρ # ϕ[U] - # f*ℱ (U) U → U' ↦ ℱ (U') + # f*ℱ (U) U → U' ↦ ℱ (U') # - # 1) If both U and V are in the `Covering` `domain(ϕ)` induce the restriction - # f*ρ from ρ on Y. - # 2) If V is in `domain(ϕ)` and U is a node hanging below V in - # the refinement tree, restrict from V. + # 1) If both U and V are in the `Covering` `domain(ϕ)` induce the restriction + # f*ρ from ρ on Y. + # 2) If V is in `domain(ϕ)` and U is a node hanging below V in + # the refinement tree, restrict from V. # 3) If V is in `domain(ϕ)` and U is a subset of V, restrict as usual. - # 4) If V is a node hanging below some patch in `domain(ϕ)` and - # U is a subset, restrict as usual. + # 4) If V is a node hanging below some patch in `domain(ϕ)` and + # U is a subset, restrict as usual. function restriction_func(F::AbsPreSheaf, V::AbsSpec, U::AbsSpec) if haskey(morphisms(fcov), V) @@ -1353,8 +1353,8 @@ end MYV = M(codomain(f_V)) MYU = M(codomain(f_U)) res_Y = M(codomain(f_V), codomain(f_U)) - result = hom(F(V), F(U), - (pullbacks[U]).(res_Y.(gens(MYV))), + result = hom(F(V), F(U), + (pullbacks[U]).(res_Y.(gens(MYV))), OOX(V, U)) return result end @@ -1364,7 +1364,7 @@ end end error("case not implemented") end - + ident = IdDict{AbsSpec, Union{Map, Nothing}}() Blubber = PreSheafOnScheme(X, production_func, restriction_func, @@ -1392,11 +1392,11 @@ end # pushforward of modules # ######################################################################## # -# It is assumed that f : R → S is a map of rings such that S ≅ R/I and -# M is an S-module. We transform M into an R-module by adding the -# necessary relations. The return value is that new module M', together -# with its identification map M' → M. Note that we can not give the -# inverse of this map, since there is no well-defined underlying ring +# It is assumed that f : R → S is a map of rings such that S ≅ R/I and +# M is an S-module. We transform M into an R-module by adding the +# necessary relations. The return value is that new module M', together +# with its identification map M' → M. Note that we can not give the +# inverse of this map, since there is no well-defined underlying ring # homomorphism. function _pushforward(f::Map{<:Ring, <:Ring}, I::Ideal, M::FreeMod) R = domain(f) @@ -1470,18 +1470,18 @@ end @attr function trivializing_covering(M::HomSheaf) X = scheme(M) OOX = OO(X) - # The problem is that every module of a HomSheaf must know that it is - # a hom-module. Hence, the way to go is to pass through a common - # refinement of domain and codomain and recreate all the hom modules - # as free modules on this covering. + # The problem is that every module of a HomSheaf must know that it is + # a hom-module. Hence, the way to go is to pass through a common + # refinement of domain and codomain and recreate all the hom modules + # as free modules on this covering. # - # But for this, it is not yet clear where to locate the patches of these - # refinements in the tree and how to deal with the restriction maps in a - # clean way. Say M = Hom(F, G) where F is trivialized on {Uᵢ} and G on - # {Vⱼ}. Then W = Uᵢ∩ Vⱼ would have to be a PrincipalOpenSubset of both - # Uᵢ and Vⱼ for the restrictions of F and G to induce the proper job - # on restrictions to M(W) automatically. - # Hence, we need to manually prescribe how to trivialize and restrict + # But for this, it is not yet clear where to locate the patches of these + # refinements in the tree and how to deal with the restriction maps in a + # clean way. Say M = Hom(F, G) where F is trivialized on {Uᵢ} and G on + # {Vⱼ}. Then W = Uᵢ∩ Vⱼ would have to be a PrincipalOpenSubset of both + # Uᵢ and Vⱼ for the restrictions of F and G to induce the proper job + # on restrictions to M(W) automatically. + # Hence, we need to manually prescribe how to trivialize and restrict # M on the Ws. dom_triv = trivializing_covering(domain(M)) cod_triv = trivializing_covering(codomain(M)) @@ -1497,41 +1497,41 @@ end dom_UV, dom_res = change_base_ring(OOX(U, UV), domain(M)(U)) add_incoming_restriction!(domain(M), U, dom_UV, dom_res) - add_incoming_restriction!(domain(M), W, dom_UV, + add_incoming_restriction!(domain(M), W, dom_UV, compose(domain(M)(W, U), dom_res)) object_cache(domain(M))[UV] = dom_UV cod_UV, cod_res = change_base_ring(OOX(V, UV), codomain(M)(V)) add_incoming_restriction!(codomain(M), V, cod_UV, cod_res) - add_incoming_restriction!(codomain(M), W, cod_UV, + add_incoming_restriction!(codomain(M), W, cod_UV, compose(codomain(M)(W, V), cod_res)) object_cache(codomain(M))[UV] = cod_UV MUV = M(UV) # This will be a free module; we need to prescribe the restrictions! MW = M(W) img_gens = elem_type(MUV)[] - # every generator g of MW is a homomorphism. It takes an element - # v ∈ domain(M)(W) to w = ϕ_{g}(v) ∈ codomain(M)(W). - # Where does g map to when restricting to MUV? + # every generator g of MW is a homomorphism. It takes an element + # v ∈ domain(M)(W) to w = ϕ_{g}(v) ∈ codomain(M)(W). + # Where does g map to when restricting to MUV? # for g in gens(MW) phi = element_to_homomorphism(g) img_gens_phi = cod_res.(codomain(M)(W, V).(phi.(gens(domain(M)(W))))) - sub_dom, inc_dom = sub(domain(M)(UV), + sub_dom, inc_dom = sub(domain(M)(UV), domain(M)(W, UV).(gens(domain(M)(W)))) #dom_res.(domain(M)(W, U).(gens(domain(M)(W))))) img_gens_psi = elem_type(codomain(M)(UV))[] for v in gens(domain(M)(UV)) w = preimage(inc_dom, v) - c = coordinates(w) # These are the coordinates in the original set + c = coordinates(w) # These are the coordinates in the original set # of generators in the domain # We use this to compute the image of v phi_v = sum([c[i]*img_gens_phi[i] for i in 1:length(img_gens_phi)], init=zero(codomain(M)(UV))) # and push it to the list. push!(img_gens_psi, phi_v) end - # From that list, we can assemble what the restriction of phi - # looks like as a homomorphism + # From that list, we can assemble what the restriction of phi + # looks like as a homomorphism psi = hom(domain(M)(UV), codomain(M)(UV), img_gens_psi) # and convert it to a module element. img_g = homomorphism_to_element(MUV, psi) @@ -1557,9 +1557,9 @@ function _trivializing_covering(M::AbsCoherentSheaf, U::AbsSpec) MU isa FreeMod && return [U] MU::SubquoModule A = _presentation_matrix(MU) - if iszero(A) - # Trivial shortcut in the recursion. - # We nevertheless need to recreate U as a PrincipalOpenSubset of itself + if iszero(A) + # Trivial shortcut in the recursion. + # We nevertheless need to recreate U as a PrincipalOpenSubset of itself # as we are not allowed to alter the values of the sheaf M on U directly. V = PrincipalOpenSubset(U, one(OO(U))) F = FreeMod(OO(V), ncols(A)) @@ -1569,13 +1569,13 @@ function _trivializing_covering(M::AbsCoherentSheaf, U::AbsSpec) return [V] end - # We do not need to go through all entries of A, but only those + # We do not need to go through all entries of A, but only those # necessary to generate the unit ideal. I = ideal(OOX(U), [A[i, j] for i in 1:nrows(A) for j in 1:ncols(A)]) if !(one(OOX(U)) in I) # Now two things could be happening. # 1. The sheaf is not locally trivial. - # 2. We might have different disjoint components on which + # 2. We might have different disjoint components on which # the sheaf has different ranks. Y = connected_components(U) length(Y) == 1 && error("sheaf is not locally free") @@ -1592,7 +1592,7 @@ function _trivializing_covering(M::AbsCoherentSheaf, U::AbsSpec) return return_patches end - # The non-zero coordinates provide us with a list of entries which + # The non-zero coordinates provide us with a list of entries which # are sufficient to do so. This set can not assumed to be minimal, though. a = coordinates(one(OOX(U)), I) nonzero_entries = [ i for i in 1:ngens(I) if !iszero(a[i])] @@ -1601,9 +1601,9 @@ function _trivializing_covering(M::AbsCoherentSheaf, U::AbsSpec) for t in nonzero_entries i = div(t-1, ncols(A)) + 1 j = mod(t-1, ncols(A)) + 1 # The matrix coordinates of the nonzero entry - # We invert the (i,j)-th entry of A. - # Then we can reduce the presentation matrix so that we can throw away one - # of the generators of the module. + # We invert the (i,j)-th entry of A. + # Then we can reduce the presentation matrix so that we can throw away one + # of the generators of the module. V = PrincipalOpenSubset(U, A[i, j]) Ares = map_entries(OOX(U, V), A) uinv = inv(Ares[i, j]) @@ -1620,15 +1620,15 @@ function _trivializing_covering(M::AbsCoherentSheaf, U::AbsSpec) # Assemble the restriction map from the parent node if iszero(Asub) - # End of recursion. + # End of recursion. # Create a free module and the corresponding restriction morphism. F = FreeMod(OO(V), ncols(Asub)) img_gens = elem_type(F)[] for k in 1:j-1 push!(img_gens, F[k]) end - push!(img_gens, - -sum([Ares[i, k]*F[(k>j ? k-1 : k)] for k in 1:ncols(Ares) if k!=j], + push!(img_gens, + -sum([Ares[i, k]*F[(k>j ? k-1 : k)] for k in 1:ncols(Ares) if k!=j], init=zero(F)) ) for k in j+1:ncols(Ares) @@ -1636,15 +1636,15 @@ function _trivializing_covering(M::AbsCoherentSheaf, U::AbsSpec) end res = hom(MU, F, img_gens, OOX(U, V)) - # Since we are messing with the internals of the sheaf, we need + # Since we are messing with the internals of the sheaf, we need # to leave everything clean. This includes manual caching. add_incoming_restriction!(M, U, F, res) object_cache(M)[V] = F set_attribute!(F, :_presentation_matrix, Asub) push!(return_patches, V) else - # Intermediate recursion step. - # Recreate the restriction of the module to the open subset but with one generator + # Intermediate recursion step. + # Recreate the restriction of the module to the open subset but with one generator # less and construct the restriction map. F, amb_res = change_base_ring(OOX(U, V), ambient_free_module(MU)) v = ambient_representatives_generators(MU) @@ -1656,8 +1656,8 @@ function _trivializing_covering(M::AbsCoherentSheaf, U::AbsSpec) for k in 1:j-1 push!(img_gens, M_gens[k]) end - push!(img_gens, - -sum([Ares[i, k]*M_gens[k] for k in 1:length(M_gens) if k!=j], + push!(img_gens, + -sum([Ares[i, k]*M_gens[k] for k in 1:length(M_gens) if k!=j], init=zero(F)) ) for k in j+1:length(M_gens) @@ -1680,27 +1680,27 @@ end ######################################################################## # Projectivization of vector bundles # # -# To any vector bundle E → X one can associate its projectivization -# ℙ(E) → X. In general, E will be given as a locally free +# To any vector bundle E → X one can associate its projectivization +# ℙ(E) → X. In general, E will be given as a locally free # AbsCoherentSheaf. ######################################################################## @doc raw""" - projectivization(E::AbsCoherentSheaf; + projectivization(E::AbsCoherentSheaf; var_names::Vector{String}=Vector{String}(), check::Bool=true ) -For a locally free sheaf ``E`` on an `AbsCoveredScheme` ``X`` this produces +For a locally free sheaf ``E`` on an `AbsCoveredScheme` ``X`` this produces the associated projectivization ``ℙ (E) → X`` as a `CoveredProjectiveScheme`. -A list of names for the variables of the relative homogeneous coordinate +A list of names for the variables of the relative homogeneous coordinate rings can be provided with `var_names`. -!!! note: The sheaf ``E`` needs to be locally free so that a `trivializing_covering` +!!! note: The sheaf ``E`` needs to be locally free so that a `trivializing_covering` can be computed. The check for this can be turned off by setting `check=false`. """ -function projectivization(E::AbsCoherentSheaf; +function projectivization(E::AbsCoherentSheaf; var_names::Vector{String}=Vector{String}(), check::Bool=true ) @@ -1750,21 +1750,21 @@ function projectivization(E::AbsCoherentSheaf; PUV, PUVtoP = fiber_product(OX(U, UV), P) QVU, QVUtoQ = fiber_product(OX(V, VU), Q) - # to construct the identifications of PUV with QVU we need to + # to construct the identifications of PUV with QVU we need to # express the generators of I(U) in terms of the generators of I(V) - # on the overlap U ∩ V. + # on the overlap U ∩ V. !(G isa Gluing) || error("method not implemented for this type of gluing") # The problem is that on a SpecOpen U ∩ V - # despite I(U)|U ∩ V == I(V)|U ∩ V, we + # despite I(U)|U ∩ V == I(V)|U ∩ V, we # have no method to find coefficients aᵢⱼ such that fᵢ = ∑ⱼaᵢⱼ⋅gⱼ - # for the generators fᵢ of I(U) and gⱼ of I(V): Even though - # we can do this locally on the patches of a SpecOpen, the result + # for the generators fᵢ of I(U) and gⱼ of I(V): Even though + # we can do this locally on the patches of a SpecOpen, the result # is not guaranteed to glue to global functions on the overlap. - # Abstractly, we know that the intersection of affine charts - # in a separated scheme must be affine, but we do not have a + # Abstractly, we know that the intersection of affine charts + # in a separated scheme must be affine, but we do not have a # model of this overlap as an affine scheme and hence no computational - # backup. + # backup. # fᵢ the generators of I(U) # gⱼ the generators of I(V) @@ -1778,16 +1778,16 @@ function projectivization(E::AbsCoherentSheaf; #B = [coordinates(OX(V, UV)(g), I(UV)) for g in gens(I(V))] # B[j][i] = bⱼᵢ SQVU = homogeneous_coordinate_ring(QVU) SPUV = homogeneous_coordinate_ring(PUV) - # the induced map is ℙ(UV) → ℙ(VU), tⱼ ↦ ∑ᵢ bⱼᵢ ⋅ sᵢ - # and ℙ(VU) → ℙ(UV), sᵢ ↦ ∑ⱼ aᵢⱼ ⋅ tⱼ - fup = ProjectiveSchemeMor(PUV, QVU, - hom(SQVU, SPUV, pullback(f), + # the induced map is ℙ(UV) → ℙ(VU), tⱼ ↦ ∑ᵢ bⱼᵢ ⋅ sᵢ + # and ℙ(VU) → ℙ(UV), sᵢ ↦ ∑ⱼ aᵢⱼ ⋅ tⱼ + fup = ProjectiveSchemeMor(PUV, QVU, + hom(SQVU, SPUV, pullback(f), [sum([B[j][i]*SPUV[i] for i in 1:ngens(SPUV)]) for j in 1:length(B)], - check=false), + check=false), check=false ) - gup = ProjectiveSchemeMor(QVU, PUV, - hom(SPUV, SQVU, pullback(g), + gup = ProjectiveSchemeMor(QVU, PUV, + hom(SPUV, SQVU, pullback(g), [sum([A[i][j]*SQVU[j] for j in 1:ngens(SQVU)]) for i in 1:length(A)], check=false ), diff --git a/experimental/Schemes/CoveredScheme.jl b/experimental/Schemes/CoveredScheme.jl index d4c84e250361..45bcdb1440a1 100644 --- a/experimental/Schemes/CoveredScheme.jl +++ b/experimental/Schemes/CoveredScheme.jl @@ -7,7 +7,7 @@ export morphism_type ### essential getters #function add_affine_refinement!( -# C::Covering, U::SpecOpen; +# C::Covering, U::SpecOpen; # a::Vector{RingElemType}=as_vector(coordinates(one(OO(ambient_scheme(U))), # ideal(OO(ambient_scheme(U)), # OO(ambient_scheme(U)).(gens(U)))), @@ -77,8 +77,8 @@ end #open_subset_type(::Type{Covering{R, S, T}}) where {R, S, T} = T #open_subset_type(C::Covering) = open_subset_type(typeof(C)) -# TODO: For some reason, the `indexin` method won't work. In the long -# run, one should probably find out why and fix it. +# TODO: For some reason, the `indexin` method won't work. In the long +# run, one should probably find out why and fix it. affine_refinements(C::Covering) = C.affine_refinements @@ -247,8 +247,8 @@ end r = relative_ambient_dimension(X) U = Vector{AbsSpec}() - # The case of ℙ⁰-bundles appears frequently in blowups when the - # ideal sheaf is trivial on some affine open part. + # The case of ℙ⁰-bundles appears frequently in blowups when the + # ideal sheaf is trivial on some affine open part. if r == 0 result = Covering(Y) set_decomposition_info!(result, Y, elem_type(OO(Y))[]) @@ -263,7 +263,7 @@ end # TODO: Check that all weights are equal to one. Otherwise the routine is not implemented. s = symbols(S) - # for each homogeneous variable, set up the chart + # for each homogeneous variable, set up the chart chart_dict, projection_dict = _generate_affine_charts(X) isempty(chart_dict) && return empty_covering(base_ring(Y)) @@ -341,7 +341,7 @@ refinements(X::AbsCoveredScheme) = refinements(underlying_scheme(X))::Dict{<:Tup ### getter methods refinements(X::CoveredScheme) = X.refinements -#function set_default_covering!(X::CoveredScheme, C::Covering) +#function set_default_covering!(X::CoveredScheme, C::Covering) # C in coverings(X) || error("covering is not listed") # X.default_covering = C # return X @@ -372,7 +372,7 @@ _compose_along_path(X::CoveredScheme, p::Vector{Int}) = _compose_along_path(X, [ # push!(p, Ni[1]) # Ni = neighbors(G, Ni[1]) # end -# q = [j] +# q = [j] # Nj = neighbors(G, j) # while length(Nj) > 0 # push!(p, Nj[1]) @@ -385,8 +385,8 @@ _compose_along_path(X::CoveredScheme, p::Vector{Int}) = _compose_along_path(X, [ #@doc raw""" # common_refinement(X::CoveredScheme, C1::T, C2::T) where {T<:Covering} # -#Given two coverings of ``X``, return a triple `(C_new, f, g)` consisting -#of a common refinement `C_new` of `C1` and `C2` and the refinement morphisms +#Given two coverings of ``X``, return a triple `(C_new, f, g)` consisting +#of a common refinement `C_new` of `C1` and `C2` and the refinement morphisms #`f : C_new → C1` and `g : C_new → C2`. #""" #function common_refinement(X::CoveredScheme, C1::T, C2::T) where {T<:Covering} @@ -403,7 +403,7 @@ _compose_along_path(X::CoveredScheme, p::Vector{Int}) = _compose_along_path(X, [ # if length(p2) == 0 # return (C1, _compose_along_path(X, p1), identity_map(C2)) # end -# +# # # now we may assume that neither one of the coverings is contained in the other # C0 = X[r] # f = _compose_along_path(X, p1) @@ -421,8 +421,8 @@ _compose_along_path(X::CoveredScheme, p::Vector{Int}) = _compose_along_path(X, [ # # first try to find a patch in C2 which fully includes U # patch_found = false # while length(V_candidates) > 0 -# V = pop!(V_candidates) -# if issubset(U, V) +# V = pop!(V_candidates) +# if is_subscheme(U, V) # inc1[U] = identity_map(U) # inc2[U] = inclusion_morphism(U, V) # inc0[U] = f[U] @@ -442,7 +442,7 @@ _compose_along_path(X::CoveredScheme, p::Vector{Int}) = _compose_along_path(X, [ # push!(new_patches, UV) # end # end -# +# # # cook up the gluings for the new patches from those in the common root. # new_gluings = IdDict{Tuple{affine_patch_type(X), affine_patch_type(X)}, gluing_type(affine_patch_type(X))}() # for (W1, W2) in keys(gluings(C0)) @@ -529,7 +529,7 @@ underlying_morphism(phi::CoveredClosedEmbedding) = phi.f image_ideal(phi::CoveredClosedEmbedding) = phi.I ### user facing constructors -function CoveredClosedEmbedding(X::AbsCoveredScheme, I::IdealSheaf; +function CoveredClosedEmbedding(X::AbsCoveredScheme, I::IdealSheaf; covering::Covering=default_covering(X), check::Bool=true) space(I) === X || error("ideal sheaf is not defined on the correct scheme") mor_dict = IdDict{AbsSpec, ClosedEmbedding}() # Stores the morphism fᵢ : Uᵢ → Vᵢ for some covering Uᵢ ⊂ Z(I) ⊂ X. @@ -549,7 +549,7 @@ function CoveredClosedEmbedding(X::AbsCoveredScheme, I::IdealSheaf; U = codomain(mor_dict[Unew]) for Vnew in keys(mor_dict) V = codomain(mor_dict[Vnew]) - gluing_dict[(Unew, Vnew)] = LazyGluing(Unew, Vnew, _compute_restriction, + gluing_dict[(Unew, Vnew)] = LazyGluing(Unew, Vnew, _compute_restriction, RestrictionDataClosedEmbedding(covering[U, V], Unew, Vnew) ) end @@ -576,28 +576,28 @@ end CoveredSchemeMorphism } -A special concrete type of an `AbsCoveredSchemeMorphism` of the -form ``f = hᵣ ∘ hᵣ₋₁ ∘ … ∘ h₁: X → Y`` for arbitrary -`AbsCoveredSchemeMorphism`s ``h₁ : X → Z₁``, ``h₂ : Z₁ → Z₂``, ..., -``hᵣ : Zᵣ₋₁ → Y``. +A special concrete type of an `AbsCoveredSchemeMorphism` of the +form ``f = hᵣ ∘ hᵣ₋₁ ∘ … ∘ h₁: X → Y`` for arbitrary +`AbsCoveredSchemeMorphism`s ``h₁ : X → Z₁``, ``h₂ : Z₁ → Z₂``, ..., +``hᵣ : Zᵣ₋₁ → Y``. -Since every such morphism ``hⱼ`` will in general have an underlying -`CoveringMorphism` with `domain` and `codomain` `covering` actual -composition of such a sequence of morphisms will lead to an exponential -increase in complexity of these coverings because of the necessary +Since every such morphism ``hⱼ`` will in general have an underlying +`CoveringMorphism` with `domain` and `codomain` `covering` actual +composition of such a sequence of morphisms will lead to an exponential +increase in complexity of these coverings because of the necessary refinements. Nevertheless, the pullback or pushforward of various objects on either ``X`` or ``Y`` through such a chain of maps is possible stepwise. -This type allows one to have one concrete morphism rather than a list -of morphisms and to reroute such calculations to iteration over the -various maps. +This type allows one to have one concrete morphism rather than a list +of morphisms and to reroute such calculations to iteration over the +various maps. -In addition to the usual functionality of the `AbsCoveredSchemeMorphism` -interface, this concrete type has the getters +In addition to the usual functionality of the `AbsCoveredSchemeMorphism` +interface, this concrete type has the getters maps(f::CompositeCoveredSchemeMorphism) -to obtain a list of the ``hⱼ`` and `map(f, j)` to obtain the `j`-th map -directly. +to obtain a list of the ``hⱼ`` and `map(f, j)` to obtain the `j`-th map +directly. """ @attributes mutable struct CompositeCoveredSchemeMorphism{ DomainType<:AbsCoveredScheme, @@ -659,8 +659,8 @@ end @doc raw""" composite_map(f::AbsCoveredSchemeMorphism, g::AbsCoveredSchemeMorphism) -Realize the composition ``x → g(f(x))`` as a composite map, i.e. an -instance of `CompositeCoveredSchemeMorphism`. +Realize the composition ``x → g(f(x))`` as a composite map, i.e. an +instance of `CompositeCoveredSchemeMorphism`. # Examples ```jldoctest @@ -744,7 +744,7 @@ function pushforward(f::CompositeCoveredSchemeMorphism, a::VarietyFunctionFieldE return result end -function pullback(f::CompositeCoveredSchemeMorphism, a::VarietyFunctionFieldElem) +function pullback(f::CompositeCoveredSchemeMorphism, a::VarietyFunctionFieldElem) result = a for g in reverse(maps(f)) result = pullback(g, result) diff --git a/experimental/Schemes/Sheaves.jl b/experimental/Schemes/Sheaves.jl index 22fcb8b69fc4..99f9b5c2f96f 100644 --- a/experimental/Schemes/Sheaves.jl +++ b/experimental/Schemes/Sheaves.jl @@ -8,18 +8,18 @@ export underlying_presheaf # The AbsPreSheaf interface # ######################################################################## @doc raw""" - space(F::AbsPreSheaf) + space(F::AbsPreSheaf) For a sheaf ``ℱ`` on a space ``X`` return ``X``. """ -function space(F::AbsPreSheaf) +function space(F::AbsPreSheaf) return space(underlying_presheaf(F)) end @doc raw""" - (F::AbsPreSheaf)(U; cached=true) + (F::AbsPreSheaf)(U; cached=true) -For a sheaf ``ℱ`` on a space ``X`` and an (admissible) open set +For a sheaf ``ℱ`` on a space ``X`` and an (admissible) open set ``U ⊂ X`` check whether ``U`` is open in ``X`` and return ``ℱ(U)``. """ function (F::AbsPreSheaf{<:Any, OpenType, OutputType})(U::T; cached::Bool=true) where {OpenType, OutputType, T<:OpenType} @@ -29,8 +29,8 @@ end @doc raw""" restriction_map(F::AbsPreSheaf, U, V) -For a sheaf ``ℱ`` on a space ``X`` and an (admissible) pair of -open sets ``U, V ⊂ X`` check whether ``U ⊂ V ⊂ X`` are open and +For a sheaf ``ℱ`` on a space ``X`` and an (admissible) pair of +open sets ``U, V ⊂ X`` check whether ``U ⊂ V ⊂ X`` are open and return the restriction map ``ℱ(V) → ℱ(U)``. """ function restriction_map(F::AbsPreSheaf{<:Any, OpenType, OutputType, RestrictionType}, @@ -49,11 +49,11 @@ end @doc raw""" is_open_func(F::AbsPreSheaf) -For a sheaf ``ℱ`` on a space ``X`` return a function `f` on two +For a sheaf ``ℱ`` on a space ``X`` return a function `f` on two arguments such that `f(U, V)` returns `true` whenever ``U ⊂ V ⊂ X`` are open inclusions and `false` otherwise. -***Note:*** This function is expected to accept ``X`` as the second argument +***Note:*** This function is expected to accept ``X`` as the second argument to check whether ``U ⊂ X`` is open in ``X``! """ function is_open_func(F::AbsPreSheaf) @@ -79,7 +79,7 @@ restriction_func(F::PreSheafOnScheme) = F.restriction_func ### Production and caching of the values of F on admissible open sets function (F::PreSheafOnScheme{<:Any, OpenType, OutputType})(U::T; cached::Bool=true, check::Bool=false) where {OpenType, OutputType, T<:OpenType} #First look whether or not the asked for result has been computed before - haskey(object_cache(F), U) && return (object_cache(F)[U])::OutputType + haskey(object_cache(F), U) && return (object_cache(F)[U])::OutputType # Testing openness might be expensive, so it can be skipped check && (is_open_func(F)(U, space(F)) || error("the given set is not open or admissible")) @@ -101,13 +101,13 @@ function restriction_map(F::PreSheafOnScheme{<:Any, OpenType, OutputType, Restri check::Bool=false ) where {OpenType, OutputType, RestrictionType, Type1<:OpenType, Type2<:OpenType} # First, look up whether this restriction had already been asked for previously. - inc = incoming_restrictions(F, F(V)) + inc = incoming_restrictions(F, F(V)) inc !== nothing && haskey(inc, U) && return (inc[U])::RestrictionType # Check whether the given pair is even admissible. check && (is_open_func(F)(V, U) || error("the second argument is not open in the first")) - # Hand the production of the restriction over to the internal method + # Hand the production of the restriction over to the internal method rho = restriction_func(F)(F, U, V) # Sanity checks @@ -121,18 +121,18 @@ function restriction_map(F::PreSheafOnScheme{<:Any, OpenType, OutputType, Restri end @doc raw""" - add_incoming_restriction!(F::AbsPreSheaf{<:Any, OpenType, <:Any, RestrictionType}, + add_incoming_restriction!(F::AbsPreSheaf{<:Any, OpenType, <:Any, RestrictionType}, U::OpenType, rho::RestrictionType ) where {OpenType, RestrictionType} -**Note:** This is a method for internal use! +**Note:** This is a method for internal use! -For an `AbsPreSheaf` `F`, a pair of open sets ``U ⊃ V`` and a manually computed -morphism ``ρ : F(U) → F(V)``, this method stores the map `rho` in the internal caching system as +For an `AbsPreSheaf` `F`, a pair of open sets ``U ⊃ V`` and a manually computed +morphism ``ρ : F(U) → F(V)``, this method stores the map `rho` in the internal caching system as the restriction map for `F` from `U` to `V`. """ -function add_incoming_restriction!(F::AbsPreSheaf{<:Any, OpenType, OutputType, RestrictionType}, +function add_incoming_restriction!(F::AbsPreSheaf{<:Any, OpenType, OutputType, RestrictionType}, U::OpenType, M::OutputType, rho::RestrictionType @@ -140,7 +140,7 @@ function add_incoming_restriction!(F::AbsPreSheaf{<:Any, OpenType, OutputType, R # First, look up the incoming restriction maps for F(V). # This will create the dictionary, if necessary. incoming_res = incoming_restrictions(F, M) - incoming_res === nothing && return F # This indicates that no + incoming_res === nothing && return F # This indicates that no incoming_res::IdDict{<:OpenType, <:RestrictionType} # sanity checks domain(rho) === F(U) || error("domain is not correct") @@ -150,14 +150,14 @@ function add_incoming_restriction!(F::AbsPreSheaf{<:Any, OpenType, OutputType, R end @doc raw""" - incoming_restrictions(F::AbsPreSheaf{<:Any, OpenType, OutputType, RestrictionType, M::OutputType) + incoming_restrictions(F::AbsPreSheaf{<:Any, OpenType, OutputType, RestrictionType, M::OutputType) -Supposing `M` is the value `M = F(U)` of some `AbsPreSheaf` `F` on an admissible open -set `U`, return an `IdDict` whose keys `V` are those admissible open sets for `F` -for which a restriction map `ρ : F(V) → F(U)` has already been computed and cached. +Supposing `M` is the value `M = F(U)` of some `AbsPreSheaf` `F` on an admissible open +set `U`, return an `IdDict` whose keys `V` are those admissible open sets for `F` +for which a restriction map `ρ : F(V) → F(U)` has already been computed and cached. The values of the dictionary are precisely those restriction maps for the respective keys. -**Note:** This +**Note:** This """ function incoming_restrictions( F::AbsPreSheaf{<:Any, OpenType, OutputType, RestrictionType}, @@ -191,7 +191,7 @@ function _is_open_func_for_schemes(X::AbsCoveredScheme) # * U::PrincipalOpenSubset ⊂ X with ambient_scheme(U) in the basic charts of X # * W::SpecOpen ⊂ X with ambient_scheme(U) in the basic charts of X function is_open_func( - U::Union{<:PrincipalOpenSubset, <:SimplifiedSpec}, + U::Union{<:PrincipalOpenSubset, <:SimplifiedSpec}, V::Union{<:PrincipalOpenSubset, <:SimplifiedSpec} ) inc_U_flat = _flatten_open_subscheme(U, default_covering(X)) @@ -213,7 +213,7 @@ function _is_open_func_for_schemes(X::AbsCoveredScheme) return true end function is_open_func( - U::Union{<:PrincipalOpenSubset, <:SimplifiedSpec}, + U::Union{<:PrincipalOpenSubset, <:SimplifiedSpec}, Y::AbsCoveredScheme ) return Y === X && has_ancestor(W->(any(WW->(WW === W), affine_charts(X))), U) @@ -221,7 +221,7 @@ function _is_open_func_for_schemes(X::AbsCoveredScheme) function is_open_func(U::AbsSpec, Y::AbsCoveredScheme) return Y === X && has_ancestor(W->any(WW->(WW===W), affine_charts(X)), U) end - # The following is implemented for the sake of completeness for boundary cases. + # The following is implemented for the sake of completeness for boundary cases. function is_open_func(Z::AbsCoveredScheme, Y::AbsCoveredScheme) return X === Y === Z end @@ -229,13 +229,13 @@ function _is_open_func_for_schemes(X::AbsCoveredScheme) any(x->x===U, affine_charts(X)) || return false any(x->x===U, affine_charts(X)) || return false G = default_covering(X)[U, V] - return issubset(U, gluing_domains(G)[1]) + return is_subscheme(U, gluing_domains(G)[1]) end function is_open_func( U::AbsSpec, V::Union{<:PrincipalOpenSubset, <:SimplifiedSpec} ) - issubset(U, V) && return true + is_subscheme(U, V) && return true any(x->x===U, affine_charts(X)) || return false inc_V_flat = _flatten_open_subscheme(V, default_covering(X)) A = ambient_scheme(codomain(inc_V_flat)) @@ -248,7 +248,7 @@ function _is_open_func_for_schemes(X::AbsCoveredScheme) return is_subset(U, pre_V) end function is_open_func( - U::Union{<:PrincipalOpenSubset, <:SimplifiedSpec}, + U::Union{<:PrincipalOpenSubset, <:SimplifiedSpec}, V::AbsSpec ) any(x->x===V, affine_charts(X)) || return false @@ -273,7 +273,7 @@ function _is_open_func_for_schemes(X::AbsCoveredScheme) return is_subset(W, gluing_domains(G)[1]) end function is_open_func( - W::SpecOpen, + W::SpecOpen, V::Union{<:PrincipalOpenSubset, <:SimplifiedSpec} ) PW = ambient_scheme(W) @@ -283,12 +283,12 @@ function _is_open_func_for_schemes(X::AbsCoveredScheme) PW in default_covering(X) || return false PV in default_covering(X) || return false if PW === PV - return issubset(W, V) + return is_subscheme(W, V) else haskey(gluings(default_covering(X)), (PW, PV)) || return false G = default_covering(X)[PW, PV] preV = preimage(gluing_morphisms(G)[1], Vdirect) - return issubset(W, preV) + return is_subscheme(W, preV) end end function is_open_func(W::SpecOpen, V::SpecOpen) @@ -297,28 +297,28 @@ function _is_open_func_for_schemes(X::AbsCoveredScheme) PW in default_covering(X) || return false PV in default_covering(X) || return false if PW === PV - return issubset(W, V) + return is_subscheme(W, V) else G = default_covering(X)[PW, PV] preV = preimage(gluing_morphisms(G)[1], V) - return issubset(W, preV) + return is_subscheme(W, preV) end end function is_open_func(U::AbsSpec, W::SpecOpen) U in default_covering(X) || return false if U === ambient_scheme(W) # in this case W must be equal to U - return issubset(W, U) + return is_subscheme(W, U) #return one(OO(U)) in complement_ideal(W) else G = default_covering(X)[ambient_scheme(W), U] - issubset(U, gluing_domains(G)[2]) || return false + is_subscheme(U, gluing_domains(G)[2]) || return false preU = preimage(gluing_morphisms(G)[1], U) - return issubset(preU, W) + return is_subscheme(preU, W) end end function is_open_func( - U::Union{<:PrincipalOpenSubset, <:SimplifiedSpec}, + U::Union{<:PrincipalOpenSubset, <:SimplifiedSpec}, W::SpecOpen ) inc_U_flat = _flatten_open_subscheme(U, default_covering(X)) @@ -328,12 +328,12 @@ function _is_open_func_for_schemes(X::AbsCoveredScheme) PU = ambient_scheme(U_flat) if PU === ambient_scheme(W) # in this case W must be equal to U - return issubset(W, U_flat) + return is_subscheme(W, U_flat) else G = default_covering(X)[ambient_scheme(W), PU] - issubset(U_flat, gluing_domains(G)[2]) || return false + is_subscheme(U_flat, gluing_domains(G)[2]) || return false preU = preimage(gluing_morphisms(G)[1], U_flat) - return issubset(preU, W) + return is_subscheme(preU, W) end end @@ -354,7 +354,7 @@ function _is_open_func_for_schemes_without_specopen(X::AbsCoveredScheme) # * U::AbsSpec ⊂ X for U in the basic charts # * U::PrincipalOpenSubset ⊂ X with ambient_scheme(U) in the basic charts of X function is_open_func( - U::Union{<:PrincipalOpenSubset, <:SimplifiedSpec}, + U::Union{<:PrincipalOpenSubset, <:SimplifiedSpec}, V::Union{<:PrincipalOpenSubset, <:SimplifiedSpec} ) inc_U_flat = _flatten_open_subscheme(U, default_covering(X)) @@ -369,14 +369,14 @@ function _is_open_func_for_schemes_without_specopen(X::AbsCoveredScheme) else G = default_covering(X)[A, B] # Get the gluing f, g = gluing_morphisms(G) - is_subset(Udirect, domain(f)) || return false + is_subscheme(Udirect, domain(f)) || return false gU = preimage(g, Udirect) - is_subset(gU, Vdirect) || return false + is_subscheme(gU, Vdirect) || return false end return true end function is_open_func( - U::Union{<:PrincipalOpenSubset, <:SimplifiedSpec}, + U::Union{<:PrincipalOpenSubset, <:SimplifiedSpec}, Y::AbsCoveredScheme ) return Y === X && has_ancestor(W->(any(WW->(WW === W), affine_charts(X))), U) @@ -384,7 +384,7 @@ function _is_open_func_for_schemes_without_specopen(X::AbsCoveredScheme) function is_open_func(U::AbsSpec, Y::AbsCoveredScheme) return Y === X && has_ancestor(W->any(WW->(WW===W), affine_charts(X)), U) end - # The following is implemented for the sake of completeness for boundary cases. + # The following is implemented for the sake of completeness for boundary cases. function is_open_func(Z::AbsCoveredScheme, Y::AbsCoveredScheme) return X === Y === Z end @@ -392,10 +392,10 @@ function _is_open_func_for_schemes_without_specopen(X::AbsCoveredScheme) U in affine_charts(X) || return false V in affine_charts(X) || return false G = default_covering(X)[U, V] - return issubset(U, gluing_domains(G)[1]) + return is_subscheme(U, gluing_domains(G)[1]) end function is_open_func( - U::Union{<:PrincipalOpenSubset, <:SimplifiedSpec}, + U::Union{<:PrincipalOpenSubset, <:SimplifiedSpec}, V::AbsSpec ) V in affine_charts(X) || return false @@ -492,7 +492,7 @@ function restrict( end function restrict( - a::MPolyQuoRingElem, + a::MPolyQuoRingElem, U::PrincipalOpenSubset; check::Bool=true ) @@ -501,7 +501,7 @@ function restrict( end function restrict( - a::MPolyQuoLocRingElem, + a::MPolyQuoLocRingElem, U::PrincipalOpenSubset; check::Bool=true ) @@ -510,8 +510,8 @@ function restrict( end function restrict( - a::Union{MPolyRingElem, MPolyQuoRingElem, - MPolyLocRingElem, MPolyQuoLocRingElem}, + a::Union{MPolyRingElem, MPolyQuoRingElem, + MPolyLocRingElem, MPolyQuoLocRingElem}, U::SpecOpen; check::Bool=true ) @@ -523,9 +523,9 @@ end # Sections of sheaves # ######################################################################## -abstract type AbsPreSheafSection{SpaceType, - ParentType<:AbsPreSheaf, - OpenType, +abstract type AbsPreSheafSection{SpaceType, + ParentType<:AbsPreSheaf, + OpenType, ElemType } end @@ -535,7 +535,7 @@ abstract type AbsPreSheafSection{SpaceType, @doc raw""" (v::AbsPreSheafSection{<:Any, <:AbsPreSheaf, OpenType})(U::OpenType) where {OpenType} -For a section ``v`` in a presheaf ``ℱ`` on ``X`` and an admissible +For a section ``v`` in a presheaf ``ℱ`` on ``X`` and an admissible open subset ``U ⊂ X`` return an element ``s ∈ ℱ(U)`` representing the section. """ function (v::AbsPreSheafSection{<:Any, <:AbsPreSheaf, OpenType})(U::OpenType) where {OpenType} @@ -547,28 +547,28 @@ end # The sheaf in which this is a section parent(v::AbsPreSheafSection) = parent(underlying_section(v)) -# The space on which the section is defined +# The space on which the section is defined space(v::AbsPreSheafSection) = space(underlying_section(v)) # The dictionary with cached representatives of that section; # for internal use only! cache_dict(v::AbsPreSheafSection) = cache_dict(underlying_section(v)) -# A function to produce a representative of that section on an -# admissible open subset which is not yet cached; +# A function to produce a representative of that section on an +# admissible open subset which is not yet cached; # for internal use only! # -# The signature of this function should be +# The signature of this function should be # # production_func(w::PreSheafSection, U::OpenType) where {OpenType} -# -# where OpenType is any admissible type for the open sets considered. -# In the internal calls, the first argument w will always be the internal -# representative of the section v itself. # -# This function should then take care of producing a representative +# where OpenType is any admissible type for the open sets considered. +# In the internal calls, the first argument w will always be the internal +# representative of the section v itself. +# +# This function should then take care of producing a representative # of v on U from the data already provided by w. -# +# production_func(v::AbsPreSheafSection) = production_func(underlying_section(v)) @@ -576,14 +576,14 @@ production_func(v::AbsPreSheafSection) = production_func(underlying_section(v)) # Minimal concrete type for sections in presheaves # ######################################################################## -# This type is for internal use in the user-facing concrete instances +# This type is for internal use in the user-facing concrete instances # of AbsPreSheafSection; to be returned via underlying_section(). -mutable struct PreSheafSection{SpaceType, - ParentType<:AbsPreSheaf, +mutable struct PreSheafSection{SpaceType, + ParentType<:AbsPreSheaf, OpenType, ElemType - } <: AbsPreSheafSection{SpaceType, - ParentType, + } <: AbsPreSheafSection{SpaceType, + ParentType, OpenType, ElemType } @@ -592,7 +592,7 @@ mutable struct PreSheafSection{SpaceType, D::IdDict{OpenType, ElemType} production_func - function PreSheafSection(F::AbsPreSheaf, + function PreSheafSection(F::AbsPreSheaf, D::IdDict{OpenType, ElemType}, production_func ) where {OpenType, ElemType} @@ -610,7 +610,7 @@ function (v::PreSheafSection{<:Any, <:AbsPreSheaf, OpenType, ElemType})(U::OpenT # First, look up whether this local representative has already been cached haskey(cache_dict(v), U) && return cache_dict(v)[U] # If not, delegate to the production function. - # These can restrict from suitable bigger sets, assemble from compatible + # These can restrict from suitable bigger sets, assemble from compatible # sections on refinements, extend trivially from other patches... s = production_func(v)(v, U) #cache_dict(v)[U] = s #TODO: Really cache all local representatives? diff --git a/src/AlgebraicGeometry/RationalPoint/AffineRationalPoint.jl b/src/AlgebraicGeometry/RationalPoint/AffineRationalPoint.jl index f3239aa97d59..d9a0a66ca5e5 100644 --- a/src/AlgebraicGeometry/RationalPoint/AffineRationalPoint.jl +++ b/src/AlgebraicGeometry/RationalPoint/AffineRationalPoint.jl @@ -114,7 +114,7 @@ end function _in(P::AbsAffineRationalPoint, X::AbsSpec) # slow fallback for affine opens # this should be improved - return issubset(scheme(P), X) + return is_subscheme(scheme(P), X) end function Base.in(P::AbsAffineRationalPoint, X::AbsSpec) diff --git a/src/AlgebraicGeometry/Schemes/AffineSchemes/Morphisms/Attributes.jl b/src/AlgebraicGeometry/Schemes/AffineSchemes/Morphisms/Attributes.jl index 45674668cda4..fd03da8c922c 100644 --- a/src/AlgebraicGeometry/Schemes/AffineSchemes/Morphisms/Attributes.jl +++ b/src/AlgebraicGeometry/Schemes/AffineSchemes/Morphisms/Attributes.jl @@ -183,7 +183,7 @@ function preimage( ) X = domain(phi) Y = codomain(phi) - check && (issubset(Z, Y) || (Z = intersect(Y, Z))) + check && (is_subscheme(Z, Y) || (Z = intersect(Y, Z))) IZ = modulus(underlying_quotient(OO(Z))) a = denominators(inverted_set(OO(Z))) R = ambient_coordinate_ring(X) diff --git a/src/AlgebraicGeometry/Schemes/AffineSchemes/Morphisms/Constructors.jl b/src/AlgebraicGeometry/Schemes/AffineSchemes/Morphisms/Constructors.jl index 1283d6e83e42..66a5a7636c84 100644 --- a/src/AlgebraicGeometry/Schemes/AffineSchemes/Morphisms/Constructors.jl +++ b/src/AlgebraicGeometry/Schemes/AffineSchemes/Morphisms/Constructors.jl @@ -247,9 +247,9 @@ true ``` """ function restrict(f::SpecMor, U::AbsSpec, V::AbsSpec; check::Bool=true) - @check issubset(U, domain(f)) "second argument does not lie in the domain of the map" - @check issubset(V, codomain(f)) "third argument does not lie in the codomain of the map" - @check issubset(U, preimage(f, V)) "the image of the restriction is not contained in the restricted codomain" + @check is_subscheme(U, domain(f)) "second argument does not lie in the domain of the map" + @check is_subscheme(V, codomain(f)) "third argument does not lie in the codomain of the map" + @check is_subscheme(U, preimage(f, V)) "the image of the restriction is not contained in the restricted codomain" return morphism(U, V, (x->OO(U)(x, check=check)).(pullback(f).(gens(domain(pullback(f))))), check=check) end diff --git a/src/AlgebraicGeometry/Schemes/AffineSchemes/Morphisms/Methods.jl b/src/AlgebraicGeometry/Schemes/AffineSchemes/Morphisms/Methods.jl index 1c9c8d177573..d2e952bfb1ee 100644 --- a/src/AlgebraicGeometry/Schemes/AffineSchemes/Morphisms/Methods.jl +++ b/src/AlgebraicGeometry/Schemes/AffineSchemes/Morphisms/Methods.jl @@ -8,8 +8,8 @@ For morphisms ``f : X → Z`` and ``g : Y → Z`` return the fiber product ``X×Y`` over ``Z`` together with its two canonical projections. -Whenever you have another set of maps `a: W → X` and `b : W → Y` forming -a commutative square with `f` and `g`, you can use +Whenever you have another set of maps `a: W → X` and `b : W → Y` forming +a commutative square with `f` and `g`, you can use `induced_map_to_fiber_product` to create the resulting map `W → X×Y`. """ function fiber_product( @@ -26,15 +26,15 @@ function fiber_product( return W, restrict(pY, W, Y, check=false), restrict(pZ, W, Z, check=false) end -# Whenever one of the maps, say f, in a fiber product is a `PrincipalOpenEmbedding` -# then the fiber product is only the restriction of g to g^{-1}(image(f)). -# This can be computed much easier and, in particular, without introducing -# extra variables: One just pulls back the `complement_equations` for `f` to -# the domain of `g`. +# Whenever one of the maps, say f, in a fiber product is a `PrincipalOpenEmbedding` +# then the fiber product is only the restriction of g to g^{-1}(image(f)). +# This can be computed much easier and, in particular, without introducing +# extra variables: One just pulls back the `complement_equations` for `f` to +# the domain of `g`. # -# We need this more simple procedure for refinements of coverings. In particular, -# it is important that the resulting fiber product is a PrincipalOpenSubset of -# the domain of `g` (or the domain of `f` when it's the other way around), so that +# We need this more simple procedure for refinements of coverings. In particular, +# it is important that the resulting fiber product is a PrincipalOpenSubset of +# the domain of `g` (or the domain of `f` when it's the other way around), so that # the ancestry-tree for patches is preserved. function fiber_product(f::PrincipalOpenEmbedding, g::AbsSpecMor) @assert codomain(f) === codomain(g) "codomains are not the same" @@ -74,12 +74,12 @@ end @doc raw""" induced_map_to_fiber_product( - a::AbsSpecMor, b::AbsSpecMor, + a::AbsSpecMor, b::AbsSpecMor, f::AbsSpecMor, g::AbsSpecMor; fiber_product::Tuple{<:AbsSpec, <:AbsSpecMor, <:AbsSpecMor}=fiber_product(f, g) ) -In a commutative diagram +In a commutative diagram ``` b W ------------. @@ -94,12 +94,12 @@ In a commutative diagram this computes the canonical map `W -> X x Y`. """ function induced_map_to_fiber_product( - a::AbsSpecMor, b::AbsSpecMor, + a::AbsSpecMor, b::AbsSpecMor, f::AbsSpecMor, g::AbsSpecMor; fiber_product::Tuple{<:AbsSpec, <:AbsSpecMor, <:AbsSpecMor}=fiber_product(f, g), check::Bool=true ) - # All checks are done here. The actual computations are carried out + # All checks are done here. The actual computations are carried out # in an internal method. X = domain(f) Y = domain(g) @@ -121,14 +121,14 @@ function induced_map_to_fiber_product( end function _induced_map_to_fiber_product( - a::AbsSpecMor, b::AbsSpecMor, + a::AbsSpecMor, b::AbsSpecMor, f::AbsSpecMor, g::AbsSpecMor; fiber_product::Tuple{<:AbsSpec, <:AbsSpecMor, <:AbsSpecMor}=fiber_product(f, g), check::Bool=true ) - # The ambient scheme of XxY is the actual product of X and Y - # over Spec(k), the coefficient ring. If it is not, then - # this is due to special dispatch which has to also be caught + # The ambient scheme of XxY is the actual product of X and Y + # over Spec(k), the coefficient ring. If it is not, then + # this is due to special dispatch which has to also be caught # with a special method for this function here. XxY = fiber_product[1] gg = fiber_product[2] @@ -142,11 +142,11 @@ function _induced_map_to_fiber_product( return morphism(W, XxY, img_gens, check=check) end -# When the fiber product was created from at least one `PrincipalOpenEmbedding`, +# When the fiber product was created from at least one `PrincipalOpenEmbedding`, # then the construction did not proceed via the `product` of `X` and `Y`. # In this case, the induced map must be created differently. function _induced_map_to_fiber_product( - a::AbsSpecMor, b::AbsSpecMor, + a::AbsSpecMor, b::AbsSpecMor, f::PrincipalOpenEmbedding, g::AbsSpecMor; fiber_product::Tuple{<:AbsSpec, <:AbsSpecMor, <:PrincipalOpenEmbedding}=fiber_product(f, g), check::Bool=true @@ -160,7 +160,7 @@ function _induced_map_to_fiber_product( end function _induced_map_to_fiber_product( - a::AbsSpecMor, b::AbsSpecMor, + a::AbsSpecMor, b::AbsSpecMor, f::AbsSpecMor, g::PrincipalOpenEmbedding; fiber_product::Tuple{<:AbsSpec, <:PrincipalOpenEmbedding, <:AbsSpecMor}=fiber_product(f, g), check::Bool=true @@ -175,7 +175,7 @@ end # additional method to remove ambiguity function _induced_map_to_fiber_product( - a::AbsSpecMor, b::AbsSpecMor, + a::AbsSpecMor, b::AbsSpecMor, f::PrincipalOpenEmbedding, g::PrincipalOpenEmbedding; fiber_product::Tuple{<:AbsSpec, <:PrincipalOpenEmbedding, <:PrincipalOpenEmbedding}=fiber_product(f, g), check::Bool=true @@ -192,30 +192,30 @@ end function _restrict_domain(f::AbsSpecMor, D::PrincipalOpenSubset; check::Bool=true) D === domain(f) && return f ambient_scheme(D) === domain(f) && return morphism(D, codomain(f), OO(D).(pullback(f).(gens(OO(codomain(f))))), check=false) - @check is_subset(D, domain(f)) "domain incompatible" + @check is_subscheme(D, domain(f)) "domain incompatible" return morphism(D, codomain(f), OO(D).(pullback(f).(gens(OO(codomain(f))))), check=check) end function _restrict_domain(f::AbsSpecMor, D::AbsSpec; check::Bool=true) D === domain(f) && return f - @check is_subset(D, domain(f)) "domain incompatible" + @check is_subscheme(D, domain(f)) "domain incompatible" return morphism(D, codomain(f), OO(D).(pullback(f).(gens(OO(codomain(f))))), check=check) end function _restrict_codomain(f::AbsSpecMor, D::PrincipalOpenSubset; check::Bool=true) D === codomain(f) && return f - if ambient_scheme(D) === codomain(f) + if ambient_scheme(D) === codomain(f) @check is_unit(pullback(f)(complement_equation(D))) "complement equation does not pull back to a unit" return morphism(domain(f), D, OO(domain(f)).(pullback(f).(gens(OO(codomain(f))))), check=false) end - @check is_subset(D, codomain(f)) "codomain incompatible" - @check is_subset(domain(f), preimage(f, D)) + @check is_subscheme(D, codomain(f)) "codomain incompatible" + @check is_subscheme(domain(f), preimage(f, D)) return morphism(domain(f), D, OO(domain(f)).(pullback(f).(gens(OO(codomain(f))))), check=check) end function _restrict_codomain(f::AbsSpecMor, D::AbsSpec; check::Bool=true) - @check is_subset(D, codomain(f)) "codomain incompatible" - @check is_subset(domain(f), preimage(f, D)) + @check is_subscheme(D, codomain(f)) "codomain incompatible" + @check is_subscheme(domain(f), preimage(f, D)) return morphism(domain(f), D, OO(domain(f)).(pullback(f).(gens(OO(codomain(f))))), check=check) end @@ -267,7 +267,7 @@ end @doc raw""" product(X::AbsSpec, Y::AbsSpec) - + Return a triple ``(X×Y, p₁, p₂)`` consisting of the product ``X×Y`` over the common base ring ``𝕜`` and the two projections ``p₁ : X×Y → X`` and ``p₂ : X×Y → Y``. @@ -293,7 +293,7 @@ function product(X::StdSpec, Y::StdSpec; change_var_names_to::Vector{String}=["", ""] ) K = OO(X) - L = OO(Y) + L = OO(Y) V = localized_ring(K) W = localized_ring(L) R = base_ring(K) @@ -306,12 +306,12 @@ function product(X::StdSpec, Y::StdSpec; new_symb = Symbol[] if length(change_var_names_to[1]) == 0 new_symb = symbols(R) - else + else new_symb = Symbol.([change_var_names_to[1]*"$i" for i in 1:ngens(R)]) end if length(change_var_names_to[2]) == 0 new_symb = vcat(new_symb, symbols(S)) - else + else new_symb = vcat(new_symb, Symbol.([change_var_names_to[2]*"$i" for i in 1:ngens(S)])) end RS, z = polynomial_ring(k, new_symb) @@ -408,9 +408,9 @@ end codomain_map::AbsSpecMor=base_change(phi, codomain(f))[2] ) -For a morphism ``f : X → Y`` between two schemes over a `base_ring` ``𝕜`` -and a ring homomorphism ``φ : 𝕜 → 𝕂`` this returns a triple -`(b₁, F, b₂)` consisting of the maps in the commutative diagram +For a morphism ``f : X → Y`` between two schemes over a `base_ring` ``𝕜`` +and a ring homomorphism ``φ : 𝕜 → 𝕂`` this returns a triple +`(b₁, F, b₂)` consisting of the maps in the commutative diagram ``` f X → Y @@ -418,10 +418,10 @@ and a ring homomorphism ``φ : 𝕜 → 𝕂`` this returns a triple X×ₖSpec(𝕂) → Y×ₖSpec(𝕂) F ``` -The optional arguments `domain_map` and `codomain_map` can be used -to specify the morphisms `b₁` and `b₂`, respectively. +The optional arguments `domain_map` and `codomain_map` can be used +to specify the morphisms `b₁` and `b₂`, respectively. """ -function base_change(phi::Any, f::AbsSpecMor; +function base_change(phi::Any, f::AbsSpecMor; domain_map::AbsSpecMor=base_change(phi, domain(f))[2], codomain_map::AbsSpecMor=base_change(phi, codomain(f))[2] ) @@ -439,7 +439,7 @@ function base_change(phi::Any, f::AbsSpecMor; SS = OO(XX) img_gens = [pb1(pbf(x)) for x in gens(R)] - # For the pullback of F no explicit coeff_map is necessary anymore + # For the pullback of F no explicit coeff_map is necessary anymore # since both rings in domain and codomain have the same (extended/reduced) # coefficient ring by now. pbF = hom(RR, SS, img_gens, check=false) # TODO: Set to false after testing @@ -447,14 +447,14 @@ function base_change(phi::Any, f::AbsSpecMor; return domain_map, morphism(XX, YY, pbF, check=false), codomain_map # TODO: Set to false after testing end -function _register_birationality!(f::AbsSpecMor, +function _register_birationality!(f::AbsSpecMor, g::AbsSpecMor, ginv::AbsSpecMor) set_attribute!(g, :inverse, ginv) set_attribute!(ginv, :inverse, g) return _register_birationality(f, g) end -function _register_birationality!(f::AbsSpecMor, +function _register_birationality!(f::AbsSpecMor, g::AbsSpecMor ) set_attribute!(f, :is_birational, true) diff --git a/src/AlgebraicGeometry/Schemes/AffineSchemes/Objects/Constructors.jl b/src/AlgebraicGeometry/Schemes/AffineSchemes/Objects/Constructors.jl index bacfbf97042c..23a9a57b2cce 100644 --- a/src/AlgebraicGeometry/Schemes/AffineSchemes/Objects/Constructors.jl +++ b/src/AlgebraicGeometry/Schemes/AffineSchemes/Objects/Constructors.jl @@ -795,7 +795,7 @@ function closure( Y::AbsSpec{BRT, <:MPolyAnyRing}; check::Bool=true ) where {BRT} - @check issubset(X, Y) "the first argument is not a subset of the second" + @check is_subscheme(X, Y) "the first argument is not a subset of the second" return X end @@ -804,7 +804,7 @@ function closure( Y::AbsSpec{BRT, <:MPolyAnyRing}; check::Bool=true ) where {BRT} - @check issubset(X, Y) "the first argument is not a subset of the second" + @check is_subscheme(X, Y) "the first argument is not a subset of the second" return Y end @@ -813,7 +813,7 @@ function closure( Y::AbsSpec{BRT, <:MPolyLocRing}; check::Bool=true ) where {BRT} - @check issubset(X, Y) "the first argument is not a subset of the second" + @check is_subscheme(X, Y) "the first argument is not a subset of the second" return Y end @@ -823,7 +823,7 @@ function closure( Y::AbsSpec{BRT, <:Union{MPolyRing,MPolyQuoRing}}; check::Bool=true ) where {BRT} - @check issubset(X, Y) "the first argument is not a subset of the second" + @check is_subscheme(X, Y) "the first argument is not a subset of the second" I = saturated_ideal(defining_ideal(X)) return Spec(base_ring(I),I) end @@ -833,7 +833,7 @@ function closure( Y::AbsSpec{BRT, <:MPolyLocRing}; check::Bool=true ) where {BRT} - @check issubset(X, Y) "the first argument is not a subset of the second" + @check is_subscheme(X, Y) "the first argument is not a subset of the second" I = saturated_ideal(defining_ideal(X)) R = base_ring(I) return Spec(MPolyQuoLocRing(R, I, inverted_set(Y))) @@ -845,7 +845,7 @@ function closure( check::Bool=true ) where {BRT, RT<:MPolyQuoLocRing{<:Any, <:Any, <:Any, <:Any, <:MPolyPowersOfElement}} - @check issubset(X, Y) "the first argument is not a subset of the second" + @check is_subscheme(X, Y) "the first argument is not a subset of the second" #is_closed_embedding(X, Y) && return X W, _ = localization(inverted_set(OO(X))*inverted_set(OO(Y))) I = ideal(W, W.(gens(modulus(OO(X))))) diff --git a/src/AlgebraicGeometry/Schemes/AffineSchemes/Objects/Methods.jl b/src/AlgebraicGeometry/Schemes/AffineSchemes/Objects/Methods.jl index c2e14c946dd0..8890af005167 100644 --- a/src/AlgebraicGeometry/Schemes/AffineSchemes/Objects/Methods.jl +++ b/src/AlgebraicGeometry/Schemes/AffineSchemes/Objects/Methods.jl @@ -13,12 +13,12 @@ end function ==(X::AbsSpec, Y::AbsSpec) X === Y && return true - return issubset(X, Y) && issubset(Y, X) + return is_subscheme(X, Y) && is_subscheme(Y, X) end function ==(X::AbsSpec, Y::EmptyScheme) - return issubset(X, Y) + return is_subscheme(X, Y) end diff --git a/src/AlgebraicGeometry/Schemes/AffineSchemes/Objects/Properties.jl b/src/AlgebraicGeometry/Schemes/AffineSchemes/Objects/Properties.jl index e9626ba7c437..46e699c87cec 100644 --- a/src/AlgebraicGeometry/Schemes/AffineSchemes/Objects/Properties.jl +++ b/src/AlgebraicGeometry/Schemes/AffineSchemes/Objects/Properties.jl @@ -30,15 +30,15 @@ is_empty(X::EmptyScheme) = true #################################################################################### -# (2) IsSubset for all other schemes +# (2) is_subscheme for all other schemes #################################################################################### -# (2.0) For empty schemes and whenever issubset cannot be implemented +# (2.0) For empty schemes and whenever is_subscheme cannot be implemented @doc raw""" - is_subset(X::AbsSpec, Y::AbsSpec) + is_subscheme(X::AbsSpec, Y::AbsSpec) Check whether ``X`` is a subset of ``Y`` based on the comparison of their coordinate rings. See [`inclusion_morphism(::AbsSpec, ::AbsSpec)`](@ref) for the corresponding morphism. @@ -67,27 +67,27 @@ Spectrum over rational field by ideal(x1*x2) -julia> is_subset(X, Y) +julia> is_subscheme(X, Y) false -julia> is_subset(Y, X) +julia> is_subscheme(Y, X) true ``` """ -function issubset(X::AbsSpec, Y::AbsSpec) - error("method `issubset(X, Y)` not implemented for `X` of type $(typeof(X)) and `Y` of type $(typeof(Y))") +function is_subscheme(X::AbsSpec, Y::AbsSpec) + error("method `is_subscheme(X, Y)` not implemented for `X` of type $(typeof(X)) and `Y` of type $(typeof(Y))") end -issubset(X::EmptyScheme{BRT}, Y::Scheme{BRT}) where {BRT} = true +is_subscheme(X::EmptyScheme{BRT}, Y::Scheme{BRT}) where {BRT} = true -function issubset(Y::AbsSpec{BRT, <:Any}, X::EmptyScheme{BRT}) where {BRT} +function is_subscheme(Y::AbsSpec{BRT, <:Any}, X::EmptyScheme{BRT}) where {BRT} return iszero(one(OO(Y))) end # (2.1) MPolyRing in first argument -function issubset( +function is_subscheme( X::AbsSpec{BRT, RT}, Y::AbsSpec{BRT, RT} ) where {BRT, RT<:MPolyRing} @@ -95,8 +95,8 @@ function issubset( end -function issubset( - X::AbsSpec{BRT, <:MPolyRing}, +function is_subscheme( + X::AbsSpec{BRT, <:MPolyRing}, Y::AbsSpec{BRT, <:MPolyQuoRing} ) where {BRT} R = OO(X) @@ -105,7 +105,7 @@ function issubset( end -function issubset( +function is_subscheme( X::AbsSpec{BRT, <:MPolyRing}, Y::AbsSpec{BRT, <:MPolyLocRing} ) where {BRT} @@ -115,7 +115,7 @@ function issubset( end -function issubset( +function is_subscheme( X::AbsSpec{BRT, <:MPolyRing}, Y::AbsSpec{BRT, <:MPolyQuoLocRing} ) where {BRT} @@ -127,7 +127,7 @@ end # (2.2) MPolyQuoRing in first argument -function issubset( +function is_subscheme( X::AbsSpec{BRT, <:MPolyQuoRing}, Y::AbsSpec{BRT, <:MPolyRing} ) where {BRT} @@ -137,7 +137,7 @@ function issubset( end -function issubset( +function is_subscheme( X::AbsSpec{BRT, RT}, Y::AbsSpec{BRT, RT} ) where {BRT, RT<:MPolyQuoRing} @@ -147,7 +147,7 @@ function issubset( end -function issubset( +function is_subscheme( X::AbsSpec{BRT, <:MPolyQuoRing}, Y::AbsSpec{BRT, <:MPolyLocRing{<:Any, <:Any, <:Any, <:Any, <:MPolyPowersOfElement}} ) where {BRT} @@ -158,7 +158,7 @@ function issubset( end -function issubset( +function is_subscheme( X::AbsSpec{BRT, <:MPolyQuoRing}, Y::AbsSpec{BRT, <:MPolyQuoLocRing{<:Any, <:Any, <:Any, <:Any, <:MPolyPowersOfElement}} ) where {BRT} @@ -171,7 +171,7 @@ end # (2.3) MPolyLocRing in first argument -function issubset( +function is_subscheme( X::AbsSpec{BRT, <:MPolyLocRing}, Y::AbsSpec{BRT, <:MPolyRing} ) where {BRT} @@ -181,7 +181,7 @@ function issubset( end -function issubset( +function is_subscheme( X::AbsSpec{BRT, <:MPolyLocRing}, Y::AbsSpec{BRT, <:MPolyQuoRing} ) where {BRT} @@ -191,7 +191,7 @@ function issubset( end -function issubset( +function is_subscheme( X::AbsSpec{BRT, RT}, Y::AbsSpec{BRT, RT} ) where {BRT, RT<:MPolyLocRing} @@ -203,7 +203,7 @@ function issubset( end -function issubset( +function is_subscheme( X::AbsSpec{BRT, <:MPolyLocRing}, Y::AbsSpec{BRT, <:MPolyQuoLocRing} ) where {BRT} @@ -217,7 +217,7 @@ end # (2.4) MPolyQuoLocRing in first argument -function issubset( +function is_subscheme( X::AbsSpec{BRT, <:MPolyQuoLocRing}, Y::AbsSpec{BRT, <:MPolyRing} ) where {BRT} @@ -227,7 +227,7 @@ function issubset( end -function issubset( +function is_subscheme( X::AbsSpec{BRT, <:MPolyQuoLocRing}, Y::AbsSpec{BRT, <:MPolyQuoRing} ) where {BRT} @@ -238,7 +238,7 @@ function issubset( end -function issubset( +function is_subscheme( X::AbsSpec{BRT, <:MPolyQuoLocRing}, Y::AbsSpec{BRT, <:MPolyLocRing{<:Any, <:Any, <:Any, <:Any, <:MPolyPowersOfElement}} ) where {BRT} @@ -256,7 +256,7 @@ function issubset( end -function issubset( +function is_subscheme( X::AbsSpec{BRT, RT}, Y::AbsSpec{BRT, RT} ) where {BRT, RT<:MPolyQuoLocRing{<:Any, <:Any, <:Any, <:Any, <:MPolyPowersOfElement}} @@ -274,7 +274,7 @@ function issubset( return issubset(J, modulus(OO(X))) end -function issubset( +function is_subscheme( X::AbsSpec{BRT, <:MPolyQuoLocRing}, Y::AbsSpec{BRT, <:MPolyQuoLocRing{<:Any, <:Any, <:Any, <:Any, <:MPolyComplementOfKPointIdeal}}) where {BRT} R = ambient_coordinate_ring(X) @@ -352,7 +352,7 @@ function is_open_embedding( UY = inverted_set(OO(Y)) issubset(UY, UX) || return false J = localized_ring(OO(X))(modulus(underlying_quotient(OO(Y)))) - return modulus(OO(X)) == J + return modulus(OO(X)) == J end @@ -456,7 +456,7 @@ end function is_closed_embedding( - X::AbsSpec{<:Ring, <:MPolyLocRing{<:Any, <:Any, <:Any, <:Any, + X::AbsSpec{<:Ring, <:MPolyLocRing{<:Any, <:Any, <:Any, <:Any, <:MPolyPowersOfElement}}, Y::AbsSpec{<:Ring, <:MPolyRing} @@ -471,14 +471,14 @@ end function is_closed_embedding( - X::AbsSpec{<:Ring, <:MPolyQuoLocRing{<:Any, <:Any, <:Any, <:Any, + X::AbsSpec{<:Ring, <:MPolyQuoLocRing{<:Any, <:Any, <:Any, <:Any, <:MPolyPowersOfElement}}, Y::AbsSpec{<:Ring, <:MPolyQuoRing} ) R = ambient_coordinate_ring(X) R === ambient_coordinate_ring(Y) || return false - for x in inverted_set(OO(X)) + for x in inverted_set(OO(X)) is_unit(OO(Y)(x)) || return false end for g in gens(modulus(OO(Y))) @@ -527,7 +527,7 @@ end # TODO: projective schemes, covered schemes @doc raw""" - is_equidimensional(X::AbsSpec{<:Field, <:MPolyAnyRing}) + is_equidimensional(X::AbsSpec{<:Field, <:MPolyAnyRing}) Check whether the scheme `X` is equidimensional. @@ -616,7 +616,7 @@ end ######################################################################## # (7) Smoothness test based on projective modules. # The routine checks whether the module for the cotangent sheaf Ω¹(X) -# is locally free over 𝒪(X) and returns `true` if this is the case. +# is locally free over 𝒪(X) and returns `true` if this is the case. ######################################################################## # TODO: is_regular using Hironaka's criterion @@ -625,7 +625,7 @@ end Check whether the scheme `X` is smooth. -Note that smoothness and regularity do not coincide over non-perfect fields. +Note that smoothness and regularity do not coincide over non-perfect fields. Smoothness implies regularity, but regular non-smooth schemes exist. See also [`singular_locus`](@ref), [`singular_locus_reduced`](@ref). @@ -727,7 +727,7 @@ Check whether the affine scheme `X` is irreducible. """ @attr Bool function is_irreducible(X::AbsSpec{<:Field, <:MPolyAnyRing}) !is_empty(X) || return false - !get_attribute(X, :is_integral, false) || return true + !get_attribute(X, :is_integral, false) || return true ## integral = irreducible + reduced return (length(minimal_primes(saturated_ideal(modulus(OO(X))))) == 1) end diff --git a/src/AlgebraicGeometry/Schemes/Gluing/Constructors.jl b/src/AlgebraicGeometry/Schemes/Gluing/Constructors.jl index 56b4ffd6b1bb..63847bab7a30 100644 --- a/src/AlgebraicGeometry/Schemes/Gluing/Constructors.jl +++ b/src/AlgebraicGeometry/Schemes/Gluing/Constructors.jl @@ -241,7 +241,7 @@ function maximal_extension(G::SimpleGluing) pby = pullback(f).(y) U2, ext_y = maximal_extension(X, fraction.(pby)) V2, ext_x = maximal_extension(Y, fraction.(pbx)) - issubset(U2, U) && issubset(V2, V) && return G + is_subscheme(U2, U) && is_subscheme(V2, V) && return G return maximal_extension(Gluing(G)) end diff --git a/src/AlgebraicGeometry/Schemes/Gluing/Methods.jl b/src/AlgebraicGeometry/Schemes/Gluing/Methods.jl index f68360bc8765..b76535ac9a3a 100644 --- a/src/AlgebraicGeometry/Schemes/Gluing/Methods.jl +++ b/src/AlgebraicGeometry/Schemes/Gluing/Methods.jl @@ -137,7 +137,7 @@ function maximal_extension(G::Gluing) g_ext = maximal_extension(Y, X, generic_fractions(g)) U_new = preimage(f_ext, domain(g_ext)) V_new = preimage(g_ext, U_new) - issubset(domain(g_ext), V_new) || error("extension failed") + is_subscheme(domain(g_ext), V_new) || error("extension failed") f_ext = restrict(f_ext, U_new, V_new) g_ext = restrict(g_ext, V_new, U_new) return Gluing(X, Y, f_ext, g_ext) diff --git a/src/AlgebraicGeometry/Schemes/ProjectiveSchemes/Objects/Methods.jl b/src/AlgebraicGeometry/Schemes/ProjectiveSchemes/Objects/Methods.jl index 4f50345c2ccd..7c6e430c64a2 100644 --- a/src/AlgebraicGeometry/Schemes/ProjectiveSchemes/Objects/Methods.jl +++ b/src/AlgebraicGeometry/Schemes/ProjectiveSchemes/Objects/Methods.jl @@ -121,7 +121,7 @@ function _dehomogenization_map(X::AbsProjectiveScheme, U::AbsSpec, i::Int) end function _dehomogenization_map( - X::AbsProjectiveScheme{CRT}, + X::AbsProjectiveScheme{CRT}, U::AbsSpec, i::Int ) where { @@ -138,7 +138,7 @@ end #= function dehomogenization_map( - X::AbsProjectiveScheme{CRT}, + X::AbsProjectiveScheme{CRT}, U::AbsSpec ) where { CRT<:Union{MPolyQuoLocRing, MPolyLocRing, MPolyRing, MPolyQuoRing} @@ -174,20 +174,20 @@ end @doc raw""" homogenization_map(P::AbsProjectiveScheme, U::AbsSpec) -Given an affine chart ``U ⊂ P`` of an `AbsProjectiveScheme` -``P``, return a method ``h`` for the homogenization of elements +Given an affine chart ``U ⊂ P`` of an `AbsProjectiveScheme` +``P``, return a method ``h`` for the homogenization of elements ``a ∈ 𝒪(U)``. This means that ``h(a)`` returns a pair ``(p, q)`` representing a fraction ``p/q ∈ S`` of the `ambient_coordinate_ring` of ``P`` such that ``a`` is the dehomogenization of ``p/q``. -**Note:** For the time being, this only works for affine +**Note:** For the time being, this only works for affine charts which are of the standard form ``sᵢ ≠ 0`` for ``sᵢ∈ S`` one of the homogeneous coordinates of ``P``. -**Note:** Since this map returns representatives only, it -is not a mathematical morphism and, hence, in particular +**Note:** Since this map returns representatives only, it +is not a mathematical morphism and, hence, in particular not an instance of `Map`. # Examples @@ -274,7 +274,7 @@ function _homogenization_map(P::AbsProjectiveScheme, U::AbsSpec, i::Int) end function _homogenization_map(P::AbsProjectiveScheme{<:MPolyAnyRing, <:MPolyDecRing}, U::AbsSpec, i::Int) - # Determine those variables which come from the homogeneous + # Determine those variables which come from the homogeneous # coordinates S = homogeneous_coordinate_ring(P) n = ngens(S) @@ -299,9 +299,9 @@ function _homogenization_map(P::AbsProjectiveScheme{<:MPolyAnyRing, <:MPolyDecRi deg_q = weighted_degree(q, w) deg_a = deg_p - deg_q ss = S[i] # the homogenization variable - + # preliminary lifts, not yet homogenized! - pp = evaluate(p, v) + pp = evaluate(p, v) qq = evaluate(q, v) # homogenize numerator and denominator @@ -319,7 +319,7 @@ function _homogenization_map(P::AbsProjectiveScheme{<:MPolyAnyRing, <:MPolyDecRi end function _homogenization_map(P::AbsProjectiveScheme{<:MPolyAnyRing, <:MPolyQuoRing}, U::AbsSpec, i::Int) - # Determine those variables which come from the homogeneous + # Determine those variables which come from the homogeneous # coordinates S = homogeneous_coordinate_ring(P) n = ngens(S) @@ -344,9 +344,9 @@ function _homogenization_map(P::AbsProjectiveScheme{<:MPolyAnyRing, <:MPolyQuoRi deg_q = weighted_degree(q, w) deg_a = deg_p - deg_q ss = S[i] # the homogenization variable - + # preliminary lifts, not yet homogenized! - pp = evaluate(p, v) + pp = evaluate(p, v) qq = evaluate(q, v) # homogenize numerator and denominator @@ -367,7 +367,7 @@ function getindex(X::AbsProjectiveScheme, U::AbsSpec) Xcov = covered_scheme(X) for C in coverings(Xcov) for j in 1:npatches(C) - if U === C[j] + if U === C[j] return C, j end end @@ -392,7 +392,7 @@ function ==(X::AbsProjectiveScheme, Y::AbsProjectiveScheme) return IXsat == IYsat end -function issubset(X::AbsProjectiveScheme, Y::AbsProjectiveScheme) +function is_subscheme(X::AbsProjectiveScheme, Y::AbsProjectiveScheme) ambient_space(X) == ambient_space(Y) || return false IX = defining_ideal(X) IY = defining_ideal(Y) diff --git a/src/AlgebraicGeometry/Schemes/SpecOpen/Morphisms/Constructors.jl b/src/AlgebraicGeometry/Schemes/SpecOpen/Morphisms/Constructors.jl index 2bb1d3c0da53..993a5693e964 100644 --- a/src/AlgebraicGeometry/Schemes/SpecOpen/Morphisms/Constructors.jl +++ b/src/AlgebraicGeometry/Schemes/SpecOpen/Morphisms/Constructors.jl @@ -20,7 +20,7 @@ end ######################################################################## function inclusion_morphism(U::SpecOpen, V::SpecOpen; check::Bool=true) X = ambient_scheme(U) - @check issubset(U, V) "method not implemented" + @check is_subscheme(U, V) "method not implemented" return SpecOpenMor(U, V, gens(ambient_coordinate_ring(X)), check=false) end @@ -48,9 +48,9 @@ end function restrict(f::SpecMor, U::SpecOpen, V::SpecOpen; check::Bool=true) @check begin - issubset(U, domain(f)) || error("$U is not contained in the domain of $f") - issubset(V, codomain(f)) || error("$V is not contained in the codomain of $f") - all(x->issubset(preimage(f, x), U), affine_patches(V)) || error("preimage of $V is not contained in $U") + is_subscheme(U, domain(f)) || error("$U is not contained in the domain of $f") + is_subscheme(V, codomain(f)) || error("$V is not contained in the codomain of $f") + all(x->is_subscheme(preimage(f, x), U), affine_patches(V)) || error("preimage of $V is not contained in $U") end return SpecOpenMor(U, V, [restrict(f, W, ambient_scheme(V), check=check) for W in affine_patches(U)]) end @@ -62,9 +62,9 @@ function restrict( check::Bool=true ) @check begin - issubset(U, domain(f)) || error("the given open is not an open subset of the domain of the map") - issubset(V, codomain(f)) || error("the given open is not an open subset of the codomain of the map") - issubset(preimage(f,V), U) || error("f(U) is not contained in V") + is_subscheme(U, domain(f)) || error("the given open is not an open subset of the domain of the map") + is_subscheme(V, codomain(f)) || error("the given open is not an open subset of the codomain of the map") + is_subscheme(preimage(f,V), U) || error("f(U) is not contained in V") end inc = inclusion_morphism(U, domain(f), check=check) help_map = compose(inc, f, check=check) @@ -75,8 +75,8 @@ end function restrict(f::SpecOpenMor, W::AbsSpec, Y::AbsSpec; check::Bool=true) @check begin - issubset(W, domain(f)) || error("$U is not contained in the domain of $f") - issubset(W, preimage(f, Y)) || error("image of $W is not contained in $Y") + is_subscheme(W, domain(f)) || error("$U is not contained in the domain of $f") + is_subscheme(W, preimage(f, Y)) || error("image of $W is not contained in $Y") end phi = restriction_map(domain(f), W) fy = [phi(pullback(f)(y)) for y in OO(codomain(f)).(gens(ambient_coordinate_ring(Y)))] diff --git a/src/AlgebraicGeometry/Schemes/SpecOpen/Morphisms/Methods.jl b/src/AlgebraicGeometry/Schemes/SpecOpen/Morphisms/Methods.jl index 2e8ddbb54416..f9853e22fb5d 100644 --- a/src/AlgebraicGeometry/Schemes/SpecOpen/Morphisms/Methods.jl +++ b/src/AlgebraicGeometry/Schemes/SpecOpen/Morphisms/Methods.jl @@ -61,7 +61,7 @@ function compose(f::SpecOpenMor, g::SpecOpenMor; check::Bool=true) U = domain(f) Cf = codomain(f) V = domain(g) - @check issubset(Cf, V) "maps are not compatible" + @check is_subscheme(Cf, V) "maps are not compatible" W = codomain(g) X = ambient_scheme(U) Y = ambient_scheme(V) diff --git a/src/AlgebraicGeometry/Schemes/SpecOpen/Objects/Methods.jl b/src/AlgebraicGeometry/Schemes/SpecOpen/Objects/Methods.jl index 218b69030dd4..c0368b2091cc 100644 --- a/src/AlgebraicGeometry/Schemes/SpecOpen/Objects/Methods.jl +++ b/src/AlgebraicGeometry/Schemes/SpecOpen/Objects/Methods.jl @@ -14,7 +14,7 @@ function intersect( X = ambient_scheme(U) ambient_coordinate_ring(U) === ambient_coordinate_ring(Y) || error("schemes can not be compared") X === Y && return SpecOpen(Y, complement_equations(U), check=check) - if check && !issubset(Y, X) + if check && !is_subscheme(Y, X) Y = intersect(Y, X) end return SpecOpen(Y, [g for g in complement_equations(U) if !iszero(OO(Y)(g))], check=check) @@ -42,24 +42,24 @@ end ######################################################################## # Containment and equality # ######################################################################## -function issubset( +function is_subscheme( Y::AbsSpec, U::SpecOpen ) ambient_coordinate_ring(Y) === ambient_coordinate_ring(U) || return false - issubset(Y, ambient_scheme(U)) || return false + is_subscheme(Y, ambient_scheme(U)) || return false return one(OO(Y)) in ideal(OO(Y), complement_equations(U)) end -function issubset( +function is_subscheme( U::SpecOpen, Y::AbsSpec ) - return all(issubset(V, Y) for V in affine_patches(U)) + return all(is_subscheme(V, Y) for V in affine_patches(U)) end -function issubset(U::SpecOpen, V::SpecOpen) +function is_subscheme(U::SpecOpen, V::SpecOpen) ambient_coordinate_ring(U) === ambient_coordinate_ring(V) || return false Z = complement(V) # perform an implicit radical membership test (Rabinowitsch) that is way more @@ -68,13 +68,13 @@ function issubset(U::SpecOpen, V::SpecOpen) isempty(hypersurface_complement(Z, g)) || return false end return true - #return issubset(complement(intersect(V, ambient_scheme(U))), complement(U)) + #return is_subscheme(complement(intersect(V, ambient_scheme(U))), complement(U)) end # TODO: Where did the type declaration go? function ==(U::SpecSubset, V::SpecSubset) ambient_coordinate_ring(U) === ambient_coordinate_ring(V) || return false - return issubset(U, V) && issubset(V, U) + return is_subscheme(U, V) && is_subscheme(V, U) end ######################################################################## @@ -115,7 +115,7 @@ function closure( U::SpecOpen, Y::AbsSpec; check::Bool=true ) - @check issubset(U, Y) "the first set is not contained in the second" + @check is_subscheme(U, Y) "the first set is not contained in the second" X = closure(U) return intersect(X, Y) end @@ -125,7 +125,7 @@ end ######################################################################## function preimage(f::AbsSpecMor, V::SpecOpen; check::Bool=true) - @check issubset(codomain(f), ambient_scheme(V)) "set is not guaranteed to be open in the codomain" + @check is_subscheme(codomain(f), ambient_scheme(V)) "set is not guaranteed to be open in the codomain" new_gens = pullback(f).(complement_equations(V)) return SpecOpen(domain(f), lifted_numerator.(new_gens), check=check) end diff --git a/src/AlgebraicGeometry/Schemes/SpecOpen/Rings/Methods.jl b/src/AlgebraicGeometry/Schemes/SpecOpen/Rings/Methods.jl index e415a92edac0..bc36cbb8f881 100644 --- a/src/AlgebraicGeometry/Schemes/SpecOpen/Rings/Methods.jl +++ b/src/AlgebraicGeometry/Schemes/SpecOpen/Rings/Methods.jl @@ -24,7 +24,7 @@ function restrict( return restrictions(f)[i] end end - check && (issubset(V, domain(f)) || error("the set is not contained in the domain of definition of the function")) + check && (is_subscheme(V, domain(f)) || error("the set is not contained in the domain of definition of the function")) VU = [intersect(V, U) for U in affine_patches(domain(f))] g = [OO(VU[i])(f[i]) for i in 1:length(VU)] #l = write_as_linear_combination(one(OO(V)), OO(V).(lifted_denominator.(g))) @@ -44,7 +44,7 @@ function restrict( return restrictions(f)[i] end end - check && (issubset(V, domain(f)) || error("the set is not contained in the domain of definition of the function")) + check && (is_subscheme(V, domain(f)) || error("the set is not contained in the domain of definition of the function")) VU = [intersect(V, U) for U in affine_patches(domain(f))] g = [OO(VU[i])(f[i]) for i in 1:length(VU)] J = ideal(OO(V), denominator.(g)) @@ -218,7 +218,7 @@ function restriction_map( # do the checks @check begin X == hypersurface_complement(Y, h) || error("$X is not the hypersurface complement of $h in the ambient variety of $U") - issubset(X, U) || error("$X is not a subset of $U") + is_subscheme(X, U) || error("$X is not a subset of $U") end # first find some basic relation hᵏ= ∑ᵢ aᵢ⋅dᵢ @@ -307,8 +307,8 @@ function restriction_map(U::SpecOpen{<:AbsSpec{<:Ring, <:AbsLocalizedRing}}, R = ambient_coordinate_ring(Y) R == ambient_coordinate_ring(X) || error("`ambient_coordinate_ring`s of the schemes not compatible") @check begin - issubset(X, Y) || error("$X is not contained in the ambient scheme of $U") - issubset(X, U) || error("$X is not a subset of $U") + is_subscheme(X, Y) || error("$X is not contained in the ambient scheme of $U") + is_subscheme(X, U) || error("$X is not a subset of $U") end L = localized_ring(OO(X)) D = denominators(inverted_set(L)) @@ -331,8 +331,8 @@ function restriction_map(U::SpecOpen{<:AbsSpec{<:Ring, <:MPolyQuoRing}}, R = ambient_coordinate_ring(Y) R == ambient_coordinate_ring(X) || error("rings not compatible") @check begin - issubset(X, Y) || error("$X is not contained in the ambient scheme of $U") - issubset(X, U) || error("$X is not a subset of $U") + is_subscheme(X, Y) || error("$X is not contained in the ambient scheme of $U") + is_subscheme(X, U) || error("$X is not a subset of $U") end h = prod(denominators(inverted_set(OO(X)))) return restriction_map(U, X, h, check=false) @@ -346,8 +346,8 @@ function restriction_map(U::SpecOpen{<:AbsSpec{<:Ring, <:MPolyRing}}, R = ambient_coordinate_ring(Y) R == ambient_coordinate_ring(X) || error("rings not compatible") @check begin - issubset(X, Y) || error("$X is not contained in the ambient scheme of $U") - issubset(X, U) || error("$X is not a subset of $U") + is_subscheme(X, Y) || error("$X is not contained in the ambient scheme of $U") + is_subscheme(X, U) || error("$X is not a subset of $U") end h = prod(denominators(inverted_set(OO(X)))) return restriction_map(U, X, h, check=false) @@ -376,7 +376,7 @@ end function restriction_map(X::Spec, U::SpecOpen; check::Bool=true) Y = ambient_scheme(U) - @check all(V->issubset(V, X), affine_patches(U)) "$U is not a subset of $X" + @check all(V->is_subscheme(V, X), affine_patches(U)) "$U is not a subset of $X" function mymap(f::MPolyQuoLocRingElem) return SpecOpenRingElem(OO(U), [OO(V)(f) for V in affine_patches(U)]) end @@ -384,7 +384,7 @@ function restriction_map(X::Spec, U::SpecOpen; check::Bool=true) end function restriction_map(U::SpecOpen, V::SpecOpen; check::Bool=true) - @check issubset(V, U) "$V is not a subset of $U" + @check is_subscheme(V, U) "$V is not a subset of $U" if U === V function mymap(f::SpecOpenRingElem) diff --git a/src/AlgebraicGeometry/Schemes/SpecOpen/Rings/Types.jl b/src/AlgebraicGeometry/Schemes/SpecOpen/Rings/Types.jl index 2d04080f758a..ae23fbc93296 100644 --- a/src/AlgebraicGeometry/Schemes/SpecOpen/Rings/Types.jl +++ b/src/AlgebraicGeometry/Schemes/SpecOpen/Rings/Types.jl @@ -21,7 +21,7 @@ mutable struct SpecOpenRing{SpecType, OpenType} <: Ring U::OpenType; check::Bool=true ) where {SpecType<:AbsSpec, OpenType<:SpecOpen} - @check issubset(U, X) "open set does not lay in the scheme" + @check is_subscheme(U, X) "open set does not lay in the scheme" return new{SpecType, OpenType}(X, U) end end diff --git a/src/exports.jl b/src/exports.jl index c8e00465aa67..015d6d7477e0 100644 --- a/src/exports.jl +++ b/src/exports.jl @@ -843,6 +843,7 @@ export is_standard_basis export is_standard_graded export is_strongly_connected export is_subset +export is_subscheme export is_supersolvable, has_is_supersolvable, set_is_supersolvable export is_surjective export is_ternary diff --git a/test/AlgebraicGeometry/Schemes/AffineSchemes.jl b/test/AlgebraicGeometry/Schemes/AffineSchemes.jl index f08f89c1b2c9..8916a579f89f 100644 --- a/test/AlgebraicGeometry/Schemes/AffineSchemes.jl +++ b/test/AlgebraicGeometry/Schemes/AffineSchemes.jl @@ -18,8 +18,8 @@ @test is_non_zero_divisor(f,A3) Xsub = subscheme(A3,J) @test !is_open_embedding(X,A3) - @test issubset(Xsub,X) - @test !issubset(X, Xsub) + @test is_subscheme(Xsub,X) + @test !is_subscheme(X, Xsub) set_name!(X, "X") @test iszero(OO(X)(f)) U = hypersurface_complement(A3, x) @@ -30,24 +30,24 @@ @test !is_open_embedding(UX,U) @test_broken is_closed_embedding(UX,U) @test !is_open_embedding(UX,A3) - @test issubset(UX,U) - @test issubset(UX,X) - @test issubset(U,A3) - @test !issubset(A3,U) + @test is_subscheme(UX,U) + @test is_subscheme(UX,X) + @test is_subscheme(U,A3) + @test !is_subscheme(A3,U) line = subscheme(A3, x) line_complement = hypersurface_complement(A3,x) - @test !issubset(line,line_complement) - @test !issubset(line_complement,line) - @test !issubset(line, X) - @test issubset(Xsub, line) + @test !is_subscheme(line,line_complement) + @test !is_subscheme(line_complement,line) + @test !is_subscheme(line, X) + @test is_subscheme(Xsub, line) U1 = hypersurface_complement(A3, [x]) @test ambient_coordinate_ring(U) === R set_name!(U, "U") UX = intersect(X, U) @test defining_ideal(UX) isa Oscar.MPolyLocalizedIdeal set_name!(UX, "U ∩ X") - @test issubset(UX, X) - @test issubset(UX, U) + @test is_subscheme(UX, X) + @test is_subscheme(UX, U) @test name(UX) == "U ∩ X" @test X == closure(UX, A3) @test is_open_embedding(UX, X) @@ -56,7 +56,7 @@ subscheme(UX, [y^2]) Z = subscheme(X, y^2) @test closure(UZ, X)==Z - + S, (u,v) = QQ["u", "v"] A2 = Spec(S) set_name!(A2, "𝔸²") @@ -68,19 +68,19 @@ psi = restrict(phi, phi_L, L) Gamma_psi, p, q = graph(psi) @test iszero(pullback(p)(OO(phi_L)(y//z)) - pullback(q)(OO(L)(v))) - + Xstd = Oscar.standard_spec(X) mirr = morphism(Xstd, Xstd, [y, x, z]) @test is_isomorphism(mirr) @test pullback(compose(inverse(mirr), mirr))(OO(Xstd)(x^2-34*z)) == OO(Xstd)(x^2-34*z+ f^2) @test is_empty(EmptyScheme(QQ)) - @test issubset(EmptyScheme(QQ),A3) - @test issubset(EmptyScheme(QQ),U) - @test !issubset(U,EmptyScheme(QQ)) - @test issubset(X,A3) - @test !issubset(A3, X) - @test issubset(A3,A3) - @test issubset(intersect(A3,A3), A3) + @test is_subscheme(EmptyScheme(QQ),A3) + @test is_subscheme(EmptyScheme(QQ),U) + @test !is_subscheme(U,EmptyScheme(QQ)) + @test is_subscheme(X,A3) + @test !is_subscheme(A3, X) + @test is_subscheme(A3,A3) + @test is_subscheme(intersect(A3,A3), A3) end # Tests for dimension when localizing with respect to either a prime @@ -103,7 +103,7 @@ end A3_localized_along_line = Spec(localization(R, complement_of_prime_ideal(ideal(R, [x, y])))[1]) @test dim(A3_localized_along_line) == 2 @test dim(Oscar.standard_spec(A3_localized_along_line)) == 2 - + S = complement_of_point_ideal(R, [1, 1, 1]) I = ideal(R, [x-1, y-1])*ideal(R, z) L, _ = localization(R, S) @@ -187,25 +187,25 @@ end set_name!(X, "X") @test iszero(OO(X)(f)) U = hypersurface_complement(A3, x) - @test issubset(intersect(A3,U),intersect(U,A3)) + @test is_subscheme(intersect(A3,U),intersect(U,A3)) V = PrincipalOpenSubset(U) @test dim(V) == 3 - @test issubset(U,V) - @test issubset(V,V) + @test is_subscheme(U,V) + @test is_subscheme(V,V) - @test_broken issubset(intersect(A3,V),intersect(V,A3)) - @test issubset(intersect(U,A3),V) - @test_broken issubset(intersect(A3,V),A3) + @test_broken is_subscheme(intersect(A3,V),intersect(V,A3)) + @test is_subscheme(intersect(U,A3),V) + @test_broken is_subscheme(intersect(A3,V),A3) @test ambient_coordinate_ring(V)===R @test ambient_coordinate_ring(U) === R @test Oscar.ring_type(V) == typeof(OO(V)) @test Oscar.base_ring_type(typeof(V)) == typeof(QQ) @test Oscar.base_ring_elem_type(V) == QQFieldElem @test base_ring(V) == QQ - @test issubset(V,U) - @test issubset(U,V) - @test issubset(V,A3) - @test !issubset(A3, V) + @test is_subscheme(V,U) + @test is_subscheme(U,V) + @test is_subscheme(V,A3) + @test !is_subscheme(A3, V) h = gens(OO(V))[1] hypersurface_complement(V, h) hypersurface_complement(V, [h]) @@ -283,7 +283,7 @@ end m2 = compose(phi4, inclusion_morphism(V, IA2)); @test m1 == m2 - # Testing morphisms + # Testing morphisms inc_U = inclusion_morphism(V, X) (a, b, c) = base_change(pr, inc_U) @test compose(a, inc_U) == compose(b, c) diff --git a/test/AlgebraicGeometry/Schemes/ProjectiveRationalPoint.jl b/test/AlgebraicGeometry/Schemes/ProjectiveRationalPoint.jl index 3280d4ad1bb8..fb88f806fcbd 100644 --- a/test/AlgebraicGeometry/Schemes/ProjectiveRationalPoint.jl +++ b/test/AlgebraicGeometry/Schemes/ProjectiveRationalPoint.jl @@ -13,7 +13,7 @@ A = algebraic_set(X) @test A([1,1,1]) == X([1,1,1]) - @test issubset(scheme(A([1,1,1])), A) + @test is_subscheme(scheme(A([1,1,1])), A) P2Z = projective_space(ZZ, 2) diff --git a/test/AlgebraicGeometry/Schemes/ProjectiveSchemes.jl b/test/AlgebraicGeometry/Schemes/ProjectiveSchemes.jl index 54fcc06b0989..47c5ec8fdac0 100644 --- a/test/AlgebraicGeometry/Schemes/ProjectiveSchemes.jl +++ b/test/AlgebraicGeometry/Schemes/ProjectiveSchemes.jl @@ -323,8 +323,8 @@ end X2 = subscheme(P2, ideal(R, [x0^2*x1,x0*x1^2,x0*x1*x2])) X3 = subscheme(P2, ideal(R,[x0])) @test X1 == X2 - @test issubset(X1, P2) - @test issubset(X1, X2) + @test is_subscheme(X1, P2) + @test is_subscheme(X1, X2) end @testset "closed embeddings" begin diff --git a/test/AlgebraicGeometry/Schemes/SpecOpen.jl b/test/AlgebraicGeometry/Schemes/SpecOpen.jl index 6329ec2b3161..e4f238e75942 100644 --- a/test/AlgebraicGeometry/Schemes/SpecOpen.jl +++ b/test/AlgebraicGeometry/Schemes/SpecOpen.jl @@ -3,7 +3,7 @@ f = x^2 + y^2 + z^2 A = Spec(R) X = Spec(quo(R, ideal(R, [x*f, y*f]))[1]) - @test issubset(X, A) + @test is_subscheme(X, A) U = SpecOpen(A, [x, y]) UX = intersect(X, U) @@ -192,7 +192,7 @@ end end -@testset "issubset" begin +@testset "is_subscheme" begin R, (x, y) = QQ["x", "y", "z"] # Spec{..., MPolyRing} A2 = Spec(R) @@ -208,60 +208,60 @@ end # PrincipalOpenSubset{MPolyQuoLocalized....} Vxy_minus_origin_p = PrincipalOpenSubset(Vxy, OO(Vxy)(x+y)) - @test issubset(A2, A2) - @test issubset(Vxy, A2) - @test issubset(A2_minus_origin, A2) - @test issubset(A2_minus_Vxy, A2) - @test issubset(A2_minus_Vxy_p, A2) - @test issubset(Vxy_minus_origin, A2) - @test issubset(Vxy_minus_origin_p, A2) - - @test issubset(Vxy, Vxy) - @test !issubset(A2_minus_origin, Vxy) - @test !issubset(A2_minus_Vxy, Vxy) - @test !issubset(A2_minus_Vxy_p, Vxy) - @test issubset(Vxy_minus_origin, Vxy) - @test issubset(Vxy_minus_origin_p, Vxy) - - @test !issubset(A2, A2_minus_origin) - @test !issubset(Vxy, A2_minus_origin) - @test issubset(A2_minus_origin, A2_minus_origin) - @test issubset(A2_minus_Vxy, A2_minus_origin) - @test issubset(A2_minus_Vxy_p, A2_minus_origin) - @test issubset(Vxy_minus_origin, A2_minus_origin) - @test issubset(Vxy_minus_origin_p, A2_minus_origin) - - @test !issubset(A2, A2_minus_Vxy) - @test !issubset(Vxy, A2_minus_Vxy) - @test !issubset(A2_minus_origin, A2_minus_Vxy) - @test issubset(A2_minus_Vxy, A2_minus_Vxy) - @test issubset(A2_minus_Vxy_p, A2_minus_Vxy) - @test !issubset(Vxy_minus_origin, A2_minus_Vxy) - @test !issubset(Vxy_minus_origin_p, A2_minus_Vxy) - - @test !issubset(A2, A2_minus_Vxy_p) - @test !issubset(Vxy, A2_minus_Vxy_p) - @test !issubset(A2_minus_origin, A2_minus_Vxy_p) - @test issubset(A2_minus_Vxy, A2_minus_Vxy_p) - @test issubset(A2_minus_Vxy_p, A2_minus_Vxy_p) - @test !issubset(Vxy_minus_origin, A2_minus_Vxy_p) - @test !issubset(Vxy_minus_origin_p, A2_minus_Vxy_p) - - @test !issubset(A2, Vxy_minus_origin) - @test !issubset(Vxy, Vxy_minus_origin) - @test_broken !issubset(A2_minus_origin, Vxy_minus_origin) - @test !issubset(A2_minus_Vxy, Vxy_minus_origin) - @test !issubset(A2_minus_Vxy_p, Vxy_minus_origin) - @test issubset(Vxy_minus_origin, Vxy_minus_origin) - @test issubset(Vxy_minus_origin_p, Vxy_minus_origin) - - @test !issubset(A2, Vxy_minus_origin_p) - @test !issubset(Vxy, Vxy_minus_origin_p) - @test !issubset(A2_minus_origin, Vxy_minus_origin_p) - @test !issubset(A2_minus_Vxy, Vxy_minus_origin_p) - @test !issubset(A2_minus_Vxy_p, Vxy_minus_origin_p) - @test issubset(Vxy_minus_origin, Vxy_minus_origin_p) - @test issubset(Vxy_minus_origin_p, Vxy_minus_origin_p) + @test is_subscheme(A2, A2) + @test is_subscheme(Vxy, A2) + @test is_subscheme(A2_minus_origin, A2) + @test is_subscheme(A2_minus_Vxy, A2) + @test is_subscheme(A2_minus_Vxy_p, A2) + @test is_subscheme(Vxy_minus_origin, A2) + @test is_subscheme(Vxy_minus_origin_p, A2) + + @test is_subscheme(Vxy, Vxy) + @test !is_subscheme(A2_minus_origin, Vxy) + @test !is_subscheme(A2_minus_Vxy, Vxy) + @test !is_subscheme(A2_minus_Vxy_p, Vxy) + @test is_subscheme(Vxy_minus_origin, Vxy) + @test is_subscheme(Vxy_minus_origin_p, Vxy) + + @test !is_subscheme(A2, A2_minus_origin) + @test !is_subscheme(Vxy, A2_minus_origin) + @test is_subscheme(A2_minus_origin, A2_minus_origin) + @test is_subscheme(A2_minus_Vxy, A2_minus_origin) + @test is_subscheme(A2_minus_Vxy_p, A2_minus_origin) + @test is_subscheme(Vxy_minus_origin, A2_minus_origin) + @test is_subscheme(Vxy_minus_origin_p, A2_minus_origin) + + @test !is_subscheme(A2, A2_minus_Vxy) + @test !is_subscheme(Vxy, A2_minus_Vxy) + @test !is_subscheme(A2_minus_origin, A2_minus_Vxy) + @test is_subscheme(A2_minus_Vxy, A2_minus_Vxy) + @test is_subscheme(A2_minus_Vxy_p, A2_minus_Vxy) + @test !is_subscheme(Vxy_minus_origin, A2_minus_Vxy) + @test !is_subscheme(Vxy_minus_origin_p, A2_minus_Vxy) + + @test !is_subscheme(A2, A2_minus_Vxy_p) + @test !is_subscheme(Vxy, A2_minus_Vxy_p) + @test !is_subscheme(A2_minus_origin, A2_minus_Vxy_p) + @test is_subscheme(A2_minus_Vxy, A2_minus_Vxy_p) + @test is_subscheme(A2_minus_Vxy_p, A2_minus_Vxy_p) + @test !is_subscheme(Vxy_minus_origin, A2_minus_Vxy_p) + @test !is_subscheme(Vxy_minus_origin_p, A2_minus_Vxy_p) + + @test !is_subscheme(A2, Vxy_minus_origin) + @test !is_subscheme(Vxy, Vxy_minus_origin) + @test_broken !is_subscheme(A2_minus_origin, Vxy_minus_origin) + @test !is_subscheme(A2_minus_Vxy, Vxy_minus_origin) + @test !is_subscheme(A2_minus_Vxy_p, Vxy_minus_origin) + @test is_subscheme(Vxy_minus_origin, Vxy_minus_origin) + @test is_subscheme(Vxy_minus_origin_p, Vxy_minus_origin) + + @test !is_subscheme(A2, Vxy_minus_origin_p) + @test !is_subscheme(Vxy, Vxy_minus_origin_p) + @test !is_subscheme(A2_minus_origin, Vxy_minus_origin_p) + @test !is_subscheme(A2_minus_Vxy, Vxy_minus_origin_p) + @test !is_subscheme(A2_minus_Vxy_p, Vxy_minus_origin_p) + @test is_subscheme(Vxy_minus_origin, Vxy_minus_origin_p) + @test is_subscheme(Vxy_minus_origin_p, Vxy_minus_origin_p) end @testset "is_open_embedding" begin diff --git a/test/AlgebraicGeometry/Schemes/singular_locus.jl b/test/AlgebraicGeometry/Schemes/singular_locus.jl index 62cf666c0007..43ed7e092db4 100644 --- a/test/AlgebraicGeometry/Schemes/singular_locus.jl +++ b/test/AlgebraicGeometry/Schemes/singular_locus.jl @@ -4,8 +4,8 @@ J = ideal(R, [x-1, y-2]) X = Spec(R, I*J, units_of(R)) Z, _ = singular_locus(X) - @test is_subset(subscheme(X, [x,y,z]), Z) - @test is_subset(subscheme(X, [z^2-3, y-2, x-1]), Z) + @test is_subscheme(subscheme(X, [x,y,z]), Z) + @test is_subscheme(subscheme(X, [z^2-3, y-2, x-1]), Z) @test !is_smooth(X) @test is_smooth(Spec(R)) Y = Spec(R, ideal(R, [x^2 - y^2 + z^2 - 1])) @@ -13,7 +13,7 @@ U1 = complement_of_point_ideal(R, [0, 0, 0]) X1 = Spec(R, I * J, U1) Z1, _ = singular_locus(X1) - @test is_subset(subscheme(X1, [x, y, z]), Z1) + @test is_subscheme(subscheme(X1, [x, y, z]), Z1) @test is_smooth(Spec(R, U1)) U2 = complement_of_point_ideal(R, [1, 1, 0]) X2 = Spec(R, I * J, U2)