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

Another fix for printing of scheme-related types #2864

Merged
merged 8 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
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
8 changes: 4 additions & 4 deletions experimental/Schemes/BlowupMorphism.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ julia> I = ideal(R, [x,y,z])
ideal(x, y, z)

julia> bl = blow_up(A3, I)
Blow up
Blowup
of scheme over QQ covered with 1 patch
1b: [x, y, z] affine 3-space
in sheaf of ideals with restriction
Expand Down Expand Up @@ -497,9 +497,9 @@ end
function Base.show(io::IO, Bl::BlowupMorphism)
io = pretty(io)
if get(io, :supercompact, false)
print(io, "Morphism")
print(io, "Blowup morphism")
else
print(io, "Blow-up: ", Lowercase(), domain(Bl))
print(io, "Blowup: ", Lowercase(), domain(Bl))
print(io, " -> ", Lowercase(), codomain(Bl))
end
end
Expand All @@ -519,7 +519,7 @@ function show(io::IO, ::MIME"text/plain", Bl::BlowupMorphism)

## create the output
io = pretty(io)
println(io, "Blow up")
println(io, "Blowup")
print(io, Indent(), "of ", Lowercase())
Oscar._show_semi_compact(io, X0, C0, "b")
println(io)
Expand Down
2 changes: 1 addition & 1 deletion experimental/Schemes/CartierDivisor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ dim(C::CartierDivisor) = dim(scheme(C))-1
function Base.show(io::IO, C::EffectiveCartierDivisor)
io = pretty(io)
if get(io, :supercompact, false)
print(io, "Cartier divisor")
print(io, "Effective cartier divisor")
elseif has_attribute(C, :name)
print(io, get_attribute(C, :name))
else
Expand Down
6 changes: 3 additions & 3 deletions experimental/Schemes/CoherentSheaves.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ end
function Base.show(io::IO, M::AbsCoherentSheaf)
io = pretty(io)
if get(io, :supercompact, false)
print(io, "Presheaf")
print(io, "Coherent sheaf of modules")
elseif has_attribute(M, :name)
print(io, get_attribute(M, :name))
else
Expand Down Expand Up @@ -1011,7 +1011,7 @@ end

