From 4abd1b756076eb8986a378fc13b9d6187b6edb3a Mon Sep 17 00:00:00 2001 From: Matthias Zach Date: Tue, 26 Sep 2023 16:57:19 +0200 Subject: [PATCH] Partially implement fiber products of closed embeddings. --- .../CoveredSchemes/Morphisms/Methods.jl | 47 +++++++++++++++++++ .../ProjectiveSchemes/Morphisms/Types.jl | 1 + .../Schemes/ProjectiveSchemes.jl | 8 ++++ 3 files changed, 56 insertions(+) diff --git a/src/AlgebraicGeometry/Schemes/CoveredSchemes/Morphisms/Methods.jl b/src/AlgebraicGeometry/Schemes/CoveredSchemes/Morphisms/Methods.jl index 24030bd10235..20c3ca8307e6 100644 --- a/src/AlgebraicGeometry/Schemes/CoveredSchemes/Morphisms/Methods.jl +++ b/src/AlgebraicGeometry/Schemes/CoveredSchemes/Morphisms/Methods.jl @@ -158,3 +158,50 @@ function Base.show(io::IO, ::MIME"text/plain", f::AbsCoveredSchemeMorphism) Oscar._show_semi_compact(io, covering_morphism(f)) end end + +function fiber_product( + i1::CoveredClosedEmbedding, + i2::CoveredClosedEmbedding + ) + X1 = domain(i1) + X2 = domain(i2) + Y = codomain(i1) + Y === codomain(i2) || error("codomains do not coincide") + i1_cov = covering_morphism(i1) + i2_cov = covering_morphism(i2) + codomain(i1_cov) === codomain(i2_cov) || error("case of different coverings in codomain not implemented") + cod_cov = codomain(i1_cov) + #= + cod_ref, ref1, ref2 = common_refinement(codomain(i1_cov), codomain(i2_cov)) + dom_ref1, i1_res = fiber_product(i1, ref1) + dom_ref2, i2_res = fiber_product(i1, ref2) + # etc. etc.... This is roughly the generic code to come. + =# + I1 = image_ideal(i1) + pb_I1 = pullback(i2, I1) + I2 = image_ideal(i2) + pb_I2 = pullback(i1, I2) + + j1 = Oscar.CoveredClosedEmbedding(domain(i2), pb_I1) + Z = domain(j1) + morphism_dict = IdDict{AbsSpec, ClosedEmbedding}() + for U in affine_charts(Z) + V2 = codomain(j1[U]) + W = codomain(i2[V2]) + V1_candidates = maps_with_given_codomain(i1, W) + @assert length(V1_candidates) == 1 "not the correct number of patches found" + V1 = domain(first(V1_candidates)) + x = gens(OO(V1)) + @show x + lift_x = [preimage(pullback(i1[V1]), f) for f in x] + @show lift_x + pb_x = pullback(i2[V2]).(lift_x) + @show pb_x + pb_x = pullback(j1[U]).(pb_x) + @show pb_x + morphism_dict[U] = ClosedEmbedding(SpecMor(U, V1, pb_x, check=false), pb_I2(V1), check=false) + end + j2_cov = CoveringMorphism(default_covering(Z), domain(i1_cov), morphism_dict, check=false) + j2 = Oscar.CoveredClosedEmbedding(Z, X1, j2_cov) + return j1, j2 +end diff --git a/src/AlgebraicGeometry/Schemes/ProjectiveSchemes/Morphisms/Types.jl b/src/AlgebraicGeometry/Schemes/ProjectiveSchemes/Morphisms/Types.jl index 46645bc9e46c..9dec25c8f7d4 100644 --- a/src/AlgebraicGeometry/Schemes/ProjectiveSchemes/Morphisms/Types.jl +++ b/src/AlgebraicGeometry/Schemes/ProjectiveSchemes/Morphisms/Types.jl @@ -154,6 +154,7 @@ end ) Y = codomain(f) SY = homogeneous_coordinate_ring(Y) + ambient_coordinate_ring(Y) === ambient_coordinate_ring(domain(f)) || error("ambient coordinate rings are not compatible") base_ring(I) === SY || error("ideal does not belong to the correct ring") @check begin pbf = pullback(f) diff --git a/test/AlgebraicGeometry/Schemes/ProjectiveSchemes.jl b/test/AlgebraicGeometry/Schemes/ProjectiveSchemes.jl index 3bc767457995..9e2d05374567 100644 --- a/test/AlgebraicGeometry/Schemes/ProjectiveSchemes.jl +++ b/test/AlgebraicGeometry/Schemes/ProjectiveSchemes.jl @@ -320,6 +320,14 @@ end I = ideal(S, [x^2 + y^2 + z^2]) X, inc = sub(IP2, I) X, inc = sub(IP2, gens(I)) + + J = ideal(S, [x+y+z]) + X2, inc2 = sub(IP2, J) + inc_cov = covered_scheme_morphism(inc) + inc2_cov = covered_scheme_morphism(inc2) + j1, j2 = fiber_product(inc_cov, inc2_cov) + @test pushforward(inc_cov)(image_ideal(j2)) == pushforward(inc2_cov)(image_ideal(j1)) + @test X === domain(inc) @test IP2 === codomain(inc) T = homogeneous_coordinate_ring(X)