Skip to content

Commit

Permalink
Move methods to where inclusion order allows them to be and implement
Browse files Browse the repository at this point in the history
ambient_embedding for projective schemes.
  • Loading branch information
HechtiDerLachs committed Sep 28, 2023
1 parent 4abd1b7 commit 64150f4
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 46 deletions.
42 changes: 42 additions & 0 deletions experimental/Schemes/CoveredProjectiveSchemes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1756,3 +1756,45 @@ 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))
lift_x = [preimage(pullback(i1[V1]), f) for f in x]
pb_x = pullback(i2[V2]).(lift_x)
pb_x = pullback(j1[U]).(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
46 changes: 0 additions & 46 deletions src/AlgebraicGeometry/Schemes/CoveredSchemes/Morphisms/Methods.jl
Original file line number Diff line number Diff line change
Expand Up @@ -159,49 +159,3 @@ function Base.show(io::IO, ::MIME"text/plain", f::AbsCoveredSchemeMorphism)
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
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ identity_map(P::AbsProjectiveScheme) = ProjectiveSchemeMor(P, P,
function sub(P::AbsProjectiveScheme, I::Ideal)
@req base_ring(I) === homogeneous_coordinate_ring(P) "ideal must be defined in the homogeneous coordinate ring of the scheme"
inc = ProjectiveClosedEmbedding(P, I)
set_attribute!(domain(inc), :ambient_space, ambient_space(P))
return domain(inc), inc
end

Expand Down Expand Up @@ -179,3 +180,13 @@ function compose(f::ProjectiveClosedEmbedding, g::ProjectiveClosedEmbedding)
J = push_If + Ig
return ProjectiveClosedEmbedding(compose(underlying_morphism(f), underlying_morphism(g)), J, check=false)
end

function ambient_embedding(X::AbsProjectiveScheme)
IP = ambient_space(X)
S = homogeneous_coordinate_ring(IP)
T = homogeneous_coordinate_ring(X)
I = defining_ideal(X)
pb = hom(S, T, gens(T))
inc_sub = ProjectiveSchemeMor(X, IP, pb, check=false)
return ProjectiveClosedEmbedding(inc_sub, I, check=false)
end

0 comments on commit 64150f4

Please sign in to comment.