diff --git a/docs/src/AlgebraicGeometry/Schemes/Sheaves.md b/docs/src/AlgebraicGeometry/Schemes/Sheaves.md index 78c358cfbf48..948f46024cdf 100644 --- a/docs/src/AlgebraicGeometry/Schemes/Sheaves.md +++ b/docs/src/AlgebraicGeometry/Schemes/Sheaves.md @@ -22,15 +22,36 @@ StructureSheafOfRings AbsIdealSheaf IdealSheaf PrimeIdealSheafFromChart +SumIdealSheaf +ProductIdealSheaf +SimplifiedIdealSheaf +PullbackIdealSheaf +RadicalOfIdealSheaf +ToricIdealSheafFromCoxRingIdeal +SingularLocusIdealSheaf ``` ## Coherent sheaves of modules +These are some types for coherent sheaves. ```@docs SheafOfModules +HomSheaf +PushforwardSheaf +PullbackSheaf +DirectSumSheaf +``` + +We provide some common constructors. +```@docs twisting_sheaf(IP::AbsProjectiveScheme{<:Field}, d::Int) tautological_bundle(IP::AbsProjectiveScheme{<:Field}) cotangent_sheaf(X::AbsCoveredScheme) free_module(R::StructureSheafOfRings, n::Int) +dual(M::SheafOfModules) +tangent_sheaf(X::AbsCoveredScheme) +``` + +```@docs projectivization(E::AbsCoherentSheaf; var_names::Vector{String}=Vector{String}(), check::Bool=true) ``` diff --git a/src/AlgebraicGeometry/Schemes/Sheaves/CoherentSheaves.jl b/src/AlgebraicGeometry/Schemes/Sheaves/CoherentSheaves.jl index cdd99771ec45..d49d63cce009 100644 --- a/src/AlgebraicGeometry/Schemes/Sheaves/CoherentSheaves.jl +++ b/src/AlgebraicGeometry/Schemes/Sheaves/CoherentSheaves.jl @@ -341,6 +341,37 @@ end For an `AbsCoveredScheme` ``X``, return the sheaf ``Ω¹(X)`` of Kaehler-differentials on ``X`` as a `CoherentSheaf`. +# Examples +```jldoctest +julia> IP1 = projective_space(QQ, 1); + +julia> X = covered_scheme(IP1) +Scheme + over rational field +with default covering + described by patches + 1: affine 1-space + 2: affine 1-space + in the coordinate(s) + 1: [(s1//s0)] + 2: [(s0//s1)] + +julia> Omega = cotangent_sheaf(X); + +julia> U, V = affine_charts(X); + +julia> UV, VU = gluing_domains(default_covering(X)[U, V]); + +julia> dx = Omega(U)[1] +d(s1//s0) + +julia> Omega(V) +Free module of rank 1 over multivariate polynomial ring in 1 variable over QQ + +julia> Omega(U, VU)(dx) +-1/(s0//s1)^2*d(s0//s1) + +``` """ @attr SheafOfModules function cotangent_sheaf(X::AbsCoveredScheme) MD = IdDict{AbsAffineScheme, ModuleFP}() @@ -419,6 +450,53 @@ end in the constructor. =# +@doc raw""" + HomSheaf + +For two `AbsCoherentSheaf`s `F` and `G` on an `AbsCoveredScheme` `X` +this computes the sheaf associated to `U -> Hom(F(U), G(U))`. +# Examples +```jldoctest +julia> IP1 = projective_space(GF(7), [:x, :y]) +Projective space of dimension 1 + over prime field of characteristic 7 +with homogeneous coordinates [x, y] + +julia> Y = covered_scheme(IP1); + +julia> Omega = cotangent_sheaf(Y) +Coherent sheaf of modules + on scheme over GF(7) covered with 2 patches + 1: [(y//x)] affine 1-space + 2: [(x//y)] affine 1-space +with restrictions + 1: free module of rank 1 over multivariate polynomial ring in 1 variable over GF(7) + 2: free module of rank 1 over multivariate polynomial ring in 1 variable over GF(7) + +julia> F = free_module(OO(Y), 1) +Coherent sheaf of modules + on scheme over GF(7) covered with 2 patches + 1: [(y//x)] affine 1-space + 2: [(x//y)] affine 1-space +with restrictions + 1: free module of rank 1 over multivariate polynomial ring in 1 variable over GF(7) + 2: free module of rank 1 over multivariate polynomial ring in 1 variable over GF(7) + +julia> T = Oscar.HomSheaf(Omega, F) +Coherent sheaf of modules + on scheme over GF(7) covered with 2 patches + 1: [(y//x)] affine 1-space + 2: [(x//y)] affine 1-space +with restrictions + 1: hom of (Multivariate polynomial ring in 1 variable over GF(7)^1, Multivariate polynomial ring in 1 variable over GF(7)^1) + 2: hom of (Multivariate polynomial ring in 1 variable over GF(7)^1, Multivariate polynomial ring in 1 variable over GF(7)^1) + +julia> typeof(T) +Oscar.HomSheaf{CoveredScheme{FqField}, AbsAffineScheme, ModuleFP, Map} + + +``` +""" @attributes mutable struct HomSheaf{SpaceType, OpenType, OutputType, RestrictionType } <: AbsCoherentSheaf{ @@ -457,6 +535,53 @@ codomain(M::HomSheaf) = M.codomain ######################################################################## # Sheaves of direct sums # ######################################################################## +@doc raw""" + DirectSumSheaf + +Given two or more `AbsCoherentSheaf`s `F` and `G` on an `AbsCoveredScheme` `X`, +this holds the sheaf associated to the direct sum of `F` and `G` + +# Examples +```jldoctest +julia> IP1 = projective_space(GF(7), [:x, :y]) +Projective space of dimension 1 + over prime field of characteristic 7 +with homogeneous coordinates [x, y] + +julia> Y = covered_scheme(IP1); + +julia> Omega = cotangent_sheaf(Y) +Coherent sheaf of modules + on scheme over GF(7) covered with 2 patches + 1: [(y//x)] affine 1-space + 2: [(x//y)] affine 1-space +with restrictions + 1: free module of rank 1 over multivariate polynomial ring in 1 variable over GF(7) + 2: free module of rank 1 over multivariate polynomial ring in 1 variable over GF(7) + +julia> F = free_module(OO(Y), 1) +Coherent sheaf of modules + on scheme over GF(7) covered with 2 patches + 1: [(y//x)] affine 1-space + 2: [(x//y)] affine 1-space +with restrictions + 1: free module of rank 1 over multivariate polynomial ring in 1 variable over GF(7) + 2: free module of rank 1 over multivariate polynomial ring in 1 variable over GF(7) + +julia> W = Oscar.DirectSumSheaf(Y, [Omega, F]) +Coherent sheaf of modules + on scheme over GF(7) covered with 2 patches + 1: [(y//x)] affine 1-space + 2: [(x//y)] affine 1-space +with restrictions + 1: direct sum of (Multivariate polynomial ring in 1 variable over GF(7)^1, Multivariate polynomial ring in 1 variable over GF(7)^1) + 2: direct sum of (Multivariate polynomial ring in 1 variable over GF(7)^1, Multivariate polynomial ring in 1 variable over GF(7)^1) + +julia> typeof(W) +DirectSumSheaf{CoveredScheme{FqField}, AbsAffineScheme, ModuleFP, Map} + +``` +""" @attributes mutable struct DirectSumSheaf{SpaceType, OpenType, OutputType, RestrictionType } <: AbsCoherentSheaf{ @@ -587,6 +712,91 @@ end # It is clear that this can and should be made lazy. # =# +@doc raw""" + PushforwardSheaf + +For a `CoveredClosedEmbedding` `i : X -> Y` and an `AbsCoherentSheaf` `F` +on `X` this computes the coherent sheaf `i_* F` on `Y`. + +# Examples +```jldoctest +julia> IP2 = projective_space(NormalToricVariety, 2) +Normal toric variety + +julia> S = cox_ring(IP2) +Multivariate polynomial ring in 3 variables over QQ graded by + x1 -> [1] + x2 -> [1] + x3 -> [1] + +julia> x, y, z = gens(S); + +julia> I = ideal(S, x^3 - y*z^2); + +julia> II = ideal_sheaf(IP2, I); + +julia> X, inc_X = sub(II); + +julia> F = cotangent_sheaf(X) +Coherent sheaf of modules + on scheme over QQ covered with 3 patches + 1: [x_1_1, x_2_1] scheme(x_1_1^3 - x_2_1) + 2: [x_1_2, x_2_2] scheme(x_1_2^2*x_2_2 - 1) + 3: [x_1_3, x_2_3] scheme(x_1_3^3 - x_2_3^2) +with restrictions + 1: subquotient of submodule with 2 generators + 1: dx_1_1 + 2: dx_2_1 + by submodule with 1 generator + 1: 3*x_1_1^2*dx_1_1 - dx_2_1 + 2: subquotient of submodule with 2 generators + 1: dx_1_2 + 2: dx_2_2 + by submodule with 1 generator + 1: 2*x_1_2*x_2_2*dx_1_2 + x_1_2^2*dx_2_2 + 3: subquotient of submodule with 2 generators + 1: dx_1_3 + 2: dx_2_3 + by submodule with 1 generator + 1: 3*x_1_3^2*dx_1_3 - 2*x_2_3*dx_2_3 + +julia> inc_F = Oscar.PushforwardSheaf(inc_X, F) +Coherent sheaf of modules + on normal toric variety +with restrictions + 1: subquotient of submodule with 2 generators + 1: dx_1_1 + 2: dx_2_1 + by submodule with 5 generators + 1: (x_1_1^3 - x_2_1)*dx_1_1 + 2: (x_1_1^3 - x_2_1)*dx_2_1 + 3: 3*x_1_1^2*dx_1_1 - dx_2_1 + 4: (x_1_1^3 - x_2_1)*dx_1_1 + 5: (x_1_1^3 - x_2_1)*dx_2_1 + 2: subquotient of submodule with 2 generators + 1: dx_1_2 + 2: dx_2_2 + by submodule with 5 generators + 1: (x_1_2^2*x_2_2 - 1)*dx_1_2 + 2: (x_1_2^2*x_2_2 - 1)*dx_2_2 + 3: 2*x_1_2*x_2_2*dx_1_2 + x_1_2^2*dx_2_2 + 4: (x_1_2^2*x_2_2 - 1)*dx_1_2 + 5: (x_1_2^2*x_2_2 - 1)*dx_2_2 + 3: subquotient of submodule with 2 generators + 1: dx_1_3 + 2: dx_2_3 + by submodule with 5 generators + 1: (x_1_3^3 - x_2_3^2)*dx_1_3 + 2: (x_1_3^3 - x_2_3^2)*dx_2_3 + 3: 3*x_1_3^2*dx_1_3 - 2*x_2_3*dx_2_3 + 4: (x_1_3^3 - x_2_3^2)*dx_1_3 + 5: (x_1_3^3 - x_2_3^2)*dx_2_3 + +julia> typeof(inc_F) +PushforwardSheaf{NormalToricVariety, AbsAffineScheme, ModuleFP, Map} + +``` +""" @attributes mutable struct PushforwardSheaf{SpaceType, OpenType, OutputType, RestrictionType } <: AbsCoherentSheaf{ @@ -670,6 +880,73 @@ end # 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. + +@doc raw""" + PullbackSheaf + +For a morphism `f : X -> Y` of `AbsCoveredScheme`s and a coherent +sheaf `F` on `Y` this computes the pullback `f^* F` on `X`. +# Examples +```jldoctest +julia> IP2 = projective_space(NormalToricVariety, 2) +Normal toric variety + +julia> S = cox_ring(IP2) +Multivariate polynomial ring in 3 variables over QQ graded by + x1 -> [1] + x2 -> [1] + x3 -> [1] + +julia> x, y, z = gens(S); + +julia> I = ideal(S, x^3 - y*z^2); + +julia> II = ideal_sheaf(IP2, I); + +julia> X, inc_X = sub(II); + +julia> F = cotangent_sheaf(codomain(inc_X)) +Coherent sheaf of modules + on normal toric variety +with restrictions + 1: submodule with 2 generators + 1: dx_1_1 + 2: dx_2_1 + represented as subquotient with no relations + 2: submodule with 2 generators + 1: dx_1_2 + 2: dx_2_2 + represented as subquotient with no relations + 3: submodule with 2 generators + 1: dx_1_3 + 2: dx_2_3 + represented as subquotient with no relations + +julia> inc_F = Oscar.PullbackSheaf(inc_X, F) +Coherent sheaf of modules + on scheme over QQ covered with 3 patches + 1: [x_1_1, x_2_1] scheme(x_1_1^3 - x_2_1) + 2: [x_1_2, x_2_2] scheme(x_1_2^2*x_2_2 - 1) + 3: [x_1_3, x_2_3] scheme(x_1_3^3 - x_2_3^2) +with restrictions + 1: submodule with 2 generators + 1: dx_1_1 + 2: dx_2_1 + represented as subquotient with no relations + 2: submodule with 2 generators + 1: dx_1_2 + 2: dx_2_2 + represented as subquotient with no relations + 3: submodule with 2 generators + 1: dx_1_3 + 2: dx_2_3 + represented as subquotient with no relations + +julia> typeof(inc_F) +PullbackSheaf{CoveredScheme{QQField}, AbsAffineScheme, ModuleFP, Map} + +``` +""" @attributes mutable struct PullbackSheaf{SpaceType, OpenType, OutputType, RestrictionType } <: AbsCoherentSheaf{ diff --git a/src/AlgebraicGeometry/Schemes/Sheaves/Types.jl b/src/AlgebraicGeometry/Schemes/Sheaves/Types.jl index 100314ab4fc6..ea9d5538e82d 100644 --- a/src/AlgebraicGeometry/Schemes/Sheaves/Types.jl +++ b/src/AlgebraicGeometry/Schemes/Sheaves/Types.jl @@ -18,7 +18,7 @@ For any instance `F` of `AbsPreSheaf` on a topological space `X` the following m * `F(U)` for *admissible* open subsets ``U ⊂ X``: This returns the value ``ℱ(U)`` of the sheaf `F` on `U`. Note that due to technical limitations, not every type of open subset might be admissible. - * `restriction_map(F, U, V)` for *admissible* open subsets ``V ⊂ U ⊂ X``: This returns the restriction map ``ρ : ℱ(U) → ℱ(V)``. + * `restriction_map(F, U, V)` for *admissible* open subsets ``V ⊂ U ⊂ X``: This returns the restriction map ``ρ : ℱ(U) → ℱ(V)``. Alternatively, one may also call `F(U, V)` to get this map. """ abstract type AbsPreSheaf{SpaceType, OpenType, OutputType, RestrictionType} end @@ -73,6 +73,73 @@ to the following: One can call the restriction maps of ``𝒪`` across charts, implicitly using the identifications given by the gluings in the `default_covering`. +# Examples +```jldoctest +julia> IP2 = projective_space(GF(7), [:x, :y, :z]) +Projective space of dimension 2 + over prime field of characteristic 7 +with homogeneous coordinates [x, y, z] + +julia> X = covered_scheme(IP2) +Scheme + over prime field of characteristic 7 +with default covering + described by patches + 1: affine 2-space + 2: affine 2-space + 3: affine 2-space + in the coordinate(s) + 1: [(y//x), (z//x)] + 2: [(x//y), (z//y)] + 3: [(x//z), (y//z)] + +julia> OOX = OO(X) +Structure sheaf of rings of regular functions + on scheme over GF(7) covered with 3 patches + 1: [(y//x), (z//x)] affine 2-space + 2: [(x//y), (z//y)] affine 2-space + 3: [(x//z), (y//z)] affine 2-space + +julia> typeof(OOX) +StructureSheafOfRings{CoveredScheme{FqField}, Union{AbsAffineScheme, AffineSchemeOpenSubscheme}, Ring, Map} + +julia> U, V, W = affine_charts(X) +3-element Vector{AffineScheme{FqField, FqMPolyRing}}: + Affine 2-space + Affine 2-space + Affine 2-space + +julia> glue = default_covering(X)[U, V] +Gluing + of affine 2-space + and affine 2-space +along the open subsets + [(y//x), (z//x)] AA^2 \ scheme((y//x)) + [(x//y), (z//y)] AA^2 \ scheme((x//y)) +given by the pullback function + (x//y) -> 1/(y//x) + (z//y) -> (z//x)/(y//x) + +julia> UV, VU = gluing_domains(glue) +(AA^2 \ scheme((y//x)), AA^2 \ scheme((x//y))) + +julia> y, z = gens(OOX(U)) +2-element Vector{FqMPolyRingElem}: + (y//x) + (z//x) + +julia> pb = OOX(U, VU) +Ring homomorphism + from multivariate polynomial ring in 2 variables over GF(7) + to localization of multivariate polynomial ring in 2 variables over GF(7) at products of ((x//y)) +defined by + (y//x) -> 1/(x//y) + (z//x) -> (z//y)/(x//y) + +julia> pb(y^2) +1/(x//y)^2 + +``` """ @attributes mutable struct StructureSheafOfRings{SpaceType, OpenType, OutputType, RestrictionType @@ -117,6 +184,70 @@ A sheaf of ideals ``I`` on an `AbsCoveredScheme` ``X``. For an affine open subset ``U ⊂ X`` call ``I(U)`` to obtain an ideal in `OO(U)` representing `I`. +# Examples +```jldoctest +julia> IP2 = projective_space(GF(7), [:x, :y, :z]) +Projective space of dimension 2 + over prime field of characteristic 7 +with homogeneous coordinates [x, y, z] + +julia> X = covered_scheme(IP2) +Scheme + over prime field of characteristic 7 +with default covering + described by patches + 1: affine 2-space + 2: affine 2-space + 3: affine 2-space + in the coordinate(s) + 1: [(y//x), (z//x)] + 2: [(x//y), (z//y)] + 3: [(x//z), (y//z)] + +julia> S = homogeneous_coordinate_ring(IP2) +Multivariate polynomial ring in 3 variables over GF(7) graded by + x -> [1] + y -> [1] + z -> [1] + +julia> II = ideal_sheaf(IP2, ideal(S, [S[1] + S[2]])) +Sheaf of ideals + on scheme over GF(7) covered with 3 patches + 1: [(y//x), (z//x)] affine 2-space + 2: [(x//y), (z//y)] affine 2-space + 3: [(x//z), (y//z)] affine 2-space +with restrictions + 1: Ideal ((y//x) + 1) + 2: Ideal ((x//y) + 1) + 3: Ideal ((x//z) + (y//z)) + +julia> U, V, W = affine_charts(X) +3-element Vector{AffineScheme{FqField, FqMPolyRing}}: + Affine 2-space + Affine 2-space + Affine 2-space + +julia> II(U) +Ideal generated by + (y//x) + 1 + +julia> II(V) +Ideal generated by + (x//y) + 1 + +julia> glue = default_covering(X)[U, V]; + +julia> UV, VU = gluing_domains(glue); + +julia> II(U, VU) # transition functions are ring homomorphisms for ideal sheaves! +Ring homomorphism + from multivariate polynomial ring in 2 variables over GF(7) + to localization of multivariate polynomial ring in 2 variables over GF(7) at products of ((x//y)) +defined by + (y//x) -> 1/(x//y) + (z//x) -> (z//y)/(x//y) + +``` """ abstract type AbsIdealSheaf{SpaceType, OpenType, OutputType, RestrictionType @@ -175,7 +306,7 @@ by a collection of concrete ideals on some open covering of ``X``. end end -@doc """raw +@doc raw""" PrimeIdealSheafFromChart Type for sheaves of prime ideals ``P`` on a covered scheme ``X`` @@ -184,6 +315,48 @@ Essentially this is a scheme theoretic point. For ``U`` an affine chart of ``X``, the ideal ``P(U)`` is computed using the gluings. The implementation is lazy. + +# Examples +```jldoctest +julia> IP2 = projective_space(GF(7), [:x, :y, :z]) +Projective space of dimension 2 + over prime field of characteristic 7 +with homogeneous coordinates [x, y, z] + +julia> X = covered_scheme(IP2) +Scheme + over prime field of characteristic 7 +with default covering + described by patches + 1: affine 2-space + 2: affine 2-space + 3: affine 2-space + in the coordinate(s) + 1: [(y//x), (z//x)] + 2: [(x//y), (z//y)] + 3: [(x//z), (y//z)] + +julia> U, V, W = affine_charts(X); + +julia> glue = default_covering(X)[U, V]; + +julia> y, z = gens(OO(U)) +2-element Vector{FqMPolyRingElem}: + (y//x) + (z//x) + +julia> P = ideal(OO(U), [y - z]) +Ideal generated by + (y//x) + 6*(z//x) + +julia> PP = Oscar.PrimeIdealSheafFromChart(X, U, P) +Prime ideal sheaf on Scheme over GF(7) covered with 3 patches extended from Ideal ((y//x) + 6*(z//x)) on Affine 2-space + +julia> PP(W) +Ideal generated by + (y//z) + 6 + +``` """ @attributes mutable struct PrimeIdealSheafFromChart{SpaceType, OpenType, OutputType, RestrictionType @@ -216,6 +389,59 @@ The implementation is lazy. end end +@doc raw""" + SumIdealSheaf + +Sum of two or more ideal sheaves. + +# Examples +```jldoctest +julia> IP2 = projective_space(GF(7), [:x, :y, :z]) +Projective space of dimension 2 + over prime field of characteristic 7 +with homogeneous coordinates [x, y, z] + +julia> X = covered_scheme(IP2) +Scheme + over prime field of characteristic 7 +with default covering + described by patches + 1: affine 2-space + 2: affine 2-space + 3: affine 2-space + in the coordinate(s) + 1: [(y//x), (z//x)] + 2: [(x//y), (z//y)] + 3: [(x//z), (y//z)] + +julia> U, V, W = affine_charts(X); + +julia> y, z = gens(OO(U)); + +julia> P1 = ideal(OO(U), [y - z]); + +julia> PP1 = Oscar.PrimeIdealSheafFromChart(X, U, P1); + +julia> P2 = ideal(OO(V), [OO(V)[1]]); + +julia> PP2 = Oscar.PrimeIdealSheafFromChart(X, V, P2) +Prime ideal sheaf on Scheme over GF(7) covered with 3 patches extended from Ideal ((x//y)) on Affine 2-space + +julia> II = PP1 + PP2 +Sum of + Prime ideal sheaf on scheme over GF(7) covered with 3 patches extended from ideal ((y//x) + 6*(z//x)) on affine 2-space + Prime ideal sheaf on scheme over GF(7) covered with 3 patches extended from ideal ((x//y)) on affine 2-space + +julia> typeof(II) +Oscar.SumIdealSheaf{CoveredScheme{FqField}, AbsAffineScheme, Ideal, Map} + +julia> II(W) +Ideal generated by + (y//z) + 6 + (x//z) + +``` +""" @attributes mutable struct SumIdealSheaf{SpaceType, OpenType, OutputType, RestrictionType } <: AbsIdealSheaf{ @@ -242,6 +468,58 @@ end end end +@doc raw""" + ProductIdealSheaf + +Product of two or more ideal sheaves. + +# Examples +```jldoctest +julia> IP2 = projective_space(GF(7), [:x, :y, :z]) +Projective space of dimension 2 + over prime field of characteristic 7 +with homogeneous coordinates [x, y, z] + +julia> X = covered_scheme(IP2) +Scheme + over prime field of characteristic 7 +with default covering + described by patches + 1: affine 2-space + 2: affine 2-space + 3: affine 2-space + in the coordinate(s) + 1: [(y//x), (z//x)] + 2: [(x//y), (z//y)] + 3: [(x//z), (y//z)] + +julia> U, V, W = affine_charts(X); + +julia> y, z = gens(OO(U)); + +julia> P1 = ideal(OO(U), [y - z]); + +julia> PP1 = Oscar.PrimeIdealSheafFromChart(X, U, P1); + +julia> P2 = ideal(OO(V), [OO(V)[1]]); + +julia> PP2 = Oscar.PrimeIdealSheafFromChart(X, V, P2) +Prime ideal sheaf on Scheme over GF(7) covered with 3 patches extended from Ideal ((x//y)) on Affine 2-space + +julia> II = PP1 * PP2 +Product of + Prime ideal sheaf on scheme over GF(7) covered with 3 patches extended from ideal ((y//x) + 6*(z//x)) on affine 2-space + Prime ideal sheaf on scheme over GF(7) covered with 3 patches extended from ideal ((x//y)) on affine 2-space + +julia> typeof(II) +Oscar.ProductIdealSheaf{CoveredScheme{FqField}, AbsAffineScheme, Ideal, Map} + +julia> II(W) +Ideal generated by + (x//z)*(y//z) + 6*(x//z) + +``` +""" @attributes mutable struct ProductIdealSheaf{SpaceType, OpenType, OutputType, RestrictionType } <: AbsIdealSheaf{ @@ -268,6 +546,78 @@ end end end +@doc raw""" + SimplifiedIdealSheaf + +For a given `AbsIdealSheaf` `II` on an `AbsCoveredScheme` `X` this uses a +heuristic to replace the generating set of `II(U)` by a hopefully smaller +one on every affine chart of `X`. + +# Examples +```jldoctes +julia> IP2 = projective_space(GF(7), [:x, :y, :z]) +Projective space of dimension 2 + over prime field of characteristic 7 +with homogeneous coordinates [x, y, z] + +julia> X = covered_scheme(IP2) +Scheme + over prime field of characteristic 7 +with default covering + described by patches + 1: affine 2-space + 2: affine 2-space + 3: affine 2-space + in the coordinate(s) + 1: [(y//x), (z//x)] + 2: [(x//y), (z//y)] + 3: [(x//z), (y//z)] + +julia> U, V, W = affine_charts(X); + +julia> y, z = gens(OO(U)); + +julia> P1 = ideal(OO(U), [y - z]); + +julia> PP1 = Oscar.PrimeIdealSheafFromChart(X, U, P1); + +julia> P2 = ideal(OO(V), [OO(V)[1], OO(V)[2]]); + +julia> PP2 = Oscar.PrimeIdealSheafFromChart(X, V, P2) +Prime ideal sheaf on Scheme over GF(7) covered with 3 patches extended from Ideal ((x//y), (z//y)) on Affine 2-space + +julia> II = PP1 + PP2 +Sum of + Prime ideal sheaf on scheme over GF(7) covered with 3 patches extended from ideal ((y//x) + + 6*(z//x)) on affine 2-space + Prime ideal sheaf on scheme over GF(7) covered with 3 patches extended from ideal ((x//y), ( + z//y)) on affine 2-space + +julia> JJ = simplify(II) +Sheaf of ideals + on scheme over GF(7) covered with 3 patches + 1: [(y//x), (z//x)] affine 2-space + 2: [(x//y), (z//y)] affine 2-space + 3: [(x//z), (y//z)] affine 2-space +with restrictions + 1: Ideal (1) + 2: Ideal (1) + 3: Ideal (1) + +julia> typeof(JJ) +Oscar.SimplifiedIdealSheaf{CoveredScheme{FqField}, AbsAffineScheme, Ideal, Map} + +julia> II(W) +Ideal generated by + (y//z) + 6 + 1 + +julia> JJ(W) +Ideal generated by + 1 + +``` +""" @attributes mutable struct SimplifiedIdealSheaf{SpaceType, OpenType, OutputType, RestrictionType } <: AbsIdealSheaf{ @@ -292,6 +642,62 @@ end end end +@doc raw""" + PullbackIdealSheaf + +Given an morphism `f : X -> Y` of `AbsCoveredScheme`s and an ideal sheaf +`II` on `Y`, this computes the pullback `f^* II` on `X`. + +# Examples +```jldoctest +julia> IP2 = projective_space(GF(7), [:x, :y, :z]) +Projective space of dimension 2 + over prime field of characteristic 7 +with homogeneous coordinates [x, y, z] + +julia> Y = covered_scheme(IP2) +Scheme + over prime field of characteristic 7 +with default covering + described by patches + 1: affine 2-space + 2: affine 2-space + 3: affine 2-space + in the coordinate(s) + 1: [(y//x), (z//x)] + 2: [(x//y), (z//y)] + 3: [(x//z), (y//z)] + +julia> U, _ = affine_charts(Y); + +julia> y, z = gens(OO(U)); + +julia> P1 = ideal(OO(U), [y, z]); + +julia> PP1 = Oscar.PrimeIdealSheafFromChart(Y, U, P1); + +julia> bl = blow_up(PP1); + +julia> X = domain(bl); + +julia> JJ = pullback(bl, PP1) +Sheaf of ideals + on scheme over GF(7) covered with 4 patches + 1: [(s1//s0), (y//x)] scheme(0) + 2: [(s0//s1), (z//x)] scheme(0) + 3: [(x//y), (z//y)] affine 2-space + 4: [(x//z), (y//z)] affine 2-space +with restrictions + 1: Ideal ((y//x), (s1//s0)*(y//x)) + 2: Ideal ((s0//s1)*(z//x), (z//x)) + 3: Ideal (1) + 4: Ideal (1) + +julia> typeof(JJ) +Oscar.PullbackIdealSheaf{CoveredScheme{FqField}, AbsAffineScheme, Ideal, Map} + +``` +""" @attributes mutable struct PullbackIdealSheaf{SpaceType, OpenType, OutputType, RestrictionType } <: AbsIdealSheaf{ @@ -320,6 +726,60 @@ end end end +@doc raw""" + RadicalOfIdealSheaf + +Given an `AbsIdealSheaf` `II` on an `AbsCoveredScheme` `X`, this computes +the sheaf associated to the radicals of the ideals on the charts. + +# Examples +```jldoctest +julia> IP2 = projective_space(GF(7), [:x, :y, :z]) +Projective space of dimension 2 + over prime field of characteristic 7 +with homogeneous coordinates [x, y, z] + +julia> Y = covered_scheme(IP2) +Scheme + over prime field of characteristic 7 +with default covering + described by patches + 1: affine 2-space + 2: affine 2-space + 3: affine 2-space + in the coordinate(s) + 1: [(y//x), (z//x)] + 2: [(x//y), (z//y)] + 3: [(x//z), (y//z)] + +julia> U, _ = affine_charts(Y); + +julia> y, z = gens(OO(U)); + +julia> P1 = ideal(OO(U), [y, z]); + +julia> PP1 = Oscar.PrimeIdealSheafFromChart(Y, U, P1); + +julia> PP1_squared = PP1^2; + +julia> JJ = radical(PP1_squared); + +julia> typeof(JJ) +Oscar.RadicalOfIdealSheaf{CoveredScheme{FqField}, AbsAffineScheme, Ideal, Map} + +julia> PP1_squared(U) +Ideal generated by + (y//x)^2 + (y//x)*(z//x) + (z//x)^2 + +julia> JJ(U) +Ideal generated by + (z//x) + (y//x) + +``` +""" @attributes mutable struct RadicalOfIdealSheaf{SpaceType, OpenType, OutputType, RestrictionType } <: AbsIdealSheaf{ @@ -344,6 +804,40 @@ end end end +@doc raw""" + ToricIdealSheafFromCoxRingIdeal + +This is the ideal sheaf associated to a `NormalToricVariety` `X` +with `cox_ring` `S` and an ideal `I` of `S`. + +# Examples +```jldoctest +julia> IP2 = projective_space(NormalToricVariety, 2) +Normal toric variety + +julia> S = cox_ring(IP2) +Multivariate polynomial ring in 3 variables over QQ graded by + x1 -> [1] + x2 -> [1] + x3 -> [1] + +julia> x, y, z = gens(S); + +julia> I = ideal(S, x^2 - y*z); + +julia> II = ideal_sheaf(IP2, I) +Sheaf of ideals + on normal toric variety +with restrictions + 1: Ideal (x_1_1^2 - x_2_1) + 2: Ideal (x_1_2*x_2_2 - 1) + 3: Ideal (x_1_3^2 - x_2_3) + +julia> typeof(II) +Oscar.ToricIdealSheafFromCoxRingIdeal{NormalToricVariety, AbsAffineScheme, Ideal, Map} + +``` +""" @attributes mutable struct ToricIdealSheafFromCoxRingIdeal{SpaceType, OpenType, OutputType, RestrictionType } <: AbsIdealSheaf{ @@ -371,6 +865,47 @@ end # Singular locus ideal sheaf ######################################################################## +@doc raw""" + SingularLocusIdealSheaf + +This is the (radical) ideal sheaf for the singular locus of an +`AbsCoveredScheme` `X`. + +# Examples +```jldoctest +julia> IP2 = projective_space(NormalToricVariety, 2) +Normal toric variety + +julia> S = cox_ring(IP2) +Multivariate polynomial ring in 3 variables over QQ graded by + x1 -> [1] + x2 -> [1] + x3 -> [1] + +julia> x, y, z = gens(S); + +julia> I = ideal(S, x^3 - y*z^2); + +julia> II = ideal_sheaf(IP2, I); + +julia> X, inc_X = sub(II); + +julia> JJ = Oscar.ideal_sheaf_of_singular_locus(X) +Sheaf of ideals + on scheme over QQ covered with 3 patches + 1: [x_1_1, x_2_1] scheme(x_1_1^3 - x_2_1) + 2: [x_1_2, x_2_2] scheme(x_1_2^2*x_2_2 - 1) + 3: [x_1_3, x_2_3] scheme(x_1_3^3 - x_2_3^2) +with restrictions + 1: Ideal (1) + 2: Ideal (1) + 3: Ideal (x_2_3, x_1_3) + +julia> typeof(JJ) +Oscar.SingularLocusIdealSheaf{CoveredScheme{QQField}, AbsAffineScheme, Ideal, Map} + +``` +""" @attributes mutable struct SingularLocusIdealSheaf{SpaceType, OpenType, OutputType, RestrictionType } <: AbsIdealSheaf{