Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes for intersections and coverings #1571

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion experimental/Schemes/AffineSchemes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,9 @@ identity_map(X::AbsSpec{<:Any, <:MPolyQuoLocalizedRing}) = SpecMor(X, X, hom(OO(
identity_map(X::AbsSpec{<:Any, <:MPolyLocalizedRing}) = SpecMor(X, X, hom(OO(X), OO(X), gens(base_ring(OO(X))), check=false))
identity_map(X::AbsSpec{<:Any, <:MPolyRing}) = SpecMor(X, X, hom(OO(X), OO(X), gens(OO(X))))
identity_map(X::AbsSpec{<:Any, <:MPolyQuo}) = SpecMor(X, X, hom(OO(X), OO(X), gens(ambient_ring(X))))
inclusion_map(X::T, Y::T) where {T<:AbsSpec} = SpecMor(X, Y, gens(base_ring(OO(Y))))
inclusion_map(X::AbsSpec, Y::AbsSpec) = SpecMor(X, Y, gens(base_ring(OO(Y)))) # TODO: Remove
inclusion_morphism(X::AbsSpec, Y::AbsSpec; check::Bool=true) = SpecMor(X, Y, gens(base_ring(OO(Y))), check=check)
inclusion_morphism(X::SpecOpen, Y::AbsSpec; check::Bool=true) = inclusion_morphism(X, SpecOpen(Y), check=check)

function restrict(f::SpecMor, U::AbsSpec, V::AbsSpec; check::Bool=true)
if check
Expand All @@ -824,6 +826,9 @@ function restrict(f::SpecMor, U::AbsSpec, V::AbsSpec; check::Bool=true)
return SpecMor(U, V, OO(U).(pullback(f).(gens(domain(pullback(f))))), check=check)
end

restriction(f::SpecMor, U::AbsSpec, V::AbsSpec; check::Bool=true) = restrict(f,U,V,check=check)
simonbrandhorst marked this conversation as resolved.
Show resolved Hide resolved


function compose(f::AbsSpecMor, g::AbsSpecMor; check::Bool=true)
codomain(f) == domain(g) || error("Morphisms can not be composed")
return SpecMor(domain(f), codomain(g), compose(pullback(g), pullback(f)), check=check)
Expand Down
40 changes: 18 additions & 22 deletions experimental/Schemes/CoveredScheme.jl
Original file line number Diff line number Diff line change
Expand Up @@ -146,22 +146,22 @@ function intersect_in_covering(U::AbsSpec, V::AbsSpec, C::Covering)
(l, m, n) = indexin(V, C)
if i == l # U and V are affine opens of the same patch X in C
X = C[i]
if X == U == V
iso = identity_map(SpecOpen(X))
if X == U == V
iso = identity_map(X)
return iso, iso, iso, iso
end
f = one(base_ring(OO(X))) # For the case where U is already a basic patch
f = one(ambient_ring(X)) # For the case where U is already a basic patch
if j != 0 # In this case, U appears in some refinement
f = gens(affine_refinements(C)[C[i]][j][1])[k]
f = gens(affine_refinements(C)[X][j][1])[k]
end
g = one(base_ring(OO(X)))
g = one(ambient_ring(X))
if m != 0
g = gens(affine_refinements(C)[C[l]][m][1])[n]
g = gens(affine_refinements(C)[X][m][1])[n]
end
W = SpecOpen(X, [f*g])
W = PrincipalOpenSubset(X, [f*g])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's try to find a test for this line, tomorrow. Also, we should run the whole method on covered schemes that use both types of glueings.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can write it when #1573 is merged.

isoW = identity_map(W)
incWtoU = inclusion_morphism(W, SpecOpen(U), check=false)
incWtoV = inclusion_morphism(W, SpecOpen(V), check=false)
incWtoU = inclusion_morphism(W, U, check=false)
incWtoV = inclusion_morphism(W, V, check=false)
return isoW, isoW, incWtoU, incWtoV
else
G = C[i, l]
Expand All @@ -172,8 +172,8 @@ function intersect_in_covering(U::AbsSpec, V::AbsSpec, C::Covering)
WV = intersect(preimU, V)
isoWUtoWV = restriction(f, WU, WV, check=false)
isoWVtoWU = restriction(g, WV, WU, check=false)
incWUtoU = inclusion_morphism(WU, SpecOpen(U), check=false)
incWVtoV = inclusion_morphism(WV, SpecOpen(V), check=false)
incWUtoU = inclusion_morphism(WU, U, check=false)
incWVtoV = inclusion_morphism(WV, V, check=false)
return isoWUtoWV, isoWVtoWU, incWUtoU, incWVtoV
end
end
Expand Down Expand Up @@ -285,29 +285,25 @@ end
for j in i+1:r+1
x = gens(base_ring(OO(U[i])))
y = gens(base_ring(OO(U[j])))
f = SpecOpenMor(U[i], x[j-1],
U[j], y[i],
Ui = PrincipalOpenSubset(U[i], OO(U[i])(x[j-1]))
Uj = PrincipalOpenSubset(U[j], OO(U[j])(y[i]))
f = SpecMor(Ui, Uj,
vcat([x[k]//x[j-1] for k in 1:i-1],
[1//x[j-1]],
[x[k-1]//x[j-1] for k in i+1:j-1],
[x[k]//x[j-1] for k in j:r],
x[r+1:end]),
check=false
check=true
simonbrandhorst marked this conversation as resolved.
Show resolved Hide resolved
)
g = SpecOpenMor(U[j], y[i],
U[i], x[j-1],
g = SpecMor(Uj, Ui,
vcat([y[k]//y[i] for k in 1:i-1],
[y[k+1]//y[i] for k in i:j-2],
[1//y[i]],
[y[k]//y[i] for k in j:r],
y[r+1:end]),
check=false
check=true
)
# the following two lines are necessary to assure correct parenthood
# of elements
f = restriction(f, domain(f), domain(g), check=false)
g = restriction(g, domain(g), domain(f), check=false)
add_glueing!(result, Glueing(U[i], U[j], f, g, check=false))
add_glueing!(result, SimpleGlueing(U[i], U[j], f, g, check=false))
end
end
return result
Expand Down
11 changes: 11 additions & 0 deletions test/Schemes/ProjectiveSchemes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,14 @@ end
a = OO(U)([x//y, z//x])
@test pullback(projection_to_base(Y))(a)*s0 == s1
end


@testset "projective schemes as covered schemes" begin
P3 = projective_space(QQ,3)
S = ambient_ring(P3)
F = subscheme(P3,ideal(S,S[1]^4+S[2]^4+S[3]^4+S[4]^4))
Fc = as_covered_scheme(F)
U = patches(Fc)[1]
V = patches(Fc)[2]
oscar.intersect_in_covering(U,V,Fc[1])
end