From 04820d1d967d2a7eea70571e6afaa50e0934ccc6 Mon Sep 17 00:00:00 2001 From: simonbrandhorst Date: Sat, 27 May 2023 09:59:58 +0200 Subject: [PATCH] pretty printing for quotients, graded and localized multivariate polynomial rings (#2184) --- Project.toml | 2 +- .../GroebnerBases/groebner_bases.md | 5 +- .../src/CommutativeAlgebra/affine_algebras.md | 35 +- docs/src/CommutativeAlgebra/localizations.md | 38 +- docs/src/CommutativeAlgebra/rings.md | 5 +- .../PlaneCurve/docs/src/elliptic_curves.md | 10 +- experimental/PlaneCurve/src/DivisorCurve.jl | 35 +- .../PlaneCurve/src/ParaPlaneCurves.jl | 7 +- experimental/PlaneCurve/src/PlaneCurve.jl | 14 +- experimental/PlaneCurve/src/ProjCurve.jl | 24 +- .../PlaneCurve/src/ProjEllipticCurve.jl | 20 +- experimental/PlaneCurve/src/ProjPlaneCurve.jl | 20 +- experimental/Schemes/BlowupMorphism.jl | 12 +- .../src/NormalToricSchemes/Attributes.jl | 2 +- .../AffineSchemes/Morphisms/Attributes.jl | 12 +- .../AffineSchemes/Morphisms/Constructors.jl | 6 +- .../AffineSchemes/Morphisms/Properties.jl | 2 +- .../AffineSchemes/Objects/Attributes.jl | 84 ++-- .../AffineSchemes/Objects/Constructors.jl | 32 +- .../AffineSchemes/Objects/Properties.jl | 24 +- .../CoveredSchemes/Objects/Attributes.jl | 6 +- .../Schemes/Glueing/Constructors.jl | 4 +- .../ProjectiveSchemes/Objects/Attributes.jl | 38 +- .../ProjectiveSchemes/Objects/Methods.jl | 4 +- .../AlgebraicCycles/attributes.jl | 4 +- .../AlgebraicCycles/constructors.jl | 4 +- .../AlgebraicCycles/special_attributes.jl | 8 +- .../CohomologyClasses/attributes.jl | 4 +- .../NormalToricVarieties/attributes.jl | 4 +- .../Matroids/matroid_strata_grassmannian.jl | 8 +- src/Combinatorics/SimplicialComplexes.jl | 8 +- src/InvariantTheory/affine_algebra.jl | 17 +- src/Modules/ModulesGraded.jl | 28 +- src/Modules/UngradedModules.jl | 28 +- src/Rings/MPolyQuo.jl | 59 +-- src/Rings/localization_interface.jl | 45 +- src/Rings/mpoly-affine-algebras.jl | 21 +- src/Rings/mpoly-graded.jl | 213 +++------ src/Rings/mpoly-ideals.jl | 8 +- src/Rings/mpoly-localizations.jl | 434 +++++++++++++++--- src/Rings/mpolyquo-localizations.jl | 142 ++++-- src/imports.jl | 5 + test/Rings/mpoly-localizations.jl | 18 - test/Rings/mpolyquo-localizations.jl | 20 - 44 files changed, 847 insertions(+), 672 deletions(-) diff --git a/Project.toml b/Project.toml index e326afdf4a01..f527067bc66a 100644 --- a/Project.toml +++ b/Project.toml @@ -23,7 +23,7 @@ UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4" cohomCalg_jll = "5558cf25-a90e-53b0-b813-cadaa3ae7ade" [compat] -AbstractAlgebra = "0.30.2" +AbstractAlgebra = "0.30.7" AlgebraicSolving = "0.3.0" DocStringExtensions = "0.8, 0.9" GAP = "0.9.4" diff --git a/docs/src/CommutativeAlgebra/GroebnerBases/groebner_bases.md b/docs/src/CommutativeAlgebra/GroebnerBases/groebner_bases.md index 85ccf9c6bcae..68ccdec19fb6 100644 --- a/docs/src/CommutativeAlgebra/GroebnerBases/groebner_bases.md +++ b/docs/src/CommutativeAlgebra/GroebnerBases/groebner_bases.md @@ -71,10 +71,7 @@ julia> default_ordering(F) degrevlex([x, y, z])*lex([gen(1), gen(2)]) julia> S, _ = grade(R, [1, 2, 3]) -(Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [2] - z -> [3], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) julia> default_ordering(S) wdegrevlex([x, y, z], [1, 2, 3]) diff --git a/docs/src/CommutativeAlgebra/affine_algebras.md b/docs/src/CommutativeAlgebra/affine_algebras.md index cfb86abb3270..3515380e6634 100644 --- a/docs/src/CommutativeAlgebra/affine_algebras.md +++ b/docs/src/CommutativeAlgebra/affine_algebras.md @@ -219,7 +219,9 @@ julia> a = ideal(A, [x-y, z^4]) ideal(x - y, z^4) julia> base_ring(a) -Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(-x^2 + y, -x^3 + z) +Quotient + of multivariate polynomial ring in 3 variables over QQ + by ideal(-x^2 + y, -x^3 + z) julia> gens(a) 2-element Vector{MPolyQuoRingElem{QQMPolyRingElem}}: @@ -350,16 +352,10 @@ julia> para = hom(D1, C1, V1) Map with following data Domain: ======= -Multivariate polynomial ring in 4 variables over QQ graded by - w -> [1] - x -> [1] - y -> [1] - z -> [1] +Graded multivariate polynomial ring in 4 variables over QQ Codomain: ========= -Multivariate polynomial ring in 2 variables over QQ graded by - s -> [1] - t -> [1] +Graded multivariate polynomial ring in 2 variables over QQ julia> twistedCubic = kernel(para) ideal(-x*z + y^2, -w*z + x*y, -w*y + x^2) @@ -374,17 +370,10 @@ julia> proj = hom(D2, C2, V2) Map with following data Domain: ======= -Multivariate polynomial ring in 3 variables over QQ graded by - a -> [1] - b -> [1] - c -> [1] +Graded multivariate polynomial ring in 3 variables over QQ Codomain: ========= -Quotient of Multivariate polynomial ring in 4 variables over QQ graded by - w -> [1] - x -> [1] - y -> [1] - z -> [1] by ideal(-x*z + y^2, -w*z + x*y, -w*y + x^2) +Quotient of multivariate polynomial ring by ideal with 3 generators julia> nodalCubic = kernel(proj) ideal(-a^2*c + b^3 - 2*b^2*c + b*c^2) @@ -443,7 +432,7 @@ Domain: Multivariate polynomial ring in 3 variables over QQ Codomain: ========= -Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(-b^3 + c) +Quotient of multivariate polynomial ring by ideal with 1 generator julia> is_surjective(F) true @@ -523,19 +512,19 @@ julia> L[2] Map with following data Domain: ======= -Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x*y, x*z) +Quotient of multivariate polynomial ring by ideal with 2 generators Codomain: ========= -Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(2*x^2 + x*y, 10*x^2 + 5*x*y + x*z) +Quotient of multivariate polynomial ring by ideal with 2 generators julia> L[3] Map with following data Domain: ======= -Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(2*x^2 + x*y, 10*x^2 + 5*x*y + x*z) +Quotient of multivariate polynomial ring by ideal with 2 generators Codomain: ========= -Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x*y, x*z) +Quotient of multivariate polynomial ring by ideal with 2 generators ``` ## Normalization diff --git a/docs/src/CommutativeAlgebra/localizations.md b/docs/src/CommutativeAlgebra/localizations.md index 492cd539905e..1c44ea09ff94 100644 --- a/docs/src/CommutativeAlgebra/localizations.md +++ b/docs/src/CommutativeAlgebra/localizations.md @@ -114,7 +114,9 @@ julia> P = ideal(R, [x]) ideal(x) julia> U = complement_of_prime_ideal(P) -complement of ideal(x) +Complement + of prime ideal(x) + in multivariate polynomial ring in 3 variables over QQ julia> Rloc, _ = localization(U); @@ -139,7 +141,9 @@ julia> P = ideal(R, [y-1, x-a]) ideal(y - 1, x - a) julia> U = complement_of_prime_ideal(P) -complement of ideal(y - 1, x - a) +Complement + of prime ideal(y - 1, x - a) + in multivariate polynomial ring in 2 variables over number field julia> RQ, _ = quo(R, I); @@ -180,7 +184,9 @@ julia> P = ideal(R, [x]) ideal(x) julia> U = complement_of_prime_ideal(P) -complement of ideal(x) +Complement + of prime ideal(x) + in multivariate polynomial ring in 3 variables over QQ julia> Rloc, iota = localization(U); @@ -225,7 +231,9 @@ julia> P = ideal(R, [y-1, x-a]) ideal(y - 1, x - a) julia> U = complement_of_prime_ideal(P) -complement of ideal(y - 1, x - a) +Complement + of prime ideal(y - 1, x - a) + in multivariate polynomial ring in 2 variables over number field julia> RQ, p = quo(R, I); @@ -284,7 +292,9 @@ julia> P = ideal(R, [x]) ideal(x) julia> U = complement_of_prime_ideal(P) -complement of ideal(x) +Complement + of prime ideal(x) + in multivariate polynomial ring in 3 variables over QQ julia> Rloc, iota = localization(U); @@ -292,7 +302,9 @@ julia> f = iota(x)/iota(y) x/y julia> parent(f) -localization of Multivariate polynomial ring in 3 variables over QQ at the complement of ideal(x) +Localization + of multivariate polynomial ring in 3 variables over QQ + at complement of prime ideal(x) julia> g = iota(y)/iota(z) y/z @@ -321,7 +333,9 @@ julia> P = ideal(R, [y-1, x-a]) ideal(y - 1, x - a) julia> U = complement_of_prime_ideal(P) -complement of ideal(y - 1, x - a) +Complement + of prime ideal(y - 1, x - a) + in multivariate polynomial ring in 2 variables over number field julia> RQ, p = quo(R, I); @@ -333,7 +347,9 @@ julia> f = phi(x) x julia> parent(f) -Localization of Quotient of Multivariate polynomial ring in 2 variables over number field by ideal(2*x^2 - y^3, 2*x^2 - y^5) at the multiplicative set complement of ideal(y - 1, x - a) +Localization + of quotient of multivariate polynomial ring by ideal with 2 generators + at complement of prime ideal(y - 1, x - a) julia> g = f/phi(y) x/y @@ -421,7 +437,11 @@ julia> U = complement_of_point_ideal(R, [0, 0]); julia> Rloc, _ = localization(R, U); julia> MI = ideal(Rloc, V) -ideal in localization of Multivariate polynomial ring in 2 variables over QQ at the complement of maximal ideal corresponding to point with coordinates QQFieldElem[0, 0] generated by [3*x^2, 4*y^3] +Ideal + of localized ring +with 2 generators + 3*x^2 + 4*y^3 ``` ### Data Associated to Ideals diff --git a/docs/src/CommutativeAlgebra/rings.md b/docs/src/CommutativeAlgebra/rings.md index 86fcd9594b21..ddd2a0d736da 100644 --- a/docs/src/CommutativeAlgebra/rings.md +++ b/docs/src/CommutativeAlgebra/rings.md @@ -356,10 +356,7 @@ julia> typeof(f) QQMPolyRingElem julia> S, (x, y, z) = grade(R) -(Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [1] - z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) julia> g = 3*x^2+y*z 3*x^2 + y*z diff --git a/experimental/PlaneCurve/docs/src/elliptic_curves.md b/experimental/PlaneCurve/docs/src/elliptic_curves.md index 3564ffae4926..3f3ee68e3621 100644 --- a/experimental/PlaneCurve/docs/src/elliptic_curves.md +++ b/experimental/PlaneCurve/docs/src/elliptic_curves.md @@ -48,10 +48,7 @@ julia> S, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]) (Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x, y, z]) julia> T, _ = grade(S) -(Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [1] - z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) julia> E = Oscar.ProjEllipticCurve(T(y^2*z - x^3 + 2*x*z^2)) Projective elliptic curve defined by -x^3 + 2*x*z^2 + y^2*z @@ -124,10 +121,7 @@ julia> S, (x,y,z) = polynomial_ring(A, ["x", "y", "z"]) (Multivariate polynomial ring in 3 variables over ZZ/(4453), AbstractAlgebra.Generic.MPoly{ZZModRingElem}[x, y, z]) julia> T, _ = grade(S) -(Multivariate polynomial ring in 3 variables over ZZ/(4453) graded by - x -> [1] - y -> [1] - z -> [1], MPolyDecRingElem{ZZModRingElem, AbstractAlgebra.Generic.MPoly{ZZModRingElem}}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over ZZ/(4453), MPolyDecRingElem{ZZModRingElem, AbstractAlgebra.Generic.MPoly{ZZModRingElem}}[x, y, z]) julia> E = Oscar.ProjEllipticCurve(T(y^2*z - x^3 - 10*x*z^2 + 2*z^3)) Projective elliptic curve defined by 4452*x^3 + 4443*x*z^2 + y^2*z + 2*z^3 diff --git a/experimental/PlaneCurve/src/DivisorCurve.jl b/experimental/PlaneCurve/src/DivisorCurve.jl index 8c06b07df3f9..b576ee6dbbae 100644 --- a/experimental/PlaneCurve/src/DivisorCurve.jl +++ b/experimental/PlaneCurve/src/DivisorCurve.jl @@ -84,10 +84,7 @@ julia> S, (x,y,z) = polynomial_ring(QQ, ["x", "y", "z"]) (Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x, y, z]) julia> T, _ = grade(S) -(Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [1] - z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) julia> C = Oscar.ProjPlaneCurve(T(y^2 + y*z + x^2)) Projective plane curve defined by x^2 + y^2 + y*z @@ -305,10 +302,7 @@ julia> S, (x,y,z) = polynomial_ring(QQ, ["x", "y", "z"]) (Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x, y, z]) julia> T, _ = grade(S) -(Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [1] - z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) julia> C = Oscar.ProjPlaneCurve(T(y^2 + y*z + x^2)) Projective plane curve defined by x^2 + y^2 + y*z @@ -452,10 +446,7 @@ julia> S, (x,y,z) = polynomial_ring(QQ, ["x", "y", "z"]) (Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x, y, z]) julia> T, _ = grade(S) -(Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [1] - z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) julia> C = Oscar.ProjPlaneCurve(T(y^2 + y*z + x^2)) Projective plane curve defined by x^2 + y^2 + y*z @@ -600,10 +591,7 @@ julia> S, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]) (Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x, y, z]) julia> T, _ = grade(S) -(Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [1] - z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) julia> C = Oscar.ProjPlaneCurve(T(y^2*z - x*(x-z)*(x+3*z))) Projective plane curve defined by -x^3 - 2*x^2*z + 3*x*z^2 + y^2*z @@ -699,10 +687,7 @@ julia> S, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]) (Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x, y, z]) julia> T, _ = grade(S) -(Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [1] - z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) julia> C = Oscar.ProjPlaneCurve(T(y^2*z - x*(x-z)*(x+3*z))) Projective plane curve defined by -x^3 - 2*x^2*z + 3*x*z^2 + y^2*z @@ -743,10 +728,7 @@ julia> S, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]) (Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x, y, z]) julia> T, _ = grade(S) -(Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [1] - z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) julia> C = Oscar.ProjPlaneCurve(T(y^2*z - x*(x-z)*(x+3*z))) Projective plane curve defined by -x^3 - 2*x^2*z + 3*x*z^2 + y^2*z @@ -785,10 +767,7 @@ julia> S, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]) (Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x, y, z]) julia> T, _ = grade(S) -(Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [1] - z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) julia> C = Oscar.ProjPlaneCurve(T(y^2*z - x*(x-z)*(x+3*z))) Projective plane curve defined by -x^3 - 2*x^2*z + 3*x*z^2 + y^2*z diff --git a/experimental/PlaneCurve/src/ParaPlaneCurves.jl b/experimental/PlaneCurve/src/ParaPlaneCurves.jl index 6d62819071ff..342c979e36fa 100644 --- a/experimental/PlaneCurve/src/ParaPlaneCurves.jl +++ b/experimental/PlaneCurve/src/ParaPlaneCurves.jl @@ -186,12 +186,7 @@ where R is the basering. # Examples ```jldoctest julia> R, (v, w, x, y, z) = graded_polynomial_ring(QQ, ["v", "w", "x", "y", "z"]) -(Multivariate polynomial ring in 5 variables over QQ graded by - v -> [1] - w -> [1] - x -> [1] - y -> [1] - z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[v, w, x, y, z]) +(Graded multivariate polynomial ring in 5 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[v, w, x, y, z]) julia> M = matrix(R, 2, 4, [v w x y; w x y z]) [v w x y] diff --git a/experimental/PlaneCurve/src/PlaneCurve.jl b/experimental/PlaneCurve/src/PlaneCurve.jl index 9b8fa63b9742..ad0467ee532b 100644 --- a/experimental/PlaneCurve/src/PlaneCurve.jl +++ b/experimental/PlaneCurve/src/PlaneCurve.jl @@ -148,10 +148,7 @@ julia> R, (x,y,z) = polynomial_ring(QQ, ["x", "y", "z"]) (Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x, y, z]) julia> T, _ = grade(R) -(Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [1] - z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) julia> F = T(y^3*x^6 - y^6*x^2*z) x^6*y^3 - x^2*y^6*z @@ -185,10 +182,7 @@ create the projective plane curve defined by `f`. # Examples ```jldoctest julia> R, (x,y,z) = graded_polynomial_ring(QQ, ["x", "y", "z"]) -(Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [1] - z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) julia> C = ProjPlaneCurve(z*x^2-y^3) Projective plane curve defined by x^2*z - y^3 @@ -475,8 +469,8 @@ julia> C = Oscar.AffinePlaneCurve(y^2+x-x^3) Affine plane curve defined by -x^3 + x + y^2 julia> Oscar.ring(C) -(Quotient of Multivariate polynomial ring in 2 variables over QQ by ideal(-x^3 + x + y^2), Map from -Multivariate polynomial ring in 2 variables over QQ to Quotient of Multivariate polynomial ring in 2 variables over QQ by ideal(-x^3 + x + y^2) defined by a julia-function with inverse) +(Quotient of multivariate polynomial ring by ideal with 1 generator, Map from +Multivariate polynomial ring in 2 variables over QQ to Quotient of multivariate polynomial ring by ideal with 1 generator defined by a julia-function with inverse) ``` """ function ring(C::PlaneCurve) diff --git a/experimental/PlaneCurve/src/ProjCurve.jl b/experimental/PlaneCurve/src/ProjCurve.jl index f288a9b08bfb..ee58d9a94f62 100644 --- a/experimental/PlaneCurve/src/ProjCurve.jl +++ b/experimental/PlaneCurve/src/ProjCurve.jl @@ -82,11 +82,7 @@ julia> S, (x, y, z, t) = polynomial_ring(QQ, ["x", "y", "z", "t"]) (Multivariate polynomial ring in 4 variables over QQ, QQMPolyRingElem[x, y, z, t]) julia> T, _ = grade(S) -(Multivariate polynomial ring in 4 variables over QQ graded by - x -> [1] - y -> [1] - z -> [1] - t -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z, t]) +(Graded multivariate polynomial ring in 4 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z, t]) julia> I = ideal(T, [x^2, y^2*z, z^2]) ideal(x^2, y^2*z, z^2) @@ -142,11 +138,7 @@ julia> S, (x, y, z, t) = polynomial_ring(QQ, ["x", "y", "z", "t"]) (Multivariate polynomial ring in 4 variables over QQ, QQMPolyRingElem[x, y, z, t]) julia> T, _ = grade(S) -(Multivariate polynomial ring in 4 variables over QQ graded by - x -> [1] - y -> [1] - z -> [1] - t -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z, t]) +(Graded multivariate polynomial ring in 4 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z, t]) julia> I = ideal(T, [x^2, y^2*z, z^2]) ideal(x^2, y^2*z, z^2) @@ -176,11 +168,7 @@ julia> S, (x, y, z, t) = polynomial_ring(QQ, ["x", "y", "z", "t"]) (Multivariate polynomial ring in 4 variables over QQ, QQMPolyRingElem[x, y, z, t]) julia> T, _ = grade(S) -(Multivariate polynomial ring in 4 variables over QQ graded by - x -> [1] - y -> [1] - z -> [1] - t -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z, t]) +(Graded multivariate polynomial ring in 4 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z, t]) julia> I = ideal(T, [x^2, y^2*z, z^2]) ideal(x^2, y^2*z, z^2) @@ -210,11 +198,7 @@ julia> S, (x, y, z, t) = polynomial_ring(QQ, ["x", "y", "z", "t"]) (Multivariate polynomial ring in 4 variables over QQ, QQMPolyRingElem[x, y, z, t]) julia> T, _ = grade(S) -(Multivariate polynomial ring in 4 variables over QQ graded by - x -> [1] - y -> [1] - z -> [1] - t -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z, t]) +(Graded multivariate polynomial ring in 4 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z, t]) julia> I = ideal(T, [x^2, y^2*z, z^2]) ideal(x^2, y^2*z, z^2) diff --git a/experimental/PlaneCurve/src/ProjEllipticCurve.jl b/experimental/PlaneCurve/src/ProjEllipticCurve.jl index a80f859e9ecf..f984d46f922d 100644 --- a/experimental/PlaneCurve/src/ProjEllipticCurve.jl +++ b/experimental/PlaneCurve/src/ProjEllipticCurve.jl @@ -152,10 +152,7 @@ julia> S, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]) (Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x, y, z]) julia> T, _ = grade(S) -(Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [1] - z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) julia> F = T(-x^3 - 3*x^2*y - 3*x*y^2 - x*z^2 - y^3 + y^2*z - y*z^2 - 4*z^3) -x^3 - 3*x^2*y - 3*x*y^2 - x*z^2 - y^3 + y^2*z - y*z^2 - 4*z^3 @@ -271,10 +268,7 @@ julia> S, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]) (Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x, y, z]) julia> T, _ = grade(S) -(Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [1] - z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) julia> F = T(-x^3 - 3*x^2*y - 3*x*y^2 - x*z^2 - y^3 + y^2*z - y*z^2 - 4*z^3) -x^3 - 3*x^2*y - 3*x*y^2 - x*z^2 - y^3 + y^2*z - y*z^2 - 4*z^3 @@ -354,10 +348,7 @@ julia> S, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]) (Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x, y, z]) julia> T, _ = grade(S) -(Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [1] - z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) julia> E = Oscar.ProjEllipticCurve(T(y^2*z - x^3 + 2*x*z^2)) Projective elliptic curve defined by -x^3 + 2*x*z^2 + y^2*z @@ -568,10 +559,7 @@ julia> S, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]) (Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x, y, z]) julia> T, _ = grade(S) -(Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [1] - z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) julia> PP = proj_space(QQ, 2) (Projective space of dim 2 over Rational field diff --git a/experimental/PlaneCurve/src/ProjPlaneCurve.jl b/experimental/PlaneCurve/src/ProjPlaneCurve.jl index 43f10c24f4a4..5dad2e0cdf5d 100644 --- a/experimental/PlaneCurve/src/ProjPlaneCurve.jl +++ b/experimental/PlaneCurve/src/ProjPlaneCurve.jl @@ -32,10 +32,7 @@ julia> S, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]) (Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x, y, z]) julia> T, _ = grade(S) -(Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [1] - z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) julia> C = Oscar.ProjPlaneCurve(x^2*(x+y)*(y^3-x^2*z)) Projective plane curve defined by -x^5*z - x^4*y*z + x^3*y^3 + x^2*y^4 @@ -77,10 +74,7 @@ julia> S, (x, y, z) = polynomial_ring(QQ, ["x", "y","z"]) (Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x, y, z]) julia> T, _ = grade(S) -(Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [1] - z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) julia> PP = proj_space(QQ, 2) (Projective space of dim 2 over Rational field @@ -158,10 +152,7 @@ julia> S, (x, y, z) = polynomial_ring(QQ, ["x", "y","z"]) (Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x, y, z]) julia> T, _ = grade(S) -(Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [1] - z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) julia> PP = proj_space(QQ, 2) (Projective space of dim 2 over Rational field @@ -464,10 +455,7 @@ julia> S, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]) (Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x, y, z]) julia> T, _ = grade(S) -(Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [1] - z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) julia> C = Oscar.ProjPlaneCurve(T(y^2 * z - x^3 - x * z^2)) Projective plane curve defined by -x^3 - x*z^2 + y^2*z diff --git a/experimental/Schemes/BlowupMorphism.jl b/experimental/Schemes/BlowupMorphism.jl index d6d7a1373d5f..a3bb1c8eaf42 100644 --- a/experimental/Schemes/BlowupMorphism.jl +++ b/experimental/Schemes/BlowupMorphism.jl @@ -404,11 +404,11 @@ Spec of Multivariate polynomial ring in 3 variables over QQ ===================================== Affine charts of the blown up scheme: -Spec of Localization of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(0, 0, 0) at the multiplicative set powers of QQMPolyRingElem[1] +Spec of Localization of quotient of multivariate polynomial ring at products of 1 element -Spec of Localization of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(0, 0, 0) at the multiplicative set powers of QQMPolyRingElem[1] +Spec of Localization of quotient of multivariate polynomial ring at products of 1 element -Spec of Localization of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(0, 0, 0) at the multiplicative set powers of QQMPolyRingElem[1] +Spec of Localization of quotient of multivariate polynomial ring at products of 1 element ===================================== Data of center: @@ -422,13 +422,13 @@ Exceptional divisor: Effective Cartier Divisor on Covered Scheme with 3 Charts: Chart 1: - ideal in Localization of Quotient of Multivariate polynomial ring in 5 variables over QQ by ideal(-(s1//s0)*z + (s2//s0)*y, (s2//s0)*x - z, (s1//s0)*x - y) at the multiplicative set powers of QQMPolyRingElem[1] generated by [x] + ideal(x) Chart 2: - ideal in Localization of Quotient of Multivariate polynomial ring in 5 variables over QQ by ideal((s2//s1)*y - z, -(s0//s1)*z + (s2//s1)*x, -(s0//s1)*y + x) at the multiplicative set powers of QQMPolyRingElem[1] generated by [y] + ideal(y) Chart 3: - ideal in Localization of Quotient of Multivariate polynomial ring in 5 variables over QQ by ideal(-(s1//s2)*z + y, -(s0//s2)*z + x, -(s0//s2)*y + (s1//s2)*x) at the multiplicative set powers of QQMPolyRingElem[1] generated by [z] + ideal(z) ``` """ diff --git a/experimental/ToricSchemes/src/NormalToricSchemes/Attributes.jl b/experimental/ToricSchemes/src/NormalToricSchemes/Attributes.jl index 51399c664a80..2b825b511370 100644 --- a/experimental/ToricSchemes/src/NormalToricSchemes/Attributes.jl +++ b/experimental/ToricSchemes/src/NormalToricSchemes/Attributes.jl @@ -22,7 +22,7 @@ julia> affine_toric_scheme = ToricSpec(antv) Spec of an affine toric variety with cone spanned by RayVector{QQFieldElem}[[1, 0], [0, 1]] julia> underlying_scheme(affine_toric_scheme) -Spec of Quotient of Multivariate polynomial ring in 2 variables over QQ by ideal(0) +Spec of Quotient of multivariate polynomial ring by ideal with 1 generator ``` """ @attr underlying_scheme(X::ToricSpec) = Spec(base_ring(toric_ideal(X)), toric_ideal(X)) diff --git a/src/AlgebraicGeometry/Schemes/AffineSchemes/Morphisms/Attributes.jl b/src/AlgebraicGeometry/Schemes/AffineSchemes/Morphisms/Attributes.jl index e52c67b95c68..d4c672460528 100644 --- a/src/AlgebraicGeometry/Schemes/AffineSchemes/Morphisms/Attributes.jl +++ b/src/AlgebraicGeometry/Schemes/AffineSchemes/Morphisms/Attributes.jl @@ -35,12 +35,12 @@ julia> (x1,x2,x3) = gens(R) x3 julia> X = subscheme(Y, x1) -Spec of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x1) +Spec of Quotient of multivariate polynomial ring by ideal with 1 generator julia> f = inclusion_morphism(X, Y); julia> domain(f) -Spec of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x1) +Spec of Quotient of multivariate polynomial ring by ideal with 1 generator ``` """ domain(f::AbsSpecMor) = domain(underlying_morphism(f)) @@ -69,7 +69,7 @@ julia> (x1,x2,x3) = gens(R) x3 julia> X = subscheme(Y, x1) -Spec of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x1) +Spec of Quotient of multivariate polynomial ring by ideal with 1 generator julia> f = inclusion_morphism(X, Y); @@ -106,7 +106,7 @@ julia> (x1,x2,x3) = gens(R) x3 julia> X = subscheme(Y, x1) -Spec of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x1) +Spec of Quotient of multivariate polynomial ring by ideal with 1 generator julia> pullback(inclusion_morphism(X, Y)) Map with following data @@ -115,7 +115,7 @@ Domain: Multivariate polynomial ring in 3 variables over QQ Codomain: ========= -Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x1) +Quotient of multivariate polynomial ring by ideal with 1 generator ``` """ pullback(f::AbsSpecMor) = pullback(underlying_morphism(f)) @@ -213,7 +213,7 @@ julia> (x1,x2,x3) = gens(R) x3 julia> X = subscheme(Y, x1) -Spec of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x1) +Spec of Quotient of multivariate polynomial ring by ideal with 1 generator julia> f = inclusion_morphism(X, Y); diff --git a/src/AlgebraicGeometry/Schemes/AffineSchemes/Morphisms/Constructors.jl b/src/AlgebraicGeometry/Schemes/AffineSchemes/Morphisms/Constructors.jl index 11a51f31be40..2e283b92938c 100644 --- a/src/AlgebraicGeometry/Schemes/AffineSchemes/Morphisms/Constructors.jl +++ b/src/AlgebraicGeometry/Schemes/AffineSchemes/Morphisms/Constructors.jl @@ -107,7 +107,7 @@ julia> (x1,x2,x3) = gens(R) x3 julia> Y = subscheme(X, x1) -Spec of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x1) +Spec of Quotient of multivariate polynomial ring by ideal with 1 generator julia> f = inclusion_morphism(Y, X); @@ -144,7 +144,7 @@ julia> (x1,x2,x3) = gens(R) x3 julia> Y = subscheme(X, x1) -Spec of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x1) +Spec of Quotient of multivariate polynomial ring by ideal with 1 generator julia> m1 = inclusion_morphism(Y, X); @@ -184,7 +184,7 @@ julia> (x1,x2,x3) = gens(R) x3 julia> Y = subscheme(X, x1) -Spec of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x1) +Spec of Quotient of multivariate polynomial ring by ideal with 1 generator julia> restrict(identity_map(X), Y, Y) == identity_map(Y) true diff --git a/src/AlgebraicGeometry/Schemes/AffineSchemes/Morphisms/Properties.jl b/src/AlgebraicGeometry/Schemes/AffineSchemes/Morphisms/Properties.jl index 8b8c96e88b3d..ae5f13cbf73a 100644 --- a/src/AlgebraicGeometry/Schemes/AffineSchemes/Morphisms/Properties.jl +++ b/src/AlgebraicGeometry/Schemes/AffineSchemes/Morphisms/Properties.jl @@ -48,7 +48,7 @@ julia> (x1,x2,x3) = gens(R) x3 julia> Y = subscheme(X, x1) -Spec of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x1) +Spec of Quotient of multivariate polynomial ring by ideal with 1 generator julia> is_identity_map(inclusion_morphism(Y, X)) false diff --git a/src/AlgebraicGeometry/Schemes/AffineSchemes/Objects/Attributes.jl b/src/AlgebraicGeometry/Schemes/AffineSchemes/Objects/Attributes.jl index 074bab6eccf7..051a51da7657 100644 --- a/src/AlgebraicGeometry/Schemes/AffineSchemes/Objects/Attributes.jl +++ b/src/AlgebraicGeometry/Schemes/AffineSchemes/Objects/Attributes.jl @@ -69,19 +69,19 @@ true julia> (x, y) = coordinates(X); julia> Y = subscheme(X, [x]) -Spec of Quotient of Multivariate polynomial ring in 2 variables over QQ by ideal(x) +Spec of Quotient of multivariate polynomial ring by ideal with 1 generator julia> X == ambient_space(Y) true julia> Z = subscheme(Y, y) -Spec of Quotient of Multivariate polynomial ring in 2 variables over QQ by ideal(x, y) +Spec of Quotient of multivariate polynomial ring by ideal with 2 generators julia> ambient_space(Z) == X true julia> V = hypersurface_complement(Y, y) -Spec of Localization of Quotient of Multivariate polynomial ring in 2 variables over QQ by ideal(x) at the multiplicative set powers of QQMPolyRingElem[y] +Spec of Localization of quotient of multivariate polynomial ring at products of 1 element julia> ambient_space(V) == X true @@ -107,7 +107,7 @@ ideal(x) julia> RmodI, quotient_map = quo(P, I); julia> Y = Spec(RmodI) -Spec of Quotient of Multivariate polynomial ring in 2 variables over QQ by ideal(x) +Spec of Quotient of multivariate polynomial ring by ideal with 1 generator julia> ambient_space(Y) == X true @@ -117,18 +117,20 @@ julia> J = ideal(RmodI, y); julia> RmodJ, quotient_map2 = quo(RmodI, J); julia> Z = Spec(RmodJ) -Spec of Quotient of Multivariate polynomial ring in 2 variables over QQ by ideal(x, y) +Spec of Quotient of multivariate polynomial ring by ideal with 2 generators julia> ambient_space(Z) == X true julia> U = powers_of_element(y) -powers of QQMPolyRingElem[y] +Multiplicative subset + of multivariate polynomial ring in 2 variables over QQ + given by the products of [y] julia> URmodI, _ = localization(RmodI, U); julia> V = Spec(URmodI) -Spec of Localization of Quotient of Multivariate polynomial ring in 2 variables over QQ by ideal(x) at the multiplicative set powers of QQMPolyRingElem[y] +Spec of Localization of quotient of multivariate polynomial ring at products of 1 element julia> ambient_space(V) == X true @@ -212,7 +214,7 @@ Affine space of dimension 2 julia> (x,y) = coordinates(X); julia> Y = subscheme(X, [x]) -Spec of Quotient of Multivariate polynomial ring in 2 variables over QQ by ideal(x) +Spec of Quotient of multivariate polynomial ring by ideal with 1 generator julia> ambient_coordinate_ring(Y) Multivariate polynomial ring in 2 variables x, y @@ -240,7 +242,7 @@ Affine space of dimension 2 julia> (x,y) = coordinates(X); julia> Y = subscheme(X, [x]) -Spec of Quotient of Multivariate polynomial ring in 2 variables over QQ by ideal(x) +Spec of Quotient of multivariate polynomial ring by ideal with 1 generator julia> coordinates(X) == ambient_coordinates(Y) true @@ -273,7 +275,7 @@ julia> (x, y) = coordinates(X) y julia> Y = subscheme(X, [x]) -Spec of Quotient of Multivariate polynomial ring in 2 variables over QQ by ideal(x) +Spec of Quotient of multivariate polynomial ring by ideal with 1 generator julia> (xY, yY) = coordinates(Y) 2-element Vector{MPolyQuoRingElem{QQMPolyRingElem}}: @@ -382,7 +384,7 @@ julia> (x1,x2,x3) = gens(R) x3 julia> Y = subscheme(X, x1) -Spec of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x1) +Spec of Quotient of multivariate polynomial ring by ideal with 1 generator julia> codim(Y) 1 @@ -449,35 +451,37 @@ julia> J = ideal(R,[(x-y)^2]) ideal(x^2 - 2*x*y + y^2) julia> X = Spec(R,J) -Spec of Quotient of Multivariate polynomial ring in 2 variables over QQ by ideal(x^2 - 2*x*y + y^2) +Spec of Quotient of multivariate polynomial ring by ideal with 1 generator julia> U = MPolyComplementOfKPointIdeal(R,[0,0]) -complement of maximal ideal corresponding to point with coordinates QQFieldElem[0, 0] +Complement + of maximal ideal corresponding to rational point with coordinates (0, 0) + in multivariate polynomial ring in 2 variables over QQ julia> Y = Spec(R,J,U) -Spec of Localization of Quotient of Multivariate polynomial ring in 2 variables over QQ by ideal(x^2 - 2*x*y + y^2) at the multiplicative set complement of maximal ideal corresponding to point with coordinates QQFieldElem[0, 0] +Spec of Localization of quotient of multivariate polynomial ring at complement of maximal ideal julia> reduced_scheme(X) -(Spec of Quotient of Multivariate polynomial ring in 2 variables over QQ by ideal(x^2 - 2*x*y + y^2, x - y), morphism from +(Spec of Quotient of multivariate polynomial ring by ideal with 2 generators, morphism from - Spec of Quotient of Multivariate polynomial ring in 2 variables over QQ by ideal(x^2 - 2*x*y + y^2, x - y) + Spec of Quotient of multivariate polynomial ring by ideal with 2 generators to - Spec of Quotient of Multivariate polynomial ring in 2 variables over QQ by ideal(x^2 - 2*x*y + y^2) + Spec of Quotient of multivariate polynomial ring by ideal with 1 generator with coordinates y, y) julia> reduced_scheme(Y) -(Spec of Localization of Quotient of Multivariate polynomial ring in 2 variables over QQ by ideal(x^2 - 2*x*y + y^2, x - y) at the multiplicative set complement of maximal ideal corresponding to point with coordinates QQFieldElem[0, 0], morphism from +(Spec of Localization of quotient of multivariate polynomial ring at complement of maximal ideal, morphism from - Spec of Localization of Quotient of Multivariate polynomial ring in 2 variables over QQ by ideal(x^2 - 2*x*y + y^2, x - y) at the multiplicative set complement of maximal ideal corresponding to point with coordinates QQFieldElem[0, 0] + Spec of Localization of quotient of multivariate polynomial ring at complement of maximal ideal to - Spec of Localization of Quotient of Multivariate polynomial ring in 2 variables over QQ by ideal(x^2 - 2*x*y + y^2) at the multiplicative set complement of maximal ideal corresponding to point with coordinates QQFieldElem[0, 0] + Spec of Localization of quotient of multivariate polynomial ring at complement of maximal ideal with coordinates @@ -544,12 +548,12 @@ julia> A3 = Spec(R) Spec of Multivariate polynomial ring in 3 variables over QQ julia> X = Spec(R,I) -Spec of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x^2 - y^2 + z^2) +Spec of Quotient of multivariate polynomial ring by ideal with 1 generator julia> singular_locus(A3) -(Spec of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(1), morphism from +(Spec of Quotient of multivariate polynomial ring by ideal with 1 generator, morphism from - Spec of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(1) + Spec of Quotient of multivariate polynomial ring by ideal with 1 generator to @@ -560,32 +564,34 @@ with coordinates 0, 0, 0) julia> singular_locus(X) -(Spec of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x^2 - y^2 + z^2, z, y, x), morphism from +(Spec of Quotient of multivariate polynomial ring by ideal with 4 generators, morphism from - Spec of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x^2 - y^2 + z^2, z, y, x) + Spec of Quotient of multivariate polynomial ring by ideal with 4 generators to - Spec of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x^2 - y^2 + z^2) + Spec of Quotient of multivariate polynomial ring by ideal with 1 generator with coordinates 0, 0, 0) julia> U = MPolyComplementOfKPointIdeal(R,[0,0,0]) -complement of maximal ideal corresponding to point with coordinates QQFieldElem[0, 0, 0] +Complement + of maximal ideal corresponding to rational point with coordinates (0, 0, 0) + in multivariate polynomial ring in 3 variables over QQ julia> Y = Spec(R,I,U) -Spec of Localization of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x^2 - y^2 + z^2) at the multiplicative set complement of maximal ideal corresponding to point with coordinates QQFieldElem[0, 0, 0] +Spec of Localization of quotient of multivariate polynomial ring at complement of maximal ideal julia> singular_locus(Y) -(Spec of Localization of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x^2 - y^2 + z^2, z, y, x) at the multiplicative set complement of maximal ideal corresponding to point with coordinates QQFieldElem[0, 0, 0], morphism from +(Spec of Localization of quotient of multivariate polynomial ring at complement of maximal ideal, morphism from - Spec of Localization of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x^2 - y^2 + z^2, z, y, x) at the multiplicative set complement of maximal ideal corresponding to point with coordinates QQFieldElem[0, 0, 0] + Spec of Localization of quotient of multivariate polynomial ring at complement of maximal ideal to - Spec of Localization of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x^2 - y^2 + z^2) at the multiplicative set complement of maximal ideal corresponding to point with coordinates QQFieldElem[0, 0, 0] + Spec of Localization of quotient of multivariate polynomial ring at complement of maximal ideal with coordinates @@ -641,29 +647,29 @@ julia> I = ideal(R, [(x^2 - y^2 + z^2)^2]) ideal(x^4 - 2*x^2*y^2 + 2*x^2*z^2 + y^4 - 2*y^2*z^2 + z^4) julia> X = Spec(R,I) -Spec of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x^4 - 2*x^2*y^2 + 2*x^2*z^2 + y^4 - 2*y^2*z^2 + z^4) +Spec of Quotient of multivariate polynomial ring by ideal with 1 generator julia> singular_locus_reduced(X) -(Spec of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(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 from +(Spec of Quotient of multivariate polynomial ring by ideal with 4 generators, morphism from - Spec of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x^4 - 2*x^2*y^2 + 2*x^2*z^2 + y^4 - 2*y^2*z^2 + z^4, z, y, x) + Spec of Quotient of multivariate polynomial ring by ideal with 4 generators to - Spec of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x^4 - 2*x^2*y^2 + 2*x^2*z^2 + y^4 - 2*y^2*z^2 + z^4) + Spec of Quotient of multivariate polynomial ring by ideal with 1 generator with coordinates 0, 0, 0) julia> singular_locus(X) -(Spec of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(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 from +(Spec of Quotient of multivariate polynomial ring by ideal with 2 generators, morphism from - Spec of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(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) + Spec of Quotient of multivariate polynomial ring by ideal with 2 generators to - Spec of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x^4 - 2*x^2*y^2 + 2*x^2*z^2 + y^4 - 2*y^2*z^2 + z^4) + Spec of Quotient of multivariate polynomial ring by ideal with 1 generator with coordinates @@ -781,7 +787,7 @@ julia> (x1,x2,x3) = gens(R) x3 julia> Y = subscheme(X, ideal(R, [x1*x2])) -Spec of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x1*x2) +Spec of Quotient of multivariate polynomial ring by ideal with 1 generator julia> I = Oscar.ambient_closure_ideal(Y) ideal(x1*x2) diff --git a/src/AlgebraicGeometry/Schemes/AffineSchemes/Objects/Constructors.jl b/src/AlgebraicGeometry/Schemes/AffineSchemes/Objects/Constructors.jl index 297eb04e7515..d088aa14d0ca 100644 --- a/src/AlgebraicGeometry/Schemes/AffineSchemes/Objects/Constructors.jl +++ b/src/AlgebraicGeometry/Schemes/AffineSchemes/Objects/Constructors.jl @@ -17,7 +17,7 @@ julia> R, (x, y) = polynomial_ring(QQ, ["x", "y"]); julia> I = ideal(R, [x]); julia> Spec(R, I) -Spec of Quotient of Multivariate polynomial ring in 2 variables over QQ by ideal(x) +Spec of Quotient of multivariate polynomial ring by ideal with 1 generator ``` """ Spec(R::MPolyRing, I::MPolyIdeal) = Spec(quo(R, I)[1]) @@ -39,7 +39,7 @@ julia> I = ideal(R, [x]); julia> U = complement_of_prime_ideal(I); julia> Spec(R, U) -Spec of localization of Multivariate polynomial ring in 2 variables over QQ at the complement of ideal(x) +Spec of Localization of multivariate polynomial ring in 2 variables over QQ at complement of prime ideal ``` """ Spec(R::MPolyRing, U::AbsMPolyMultSet) = Spec(Localization(R, U)[1]) @@ -62,7 +62,7 @@ julia> I = ideal(R, [x]); julia> U = complement_of_prime_ideal(ideal(R, [y])); julia> Spec(R, I, U) -Spec of Localization of Quotient of Multivariate polynomial ring in 2 variables over QQ by ideal(x) at the multiplicative set complement of ideal(y) +Spec of Localization of quotient of multivariate polynomial ring at complement of prime ideal ``` """ Spec(R::MPolyRing, I::MPolyIdeal, U::AbsMPolyMultSet) = Spec(MPolyQuoLocRing(R, I, U)) @@ -88,10 +88,10 @@ julia> R, (x, y) = polynomial_ring(QQ, ["x", "y"]); julia> I = ideal(R, [x]); julia> X = Spec(R, I) -Spec of Quotient of Multivariate polynomial ring in 2 variables over QQ by ideal(x) +Spec of Quotient of multivariate polynomial ring by ideal with 1 generator julia> Y = Spec(X) -Spec of Quotient of Multivariate polynomial ring in 2 variables over QQ by ideal(x) +Spec of Quotient of multivariate polynomial ring by ideal with 1 generator ``` """ Spec(X::Spec) = Spec(OO(X)) @@ -174,7 +174,7 @@ transform to a `Spec` of an `MPolyQuoLocRing`. # Examples ```jldoctest julia> standard_spec(affine_space(QQ,5)) -Spec of Localization of Quotient of Multivariate polynomial ring in 5 variables over QQ by ideal(0) at the multiplicative set powers of QQMPolyRingElem[1] +Spec of Localization of quotient of multivariate polynomial ring at products of 1 element ``` """ function standard_spec(X::AbsSpec) @@ -291,10 +291,10 @@ julia> (x1,x2,x3) = gens(R) x3 julia> subscheme(X,x1) -Spec of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x1) +Spec of Quotient of multivariate polynomial ring by ideal with 1 generator julia> subscheme(X,[x1,x2]) -Spec of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x1, x2) +Spec of Quotient of multivariate polynomial ring by ideal with 2 generators ``` """ subscheme(X::AbsSpec, f::Vector{<:RingElem}) = subscheme(X, ideal(OO(X), f)) @@ -329,7 +329,7 @@ julia> (x1,x2,x3) = gens(R) x3 julia> subscheme(X,ideal(R,[x1*x2])) -Spec of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x1*x2) +Spec of Quotient of multivariate polynomial ring by ideal with 1 generator ``` """ function subscheme(X::AbsSpec, I::Ideal) @@ -370,7 +370,7 @@ julia> (x1, x2, x3) = gens(R) x3 julia> hypersurface_complement(X, x1) -Spec of localization of Multivariate polynomial ring in 3 variables over QQ at the powers of QQMPolyRingElem[x1] +Spec of Localization of multivariate polynomial ring in 3 variables over QQ at products of 1 element ``` """ function hypersurface_complement(X::AbsSpec, f::RingElem) @@ -441,7 +441,7 @@ julia> (x1,x2,x3) = gens(R) x3 julia> hypersurface_complement(X,[x1,x2]) -Spec of localization of Multivariate polynomial ring in 3 variables over QQ at the powers of QQMPolyRingElem[x1, x2] +Spec of Localization of multivariate polynomial ring in 3 variables over QQ at products of 2 elements ``` """ function hypersurface_complement(X::AbsSpec, f::Vector{<:RingElem}) @@ -529,13 +529,13 @@ julia> (x1,x2,x3) = gens(R) x3 julia> Y1 = subscheme(X,[x1]) -Spec of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x1) +Spec of Quotient of multivariate polynomial ring by ideal with 1 generator julia> Y2 = subscheme(X,[x2]) -Spec of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x2) +Spec of Quotient of multivariate polynomial ring by ideal with 1 generator julia> intersect(Y1, Y2) -Spec of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x1, x2) +Spec of Quotient of multivariate polynomial ring by ideal with 2 generators ``` """ function Base.intersect(X::AbsSpec{BRT, <:Ring}, Y::AbsSpec{BRT, <:Ring}) where {BRT<:Ring} @@ -700,10 +700,10 @@ julia> (x1,x2,x3) = gens(R) x3 julia> H = subscheme(X,ideal(R,[x1])) -Spec of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x1) +Spec of Quotient of multivariate polynomial ring by ideal with 1 generator julia> closure(H, X) -Spec of Localization of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x1) at the multiplicative set powers of QQMPolyRingElem[1] +Spec of Localization of quotient of multivariate polynomial ring at products of 1 element ``` """ function closure(X::AbsSpec, Y::AbsSpec) diff --git a/src/AlgebraicGeometry/Schemes/AffineSchemes/Objects/Properties.jl b/src/AlgebraicGeometry/Schemes/AffineSchemes/Objects/Properties.jl index 53bc554b270f..575539c31abb 100644 --- a/src/AlgebraicGeometry/Schemes/AffineSchemes/Objects/Properties.jl +++ b/src/AlgebraicGeometry/Schemes/AffineSchemes/Objects/Properties.jl @@ -61,7 +61,7 @@ julia> (x1,x2,x3) = gens(R) x3 julia> Y = subscheme(X,ideal(R,[x1*x2])) -Spec of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x1*x2) +Spec of Quotient of multivariate polynomial ring by ideal with 1 generator julia> is_subset(X, Y) false @@ -312,13 +312,13 @@ julia> (x1,x2,x3) = gens(R) x3 julia> Y = subscheme(X,ideal(R,[x1*x2])) -Spec of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x1*x2) +Spec of Quotient of multivariate polynomial ring by ideal with 1 generator julia> is_open_embedding(Y, X) false julia> Z = hypersurface_complement(X, x1) -Spec of localization of Multivariate polynomial ring in 3 variables over QQ at the powers of QQMPolyRingElem[x1] +Spec of Localization of multivariate polynomial ring in 3 variables over QQ at products of 1 element julia> is_open_embedding(Z, X) true @@ -380,13 +380,13 @@ julia> (x1,x2,x3) = gens(R) x3 julia> Y = subscheme(X,ideal(R,[x1*x2])) -Spec of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x1*x2) +Spec of Quotient of multivariate polynomial ring by ideal with 1 generator julia> is_closed_embedding(Y, X) true julia> Z = hypersurface_complement(X, x1) -Spec of localization of Multivariate polynomial ring in 3 variables over QQ at the powers of QQMPolyRingElem[x1] +Spec of Localization of multivariate polynomial ring in 3 variables over QQ at products of 1 element julia> is_closed_embedding(Z, X) false @@ -527,10 +527,10 @@ julia> J = ideal(R,[x-1,y-2]) ideal(x - 1, y - 2) julia> X = Spec(R,I) -Spec of Quotient of Multivariate polynomial ring in 2 variables over QQ by ideal(x - y) +Spec of Quotient of multivariate polynomial ring by ideal with 1 generator julia> Y = Spec(R,I*J) -Spec of Quotient of Multivariate polynomial ring in 2 variables over QQ by ideal(x^2 - x*y - x + y, x*y - 2*x - y^2 + 2*y) +Spec of Quotient of multivariate polynomial ring by ideal with 2 generators julia> is_equidimensional(X) true @@ -619,22 +619,24 @@ julia> J = ideal(R,[x^2-y^2]) ideal(x^2 - y^2) julia> X = Spec(R, I) -Spec of Quotient of Multivariate polynomial ring in 2 variables over QQ by ideal(x - y^2) +Spec of Quotient of multivariate polynomial ring by ideal with 1 generator julia> is_smooth(X) true julia> Y = Spec(R, J) -Spec of Quotient of Multivariate polynomial ring in 2 variables over QQ by ideal(x^2 - y^2) +Spec of Quotient of multivariate polynomial ring by ideal with 1 generator julia> is_smooth(Y) false julia> U = MPolyComplementOfKPointIdeal(R,[1,1]) -complement of maximal ideal corresponding to point with coordinates QQFieldElem[1, 1] +Complement + of maximal ideal corresponding to rational point with coordinates (1, 1) + in multivariate polynomial ring in 2 variables over QQ julia> Z = Spec(R, J, U) -Spec of Localization of Quotient of Multivariate polynomial ring in 2 variables over QQ by ideal(x^2 - y^2) at the multiplicative set complement of maximal ideal corresponding to point with coordinates QQFieldElem[1, 1] +Spec of Localization of quotient of multivariate polynomial ring at complement of maximal ideal julia> is_smooth(Z) true diff --git a/src/AlgebraicGeometry/Schemes/CoveredSchemes/Objects/Attributes.jl b/src/AlgebraicGeometry/Schemes/CoveredSchemes/Objects/Attributes.jl index 721a5e066216..9f48ba880493 100644 --- a/src/AlgebraicGeometry/Schemes/CoveredSchemes/Objects/Attributes.jl +++ b/src/AlgebraicGeometry/Schemes/CoveredSchemes/Objects/Attributes.jl @@ -88,9 +88,9 @@ covered scheme with 3 affine patches in its default covering julia> affine_charts(Xcov) 3-element Vector{AbsSpec}: - Spec of Quotient of Multivariate polynomial ring in 2 variables over QQ by ideal((s1//s0) - (s2//s0)^2) - Spec of Quotient of Multivariate polynomial ring in 2 variables over QQ by ideal((s0//s1) - (s2//s1)^2) - Spec of Quotient of Multivariate polynomial ring in 2 variables over QQ by ideal((s0//s2)*(s1//s2) - 1) + Spec of Quotient of multivariate polynomial ring by ideal with 1 generator + Spec of Quotient of multivariate polynomial ring by ideal with 1 generator + Spec of Quotient of multivariate polynomial ring by ideal with 1 generator ``` """ diff --git a/src/AlgebraicGeometry/Schemes/Glueing/Constructors.jl b/src/AlgebraicGeometry/Schemes/Glueing/Constructors.jl index d4551673a729..27c8f588d696 100644 --- a/src/AlgebraicGeometry/Schemes/Glueing/Constructors.jl +++ b/src/AlgebraicGeometry/Schemes/Glueing/Constructors.jl @@ -25,11 +25,11 @@ julia> g = SpecMor(V2, V1, [1//u, v//u]); # and its inverse julia> G = Glueing(U1, U2, f, g) # Construct the glueing Glueing of Spec of Multivariate polynomial ring in 2 variables over QQ and Spec of Multivariate polynomial ring in 2 variables over QQ along the map morphism from - Spec of localization of Multivariate polynomial ring in 2 variables over QQ at the powers of QQMPolyRingElem[x] + Spec of Localization of multivariate polynomial ring in 2 variables over QQ at products of 1 element to - Spec of localization of Multivariate polynomial ring in 2 variables over QQ at the powers of QQMPolyRingElem[u] + Spec of Localization of multivariate polynomial ring in 2 variables over QQ at products of 1 element with coordinates diff --git a/src/AlgebraicGeometry/Schemes/ProjectiveSchemes/Objects/Attributes.jl b/src/AlgebraicGeometry/Schemes/ProjectiveSchemes/Objects/Attributes.jl index 529e944c3cb5..ff8687ff8d37 100644 --- a/src/AlgebraicGeometry/Schemes/ProjectiveSchemes/Objects/Attributes.jl +++ b/src/AlgebraicGeometry/Schemes/ProjectiveSchemes/Objects/Attributes.jl @@ -38,10 +38,9 @@ Projective scheme defined by ideal(x + y) julia> homogeneous_coordinate_ring(X) -Quotient of Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [1] - z -> [1] by ideal(x + y) +Quotient + of graded multivariate polynomial ring in 3 variables over QQ + by ideal(x + y) ``` """ @@ -93,10 +92,7 @@ homogeneous ideal ``I`` this returns ``P``. # Example ```jldoctest julia> S, _ = grade(QQ["x", "y", "z"][1]) -(Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [1] - z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) julia> I = ideal(S, S[1] + S[2]) ideal(x + y) @@ -107,10 +103,9 @@ Projective scheme defined by ideal(x + y) julia> homogeneous_coordinate_ring(X) -Quotient of Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [1] - z -> [1] by ideal(x + y) +Quotient + of graded multivariate polynomial ring in 3 variables over QQ + by ideal(x + y) julia> ambient_coordinate_ring(X) === S true @@ -216,10 +211,7 @@ julia> R, (u, v) = QQ["u", "v"]; julia> Q, _ = quo(R, ideal(R, u^2 + v^2)); julia> S, _ = grade(Q["x", "y", "z"][1]) -(Multivariate polynomial ring in 3 variables over quotient of Multivariate polynomial ring in 2 variables over QQ by ideal(u^2 + v^2) graded by - x -> [1] - y -> [1] - z -> [1], MPolyDecRingElem{MPolyQuoRingElem{QQMPolyRingElem}, AbstractAlgebra.Generic.MPoly{MPolyQuoRingElem{QQMPolyRingElem}}}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over quotient of multivariate polynomial ring, MPolyDecRingElem{MPolyQuoRingElem{QQMPolyRingElem}, AbstractAlgebra.Generic.MPoly{MPolyQuoRingElem{QQMPolyRingElem}}}[x, y, z]) julia> P = projective_scheme(S); @@ -254,21 +246,18 @@ julia> R, (u, v) = QQ["u", "v"]; julia> Q, _ = quo(R, ideal(R, u^2 + v^2)); julia> S, _ = grade(Q["x", "y", "z"][1]) -(Multivariate polynomial ring in 3 variables over quotient of Multivariate polynomial ring in 2 variables over QQ by ideal(u^2 + v^2) graded by - x -> [1] - y -> [1] - z -> [1], MPolyDecRingElem{MPolyQuoRingElem{QQMPolyRingElem}, AbstractAlgebra.Generic.MPoly{MPolyQuoRingElem{QQMPolyRingElem}}}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over quotient of multivariate polynomial ring, MPolyDecRingElem{MPolyQuoRingElem{QQMPolyRingElem}, AbstractAlgebra.Generic.MPoly{MPolyQuoRingElem{QQMPolyRingElem}}}[x, y, z]) julia> P = projective_scheme(S); julia> affine_cone(P) -(Spec of Quotient of Multivariate polynomial ring in 5 variables over QQ by ideal(u^2 + v^2), Map with following data +(Spec of Quotient of multivariate polynomial ring by ideal with 1 generator, Map with following data Domain: ======= S Codomain: ========= -Quotient of Multivariate polynomial ring in 5 variables over QQ by ideal(u^2 + v^2)) +Quotient of multivariate polynomial ring by ideal with 1 generator) ``` """ @@ -385,10 +374,7 @@ julia> R, (u, v) = QQ["u", "v"]; julia> Q, _ = quo(R, ideal(R, u^2 + v^2)); julia> S, _ = grade(Q["x", "y", "z"][1]) -(Multivariate polynomial ring in 3 variables over quotient of Multivariate polynomial ring in 2 variables over QQ by ideal(u^2 + v^2) graded by - x -> [1] - y -> [1] - z -> [1], MPolyDecRingElem{MPolyQuoRingElem{QQMPolyRingElem}, AbstractAlgebra.Generic.MPoly{MPolyQuoRingElem{QQMPolyRingElem}}}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over quotient of multivariate polynomial ring, MPolyDecRingElem{MPolyQuoRingElem{QQMPolyRingElem}, AbstractAlgebra.Generic.MPoly{MPolyQuoRingElem{QQMPolyRingElem}}}[x, y, z]) julia> P = projective_scheme(S); diff --git a/src/AlgebraicGeometry/Schemes/ProjectiveSchemes/Objects/Methods.jl b/src/AlgebraicGeometry/Schemes/ProjectiveSchemes/Objects/Methods.jl index 032b702fefa7..19159d9e4df0 100644 --- a/src/AlgebraicGeometry/Schemes/ProjectiveSchemes/Objects/Methods.jl +++ b/src/AlgebraicGeometry/Schemes/ProjectiveSchemes/Objects/Methods.jl @@ -74,7 +74,7 @@ Projective space of dimension 2 julia> X = covered_scheme(P); julia> U = first(affine_charts(X)) -Spec of Quotient of Multivariate polynomial ring in 2 variables over QQ by ideal() +Spec of Quotient of multivariate polynomial ring by ideal with 0 generators julia> phi = dehomogenization_map(P, U); @@ -186,7 +186,7 @@ julia> X = covered_scheme(P); julia> U = first(affine_charts(X)) -Spec of Localization of Quotient of Multivariate polynomial ring in 4 variables over QQ by ideal() at the multiplicative set powers of QQMPolyRingElem[1] +Spec of Localization of quotient of multivariate polynomial ring at products of 1 element julia> phi = homogenization_map(P, U); diff --git a/src/AlgebraicGeometry/ToricVarieties/AlgebraicCycles/attributes.jl b/src/AlgebraicGeometry/ToricVarieties/AlgebraicCycles/attributes.jl index 113ff5e95db2..1ec0cac49878 100644 --- a/src/AlgebraicGeometry/ToricVarieties/AlgebraicCycles/attributes.jl +++ b/src/AlgebraicGeometry/ToricVarieties/AlgebraicCycles/attributes.jl @@ -90,7 +90,9 @@ julia> sr_and_linear_relation_ideal = ideal([x1*x3, x1*x5, x2*x4, x2*x5, x3*x4, ideal(x1*x3, x1*x5, x2*x4, x2*x5, x3*x4, x1 + x2 - x5, x2 + x3 - x4 - x5) julia> R_quo = quo(R, sr_and_linear_relation_ideal)[1] -Quotient of Multivariate polynomial ring in 5 variables over QQ by ideal(x1*x3, x1*x5, x2*x4, x2*x5, x3*x4, x1 + x2 - x5, x2 + x3 - x4 - x5) +Quotient + of multivariate polynomial ring in 5 variables over QQ + by ideal(x1*x3, x1*x5, x2*x4, x2*x5, x3*x4, x1 + x2 - x5, x2 + x3 - x4 - x5) julia> polynomial(R_quo, ac) 6*x3 + x4 + 7*x5 diff --git a/src/AlgebraicGeometry/ToricVarieties/AlgebraicCycles/constructors.jl b/src/AlgebraicGeometry/ToricVarieties/AlgebraicCycles/constructors.jl index 1ae95c26e466..2a55909d1682 100644 --- a/src/AlgebraicGeometry/ToricVarieties/AlgebraicCycles/constructors.jl +++ b/src/AlgebraicGeometry/ToricVarieties/AlgebraicCycles/constructors.jl @@ -24,7 +24,9 @@ julia> P2 = projective_space(NormalToricVariety, 2) Normal, non-affine, smooth, projective, gorenstein, fano, 2-dimensional toric variety without torusfactor julia> chow_ring(P2) -Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x1 - x3, x2 - x3, x1*x2*x3) +Quotient + of multivariate polynomial ring in 3 variables over QQ + by ideal(x1 - x3, x2 - x3, x1*x2*x3) julia> (x1, x2, x3) = gens(chow_ring(P2)) 3-element Vector{MPolyQuoRingElem{QQMPolyRingElem}}: diff --git a/src/AlgebraicGeometry/ToricVarieties/AlgebraicCycles/special_attributes.jl b/src/AlgebraicGeometry/ToricVarieties/AlgebraicCycles/special_attributes.jl index 56fab5d5a1f4..9a86f292f665 100644 --- a/src/AlgebraicGeometry/ToricVarieties/AlgebraicCycles/special_attributes.jl +++ b/src/AlgebraicGeometry/ToricVarieties/AlgebraicCycles/special_attributes.jl @@ -36,13 +36,17 @@ false julia> set_coordinate_names(v, ["x_{1}", "x_{2}", "x_{3}"]) julia> chow_ring(v) -Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x_{1} - x_{3}, x_{2} - x_{3}, x_{1}*x_{2}, x_{1}*x_{3}, x_{2}*x_{3}) +Quotient + of multivariate polynomial ring in 3 variables over QQ + by ideal(x_{1} - x_{3}, x_{2} - x_{3}, x_{1}*x_{2}, x_{1}*x_{3}, x_{2}*x_{3}) julia> M = cycle_matroid(complete_graph(3)) Matroid of rank 2 on 3 elements julia> chow_ring(M) -Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(x_{1} - x_{2}, x_{1} - x_{3}, x_{1}*x_{2}, x_{1}*x_{3}, x_{2}*x_{3}) +Quotient + of multivariate polynomial ring in 3 variables over QQ + by ideal(x_{1} - x_{2}, x_{1} - x_{3}, x_{1}*x_{2}, x_{1}*x_{3}, x_{2}*x_{3}) ``` """ @attr MPolyQuoRing function chow_ring(v::AbstractNormalToricVariety) diff --git a/src/AlgebraicGeometry/ToricVarieties/CohomologyClasses/attributes.jl b/src/AlgebraicGeometry/ToricVarieties/CohomologyClasses/attributes.jl index 681e2a111502..f4df9cab2185 100644 --- a/src/AlgebraicGeometry/ToricVarieties/CohomologyClasses/attributes.jl +++ b/src/AlgebraicGeometry/ToricVarieties/CohomologyClasses/attributes.jl @@ -138,7 +138,9 @@ julia> sr_and_linear_relation_ideal = ideal([x1*x3, x1*x5, x2*x4, x2*x5, x3*x4, ideal(x1*x3, x1*x5, x2*x4, x2*x5, x3*x4, x1 + x2 - x5, x2 + x3 - x4 - x5) julia> R_quo = quo(R, sr_and_linear_relation_ideal)[1] -Quotient of Multivariate polynomial ring in 5 variables over QQ by ideal(x1*x3, x1*x5, x2*x4, x2*x5, x3*x4, x1 + x2 - x5, x2 + x3 - x4 - x5) +Quotient + of multivariate polynomial ring in 5 variables over QQ + by ideal(x1*x3, x1*x5, x2*x4, x2*x5, x3*x4, x1 + x2 - x5, x2 + x3 - x4 - x5) julia> polynomial(R_quo, cc) 6*x3 + x4 + 7*x5 diff --git a/src/AlgebraicGeometry/ToricVarieties/NormalToricVarieties/attributes.jl b/src/AlgebraicGeometry/ToricVarieties/NormalToricVarieties/attributes.jl index de3b3605ecd4..d0fc10ff990b 100644 --- a/src/AlgebraicGeometry/ToricVarieties/NormalToricVarieties/attributes.jl +++ b/src/AlgebraicGeometry/ToricVarieties/NormalToricVarieties/attributes.jl @@ -536,7 +536,9 @@ julia> p2 = projective_space(NormalToricVariety, 2); julia> set_coordinate_names_of_torus(p2, ["y1", "y2"]) julia> coordinate_ring_of_torus(p2) -Quotient of Multivariate polynomial ring in 4 variables over QQ by ideal(y1*y1_ - 1, y2*y2_ - 1) +Quotient + of multivariate polynomial ring in 4 variables over QQ + by ideal(y1*y1_ - 1, y2*y2_ - 1) ``` """ @attr MPolyQuoRing function coordinate_ring_of_torus(v::AbstractNormalToricVariety) diff --git a/src/Combinatorics/Matroids/matroid_strata_grassmannian.jl b/src/Combinatorics/Matroids/matroid_strata_grassmannian.jl index c00d1c4cf49f..a488aab449a2 100644 --- a/src/Combinatorics/Matroids/matroid_strata_grassmannian.jl +++ b/src/Combinatorics/Matroids/matroid_strata_grassmannian.jl @@ -15,7 +15,9 @@ julia> A # The coordinate matrix with entries in the polynomial ring `R`. [0 0 0 1 x[3, 2] x[3, 3] x[3, 4]] julia> W # The coordinate ring of the stratum; in general a localized quotient ring `(R/I)[S⁻¹]`. -Localization of Quotient of Multivariate polynomial ring in 9 variables over GF(2) by ideal(x[2, 3]*x[3, 4] + x[3, 3]*x[2, 4], x[1, 2]*x[3, 4] + x[3, 2]*x[1, 4], x[1, 1]*x[2, 4] + x[2, 1]*x[1, 4], x[1, 1]*x[3, 2]*x[2, 3] + x[2, 1]*x[1, 2]*x[3, 3]) at the multiplicative set powers of fpMPolyRingElem[x[3, 3]*x[1, 4], x[1, 1]*x[2, 3]*x[3, 4] + x[1, 1]*x[3, 3]*x[2, 4] + x[2, 1]*x[3, 3]*x[1, 4], x[2, 3]*x[1, 4], x[1, 2]*x[2, 3]*x[3, 4] + x[1, 2]*x[3, 3]*x[2, 4] + x[3, 2]*x[2, 3]*x[1, 4], x[3, 2]*x[2, 4], x[1, 1]*x[3, 2]*x[2, 4] + x[2, 1]*x[1, 2]*x[3, 4] + x[2, 1]*x[3, 2]*x[1, 4], x[1, 2]*x[2, 4], x[2, 4], x[1, 4], x[2, 1]*x[3, 4], x[1, 1]*x[3, 4], x[3, 4], x[3, 2]*x[2, 3], x[1, 2]*x[3, 3], x[1, 2]*x[2, 3], x[2, 3], x[1, 1]*x[2, 3], x[2, 1]*x[3, 3], x[1, 1]*x[3, 3], x[3, 3], x[1, 2], x[2, 1]*x[1, 2], x[2, 1]*x[3, 2], x[1, 1]*x[3, 2], x[3, 2], x[2, 1], x[1, 1], 1] +Localization + of quotient of multivariate polynomial ring by ideal with 4 generators + at products of 28 elements ``` """ function matroid_stratum_matrix_coordinates(M::Matroid, B::GroundsetType, F::AbstractAlgebra.Ring = ZZ) @@ -62,7 +64,9 @@ julia> X # The coordinate matrix. [0 0 0 1 1 1 1] julia> W # The coordinate ring of the stratum. -Localization of Quotient of Multivariate polynomial ring in 3 variables over GF(2) by ideal(x[2, 3] + 1, x[1, 2] + 1, x[1, 1] + 1, x[1, 1]*x[2, 3] + x[1, 2]) at the multiplicative set powers of fpMPolyRingElem[1, x[1, 1]*x[2, 3] + x[1, 1] + 1, x[2, 3], x[1, 2]*x[2, 3] + x[1, 2] + x[2, 3], x[1, 1] + x[1, 2] + 1, x[1, 2], x[1, 1], x[1, 2]*x[2, 3], x[1, 1]*x[2, 3]] +Localization + of quotient of multivariate polynomial ring by ideal with 4 generators + at products of 9 elements ``` """ function matroid_realization_space(M::Matroid, A::GroundsetType, F::AbstractAlgebra.Ring=ZZ) diff --git a/src/Combinatorics/SimplicialComplexes.jl b/src/Combinatorics/SimplicialComplexes.jl index 118621c9dec0..5ddf2346c995 100644 --- a/src/Combinatorics/SimplicialComplexes.jl +++ b/src/Combinatorics/SimplicialComplexes.jl @@ -305,8 +305,8 @@ Return the Stanley-Reisner ring of the abstract simplicial complex `K`. julia> K = SimplicialComplex([[1,2,3],[2,3,4]]); julia> stanley_reisner_ring(K) -(Quotient of Multivariate polynomial ring in 4 variables over QQ by ideal(x1*x4), Map from -Multivariate polynomial ring in 4 variables over QQ to Quotient of Multivariate polynomial ring in 4 variables over QQ by ideal(x1*x4) defined by a julia-function with inverse) +(Quotient of multivariate polynomial ring by ideal with 1 generator, Map from +Multivariate polynomial ring in 4 variables over QQ to Quotient of multivariate polynomial ring by ideal with 1 generator defined by a julia-function with inverse) ``` """ function stanley_reisner_ring(K::SimplicialComplex) @@ -325,8 +325,8 @@ Return the Stanley-Reisner ring of the abstract simplicial complex `K`, as a quo julia> R, _ = ZZ["a","b","c","d","e","f"]; julia> stanley_reisner_ring(R, real_projective_plane()) -(Quotient of Multivariate polynomial ring in 6 variables over ZZ by ideal(a*b*c, a*b*d, a*e*f, b*e*f, a*c*f, a*d*e, c*d*e, c*d*f, b*c*e, b*d*f), Map from -Multivariate polynomial ring in 6 variables over ZZ to Quotient of Multivariate polynomial ring in 6 variables over ZZ by ideal(a*b*c, a*b*d, a*e*f, b*e*f, a*c*f, a*d*e, c*d*e, c*d*f, b*c*e, b*d*f) defined by a julia-function with inverse) +(Quotient of multivariate polynomial ring by ideal with 10 generators, Map from +Multivariate polynomial ring in 6 variables over ZZ to Quotient of multivariate polynomial ring by ideal with 10 generators defined by a julia-function with inverse) ``` """ stanley_reisner_ring(R::MPolyRing, K::SimplicialComplex) = quo(R, stanley_reisner_ideal(R, K)) diff --git a/src/InvariantTheory/affine_algebra.jl b/src/InvariantTheory/affine_algebra.jl index 28d895e7ff88..b912aab565f1 100644 --- a/src/InvariantTheory/affine_algebra.jl +++ b/src/InvariantTheory/affine_algebra.jl @@ -66,24 +66,13 @@ with generators AbstractAlgebra.Generic.MatSpaceElem{nf_elem}[[0 0 1; 1 0 0; 0 1 0], [1 0 0; 0 a 0; 0 0 -a-1]] julia> affine_algebra(IR) -(Quotient of Multivariate polynomial ring in 4 variables over cyclotomic field of order 3 graded by - y1 -> [3] - y2 -> [3] - y3 -> [6] - y4 -> [9] by ideal(y1^6 - 3*y1^4*y3 - 16*y1^3*y2^3 - 4*y1^3*y4 + 3*y1^2*y3^2 + 24*y1*y2^3*y3 + 4*y1*y3*y4 + 72*y2^6 + 24*y2^3*y4 - y3^3 + 8*y4^2), Map with following data +(Quotient of multivariate polynomial ring by ideal with 1 generator, Map with following data Domain: ======= -Quotient of Multivariate polynomial ring in 4 variables over cyclotomic field of order 3 graded by - y1 -> [3] - y2 -> [3] - y3 -> [6] - y4 -> [9] by ideal(y1^6 - 3*y1^4*y3 - 16*y1^3*y2^3 - 4*y1^3*y4 + 3*y1^2*y3^2 + 24*y1*y2^3*y3 + 4*y1*y3*y4 + 72*y2^6 + 24*y2^3*y4 - y3^3 + 8*y4^2) +Quotient of multivariate polynomial ring by ideal with 1 generator Codomain: ========= -Multivariate polynomial ring in 3 variables over cyclotomic field of order 3 graded by - x[1] -> [1] - x[2] -> [1] - x[3] -> [1]) +Graded multivariate polynomial ring in 3 variables over cyclotomic field of order 3) ``` """ function affine_algebra(IR::InvRing; algo_gens::Symbol = :default, algo_rels::Symbol = :groebner_basis) diff --git a/src/Modules/ModulesGraded.jl b/src/Modules/ModulesGraded.jl index 8b23e633d6a9..352d1332fc81 100644 --- a/src/Modules/ModulesGraded.jl +++ b/src/Modules/ModulesGraded.jl @@ -24,9 +24,7 @@ The string `name` specifies how the basis vectors are printed. # Examples ```jldoctest julia> R, (x,y) = graded_polynomial_ring(QQ, ["x", "y"]) -(Multivariate polynomial ring in 2 variables over QQ graded by - x -> [1] - y -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y]) +(Graded multivariate polynomial ring in 2 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y]) julia> graded_free_module(R,3) Graded free module R^3([0]) of rank 3 over R @@ -168,12 +166,7 @@ julia> g = gens(G) julia> W = [g[1], g[1], g[2], g[2], g[2]]; julia> S, _ = grade(R, W) -(Multivariate polynomial ring in 5 variables over QQ graded by - x[1] -> [1 0] - x[2] -> [1 0] - y[1] -> [0 1] - y[2] -> [0 1] - y[3] -> [0 1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x[1], x[2], y[1], y[2], y[3]]) +(Graded multivariate polynomial ring in 5 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x[1], x[2], y[1], y[2], y[3]]) julia> F = free_module(S, 3) Free module of rank 3 over S @@ -230,10 +223,7 @@ Return the new module. # Examples ```jldoctest julia> R, (x, y, z) = graded_polynomial_ring(QQ, ["x", "y", "z"], [1 0 1; 0 1 1]) -(Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1 0] - y -> [0 1] - z -> [1 1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) julia> F = free_module(R, 2) Free module of rank 2 over R @@ -247,14 +237,10 @@ Graded free module R^1([-1 0]) + R^1([0 -1]) of rank 2 over R ```jldoctest julia> R, (x, y) = graded_polynomial_ring(QQ, ["x", "y"]) -(Multivariate polynomial ring in 2 variables over QQ graded by - x -> [1] - y -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y]) +(Graded multivariate polynomial ring in 2 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y]) julia> S, _ = quo(R, [x*y]) -(Quotient of Multivariate polynomial ring in 2 variables over QQ graded by - x -> [1] - y -> [1] by ideal(x*y), Map from +(Quotient of multivariate polynomial ring by ideal with 1 generator, Map from R to S defined by a julia-function with inverse) julia> F = free_module(S, 2) @@ -1522,9 +1508,7 @@ The string `name` specifies how the basis vectors are printed. # Examples ```jldoctest julia> R, (x,y) = grade(polynomial_ring(QQ, ["x", "y"])[1]) -(Multivariate polynomial ring in 2 variables over QQ graded by - x -> [1] - y -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y]) +(Graded multivariate polynomial ring in 2 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y]) julia> free_module_dec(R,3) Decorated free module of rank 3 over RR^3([0]) diff --git a/src/Modules/UngradedModules.jl b/src/Modules/UngradedModules.jl index 78553d3b23e7..5a72d30df850 100644 --- a/src/Modules/UngradedModules.jl +++ b/src/Modules/UngradedModules.jl @@ -50,7 +50,7 @@ julia> U = complement_of_prime_ideal(P); julia> RL, _ = Localization(R, U); julia> FRL = free_module(RL, 2, "f") -Free module of rank 2 over localization of Multivariate polynomial ring in 3 variables over QQ at the complement of ideal(x, y, z) +Free module of rank 2 over Localization of multivariate polynomial ring in 3 variables over QQ at complement of prime ideal julia> RL(x)*FRL[1] x*f[1] @@ -66,7 +66,7 @@ x*g[1] julia> RQL, _ = Localization(RQ, U); julia> FRQL = free_module(RQL, 2, "h") -Free module of rank 2 over Localization of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(2*x^2 - y^3, 2*x^2 - y^5) at the multiplicative set complement of ideal(x, y, z) +Free module of rank 2 over Localization of quotient of multivariate polynomial ring at complement of prime ideal julia> RQL(x)*FRQL[1] x*h[1] @@ -1757,7 +1757,7 @@ julia> U = complement_of_prime_ideal(P); julia> RL, _ = Localization(R, U); julia> FRL = free_module(RL, 1) -Free module of rank 1 over localization of Multivariate polynomial ring in 3 variables over QQ at the complement of ideal(x, y, z) +Free module of rank 1 over Localization of multivariate polynomial ring in 3 variables over QQ at complement of prime ideal julia> ARL = RL[x; y] [x] @@ -1803,7 +1803,7 @@ by Submodule with 3 generators julia> RQL, _ = Localization(RQ, U); julia> FRQL = free_module(RQL, 1) -Free module of rank 1 over Localization of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(2*x^2 - y^3, 2*x^2 - y^5) at the multiplicative set complement of ideal(x, y, z) +Free module of rank 1 over Localization of quotient of multivariate polynomial ring at complement of prime ideal julia> ARQL = RQL[x; y] [x] @@ -5596,10 +5596,7 @@ julia> Z = abelian_group(0) GrpAb: Z julia> Rg, (x, y, z) = grade(R, [Z[1],Z[1],Z[1]]) -(Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [1] - z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) julia> F = graded_free_module(Rg, 3); @@ -5699,10 +5696,7 @@ julia> Z = abelian_group(0) GrpAb: Z julia> Rg, (x, y, z) = grade(R, [Z[1],Z[1],Z[1]]) -(Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [1] - z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) julia> F = graded_free_module(Rg, 3); @@ -5866,10 +5860,7 @@ julia> Z = abelian_group(0) GrpAb: Z julia> Rg, (x, y, z) = grade(R, [Z[1],Z[1],Z[1]]) -(Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [1] - z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) julia> F = graded_free_module(Rg, 1); @@ -6056,10 +6047,7 @@ julia> Z = abelian_group(0) GrpAb: Z julia> Rg, (x, y, z) = grade(R, [Z[1],Z[1],Z[1]]) -(Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [1] - z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) julia> F = graded_free_module(Rg, 1); diff --git a/src/Rings/MPolyQuo.jl b/src/Rings/MPolyQuo.jl index 49d9e4a15f23..21e7dcbb26ef 100644 --- a/src/Rings/MPolyQuo.jl +++ b/src/Rings/MPolyQuo.jl @@ -36,11 +36,25 @@ function groebner_assure(r::MPolyQuoRing) return true end -function show(io::IO, Q::MPolyQuoRing) - Hecke.@show_name(io, Q) - Hecke.@show_special(io, Q) - io = IOContext(io, :compact => true) - print(io, "Quotient of $(base_ring(Q)) by $(modulus(Q))") +function Base.show(io::IO, ::MIME"text/plain", Q::MPolyQuoRing) + io = pretty(io) + println(io, "Quotient") + println(io, Indent(), "of ", Lowercase(), base_ring(Q)) + print(io, "by ", modulus(Q)) + print(io, Dedent()) +end + +function Base.show(io::IO, Q::MPolyQuoRing) + io = pretty(io) + @show_name(io, Q) + @show_special(io, Q) + if get(io, :supercompact, false) + # no nested printing + print(io, "Quotient of multivariate polynomial ring") + else + # nested printing allowed, preferably supercompact + print(io, "Quotient of multivariate polynomial ring by ideal with ", ItemQuantity(ngens(modulus(Q)), "generator")) + end end gens(Q::MPolyQuoRing) = [Q(x) for x = gens(base_ring(Q))] @@ -157,7 +171,9 @@ julia> a = ideal(Q, [x, y]) ideal(x, y) julia> base_ring(a) -Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(-x^2 + y, -x^3 + z) +Quotient + of multivariate polynomial ring in 3 variables over QQ + by ideal(-x^2 + y, -x^3 + z) ``` """ function base_ring(a::MPolyQuoIdeal) @@ -200,7 +216,7 @@ julia> R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]) (Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x, y, z]) julia> A, _ = quo(R, ideal(R, [y-x^2, z-x^3])) -(Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(-x^2 + y, -x^3 + z), Map from +(Quotient of multivariate polynomial ring by ideal with 2 generators, Map from Multivariate polynomial ring in 3 variables over QQ to A defined by a julia-function with inverse) julia> a = ideal(A, [x-y]) @@ -230,7 +246,7 @@ julia> R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]) (Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x, y, z]) julia> A, _ = quo(R, ideal(R, [y-x^2, z-x^3])) -(Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(-x^2 + y, -x^3 + z), Map from +(Quotient of multivariate polynomial ring by ideal with 2 generators, Map from Multivariate polynomial ring in 3 variables over QQ to A defined by a julia-function with inverse) julia> a = ideal(A, [x-y]) @@ -818,7 +834,9 @@ julia> R, (x, y) = polynomial_ring(QQ, ["x", "y"]); julia> A, p = quo(R, ideal(R, [x^2-y^3, x-y])); julia> A -Quotient of Multivariate polynomial ring in 2 variables over QQ by ideal(x^2 - y^3, x - y) +Quotient + of multivariate polynomial ring in 2 variables over QQ + by ideal(x^2 - y^3, x - y) julia> typeof(A) MPolyQuoRing{QQMPolyRingElem} @@ -840,10 +858,7 @@ MPolyQuoRingElem{QQMPolyRingElem} julia> S, (x, y, z) = graded_polynomial_ring(QQ, ["x", "y", "z"]); julia> B, _ = quo(S, ideal(S, [x^2*z-y^3, x-y])) -(Quotient of Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [1] - z -> [1] by ideal(x^2*z - y^3, x - y), Map from +(Quotient of multivariate polynomial ring by ideal with 2 generators, Map from S to B defined by a julia-function with inverse) julia> typeof(B) @@ -1097,10 +1112,7 @@ Given a homogeneous element `f` of a $\mathbb Z$-graded affine algebra, return t julia> R, (x, y, z) = graded_polynomial_ring(QQ, ["x", "y", "z"] ); julia> A, p = quo(R, ideal(R, [y-x, z^3-x^3])) -(Quotient of Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [1] - z -> [1] by ideal(-x + y, -x^3 + z^3), Map from +(Quotient of multivariate polynomial ring by ideal with 2 generators, Map from R to A defined by a julia-function with inverse) julia> f = p(y^2-x^2+z^4) @@ -1293,11 +1305,7 @@ Additionally, return the embedding of the component into `A`. # Examples ```jldoctest julia> R, (w, x, y, z) = graded_polynomial_ring(QQ, ["w", "x", "y", "z"]) -(Multivariate polynomial ring in 4 variables over QQ graded by - w -> [1] - x -> [1] - y -> [1] - z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[w, x, y, z]) +(Graded multivariate polynomial ring in 4 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[w, x, y, z]) julia> L = homogeneous_component(R, 2); @@ -1363,12 +1371,7 @@ julia> HC = gens(L[1]); julia> EMB = L[2] Map from -homogeneous component of Multivariate polynomial ring in 5 variables over QQ graded by - x[1] -> [1 0] - x[2] -> [1 0] - y[1] -> [0 1] - y[2] -> [0 1] - y[3] -> [0 1] of degree Element of G with components [2 1] +homogeneous component of Graded multivariate polynomial ring in 5 variables over QQ of degree Element of G with components [2 1] to S defined by a julia-function with inverse julia> for i in 1:length(HC) println(EMB(HC[i])) end diff --git a/src/Rings/localization_interface.jl b/src/Rings/localization_interface.jl index 900acba06331..21c59d22647f 100644 --- a/src/Rings/localization_interface.jl +++ b/src/Rings/localization_interface.jl @@ -42,7 +42,9 @@ julia> P = ideal(R, [x]) ideal(x) julia> U = MPolyComplementOfPrimeIdeal(P) -complement of ideal(x) +Complement + of prime ideal(x) + in multivariate polynomial ring in 3 variables over QQ julia> x+1 in U true @@ -97,7 +99,9 @@ julia> P = ideal(R, [x]) ideal(x) julia> U = MPolyComplementOfPrimeIdeal(P) -complement of ideal(x) +Complement + of prime ideal(x) + in multivariate polynomial ring in 3 variables over QQ julia> Rloc, _ = Localization(U); @@ -123,7 +127,9 @@ julia> P = ideal(R, [x]) ideal(x) julia> U = MPolyComplementOfPrimeIdeal(P) -complement of ideal(x) +Complement + of prime ideal(x) + in multivariate polynomial ring in 3 variables over QQ julia> Rloc, _ = Localization(U); @@ -155,12 +161,16 @@ julia> P = ideal(R, [x]) ideal(x) julia> U = MPolyComplementOfPrimeIdeal(P) -complement of ideal(x) +Complement + of prime ideal(x) + in multivariate polynomial ring in 3 variables over QQ julia> Rloc, iota = Localization(R, U); julia> Rloc -localization of Multivariate polynomial ring in 3 variables over QQ at the complement of ideal(x) +Localization + of multivariate polynomial ring in 3 variables over QQ + at complement of prime ideal(x) julia> iota Map with following data @@ -169,7 +179,7 @@ Domain: Multivariate polynomial ring in 3 variables over QQ Codomain: ========= -localization of Multivariate polynomial ring in 3 variables over QQ at the complement of ideal(x) +Localization of multivariate polynomial ring in 3 variables over QQ at complement of prime ideal ``` """ function Localization(S::AbsMultSet) @@ -383,11 +393,24 @@ canonical_unit(f::LocRingElemType) where {LocRingElemType<:AbsLocalizedRingElem} characteristic(W::AbsLocalizedRing) = characteristic(base_ring(W)) -function Base.show(io::IO, W::AbsLocalizedRing) - print(io, "localization of ") - print(io, base_ring(W)) - print(io, " at the ") - print(io, inverted_set(W)) +function Base.show(io::IO, ::MIME"text/plain", W::AbsLocalizedRing) + io = pretty(io) + println(io, "Localization", Indent()) + println(io, "of ", Lowercase(), base_ring(W)) + print(io, "at ") + print(io, Lowercase(), inverted_set(W)) + print(io, Dedent()) +end + +function Base.show(io::IO, W::AbsLocalizedRing) + io = pretty(io) + if get(io, :supercompact, false) + print(io, "Localized ring") + else + print(io, "Localization of ", Lowercase(), base_ring(W)) + print(io, " at ") + print(pretty(IOContext(io, :supercompact =>true)), Lowercase(), inverted_set(W)) + end end function zero!(a::AbsLocalizedRingElem) diff --git a/src/Rings/mpoly-affine-algebras.jl b/src/Rings/mpoly-affine-algebras.jl index bd01e0d1fa3f..8f1f4bd089a4 100644 --- a/src/Rings/mpoly-affine-algebras.jl +++ b/src/Rings/mpoly-affine-algebras.jl @@ -344,10 +344,7 @@ Return the Hilbert series of the positively graded affine algebra `A`. julia> W = [1 1 1; 0 0 -1]; julia> R, x = graded_polynomial_ring(QQ, ["x[1]", "x[2]", "x[3]"], W) -(Multivariate polynomial ring in 3 variables over QQ graded by - x[1] -> [1 0] - x[2] -> [1 0] - x[3] -> [1 -1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x[1], x[2], x[3]]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x[1], x[2], x[3]]) julia> I = ideal(R, [x[1]^3*x[2], x[2]*x[3]^2, x[2]^2*x[3], x[3]^4]); @@ -531,10 +528,7 @@ Return the reduced Hilbert series of the positively graded affine algebra `A`. julia> W = [1 1 1; 0 0 -1]; julia> R, x = graded_polynomial_ring(QQ, ["x[1]", "x[2]", "x[3]"], W) -(Multivariate polynomial ring in 3 variables over QQ graded by - x[1] -> [1 0] - x[2] -> [1 0] - x[3] -> [1 -1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x[1], x[2], x[3]]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x[1], x[2], x[3]]) julia> I = ideal(R, [x[1]^3*x[2], x[2]*x[3]^2, x[2]^2*x[3], x[3]^4]); @@ -643,10 +637,7 @@ of $A$, and return the value $H(A, g)$ as above. julia> W = [1 1 1; 0 0 -1]; julia> R, x = graded_polynomial_ring(QQ, ["x[1]", "x[2]", "x[3]"], W) -(Multivariate polynomial ring in 3 variables over QQ graded by - x[1] -> [1 0] - x[2] -> [1 0] - x[3] -> [1 -1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x[1], x[2], x[3]]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x[1], x[2], x[3]]) julia> I = ideal(R, [x[1]^3*x[2], x[2]*x[3]^2, x[2]^2*x[3], x[3]^4]); @@ -1117,7 +1108,9 @@ julia> size(LL) (3,) julia> LL[1][1] -Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(-T(1)*y + x, -T(1)*x + y^2, T(1)^2 - y, -x^2 + y^3) +Quotient + of multivariate polynomial ring in 3 variables over QQ + by ideal(-T(1)*y + x, -T(1)*x + y^2, T(1)^2 - y, -x^2 + y^3) julia> LL[1][2] Map with following data @@ -1126,7 +1119,7 @@ Domain: A Codomain: ========= -Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(-T(1)*y + x, -T(1)*x + y^2, T(1)^2 - y, -x^2 + y^3) +Quotient of multivariate polynomial ring by ideal with 4 generators julia> LL[1][3] (y, ideal(x, y)) diff --git a/src/Rings/mpoly-graded.jl b/src/Rings/mpoly-graded.jl index 7e1cee84362a..f346f79c67e7 100644 --- a/src/Rings/mpoly-graded.jl +++ b/src/Rings/mpoly-graded.jl @@ -30,10 +30,7 @@ If `R` is, say, `G`-graded, return `G`. # Examples ```jldoctest julia> R, (x, y, z) = graded_polynomial_ring(QQ, ["x", "y", "z"], [1, 2, 3]) -(Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [2] - z -> [3], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) julia> grading_group(R) GrpAb: Z @@ -58,42 +55,48 @@ is_filtered(::MPolyRing) = false function show(io::IO, ::MIME"text/plain", W::MPolyDecRing) Hecke.@show_name(io, W) Hecke.@show_special(io, W) + io = pretty(io) if is_filtered(W) - println(io, "$(forget_decoration(W)) filtrated by ") + print(io, forget_decoration(W)) + println(io, " filtrated by ") else - println(io, "$(forget_decoration(W)) graded by ") + print(io, "$(forget_decoration(W))") + println(io, " graded by ") end R = forget_decoration(W) g = gens(R) + print(io, Indent()) for i = 1:ngens(R) if i == ngens(R) - print(io, " $(g[i]) -> $(W.d[i].coeff)") - else - println(io, " $(g[i]) -> $(W.d[i].coeff)") - end + print(io, "$(g[i]) -> $(W.d[i].coeff)") + else + println(io, "$(g[i]) -> $(W.d[i].coeff)") + end end + print(io, Dedent()) # println(IOContext(io, :compact => true, ), W.d) end - -function show(io::IO, W::MPolyDecRing) +function Base.show(io::IO, W::MPolyDecRing) Hecke.@show_name(io, W) Hecke.@show_special(io, W) - if is_filtered(W) - println(io, "$(forget_decoration(W)) filtrated by ") + io = pretty(io) + if get(io, :supercompact, false) + # no nested printing + if is_filtered(W) + print(io, "Filtered multivariate polynomial ring") + else + print(io, "Graded multivariate polynomial ring") + end else - println(io, "$(forget_decoration(W)) graded by ") - end - R = forget_decoration(W) - g = gens(R) - for i = 1:ngens(R) - if i == ngens(R) - print(io, " $(g[i]) -> $(W.d[i].coeff)") - else - println(io, " $(g[i]) -> $(W.d[i].coeff)") - end + # nested printing allowed, preferably supercompact + R = forget_decoration(W) + if is_filtered(W) + print(io, "Filtered ", Lowercase(), R) + else + print(io, "Graded ", Lowercase(), R) + end end -# println(IOContext(io, :compact => true, ), W.d) end @@ -123,16 +126,10 @@ julia> R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]) julia> W = [1, 2, 3]; julia> S, (x, y, z) = grade(R, W) -(Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [2] - z -> [3], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) julia> T, (x, y, z) = grade(R) -(Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [1] - z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) ``` """ function grade(R::MPolyRing, W::Vector{<:IntegerUnion}) @@ -173,12 +170,7 @@ julia> W = [1 1 0 0 0; 0 0 1 1 1] 0 0 1 1 1 julia> grade(R, W) -(Multivariate polynomial ring in 5 variables over QQ graded by - x[1] -> [1 0] - x[2] -> [1 0] - y[1] -> [0 1] - y[2] -> [0 1] - y[3] -> [0 1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x[1], x[2], y[1], y[2], y[3]]) +(Graded multivariate polynomial ring in 5 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x[1], x[2], y[1], y[2], y[3]]) ``` """ function grade(R::MPolyRing, W::Vector{<:Vector{<:IntegerUnion}}) @@ -216,10 +208,7 @@ julia> R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]) julia> W = [1, 2, 3]; julia> S, (x, y, z) = grade(R, W) -(Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [2] - z -> [3], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) julia> is_standard_graded(S) false @@ -255,10 +244,7 @@ julia> R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]) julia> W = [1, 2, 3]; julia> S, (x, y, z) = grade(R, W) -(Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [2] - z -> [3], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) julia> is_z_graded(S) true @@ -294,12 +280,7 @@ julia> g = gens(G); julia> W = [g[1]+g[3]+g[4], g[2]+g[4], g[1]+g[3], g[2], g[1]+g[2]]; julia> S, x = grade(R, W) -(Multivariate polynomial ring in 5 variables over QQ graded by - x[1] -> [1 0 1 1] - x[2] -> [0 1 0 1] - x[3] -> [1 0 1 0] - x[4] -> [0 1 0 0] - x[5] -> [1 1 0 0], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x[1], x[2], x[3], x[4], x[5]]) +(Graded multivariate polynomial ring in 5 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x[1], x[2], x[3], x[4], x[5]]) julia> is_zm_graded(S) false @@ -349,10 +330,7 @@ julia> G = abelian_group([0]) GrpAb: Z julia> S, (t, x, y) = grade(R, [-1, 1, 1]) -(Multivariate polynomial ring in 3 variables over QQ graded by - t -> [-1] - x -> [1] - y -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[t, x, y]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[t, x, y]) julia> is_positively_graded(S) false @@ -370,9 +348,7 @@ julia> W = [gen(G, 1)+gen(G, 2), gen(G, 1)] Element of G with components [1 0] julia> S, (x, y) = grade(R, W) -(Multivariate polynomial ring in 2 variables over QQ graded by - x -> [1 1] - y -> [1 0], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y]) +(Graded multivariate polynomial ring in 2 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y]) julia> is_positively_graded(S) false @@ -420,23 +396,13 @@ julia> W = [[1, 0], [0, 1], [1, 0], [4, 1]] [4, 1] julia> R, x = graded_polynomial_ring(QQ, 4, :x, W) -(Multivariate polynomial ring in 4 variables over QQ graded by - x1 -> [1 0] - x2 -> [0 1] - x3 -> [1 0] - x4 -> [4 1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x1, x2, x3, x4]) +(Graded multivariate polynomial ring in 4 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x1, x2, x3, x4]) julia> S, (x, y, z) = graded_polynomial_ring(QQ, [:x, :y, :z], [1, 2, 3]) -(Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [2] - z -> [3], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) julia> T, (x, y, z) = graded_polynomial_ring(QQ, ["x", "y", "z"]) -(Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [1] - z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) ``` """ function graded_polynomial_ring(C::Ring, V::Union{Tuple{Vararg{T}}, AbstractVector{T}}, @@ -497,10 +463,7 @@ julia> g = gen(G, 1) Element of G with components [1] julia> S, (t, x, y) = grade(R, [-g, g, g]) -(Multivariate polynomial ring in 3 variables over QQ graded by - t -> [-1] - x -> [1] - y -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[t, x, y]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[t, x, y]) julia> typeof(S) MPolyDecRing{QQFieldElem, QQMPolyRing} @@ -525,12 +488,7 @@ julia> g = gens(G) julia> W = [g[1], g[1], g[2], g[2], g[2]]; julia> S, _ = grade(R, W) -(Multivariate polynomial ring in 5 variables over QQ graded by - x[1] -> [1 0] - x[2] -> [1 0] - y[1] -> [0 1] - y[2] -> [0 1] - y[3] -> [0 1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x[1], x[2], y[1], y[2], y[3]]) +(Graded multivariate polynomial ring in 5 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x[1], x[2], y[1], y[2], y[3]]) julia> typeof(x[1]) QQMPolyRingElem @@ -566,12 +524,7 @@ julia> g = gens(G) julia> W = [g[1]+g[3]+g[4], g[2]+g[4], g[1]+g[3], g[2], g[1]+g[2]]; julia> S, x = grade(R, W) -(Multivariate polynomial ring in 5 variables over QQ graded by - x[1] -> [1 0 1 1] - x[2] -> [0 1 0 1] - x[3] -> [1 0 1 0] - x[4] -> [0 1 0 0] - x[5] -> [1 1 0 0], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x[1], x[2], x[3], x[4], x[5]]) +(Graded multivariate polynomial ring in 5 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x[1], x[2], x[3], x[4], x[5]]) ``` """ function grade(R::MPolyRing, v::Vector{GrpAbFinGenElem}) @@ -874,12 +827,7 @@ julia> g = gens(G); julia> W = [g[1]+g[3]+g[4], g[2]+g[4], g[1]+g[3], g[2], g[1]+g[2]]; julia> S, x = grade(R, W) -(Multivariate polynomial ring in 5 variables over QQ graded by - x[1] -> [1 0 1 1] - x[2] -> [0 1 0 1] - x[3] -> [1 0 1 0] - x[4] -> [0 1 0 0] - x[5] -> [1 1 0 0], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x[1], x[2], x[3], x[4], x[5]]) +(Graded multivariate polynomial ring in 5 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x[1], x[2], x[3], x[4], x[5]]) julia> f = x[2]^2+2*x[4]^2 x[2]^2 + 2*x[4]^2 @@ -895,11 +843,7 @@ julia> W = [[1, 0], [0, 1], [1, 0], [4, 1]] [4, 1] julia> R, x = graded_polynomial_ring(QQ, ["x[1]", "x[2]", "x[3]", "x[4]"], W) -(Multivariate polynomial ring in 4 variables over QQ graded by - x[1] -> [1 0] - x[2] -> [0 1] - x[3] -> [1 0] - x[4] -> [4 1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x[1], x[2], x[3], x[4]]) +(Graded multivariate polynomial ring in 4 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x[1], x[2], x[3], x[4]]) julia> f = x[1]^4*x[2]+x[4] x[1]^4*x[2] + x[4] @@ -913,10 +857,7 @@ julia> degree(Vector{Int}, f) 1 julia> R, (x, y, z) = graded_polynomial_ring(QQ, ["x", "y", "z"], [1, 2, 3]) -(Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [2] - z -> [3], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) julia> f = x^6+y^3+z^2 x^6 + y^3 + z^2 @@ -976,10 +917,7 @@ Given an element `f` of a graded multivariate ring, return `true` if `f` is homo # Examples ```jldoctest julia> R, (x, y, z) = graded_polynomial_ring(QQ, ["x", "y", "z"], [1, 2, 3]) -(Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [2] - z -> [3], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) julia> f = x^2+y*z x^2 + y*z @@ -993,11 +931,7 @@ julia> W = [1 2 1 0; 3 4 0 1] 3 4 0 1 julia> S, (w, x, y, z) = graded_polynomial_ring(QQ, ["w", "x", "y", "z"], W) -(Multivariate polynomial ring in 4 variables over QQ graded by - w -> [1 3] - x -> [2 4] - y -> [1 0] - z -> [0 1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[w, x, y, z]) +(Graded multivariate polynomial ring in 4 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[w, x, y, z]) julia> F = w^3*y^3*z^3 + w^2*x*y^2*z^2 + w*x^2*y*z + x^3 w^3*y^3*z^3 + w^2*x*y^2*z^2 + w*x^2*y*z + x^3 @@ -1031,10 +965,7 @@ Given an element `f` of a graded multivariate ring, return the homogeneous compo # Examples ```jldoctest julia> R, (x, y, z) = graded_polynomial_ring(QQ, ["x", "y", "z"], [1, 2, 3]) -(Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [2] - z -> [3], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) julia> f = x^2+y+z x^2 + y + z @@ -1056,12 +987,7 @@ julia> g = gens(G); julia> W = [g[1]+g[3]+g[4], g[2]+g[4], g[1]+g[3], g[2], g[1]+g[2]]; julia> S, x = grade(R, W) -(Multivariate polynomial ring in 5 variables over QQ graded by - x[1] -> [1 0 1 1] - x[2] -> [0 1 0 1] - x[3] -> [1 0 1 0] - x[4] -> [0 1 0 0] - x[5] -> [1 1 0 0], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x[1], x[2], x[3], x[4], x[5]]) +(Graded multivariate polynomial ring in 5 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x[1], x[2], x[3], x[4], x[5]]) julia> f = x[1]^2+x[3]^2+x[5]^2 x[1]^2 + x[3]^2 + x[5]^2 @@ -1143,12 +1069,7 @@ julia> g = gens(G); julia> W = [g[1]+g[3]+g[4], g[2]+g[4], g[1]+g[3], g[2], g[1]+g[2]]; julia> S, x = grade(R, W) -(Multivariate polynomial ring in 5 variables over QQ graded by - x[1] -> [1 0 1 1] - x[2] -> [0 1 0 1] - x[3] -> [1 0 1 0] - x[4] -> [0 1 0 0] - x[5] -> [1 1 0 0], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x[1], x[2], x[3], x[4], x[5]]) +(Graded multivariate polynomial ring in 5 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x[1], x[2], x[3], x[4], x[5]]) julia> f = x[1]^2+x[3]^2+x[5]^2 x[1]^2 + x[3]^2 + x[5]^2 @@ -1164,11 +1085,7 @@ julia> W = [[1, 0], [0, 1], [1, 0], [4, 1]] [4, 1] julia> R, x = graded_polynomial_ring(QQ, ["x[1]", "x[2]", "x[3]", "x[4]"], W) -(Multivariate polynomial ring in 4 variables over QQ graded by - x[1] -> [1 0] - x[2] -> [0 1] - x[3] -> [1 0] - x[4] -> [4 1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x[1], x[2], x[3], x[4]]) +(Graded multivariate polynomial ring in 4 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x[1], x[2], x[3], x[4]]) julia> f = x[1]^2*x[2]+x[4] x[1]^2*x[2] + x[4] @@ -1177,10 +1094,7 @@ julia> homogeneous_component(f, [2, 1]) x[1]^2*x[2] julia> R, (x, y, z) = graded_polynomial_ring(QQ, ["x", "y", "z"], [1, 2, 3]) -(Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [2] - z -> [3], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) julia> f = x^2+y+z x^2 + y + z @@ -1282,12 +1196,7 @@ GrpAb: Z^2 julia> L = homogeneous_component(S, [1, 1]); julia> L[1] -homogeneous component of Multivariate polynomial ring in 5 variables over QQ graded by - x[1] -> [1 0] - x[2] -> [1 0] - y[1] -> [0 1] - y[2] -> [0 1] - y[3] -> [0 1] of degree graded by [1 1] +homogeneous component of Graded multivariate polynomial ring in 5 variables over QQ of degree graded by [1 1] julia> FG = gens(L[1]); @@ -1304,10 +1213,7 @@ x[1]*y[2] x[1]*y[1] julia> T, (x, y, z) = graded_polynomial_ring(QQ, ["x", "y", "z"]) -(Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [1] - z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) julia> G = grading_group(T) GrpAb: Z @@ -2303,10 +2209,7 @@ Return the dehomogenization of `I` in a polynomial ring as above. # Examples ```jldoctest julia> S, (x, y, z) = graded_polynomial_ring(QQ, ["x", "y", "z"]) -(Multivariate polynomial ring in 3 variables over QQ graded by - x -> [1] - y -> [1] - z -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) +(Graded multivariate polynomial ring in 3 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y, z]) julia> F = x^3-x^2*y-x*z^2 x^3 - x^2*y - x*z^2 @@ -2340,11 +2243,7 @@ julia> W = [1 2 1 0; 3 4 0 1] 3 4 0 1 julia> S, (w, x, y, z) = graded_polynomial_ring(QQ, ["w", "x", "y", "z"], W) -(Multivariate polynomial ring in 4 variables over QQ graded by - w -> [1 3] - x -> [2 4] - y -> [1 0] - z -> [0 1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[w, x, y, z]) +(Graded multivariate polynomial ring in 4 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[w, x, y, z]) julia> F = w^3*y^3*z^3 + w^2*x*y^2*z^2 + w*x^2*y*z + x^3 w^3*y^3*z^3 + w^2*x*y^2*z^2 + w*x^2*y*z + x^3 diff --git a/src/Rings/mpoly-ideals.jl b/src/Rings/mpoly-ideals.jl index b99872bbe8d7..8dd0cfe6d52e 100644 --- a/src/Rings/mpoly-ideals.jl +++ b/src/Rings/mpoly-ideals.jl @@ -21,9 +21,7 @@ julia> typeof(I) MPolyIdeal{QQMPolyRingElem} julia> S, (x, y) = graded_polynomial_ring(QQ, ["x", "y"], [1, 2]) -(Multivariate polynomial ring in 2 variables over QQ graded by - x -> [1] - y -> [2], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y]) +(Graded multivariate polynomial ring in 2 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y]) julia> J = ideal(S, [(x^2+y)^2]) ideal(x^4 + 2*x^2*y + y^2) @@ -599,9 +597,7 @@ x^2 + 1 ```jldoctest julia> R, (x, y) = graded_polynomial_ring(QQ, ["x", "y"]) -(Multivariate polynomial ring in 2 variables over QQ graded by - x -> [1] - y -> [1], MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y]) +(Graded multivariate polynomial ring in 2 variables over QQ, MPolyDecRingElem{QQFieldElem, QQMPolyRingElem}[x, y]) julia> I = ideal(R, [x^2+y^2]) ideal(x^2 + y^2) diff --git a/src/Rings/mpoly-localizations.jl b/src/Rings/mpoly-localizations.jl index 1e31702c00eb..e2e8c2343394 100644 --- a/src/Rings/mpoly-localizations.jl +++ b/src/Rings/mpoly-localizations.jl @@ -30,6 +30,19 @@ abstract type AbsMPolyMultSet{BRT, BRET, RT, RET} <: AbsMultSet{RT, RET} end } The set `S = { aᵏ : k ∈ ℕ₀ }` for some ``a ∈ R`` with ``R`` of type `BaseRingType`. + +```jldoctest +julia> R, (x, y) = polynomial_ring(QQ, ["x", "y"]); + +julia> powers_of_element(x) +Multiplicative subset + of multivariate polynomial ring in 2 variables over QQ + given by the products of [x] + +julia> (powers_of_element(x),) +(Products of 1 element,) + +``` """ mutable struct MPolyPowersOfElement{ BaseRingType, @@ -92,9 +105,24 @@ Base.iterate(U::MPolyPowersOfElement, i::Int) = (i < length(U.a) ? (U.a[i+1], i+ is_trivial(U::MPolyPowersOfElement) = (U == units_of(ambient_ring(U))) ### printing + +function Base.show(io::IO, ::MIME"text/plain", S::MPolyPowersOfElement) + io = pretty(io) + println(io, "Multiplicative subset") + print(io, Indent()) + println(io, "of ", Lowercase(), ambient_ring(S)) + print(io, "given by the products of ") + print(io, "[") + join(io, denominators(S), ", ") + print(io, "]") + print(io, Dedent()) +end + function Base.show(io::IO, S::MPolyPowersOfElement) - print(io, "powers of ") - print(io, denominators(S)) + io = pretty(io) + # no need for supercompact printing + print(io, "Products of ") + print(io, ItemQuantity(length(denominators(S)), "element")) end ### generation of random elements @@ -142,6 +170,19 @@ end The complement of a prime ideal ``P ⊂ 𝕜[x₁,…,xₙ]`` in a multivariate polynomial ring with elements of type `RingElemType` over a base ring ``𝕜`` of type `BaseRingType`. + +```jldoctest +julia> R, (x, y) = polynomial_ring(QQ, ["x", "y"]); + +julia> S = complement_of_prime_ideal(ideal([x])) +Complement + of prime ideal(x) + in multivariate polynomial ring in 2 variables over QQ + +julia> (S,) +(Complement of prime ideal(x),) + +``` """ mutable struct MPolyComplementOfPrimeIdeal{ BaseRingType, @@ -186,9 +227,21 @@ end prime_ideal(S::MPolyComplementOfPrimeIdeal) = S.P ### printing +function Base.show(io::IO, ::MIME"text/plain", S::MPolyComplementOfPrimeIdeal) + io = pretty(io) + println(io, "Complement") + println(io, Indent(), "of prime ", Lowercase(), prime_ideal(S)) + print(io, "in ", Lowercase(), ambient_ring(S)) + print(io, Dedent()) +end + function Base.show(io::IO, S::MPolyComplementOfPrimeIdeal) - print(io, "complement of ") - print(io, prime_ideal(S)) + io = pretty(io) + if get(io, :supercompact, false) + print(io, "Complement of prime ideal") + else + print(io, "Complement of prime ", prime_ideal(S)) + end end ### generation of random elements @@ -227,6 +280,19 @@ end } Complement of a maximal ideal ``𝔪 = ⟨x₁-a₁,…,xₙ-aₙ⟩⊂ 𝕜[x₁,…xₙ]`` with ``aᵢ∈ 𝕜``. + +```jldoctest +julia> R, (x, y) = polynomial_ring(QQ, ["x", "y"]); + +julia> S = complement_of_point_ideal(R,[1,2]) +Complement + of maximal ideal corresponding to rational point with coordinates (1, 2) + in multivariate polynomial ring in 2 variables over QQ + +julia> (S,) +(Complement of maximal ideal of point (1, 2),) + +``` """ mutable struct MPolyComplementOfKPointIdeal{ BaseRingType, @@ -269,7 +335,9 @@ $$m = \langle x_1-a_1,\dots, x_n-a_n\rangle \subset R.$$ julia> R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]); julia> U = complement_of_point_ideal(R, [0, 0 ,0]) -complement of maximal ideal corresponding to point with coordinates QQFieldElem[0, 0, 0] +Complement + of maximal ideal corresponding to rational point with coordinates (0, 0, 0) + in multivariate polynomial ring in 3 variables over QQ ``` """ @@ -294,7 +362,9 @@ julia> P = ideal(R, [x]) ideal(x) julia> U = complement_of_prime_ideal(P) -complement of ideal(x) +Complement + of prime ideal(x) + in multivariate polynomial ring in 3 variables over QQ ``` """ complement_of_prime_ideal(P::MPolyIdeal; check::Bool=false) = MPolyComplementOfPrimeIdeal(P; check) @@ -313,7 +383,9 @@ julia> f = x x julia> U = powers_of_element(f) -powers of QQMPolyRingElem[x] +Multiplicative subset + of multivariate polynomial ring in 3 variables over QQ + given by the products of [x] ``` """ powers_of_element(f::MPolyRingElem) = MPolyPowersOfElement(f) @@ -334,9 +406,29 @@ function Base.in( end ### printing +function Base.show(io::IO, ::MIME"text/plain", S::MPolyComplementOfKPointIdeal) + io = pretty(io) + println(io, "Complement") + print(io, Indent(), "of maximal ideal corresponding to rational point ") + print(io, Indent(), "with coordinates ") + print(io, "(") + join(io, point_coordinates(S), ", ") + println(io, ")") + print(io, Dedent()) + print(io, "in ", Lowercase(), ambient_ring(S)) + print(io, Dedent()) +end + function Base.show(io::IO, S::MPolyComplementOfKPointIdeal) - print(io, "complement of maximal ideal corresponding to point with coordinates ") - print(io, point_coordinates(S)) + io = pretty(io) + if get(io, :supercompact, false) + print(io, "Complement of maximal ideal") + else + print(io, "Complement of maximal ideal of point ") + print(io, "(") + join(io, point_coordinates(S), ", ") + print(io, ")") + end end ### generation of random elements @@ -371,6 +463,23 @@ end A finite product `T⋅U = { a⋅b : a ∈ T, b∈ U}` of arbitrary other multiplicative sets in a multivariate polynomial ring. + +```jldoctest +julia> R, (x, y) = polynomial_ring(QQ, ["x", "y"]); + +julia> S = complement_of_point_ideal(R,[1,2]); + +julia> T = powers_of_element(x); + +julia> ST = MPolyProductOfMultSets(R, [S, T]) +Product of the multiplicative sets + complement of maximal ideal of point (1, 2) + products of 1 element + +julia> (ST,) +(Product of the multiplicative subsets [complement of maximal ideal, products of 1 element],) + +``` """ mutable struct MPolyProductOfMultSets{ BaseRingType, @@ -429,11 +538,28 @@ function Base.in( end ### printing +function Base.show(io::IO, ::MIME"text/plain", S::MPolyProductOfMultSets) + io = pretty(io) + println(io, "Product of the multiplicative sets") + print(io, Indent()) + M = sets(S) + for i in 1:length(M)-1 + println(io, Lowercase(), M[i]) + end + print(io, Lowercase(), M[end]) + print(io, Dedent()) +end + function Base.show(io::IO, S::MPolyProductOfMultSets) - print(io, "product of the multiplicative sets [") - for s in sets(S) - print(io, s) - s != last(sets(S)) && print(io, ", ") + io = pretty(io) + if get(io, :supercompact, false) + println("Product of multiplicatively closed subsets") + else + print(io, "Product of the multiplicative subsets [") + for s in sets(S) + print(IOContext(io, :supercompact=>true), Lowercase(), s) + s !== last(sets(S)) && print(io, ", ") + end end print(io, "]") end @@ -510,11 +636,26 @@ function Base.in( end ### printing -function Base.show(io::IO, S::MPolyLeadingMonOne) - print(io, "elements of ") - print(io, ambient_ring(S)) - print(io, " with leading monomial 1 w.r.t. ") +function Base.show(io::IO,::MIME"text/plain", S::MPolyLeadingMonOne) + io = pretty(io) + println(io, "Elements") + print(io, Indent()) + println(io, "of ", ambient_ring(S)) + print(io, Dedent()) + println(io, "with leading monomial 1 w.r.t. ") + print(io, Indent()) print(io, ordering(S)) + print(io, Dedent()) +end + +function Base.show(io::IO, S::MPolyLeadingMonOne) + io = pretty(IOContext(io, :supercompact=>true)) + if get(io, :supercompact, false) + print(io, "Elements with leading monomial 1") + else + print(io, "Elements with leading monomial 1 w.r.t. ") + print(io, ordering(S)) + end end ######################################################################## @@ -694,16 +835,22 @@ Alternatively, write `T*U`. julia> R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]); julia> T = complement_of_point_ideal(R, [0, 0 ,0]) -complement of maximal ideal corresponding to point with coordinates QQFieldElem[0, 0, 0] +Complement + of maximal ideal corresponding to rational point with coordinates (0, 0, 0) + in multivariate polynomial ring in 3 variables over QQ julia> f = x x julia> U = powers_of_element(f) -powers of QQMPolyRingElem[x] +Multiplicative subset + of multivariate polynomial ring in 3 variables over QQ + given by the products of [x] julia> S = product(T, U) -product of the multiplicative sets [complement of maximal ideal corresponding to point with coordinates QQFieldElem[0, 0, 0], powers of QQMPolyRingElem[x]] +Product of the multiplicative sets + complement of maximal ideal of point (0, 0, 0) + products of 1 element ``` """ function product(T::AbsMPolyMultSet, U::AbsMPolyMultSet) @@ -966,12 +1113,16 @@ julia> P = ideal(R, [x]) ideal(x) julia> U = complement_of_prime_ideal(P) -complement of ideal(x) +Complement + of prime ideal(x) + in multivariate polynomial ring in 3 variables over QQ julia> Rloc, iota = localization(R, U); julia> Rloc -localization of Multivariate polynomial ring in 3 variables over QQ at the complement of ideal(x) +Localization + of multivariate polynomial ring in 3 variables over QQ + at complement of prime ideal(x) julia> iota Map with following data @@ -980,7 +1131,7 @@ Domain: Multivariate polynomial ring in 3 variables over QQ Codomain: ========= -localization of Multivariate polynomial ring in 3 variables over QQ at the complement of ideal(x) +Localization of multivariate polynomial ring in 3 variables over QQ at complement of prime ideal ``` """ localization(R::MPolyRing, U::AbsMPolyMultSet) @@ -1310,7 +1461,9 @@ julia> P = ideal(R, [x]) ideal(x) julia> U = complement_of_prime_ideal(P) -complement of ideal(x) +Complement + of prime ideal(x) + in multivariate polynomial ring in 3 variables over QQ julia> Rloc, iota = localization(U); @@ -1489,25 +1642,48 @@ julia> T = MPolyPowersOfElement(f); julia> RL,phiL = Localization(R,T); julia> I=ideal(RL,RL.([x+y+z,w-1])) -ideal in localization of Multivariate polynomial ring in 4 variables over QQ at the powers of QQMPolyRingElem[x + y + z + w - 1] generated by [x + y + z, w - 1] +Ideal + of localized ring +with 2 generators + x + y + z + w - 1 julia> is_one(I) true julia> J=ideal(RL,RL.([x^2,y])) -ideal in localization of Multivariate polynomial ring in 4 variables over QQ at the powers of QQMPolyRingElem[x + y + z + w - 1] generated by [x^2, y] +Ideal + of localized ring +with 2 generators + x^2 + y julia> K=ideal(RL,RL.([x])) -ideal in localization of Multivariate polynomial ring in 4 variables over QQ at the powers of QQMPolyRingElem[x + y + z + w - 1] generated by [x] +Ideal + of localized ring +with 1 generator + x julia> intersect(J,K) -ideal in localization of Multivariate polynomial ring in 4 variables over QQ at the powers of QQMPolyRingElem[x + y + z + w - 1] generated by [x*y, x^2] +Ideal + of localized ring +with 2 generators + x*y + x^2 julia> intersect(I,J,K) -ideal in localization of Multivariate polynomial ring in 4 variables over QQ at the powers of QQMPolyRingElem[x + y + z + w - 1] generated by [x*y, x^2] +Ideal + of localized ring +with 2 generators + x*y + x^2 julia> intersect([I,J,K]) -ideal in localization of Multivariate polynomial ring in 4 variables over QQ at the powers of QQMPolyRingElem[x + y + z + w - 1] generated by [x*y, x^2] +Ideal + of localized ring +with 2 generators + x*y + x^2 ``` """ function intersect(I::MPolyLocalizedIdeal, J::MPolyLocalizedIdeal) @@ -1603,12 +1779,17 @@ projection map `R -> RQ`. julia> R, (x,) = polynomial_ring(QQ, ["x"]); julia> U = powers_of_element(x) -powers of QQMPolyRingElem[x] +Multiplicative subset + of multivariate polynomial ring in 1 variable over QQ + given by the products of [x] julia> Rloc, iota = localization(R, U); julia> I = ideal(Rloc, [x+x^2]) -ideal in localization of Multivariate polynomial ring in 1 variable over QQ at the powers of QQMPolyRingElem[x] generated by [x^2 + x] +Ideal + of localized ring +with 1 generator + x^2 + x julia> SI = saturated_ideal(I) ideal(x + 1) @@ -1618,12 +1799,17 @@ Multivariate polynomial ring in 1 variable x over rational field julia> U = complement_of_point_ideal(R, [0]) -complement of maximal ideal corresponding to point with coordinates QQFieldElem[0] +Complement + of maximal ideal corresponding to rational point with coordinates (0) + in multivariate polynomial ring in 1 variable over QQ julia> Rloc, iota = localization(R, U); julia> I = ideal(Rloc, [x+x^2]) -ideal in localization of Multivariate polynomial ring in 1 variable over QQ at the complement of maximal ideal corresponding to point with coordinates QQFieldElem[0] generated by [x^2 + x] +Ideal + of localized ring +with 1 generator + x^2 + x julia> saturated_ideal(I) ideal(x) @@ -1933,13 +2119,20 @@ julia> I = ideal(R, [x, y^2+1]) ideal(x, y^2 + 1) julia> U = MPolyComplementOfPrimeIdeal(I) -complement of ideal(x, y^2 + 1) +Complement + of prime ideal(x, y^2 + 1) + in multivariate polynomial ring in 2 variables over QQ julia> L = MPolyLocRing(R, U) -localization of Multivariate polynomial ring in 2 variables over QQ at the complement of ideal(x, y^2 + 1) +Localization + of multivariate polynomial ring in 2 variables over QQ + at complement of prime ideal(x, y^2 + 1) julia> J = ideal(L,[y*(x^2+(y^2+1)^2)]) -ideal in localization of Multivariate polynomial ring in 2 variables over QQ at the complement of ideal(x, y^2 + 1) generated by [x^2*y + y^5 + 2*y^3 + y] +Ideal + of localized ring +with 1 generator + x^2*y + y^5 + 2*y^3 + y julia> saturated_ideal(J) ideal(x^2 + y^4 + 2*y^2 + 1) @@ -2071,19 +2264,55 @@ end Base.:(:)(I::IdealType, J::IdealType) where {IdealType<:MPolyLocalizedIdeal} = quotient(I, J) +""" +```jldoctest +julia> R, (x, y) = polynomial_ring(QQ, ["x", "y"]); + +julia> S = complement_of_point_ideal(R,[1,2]); -function Base.show(io::IO, I::MPolyLocalizedIdeal) - if ngens(I) == 0 - print(io, "zero ideal in $(base_ring(I))") - return - end - print(io, "ideal in $(base_ring(I)) generated by [") +julia> SinvR = localization(R,S)[1] +Localization + of multivariate polynomial ring in 2 variables over QQ + at complement of maximal ideal of point (1, 2) + +julia> I = ideal(SinvR, gens(SinvR)) +Ideal + of localized ring +with 2 generators + x + y + +julia> (I,) +(ideal(x, y),) + +``` +""" +function Base.show(io::IO,::MIME"text/plain", I::MPolyLocalizedIdeal) n = ngens(I) - for i in (1:n-1) - print(io, "$(gen(I, i)), ") + io = pretty(IOContext(io,:supercompact=>true)) + println(io, "Ideal") + println(io, Indent(), "of ", Lowercase(), base_ring(I)) + if n > 0 + print(io, Dedent()) + println(io, "with ", ItemQuantity(ngens(I),"generator")) + print(io, Indent()) + for i in 1:n + if i < n + println(io, gen(I, i)) + else + print(io, gen(I, i)) + end + end + else + print(io, Dedent()) + print(io, "with ", ItemQuantity(ngens(I),"generator")) end - print(io, last(gens(I))) - print(io, "]") +end + +function Base.show(io::IO, I::MPolyLocalizedIdeal) + print(io, "ideal(") + join(io, gens(I), ", ") + print(io, ")") end @attr function shifted_ideal( @@ -2428,18 +2657,81 @@ function MPolyLocalizedRingHom( end ### printing -function Base.show(io::IO, phi::MPolyLocalizedRingHom) +""" +```jldoctest +julia> R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]); + +julia> I = ideal(R, [y-x^2, z-x^3]); + +julia> RQ, p = quo(R, I); + +julia> UR = complement_of_point_ideal(R, [0, 0, 0]); + +julia> RQL, _ = localization(RQ, UR); + +julia> T, (t,) = polynomial_ring(QQ, ["t"]); + +julia> UT = complement_of_point_ideal(T, [0]); + +julia> TL, _ = localization(T, UT); + +julia> PSI = hom(TL, RQL, RQL.([x])) +Ring homomorphism + from localization of multivariate polynomial ring in 1 variable over QQ at complement of maximal ideal + to localization of quotient of multivariate polynomial ring at complement of maximal ideal +defined by + t -> x + +julia> (PSI, ) +(hom: Localized ring -> Localized quotient of multivariate polynomial ring,) + +``` +""" +function Base.show(io::IO, ::MIME"text/plain", phi::MPolyLocalizedRingHom) R = base_ring(domain(phi)) psi = restricted_map(phi) - println(io, "$(domain(phi)) → $(codomain(phi));") - for i in 1:ngens(R)-1 - println(io, " $(R[i]) ↦ $(psi(R[i])),") + io = pretty(io) + println(io, "Ring homomorphism") + print(io, Indent()) + println(io, "from ", Lowercase(), domain(phi)) + println(io, "to ", Lowercase(), codomain(phi)) + print(io, Dedent()) + println(io,"defined by") + print(io, Indent()) + if is_unicode_allowed() + for i in 1:ngens(R)-1 + println(io, "$(R[i]) ↦ $(psi(R[i]))") + end + n = ngens(R) + println(io, "$(R[n]) ↦ $(psi(R[n]))") + else + for i in 1:ngens(R)-1 + println(io, "$(R[i]) -> $(psi(R[i]))") + end + n = ngens(R) + print(io, "$(R[n]) -> $(psi(R[n]))") + end + print(io, Dedent()) +end + +function Base.show(io::IO, phi::MPolyLocalizedRingHom) + io = pretty(io) + if get(io, :supercompact, false) + println("Ring homomorphism") + else + R = base_ring(domain(phi)) + psi = restricted_map(phi) + print(IOContext(io,:supercompact=>true), "hom: ", domain(phi)) + if is_unicode_allowed() + print(io, " → ") + else + print(io, " -> ") + end + print(IOContext(io,:supercompact=>true), codomain(phi)) end - n = ngens(R) - println(io, " $(R[n]) ↦ $(psi(R[n]))") - return end + @doc raw""" hom(Rloc::MPolyLocRing, S::Ring, phi::Map) @@ -2489,9 +2781,21 @@ julia> UT = complement_of_point_ideal(T, [0]); julia> TL, _ = localization(T, UT); -julia> PHI = hom(RQL, TL, TL.([t, t^2, t^3])); - -julia> PSI = hom(TL, RQL, RQL.([x])); +julia> PHI = hom(RQL, TL, TL.([t, t^2, t^3])) +Ring homomorphism + from localization of quotient of multivariate polynomial ring at complement of maximal ideal + to localization of multivariate polynomial ring in 1 variable over QQ at complement of maximal ideal +defined by + x -> t + y -> t^2 + z -> t^3 + +julia> PSI = hom(TL, RQL, RQL.([x])) +Ring homomorphism + from localization of multivariate polynomial ring in 1 variable over QQ at complement of maximal ideal + to localization of quotient of multivariate polynomial ring at complement of maximal ideal +defined by + t -> x julia> PHI(RQL(z)) t^3 @@ -2545,7 +2849,7 @@ Domain: Multivariate polynomial ring in 3 variables over QQ Codomain: ========= -localization of Multivariate polynomial ring in 1 variable over QQ at the complement of maximal ideal corresponding to point with coordinates QQFieldElem[0] +Localization of multivariate polynomial ring in 1 variable over QQ at complement of maximal ideal julia> psi = restricted_map(PSI) Map with following data @@ -2554,7 +2858,7 @@ Domain: Multivariate polynomial ring in 1 variable over QQ Codomain: ========= -Localization of Quotient of Multivariate polynomial ring in 3 variables over QQ by ideal(-x^2 + y, -x^3 + z) at the multiplicative set complement of maximal ideal corresponding to point with coordinates QQFieldElem[0, 0, 0] +Localization of quotient of multivariate polynomial ring at complement of maximal ideal ``` """ restricted_map(PHI::MPolyLocalizedRingHom) = PHI.res @@ -2675,7 +2979,9 @@ Return `true` if `f` is contained in `U`, `false` otherwise. julia> R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]); julia> S = complement_of_point_ideal(R, [0, 0 ,0]) -complement of maximal ideal corresponding to point with coordinates QQFieldElem[0, 0, 0] +Complement + of maximal ideal corresponding to rational point with coordinates (0, 0, 0) + in multivariate polynomial ring in 3 variables over QQ julia> y in S false @@ -2684,13 +2990,17 @@ julia> P = ideal(R, [x]) ideal(x) julia> T = complement_of_prime_ideal(P) -complement of ideal(x) +Complement + of prime ideal(x) + in multivariate polynomial ring in 3 variables over QQ julia> y in T true julia> U = powers_of_element(x) -powers of QQMPolyRingElem[x] +Multiplicative subset + of multivariate polynomial ring in 3 variables over QQ + given by the products of [x] julia> x^3 in U true diff --git a/src/Rings/mpolyquo-localizations.jl b/src/Rings/mpolyquo-localizations.jl index 85dcef3d394c..c33aeb66bc79 100644 --- a/src/Rings/mpolyquo-localizations.jl +++ b/src/Rings/mpolyquo-localizations.jl @@ -211,8 +211,26 @@ gens(L::MPolyQuoLocRing) = L.(gens(base_ring(L))) gen(L::MPolyQuoLocRing, i::Int) = L(gen(base_ring(L), i)) ### printing + +function Base.show(io::IO, ::MIME"text/plain", L::MPolyQuoLocRing) + io = pretty(io) + println(io, "Localization") + print(io, Indent()) + println(io, "of ", Lowercase(), underlying_quotient(L)) + print(io, "at ", Lowercase(), inverted_set(L)) + print(io, Dedent()) +end + function Base.show(io::IO, L::MPolyQuoLocRing) - print(io, "Localization of $(underlying_quotient(L)) at the multiplicative set $(inverted_set(L))") + io = pretty(io) + if get(io, :supercompact, false) + print(io, "Localized quotient of multivariate polynomial ring") + else + io = pretty(IOContext(io, :supercompact=>true)) + print(io, "Localization of ") + print(io, Lowercase(), underlying_quotient(L)) + print(io, " at ", Lowercase(), inverted_set(L)) + end end ### additional constructors @@ -274,18 +292,22 @@ julia> P = ideal(R, [y-1, x-a]) ideal(y - 1, x - a) julia> U = complement_of_prime_ideal(P) -complement of ideal(y - 1, x - a) +Complement + of prime ideal(y - 1, x - a) + in multivariate polynomial ring in 2 variables over number field julia> RQ, _ = quo(R, I); julia> RQL, iota = localization(RQ, U); julia> RQL -Localization of Quotient of Multivariate polynomial ring in 2 variables over number field by ideal(2*x^2 - y^3, 2*x^2 - y^5) at the multiplicative set complement of ideal(y - 1, x - a) +Localization + of quotient of multivariate polynomial ring by ideal with 2 generators + at complement of prime ideal(y - 1, x - a) julia> iota Map from -RQ to Localization of Quotient of Multivariate polynomial ring in 2 variables over number field by ideal(2*x^2 - y^3, 2*x^2 - y^5) at the multiplicative set complement of ideal(y - 1, x - a) defined by a julia-function +RQ to Localization of quotient of multivariate polynomial ring at complement of prime ideal defined by a julia-function ``` """ localization(A::MPolyQuoRing, U::AbsMPolyMultSet) @@ -542,7 +564,9 @@ julia> P = ideal(R, [y-1, x-a]) ideal(y - 1, x - a) julia> U = complement_of_prime_ideal(P) -complement of ideal(y - 1, x - a) +Complement + of prime ideal(y - 1, x - a) + in multivariate polynomial ring in 2 variables over number field julia> RQ, p = quo(R, I); @@ -1056,16 +1080,50 @@ function ==(f::MPolyQuoLocalizedRingHom, g::MPolyQuoLocalizedRingHom) end ### printing +function Base.show(io::IO, ::MIME"text/plain", phi::MPolyQuoLocalizedRingHom) + R = base_ring(domain(phi)) + psi = restricted_map(phi) + io = pretty(io) + println(io, "Ring homomorphism") + print(io, Indent()) + println(io, "from ", Lowercase(), domain(phi)) + println(io, "to ", Lowercase(), codomain(phi)) + print(io, Dedent()) + println(io,"defined by") + print(io, Indent()) + if is_unicode_allowed() + for i in 1:ngens(R)-1 + println(io, "$(R[i]) ↦ $(psi(R[i]))") + end + n = ngens(R) + println(io, "$(R[n]) ↦ $(psi(R[n]))") + else + for i in 1:ngens(R)-1 + println(io, "$(R[i]) -> $(psi(R[i]))") + end + n = ngens(R) + print(io, "$(R[n]) -> $(psi(R[n]))") + end + print(io, Dedent()) +end + function Base.show(io::IO, phi::MPolyQuoLocalizedRingHom) R = base_ring(domain(phi)) psi = restricted_map(phi) - println(io, "$(domain(phi)) → $(codomain(phi));") - for i in 1:ngens(R)-1 - println(io, " $(R[i]) ↦ $(psi(R[i])),") + if get(io, :supercompact, false) + print(io, "Ring homomorphism") + else + io = IOContext(io, :supercompact=>true) + io = pretty(io) + print(io, "hom: ") + print(IOContext(io, :supercompact=>true), domain(phi)) + if is_unicode_allowed() + print(io, " → ") + else + print(io, " -> ") + end + print(IOContext(io, :supercompact=>true), codomain(phi)) end - n = ngens(R) - println(io, " $(R[n]) ↦ $(psi(R[n]))") - return end ### helper_ring @@ -1537,16 +1595,37 @@ julia> T = MPolyComplementOfKPointIdeal(R,[0,0,0,0]); julia> RQL, phiQL = Localization(RQ,T); julia> I = ideal(RQL,RQL.([x,z])) -ideal in Localization of Quotient of Multivariate polynomial ring in 4 variables over QQ by ideal(x*y - z*w) at the multiplicative set complement of maximal ideal corresponding to point with coordinates QQFieldElem[0, 0, 0, 0] generated by [x, z] +Ideal + of localized quotient of multivariate polynomial ring +with 2 generators + x + z julia> J = ideal(RQL,RQL.([y])) -ideal in Localization of Quotient of Multivariate polynomial ring in 4 variables over QQ by ideal(x*y - z*w) at the multiplicative set complement of maximal ideal corresponding to point with coordinates QQFieldElem[0, 0, 0, 0] generated by [y] +Ideal + of localized quotient of multivariate polynomial ring +with 1 generator + y julia> intersect(I,J) -ideal in Localization of Quotient of Multivariate polynomial ring in 4 variables over QQ by ideal(x*y - z*w) at the multiplicative set complement of maximal ideal corresponding to point with coordinates QQFieldElem[0, 0, 0, 0] generated by [z*w, y*z, x*y] +Ideal + of localized quotient of multivariate polynomial ring +with 3 generators + z*w + y*z + x*y + +julia> K = intersect([I,J]) +Ideal + of localized quotient of multivariate polynomial ring +with 3 generators + z*w + y*z + x*y + +julia> (I,J,K) +(ideal(x, z), ideal(y), ideal(z*w, y*z, x*y)) -julia> intersect([I,J]) -ideal in Localization of Quotient of Multivariate polynomial ring in 4 variables over QQ by ideal(x*y - z*w) at the multiplicative set complement of maximal ideal corresponding to point with coordinates QQFieldElem[0, 0, 0, 0] generated by [z*w, y*z, x*y] ``` """ function intersect(I::MPolyQuoLocalizedIdeal, J::MPolyQuoLocalizedIdeal) @@ -1634,18 +1713,27 @@ function ideal( end ### printing -function Base.show(io::IO, I::MPolyQuoLocalizedIdeal) - if ngens(I) == 0 - print(io, "zero ideal in $(base_ring(I))") - return +function Base.show(io::IO,::MIME"text/plain", I::MPolyQuoLocalizedIdeal) + n = ngens(I) + io = pretty(IOContext(io,:supercompact=>true)) + println(io, "Ideal") + println(io, Indent(), "of ", Lowercase(), base_ring(I)) + if n > 0 + print(io, Dedent()) + println(io, "with ", ItemQuantity(ngens(I),"generator")) + print(io, Indent()) + join(io, gens(I), "\n") + else + print(io, Dedent()) + print(io, "with ", ItemQuantity(ngens(I),"generator")) end - str = "ideal in $(base_ring(I)) generated by [$(first(gens(I)))" - for i in 2:ngens(I) - str = str * ", $(gen(I, i))" - end - str = str * "]" - print(io, str) - return + print(io, Dedent()) +end + +function Base.show(io::IO, I::MPolyQuoLocalizedIdeal) + print(io, "ideal(") + join(io, gens(I), ", ") + print(io, ")") end ### Further constructors for quotient rings diff --git a/src/imports.jl b/src/imports.jl index 0763205bb267..960fbe24c80f 100644 --- a/src/imports.jl +++ b/src/imports.jl @@ -59,6 +59,7 @@ import AbstractAlgebra: canonical_unit, codomain, data, + Dedent, degree, dim, domain, @@ -80,6 +81,9 @@ import AbstractAlgebra: get_attribute, get_attribute!, Ideal, + Indent, + Lowercase, + LowercaseOff, Map, map, MatElem, @@ -96,6 +100,7 @@ import AbstractAlgebra: PolyRingElem, polynomial_ring, PolyRing, + pretty, Ring, RingElem, RingElement, diff --git a/test/Rings/mpoly-localizations.jl b/test/Rings/mpoly-localizations.jl index 72a62795d5a5..ce19643c0ed4 100644 --- a/test/Rings/mpoly-localizations.jl +++ b/test/Rings/mpoly-localizations.jl @@ -395,24 +395,6 @@ end @test sprint(show, L(y)) == "y" # Denominator is one; omit printing it. end -@testset "printing of ideals and homomorphisms" begin - R, (x, y) = ZZ["x", "y"] - U = powers_of_element(y) - L, = localization(R, U) - - I = ideal(L, []) - @test sprint(show, I) == "zero ideal in $(base_ring(I))" - I = ideal(L, [x]) - @test sprint(show, I) == "ideal in $(base_ring(I)) generated by [x]" - I = ideal(L, [x, x-1]) - @test I[1] == x # test getters - @test gen(I, 2) == x-1 - @test sprint(show, I) == "ideal in $(base_ring(I)) generated by [x, x - 1]" - - phi = hom(L, L, gens(L)) - @test sprint(show, phi) == "localization of Multivariate polynomial ring in 2 variables over ZZ at the powers of ZZMPolyRingElem[y] → localization of Multivariate polynomial ring in 2 variables over ZZ at the powers of ZZMPolyRingElem[y];\n x ↦ x,\n y ↦ y\n" -end - @testset "fractions and divexact: Issue #1885" begin R, (x, y) = ZZ["x", "y"] U = powers_of_element(y) diff --git a/test/Rings/mpolyquo-localizations.jl b/test/Rings/mpolyquo-localizations.jl index 10ae8028ed7f..aee3c41055b8 100644 --- a/test/Rings/mpolyquo-localizations.jl +++ b/test/Rings/mpolyquo-localizations.jl @@ -128,26 +128,6 @@ end L, = localization(A, U) phi = hom(L, L, gens(L)) end - -@testset "printing of ideals and homomorphisms" begin - R, (x, y) = ZZ["x", "y"] - I = ideal(R, [x^2-y^2]) - U = powers_of_element(y) - A, = quo(R, I) - L, = localization(A, U) - - I = ideal(L, []) - @test sprint(show, I) == "zero ideal in $(base_ring(I))" - I = ideal(L, [x]) - @test sprint(show, I) == "ideal in $(base_ring(I)) generated by [x]" - I = ideal(L, [x, (x-1)//y]) - @test I[1] == x # test getters - @test gen(I, 2) == L((x-1)//y) - @test sprint(show, I) == "ideal in $(base_ring(I)) generated by [x, (x - 1)/y]" - - phi = hom(L, L, gens(L)) - @test sprint(show, phi) == "$(L) → $(L);\n x ↦ x,\n y ↦ y\n" -end @testset "fractions and divexact: Issue #1885" begin R, (x, y) = ZZ["x", "y"]