diff --git a/docs/src/CommutativeAlgebra/GroebnerBases/groebner_bases.md b/docs/src/CommutativeAlgebra/GroebnerBases/groebner_bases.md index c88e70bc6dbe..04facd9a68b9 100644 --- a/docs/src/CommutativeAlgebra/GroebnerBases/groebner_bases.md +++ b/docs/src/CommutativeAlgebra/GroebnerBases/groebner_bases.md @@ -65,7 +65,7 @@ julia> default_ordering(R) degrevlex([x, y, z]) julia> F = free_module(R, 2) -Free module of rank 2 over Multivariate polynomial ring in 3 variables over QQ +Free module of rank 2 over multivariate polynomial ring julia> default_ordering(F) degrevlex([x, y, z])*lex([gen(1), gen(2)]) @@ -140,7 +140,7 @@ julia> R, (x, y) = polynomial_ring(QQ, ["x", "y"]) (Multivariate polynomial ring in 2 variables over QQ, QQMPolyRingElem[x, y]) julia> F = free_module(R, 3) -Free module of rank 3 over Multivariate polynomial ring in 2 variables over QQ +Free module of rank 3 over multivariate polynomial ring julia> f = (5*x*y^2-y^10+3)*F[1]+(4*x^3+2*y) *F[2]+16*x*F[3] (5*x*y^2 - y^10 + 3)*e[1] + (4*x^3 + 2*y)*e[2] + 16*x*e[3] diff --git a/docs/src/CommutativeAlgebra/GroebnerBases/orderings.md b/docs/src/CommutativeAlgebra/GroebnerBases/orderings.md index 7fd4a9ec1619..6ebaf9325209 100644 --- a/docs/src/CommutativeAlgebra/GroebnerBases/orderings.md +++ b/docs/src/CommutativeAlgebra/GroebnerBases/orderings.md @@ -410,7 +410,7 @@ basis vectors as *lex*, and to the $i > j$ ordering as *invlex*. And, we use the julia> R, (w, x, y, z) = polynomial_ring(QQ, ["w", "x", "y", "z"]); julia> F = free_module(R, 3) -Free module of rank 3 over Multivariate polynomial ring in 4 variables over QQ +Free module of rank 3 over multivariate polynomial ring julia> o1 = degrevlex(R)*invlex(gens(F)) degrevlex([w, x, y, z])*invlex([gen(1), gen(2), gen(3)]) diff --git a/docs/src/CommutativeAlgebra/ModulesOverMultivariateRings/complexes.md b/docs/src/CommutativeAlgebra/ModulesOverMultivariateRings/complexes.md index 56edbf36b5d1..83822ec9042d 100644 --- a/docs/src/CommutativeAlgebra/ModulesOverMultivariateRings/complexes.md +++ b/docs/src/CommutativeAlgebra/ModulesOverMultivariateRings/complexes.md @@ -52,25 +52,21 @@ julia> range(C) 5:-1:3 julia> C[5] -Subquotient of Submodule with 1 generator +Subquotient of submodule with 1 generator 1 -> e[1] -by Submodule with 1 generator +by submodule with 1 generator 1 -> x^4*e[1] julia> delta = map(C, 5) -Map with following data -Domain: -======= -Subquotient of Submodule with 1 generator -1 -> e[1] -by Submodule with 1 generator -1 -> x^4*e[1] -Codomain: -========= -Subquotient of Submodule with 1 generator -1 -> e[1] -by Submodule with 1 generator -1 -> x^3*e[1] +Module homomorphism + from subquotient of submodule with 1 generator + 1 -> e[1] + by submodule with 1 generator + 1 -> x^4*e[1] + to subquotient of submodule with 1 generator + 1 -> e[1] + by submodule with 1 generator + 1 -> x^3*e[1] julia> matrix(delta) [x^2] diff --git a/docs/src/CommutativeAlgebra/ModulesOverMultivariateRings/free_modules.md b/docs/src/CommutativeAlgebra/ModulesOverMultivariateRings/free_modules.md index 6c6496c223fd..ab59e789edb1 100644 --- a/docs/src/CommutativeAlgebra/ModulesOverMultivariateRings/free_modules.md +++ b/docs/src/CommutativeAlgebra/ModulesOverMultivariateRings/free_modules.md @@ -148,7 +148,7 @@ julia> f = x*F[1] + y*F[3] x*e[1] + y*e[3] julia> parent(f) -Free module of rank 3 over Multivariate polynomial ring in 2 variables over QQ +Free module of rank 3 over multivariate polynomial ring julia> coordinates(f) Sparse row with positions [1, 3] and values QQMPolyRingElem[x, y] diff --git a/docs/src/CommutativeAlgebra/ModulesOverMultivariateRings/subquotients.md b/docs/src/CommutativeAlgebra/ModulesOverMultivariateRings/subquotients.md index 70790c1a9042..6bf0e31e0790 100644 --- a/docs/src/CommutativeAlgebra/ModulesOverMultivariateRings/subquotients.md +++ b/docs/src/CommutativeAlgebra/ModulesOverMultivariateRings/subquotients.md @@ -86,7 +86,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> F = free_module(R, 1) -Free module of rank 1 over Multivariate polynomial ring in 3 variables over QQ +Free module of rank 1 over multivariate polynomial ring julia> A = R[x; y] [x] @@ -98,10 +98,10 @@ julia> B = R[x^2; y^3; z^4] [z^4] julia> M = SubquoModule(F, A, B) -Subquotient of Submodule with 2 generators +Subquotient of submodule with 2 generators 1 -> x*e[1] 2 -> y*e[1] -by Submodule with 3 generators +by submodule with 3 generators 1 -> x^2*e[1] 2 -> y^3*e[1] 3 -> z^4*e[1] @@ -136,9 +136,9 @@ julia> relations(M) z^4*e[1] julia> ambient_module(M) -Subquotient of Submodule with 1 generator +Subquotient of submodule with 1 generator 1 -> e[1] -by Submodule with 3 generators +by submodule with 3 generators 1 -> x^2*e[1] 2 -> y^3*e[1] 3 -> z^4*e[1] @@ -181,7 +181,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> F = free_module(R, 1) -Free module of rank 1 over Multivariate polynomial ring in 3 variables over QQ +Free module of rank 1 over multivariate polynomial ring julia> A = R[x; y] [x] @@ -193,10 +193,10 @@ julia> B = R[x^2; y^3; z^4] [z^4] julia> M = SubquoModule(F, A, B) -Subquotient of Submodule with 2 generators +Subquotient of submodule with 2 generators 1 -> x*e[1] 2 -> y*e[1] -by Submodule with 3 generators +by submodule with 3 generators 1 -> x^2*e[1] 2 -> y^3*e[1] 3 -> z^4*e[1] @@ -237,7 +237,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> F = free_module(R, 1) -Free module of rank 1 over Multivariate polynomial ring in 3 variables over QQ +Free module of rank 1 over multivariate polynomial ring julia> A = R[x; y] [x] @@ -249,10 +249,10 @@ julia> B = R[x^2; y^3; z^4] [z^4] julia> M = SubquoModule(F, A, B) -Subquotient of Submodule with 2 generators +Subquotient of submodule with 2 generators 1 -> x*e[1] 2 -> y*e[1] -by Submodule with 3 generators +by submodule with 3 generators 1 -> x^2*e[1] 2 -> y^3*e[1] 3 -> z^4*e[1] @@ -261,10 +261,10 @@ julia> m = z*M[1] + M[2] (x*z + y)*e[1] julia> parent(m) -Subquotient of Submodule with 2 generators +Subquotient of submodule with 2 generators 1 -> x*e[1] 2 -> y*e[1] -by Submodule with 3 generators +by submodule with 3 generators 1 -> x^2*e[1] 2 -> y^3*e[1] 3 -> z^4*e[1] @@ -285,7 +285,7 @@ julia> parent(fm) === ambient_free_module(M) true julia> F = ambient_free_module(M) -Free module of rank 1 over Multivariate polynomial ring in 3 variables over QQ +Free module of rank 1 over multivariate polynomial ring julia> f = x*F[1] x*e[1] diff --git a/experimental/Schemes/CoherentSheaves.jl b/experimental/Schemes/CoherentSheaves.jl index 715fcb4b19fb..ba23b9b8ac79 100644 --- a/experimental/Schemes/CoherentSheaves.jl +++ b/experimental/Schemes/CoherentSheaves.jl @@ -722,10 +722,10 @@ Coherent sheaf of modules 3: [(s0//s2), (s1//s2), (s3//s2)] affine 3-space 4: [(s0//s3), (s1//s3), (s2//s3)] affine 3-space with restrictions - 1: free module of rank 1 over Multivariate polynomial ring in 3 variables over QQ - 2: free module of rank 1 over Multivariate polynomial ring in 3 variables over QQ - 3: free module of rank 1 over Multivariate polynomial ring in 3 variables over QQ - 4: free module of rank 1 over Multivariate polynomial ring in 3 variables over QQ + 1: free module of rank 1 over multivariate polynomial ring + 2: free module of rank 1 over multivariate polynomial ring + 3: free module of rank 1 over multivariate polynomial ring + 4: free module of rank 1 over multivariate polynomial ring ``` """ function twisting_sheaf(IP::AbsProjectiveScheme{<:Field}, d::Int) @@ -783,10 +783,10 @@ Coherent sheaf of modules 3: [(s0//s2), (s1//s2), (s3//s2)] affine 3-space 4: [(s0//s3), (s1//s3), (s2//s3)] affine 3-space with restrictions - 1: free module of rank 1 over Multivariate polynomial ring in 3 variables over QQ - 2: free module of rank 1 over Multivariate polynomial ring in 3 variables over QQ - 3: free module of rank 1 over Multivariate polynomial ring in 3 variables over QQ - 4: free module of rank 1 over Multivariate polynomial ring in 3 variables over QQ + 1: free module of rank 1 over multivariate polynomial ring + 2: free module of rank 1 over multivariate polynomial ring + 3: free module of rank 1 over multivariate polynomial ring + 4: free module of rank 1 over multivariate polynomial ring ``` """ function tautological_bundle(IP::AbsProjectiveScheme{<:Field}) diff --git a/src/Modules/FreeModules-graded.jl b/src/Modules/FreeModules-graded.jl index 864b8ce6ddf4..c07f1395243a 100644 --- a/src/Modules/FreeModules-graded.jl +++ b/src/Modules/FreeModules-graded.jl @@ -76,8 +76,9 @@ function show(io::IO, F::FreeModule_dec) @show_name(io, F) @show_special(io, F) + io_compact = IOContext(io, :compact => true, :supercompact => true) print(io, "Free module of rank $(length(F.d)) over ") - print(IOContext(io, :compact =>true), F.R) + print(io_compact, F.R) if is_graded(F.R) print(io, ", graded as ") else @@ -92,7 +93,7 @@ function show(io::IO, F::FreeModule_dec) else first = false end - print(IOContext(io, :compact => true), F.R, "^$v(", k, ")") + print(io_compact, F.R, "^$v(", k, ")") end #= @@ -103,8 +104,8 @@ function show(io::IO, F::FreeModule_dec) while i+j <= dim(F) && d == F.d[i+j] j += 1 end - print(IOContext(io, :compact => true), F.R, "^$j") - print(IOContext(io, :compact => true), "(", -d, ")") + print(io_compact, F.R, "^$j") + print(io_compact, "(", -d, ")") if i+j < dim(F) print(io, " + ") end diff --git a/src/Modules/ModuleTypes.jl b/src/Modules/ModuleTypes.jl index 02decdce8796..3431e085039c 100644 --- a/src/Modules/ModuleTypes.jl +++ b/src/Modules/ModuleTypes.jl @@ -103,7 +103,7 @@ julia> R, (x, y) = polynomial_ring(QQ, ["x", "y"]) (Multivariate polynomial ring in 2 variables over QQ, QQMPolyRingElem[x, y]) julia> F = free_module(R, 3) -Free module of rank 3 over Multivariate polynomial ring in 2 variables over QQ +Free module of rank 3 over multivariate polynomial ring julia> f = F(sparse_row(R, [(1,x),(3,y)])) x*e[1] + y*e[3] @@ -272,10 +272,10 @@ julia> B = R[x^2; x*y; y^2; z^4] [z^4] julia> M = SubquoModule(A, B) -Subquotient of Submodule with 2 generators +Subquotient of submodule with 2 generators 1 -> x*e[1] 2 -> y*e[1] -by Submodule with 4 generators +by submodule with 4 generators 1 -> x^2*e[1] 2 -> x*y*e[1] 3 -> y^2*e[1] diff --git a/src/Modules/ModulesGraded.jl b/src/Modules/ModulesGraded.jl index f40a173310d1..8577725b59dc 100644 --- a/src/Modules/ModulesGraded.jl +++ b/src/Modules/ModulesGraded.jl @@ -649,11 +649,13 @@ julia> V = [y*G[1], x*G[1]+y*G[2], z*G[2]] z*e[2] julia> a = hom(F, G, V) -F -> G -e[1] -> y*e[1] -e[2] -> x*e[1] + y*e[2] -e[3] -> z*e[2] Graded module homomorphism of degree [1] + from graded free module R^3([0]) of rank 3 over R + to graded free module R^2([0]) of rank 2 over R +defined by + e[1] -> y*e[1] + e[2] -> x*e[1] + y*e[2] + e[3] -> z*e[2] julia> degree(a) [1] @@ -712,11 +714,13 @@ julia> V = [y*G[1], x*G[1]+y*G[2], z*G[2]] z*e[2] julia> a = hom(F, G, V) -F -> G -e[1] -> y*e[1] -e[2] -> x*e[1] + y*e[2] -e[3] -> z*e[2] Graded module homomorphism of degree [1] + from graded free module R^3([0]) of rank 3 over R + to graded free module R^2([0]) of rank 2 over R +defined by + e[1] -> y*e[1] + e[2] -> x*e[1] + y*e[2] + e[3] -> z*e[2] julia> is_graded(a) true @@ -748,11 +752,13 @@ julia> V = [y*G[1], x*G[1]+y*G[2], z*G[2]] z*e[2] julia> a = hom(F, G, V) -F -> G -e[1] -> y*e[1] -e[2] -> x*e[1] + y*e[2] -e[3] -> z*e[2] Graded module homomorphism of degree [1] + from graded free module R^3([0]) of rank 3 over R + to graded free module R^2([0]) of rank 2 over R +defined by + e[1] -> y*e[1] + e[2] -> x*e[1] + y*e[2] + e[3] -> z*e[2] julia> is_graded(a) true @@ -790,11 +796,13 @@ julia> V = [y*G[1], x*G[1]+y*G[2], z*G[2]] z*e[2] julia> a = hom(F, G, V) -F -> G -e[1] -> y*e[1] -e[2] -> x*e[1] + y*e[2] -e[3] -> z*e[2] Graded module homomorphism of degree [1] + from graded free module R^3([0]) of rank 3 over R + to graded free module R^2([0]) of rank 2 over R +defined by + e[1] -> y*e[1] + e[2] -> x*e[1] + y*e[2] + e[3] -> z*e[2] julia> is_homogeneous(a) false @@ -1101,10 +1109,24 @@ julia> N = M; julia> V = [y^2*N[1], x^2*N[2]]; julia> a = hom(M, N, V) -M -> M -x*e[1] -> x*y^2*e[1] -y*e[1] -> x^2*y*e[1] Graded module homomorphism of degree [2] + from graded subquotient of submodule of F generated by + 1 -> x*e[1] + 2 -> y*e[1] + by submodule of F generated by + 1 -> x^2*e[1] + 2 -> y^3*e[1] + 3 -> z^4*e[1] + to graded subquotient of submodule of F generated by + 1 -> x*e[1] + 2 -> y*e[1] + by submodule of F generated by + 1 -> x^2*e[1] + 2 -> y^3*e[1] + 3 -> z^4*e[1] +defined by + x*e[1] -> x*y^2*e[1] + y*e[1] -> x^2*y*e[1] julia> degree(a) [2] @@ -1168,10 +1190,24 @@ julia> N = M; julia> V = [y^2*N[1], x^2*N[2]]; julia> a = hom(M, N, V) -M -> M -x*e[1] -> x*y^2*e[1] -y*e[1] -> x^2*y*e[1] Graded module homomorphism of degree [2] + from graded subquotient of submodule of F generated by + 1 -> x*e[1] + 2 -> y*e[1] + by submodule of F generated by + 1 -> x^2*e[1] + 2 -> y^3*e[1] + 3 -> z^4*e[1] + to graded subquotient of submodule of F generated by + 1 -> x*e[1] + 2 -> y*e[1] + by submodule of F generated by + 1 -> x^2*e[1] + 2 -> y^3*e[1] + 3 -> z^4*e[1] +defined by + x*e[1] -> x*y^2*e[1] + y*e[1] -> x^2*y*e[1] julia> is_graded(a) true @@ -1203,10 +1239,24 @@ julia> N = M; julia> V = [y^2*N[1], x^2*N[2]]; julia> a = hom(M, N, V) -M -> M -x*e[1] -> x*y^2*e[1] -y*e[1] -> x^2*y*e[1] Graded module homomorphism of degree [2] + from graded subquotient of submodule of F generated by + 1 -> x*e[1] + 2 -> y*e[1] + by submodule of F generated by + 1 -> x^2*e[1] + 2 -> y^3*e[1] + 3 -> z^4*e[1] + to graded subquotient of submodule of F generated by + 1 -> x*e[1] + 2 -> y*e[1] + by submodule of F generated by + 1 -> x^2*e[1] + 2 -> y^3*e[1] + 3 -> z^4*e[1] +defined by + x*e[1] -> x*y^2*e[1] + y*e[1] -> x^2*y*e[1] julia> grading_group(a) GrpAb: Z @@ -1241,10 +1291,24 @@ julia> N = M; julia> V = [y^2*N[1], x^2*N[2]]; julia> a = hom(M, N, V) -M -> M -x*e[1] -> x*y^2*e[1] -y*e[1] -> x^2*y*e[1] Graded module homomorphism of degree [2] + from graded subquotient of submodule of F generated by + 1 -> x*e[1] + 2 -> y*e[1] + by submodule of F generated by + 1 -> x^2*e[1] + 2 -> y^3*e[1] + 3 -> z^4*e[1] + to graded subquotient of submodule of F generated by + 1 -> x*e[1] + 2 -> y*e[1] + by submodule of F generated by + 1 -> x^2*e[1] + 2 -> y^3*e[1] + 3 -> z^4*e[1] +defined by + x*e[1] -> x*y^2*e[1] + y*e[1] -> x^2*y*e[1] julia> is_homogeneous(a) false @@ -1953,8 +2017,9 @@ function show(io::IO, F::FreeMod_dec) @show_name(io, F) @show_special(io, F) + io_compact = IOContext(io, :compact => true, :supercompact => true) print(io, "Decorated free module of rank $(rank(F)) over ") - print(IOContext(io, :compact =>true), base_ring(F)) + print(io_compact, base_ring(F)) i = 1 while i < dim(F) @@ -1963,8 +2028,8 @@ function show(io::IO, F::FreeMod_dec) while i+j <= dim(F) && d == F.d[i+j] j += 1 end - print(IOContext(io, :compact => true), base_ring(F), "^$j") - print(IOContext(io, :compact => true), "(", -d, ")") + print(io_compact, base_ring(F), "^$j") + print(io_compact, "(", -d, ")") if i+j < dim(F) print(io, " + ") end @@ -2697,9 +2762,9 @@ Ideal generated by y^3 julia> quotient_ring_as_module(I) -Subquotient of Submodule with 1 generator +Subquotient of submodule with 1 generator 1 -> e[1] -by Submodule with 2 generators +by submodule with 2 generators 1 -> x^2*e[1] 2 -> y^3*e[1] ``` @@ -2751,7 +2816,7 @@ julia> ideal_as_module(I) Submodule with 2 generators 1 -> x^2*e[1] 2 -> y^3*e[1] -represented as subquotient with no relations. +represented as subquotient with no relations ``` ```jldoctest julia> S, (x, y) = graded_polynomial_ring(QQ, ["x", "y"]); diff --git a/src/Modules/UngradedModules/FreeMod.jl b/src/Modules/UngradedModules/FreeMod.jl index eaf843d31646..4120676c8eab 100644 --- a/src/Modules/UngradedModules/FreeMod.jl +++ b/src/Modules/UngradedModules/FreeMod.jl @@ -37,7 +37,7 @@ The string `name` specifies how the basis vectors are printed. julia> R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]); julia> FR = free_module(R, 2) -Free module of rank 2 over Multivariate polynomial ring in 3 variables over QQ +Free module of rank 2 over multivariate polynomial ring julia> x*FR[1] x*e[1] @@ -49,7 +49,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 complement of prime ideal (x, y, z) +Free module of rank 2 over localized ring julia> RL(x)*FRL[1] x*f[1] @@ -65,7 +65,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 at complement of prime ideal +Free module of rank 2 over localized quotient of multivariate polynomial ring julia> RQL(x)*FRQL[1] x*h[1] @@ -107,8 +107,9 @@ end function show(io::IO, F::FreeMod) @show_name(io, F) @show_special(io, F) - compact = get(io, :compact, false) - io_compact = IOContext(io, :compact => true) + io = pretty(io) + compact = get(io, :supercompact, false) + io_compact = IOContext(io, :compact => true, :supercompact => true) if is_graded(F) if !compact print(io, "Graded free module ") @@ -133,17 +134,17 @@ function show(io::IO, F::FreeMod) end if !compact - print(io," of rank $(rank(F)) over ") + print(io," of rank $(rank(F)) over ", Lowercase()) print(io_compact, base_ring(F)) end else if !compact #Todo: Use once the printing of rings is fixed #print(io_compact, "Free module ", base_ring(F), "^$(F.n) of rank $(F.n) over ") - print(io_compact, "Free module of rank $(F.n) over ") + print(io_compact, "Free module of rank $(rank(F)) over ", Lowercase()) print(io_compact, F.R) else - print(io_compact, base_ring(F), "^$(F.n)") + print(io_compact, base_ring(F), "^$(rank(F))") end end end diff --git a/src/Modules/UngradedModules/FreeModElem.jl b/src/Modules/UngradedModules/FreeModElem.jl index 6c86428ef130..37f1fb08ed6c 100644 --- a/src/Modules/UngradedModules/FreeModElem.jl +++ b/src/Modules/UngradedModules/FreeModElem.jl @@ -84,7 +84,7 @@ julia> R, (x, y) = polynomial_ring(QQ, ["x", "y"]) (Multivariate polynomial ring in 2 variables over QQ, QQMPolyRingElem[x, y]) julia> F = FreeMod(R,3) -Free module of rank 3 over Multivariate polynomial ring in 2 variables over QQ +Free module of rank 3 over multivariate polynomial ring julia> f = x*gen(F,1)+y*gen(F,3) x*e[1] + y*e[3] diff --git a/src/Modules/UngradedModules/FreeModuleHom.jl b/src/Modules/UngradedModules/FreeModuleHom.jl index 4e59682070eb..ef3674903da4 100644 --- a/src/Modules/UngradedModules/FreeModuleHom.jl +++ b/src/Modules/UngradedModules/FreeModuleHom.jl @@ -42,10 +42,10 @@ julia> R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]) (Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x, y, z]) julia> F = free_module(R, 3) -Free module of rank 3 over Multivariate polynomial ring in 3 variables over QQ +Free module of rank 3 over multivariate polynomial ring julia> G = free_module(R, 2) -Free module of rank 2 over Multivariate polynomial ring in 3 variables over QQ +Free module of rank 2 over multivariate polynomial ring julia> V = [y*G[1], x*G[1]+y*G[2], z*G[2]]; @@ -101,10 +101,10 @@ julia> R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]) (Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x, y, z]) julia> F = free_module(R, 3) -Free module of rank 3 over Multivariate polynomial ring in 3 variables over QQ +Free module of rank 3 over multivariate polynomial ring julia> G = free_module(R, 2) -Free module of rank 2 over Multivariate polynomial ring in 3 variables over QQ +Free module of rank 2 over multivariate polynomial ring julia> V = [y*G[1], x*G[1]+y*G[2], z*G[2]] 3-element Vector{FreeModElem{QQMPolyRingElem}}: @@ -113,13 +113,9 @@ julia> V = [y*G[1], x*G[1]+y*G[2], z*G[2]] z*e[2] julia> a = hom(F, G, V) -Map with following data -Domain: -======= -Free module of rank 3 over Multivariate polynomial ring in 3 variables over QQ -Codomain: -========= -Free module of rank 2 over Multivariate polynomial ring in 3 variables over QQ +Module homomorphism + from free module of rank 3 over multivariate polynomial ring + to free module of rank 2 over multivariate polynomial ring julia> a(F[2]) x*e[1] + y*e[2] @@ -130,13 +126,9 @@ julia> B = R[y 0; x y; 0 z] [0 z] julia> b = hom(F, G, B) -Map with following data -Domain: -======= -Free module of rank 3 over Multivariate polynomial ring in 3 variables over QQ -Codomain: -========= -Free module of rank 2 over Multivariate polynomial ring in 3 variables over QQ +Module homomorphism + from free module of rank 3 over multivariate polynomial ring + to free module of rank 2 over multivariate polynomial ring julia> a == b true @@ -158,11 +150,13 @@ julia> V1 = [y*G1[1], (x+y)*G1[1]+y*G1[2], z*G1[2]] z*e[2] julia> a1 = hom(F1, G1, V1) -F1 -> G1 -e[1] -> y*e[1] -e[2] -> (x + y)*e[1] + y*e[2] -e[3] -> z*e[2] Graded module homomorphism of degree [1] + from graded free module Rg^3([0]) of rank 3 over Rg + to graded free module Rg^2([0]) of rank 2 over Rg +defined by + e[1] -> y*e[1] + e[2] -> (x + y)*e[1] + y*e[2] + e[3] -> z*e[2] julia> F2 = graded_free_module(Rg, [1,1,1]) Graded free module Rg^3([-1]) of rank 3 over Rg @@ -177,11 +171,13 @@ julia> V2 = [y*G2[1], (x+y)*G2[1]+y*G2[2], z*G2[2]] z*e[2] julia> a2 = hom(F2, G2, V2) -F2 -> G2 -e[1] -> y*e[1] -e[2] -> (x + y)*e[1] + y*e[2] -e[3] -> z*e[2] Homogeneous module homomorphism + from graded free module Rg^3([-1]) of rank 3 over Rg + to graded free module Rg^2([0]) of rank 2 over Rg +defined by + e[1] -> y*e[1] + e[2] -> (x + y)*e[1] + y*e[2] + e[3] -> z*e[2] julia> B = Rg[y 0; x+y y; 0 z] [ y 0] @@ -189,11 +185,13 @@ julia> B = Rg[y 0; x+y y; 0 z] [ 0 z] julia> b = hom(F2, G2, B) -F2 -> G2 -e[1] -> y*e[1] -e[2] -> (x + y)*e[1] + y*e[2] -e[3] -> z*e[2] Homogeneous module homomorphism + from graded free module Rg^3([-1]) of rank 3 over Rg + to graded free module Rg^2([0]) of rank 2 over Rg +defined by + e[1] -> y*e[1] + e[2] -> (x + y)*e[1] + y*e[2] + e[3] -> z*e[2] julia> a2 == b true @@ -275,41 +273,38 @@ function morphism_type( return FreeModuleHom{DomainType, CodomainType, RingMapType} end -function Base.show(io::IO, ::MIME"text/plain", fmh::FreeModuleHom{T1, T2, RingMapType}) where {T1 <: AbstractFreeMod, T2 <: ModuleFP, RingMapType} - # HACK - show(io, fmh) +function AbstractAlgebra.show_map_data(io::IO, fmh::FreeModuleHom{T1, T2, RingMapType}) where {T1 <: AbstractFreeMod, T2 <: ModuleFP, RingMapType} + if is_graded(fmh) + println(io) + print(io, "defined by", Indent()) + io_compact = IOContext(io, :compact => true, :supercompact => true) + domain_gens = gens(domain(fmh)) + for g in domain_gens + println(io) + print(io_compact, g, " -> ", fmh(g)) + end + end end function Base.show(io::IO, fmh::FreeModuleHom{T1, T2, RingMapType}) where {T1 <: AbstractFreeMod, T2 <: ModuleFP, RingMapType} - compact = get(io, :compact, false) - io_compact = IOContext(io, :compact => true) - if is_graded(fmh) - print(io_compact, domain(fmh)) - print(io, " -> ") - print(io_compact, codomain(fmh)) - if !compact - print(io, "\n") - for i in 1:ngens(domain(fmh)) - print(io, domain(fmh)[i], " -> ") - print(io_compact, fmh(domain(fmh)[i])) - print(io, "\n") - end + if get(io, :supercompact, false) + if is_graded(fmh) A = grading_group(fmh) if degree(fmh) == A[0] print(io, "Homogeneous module homomorphism") else + io_compact = IOContext(io, :compact => true, :supercompact => true) print(io_compact, "Graded module homomorphism of degree ", degree(fmh)) - print(io, "\n") end + else + print(io, "Module homomorphism") end else - println(io, "Map with following data") - println(io, "Domain:") - println(io, "=======") - println(io, domain(fmh)) - println(io, "Codomain:") - println(io, "=========") - print(io, codomain(fmh)) + io = pretty(io) + print(io, "Hom: ") + io_compact = IOContext(io, :compact => true, :supercompact => true) + print(io_compact, Lowercase(), domain(fmh), " -> ") + print(io_compact, Lowercase(), codomain(fmh)) end end @@ -324,22 +319,18 @@ that converts elements from $S$ into morphisms $F \to G$. julia> R, _ = polynomial_ring(QQ, ["x", "y", "z"]); julia> F1 = free_module(R, 3) -Free module of rank 3 over Multivariate polynomial ring in 3 variables over QQ +Free module of rank 3 over multivariate polynomial ring julia> F2 = free_module(R, 2) -Free module of rank 2 over Multivariate polynomial ring in 3 variables over QQ +Free module of rank 2 over multivariate polynomial ring julia> V, f = hom(F1, F2) -(hom of (F1, F2), Map: hom of (F1, F2) -> set of all homomorphisms from Free module of rank 3 over Multivariate polynomial ring in 3 variables over QQ to Free module of rank 2 over Multivariate polynomial ring in 3 variables over QQ) +(hom of (F1, F2), Map: hom of (F1, F2) -> set of all homomorphisms from Free module of rank 3 over multivariate polynomial ring to Free module of rank 2 over multivariate polynomial ring) julia> f(V[1]) -Map with following data -Domain: -======= -Free module of rank 3 over Multivariate polynomial ring in 3 variables over QQ -Codomain: -========= -Free module of rank 2 over Multivariate polynomial ring in 3 variables over QQ +Module homomorphism + from free module of rank 3 over multivariate polynomial ring + to free module of rank 2 over multivariate polynomial ring ``` @@ -356,11 +347,13 @@ julia> V, f = hom(F1, F2) (hom of (F1, F2), Map: hom of (F1, F2) -> set of all homomorphisms from Graded free module Rg^1([-1]) + Rg^2([-2]) of rank 3 over Rg to Graded free module Rg^1([-3]) + Rg^1([-5]) of rank 2 over Rg) julia> f(V[1]) -F1 -> F2 -e[1] -> e[1] -e[2] -> 0 -e[3] -> 0 Graded module homomorphism of degree [2] + from graded free module Rg^1([-1]) + Rg^2([-2]) of rank 3 over Rg + to graded free module Rg^1([-3]) + Rg^1([-5]) of rank 2 over Rg +defined by + e[1] -> e[1] + e[2] -> 0 + e[3] -> 0 ``` """ @@ -413,10 +406,10 @@ julia> R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]) (Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x, y, z]) julia> F = free_module(R, 3) -Free module of rank 3 over Multivariate polynomial ring in 3 variables over QQ +Free module of rank 3 over multivariate polynomial ring julia> G = free_module(R, 2) -Free module of rank 2 over Multivariate polynomial ring in 3 variables over QQ +Free module of rank 2 over multivariate polynomial ring julia> V = [y*G[1], x*G[1]+y*G[2], z*G[2]]; @@ -425,15 +418,9 @@ julia> a = hom(F, G, V); julia> kernel(a) (Submodule with 1 generator 1 -> x*z*e[1] - y*z*e[2] + y^2*e[3] -represented as subquotient with no relations., Map with following data -Domain: -======= -Submodule with 1 generator +represented as subquotient with no relations, Hom: 1 -> x*z*e[1] - y*z*e[2] + y^2*e[3] -represented as subquotient with no relations. -Codomain: -========= -Free module of rank 3 over Multivariate polynomial ring in 3 variables over QQ) +represented as subquotient with no relations -> F) ``` ```jldoctest @@ -450,11 +437,9 @@ julia> a = hom(F, G, V); julia> kernel(a) (Graded submodule of F 1 -> x*z*e[1] - y*z*e[2] + y^2*e[3] -represented as subquotient with no relations, Graded submodule of F +represented as subquotient with no relations, Hom: graded submodule of F 1 -> x*z*e[1] - y*z*e[2] + y^2*e[3] -represented as subquotient with no relations -> F -x*z*e[1] - y*z*e[2] + y^2*e[3] -> x*z*e[1] - y*z*e[2] + y^2*e[3] -Homogeneous module homomorphism) +represented as subquotient with no relations -> F) ``` """ @@ -503,10 +488,10 @@ julia> R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]) (Multivariate polynomial ring in 3 variables over QQ, QQMPolyRingElem[x, y, z]) julia> F = free_module(R, 3) -Free module of rank 3 over Multivariate polynomial ring in 3 variables over QQ +Free module of rank 3 over multivariate polynomial ring julia> G = free_module(R, 2) -Free module of rank 2 over Multivariate polynomial ring in 3 variables over QQ +Free module of rank 2 over multivariate polynomial ring julia> V = [y*G[1], x*G[1]+y*G[2], z*G[2]]; @@ -517,17 +502,11 @@ julia> image(a) 1 -> y*e[1] 2 -> x*e[1] + y*e[2] 3 -> z*e[2] -represented as subquotient with no relations., Map with following data -Domain: -======= -Submodule with 3 generators +represented as subquotient with no relations, Hom: 1 -> y*e[1] 2 -> x*e[1] + y*e[2] 3 -> z*e[2] -represented as subquotient with no relations. -Codomain: -========= -Free module of rank 2 over Multivariate polynomial ring in 3 variables over QQ) +represented as subquotient with no relations -> G) ``` ```jldoctest @@ -546,15 +525,11 @@ julia> image(a) 1 -> y*e[1] 2 -> x*e[1] + y*e[2] 3 -> z*e[2] -represented as subquotient with no relations, Graded submodule of G +represented as subquotient with no relations, Hom: graded submodule of G 1 -> y*e[1] 2 -> x*e[1] + y*e[2] 3 -> z*e[2] -represented as subquotient with no relations -> G -y*e[1] -> y*e[1] -x*e[1] + y*e[2] -> x*e[1] + y*e[2] -z*e[2] -> z*e[2] -Homogeneous module homomorphism) +represented as subquotient with no relations -> G) ``` """ diff --git a/src/Modules/UngradedModules/FreeResolutions.jl b/src/Modules/UngradedModules/FreeResolutions.jl index dee8ee23e56a..61fc3642b723 100644 --- a/src/Modules/UngradedModules/FreeResolutions.jl +++ b/src/Modules/UngradedModules/FreeResolutions.jl @@ -36,7 +36,7 @@ function free_show(io::IO, C::ComplexOfMorphisms) push!(rank_mod, rank(M)) end - io = IOContext(io, :compact => true) + io = IOContext(io, :compact => true, :supercompact => true) N = get_attribute(C, :free_res) if N !== nothing print(io, "Free resolution") @@ -106,10 +106,10 @@ julia> B = R[x^2; x*y; y^2; z^4] [z^4] julia> M = SubquoModule(A, B) -Subquotient of Submodule with 2 generators +Subquotient of submodule with 2 generators 1 -> x*e[1] 2 -> y*e[1] -by Submodule with 4 generators +by submodule with 4 generators 1 -> x^2*e[1] 2 -> x*y*e[1] 3 -> y^2*e[1] @@ -276,10 +276,10 @@ julia> B = R[x^2; x*y; y^2; z^4] [z^4] julia> M = SubquoModule(A, B) -Subquotient of Submodule with 2 generators +Subquotient of submodule with 2 generators 1 -> x*e[1] 2 -> y*e[1] -by Submodule with 4 generators +by submodule with 4 generators 1 -> x^2*e[1] 2 -> x*y*e[1] 3 -> y^2*e[1] @@ -294,7 +294,7 @@ julia> is_complete(fr) false julia> fr[4] -Free module of rank 0 over Multivariate polynomial ring in 3 variables over QQ +Free module of rank 0 over multivariate polynomial ring julia> fr Free resolution of M diff --git a/src/Modules/UngradedModules/Hom_and_ext.jl b/src/Modules/UngradedModules/Hom_and_ext.jl index 8bd774eff373..0276ba7bdfb8 100644 --- a/src/Modules/UngradedModules/Hom_and_ext.jl +++ b/src/Modules/UngradedModules/Hom_and_ext.jl @@ -23,10 +23,10 @@ julia> F = FreeMod(R, 2); julia> V = [x*F[1], y^2*F[2]]; julia> M = quo(F, V)[1] -Subquotient of Submodule with 2 generators +Subquotient of submodule with 2 generators 1 -> e[1] 2 -> e[2] -by Submodule with 2 generators +by submodule with 2 generators 1 -> x*e[1] 2 -> y^2*e[2] @@ -116,10 +116,10 @@ julia> F = FreeMod(R, 2); julia> V = [x*F[1], y^2*F[2]]; julia> M = quo(F, V)[1] -Subquotient of Submodule with 2 generators +Subquotient of submodule with 2 generators 1 -> e[1] 2 -> e[2] -by Submodule with 2 generators +by submodule with 2 generators 1 -> x*e[1] 2 -> y^2*e[2] @@ -138,23 +138,19 @@ julia> relations(H) y^2*(e[2] -> e[2]) julia> a = element_to_homomorphism(H[1]+y*H[2]) -Map with following data -Domain: -======= -Subquotient of Submodule with 2 generators -1 -> e[1] -2 -> e[2] -by Submodule with 2 generators -1 -> x*e[1] -2 -> y^2*e[2] -Codomain: -========= -Subquotient of Submodule with 2 generators -1 -> e[1] -2 -> e[2] -by Submodule with 2 generators -1 -> x*e[1] -2 -> y^2*e[2] +Module homomorphism + from subquotient of submodule with 2 generators + 1 -> e[1] + 2 -> e[2] + by submodule with 2 generators + 1 -> x*e[1] + 2 -> y^2*e[2] + to subquotient of submodule with 2 generators + 1 -> e[1] + 2 -> e[2] + by submodule with 2 generators + 1 -> x*e[1] + 2 -> y^2*e[2] julia> matrix(a) [1 0] @@ -182,10 +178,10 @@ julia> F = FreeMod(R, 2); julia> V = [x*F[1], y^2*F[2]]; julia> M = quo(F, V)[1] -Subquotient of Submodule with 2 generators +Subquotient of submodule with 2 generators 1 -> e[1] 2 -> e[2] -by Submodule with 2 generators +by submodule with 2 generators 1 -> x*e[1] 2 -> y^2*e[2] diff --git a/src/Modules/UngradedModules/HomologicalAlgebra.jl b/src/Modules/UngradedModules/HomologicalAlgebra.jl index fcf37755b1ad..c74ee7b4b293 100644 --- a/src/Modules/UngradedModules/HomologicalAlgebra.jl +++ b/src/Modules/UngradedModules/HomologicalAlgebra.jl @@ -204,26 +204,26 @@ julia> F = free_module(R, 1); julia> Q, _ = quo(F, [x*F[1]]); julia> T0 = tor(Q, M, 0) -Subquotient of Submodule with 2 generators +Subquotient of submodule with 2 generators 1 -> x*e[1] \otimes e[1] 2 -> y*e[1] \otimes e[1] -by Submodule with 4 generators +by submodule with 4 generators 1 -> x^2*e[1] \otimes e[1] 2 -> y^3*e[1] \otimes e[1] 3 -> z^4*e[1] \otimes e[1] 4 -> x*y*e[1] \otimes e[1] julia> T1 = tor(Q, M, 1) -Subquotient of Submodule with 1 generator +Subquotient of submodule with 1 generator 1 -> -x*e[1] \otimes e[1] -by Submodule with 3 generators +by submodule with 3 generators 1 -> x^2*e[1] \otimes e[1] 2 -> y^3*e[1] \otimes e[1] 3 -> z^4*e[1] \otimes e[1] julia> T2 = tor(Q, M, 2) Submodule with 0 generators -represented as subquotient with no relations. +represented as subquotient with no relations ``` """ function tor(M::ModuleFP, N::ModuleFP, i::Int) @@ -459,18 +459,18 @@ julia> C = ComplexOfMorphisms(ModuleFP, [a, b]); julia> H = homology(C) 3-element Vector{SubquoModule{QQMPolyRingElem}}: - Subquotient of Submodule with 1 generator + Subquotient of submodule with 1 generator 1 -> x*e[1] -by Submodule with 1 generator +by submodule with 1 generator 1 -> x^4*e[1] - Subquotient of Submodule with 1 generator + Subquotient of submodule with 1 generator 1 -> x*e[1] -by Submodule with 2 generators +by submodule with 2 generators 1 -> x^3*e[1] 2 -> x^2*e[1] - Subquotient of Submodule with 1 generator + Subquotient of submodule with 1 generator 1 -> e[1] -by Submodule with 2 generators +by submodule with 2 generators 1 -> x^3*e[1] 2 -> x^2*e[1] ``` @@ -506,9 +506,9 @@ julia> b = hom(B, B, [x^2*B[1]]); julia> C = ComplexOfMorphisms(ModuleFP, [a, b]); julia> H = homology(C, 1) -Subquotient of Submodule with 1 generator +Subquotient of submodule with 1 generator 1 -> x*e[1] -by Submodule with 2 generators +by submodule with 2 generators 1 -> x^3*e[1] 2 -> x^2*e[1] ``` @@ -550,40 +550,40 @@ julia> F = FreeMod(R, 1); julia> V = [x*F[1], y*F[1]]; julia> M = quo(F, V)[1] -Subquotient of Submodule with 1 generator +Subquotient of submodule with 1 generator 1 -> e[1] -by Submodule with 2 generators +by submodule with 2 generators 1 -> x*e[1] 2 -> y*e[1] julia> ext(M, M, 0) -Subquotient of Submodule with 1 generator +Subquotient of submodule with 1 generator 1 -> (e[1] -> e[1]) -by Submodule with 2 generators +by submodule with 2 generators 1 -> x*(e[1] -> e[1]) 2 -> y*(e[1] -> e[1]) julia> ext(M, M, 1) -Subquotient of Submodule with 2 generators +Subquotient of submodule with 2 generators 1 -> (e[2] -> e[1]) 2 -> (e[1] -> e[1]) -by Submodule with 4 generators +by submodule with 4 generators 1 -> x*(e[1] -> e[1]) 2 -> y*(e[1] -> e[1]) 3 -> x*(e[2] -> e[1]) 4 -> y*(e[2] -> e[1]) julia> ext(M, M, 2) -Subquotient of Submodule with 1 generator +Subquotient of submodule with 1 generator 1 -> (e[1] -> e[1]) -by Submodule with 3 generators +by submodule with 3 generators 1 -> x*(e[1] -> e[1]) 2 -> y*(e[1] -> e[1]) 3 -> -x*(e[1] -> e[1]) julia> ext(M, M, 3) Submodule with 0 generators -represented as subquotient with no relations. +represented as subquotient with no relations ``` """ function ext(M::ModuleFP, N::ModuleFP, i::Int) diff --git a/src/Modules/UngradedModules/Methods.jl b/src/Modules/UngradedModules/Methods.jl index 48bbdd6ee98a..f9fc5baf7bc9 100644 --- a/src/Modules/UngradedModules/Methods.jl +++ b/src/Modules/UngradedModules/Methods.jl @@ -19,10 +19,24 @@ julia> B = Rg[x^2; y^3; z^4]; julia> M = SubquoModule(F, A, B); julia> is_equal_with_morphism(M, M) -M -> M -x*e[1] -> x*e[1] -y*e[1] -> y*e[1] Homogeneous module homomorphism + from graded subquotient of submodule of F generated by + 1 -> x*e[1] + 2 -> y*e[1] + by submodule of F generated by + 1 -> x^2*e[1] + 2 -> y^3*e[1] + 3 -> z^4*e[1] + to graded subquotient of submodule of F generated by + 1 -> x*e[1] + 2 -> y*e[1] + by submodule of F generated by + 1 -> x^2*e[1] + 2 -> y^3*e[1] + 3 -> z^4*e[1] +defined by + x*e[1] -> x*e[1] + y*e[1] -> y*e[1] ``` """ function is_equal_with_morphism(M::SubquoModule{T}, N::SubquoModule{T}, task::Symbol = :none) where {T} diff --git a/src/Modules/UngradedModules/Presentation.jl b/src/Modules/UngradedModules/Presentation.jl index 98e2dcf66d6d..f105ade504fa 100644 --- a/src/Modules/UngradedModules/Presentation.jl +++ b/src/Modules/UngradedModules/Presentation.jl @@ -141,22 +141,28 @@ julia> p[1] Graded free module Rg^0 of rank 0 over Rg julia> map(p,-1) -F -> 0 -e[1] -> 0 -e[2] -> 0 -e[3] -> 0 Homogeneous module homomorphism + from graded free module Rg^1([-1]) + Rg^2([-2]) of rank 3 over Rg + to graded free module Rg^0 of rank 0 over Rg +defined by + e[1] -> 0 + e[2] -> 0 + e[3] -> 0 julia> map(p,0) -F -> F -e[1] -> e[1] -e[2] -> e[2] -e[3] -> e[3] Homogeneous module homomorphism + from graded free module Rg^1([-1]) + Rg^2([-2]) of rank 3 over Rg + to graded free module Rg^1([-1]) + Rg^2([-2]) of rank 3 over Rg +defined by + e[1] -> e[1] + e[2] -> e[2] + e[3] -> e[3] julia> map(p,1) -0 -> F Homogeneous module homomorphism + from graded free module Rg^0 of rank 0 over Rg + to graded free module Rg^1([-1]) + Rg^2([-2]) of rank 3 over Rg +defined by julia> F = graded_free_module(Rg, 1); @@ -188,25 +194,43 @@ julia> P[1] Graded free module Rg^2([-2]) + Rg^1([-3]) + Rg^2([-5]) of rank 5 over Rg julia> map(P,-1) -M -> 0 -x*e[1] -> 0 -y*e[1] -> 0 Homogeneous module homomorphism + from graded subquotient of submodule of F generated by + 1 -> x*e[1] + 2 -> y*e[1] + by submodule of F generated by + 1 -> x^2*e[1] + 2 -> y^3*e[1] + 3 -> z^4*e[1] + to graded free module Rg^0 of rank 0 over Rg +defined by + x*e[1] -> 0 + y*e[1] -> 0 julia> map(P,0) -Rg^2 -> M -e[1] -> x*e[1] -e[2] -> y*e[1] Homogeneous module homomorphism + from graded free module Rg^2([-1]) of rank 2 over Rg + to graded subquotient of submodule of F generated by + 1 -> x*e[1] + 2 -> y*e[1] + by submodule of F generated by + 1 -> x^2*e[1] + 2 -> y^3*e[1] + 3 -> z^4*e[1] +defined by + e[1] -> x*e[1] + e[2] -> y*e[1] julia> map(P,1) -Rg^5 -> Rg^2 -e[1] -> x*e[1] -e[2] -> -y*e[1] + x*e[2] -e[3] -> y^2*e[2] -e[4] -> z^4*e[1] -e[5] -> z^4*e[2] Homogeneous module homomorphism + from graded free module Rg^2([-2]) + Rg^1([-3]) + Rg^2([-5]) of rank 5 over Rg + to graded free module Rg^2([-1]) of rank 2 over Rg +defined by + e[1] -> x*e[1] + e[2] -> -y*e[1] + x*e[2] + e[3] -> y^2*e[2] + e[4] -> z^4*e[1] + e[5] -> z^4*e[2] ``` """ function presentation(M::ModuleFP) @@ -235,19 +259,19 @@ julia> A = R[x; y]; julia> B = R[x^2; y^3; z^4]; julia> M = SubquoModule(A, B) -Subquotient of Submodule with 2 generators +Subquotient of submodule with 2 generators 1 -> x*e[1] 2 -> y*e[1] -by Submodule with 3 generators +by submodule with 3 generators 1 -> x^2*e[1] 2 -> y^3*e[1] 3 -> z^4*e[1] julia> C = present_as_cokernel(M) -Subquotient of Submodule with 2 generators +Subquotient of submodule with 2 generators 1 -> e[1] 2 -> e[2] -by Submodule with 5 generators +by submodule with 5 generators 1 -> x*e[1] 2 -> -y*e[1] + x*e[2] 3 -> y^2*e[2] @@ -275,7 +299,7 @@ by submodule of Rg^2 generated by 2 -> -y*e[1] + x*e[2] 3 -> y^2*e[2] 4 -> z^4*e[1] -5 -> z^4*e[2], Graded subquotient of submodule of Rg^2 generated by +5 -> z^4*e[2], Hom: graded subquotient of submodule of Rg^2 generated by 1 -> e[1] 2 -> e[2] by submodule of Rg^2 generated by @@ -283,10 +307,7 @@ by submodule of Rg^2 generated by 2 -> -y*e[1] + x*e[2] 3 -> y^2*e[2] 4 -> z^4*e[1] -5 -> z^4*e[2] -> M -e[1] -> x*e[1] -e[2] -> y*e[1] -Homogeneous module homomorphism) +5 -> z^4*e[2] -> M) ``` """ function present_as_cokernel(SQ::SubquoModule, task::Symbol = :none) @@ -332,25 +353,21 @@ If `task = :only_morphism`, return only an isomorphism. julia> R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]); julia> F = free_module(R, 2) -Free module of rank 2 over Multivariate polynomial ring in 3 variables over QQ +Free module of rank 2 over multivariate polynomial ring julia> present_as_cokernel(F) Submodule with 2 generators 1 -> e[1] 2 -> e[2] -represented as subquotient with no relations. +represented as subquotient with no relations julia> present_as_cokernel(F, :only_morphism) -Map with following data -Domain: -======= -Free module of rank 2 over Multivariate polynomial ring in 3 variables over QQ -Codomain: -========= -Submodule with 2 generators -1 -> e[1] -2 -> e[2] -represented as subquotient with no relations. +Module homomorphism + from free module of rank 2 over multivariate polynomial ring + to submodule with 2 generators + 1 -> e[1] + 2 -> e[2] + represented as subquotient with no relations ``` """ function present_as_cokernel(F::FreeMod, task::Symbol = :none) @@ -381,28 +398,16 @@ that `N` is generated by a minimal number of elements. julia> R, (x, y) = polynomial_ring(QQ, ["x", "y"]); julia> M = SubquoModule(identity_matrix(R, 2), R[1 x+y]) -Subquotient of Submodule with 2 generators +Subquotient of submodule with 2 generators 1 -> e[1] 2 -> e[2] -by Submodule with 1 generator +by submodule with 1 generator 1 -> e[1] + (x + y)*e[2] julia> N, phi = prune_with_map(M) (Submodule with 1 generator 1 -> e[1] -represented as subquotient with no relations., Map with following data -Domain: -======= -Submodule with 1 generator -1 -> e[1] -represented as subquotient with no relations. -Codomain: -========= -Subquotient of Submodule with 2 generators -1 -> e[1] -2 -> e[2] -by Submodule with 1 generator -1 -> e[1] + (x + y)*e[2]) +represented as subquotient with no relations, Hom: N -> M) julia> phi(first(gens(N))) e[2] diff --git a/src/Modules/UngradedModules/SubModuleOfFreeModule.jl b/src/Modules/UngradedModules/SubModuleOfFreeModule.jl index e243d3695794..f38f8dde6e64 100644 --- a/src/Modules/UngradedModules/SubModuleOfFreeModule.jl +++ b/src/Modules/UngradedModules/SubModuleOfFreeModule.jl @@ -295,8 +295,8 @@ end function show(io::IO, M::SubModuleOfFreeModule) @show_name(io, M) @show_special(io, M) - io_compact = IOContext(io, :compact => true) - compact = get(io, :compact, false) + io_compact = IOContext(io, :compact => true, :supercompact => true) + compact = get(io, :supercompact, false) if !compact if is_graded(M) print(io_compact, "Graded submodule of ", M.F) diff --git a/src/Modules/UngradedModules/SubQuoHom.jl b/src/Modules/UngradedModules/SubQuoHom.jl index 0b2394f43eda..dbb8070b8a7d 100644 --- a/src/Modules/UngradedModules/SubQuoHom.jl +++ b/src/Modules/UngradedModules/SubQuoHom.jl @@ -41,42 +41,38 @@ function SubQuoHom(D::SubquoModule, C::ModuleFP{T}, mat::MatElem{T}, h::RingMapT end end -function Base.show(io::IO, ::MIME"text/plain", fmh::SubQuoHom{T1, T2, RingMapType}) where {T1 <: AbstractSubQuo, T2 <: ModuleFP, RingMapType} - # HACK - show(io, fmh) +function AbstractAlgebra.show_map_data(io::IO, fmh::SubQuoHom{T1, T2, RingMapType}) where {T1 <: AbstractSubQuo, T2 <: ModuleFP, RingMapType} + if is_graded(fmh) + println(io) + print(io, "defined by", Indent()) + io_compact = IOContext(io, :compact => true, :supercompact => true) + domain_gens = gens(domain(fmh)) + for g in domain_gens + println(io) + print(io_compact, g, " -> ", fmh(g)) + end + end end function Base.show(io::IO, fmh::SubQuoHom{T1, T2, RingMapType}) where {T1 <: AbstractSubQuo, T2 <: ModuleFP, RingMapType} - compact = get(io, :compact, false) - io_compact = IOContext(io, :compact => true) - domain_gens = gens(domain(fmh)) - if is_graded(fmh) - print(io_compact, domain(fmh)) - print(io, " -> ") - print(io_compact, codomain(fmh)) - if !compact - print(io, "\n") - for i in 1:length(domain_gens) - print(io, domain_gens[i], " -> ") - print(io_compact, fmh(domain_gens[i])) - print(io, "\n") - end + if get(io, :supercompact, false) + if is_graded(fmh) A = grading_group(fmh) if degree(fmh) == A[0] print(io, "Homogeneous module homomorphism") else + io_compact = IOContext(io, :compact => true, :supercompact => true) print(io_compact, "Graded module homomorphism of degree ", degree(fmh)) - print(io, "\n") end + else + print(io, "Module homomorphism") end else - println(io, "Map with following data") - println(io, "Domain:") - println(io, "=======") - println(io, domain(fmh)) - println(io, "Codomain:") - println(io, "=========") - print(io, codomain(fmh)) + io = pretty(io) + print(io, "Hom: ") + io_compact = IOContext(io, :compact => true, :supercompact => true) + print(io_compact, Lowercase(), domain(fmh), " -> ") + print(io_compact, Lowercase(), codomain(fmh)) end end @@ -121,7 +117,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> F = free_module(R, 1) -Free module of rank 1 over Multivariate polynomial ring in 3 variables over QQ +Free module of rank 1 over multivariate polynomial ring julia> A = R[x; y] [x] @@ -133,10 +129,10 @@ julia> B = R[x^2; y^3; z^4] [z^4] julia> M = SubquoModule(F, A, B) -Subquotient of Submodule with 2 generators +Subquotient of submodule with 2 generators 1 -> x*e[1] 2 -> y*e[1] -by Submodule with 3 generators +by submodule with 3 generators 1 -> x^2*e[1] 2 -> y^3*e[1] 3 -> z^4*e[1] @@ -149,25 +145,21 @@ julia> V = [y^2*N[1], x*N[2]] x*y*e[1] julia> a = hom(M, N, V) -Map with following data -Domain: -======= -Subquotient of Submodule with 2 generators -1 -> x*e[1] -2 -> y*e[1] -by Submodule with 3 generators -1 -> x^2*e[1] -2 -> y^3*e[1] -3 -> z^4*e[1] -Codomain: -========= -Subquotient of Submodule with 2 generators -1 -> x*e[1] -2 -> y*e[1] -by Submodule with 3 generators -1 -> x^2*e[1] -2 -> y^3*e[1] -3 -> z^4*e[1] +Module homomorphism + from subquotient of submodule with 2 generators + 1 -> x*e[1] + 2 -> y*e[1] + by submodule with 3 generators + 1 -> x^2*e[1] + 2 -> y^3*e[1] + 3 -> z^4*e[1] + to subquotient of submodule with 2 generators + 1 -> x*e[1] + 2 -> y*e[1] + by submodule with 3 generators + 1 -> x^2*e[1] + 2 -> y^3*e[1] + 3 -> z^4*e[1] julia> is_welldefined(a) true @@ -187,7 +179,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> F = free_module(R, 1) -Free module of rank 1 over Multivariate polynomial ring in 3 variables over QQ +Free module of rank 1 over multivariate polynomial ring julia> A = R[x; y]; @@ -231,10 +223,24 @@ julia> N = M; julia> V = [y^2*N[1], x^2*N[2]]; julia> a = hom(M, N, V) -M -> M -x*e[1] -> x*y^2*e[1] -y*e[1] -> x^2*y*e[1] Graded module homomorphism of degree [2] + from graded subquotient of submodule of F generated by + 1 -> x*e[1] + 2 -> y*e[1] + by submodule of F generated by + 1 -> x^2*e[1] + 2 -> y^3*e[1] + 3 -> z^4*e[1] + to graded subquotient of submodule of F generated by + 1 -> x*e[1] + 2 -> y*e[1] + by submodule of F generated by + 1 -> x^2*e[1] + 2 -> y^3*e[1] + 3 -> z^4*e[1] +defined by + x*e[1] -> x*y^2*e[1] + y*e[1] -> x^2*y*e[1] julia> is_welldefined(a) true @@ -244,10 +250,24 @@ julia> W = Rg[y^2 0; 0 x^2] [ 0 x^2] julia> b = hom(M, N, W) -M -> M -x*e[1] -> x*y^2*e[1] -y*e[1] -> x^2*y*e[1] Graded module homomorphism of degree [2] + from graded subquotient of submodule of F generated by + 1 -> x*e[1] + 2 -> y*e[1] + by submodule of F generated by + 1 -> x^2*e[1] + 2 -> y^3*e[1] + 3 -> z^4*e[1] + to graded subquotient of submodule of F generated by + 1 -> x*e[1] + 2 -> y*e[1] + by submodule of F generated by + 1 -> x^2*e[1] + 2 -> y^3*e[1] + 3 -> z^4*e[1] +defined by + x*e[1] -> x*y^2*e[1] + y*e[1] -> x^2*y*e[1] julia> a == b true @@ -258,10 +278,24 @@ julia> W = [y*N[1], x*N[2]] x*y*e[1] julia> c = hom(M, N, W) -M -> M -x*e[1] -> x*y*e[1] -y*e[1] -> x*y*e[1] Graded module homomorphism of degree [1] + from graded subquotient of submodule of F generated by + 1 -> x*e[1] + 2 -> y*e[1] + by submodule of F generated by + 1 -> x^2*e[1] + 2 -> y^3*e[1] + 3 -> z^4*e[1] + to graded subquotient of submodule of F generated by + 1 -> x*e[1] + 2 -> y*e[1] + by submodule of F generated by + 1 -> x^2*e[1] + 2 -> y^3*e[1] + 3 -> z^4*e[1] +defined by + x*e[1] -> x*y*e[1] + y*e[1] -> x*y*e[1] julia> is_welldefined(c) false @@ -369,7 +403,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> F = free_module(R, 1) -Free module of rank 1 over Multivariate polynomial ring in 3 variables over QQ +Free module of rank 1 over multivariate polynomial ring julia> A = R[x; y] [x] @@ -381,10 +415,10 @@ julia> B = R[x^2; y^3; z^4] [z^4] julia> M = SubquoModule(F, A, B) -Subquotient of Submodule with 2 generators +Subquotient of submodule with 2 generators 1 -> x*e[1] 2 -> y*e[1] -by Submodule with 3 generators +by submodule with 3 generators 1 -> x^2*e[1] 2 -> y^3*e[1] 3 -> z^4*e[1] @@ -426,10 +460,24 @@ julia> N = M; julia> V = [y^2*N[1], x^2*N[2]]; julia> a = hom(M, N, V) -M -> M -x*e[1] -> x*y^2*e[1] -y*e[1] -> x^2*y*e[1] Graded module homomorphism of degree [2] + from graded subquotient of submodule of F generated by + 1 -> x*e[1] + 2 -> y*e[1] + by submodule of F generated by + 1 -> x^2*e[1] + 2 -> y^3*e[1] + 3 -> z^4*e[1] + to graded subquotient of submodule of F generated by + 1 -> x*e[1] + 2 -> y*e[1] + by submodule of F generated by + 1 -> x^2*e[1] + 2 -> y^3*e[1] + 3 -> z^4*e[1] +defined by + x*e[1] -> x*y^2*e[1] + y*e[1] -> x^2*y*e[1] julia> matrix(a) [y^2 0] @@ -575,20 +623,16 @@ Submodule with 3 generators 1 -> y*e[1] 2 -> x*e[1] + y*e[2] 3 -> z*e[2] -represented as subquotient with no relations. +represented as subquotient with no relations julia> incl -Map with following data -Domain: -======= -Submodule with 3 generators -1 -> y*e[1] -2 -> x*e[1] + y*e[2] -3 -> z*e[2] -represented as subquotient with no relations. -Codomain: -========= -Free module of rank 2 over Multivariate polynomial ring in 3 variables over QQ +Module homomorphism + from submodule with 3 generators + 1 -> y*e[1] + 2 -> x*e[1] + y*e[2] + 3 -> z*e[2] + represented as subquotient with no relations + to free module of rank 2 over multivariate polynomial ring ``` ```jldoctest @@ -606,10 +650,10 @@ julia> B = R[x^2; y^3; z^4] [z^4] julia> M = SubquoModule(F, A, B) -Subquotient of Submodule with 2 generators +Subquotient of submodule with 2 generators 1 -> x*e[1] 2 -> y*e[1] -by Submodule with 3 generators +by submodule with 3 generators 1 -> x^2*e[1] 2 -> y^3*e[1] 3 -> z^4*e[1] @@ -626,34 +670,30 @@ julia> a = hom(M, N, V); julia> I, incl = image(a); julia> I -Subquotient of Submodule with 2 generators +Subquotient of submodule with 2 generators 1 -> x*y^2*e[1] 2 -> x*y*e[1] -by Submodule with 3 generators +by submodule with 3 generators 1 -> x^2*e[1] 2 -> y^3*e[1] 3 -> z^4*e[1] julia> incl -Map with following data -Domain: -======= -Subquotient of Submodule with 2 generators -1 -> x*y^2*e[1] -2 -> x*y*e[1] -by Submodule with 3 generators -1 -> x^2*e[1] -2 -> y^3*e[1] -3 -> z^4*e[1] -Codomain: -========= -Subquotient of Submodule with 2 generators -1 -> x*e[1] -2 -> y*e[1] -by Submodule with 3 generators -1 -> x^2*e[1] -2 -> y^3*e[1] -3 -> z^4*e[1] +Module homomorphism + from subquotient of submodule with 2 generators + 1 -> x*y^2*e[1] + 2 -> x*y*e[1] + by submodule with 3 generators + 1 -> x^2*e[1] + 2 -> y^3*e[1] + 3 -> z^4*e[1] + to subquotient of submodule with 2 generators + 1 -> x*e[1] + 2 -> y*e[1] + by submodule with 3 generators + 1 -> x^2*e[1] + 2 -> y^3*e[1] + 3 -> z^4*e[1] ``` ```jldoctest @@ -679,10 +719,24 @@ julia> N = M; julia> V = [y^2*N[1], x^2*N[2]]; julia> a = hom(M, N, V) -M -> M -x*e[1] -> x*y^2*e[1] -y*e[1] -> x^2*y*e[1] Graded module homomorphism of degree [2] + from graded subquotient of submodule of F generated by + 1 -> x*e[1] + 2 -> y*e[1] + by submodule of F generated by + 1 -> x^2*e[1] + 2 -> y^3*e[1] + 3 -> z^4*e[1] + to graded subquotient of submodule of F generated by + 1 -> x*e[1] + 2 -> y*e[1] + by submodule of F generated by + 1 -> x^2*e[1] + 2 -> y^3*e[1] + 3 -> z^4*e[1] +defined by + x*e[1] -> x*y^2*e[1] + y*e[1] -> x^2*y*e[1] julia> image(a) (Graded subquotient of submodule of F generated by @@ -691,16 +745,13 @@ julia> image(a) by submodule of F generated by 1 -> x^2*e[1] 2 -> y^3*e[1] -3 -> z^4*e[1], Graded subquotient of submodule of F generated by +3 -> z^4*e[1], Hom: graded subquotient of submodule of F generated by 1 -> x*y^2*e[1] 2 -> x^2*y*e[1] by submodule of F generated by 1 -> x^2*e[1] 2 -> y^3*e[1] -3 -> z^4*e[1] -> M -x*y^2*e[1] -> x*y^2*e[1] -x^2*y*e[1] -> x^2*y*e[1] -Homogeneous module homomorphism) +3 -> z^4*e[1] -> M) ``` """ function image(a::ModuleFPHom) @@ -755,18 +806,14 @@ julia> K, incl = kernel(a); julia> K Submodule with 1 generator 1 -> x*z*e[1] - y*z*e[2] + y^2*e[3] -represented as subquotient with no relations. +represented as subquotient with no relations julia> incl -Map with following data -Domain: -======= -Submodule with 1 generator -1 -> x*z*e[1] - y*z*e[2] + y^2*e[3] -represented as subquotient with no relations. -Codomain: -========= -Free module of rank 3 over Multivariate polynomial ring in 3 variables over QQ +Module homomorphism + from submodule with 1 generator + 1 -> x*z*e[1] - y*z*e[2] + y^2*e[3] + represented as subquotient with no relations + to free module of rank 3 over multivariate polynomial ring ``` ```jldoctest @@ -784,10 +831,10 @@ julia> B = R[x^2; y^3; z^4] [z^4] julia> M = SubquoModule(F, A, B) -Subquotient of Submodule with 2 generators +Subquotient of submodule with 2 generators 1 -> x*e[1] 2 -> y*e[1] -by Submodule with 3 generators +by submodule with 3 generators 1 -> x^2*e[1] 2 -> y^3*e[1] 3 -> z^4*e[1] @@ -804,36 +851,32 @@ julia> a = hom(M, N, V); julia> K, incl = kernel(a); julia> K -Subquotient of Submodule with 3 generators +Subquotient of submodule with 3 generators 1 -> (-x + y^2)*e[1] 2 -> x*y*e[1] 3 -> -x*y*e[1] -by Submodule with 3 generators +by submodule with 3 generators 1 -> x^2*e[1] 2 -> y^3*e[1] 3 -> z^4*e[1] julia> incl -Map with following data -Domain: -======= -Subquotient of Submodule with 3 generators -1 -> (-x + y^2)*e[1] -2 -> x*y*e[1] -3 -> -x*y*e[1] -by Submodule with 3 generators -1 -> x^2*e[1] -2 -> y^3*e[1] -3 -> z^4*e[1] -Codomain: -========= -Subquotient of Submodule with 2 generators -1 -> x*e[1] -2 -> y*e[1] -by Submodule with 3 generators -1 -> x^2*e[1] -2 -> y^3*e[1] -3 -> z^4*e[1] +Module homomorphism + from subquotient of submodule with 3 generators + 1 -> (-x + y^2)*e[1] + 2 -> x*y*e[1] + 3 -> -x*y*e[1] + by submodule with 3 generators + 1 -> x^2*e[1] + 2 -> y^3*e[1] + 3 -> z^4*e[1] + to subquotient of submodule with 2 generators + 1 -> x*e[1] + 2 -> y*e[1] + by submodule with 3 generators + 1 -> x^2*e[1] + 2 -> y^3*e[1] + 3 -> z^4*e[1] ``` ```jldoctest @@ -859,10 +902,24 @@ julia> N = M; julia> V = [y^2*N[1], x^2*N[2]]; julia> a = hom(M, N, V) -M -> M -x*e[1] -> x*y^2*e[1] -y*e[1] -> x^2*y*e[1] Graded module homomorphism of degree [2] + from graded subquotient of submodule of F generated by + 1 -> x*e[1] + 2 -> y*e[1] + by submodule of F generated by + 1 -> x^2*e[1] + 2 -> y^3*e[1] + 3 -> z^4*e[1] + to graded subquotient of submodule of F generated by + 1 -> x*e[1] + 2 -> y*e[1] + by submodule of F generated by + 1 -> x^2*e[1] + 2 -> y^3*e[1] + 3 -> z^4*e[1] +defined by + x*e[1] -> x*y^2*e[1] + y*e[1] -> x^2*y*e[1] julia> kernel(a) (Graded subquotient of submodule of F generated by @@ -872,18 +929,14 @@ julia> kernel(a) by submodule of F generated by 1 -> x^2*e[1] 2 -> y^3*e[1] -3 -> z^4*e[1], Graded subquotient of submodule of F generated by +3 -> z^4*e[1], Hom: graded subquotient of submodule of F generated by 1 -> -y*e[1] 2 -> (x^2 - y^2)*e[1] 3 -> -x*y*e[1] by submodule of F generated by 1 -> x^2*e[1] 2 -> y^3*e[1] -3 -> z^4*e[1] -> M --y*e[1] -> -y*e[1] -(x^2 - y^2)*e[1] -> (x^2 - y^2)*e[1] --x*y*e[1] -> -x*y*e[1] -Homogeneous module homomorphism) +3 -> z^4*e[1] -> M) ``` """ diff --git a/src/Modules/UngradedModules/SubquoModule.jl b/src/Modules/UngradedModules/SubquoModule.jl index d0b43401c21b..5fa17e9bbd52 100644 --- a/src/Modules/UngradedModules/SubquoModule.jl +++ b/src/Modules/UngradedModules/SubquoModule.jl @@ -42,7 +42,7 @@ julia> R, (x,y) = polynomial_ring(QQ, ["x", "y"]) (Multivariate polynomial ring in 2 variables over QQ, QQMPolyRingElem[x, y]) julia> F = FreeMod(R,2) -Free module of rank 2 over Multivariate polynomial ring in 2 variables over QQ +Free module of rank 2 over multivariate polynomial ring julia> O = [x*F[1]+F[2],y*F[2]] 2-element Vector{FreeModElem{QQMPolyRingElem}}: @@ -53,7 +53,7 @@ julia> M = SubquoModule(F, O) Submodule with 2 generators 1 -> x*e[1] + e[2] 2 -> y*e[2] -represented as subquotient with no relations. +represented as subquotient with no relations ``` """ @@ -134,10 +134,10 @@ julia> B = R[x^2; x*y; y^2; z^4] [z^4] julia> M = SubquoModule(A, B) -Subquotient of Submodule with 2 generators +Subquotient of submodule with 2 generators 1 -> x*e[1] 2 -> y*e[1] -by Submodule with 4 generators +by submodule with 4 generators 1 -> x^2*e[1] 2 -> x*y*e[1] 3 -> y^2*e[1] @@ -187,7 +187,7 @@ free module homomorphisms with codomain `F` represented by `A` and `B`. julia> R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]); julia> FR = free_module(R, 1) -Free module of rank 1 over Multivariate polynomial ring in 3 variables over QQ +Free module of rank 1 over multivariate polynomial ring julia> AR = R[x; y] [x] @@ -199,10 +199,10 @@ julia> BR = R[x^2; y^3; z^4] [z^4] julia> MR = SubquoModule(FR, AR, BR) -Subquotient of Submodule with 2 generators +Subquotient of submodule with 2 generators 1 -> x*e[1] 2 -> y*e[1] -by Submodule with 3 generators +by submodule with 3 generators 1 -> x^2*e[1] 2 -> y^3*e[1] 3 -> z^4*e[1] @@ -214,7 +214,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 complement of prime ideal (x, y, z) +Free module of rank 1 over localized ring julia> ARL = RL[x; y] [x] @@ -226,10 +226,10 @@ julia> BRL = RL[x^2; y^3; z^4] [z^4] julia> MRL = SubquoModule(FRL, ARL, BRL) -Subquotient of Submodule with 2 generators +Subquotient of submodule with 2 generators 1 -> x*e[1] 2 -> y*e[1] -by Submodule with 3 generators +by submodule with 3 generators 1 -> x^2*e[1] 2 -> y^3*e[1] 3 -> z^4*e[1] @@ -249,10 +249,10 @@ julia> BRQ = RQ[x^2; y^3; z^4] [z^4] julia> MRQ = SubquoModule(FRQ, ARQ, BRQ) -Subquotient of Submodule with 2 generators +Subquotient of submodule with 2 generators 1 -> x*e[1] 2 -> y*e[1] -by Submodule with 3 generators +by submodule with 3 generators 1 -> x^2*e[1] 2 -> 2*x^2*e[1] 3 -> z^4*e[1] @@ -260,7 +260,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 at complement of prime ideal +Free module of rank 1 over localized quotient of multivariate polynomial ring julia> ARQL = RQL[x; y] [x] @@ -272,10 +272,10 @@ julia> BRQL = RQL[x^2; y^3; z^4] [z^4] julia> MRQL = SubquoModule(FRQL, ARQL, BRQL) -Subquotient of Submodule with 2 generators +Subquotient of submodule with 2 generators 1 -> x*e[1] 2 -> y*e[1] -by Submodule with 3 generators +by submodule with 3 generators 1 -> 0 2 -> 0 3 -> z^4*e[1] @@ -301,16 +301,20 @@ julia> V2 = [z*G[2]+y*G[1]] y*e[1] + z*e[2] julia> a1 = hom(F1, G, V1) -F1 -> G -e[1] -> y*e[1] -e[2] -> (x + y)*e[1] + y*e[2] -e[3] -> z*e[2] Homogeneous module homomorphism + from graded free module Rg^3([-2]) of rank 3 over Rg + to graded free module Rg^2([-1]) of rank 2 over Rg +defined by + e[1] -> y*e[1] + e[2] -> (x + y)*e[1] + y*e[2] + e[3] -> z*e[2] julia> a2 = hom(F2, G, V2) -F2 -> G -e[1] -> y*e[1] + z*e[2] Homogeneous module homomorphism + from graded free module Rg^1([-2]) of rank 1 over Rg + to graded free module Rg^2([-1]) of rank 2 over Rg +defined by + e[1] -> y*e[1] + z*e[2] julia> V = subquotient(a1,a2) Graded subquotient of submodule of G generated by @@ -356,15 +360,19 @@ subquotient(A::MatElem{T}, B::MatElem{T}) where {T} = SubquoModule(A, B) function show(io::IO, SQ::SubquoModule) @show_name(io, SQ) @show_special(io, SQ) - io_compact = IOContext(io, :compact => true) + io = pretty(io) + io_compact = IOContext(io, :compact => true, :supercompact => true) if is_graded(SQ) if isdefined(SQ, :quo) && !iszero(SQ.quo) print(io, "Graded subquotient") - print(io_compact, " of submodule of ", SQ.F, " generated by", SQ.sub, "\nby submodule of ", SQ.F, " generated by", SQ.quo) + println(io_compact, " of submodule of ", Lowercase(), SQ.F, + " generated by", Lowercase(), SQ.sub) + print(io_compact, "by submodule of ", Lowercase(), SQ.F, + " generated by", Lowercase(), SQ.quo) else - print(io_compact, "Graded submodule of ", SQ.F) - print(io_compact, SQ.sub, "\n") + print(io_compact, "Graded submodule of ", Lowercase(), SQ.F) + println(io_compact, Lowercase(), SQ.sub) print(io, "represented as subquotient with no relations") end else @@ -378,10 +386,11 @@ function show(io::IO, SQ::SubquoModule) # print(io, "represented as subquotient with no relations") # end if isdefined(SQ, :quo) && !iszero(SQ.quo) - print(io, "Subquotient of ", SQ.sub, "\nby ", SQ.quo) + println(io, "Subquotient of ", Lowercase(), SQ.sub, ) + print(io, "by ", Lowercase(), SQ.quo) else - print(io, SQ.sub, "\n") - print(io, "represented as subquotient with no relations.") + println(io, SQ.sub) + print(io, "represented as subquotient with no relations") end end end @@ -394,7 +403,7 @@ Show `SQ` as a subquotient of *matrices* `A` and `B`. function show_subquo(SQ::SubquoModule) #@show_name(io, SQ) #@show_special(io, SQ) - io_compact = IOContext(stdout, :compact => true) + io_compact = IOContext(stdout, :supercompact => true) if isdefined(SQ, :quo) if is_generated_by_standard_unit_vectors(SQ.sub) if is_graded(SQ) @@ -425,7 +434,7 @@ function show_subquo(SQ::SubquoModule) end function show_morphism_as_map(f::ModuleFPHom, print_non_zero_only = false) - io_compact = IOContext(stdout, :compact => true) + io_compact = IOContext(stdout, :supercompact => true) print(io_compact, domain(f), " -> ", codomain(f)) print("\n") D = domain(f) @@ -474,10 +483,10 @@ julia> W = R[y 0; x y; 0 z] julia> a = hom(F, G, W); julia> cokernel(a) -Subquotient of Submodule with 2 generators +Subquotient of submodule with 2 generators 1 -> e[1] 2 -> e[2] -by Submodule with 3 generators +by submodule with 3 generators 1 -> y*e[1] 2 -> x*e[1] + y*e[2] 3 -> z*e[2] @@ -498,10 +507,10 @@ julia> B = R[x^2; y^3; z^4] [z^4] julia> M = SubquoModule(F, A, B) -Subquotient of Submodule with 2 generators +Subquotient of submodule with 2 generators 1 -> x*e[1] 2 -> y*e[1] -by Submodule with 3 generators +by submodule with 3 generators 1 -> x^2*e[1] 2 -> y^3*e[1] 3 -> z^4*e[1] @@ -516,10 +525,10 @@ julia> V = [y^2*N[1], x*N[2]] julia> a = hom(M, N, V); julia> cokernel(a) -Subquotient of Submodule with 2 generators +Subquotient of submodule with 2 generators 1 -> x*e[1] 2 -> y*e[1] -by Submodule with 5 generators +by submodule with 5 generators 1 -> x^2*e[1] 2 -> y^3*e[1] 3 -> z^4*e[1] @@ -540,11 +549,13 @@ julia> W = Rg[y 0; x y; 0 z] [0 z] julia> a = hom(F, G, W) -F -> G -e[1] -> y*e[1] -e[2] -> x*e[1] + y*e[2] -e[3] -> z*e[2] Graded module homomorphism of degree [1] + from graded free module Rg^3([0]) of rank 3 over Rg + to graded free module Rg^2([0]) of rank 2 over Rg +defined by + e[1] -> y*e[1] + e[2] -> x*e[1] + y*e[2] + e[3] -> z*e[2] julia> M = cokernel(a) Graded subquotient of submodule of G generated by @@ -571,17 +582,17 @@ Return the cokernel of `A` as an object of type `SubquoModule` with ambient free julia> R, (x,y,z) = polynomial_ring(QQ, ["x", "y", "z"]); julia> F = free_module(R, 2) -Free module of rank 2 over Multivariate polynomial ring in 3 variables over QQ +Free module of rank 2 over multivariate polynomial ring julia> A = R[x y; 2*x^2 3*y^2] [ x y] [2*x^2 3*y^2] julia> M = cokernel(F, A) -Subquotient of Submodule with 2 generators +Subquotient of submodule with 2 generators 1 -> e[1] 2 -> e[2] -by Submodule with 2 generators +by submodule with 2 generators 1 -> x*e[1] + y*e[2] 2 -> 2*x^2*e[1] + 3*y^2*e[2] @@ -635,10 +646,10 @@ julia> A = R[x y; 2*x^2 3*y^2] [2*x^2 3*y^2] julia> M = cokernel(A) -Subquotient of Submodule with 2 generators +Subquotient of submodule with 2 generators 1 -> e[1] 2 -> e[2] -by Submodule with 2 generators +by submodule with 2 generators 1 -> x*e[1] + y*e[2] 2 -> 2*x^2*e[1] + 3*y^2*e[2] @@ -658,7 +669,7 @@ Return the image of `A` as an object of type `SubquoModule` with ambient free mo julia> R, (x,y,z) = polynomial_ring(QQ, ["x", "y", "z"]); julia> F = free_module(R, 2) -Free module of rank 2 over Multivariate polynomial ring in 3 variables over QQ +Free module of rank 2 over multivariate polynomial ring julia> A = R[x y; 2*x^2 3*y^2] [ x y] @@ -668,7 +679,7 @@ julia> M = image(F, A) Submodule with 2 generators 1 -> x*e[1] + y*e[2] 2 -> 2*x^2*e[1] + 3*y^2*e[2] -represented as subquotient with no relations. +represented as subquotient with no relations julia> ambient_free_module(M) === F true @@ -720,7 +731,7 @@ julia> M = image(A) Submodule with 2 generators 1 -> x*e[1] + y*e[2] 2 -> 2*x^2*e[1] + 3*y^2*e[2] -represented as subquotient with no relations. +represented as subquotient with no relations ``` """ function image(A::MatElem) @@ -838,7 +849,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> F = free_module(R, 1) -Free module of rank 1 over Multivariate polynomial ring in 3 variables over QQ +Free module of rank 1 over multivariate polynomial ring julia> AM = R[x;] [x] @@ -849,9 +860,9 @@ julia> BM = R[x^2; y^3; z^4] [z^4] julia> M = SubquoModule(F, AM, BM) -Subquotient of Submodule with 1 generator +Subquotient of submodule with 1 generator 1 -> x*e[1] -by Submodule with 3 generators +by submodule with 3 generators 1 -> x^2*e[1] 2 -> y^3*e[1] 3 -> z^4*e[1] @@ -866,10 +877,10 @@ julia> BN = R[x^2+y^4; y^3; z^4] [ z^4] julia> N = SubquoModule(F, AN, BN) -Subquotient of Submodule with 2 generators +Subquotient of submodule with 2 generators 1 -> x*e[1] 2 -> y*e[1] -by Submodule with 3 generators +by submodule with 3 generators 1 -> (x^2 + y^4)*e[1] 2 -> y^3*e[1] 3 -> z^4*e[1] @@ -966,7 +977,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> F = free_module(R, 1) -Free module of rank 1 over Multivariate polynomial ring in 3 variables over QQ +Free module of rank 1 over multivariate polynomial ring julia> AM = R[x;] [x] @@ -977,9 +988,9 @@ julia> BM = R[x^2; y^3; z^4] [z^4] julia> M = SubquoModule(F, AM, BM) -Subquotient of Submodule with 1 generator +Subquotient of submodule with 1 generator 1 -> x*e[1] -by Submodule with 3 generators +by submodule with 3 generators 1 -> x^2*e[1] 2 -> y^3*e[1] 3 -> z^4*e[1] @@ -994,10 +1005,10 @@ julia> BN = R[x^2+y^4; y^3; z^4] [ z^4] julia> N = SubquoModule(F, AN, BN) -Subquotient of Submodule with 2 generators +Subquotient of submodule with 2 generators 1 -> x*e[1] 2 -> y*e[1] -by Submodule with 3 generators +by submodule with 3 generators 1 -> (x^2 + y^4)*e[1] 2 -> y^3*e[1] 3 -> z^4*e[1] @@ -1129,10 +1140,7 @@ Graded submodule of F2 represented as subquotient with no relations julia> is_canonically_isomorphic_with_map(M1, M2) -(true, M1 -> M2 -x^3*e[1] + x^2*e[2] + x*e[3] -> x^3*e[1] + x*e[2] + x^2*e[3] -(2*x^4 + x^3*y)*e[1] + (x^3 + 2*x*y^2)*e[2] + x^2*e[3] -> (2*x^4 + x^3*y)*e[1] + x^2*e[2] + (x^3 + 2*x*y^2)*e[3] -Homogeneous module homomorphism) +(true, Hom: M1 -> M2) ``` """ @@ -1165,7 +1173,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> F = free_module(R, 1) -Free module of rank 1 over Multivariate polynomial ring in 3 variables over QQ +Free module of rank 1 over multivariate polynomial ring julia> AM = R[x;] [x] @@ -1176,9 +1184,9 @@ julia> BM = R[x^2; y^3; z^4] [z^4] julia> M = SubquoModule(F, AM, BM) -Subquotient of Submodule with 1 generator +Subquotient of submodule with 1 generator 1 -> x*e[1] -by Submodule with 3 generators +by submodule with 3 generators 1 -> x^2*e[1] 2 -> y^3*e[1] 3 -> z^4*e[1] @@ -1192,9 +1200,9 @@ julia> BN = R[x^2; y^3; z^4] [z^4] julia> N = SubquoModule(F, AN, BN) -Subquotient of Submodule with 1 generator +Subquotient of submodule with 1 generator 1 -> y*e[1] -by Submodule with 3 generators +by submodule with 3 generators 1 -> x^2*e[1] 2 -> y^3*e[1] 3 -> z^4*e[1] @@ -1202,53 +1210,45 @@ by Submodule with 3 generators julia> O = sum(M, N); julia> O[1] -Subquotient of Submodule with 2 generators +Subquotient of submodule with 2 generators 1 -> x*e[1] 2 -> y*e[1] -by Submodule with 3 generators +by submodule with 3 generators 1 -> x^2*e[1] 2 -> y^3*e[1] 3 -> z^4*e[1] julia> O[2] -Map with following data -Domain: -======= -Subquotient of Submodule with 1 generator -1 -> x*e[1] -by Submodule with 3 generators -1 -> x^2*e[1] -2 -> y^3*e[1] -3 -> z^4*e[1] -Codomain: -========= -Subquotient of Submodule with 2 generators -1 -> x*e[1] -2 -> y*e[1] -by Submodule with 3 generators -1 -> x^2*e[1] -2 -> y^3*e[1] -3 -> z^4*e[1] +Module homomorphism + from subquotient of submodule with 1 generator + 1 -> x*e[1] + by submodule with 3 generators + 1 -> x^2*e[1] + 2 -> y^3*e[1] + 3 -> z^4*e[1] + to subquotient of submodule with 2 generators + 1 -> x*e[1] + 2 -> y*e[1] + by submodule with 3 generators + 1 -> x^2*e[1] + 2 -> y^3*e[1] + 3 -> z^4*e[1] julia> O[3] -Map with following data -Domain: -======= -Subquotient of Submodule with 1 generator -1 -> y*e[1] -by Submodule with 3 generators -1 -> x^2*e[1] -2 -> y^3*e[1] -3 -> z^4*e[1] -Codomain: -========= -Subquotient of Submodule with 2 generators -1 -> x*e[1] -2 -> y*e[1] -by Submodule with 3 generators -1 -> x^2*e[1] -2 -> y^3*e[1] -3 -> z^4*e[1] +Module homomorphism + from subquotient of submodule with 1 generator + 1 -> y*e[1] + by submodule with 3 generators + 1 -> x^2*e[1] + 2 -> y^3*e[1] + 3 -> z^4*e[1] + to subquotient of submodule with 2 generators + 1 -> x*e[1] + 2 -> y*e[1] + by submodule with 3 generators + 1 -> x^2*e[1] + 2 -> y^3*e[1] + 3 -> z^4*e[1] ``` ```jldoctest @@ -1287,23 +1287,19 @@ julia> sum(M, N) by submodule of F generated by 1 -> x^2*e[1] 2 -> y^3*e[1] -3 -> z^4*e[1], M -> Graded subquotient of submodule of F generated by +3 -> z^4*e[1], Hom: M -> graded subquotient of submodule of F generated by 1 -> x*e[1] 2 -> y*e[1] by submodule of F generated by 1 -> x^2*e[1] 2 -> y^3*e[1] -3 -> z^4*e[1] -x*e[1] -> x*e[1] -Homogeneous module homomorphism, N -> Graded subquotient of submodule of F generated by +3 -> z^4*e[1], Hom: N -> graded subquotient of submodule of F generated by 1 -> x*e[1] 2 -> y*e[1] by submodule of F generated by 1 -> x^2*e[1] 2 -> y^3*e[1] -3 -> z^4*e[1] -y*e[1] -> y*e[1] -Homogeneous module homomorphism) +3 -> z^4*e[1]) ``` """ @@ -1347,7 +1343,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> F = free_module(R, 1) -Free module of rank 1 over Multivariate polynomial ring in 3 variables over QQ +Free module of rank 1 over multivariate polynomial ring julia> AM = R[x;] [x] @@ -1358,9 +1354,9 @@ julia> BM = R[x^2; y^3; z^4] [z^4] julia> M = SubquoModule(F, AM, BM) -Subquotient of Submodule with 1 generator +Subquotient of submodule with 1 generator 1 -> x*e[1] -by Submodule with 3 generators +by submodule with 3 generators 1 -> x^2*e[1] 2 -> y^3*e[1] 3 -> z^4*e[1] @@ -1374,18 +1370,18 @@ julia> BN = R[x^2; y^3; z^4] [z^4] julia> N = SubquoModule(F, AN, BN) -Subquotient of Submodule with 1 generator +Subquotient of submodule with 1 generator 1 -> y*e[1] -by Submodule with 3 generators +by submodule with 3 generators 1 -> x^2*e[1] 2 -> y^3*e[1] 3 -> z^4*e[1] julia> O = M + N -Subquotient of Submodule with 2 generators +Subquotient of submodule with 2 generators 1 -> x*e[1] 2 -> y*e[1] -by Submodule with 3 generators +by submodule with 3 generators 1 -> x^2*e[1] 2 -> y^3*e[1] 3 -> z^4*e[1] @@ -1450,7 +1446,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> F = free_module(R, 1) -Free module of rank 1 over Multivariate polynomial ring in 3 variables over QQ +Free module of rank 1 over multivariate polynomial ring julia> AM = R[x;] [x] @@ -1461,9 +1457,9 @@ julia> BM = R[x^2; y^3; z^4] [z^4] julia> M = SubquoModule(F, AM, BM) -Subquotient of Submodule with 1 generator +Subquotient of submodule with 1 generator 1 -> x*e[1] -by Submodule with 3 generators +by submodule with 3 generators 1 -> x^2*e[1] 2 -> y^3*e[1] 3 -> z^4*e[1] @@ -1477,55 +1473,33 @@ julia> BN = R[x^2; y^3; z^4] [z^4] julia> N = SubquoModule(F, AN, BN) -Subquotient of Submodule with 1 generator +Subquotient of submodule with 1 generator 1 -> y*e[1] -by Submodule with 3 generators +by submodule with 3 generators 1 -> x^2*e[1] 2 -> y^3*e[1] 3 -> z^4*e[1] julia> intersect(M, N) -(Subquotient of Submodule with 2 generators +(Subquotient of submodule with 2 generators 1 -> -x*y*e[1] 2 -> x*z^4*e[1] -by Submodule with 3 generators +by submodule with 3 generators 1 -> x^2*e[1] 2 -> y^3*e[1] -3 -> z^4*e[1], Map with following data -Domain: -======= -Subquotient of Submodule with 2 generators +3 -> z^4*e[1], Hom: subquotient of 1 -> -x*y*e[1] 2 -> x*z^4*e[1] -by Submodule with 3 generators -1 -> x^2*e[1] -2 -> y^3*e[1] -3 -> z^4*e[1] -Codomain: -========= -Subquotient of Submodule with 1 generator -1 -> x*e[1] -by Submodule with 3 generators +by 1 -> x^2*e[1] 2 -> y^3*e[1] -3 -> z^4*e[1], Map with following data -Domain: -======= -Subquotient of Submodule with 2 generators +3 -> z^4*e[1] -> M, Hom: subquotient of 1 -> -x*y*e[1] 2 -> x*z^4*e[1] -by Submodule with 3 generators -1 -> x^2*e[1] -2 -> y^3*e[1] -3 -> z^4*e[1] -Codomain: -========= -Subquotient of Submodule with 1 generator -1 -> y*e[1] -by Submodule with 3 generators +by 1 -> x^2*e[1] 2 -> y^3*e[1] -3 -> z^4*e[1]) +3 -> z^4*e[1] -> N) ``` ```jldoctest @@ -1564,25 +1538,19 @@ julia> intersect(M, N) by submodule of F generated by 1 -> x^2*e[1] 2 -> y^3*e[1] -3 -> z^4*e[1], Graded subquotient of submodule of F generated by +3 -> z^4*e[1], Hom: graded subquotient of submodule of F generated by 1 -> -x*y*e[1] 2 -> x*z^4*e[1] by submodule of F generated by 1 -> x^2*e[1] 2 -> y^3*e[1] -3 -> z^4*e[1] -> M --x*y*e[1] -> -x*y*e[1] -x*z^4*e[1] -> x*z^4*e[1] -Homogeneous module homomorphism, Graded subquotient of submodule of F generated by +3 -> z^4*e[1] -> M, Hom: graded subquotient of submodule of F generated by 1 -> -x*y*e[1] 2 -> x*z^4*e[1] by submodule of F generated by 1 -> x^2*e[1] 2 -> y^3*e[1] -3 -> z^4*e[1] -> N --x*y*e[1] -> x*y*e[1] -x*z^4*e[1] -> 0 -Homogeneous module homomorphism) +3 -> z^4*e[1] -> N) ``` """ diff --git a/src/Modules/UngradedModules/SubquoModuleElem.jl b/src/Modules/UngradedModules/SubquoModuleElem.jl index 0de3819bd670..9e341e9d0062 100644 --- a/src/Modules/UngradedModules/SubquoModuleElem.jl +++ b/src/Modules/UngradedModules/SubquoModuleElem.jl @@ -543,20 +543,16 @@ Submodule with 3 generators 1 -> x^2*e[1] 2 -> y^3*e[1] 3 -> z^4*e[1] -represented as subquotient with no relations. +represented as subquotient with no relations julia> incl -Map with following data -Domain: -======= -Submodule with 3 generators -1 -> x^2*e[1] -2 -> y^3*e[1] -3 -> z^4*e[1] -represented as subquotient with no relations. -Codomain: -========= -Free module of rank 1 over Multivariate polynomial ring in 3 variables over QQ +Module homomorphism + from submodule with 3 generators + 1 -> x^2*e[1] + 2 -> y^3*e[1] + 3 -> z^4*e[1] + represented as subquotient with no relations + to free module of rank 1 over multivariate polynomial ring ``` """ function sub(M::ModuleFP{T}, V::Vector{<:ModuleFPElem{T}}, task::Symbol = :with_morphism) where T @@ -711,26 +707,22 @@ julia> V = [x^2*F[1]; y^3*F[1]; z^4*F[1]]; julia> N, proj = quo(F, V); julia> N -Subquotient of Submodule with 1 generator +Subquotient of submodule with 1 generator 1 -> e[1] -by Submodule with 3 generators +by submodule with 3 generators 1 -> x^2*e[1] 2 -> y^3*e[1] 3 -> z^4*e[1] julia> proj -Map with following data -Domain: -======= -Free module of rank 1 over Multivariate polynomial ring in 3 variables over QQ -Codomain: -========= -Subquotient of Submodule with 1 generator -1 -> e[1] -by Submodule with 3 generators -1 -> x^2*e[1] -2 -> y^3*e[1] -3 -> z^4*e[1] +Module homomorphism + from free module of rank 1 over multivariate polynomial ring + to subquotient of submodule with 1 generator + 1 -> e[1] + by submodule with 3 generators + 1 -> x^2*e[1] + 2 -> y^3*e[1] + 3 -> z^4*e[1] ``` """ function quo(M::ModuleFP{T}, V::Vector{<:ModuleFPElem{T}}, task::Symbol = :with_morphism) where T @@ -873,7 +865,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> F = free_module(R, 1) -Free module of rank 1 over Multivariate polynomial ring in 3 variables over QQ +Free module of rank 1 over multivariate polynomial ring julia> A = R[x^2+y^2;] [x^2 + y^2] @@ -884,9 +876,9 @@ julia> B = R[x^2; y^3; z^4] [z^4] julia> M = SubquoModule(F, A, B) -Subquotient of Submodule with 1 generator +Subquotient of submodule with 1 generator 1 -> (x^2 + y^2)*e[1] -by Submodule with 3 generators +by submodule with 3 generators 1 -> x^2*e[1] 2 -> y^3*e[1] 3 -> z^4*e[1] @@ -939,7 +931,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> F = free_module(R, 1) -Free module of rank 1 over Multivariate polynomial ring in 3 variables over QQ +Free module of rank 1 over multivariate polynomial ring julia> A = R[x; y] [x] @@ -951,10 +943,10 @@ julia> B = R[x^2; y^3; z^4] [z^4] julia> M = SubquoModule(F, A, B) -Subquotient of Submodule with 2 generators +Subquotient of submodule with 2 generators 1 -> x*e[1] 2 -> y*e[1] -by Submodule with 3 generators +by submodule with 3 generators 1 -> x^2*e[1] 2 -> y^3*e[1] 3 -> z^4*e[1] diff --git a/src/Modules/homological-algebra.jl b/src/Modules/homological-algebra.jl index 9e11e5215e34..13f85639dbc5 100644 --- a/src/Modules/homological-algebra.jl +++ b/src/Modules/homological-algebra.jl @@ -31,10 +31,10 @@ julia> U = matrix([x^3-y^2 o; o x^3-y^2; -x^2 y; -y x]) [ -y x] julia> M = quo(F,U)[1] -Subquotient of Submodule with 2 generators +Subquotient of submodule with 2 generators 1 -> e[1] 2 -> e[2] -by Submodule with 4 generators +by submodule with 4 generators 1 -> (x^3 - y^2)*e[1] 2 -> (x^3 - y^2)*e[2] 3 -> -x^2*e[1] + y*e[2] @@ -106,10 +106,10 @@ julia> U = matrix([x^3-y^2 o; o x^3-y^2; -x^2 y; -y x]) [ -y x] julia> M = quo(F,U)[1] -Subquotient of Submodule with 2 generators +Subquotient of submodule with 2 generators 1 -> e[1] 2 -> e[2] -by Submodule with 4 generators +by submodule with 4 generators 1 -> (x^3 - y^2)*e[1] 2 -> (x^3 - y^2)*e[2] 3 -> -x^2*e[1] + y*e[2] @@ -163,10 +163,10 @@ julia> U = matrix([x^3-y^2 o; o x^3-y^2; -x^2 y; -y x]) [ -y x] julia> M = quo(F,U)[1] -Subquotient of Submodule with 2 generators +Subquotient of submodule with 2 generators 1 -> e[1] 2 -> e[2] -by Submodule with 4 generators +by submodule with 4 generators 1 -> (x^3 - y^2)*e[1] 2 -> (x^3 - y^2)*e[2] 3 -> -x^2*e[1] + y*e[2] @@ -295,26 +295,26 @@ julia> V = [x*y, x*z, y*z] y*z julia> koszul_homology(V, F, 0) -Subquotient of Submodule with 1 generator +Subquotient of submodule with 1 generator 1 -> e[1]∧e[2]∧e[3] -by Submodule with 3 generators +by submodule with 3 generators 1 -> y*z*e[1]∧e[2]∧e[3] 2 -> -x*z*e[1]∧e[2]∧e[3] 3 -> x*y*e[1]∧e[2]∧e[3] julia> koszul_homology(V, F, 1) -Subquotient of Submodule with 2 generators +Subquotient of submodule with 2 generators 1 -> y*e[1]∧e[3] \otimes e[1] + z*e[2]∧e[3] \otimes e[1] 2 -> x*e[1]∧e[2] \otimes e[1] - z*e[2]∧e[3] \otimes e[1] -by Submodule with 3 generators +by submodule with 3 generators 1 -> -x*z*e[1]∧e[2] \otimes e[1] - y*z*e[1]∧e[3] \otimes e[1] 2 -> x*y*e[1]∧e[2] \otimes e[1] - y*z*e[2]∧e[3] \otimes e[1] 3 -> x*y*e[1]∧e[3] \otimes e[1] + x*z*e[2]∧e[3] \otimes e[1] julia> koszul_homology(V, F, 2) -Subquotient of Submodule with 1 generator +Subquotient of submodule with 1 generator 1 -> x*y*e[1] \otimes e[1] + x*z*e[2] \otimes e[1] + y*z*e[3] \otimes e[1] -by Submodule with 1 generator +by submodule with 1 generator 1 -> x*y*e[1] \otimes e[1] + x*z*e[2] \otimes e[1] + y*z*e[3] \otimes e[1] ``` @@ -326,26 +326,26 @@ julia> TC = ideal(R, [x*z-y^2, w*z-x*y, w*y-x^2]); julia> F = free_module(R, 1); julia> koszul_homology(gens(TC), F, 0) -Subquotient of Submodule with 1 generator +Subquotient of submodule with 1 generator 1 -> e[1]∧e[2]∧e[3] -by Submodule with 3 generators +by submodule with 3 generators 1 -> (w*y - x^2)*e[1]∧e[2]∧e[3] 2 -> (-w*z + x*y)*e[1]∧e[2]∧e[3] 3 -> (x*z - y^2)*e[1]∧e[2]∧e[3] julia> koszul_homology(gens(TC), F, 1) -Subquotient of Submodule with 2 generators +Subquotient of submodule with 2 generators 1 -> z*e[1]∧e[2] \otimes e[1] + y*e[1]∧e[3] \otimes e[1] + x*e[2]∧e[3] \otimes e[1] 2 -> y*e[1]∧e[2] \otimes e[1] + x*e[1]∧e[3] \otimes e[1] + w*e[2]∧e[3] \otimes e[1] -by Submodule with 3 generators +by submodule with 3 generators 1 -> (-w*z + x*y)*e[1]∧e[2] \otimes e[1] + (-w*y + x^2)*e[1]∧e[3] \otimes e[1] 2 -> (x*z - y^2)*e[1]∧e[2] \otimes e[1] + (-w*y + x^2)*e[2]∧e[3] \otimes e[1] 3 -> (x*z - y^2)*e[1]∧e[3] \otimes e[1] + (w*z - x*y)*e[2]∧e[3] \otimes e[1] julia> koszul_homology(gens(TC), F, 2) -Subquotient of Submodule with 1 generator +Subquotient of submodule with 1 generator 1 -> (-x*z + y^2)*e[1] \otimes e[1] + (-w*z + x*y)*e[2] \otimes e[1] + (-w*y + x^2)*e[3] \otimes e[1] -by Submodule with 1 generator +by submodule with 1 generator 1 -> (x*z - y^2)*e[1] \otimes e[1] + (w*z - x*y)*e[2] \otimes e[1] + (w*y - x^2)*e[3] \otimes e[1] ``` """ diff --git a/src/Rings/orderings.jl b/src/Rings/orderings.jl index 2a627f5e0208..f5a72a323d4a 100644 --- a/src/Rings/orderings.jl +++ b/src/Rings/orderings.jl @@ -1541,7 +1541,7 @@ julia> cmp(lex([x,y,z]), z, one(R)) 1 julia> F = free_module(R, 2) -Free module of rank 2 over Multivariate polynomial ring in 3 variables over QQ +Free module of rank 2 over multivariate polynomial ring julia> cmp(lex(R)*invlex(F), F[1], F[2]) -1 @@ -1826,7 +1826,7 @@ Return the ring ordering induced by `ord`. julia> R, (w, x, y, z) = polynomial_ring(QQ, ["w", "x", "y", "z"]); julia> F = free_module(R, 3) -Free module of rank 3 over Multivariate polynomial ring in 4 variables over QQ +Free module of rank 3 over multivariate polynomial ring julia> o = invlex(gens(F))*degrevlex(R) invlex([gen(1), gen(2), gen(3)])*degrevlex([w, x, y, z]) diff --git a/test/Modules/ExteriorPowers.jl b/test/Modules/ExteriorPowers.jl index 8030b98c2004..9f0f18cf9ff8 100644 --- a/test/Modules/ExteriorPowers.jl +++ b/test/Modules/ExteriorPowers.jl @@ -130,7 +130,7 @@ end u = (F[1], F[4], F[3]) @test "$(mm(v))" == "e[1]∧e[3]∧e[4]" - @test "$(F3)" == "⋀^3(Free module of rank 5 over Multivariate polynomial ring in 5 variables over QQ)" + @test "$(F3)" == "⋀^3(Free module of rank 5 over multivariate polynomial ring)" eu = sum(f*e for (f, e) in zip(gens(R), gens(F))) K = koszul_complex(eu)