function Base.show(io::IO, M::DirectSumSheaf)
if get(io, :supercompact, false)
print(io, "Presheaf")
print(io, "Direct sum of sheaves")
else
s = summands(M)
if is_unicode_allowed() && length(s) > 0
Expand All @@ -1020,7 +1020,7 @@ function Base.show(io::IO, M::DirectSumSheaf)
end
print(io, "$(s[end])")
else
print(io, "Sheaf of modules on covered scheme")
print(io, "Direct sum of sheaves of modules on covered scheme")
end
end
end
Expand Down
20 changes: 4 additions & 16 deletions experimental/Schemes/CoveredProjectiveSchemes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -173,23 +173,11 @@ mutable struct ProjectiveGlueing{
end

function Base.show(io::IO, PG::LazyProjectiveGlueing)
if get(io, :supercompact, false)
print(io, "Projective glueing")
else
if isdefined(G, :underlying_glueing)
show(io, underlying_glueing(G))
else
print(io, "Glueing of projective patches (not yet computed)")
end
end
print(io, "Glueing of projective patches (not yet computed)")
end

function Base.show(io::IO, PG::ProjectiveGlueing)
if get(io, :supercompact, false)
print(io, "Projective glueing")
else
print(io, "Glueing of projective patches")
end
print(io, "Glueing of projective patches")
end

function Base.show(io::IO, ::MIME"text/plain", PG::ProjectiveGlueing)
Expand Down Expand Up @@ -281,10 +269,10 @@ function Base.show(io::IO, CPS::CoveredProjectiveScheme)
n = length(projective_patches(CPS))
K = base_ring(base_scheme(CPS))
if get(io, :supercompact, false)
print(io, "Scheme")
print(io, "Relative projective scheme")
else
if length(projective_patches(CPS)) == 0
print(io, "Empty covered projective scheme over ")
print(io, "Empty relative projective scheme over ")
else
print(io, "Relative projective scheme over ")
end
Expand Down
4 changes: 2 additions & 2 deletions experimental/Schemes/CoveredScheme.jl
Original file line number Diff line number Diff line change
Expand Up @@ -689,8 +689,8 @@ julia> inc_E = Oscar.CoveredClosedEmbedding(domain(pr), JJ);

julia> comp = Oscar.composite_map(inc_E, pr)
Composite morphism of
Morphism: scheme over QQ covered with 2 patches -> scheme over QQ covered with 2 patches
Blow-up: scheme over QQ covered with 2 patches -> scheme over QQ covered with 1 patch
Hom: scheme over QQ covered with 2 patches -> scheme over QQ covered with 2 patches
Blowup: scheme over QQ covered with 2 patches -> scheme over QQ covered with 1 patch

julia> Oscar.maps(comp)[1] === inc_E
true
Expand Down
6 changes: 3 additions & 3 deletions experimental/Schemes/FunctionFields.jl
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,9 @@ canonical_unit(f::VarietyFunctionFieldElem) = f # part of the ring interface tha
function Base.show(io::IO, KK::VarietyFunctionField)
io = pretty(io)
if get(io, :supercompact, false)
print(io, "Field")
print(io, "Field of rational functions")
else
print(io, "Function field of ", Lowercase(), variety(KK))
print(io, "Field of rational functions on ", Lowercase(), variety(KK))
end
end

Expand All @@ -414,7 +414,7 @@ end
function Base.show(io::IO, f::VarietyFunctionFieldElem)
io = pretty(io)
if get(io, :supercompact, false)
print(io, "Field element")
print(io, "Rational function")
else
print(io, "Rational function on ", Lowercase(), variety(parent(f)))
end
Expand Down
2 changes: 1 addition & 1 deletion experimental/Schemes/IdealSheaves.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1029,7 +1029,7 @@ function Base.show(io::IO, I::IdealSheaf, show_scheme::Bool = true)
if has_attribute(I, :name)
print(io, get_attribute(I, :name))
elseif get(io, :supercompact, false)
print(io, "Presheaf")
print(io, "Sheaf of ideals")
else
if get_attribute(I, :is_one, false)
print(io, "Sheaf of unit ideals")
Expand Down
2 changes: 1 addition & 1 deletion experimental/Schemes/MorphismFromRationalFunctions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ function Base.show(io::IOContext, Phi::MorphismFromRationalFunctions)
if get(io, :supercompact, false)
print("Morphism from rational functions")
else
print("hom: ", X, " -> ", Y)
print("Hom: ", X, " -> ", Y)
end
end

Expand Down
2 changes: 1 addition & 1 deletion experimental/Schemes/Sheaves.jl
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ end
function Base.show(io::IO, R::StructureSheafOfRings)
io = pretty(io)
if get(io, :supercompact, false)
print(io, "Presheaf")
print(io, "Structure sheaf of rings")
else
if is_unicode_allowed()
print(io, "𝒪_{")
Expand Down
2 changes: 1 addition & 1 deletion experimental/Schemes/WeilDivisor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ function Base.show(io::IO, D::WeilDivisor)
if has_name(D)
print(io, name(D))
elseif get(io, :supercompact, false)
print(io, "Algebraic cycle")
print(io, "Weil divisor")
# if the divisor is prime and the ideal sheaf has a name print that
elseif length(components(D)) == 1 && has_attribute(first(components(D)), :name)
I = first(components(D))
Expand Down
2 changes: 1 addition & 1 deletion experimental/Schemes/elliptic_surface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ end
function Base.show(io::IO, S::EllipticSurface)
io = pretty(io)
if get(io, :supercompact, false)
print(io, "Scheme")
print(io, "Elliptic surface")
else
E = generic_fiber(S)
print(io, "Elliptic surface with generic fiber ", equation(E))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ end
function Base.show(io::IO, X::AffineAlgebraicSet{<:Field,<:MPolyQuoRing})
io = pretty(io)
if get(io, :supercompact, false)
print(io, "Scheme")
print(io, "Affine algebraic set")
fingolfin marked this conversation as resolved.
Show resolved Hide resolved
elseif get_attribute(X, :is_empty, false)
print(io, "Empty affine algebraic set over ")
K = base_ring(X)
Expand Down Expand Up @@ -58,7 +58,7 @@ end
function Base.show(io::IO, X::AffineAlgebraicSet)
io = pretty(io)
if get(io, :supercompact, false)
print(io, "Scheme")
print(io, "Affine algebraic set")
elseif get_attribute(X, :is_empty, false)
print(io, "Empty affine algebraic set over ")
K = base_ring(X)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ given by the pullback function
x3 -> x3

julia> graph(f)
(V(x1, -x1, x2 - x2, x3 - x3), Morphism: V(x1, -x1, x2 - x2, x3 - x3) -> V(x1), Morphism: V(x1, -x1, x2 - x2, x3 - x3) -> affine 3-space over QQ with coordinates [x1, x2, x3])
(V(x1, -x1, x2 - x2, x3 - x3), Hom: V(x1, -x1, x2 - x2, x3 - x3) -> V(x1), Hom: V(x1, -x1, x2 - x2, x3 - x3) -> affine 3-space over QQ with coordinates [x1, x2, x3])
```
"""
function graph(f::AbsSpecMor{<:AbsSpec{BRT}, <:AbsSpec{BRT}}) where {BRT}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ function Base.show(io::IO, ::MIME"text/plain", f::AbsSpecMor)
kY = length(str) # Length coordinates codomain
push!(co_str, str)
k = max(length.(co_str)...) # Maximum to estimate offsets
println(io, "Morphism")
println(io, "Affine scheme morphism")
print(io, Indent(), "from ")
print(io, co_str[1]*" "^(k-kX+2)) # Consider offset for alignment
if typeof(X) <: Union{PrincipalOpenSubset, AffineVariety{ <:Field, <: MPolyAnyRing}, <:Spec{<:Field, <:MPolyAnyRing}} # Take care of the case where the domain is not given as a V(bla)
Expand Down Expand Up @@ -210,11 +210,11 @@ end
function Base.show(io::IO, f::AbsSpecMor)
io = pretty(io)
if get(io, :supercompact, false)
print(io, "Morphism")
print(io, "Affine scheme morphism")
else
X = domain(f)
Y = codomain(f)
print(io, "Morphism: ")
print(io, "Hom: ")
if typeof(X) <: Union{PrincipalOpenSubset, AffineVariety{ <:Field, <: MPolyAnyRing}, <:Spec{<:Field, <:MPolyAnyRing}} # Take care of the case where the domain is not given as a V(bla)
print(io, Lowercase())
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -558,10 +558,10 @@ Spectrum
at complement of maximal ideal of point (0, 0)

julia> reduced_scheme(X)
(V(x^2 - 2*x*y + y^2, x - y), Morphism: V(x^2 - 2*x*y + y^2, x - y) -> V(x^2 - 2*x*y + y^2))
(V(x^2 - 2*x*y + y^2, x - y), Hom: V(x^2 - 2*x*y + y^2, x - y) -> V(x^2 - 2*x*y + y^2))

julia> reduced_scheme(Y)
(Spec of localization of quotient of multivariate polynomial ring at complement of maximal ideal, Morphism: Spec of localization of quotient of multivariate polynomial ring at complement of maximal ideal -> Spec of localization of quotient of multivariate polynomial ring at complement of maximal ideal)
(Spec of localization of quotient of multivariate polynomial ring at complement of maximal ideal, Hom: Spec of localization of quotient of multivariate polynomial ring at complement of maximal ideal -> Spec of localization of quotient of multivariate polynomial ring at complement of maximal ideal)

```
"""
Expand Down Expand Up @@ -641,10 +641,10 @@ Spectrum
by ideal(x^2 - y^2 + z^2)

julia> singular_locus(A3)
(V(1), Morphism: V(1) -> affine 3-space)
(V(1), Hom: V(1) -> affine 3-space)

julia> singular_locus(X)
(V(x^2 - y^2 + z^2, z, y, x), Morphism: V(x^2 - y^2 + z^2, z, y, x) -> V(x^2 - y^2 + z^2))
(V(x^2 - y^2 + z^2, z, y, x), Hom: V(x^2 - y^2 + z^2, z, y, x) -> V(x^2 - y^2 + z^2))

julia> U = MPolyComplementOfKPointIdeal(R,[0,0,0])
Complement
Expand All @@ -661,7 +661,7 @@ Spectrum
at complement of maximal ideal of point (0, 0, 0)

julia> singular_locus(Y)
(Spec of localization of quotient of multivariate polynomial ring at complement of maximal ideal, Morphism: Spec of localization of quotient of multivariate polynomial ring at complement of maximal ideal -> Spec of localization of quotient of multivariate polynomial ring at complement of maximal ideal)
(Spec of localization of quotient of multivariate polynomial ring at complement of maximal ideal, Hom: Spec of localization of quotient of multivariate polynomial ring at complement of maximal ideal -> Spec of localization of quotient of multivariate polynomial ring at complement of maximal ideal)

```
"""
Expand Down Expand Up @@ -720,10 +720,10 @@ Spectrum
by ideal(x^4 - 2*x^2*y^2 + 2*x^2*z^2 + y^4 - 2*y^2*z^2 + z^4)

julia> singular_locus_reduced(X)
(V(x^4 - 2*x^2*y^2 + 2*x^2*z^2 + y^4 - 2*y^2*z^2 + z^4, z, y, x), Morphism: V(x^4 - 2*x^2*y^2 + 2*x^2*z^2 + y^4 - 2*y^2*z^2 + z^4, z, y, x) -> V(x^4 - 2*x^2*y^2 + 2*x^2*z^2 + y^4 - 2*y^2*z^2 + z^4))
(V(x^4 - 2*x^2*y^2 + 2*x^2*z^2 + y^4 - 2*y^2*z^2 + z^4, z, y, x), Hom: V(x^4 - 2*x^2*y^2 + 2*x^2*z^2 + y^4 - 2*y^2*z^2 + z^4, z, y, x) -> V(x^4 - 2*x^2*y^2 + 2*x^2*z^2 + y^4 - 2*y^2*z^2 + z^4))

julia> singular_locus(X)
(V(x^4 - 2*x^2*y^2 + 2*x^2*z^2 + y^4 - 2*y^2*z^2 + z^4, x^2 - y^2 + z^2), Morphism: V(x^4 - 2*x^2*y^2 + 2*x^2*z^2 + y^4 - 2*y^2*z^2 + z^4, x^2 - y^2 + z^2) -> V(x^4 - 2*x^2*y^2 + 2*x^2*z^2 + y^4 - 2*y^2*z^2 + z^4))
(V(x^4 - 2*x^2*y^2 + 2*x^2*z^2 + y^4 - 2*y^2*z^2 + z^4, x^2 - y^2 + z^2), Hom: V(x^4 - 2*x^2*y^2 + 2*x^2*z^2 + y^4 - 2*y^2*z^2 + z^4, x^2 - y^2 + z^2) -> V(x^4 - 2*x^2*y^2 + 2*x^2*z^2 + y^4 - 2*y^2*z^2 + z^4))

```
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function Base.show(io::IO, X::AbsSpec)
elseif get(io, :supercompact, false)
print(io, "Affine scheme")
elseif get_attribute(X, :is_empty, false)
print(io, "Empty scheme")
print(io, "Empty affine scheme")
else
_show(io, X)
end
Expand All @@ -60,7 +60,7 @@ end

function _show(io::IO, X::AbsSpec{<:Any,<:MPolyRing})
io = pretty(io)
print(io, "affine ",ngens(OO(X)),"-space")
print(io, "Affine ",ngens(OO(X)),"-space")
end

function _show(io::IO, X::AbsSpec{<:Any,<:MPolyQuoRing})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ end
function Base.show(io::IO, X::AffineVariety{<:Field,<:MPolyQuoRing})
io = pretty(io)
if get(io, :supercompact, false)
print(io, "Scheme")
print(io, "Affine variety")
elseif get_attribute(X, :is_empty, false)
print(io, "Empty affine variety over ")
K = base_ring(X)
Expand All @@ -49,7 +49,7 @@ end
function Base.show(io::IO, X::AffineVariety)
io = pretty(io)
if get(io, :supercompact, false)
print(io, "Scheme")
print(io, "Affine variety")
fingolfin marked this conversation as resolved.
Show resolved Hide resolved
elseif get_attribute(X, :is_empty, false)
print(io, "Empty affine variety over ")
K = base_ring(X)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ with default covering
3: [(x//z), (y//z)]

julia> I, s = singular_locus(Ycov)
(Scheme over QQ covered with 1 patch, Morphism: scheme over QQ covered with 1 patch -> scheme over QQ covered with 3 patches)
(Scheme over QQ covered with 1 patch, Hom: scheme over QQ covered with 1 patch -> scheme over QQ covered with 3 patches)

julia> covering_morphism(s)
Morphism
from covering with 1 patch
1a: [(x//z), (y//z)] V((x//z)^3 - (y//z)^2, (y//z), (x//z))
to covering with 3 patches
to covering with 3 patches
1b: [(y//x), (z//x)] V(-(y//x)^2*(z//x) + 1)
2b: [(x//y), (z//y)] V((x//y)^3 - (z//y))
3b: [(x//z), (y//z)] V((x//z)^3 - (y//z)^2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Morphism
1a: [(y//x), (z//x)] V((y//x), 1)
2a: [(x//y), (z//y)] V(1, (x//y))
3a: [(x//z), (y//z)] V((y//z), (x//z))
to scheme over QQ covered with 3 patches
to scheme over QQ covered with 3 patches
1b: [(y//x), (z//x)] V((y//x), 1)
2b: [(x//y), (z//y)] V(1, (x//y))
3b: [(x//z), (y//z)] V((y//z), (x//z))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ end
function Base.show(io::IO, f::AbsCoveredSchemeMorphism)
io = pretty(io)
if get(io, :supercompact, false)
print(io, "Morphism")
print(io, "Covered scheme morphism")
else
print(io, "Morphism: ", Lowercase(), domain(f), " -> ", Lowercase(), codomain(f))
print(io, "Hom: ", Lowercase(), domain(f), " -> ", Lowercase(), codomain(f))
end
end

Expand All @@ -142,11 +142,11 @@ end
function Base.show(io::IO, ::MIME"text/plain", f::AbsCoveredSchemeMorphism)
io = pretty(io)
g = covering_morphism(f)
println(io, "Morphism")
println(io, "Covered scheme morphism")
print(io, Indent(), "from ", Lowercase())
Oscar._show_semi_compact(io, domain(f), domain(g), "a")
println(io)
print(io, "to ", Lowercase())
print(io, "to ", Lowercase())
Oscar._show_semi_compact(io, codomain(f), codomain(g), "b")
if min(length(domain(g)), length(codomain(g))) == 0
print(io, Dedent())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ with default covering
3: [(x//z), (y//z)]

julia> I, s = singular_locus(Ycov)
(Scheme over QQ covered with 1 patch, Morphism: scheme over QQ covered with 1 patch -> scheme over QQ covered with 3 patches)
(Scheme over QQ covered with 1 patch, Hom: scheme over QQ covered with 1 patch -> scheme over QQ covered with 3 patches)

julia> I # singular locus actually lives in the patch {z != 0}
Scheme
Expand All @@ -247,7 +247,7 @@ julia> s
Morphism
from scheme over QQ covered with 1 patch
1a: [(x//z), (y//z)] V((x//z)^3 - (y//z)^2, (y//z), (x//z))
to scheme over QQ covered with 3 patches
to scheme over QQ covered with 3 patches
1b: [(y//x), (z//x)] V(-(y//x)^2*(z//x) + 1)
2b: [(x//y), (z//y)] V((x//y)^3 - (z//y))
3b: [(x//z), (y//z)] V((x//z)^3 - (y//z)^2)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ function Base.show(io::IO, X::AbsCoveredScheme, cov::Covering = get_attribute(X,
if has_name(X)
print(io, name(X))
elseif get(io, :supercompact, false)
print(io, "Scheme")
print(io, "Covered scheme")
else
if get_attribute(X, :is_empty, false) || npatches(cov) == 0
print(io, "Empty covered scheme over ")
Expand Down
Loading