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 4 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
2 changes: 1 addition & 1 deletion experimental/Schemes/CoveredProjectiveSchemes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ 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, "Covered projective scheme")
StevellM marked this conversation as resolved.
Show resolved Hide resolved
else
if length(projective_patches(CPS)) == 0
print(io, "Empty covered projective scheme over ")
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
4 changes: 2 additions & 2 deletions experimental/Schemes/FunctionFields.jl
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ 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, "Function field")
fingolfin marked this conversation as resolved.
Show resolved Hide resolved
else
print(io, "Function field of ", Lowercase(), variety(KK))
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, "Function field element")
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, "Ideal sheaf")
fingolfin marked this conversation as resolved.
Show resolved Hide resolved
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 @@ -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 @@ -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 @@ -146,7 +146,7 @@ function Base.show(io::IO, ::MIME"text/plain", f::AbsCoveredSchemeMorphism)
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
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Morphism
1a: [(y//x), (z//x)] V(-(y//x)^2*(z//x) + 1)
2a: [(x//y), (z//y)] V((x//y)^3 - (z//y))
3a: [(x//z), (y//z)] V((x//z)^3 - (y//z)^2)
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
6 changes: 3 additions & 3 deletions src/AlgebraicGeometry/Schemes/Covering/Morphisms/Methods.jl
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ end
function Base.show(io::IO, f::CoveringMorphism)
io = pretty(io)
if get(io, :supercompact, false)
print(io, "Morphism")
print(io, "Covering morphism")
else
print(io, "Morphism: ", Lowercase(), domain(f), " -> ", Lowercase(), codomain(f))
print(io, "Hom: ", Lowercase(), domain(f), " -> ", Lowercase(), codomain(f))
end
end

Expand Down Expand Up @@ -172,7 +172,7 @@ function Base.show(io::IO, ::MIME"text/plain", f::CoveringMorphism)
print(io, " "^(lX-li)*"$(i)a: "*co_str[i+1]*" "^(k-kc+3), Lowercase(), U)
end
println(io, Dedent())
print(io, "to ", Lowercase(), codomain(f))
print(io, "to ", Lowercase(), codomain(f))
print(io, Indent())
co_str = String[""]
for i in 1:length(codomain(f))
Expand Down
4 changes: 2 additions & 2 deletions src/AlgebraicGeometry/Schemes/Glueing/Constructors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ julia> g = SpecMor(V2, V1, [1//u, v//u]); # and its inverse

julia> G = Glueing(U1, U2, f, g) # Construct the glueing
Glueing
of affine 2-space
of affine 2-space
and affine 2-space
along the open subsets
[x, y] AA^2 \ V(x)
Expand All @@ -46,7 +46,7 @@ julia> h2 = SpecOpenMor(W2, W1, [1//u, v//u]);

julia> H = Glueing(U1, U2, h1, h2)
Glueing
of affine 2-space
of affine 2-space
and affine 2-space
along the open subsets
[x, y] complement to V(x) in affine scheme with coordinates [x, y]
Expand Down
2 changes: 1 addition & 1 deletion src/AlgebraicGeometry/Schemes/Glueing/Methods.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
function Base.show(io::IO, ::MIME"text/plain", G::AbsGlueing)
io = pretty(io)
println(io, "Glueing")
println(io, Indent(), "of ", Lowercase(), patches(G)[1])
println(io, Indent(), "of ", Lowercase(), patches(G)[1])
println(io, "and ", Lowercase(), patches(G)[2])
println(io, Dedent(), "along the open subsets")
f = glueing_morphisms(G)[1]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ end
function Base.show(io::IO, X::AbsProjectiveAlgebraicSet{<:Field, <:MPolyQuoRing})
io = pretty(io)
if get(io, :supercompact, false)
print(io, "Scheme")
print(io, "Projective algebraic set")
fingolfin marked this conversation as resolved.
Show resolved Hide resolved
elseif get_attribute(X, :is_empty, false)
print(io, "Empty projective algebraic set")
else
Expand Down
Loading
Loading