diff --git a/experimental/MatroidRealizationSpaces/test/runtests.jl b/experimental/MatroidRealizationSpaces/test/runtests.jl index 3f1fbe1653e8..08f30d49d9e0 100644 --- a/experimental/MatroidRealizationSpaces/test/runtests.jl +++ b/experimental/MatroidRealizationSpaces/test/runtests.jl @@ -119,7 +119,7 @@ end @test X isa AbsSpec @test !isdefined(X, :underlying_scheme) R = OO(X) - @test R isa MPolyQuoLocRing + @test R isa Oscar.MPolyQuoLocRing f = sum(gens(R)) U = PrincipalOpenSubset(X, f) @test U isa AbsSpec diff --git a/src/AlgebraicGeometry/Schemes/AffineSchemes/Objects/Attributes.jl b/src/AlgebraicGeometry/Schemes/AffineSchemes/Objects/Attributes.jl index 0290bf7b3632..3b772f28b047 100644 --- a/src/AlgebraicGeometry/Schemes/AffineSchemes/Objects/Attributes.jl +++ b/src/AlgebraicGeometry/Schemes/AffineSchemes/Objects/Attributes.jl @@ -543,7 +543,7 @@ Spectrum over rational field by ideal(x^2 - 2*x*y + y^2) -julia> U = MPolyComplementOfKPointIdeal(R,[0,0]) +julia> U = complement_of_point_ideal(R, [0,0]) Complement of maximal ideal corresponding to rational point with coordinates (0, 0) in multivariate polynomial ring in 2 variables over QQ @@ -646,7 +646,7 @@ julia> singular_locus(A3) julia> singular_locus(X) (V(x^2 - y^2 + z^2, z, y, x), Hom: V(x^2 - y^2 + z^2, z, y, x) -> V(x^2 - y^2 + z^2)) -julia> U = MPolyComplementOfKPointIdeal(R,[0,0,0]) +julia> U = complement_of_point_ideal(R, [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 diff --git a/src/AlgebraicGeometry/Schemes/AffineSchemes/Objects/Properties.jl b/src/AlgebraicGeometry/Schemes/AffineSchemes/Objects/Properties.jl index 40f45bcdbe01..fdcabcd34dcd 100644 --- a/src/AlgebraicGeometry/Schemes/AffineSchemes/Objects/Properties.jl +++ b/src/AlgebraicGeometry/Schemes/AffineSchemes/Objects/Properties.jl @@ -666,7 +666,7 @@ Spectrum julia> is_smooth(Y) false -julia> U = MPolyComplementOfKPointIdeal(R,[1,1]) +julia> U = complement_of_point_ideal(R, [1,1]) Complement of maximal ideal corresponding to rational point with coordinates (1, 1) in multivariate polynomial ring in 2 variables over QQ diff --git a/src/Modules/Posur.jl b/src/Modules/Posur.jl index d38661f25a9f..cc2e94a84d29 100644 --- a/src/Modules/Posur.jl +++ b/src/Modules/Posur.jl @@ -156,7 +156,7 @@ recommended to choose ``f`` to be the 'least complex' in an appropriate sense for ``R``. """ function has_nonempty_intersection(U::AbsMultSet, I::Ideal) - R = ambient_ring(U) + R = ring(U) R == base_ring(I) || error("the multiplicative set and the ideal must be defined over the same ring") error("this method is not implemented for multiplicative sets of type $(typeof(U)) and ideals of type $(typeof(I)); see Posur: Linear systems over localizations of rings, arXiv:1709.08180v2, Definition 3.8 for the requirements of the implementation") end @@ -201,7 +201,7 @@ function has_solution( } R = base_ring(A) R === base_ring(b) || error("matrices must be defined over the same ring") - R === ambient_ring(U) || error("multiplicative set must be defined over the same ring as the matrices") + R === ring(U) || error("multiplicative set must be defined over the same ring as the matrices") m = nrows(A) nrows(b) == 1 || error("can not solve for more than one row vector") n = ncols(A) diff --git a/src/Modules/mpoly-localizations.jl b/src/Modules/mpoly-localizations.jl index e6246c189079..644aeaaa88f0 100644 --- a/src/Modules/mpoly-localizations.jl +++ b/src/Modules/mpoly-localizations.jl @@ -10,7 +10,7 @@ function has_nonempty_intersection(U::MPolyPowersOfElement, I::MPolyIdeal; check::Bool=true) - R = ambient_ring(U) + R = ring(U) R == base_ring(I) || error("the multiplicative set and the ideal must be defined over the same ring") d = prod(denominators(U); init=one(R)) @@ -22,7 +22,7 @@ function has_nonempty_intersection(U::MPolyPowersOfElement, I::MPolyIdeal; check end function has_nonempty_intersection(U::MPolyComplementOfPrimeIdeal, I::MPolyIdeal; check::Bool=true) - R = ambient_ring(U) + R = ring(U) R == base_ring(I) || error("the multiplicative set and the ideal must be defined over the same ring") P = prime_ideal(U) candidates = [(f, i) for (f, i) in zip(gens(I), 1:ngens(I)) if !(f in P)] @@ -40,7 +40,7 @@ function has_nonempty_intersection(U::MPolyComplementOfPrimeIdeal, I::MPolyIdeal end function has_nonempty_intersection(U::MPolyComplementOfKPointIdeal, I::MPolyIdeal; check::Bool=true) - R = ambient_ring(U) + R = ring(U) R == base_ring(I) || error("the multiplicative set and the ideal must be defined over the same ring") a = point_coordinates(U) candidates = [(f, i) for (f, i) in zip(gens(I), 1:ngens(I)) if !(iszero(evaluate(f, a)))] @@ -59,7 +59,7 @@ end function has_nonempty_intersection(U::MPolyProductOfMultSets, I::MPolyIdeal; check::Bool=true) J = I - R = ambient_ring(U) + R = ring(U) R == base_ring(I) || error("rings not compatible") Usets = sets(U) if length(Usets) == 1 @@ -202,4 +202,4 @@ the shift map ``Ī¦ : R ā†’ R`` which is moving the point of ``š”Ŗ`` to the orig Mp_gens_shift = shift.(gens(Mp)) result = SubModuleOfFreeModule(F_shifted,Mp_gens_shift) return result -end \ No newline at end of file +end diff --git a/src/Rings/localization_interface.jl b/src/Rings/localization_interface.jl index bef27cf6874f..94200dd6d0fc 100644 --- a/src/Rings/localization_interface.jl +++ b/src/Rings/localization_interface.jl @@ -19,12 +19,12 @@ abstract type AbsMultSet{RingType<:Ring, RingElemType<:RingElem} end ### required getter functions @doc raw""" - ambient_ring(S::AbsMultSet) + ring(S::AbsMultSet) Return the ambient ring `R` for a multiplicatively closed set `S āŠ‚ R`. """ -function ambient_ring(S::AbsMultSet) - error("method `ambient_ring` not implemented for multiplicatively closed sets of type $(typeof(S))") +function ring(S::AbsMultSet) + error("method `ring` not implemented for multiplicatively closed sets of type $(typeof(S))") end ### required functionality @@ -41,7 +41,7 @@ julia> R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]) julia> P = ideal(R, [x]) ideal(x) -julia> U = MPolyComplementOfPrimeIdeal(P) +julia> U = complement_of_prime_ideal(P) Complement of prime ideal(x) in multivariate polynomial ring in 3 variables over QQ @@ -59,7 +59,7 @@ end # of the multiplicative set whenever possible. For instance, this is # used to check well-definedness of homomorphisms from localized rings. # By default, however, this iteration does nothing. -Base.iterate(U::T) where {T<:AbsMultSet} = (one(ambient_ring(U)), 1) +Base.iterate(U::T) where {T<:AbsMultSet} = (one(ring(U)), 1) Base.iterate(U::T, a::Tuple{<:RingElem, Int}) where {T<:AbsMultSet} = nothing Base.iterate(U::T, i::Int) where {T<:AbsMultSet} = nothing @@ -98,13 +98,14 @@ julia> R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]) julia> P = ideal(R, [x]) ideal(x) -julia> U = MPolyComplementOfPrimeIdeal(P) +julia> U = complement_of_prime_ideal(P) Complement of prime ideal(x) in multivariate polynomial ring in 3 variables over QQ julia> Rloc, _ = localization(U); + julia> R === base_ring(Rloc) true ``` @@ -126,13 +127,14 @@ julia> R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]) julia> P = ideal(R, [x]) ideal(x) -julia> U = MPolyComplementOfPrimeIdeal(P) +julia> U = complement_of_prime_ideal(P) Complement of prime ideal(x) in multivariate polynomial ring in 3 variables over QQ julia> Rloc, _ = localization(U); + julia> U === inverted_set(Rloc) true ``` @@ -160,13 +162,14 @@ julia> R, (x, y, z) = polynomial_ring(QQ, ["x", "y", "z"]) julia> P = ideal(R, [x]) ideal(x) -julia> U = MPolyComplementOfPrimeIdeal(P) +julia> U = complement_of_prime_ideal(P) 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 x, y, z @@ -188,7 +191,7 @@ function localization(S::AbsMultSet) end function localization(R::Ring, U::AbsMultSet) - R == ambient_ring(U) || error("ring and multiplicative set are incompatible") + R == ring(U) || error("ring and multiplicative set are incompatible") return localization(U) end diff --git a/src/Rings/mpoly-localizations.jl b/src/Rings/mpoly-localizations.jl index c83a01e4cf2d..fca7eb32c03f 100644 --- a/src/Rings/mpoly-localizations.jl +++ b/src/Rings/mpoly-localizations.jl @@ -70,7 +70,7 @@ mutable struct MPolyPowersOfElement{ end ### required getter functions -ambient_ring(S::MPolyPowersOfElement) = S.R +ring(S::MPolyPowersOfElement) = S.R ### additional constructors MPolyPowersOfElement(f::RET) where {RET<:MPolyRingElem} = MPolyPowersOfElement(parent(f), [f]) @@ -85,7 +85,7 @@ function Base.in( S::MPolyPowersOfElement{BaseRingType, BaseRingElemType, RingType, RingElemType} ) where {BaseRingType, BaseRingElemType, RingType, RingElemType} R = parent(f) - R == ambient_ring(S) || return false + R === ring(S) || return false if iszero(f) return false end @@ -102,7 +102,7 @@ Base.iterate(U::MPolyPowersOfElement) = (length(U.a)>0 ? (U.a[1], 1) : nothing) Base.iterate(U::MPolyPowersOfElement, a::Tuple{<:MPolyRingElem, Int}) = (a[2] < length(U.a) ? (U.a[a[2]+1], a[2]+1) : nothing) Base.iterate(U::MPolyPowersOfElement, i::Int) = (i < length(U.a) ? (U.a[i+1], i+1) : nothing) -is_trivial(U::MPolyPowersOfElement) = (U == units_of(ambient_ring(U))) +is_trivial(U::MPolyPowersOfElement) = (U == units_of(ring(U))) ### printing @@ -110,7 +110,7 @@ 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)) + println(io, "of ", Lowercase(), ring(S)) print(io, "given by the products of ") print(io, "[") join(io, denominators(S), ", ") @@ -132,19 +132,19 @@ end ### generation of random elements function rand(S::MPolyPowersOfElement, v1::AbstractUnitRange{Int}, v2::AbstractUnitRange{Int}, v3::AbstractUnitRange{Int}) - R = ambient_ring(S) + R = ring(S) return prod(f^rand(0:2) for f in denominators(S); init = one(R))::elem_type(R) end function rand(rng::Random.AbstractRNG, S::MPolyPowersOfElement, v1::AbstractUnitRange{Int}, v2::AbstractUnitRange{Int}, v3::AbstractUnitRange{Int}) - R = ambient_ring(S) + R = ring(S) return prod(f^rand(rng, 0:2) for f in denominators(S); init = one(R))::elem_type(R) end ### simplification. # Replaces each element d by its list of square free prime divisors. function simplify!(S::MPolyPowersOfElement) - R = ambient_ring(S) + R = ring(S) new_denom = Vector{elem_type(R)}() for d in denominators(S) for a in factor(d) @@ -156,7 +156,7 @@ function simplify!(S::MPolyPowersOfElement) end function simplify(S::MPolyPowersOfElement) - R = ambient_ring(S) + R = ring(S) new_denom = Vector{elem_type(R)}() for d in denominators(S) for a in factor(d) @@ -228,8 +228,7 @@ mutable struct MPolyComplementOfPrimeIdeal{ end ### required getter functions -ambient_ring( - S::MPolyComplementOfPrimeIdeal) = S.R +ring(S::MPolyComplementOfPrimeIdeal) = S.R ### required functionality function Base.in( @@ -247,7 +246,7 @@ 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, "in ", Lowercase(), ring(S)) print(io, Dedent()) end @@ -261,7 +260,7 @@ end ### generation of random elements function rand(S::MPolyComplementOfPrimeIdeal, v1::AbstractUnitRange{Int}, v2::AbstractUnitRange{Int}, v3::AbstractUnitRange{Int}) - f = rand(ambient_ring(S), v1, v2, v3) + f = rand(ring(S), v1, v2, v3) if f in prime_ideal(S) return rand(S, v1, v2, v3) end @@ -269,7 +268,7 @@ function rand(S::MPolyComplementOfPrimeIdeal, v1::AbstractUnitRange{Int}, v2::Ab end function rand(rng::Random.AbstractRNG, S::MPolyComplementOfPrimeIdeal, v1::AbstractUnitRange{Int}, v2::AbstractUnitRange{Int}, v3::AbstractUnitRange{Int}) - f = rand(rng, ambient_ring(S), v1, v2, v3) + f = rand(rng, ring(S), v1, v2, v3) if f in prime_ideal(S) return rand(rng, S, v1, v2, v3) end @@ -341,16 +340,16 @@ end # MPolyComplementOfPrimeIdeal. In order to treat them in # parallel, we introduce the analogous method here. function prime_ideal(S::MPolyComplementOfKPointIdeal) - kk = coefficient_ring(ambient_ring(S)) + kk = coefficient_ring(ring(S)) # TODO: Test whether kk is an integral domain if !isdefined(S, :m) - R = ambient_ring(S) + R = ring(S) x = gens(R) n = ngens(R) m = ideal(R, [x[i]-a for (i, a) in enumerate(point_coordinates(S))]) set_attribute!(m, :is_prime=>true) kk isa Field && set_attribute!(m, :is_maximal=>true) - set_attribute!(m, :dim=>dim(coefficient_ring(ambient_ring(S)))) + set_attribute!(m, :dim=>dim(coefficient_ring(ring(S)))) S.m = m end return S.m @@ -430,7 +429,7 @@ Multiplicative subset powers_of_element(f::MPolyRingElem) = MPolyPowersOfElement(f) ### required getter functions -ambient_ring(S::MPolyComplementOfKPointIdeal) = S.R +ring(S::MPolyComplementOfKPointIdeal) = S.R ### additional getter functions point_coordinates(S::MPolyComplementOfKPointIdeal) = S.a @@ -440,8 +439,8 @@ function Base.in( f::RingElemType, S::MPolyComplementOfKPointIdeal{BaseRingType, BaseRingElemType, RingType, RingElemType} ) where {BaseRingType, BaseRingElemType, RingType, RingElemType} - parent(f) == ambient_ring(S) || return false - return !(evaluate(f, point_coordinates(S)) == zero(ambient_ring(S))) + parent(f) == ring(S) || return false + return !(evaluate(f, point_coordinates(S)) == zero(ring(S))) end ### printing @@ -454,7 +453,7 @@ function Base.show(io::IO, ::MIME"text/plain", S::MPolyComplementOfKPointIdeal) join(io, point_coordinates(S), ", ") println(io, ")") print(io, Dedent()) - print(io, "in ", Lowercase(), ambient_ring(S)) + print(io, "in ", Lowercase(), ring(S)) print(io, Dedent()) end @@ -471,14 +470,14 @@ end ### generation of random elements function rand(S::MPolyComplementOfKPointIdeal, v1::AbstractUnitRange{Int}, v2::AbstractUnitRange{Int}, v3::AbstractUnitRange{Int}) - f = rand(ambient_ring(S), v1, v2, v3) + f = rand(ring(S), v1, v2, v3) if !(f in S) return rand(S, v1, v2, v3) end return f end function rand(rng::Random.AbstractRNG, S::MPolyComplementOfKPointIdeal, v1::AbstractUnitRange{Int}, v2::AbstractUnitRange{Int}, v3::AbstractUnitRange{Int}) - f = rand(rng, ambient_ring(S), v1, v2, v3) + f = rand(rng, ring(S), v1, v2, v3) if !(f in S) return rand(rng, S, v1, v2, v3) end @@ -509,7 +508,7 @@ julia> S = complement_of_point_ideal(R,[1,2]); julia> T = powers_of_element(x); -julia> ST = MPolyProductOfMultSets(R, [S, T]) +julia> ST = Oscar.MPolyProductOfMultSets(R, [S, T]) Product of the multiplicative sets complement of maximal ideal of point (1, 2) products of (x) @@ -535,14 +534,14 @@ mutable struct MPolyProductOfMultSets{ function MPolyProductOfMultSets(R::RT, U::Vector{<:AbsMPolyMultSet{BRT, BRET, RT, RET}}) where {BRT<:Ring, BRET<:RingElement, RT<:MPolyRing, RET<:MPolyRingElem} for s in U - ambient_ring(s) == R || error("multiplicative set does not live in the given ring") + ring(s) == R || error("multiplicative set does not live in the given ring") end return new{typeof(coefficient_ring(R)), elem_type(coefficient_ring(R)), typeof(R), elem_type(R)}(R, U) end end ### required getter functions -ambient_ring(S::MPolyProductOfMultSets) = S.R +ring(S::MPolyProductOfMultSets) = S.R ### additional functionality getindex(S::MPolyProductOfMultSets, i::Integer) = S.U[i] @@ -553,7 +552,7 @@ function Base.in( f::RingElemType, S::MPolyProductOfMultSets{BaseRingType, BaseRingElemType, RingType, RingElemType} ) where {BaseRingType, BaseRingElemType, RingType, RingElemType} - R = ambient_ring(S) + R = ring(S) divides(one(R), f)[1] && return true U = sets(S) for s in U @@ -604,10 +603,10 @@ end ### generation of random elements function rand(S::MPolyProductOfMultSets, v1::AbstractUnitRange{Int}, v2::AbstractUnitRange{Int}, v3::AbstractUnitRange{Int}) - return prod([rand(s, v1, v2, v3) for s in sets(S)])::elem_type(ambient_ring(S)) + return prod([rand(s, v1, v2, v3) for s in sets(S)])::elem_type(ring(S)) end function rand(rng::Random.AbstractRNG, S::MPolyProductOfMultSets, v1::AbstractUnitRange{Int}, v2::AbstractUnitRange{Int}, v3::AbstractUnitRange{Int}) - return prod([rand(rng, s, v1, v2, v3) for s in sets(S)])::elem_type(ambient_ring(S)) + return prod([rand(rng, s, v1, v2, v3) for s in sets(S)])::elem_type(ring(S)) end ######################################################################## @@ -653,7 +652,7 @@ mutable struct MPolyLeadingMonOne{ end ### required getter functions -ambient_ring(S::MPolyLeadingMonOne) = S.R +ring(S::MPolyLeadingMonOne) = S.R ### additional constructors MPolyLeadingMonOne(ord::MonomialOrdering) = MPolyLeadingMonOne(ord.R, ord) @@ -666,7 +665,7 @@ function Base.in( S::MPolyLeadingMonOne{BaseRingType, BaseRingElemType, RingType, RingElemType} ) where {BaseRingType, BaseRingElemType, RingType, RingElemType} R = parent(f) - R == ambient_ring(S) || return false + R == ring(S) || return false if iszero(f) return false end @@ -678,7 +677,7 @@ 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)) + println(io, "of ", ring(S)) print(io, Dedent()) println(io, "with leading monomial 1 w.r.t. ") print(io, Indent()) @@ -704,7 +703,7 @@ end āŠ‚(T::AbsMPolyMultSet, U::AbsMPolyMultSet) = issubset(T, U) function issubset(T::AbsMPolyMultSet, U::AbsMPolyMultSet) - ambient_ring(T) == ambient_ring(U) || return false + ring(T) == ring(U) || return false error("comparison of multiplicative sets of type $(typeof(T)) and $(typeof(U)) is not implemented") end @@ -728,8 +727,8 @@ function issubset( T::MPolyComplementOfKPointIdeal{BRT, BRET, RT, RET}, U::MPolyComplementOfKPointIdeal{BRT, BRET, RT, RET} ) where {BRT, BRET, RT, RET} - R = ambient_ring(T) - R == ambient_ring(U) || error("multiplicative sets do not belong to the same ring") + R = ring(T) + R == ring(U) || error("multiplicative sets do not belong to the same ring") a = point_coordinates(U) b = point_coordinates(T) for i in 1:length(a) @@ -742,8 +741,8 @@ function issubset( T::MPolyComplementOfKPointIdeal{BRT, BRET, RT, RET}, U::MPolyComplementOfPrimeIdeal{BRT, BRET, RT, RET} ) where {BRT, BRET, RT, RET} - R = ambient_ring(T) - R == ambient_ring(U) || error("multiplicative sets do not belong to the same ring") + R = ring(T) + R == ring(U) || error("multiplicative sets do not belong to the same ring") a = point_coordinates(T) for i in 1:length(a) (gen(R, i)- R(a[i])) in prime_ideal(U) || return false @@ -755,8 +754,8 @@ function issubset( T::MPolyComplementOfPrimeIdeal{BRT, BRET, RT, RET}, U::MPolyComplementOfKPointIdeal{BRT, BRET, RT, RET} ) where {BRT, BRET, RT, RET} - R = ambient_ring(T) - R == ambient_ring(U) || error("multiplicative sets do not belong to the same ring") + R = ring(T) + R == ring(U) || error("multiplicative sets do not belong to the same ring") a = point_coordinates(U) for f in gens(prime_ideal(T)) iszero(evaluate(f, a)) || return false @@ -897,16 +896,16 @@ Product of the multiplicative sets ``` """ function product(T::AbsMPolyMultSet, U::AbsMPolyMultSet) - R = ambient_ring(T) - R == ambient_ring(U) || error("multiplicative sets do not belong to the same ring") + R = ring(T) + R == ring(U) || error("multiplicative sets do not belong to the same ring") issubset(T, U) && return U issubset(U, T) && return T return MPolyProductOfMultSets(R, [T, U]) end function product(T::MST, U::MST) where {MST<:MPolyProductOfMultSets} - R = ambient_ring(T) - R == ambient_ring(U) || error("multiplicative sets do not belong to the same ring") + R = ring(T) + R == ring(U) || error("multiplicative sets do not belong to the same ring") new_sets = Vector() for S in sets(T) push!(new_sets, S) @@ -931,8 +930,8 @@ function product(T::MST, U::MST) where {MST<:MPolyProductOfMultSets} end function product(T::MPolyProductOfMultSets{BRT, BRET, RT, RET}, U::MST) where {BRT, BRET, RT, RET, MST<:AbsMPolyMultSet{BRT, BRET, RT, RET}} - R = ambient_ring(T) - R == ambient_ring(U) || error("multiplicative sets do not belong to the same ring") + R = ring(T) + R == ring(U) || error("multiplicative sets do not belong to the same ring") for V in sets(T) issubset(U, T) && return T end @@ -946,8 +945,8 @@ end product(U::MST, T::MPolyProductOfMultSets{BRT, BRET, RT, RET}) where {BRT, BRET, RT, RET, MST<:AbsMPolyMultSet{BRT, BRET, RT, RET}} = product(T, U) function product(T::MPolyComplementOfPrimeIdeal{BRT, BRET, RT, RET}, U::MPolyComplementOfKPointIdeal{BRT, BRET, RT, RET}) where {BRT, BRET, RT, RET} - R = ambient_ring(T) - R == ambient_ring(U) || error("multiplicative sets do not belong to the same ring") + R = ring(T) + R == ring(U) || error("multiplicative sets do not belong to the same ring") P = prime_ideal(T) for f in gens(P) if iszero(evaluate(f, point_coordinates(U))) @@ -965,8 +964,8 @@ function product( end function product(T::MST, U::MST) where {MST<:MPolyComplementOfKPointIdeal} - R = ambient_ring(T) - R == ambient_ring(U) || error("multiplicative sets do not belong to the same ring") + R = ring(T) + R == ring(U) || error("multiplicative sets do not belong to the same ring") a = point_coordinates(U) b = point_coordinates(T) for i in 1:length(a) @@ -976,8 +975,8 @@ function product(T::MST, U::MST) where {MST<:MPolyComplementOfKPointIdeal} end function product(T::MST, U::MST) where {MST<:MPolyComplementOfPrimeIdeal} - R = ambient_ring(T) - R == ambient_ring(U) || error("multiplicative sets do not belong to the same ring") + R = ring(T) + R == ring(U) || error("multiplicative sets do not belong to the same ring") if issubset(prime_ideal(T), prime_ideal(U)) return T end @@ -988,8 +987,8 @@ function product(T::MST, U::MST) where {MST<:MPolyComplementOfPrimeIdeal} end function product(T::MST, U::MST) where {MST<:MPolyPowersOfElement} - R = ambient_ring(T) - R == ambient_ring(U) || error("multiplicative sets do not belong to the same ring") + R = ring(T) + R == ring(U) || error("multiplicative sets do not belong to the same ring") new_denoms = Vector{elem_type(R)}() for f in denominators(T) for g in denominators(U) @@ -1015,8 +1014,8 @@ function product( U::AbsMPolyMultSet{BRT, BRET, RT, RET}, T::MPolyPowersOfElement{BRT, BRET, RT, RET} ) where {BRT, BRET, RT, RET} - R = ambient_ring(T) - R == ambient_ring(U) || error("multiplicative sets do not belong to the same ring") + R = ring(T) + R == ring(U) || error("multiplicative sets do not belong to the same ring") for a in denominators(T) a in U || return MPolyProductOfMultSets(R, [U, T]) end @@ -1027,8 +1026,8 @@ function product( T::MPolyPowersOfElement{BRT, BRET, RT, RET}, U::AbsMPolyMultSet{BRT, BRET, RT, RET} ) where {BRT, BRET, RT, RET} - R = ambient_ring(T) - R == ambient_ring(U) || error("multiplicative sets do not belong to the same ring") + R = ring(T) + R == ring(U) || error("multiplicative sets do not belong to the same ring") for a in denominators(T) a in U || return MPolyProductOfMultSets(R, [U, T]) end @@ -1039,8 +1038,8 @@ function product( T::MPolyPowersOfElement{BRT, BRET, RT, RET}, U::MPolyProductOfMultSets{BRT, BRET, RT, RET} ) where {BRT, BRET, RT, RET} - R = ambient_ring(T) - R == ambient_ring(U) || error("multiplicative sets do not belong to the same ring") + R = ring(T) + R == ring(U) || error("multiplicative sets do not belong to the same ring") keep_denom = Vector{RET}() for a in denominators(T) a in U || (push!(keep_denom, a)) @@ -1070,7 +1069,7 @@ end function (phi::MPolyAnyMap{<:MPolyRing, <:MPolyRing, Nothing})(U::MPolyPowersOfElement; check::Bool=true ) - ambient_ring(U) === domain(phi) || error("multiplicative set does not lay in the domain of the morphism") + ring(U) === domain(phi) || error("multiplicative set does not lay in the domain of the morphism") S = codomain(phi) SU = MPolyPowersOfElement(S, phi.(denominators(U))) return SU @@ -1079,7 +1078,7 @@ end function (phi::MPolyAnyMap{<:MPolyRing, <:MPolyRing, Nothing})(U::MPolyComplementOfPrimeIdeal; check::Bool=true ) - ambient_ring(U) === domain(phi) || error("multiplicative set does not lay in the domain of the morphism") + ring(U) === domain(phi) || error("multiplicative set does not lay in the domain of the morphism") S = codomain(phi) Q = ideal(S, phi.(gens(prime_ideal(U)))) SU = MPolyComplementOfPrimeIdeal(S, Q, check=check) @@ -1126,7 +1125,7 @@ at a multiplicative set ``S āŠ‚ R`` of type `MultSetType`. S::MultSetType ) where {RingType<:MPolyRing, MultSetType<:AbsMPolyMultSet} # TODO: Add some sanity checks here? - ambient_ring(S) == R || error("the multiplicative set is not contained in the given ring") + ring(S) == R || error("the multiplicative set is not contained in the given ring") k = coefficient_ring(R) R_loc = new{typeof(k), elem_type(k), RingType, elem_type(R), MultSetType}(R, S) return R_loc @@ -1180,7 +1179,7 @@ defined by """ localization(R::MPolyRing, U::AbsMPolyMultSet) function localization(S::AbsMPolyMultSet) - R = ambient_ring(S) + R = ring(S) Rloc = MPolyLocRing(R, S) #iota = MapFromFunc(R, Rloc, x -> Rloc(x)) iota = hom(R, Rloc, Rloc.(gens(R)), check=false) @@ -1692,7 +1691,7 @@ julia> R,(x,y,z,w) = QQ["x","y","z","w"]; julia> f = x+y+z+w-1; -julia> T = MPolyPowersOfElement(f); +julia> T = powers_of_element(f); julia> RL,phiL = localization(R,T); @@ -2168,16 +2167,13 @@ julia> R, (x, y) = QQ["x", "y"] julia> I = ideal(R, [x, y^2+1]) ideal(x, y^2 + 1) -julia> U = MPolyComplementOfPrimeIdeal(I) +julia> U = complement_of_prime_ideal(I) 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 x, y - over rational field - at complement of prime ideal(x, y^2 + 1) +julia> L, _ = localization(R, U) +(Localization of multivariate polynomial ring in 2 variables over QQ at complement of prime ideal(x, y^2 + 1), Hom: multivariate polynomial ring -> localized ring) julia> J = ideal(L,[y*(x^2+(y^2+1)^2)]) Ideal @@ -3112,7 +3108,7 @@ with 4 generators y^2 - 4*y + 4 julia> minimal_generating_set(I) -3-element Vector{MPolyLocRingElem{QQField, QQFieldElem, QQMPolyRing, QQMPolyRingElem, MPolyComplementOfKPointIdeal{QQField, QQFieldElem, QQMPolyRing, QQMPolyRingElem}}}: +3-element Vector{Oscar.MPolyLocRingElem{QQField, QQFieldElem, QQMPolyRing, QQMPolyRingElem, Oscar.MPolyComplementOfKPointIdeal{QQField, QQFieldElem, QQMPolyRing, QQMPolyRingElem}}}: y^2 - 4*y + 4 x*y - 2*x - y + 2 x^2 - 2*x + 1 @@ -3188,7 +3184,7 @@ with 4 generators y^2 julia> small_generating_set(I) -3-element Vector{MPolyLocRingElem{QQField, QQFieldElem, QQMPolyRing, QQMPolyRingElem, MPolyPowersOfElement{QQField, QQFieldElem, QQMPolyRing, QQMPolyRingElem}}}: +3-element Vector{Oscar.MPolyLocRingElem{QQField, QQFieldElem, QQMPolyRing, QQMPolyRingElem, Oscar.MPolyPowersOfElement{QQField, QQFieldElem, QQMPolyRing, QQMPolyRingElem}}}: y^2 x*y - y x^2 - 2*x + 1 diff --git a/src/Rings/mpolyquo-localizations.jl b/src/Rings/mpolyquo-localizations.jl index 2ea292740008..9847a64a9182 100644 --- a/src/Rings/mpolyquo-localizations.jl +++ b/src/Rings/mpolyquo-localizations.jl @@ -98,7 +98,7 @@ multiplicative set ``S āŠ‚ P`` of type `MultSetType`. #modulus(Q) == I || error("the modulus of the quotient ring does not coincide with the ideal") S === inverted_set(W) || error("the multiplicative set does not coincide with the inverted set of the localized ring") base_ring(W) === R || error("the localization does not come from the given ring") - ambient_ring(S) === R || error("Multiplicative set does not belong to the ring") + ring(S) === R || error("Multiplicative set does not belong to the ring") k = coefficient_ring(R) L = new{typeof(k), elem_type(k), typeof(R), RingElemType, MultSetType}(R, I, S, Q, W) return L @@ -324,7 +324,7 @@ function localization( L::MPolyQuoLocRing{BRT, BRET, RT, RET, MST}, S::AbsMPolyMultSet{BRT, BRET, RT, RET} ) where {BRT, BRET, RT, RET, MST} - ambient_ring(S) === base_ring(L) || error("multiplicative set does not belong to the correct ring") + ring(S) === base_ring(L) || error("multiplicative set does not belong to the correct ring") issubset(S, inverted_set(L)) && return L, MapFromFunc(L, L, x->x) U = inverted_set(L)*S W = MPolyQuoLocRing(base_ring(L), modulus(underlying_quotient(L)), U, underlying_quotient(L), localization(U)[1]) @@ -1643,7 +1643,7 @@ julia> Q = ideal(R,[x*y-z*w]); julia> RQ,phiQ = quo(R,Q); -julia> T = MPolyComplementOfKPointIdeal(R,[0,0,0,0]); +julia> T = complement_of_point_ideal(R,[0,0,0,0]); julia> RQL, phiQL = localization(RQ,T); diff --git a/src/aliases.jl b/src/aliases.jl index 9fcbf61d50b7..41f753185705 100644 --- a/src/aliases.jl +++ b/src/aliases.jl @@ -104,3 +104,4 @@ Base.@deprecate_binding SubQuo SubquoModule #@alias SubQuoElem_dec SubquoDecModuleElem #@alias SubQuo_dec SubquoDecModule Base.@deprecate_binding GradedPolynomialRing graded_polynomial_ring + diff --git a/src/deprecations.jl b/src/deprecations.jl index 61deabd1970c..f072c3e1878b 100644 --- a/src/deprecations.jl +++ b/src/deprecations.jl @@ -528,6 +528,7 @@ Base.@deprecate_binding is_isomorphic_with_alternating_group is_isomorphic_to_al Base.@deprecate_binding has_is_isomorphic_with_alternating_group has_is_isomorphic_to_alternating_group Base.@deprecate_binding set_is_isomorphic_with_alternating_group set_is_isomorphic_to_alternating_group -# Deprecated after 0.15.0 +Base.@deprecate ambient_ring(U::AbsMultSet) ring(U) + Base.@deprecate_binding jacobi_matrix jacobian_matrix Base.@deprecate_binding jacobi_ideal jacobian_ideal diff --git a/src/exports.jl b/src/exports.jl index 5d1d2bcdd4b7..875d0c0c0192 100644 --- a/src/exports.jl +++ b/src/exports.jl @@ -90,23 +90,10 @@ export LinearHalfspace export LinearHyperplane export LinearProgram, linear_program export localization -export MPolyComplementOfKPointIdeal -export MPolyComplementOfPrimeIdeal export MPolyDecRing export MPolyDecRingElem export MPolyIdeal -export MPolyLeadingMonOne -export MPolyLocRing -export MPolyLocRingElem -export MPolyLocalizedIdeal -export MPolyLocalizedRingHom -export MPolyPowersOfElement -export MPolyProductOfMultSets export MPolyQuoIdeal -export MPolyQuoLocRing -export MPolyQuoLocRingElem -export MPolyQuoLocalizedIdeal -export MPolyQuoLocalizedRingHom export MPolyQuoRing export MPolyQuoRingElem export MPolyRingElem @@ -246,7 +233,6 @@ export ambient_germ export ambient_module export ambient_representative export ambient_representatives_generators -export ambient_ring export ambient_scheme export ambient_space export ambient_type @@ -269,9 +255,6 @@ export augmented_chow_ring export aut export automorphism_group export base_ring -export base_ring_elem_type -export base_ring_module -export base_ring_type export base_scheme export bases export basic_patches @@ -294,7 +277,6 @@ export blocks export bond_matroid export borcherds_method export boundary_lattice_points -export bring_to_common_denominator export build_ctx export build_doc export canonical_bundle @@ -365,7 +347,6 @@ export combinatorial_symmetries export comm export comm! export common_components -export common_denominator export common_refinement export complement export complement_class_reps @@ -640,11 +621,6 @@ export has_transitive_groups export has_vertex export haspreimage export height -export helper_eta -export helper_ideal -export helper_images -export helper_kappa -export helper_ring export hermitian_form export hessian export hessian_matrix @@ -685,7 +661,6 @@ export ideal_as_module export ideal_membership export ideal_of_linear_relations export ideal_sheaf -export ideal_type export identifier export identity_map export image @@ -1005,7 +980,6 @@ export min_revlex_basis_encoding export min_weights export minimal_betti_table export minimal_block_reps -export minimal_denominators export minimal_faces export minimal_generating_set, has_minimal_generating_set, set_minimal_generating_set export minimal_generators @@ -1040,7 +1014,6 @@ export mpoly_dec_type export mpoly_ring_type export mpoly_type export mul! -export mult_set_type export multi_hilbert_function export multi_hilbert_series export multi_hilbert_series_reduced @@ -1316,6 +1289,7 @@ export right_coset_action export right_cosets export right_ideal export right_transversal +export ring export ring_elem_type export ring_type export rising_factorial @@ -1523,6 +1497,5 @@ export weyl_vector export witt_index export wreath_product export write_as_full -export write_as_linear_combination export zonotope export zonotope_vertices_fukuda_matrix diff --git a/test/AlgebraicGeometry/Schemes/AffineSchemes.jl b/test/AlgebraicGeometry/Schemes/AffineSchemes.jl index c892b3cfe3c6..d06ba04094ae 100644 --- a/test/AlgebraicGeometry/Schemes/AffineSchemes.jl +++ b/test/AlgebraicGeometry/Schemes/AffineSchemes.jl @@ -194,9 +194,9 @@ end @test_broken issubset(intersect(A3,V),A3) @test ambient_coordinate_ring(V)===R @test ambient_coordinate_ring(U) === R - @test ring_type(V) == typeof(OO(V)) - @test base_ring_type(typeof(V)) == typeof(QQ) - @test base_ring_elem_type(V) == QQFieldElem + @test Oscar.ring_type(V) == typeof(OO(V)) + @test Oscar.base_ring_type(typeof(V)) == typeof(QQ) + @test Oscar.base_ring_elem_type(V) == QQFieldElem @test base_ring(V) == QQ @test issubset(V,U) @test issubset(U,V) diff --git a/test/AlgebraicGeometry/Schemes/SpaceGerms.jl b/test/AlgebraicGeometry/Schemes/SpaceGerms.jl index e8da7ec267ff..87e4a19f9ca8 100644 --- a/test/AlgebraicGeometry/Schemes/SpaceGerms.jl +++ b/test/AlgebraicGeometry/Schemes/SpaceGerms.jl @@ -12,8 +12,8 @@ @test defining_ring_element(Z0) isa elem_type(Oscar.localized_ring_type(ring_type(Z0))) Z1 = CompleteIntersectionGerm(X,[1,2,1]) @test defining_ring_elements(Z1) isa Vector{elem_type(Oscar.localized_ring_type(ring_type(Z0)))} - U0 = MPolyComplementOfKPointIdeal(R,[0,0,0]) - U1 = MPolyComplementOfKPointIdeal(R,[1,2,1]) + U0 = Oscar.MPolyComplementOfKPointIdeal(R,[0,0,0]) + U1 = Oscar.MPolyComplementOfKPointIdeal(R,[1,2,1]) @test U0 == inverted_set(OO(X0)) @test U1 == inverted_set(OO(X1)) @test X0 == Y0 @@ -55,8 +55,8 @@ end @testset "Space Germ constructors Spec-Ideal" begin R, (x,y,z) = QQ["x", "y", "z"] J = ideal(R, [x-y]) - U0 = MPolyComplementOfKPointIdeal(R,[0,0,0]) - U1 = MPolyComplementOfKPointIdeal(R,[1,2,2]) + U0 = Oscar.MPolyComplementOfKPointIdeal(R,[0,0,0]) + U1 = Oscar.MPolyComplementOfKPointIdeal(R,[1,2,2]) Xg = Spec(R) Xgq = Spec(R,J) Xl1 = Spec(R, U0) @@ -80,8 +80,8 @@ end X1 = SpaceGerm(X,ideal(R,[x-1,y-2,z-2])) Y0 = SpaceGerm(Y,ideal(R,[x,y,z])) Y1 = SpaceGerm(Y,ideal(R,[x-1,y-2,z-2])) - U0 = MPolyComplementOfKPointIdeal(R,[0,0,0]) - U1 = MPolyComplementOfKPointIdeal(R,[1,2,2]) + U0 = Oscar.MPolyComplementOfKPointIdeal(R,[0,0,0]) + U1 = Oscar.MPolyComplementOfKPointIdeal(R,[1,2,2]) @test U0 == inverted_set(OO(X0)) @test U1 == inverted_set(OO(X1)) @test X0 == Y0 @@ -118,7 +118,7 @@ end X0,phi0 = germ_at_point(X,ideal(R,[x,y,z])) X1 = SpaceGerm(X,ideal(R,[x,y,z])) X2,phi2 = germ_at_point(X,[0,0,0]) - U0 = MPolyComplementOfKPointIdeal(R,[0,0,0]) + U0 = Oscar.MPolyComplementOfKPointIdeal(R,[0,0,0]) @test U0 == inverted_set(OO(X0)) @test U0 == inverted_set(OO(X2)) @test X0 == X1 @@ -161,7 +161,7 @@ end @test defining_ideal(X0) != ideal(R,zero(R)) @test defining_ideal(X0) == ideal(OO(X0),[0]) @test defining_ideal(X2) == ideal(localized_ring(OO(X2)),[x,y]) - @test inverted_set(OO(ambient_germ(X2))) == MPolyComplementOfKPointIdeal(R,[0,0,0]) + @test inverted_set(OO(ambient_germ(X2))) == Oscar.MPolyComplementOfKPointIdeal(R,[0,0,0]) @test ambient_germ(X0) == X0 end diff --git a/test/Modules/ProjectiveModules.jl b/test/Modules/ProjectiveModules.jl index d5daae38aa93..ea69a6bfe81f 100644 --- a/test/Modules/ProjectiveModules.jl +++ b/test/Modules/ProjectiveModules.jl @@ -13,7 +13,7 @@ @test success @test P^2 == P - W = MPolyQuoLocRing(R, I, units_of(R)) + W = Oscar.MPolyQuoLocRing(R, I, units_of(R)) F3 = FreeMod(W, 3) F4 = FreeMod(W, 4) h = hom(F3, F4, map_entries(W, M)) diff --git a/test/Modules/UngradedModules.jl b/test/Modules/UngradedModules.jl index 4d9732a0b90f..f605b2fef066 100644 --- a/test/Modules/UngradedModules.jl +++ b/test/Modules/UngradedModules.jl @@ -1019,8 +1019,8 @@ end @testset "change of base rings" begin R, (x,y) = QQ["x", "y"] - U = MPolyPowersOfElement(x) - S = MPolyLocRing(R, U) + U = Oscar.MPolyPowersOfElement(x) + S = Oscar.MPolyLocRing(R, U) F = FreeMod(R, 2) FS, mapF = change_base_ring(S, F) @test 1//x*mapF(x*F[1]) == FS[1] diff --git a/test/Modules/module-localizations.jl b/test/Modules/module-localizations.jl index a179a2ca4558..e2f28ccfc996 100644 --- a/test/Modules/module-localizations.jl +++ b/test/Modules/module-localizations.jl @@ -1,7 +1,7 @@ @testset "module localizations 1" begin kk = QQ R, (x,y) = QQ["x", "y"] - U = MPolyComplementOfKPointIdeal(R, [0, 0]) + U = Oscar.MPolyComplementOfKPointIdeal(R, [0, 0]) L, _ = localization(U) F = FreeMod(L, 3) A = L[x 0 1; 0 y y^2] @@ -17,7 +17,7 @@ @test represents_element((x^8-9)*F[2], K) @test represents_element(x*F[3], K) - T = MPolyPowersOfElement(R, [x, y]) + T = Oscar.MPolyPowersOfElement(R, [x, y]) W, _ = localization(T) F = FreeMod(W, 2) A = W[x 0; 0 y^2] @@ -28,10 +28,10 @@ end @testset "module localizations 2" begin R, (x,y) = QQ["x", "y"] - U = MPolyPowersOfElement(x+y) + U = Oscar.MPolyPowersOfElement(x+y) S, _ = localization(U) F = FreeMod(S, 2) - Fb = base_ring_module(F) + Fb = Oscar.base_ring_module(F) A = S[x//(x+y); y//(x+y)^2] B, D = Oscar.clear_denominators(A) @test change_base_ring(S, D) * A == B @@ -41,7 +41,7 @@ end @test success @test v*A == b - V = MPolyComplementOfPrimeIdeal(ideal(R, [x,y])) + V = Oscar.MPolyComplementOfPrimeIdeal(ideal(R, [x,y])) S, _ = localization(V) A = S[x//(x+y+1); y*(x-5)^3] b = matrix(S, 1, 1, [(x+y)*x + 5*y//(x+y+2)^10]) @@ -75,13 +75,13 @@ end @testset "module localizations 3" begin R, (x,y) = QQ["x", "y"] - U = MPolyPowersOfElement(x^7) + U = Oscar.MPolyPowersOfElement(x^7) S, _ = localization(U) F = FreeMod(S, 1) A = S[x^4*y^2; x^2*y] B = S[y^8; y^9] M = SubquoModule(F, A, B) - Fb = base_ring_module(F) + Fb = Oscar.base_ring_module(F) @test !represents_element(y*Fb[1], Oscar.pre_saturated_module(M)) @test represents_element(y*F[1], M) v = coordinates(y*F[1], M) @@ -107,7 +107,7 @@ end R, (x,y,z) = QQ["x", "y", "z"] M = R[x-1 y; z x] I = ideal(R, det(M)) - Q = MPolyQuoLocRing(R, I, units_of(R)) + Q = Oscar.MPolyQuoLocRing(R, I, units_of(R)) A = map_entries(Q, M) K1 = syz(A) K2 = syz(K1) diff --git a/test/Rings/MPolyQuo.jl b/test/Rings/MPolyQuo.jl index 8e384bd858fb..9e2f0c994bc8 100644 --- a/test/Rings/MPolyQuo.jl +++ b/test/Rings/MPolyQuo.jl @@ -168,32 +168,6 @@ end @test !is_prime(J2) end -@testset "modulus - MPAnyQuoRing MPAnyNonQuoRing" begin - R, (x,y,z) = QQ["x", "y", "z"] - I = ideal(R, [x+y+z]) - A, _ = quo(R,I) - @test modulus(R) == ideal(R,[zero(R)]) - @test modulus(A) == I - U=MPolyComplementOfKPointIdeal(R,[0,0,0]) - Rl,_ = localization(R,U) - Il = Rl(I) - Al, _ = quo(Rl, Il) - @test modulus(Rl) == ideal(Rl,[zero(Rl)]) - @test modulus(Al) == Il - U2=MPolyComplementOfPrimeIdeal(ideal(R,[x^2+1,y-x,z])) - Rl2,_ = localization(R,U2) - Il2 = Rl2(I) - Al2,_ = quo(Rl2,Il2) - @test modulus(Rl2) == ideal(Rl2,[zero(Rl2)]) - @test modulus(Al2) == Il2 - U3=MPolyPowersOfElement(x+y) - Rl3,_ = localization(R,U3) - Il3 = Rl3(I) - Al3,_ = quo(Rl3,Il3) - @test modulus(Rl3) == ideal(Rl3,[zero(Rl3)]) - @test modulus(Al3) == Il3 -end - @testset "saturated ideal compatibility" begin R, (x,y,z) = QQ["x", "y", "z"] I = ideal(R, [x+y+z]) diff --git a/test/Rings/integer-localizations.jl b/test/Rings/integer-localizations.jl index 037a0a40c01c..212982071504 100644 --- a/test/Rings/integer-localizations.jl +++ b/test/Rings/integer-localizations.jl @@ -4,7 +4,7 @@ using Oscar -import Oscar: base_ring, inverted_set, ambient_ring, localization, parent, numerator, denominator, one, zero, reduce_fraction +import Oscar: base_ring, inverted_set, ring, localization, parent, numerator, denominator, one, zero, reduce_fraction import Oscar.AbstractAlgebra: elem_type, parent_type export FmpzComplementOfPrimeIdeal, FmpzPowersOfElement, FmpzComplementOfZeroIdeal @@ -29,7 +29,7 @@ mutable struct FmpzPowersOfElement <: AbsMultSet{ZZRing, ZZRingElem} end ### required getter functions -ambient_ring(S::FmpzPowersOfElement) = ZZ +ring(S::FmpzPowersOfElement) = ZZ ### required functionality function Base.in(a::ZZRingElem, S::FmpzPowersOfElement) @@ -73,7 +73,7 @@ mutable struct FmpzComplementOfPrimeIdeal <: AbsMultSet{ZZRing, ZZRingElem} end ### required getter functions -ambient_ring(S::FmpzComplementOfPrimeIdeal) = ZZ +ring(S::FmpzComplementOfPrimeIdeal) = ZZ ### required functionality function Base.in(b::ZZRingElem, S::FmpzComplementOfPrimeIdeal) @@ -103,7 +103,7 @@ mutable struct FmpzComplementOfZeroIdeal <: AbsMultSet{ZZRing, ZZRingElem} end ### required getter functions -ambient_ring(S::FmpzComplementOfZeroIdeal) = ZZ +ring(S::FmpzComplementOfZeroIdeal) = ZZ ### required functionality function Base.in(b::ZZRingElem, S::FmpzComplementOfZeroIdeal) @@ -240,9 +240,9 @@ parent_type(T::Type{FmpzLocalizedRingElem{MultSetType}}) where {MultSetType} = F @test 25 in S @test !(33 in S) @test 5*5*7 in S - @test ambient_ring(S) == ZZ + @test ring(S) == ZZ W, _ = localization(S) - @test base_ring(W) == ambient_ring(S) + @test base_ring(W) == ring(S) @test inverted_set(W) == S a = W(3) b = W(7, 5) @@ -257,9 +257,9 @@ parent_type(T::Type{FmpzLocalizedRingElem{MultSetType}}) where {MultSetType} = F @test !(13^5 in U) @test !(13*4289729837 in U) @test 5783790198374098 in U - @test ambient_ring(U) == ZZ + @test ring(U) == ZZ W, _ = localization(U) - @test base_ring(W) == ambient_ring(U) + @test base_ring(W) == ring(U) @test inverted_set(W) == U a = W(4, 17) b = W(4*17) @@ -272,9 +272,9 @@ parent_type(T::Type{FmpzLocalizedRingElem{MultSetType}}) where {MultSetType} = F O = FmpzComplementOfZeroIdeal() @test 234890 in O @test !(0 in O) - @test ambient_ring(O) == ZZ + @test ring(O) == ZZ W, _ = localization(O) - @test base_ring(W) == ambient_ring(O) + @test base_ring(W) == ring(O) @test inverted_set(W) == O a = W(4, 17) b = W(4*17) diff --git a/test/Rings/mpoly-localizations.jl b/test/Rings/mpoly-localizations.jl index 7036345a93f7..31e3d81f95a5 100644 --- a/test/Rings/mpoly-localizations.jl +++ b/test/Rings/mpoly-localizations.jl @@ -7,9 +7,9 @@ const rng = Oscar.get_seeded_rng() f = x^2 + y^2 -1 m = ideal(R, [x, y]) I = ideal(R, f) - S = MPolyComplementOfPrimeIdeal(I) + S = Oscar.MPolyComplementOfPrimeIdeal(I) V, _ = localization(S) - T = MPolyComplementOfKPointIdeal(R, [ZZ(1), ZZ(0)]) + T = Oscar.MPolyComplementOfKPointIdeal(R, [ZZ(1), ZZ(0)]) W, _ = localization(T) k = QQ @@ -21,16 +21,16 @@ const rng = Oscar.get_seeded_rng() f = x^2 + y^2 - p^2 - q^2 m = ideal(R, [x, y]) I = ideal(R, f) - S = MPolyComplementOfPrimeIdeal(I) - @test ambient_ring(S) == R + S = Oscar.MPolyComplementOfPrimeIdeal(I) + @test ring(S) == R @test !( f in S ) @test x in S V, _ = localization(S) @test base_ring(V) == R @test inverted_set(V) == S - T = MPolyComplementOfKPointIdeal(R, [k(p), k(q)]) - @test ambient_ring(T) == R + T = Oscar.MPolyComplementOfKPointIdeal(R, [k(p), k(q)]) + @test ring(T) == R @test typeof(point_coordinates(T)) == Vector{elem_type(k)} @test x in T @test !(x-p in T) @@ -55,8 +55,8 @@ const rng = Oscar.get_seeded_rng() J = ideal(W, [W(x-3), W(y-4)]) J = ideal(W, [f, y-q]) - @test I_loc + J isa MPolyLocalizedIdeal - @test I_loc * J isa MPolyLocalizedIdeal + @test I_loc + J isa Oscar.MPolyLocalizedIdeal + @test I_loc * J isa Oscar.MPolyLocalizedIdeal # @test reduce(W(x)//W(y-q+1), lbpa) == W(p)//W(y-q+1) @@ -72,9 +72,9 @@ const rng = Oscar.get_seeded_rng() x = v[1] y = v[2] f = (x^2 + y^2)^2 - S = MPolyComplementOfKPointIdeal(R, [ZZ(0), ZZ(0)]) - T = MPolyPowersOfElement(R, [f]) - U = MPolyProductOfMultSets(R, [S, T]) + S = Oscar.MPolyComplementOfKPointIdeal(R, [ZZ(0), ZZ(0)]) + T = Oscar.MPolyPowersOfElement(R, [f]) + U = Oscar.MPolyProductOfMultSets(R, [S, T]) @test f in U @test (f*(x-1) in U) @test !(f*x in U) @@ -87,8 +87,8 @@ const rng = Oscar.get_seeded_rng() I = ideal(S, [x + y + z, x^2 + y^2 + z^3]) R, (x, y) = QQ["x", "y"] - U = MPolyPowersOfElement(R, [x]) - L = MPolyLocRing(R, U) + U = Oscar.MPolyPowersOfElement(R, [x]) + L = Oscar.MPolyLocRing(R, U) I = ideal(L, [y*(y-x)]) J = ideal(L, [x*(y-x)]) @test y in quotient(I, J) @@ -97,8 +97,8 @@ const rng = Oscar.get_seeded_rng() R, (x, y) = QQ["x", "y"] f = x^2 + y^3- 2 I = ideal(R, [f]) - U = MPolyComplementOfPrimeIdeal(I) - L = MPolyLocRing(R, U) + U = Oscar.MPolyComplementOfPrimeIdeal(I) + L = Oscar.MPolyLocRing(R, U) I = ideal(L, [f^4]) J = ideal(L, [f^2]) @test f^2 in quotient(I, J) @@ -108,8 +108,8 @@ const rng = Oscar.get_seeded_rng() R, (x, y) = QQ["x", "y"] f = x^2 + y^2- 2 I = ideal(R, [f]) - U = MPolyComplementOfKPointIdeal(R, [1, 1]) - L = MPolyLocRing(R, U) + U = Oscar.MPolyComplementOfKPointIdeal(R, [1, 1]) + L = Oscar.MPolyLocRing(R, U) I = ideal(L, [y^2*f^4]) J = ideal(L, [x*f^2]) @test f^2 in quotient(I, J) @@ -122,7 +122,7 @@ end x = variab[1] y = variab[2] f = x^2 + y^2 -1 - S = MPolyPowersOfElement(R, [x, y, f]) + S = Oscar.MPolyPowersOfElement(R, [x, y, f]) @test f in S # 5 is not a unit in R @test !(5*f in S) @@ -131,7 +131,7 @@ end x = variabs[1] y = variabs[2] f = x^2 + y^4-120 - S = MPolyPowersOfElement(R, [x, y, f]) + S = Oscar.MPolyPowersOfElement(R, [x, y, f]) @test f in S # Now 5 is a unit in R @test (5*f in S) @@ -154,7 +154,7 @@ end x = variab[1] y = variab[2] f = x^2 + y^2 -1 - S = MPolyPowersOfElement(R, [x, y, f]) + S = Oscar.MPolyPowersOfElement(R, [x, y, f]) @test f in S @test !(5*f in S) @@ -162,15 +162,15 @@ end V, _ = localization(U, x) W, _ = localization(V, 5*f) - phi = MPolyLocalizedRingHom(R, W, [W(1//x), W(y//f)]) + phi = Oscar.MPolyLocalizedRingHom(R, W, [W(1//x), W(y//f)]) @test phi(x*f) == phi(domain(phi)(x*f)) @test phi(ZZ(9)) == W(ZZ(9)) - psi = MPolyLocalizedRingHom(U, R, [R(0), R(0)]) + psi = Oscar.MPolyLocalizedRingHom(U, R, [R(0), R(0)]) @test psi(U(-1//f))==one(codomain(psi)) end -function test_elem(W::MPolyLocRing) +function test_elem(W::Oscar.MPolyLocRing) f = rand(rng, W, 0:3, 0:4, 0:3) return f end @@ -185,9 +185,9 @@ end # # d = Vector{elem_type(R)}() # d = [rand(R, 1:3, 0:4, 1:10)::elem_type(R) for i in 0:(abs(rand(Int))%3+1)] -# S = MPolyPowersOfElement(R, d) -# T = MPolyComplementOfKPointIdeal(R, [kk(125), kk(-45)]) -# U = MPolyComplementOfPrimeIdeal(I) +# S = Oscar.MPolyPowersOfElement(R, d) +# T = Oscar.MPolyComplementOfKPointIdeal(R, [kk(125), kk(-45)]) +# U = Oscar.MPolyComplementOfPrimeIdeal(I) # # test_Ring_interface_recursive(localization(S)[1]) # test_Ring_interface_recursive(localization(T)[1]) @@ -209,9 +209,9 @@ end f = rand(rng, R, 1:3, 0:3, 1:10)::elem_type(R) iszero(f) || push!(d, f) end - S = MPolyPowersOfElement(R, d) - T = MPolyComplementOfKPointIdeal(R, [kk(125), kk(-45)]) - U = MPolyComplementOfPrimeIdeal(I) + S = Oscar.MPolyPowersOfElement(R, d) + T = Oscar.MPolyComplementOfKPointIdeal(R, [kk(125), kk(-45)]) + U = Oscar.MPolyComplementOfPrimeIdeal(I) test_Ring_interface_recursive(localization(S)[1]) test_Ring_interface_recursive(localization(T)[1]) @@ -226,9 +226,9 @@ end # # d = Vector{elem_type(R)}() # d = [rand(R, 1:3, 0:4, 1:10)::elem_type(R) for i in 0:(abs(rand(Int))%3+1)] -# S = MPolyPowersOfElement(R, d) -# T = MPolyComplementOfKPointIdeal(R, [kk(125), kk(-45)]) -# U = MPolyComplementOfPrimeIdeal(I) +# S = Oscar.MPolyPowersOfElement(R, d) +# T = Oscar.MPolyComplementOfKPointIdeal(R, [kk(125), kk(-45)]) +# U = Oscar.MPolyComplementOfPrimeIdeal(I) # # test_Ring_interface_recursive(localization(S)[1]) # test_Ring_interface_recursive(localization(T)[1]) @@ -238,7 +238,7 @@ end @testset "localization_at_orderings_1" begin R, (x,y) = QQ["x", "y"] o = degrevlex([x])*negdegrevlex([y]) - U = MPolyLeadingMonOne(R, o) + U = Oscar.MPolyLeadingMonOne(R, o) @test y-1 in U @test !(x in U) L, _ = localization(R, U) @@ -264,7 +264,7 @@ end @testset "localizations at k-points" begin R, (x, y, z) = QQ["x", "y", "z"] p = [-5, 8, 1//2] - U = MPolyComplementOfKPointIdeal(R, p) + U = Oscar.MPolyComplementOfKPointIdeal(R, p) I = ideal(R, [x*(x+5), (y-8)*y-z*(x+5)]) L, _ = localization(R, U) LI = L(I) @@ -283,19 +283,19 @@ end @testset "successive localizations" begin R, (x, y, z) = QQ["x", "y", "z"] p = [0,0,0] - U = MPolyComplementOfKPointIdeal(R, p) + U = Oscar.MPolyComplementOfKPointIdeal(R, p) I = ideal(R, [x*(y-1)-z*(x-2), y*x]) L, _ = localization(R, U) LI = L(I) W, _ = quo(L, LI) - S = MPolyPowersOfElement(R, [y]) + S = Oscar.MPolyPowersOfElement(R, [y]) RS, _ = localization(R, S) RSI = RS(I) saturated_ideal(RSI, with_generator_transition=true) J = L(Oscar.pre_saturated_ideal(RSI)) z in J W, _ = quo(L, LI) - S = MPolyPowersOfElement(R, [y]) + S = Oscar.MPolyPowersOfElement(R, [y]) WS, _ = localization(W, S) @test !iszero(W(z)) @test iszero(WS(z)) @@ -310,8 +310,8 @@ end @testset "saturated_ideals" begin R, (x, y) = QQ["x", "y"] I = ideal(R, [x, y^2+1]) - U = MPolyComplementOfPrimeIdeal(I) - L = MPolyLocRing(R, U) + U = Oscar.MPolyComplementOfPrimeIdeal(I) + L = Oscar.MPolyLocRing(R, U) J = ideal(L,[y*(x^2+(y^2+1)^2)]) J_sat = ideal(R,[(x^2+(y^2+1)^2)]) @test saturated_ideal(J) == J_sat diff --git a/test/Rings/mpolyquo-localizations.jl b/test/Rings/mpolyquo-localizations.jl index 85420d741710..c6c660a91162 100644 --- a/test/Rings/mpolyquo-localizations.jl +++ b/test/Rings/mpolyquo-localizations.jl @@ -7,8 +7,8 @@ f = x*v-y*u I = ideal(R, f) Q, p = quo(R, I) - S = MPolyComplementOfKPointIdeal(R, [QQ(1), QQ(0), QQ(1), QQ(0)]) - T = MPolyComplementOfKPointIdeal(R, [QQ(0), QQ(0), QQ(0), QQ(0)]) + S = Oscar.MPolyComplementOfKPointIdeal(R, [QQ(1), QQ(0), QQ(1), QQ(0)]) + T = Oscar.MPolyComplementOfKPointIdeal(R, [QQ(0), QQ(0), QQ(0), QQ(0)]) L, _ = localization(Q, S) a = L(x) b = L(y) @@ -20,16 +20,16 @@ x = v[1] y = v[2] f = (x^2 + y^2) - T = MPolyComplementOfKPointIdeal(R, [kk(0), kk(0)]) + T = Oscar.MPolyComplementOfKPointIdeal(R, [kk(0), kk(0)]) I = ideal(R, f) - V = MPolyQuoLocRing(R, I, T) + V = Oscar.MPolyQuoLocRing(R, I, T) S = R - U = MPolyPowersOfElement(S, [f-1]) + U = Oscar.MPolyPowersOfElement(S, [f-1]) J = ideal(S, zero(S)) - W = MPolyQuoLocRing(S, J, U) + W = Oscar.MPolyQuoLocRing(S, J, U) - h = MPolyQuoLocalizedRingHom(W, V, [x//(y-1), y//(x-5)]) + h = Oscar.MPolyQuoLocalizedRingHom(W, V, [x//(y-1), y//(x-5)]) J1 = ideal(V, [x*(x-1), y*(y-3)]) J2 = ideal(W, [x, y]) @test preimage(h, J1) == J2 @@ -41,20 +41,20 @@ R, (x,y) = kk["x", "y"] f = x^2 + y^2-2 - S = MPolyPowersOfElement(x-1) - T = MPolyComplementOfKPointIdeal(R, [1,1]) - V = MPolyComplementOfPrimeIdeal(ideal(R, f)) + S = Oscar.MPolyPowersOfElement(x-1) + T = Oscar.MPolyComplementOfKPointIdeal(R, [1,1]) + V = Oscar.MPolyComplementOfPrimeIdeal(ideal(R, f)) āŠ‚ = issubset @test S āŠ‚ V @test !(V āŠ‚ S) @test !(T āŠ‚ V) @test (V āŠ‚ T) - @test !(MPolyComplementOfPrimeIdeal(ideal(R, f-1)) āŠ‚ T) - @test S āŠ‚ MPolyComplementOfPrimeIdeal(ideal(R, f-1)) - @test !(MPolyPowersOfElement(f) āŠ‚ V) - @test MPolyPowersOfElement(x-1) āŠ‚ MPolyComplementOfKPointIdeal(R, [0,0]) - @test MPolyPowersOfElement(x-1) * MPolyComplementOfKPointIdeal(R, [0,0]) āŠ‚ MPolyComplementOfKPointIdeal(R, [0,0]) - @test !(MPolyPowersOfElement(x) āŠ‚ MPolyComplementOfKPointIdeal(R, [0,0])) + @test !(Oscar.MPolyComplementOfPrimeIdeal(ideal(R, f-1)) āŠ‚ T) + @test S āŠ‚ Oscar.MPolyComplementOfPrimeIdeal(ideal(R, f-1)) + @test !(Oscar.MPolyPowersOfElement(f) āŠ‚ V) + @test Oscar.MPolyPowersOfElement(x-1) āŠ‚ Oscar.MPolyComplementOfKPointIdeal(R, [0,0]) + @test Oscar.MPolyPowersOfElement(x-1) * Oscar.MPolyComplementOfKPointIdeal(R, [0,0]) āŠ‚ Oscar.MPolyComplementOfKPointIdeal(R, [0,0]) + @test !(Oscar.MPolyPowersOfElement(x) āŠ‚ Oscar.MPolyComplementOfKPointIdeal(R, [0,0])) @test T*T == T U = S*T @@ -83,7 +83,7 @@ h = x^4+23*x*y^3-15 Q, _ = quo(R, f) - T = MPolyPowersOfElement(h^3) + T = Oscar.MPolyPowersOfElement(h^3) W, _ = localization(Q, T) @test x//(h+3*f) in W @test W(x//(h+3*f)) == W(x//h) @@ -92,21 +92,21 @@ g = [W(8*x*h+4), W(x, 45*h^2)] @test one(localized_ring(W)) in ideal(W, g) - @test one(W) == dot(write_as_linear_combination(one(W), g), g) + @test one(W) == dot(Oscar.write_as_linear_combination(one(W), g), g) h = (x+5)*(x^2+10*y)+(y-7)*(y^2-3*x) Q, _ = quo(R, h) - T = MPolyComplementOfKPointIdeal(R, [-5, 7]) + T = Oscar.MPolyComplementOfKPointIdeal(R, [-5, 7]) W, _ = localization(Q, T) @test x//(y) in W @test x//(y+h) in W g = [W(h + (x+5) - 9, y+24*x^3-8)] - (d, a) = bring_to_common_denominator([one(W), g[1]]) + (d, a) = Oscar.bring_to_common_denominator([one(W), g[1]]) @test W(a[1], d) == one(W) @test W(a[2]*lifted_numerator(g[1]), d) == g[1] @test (one(localized_ring(W)) in ideal(W, g)) - @test one(W) == dot(write_as_linear_combination(one(W), g), g) + @test one(W) == dot(Oscar.write_as_linear_combination(one(W), g), g) end @testset "prime ideals in quotient rings" begin @@ -148,9 +148,9 @@ end Q2 = ideal(R,[x*y-z*w]) RQ1,phiQ1 = quo(R,Q1) RQ2,phiQ2 = quo(R,Q2) - T1 = MPolyComplementOfKPointIdeal(R,[0,0,0,0]) + T1 = Oscar.MPolyComplementOfKPointIdeal(R,[0,0,0,0]) f = x+y+z+w-1 - T2 = MPolyPowersOfElement(f) + T2 = Oscar.MPolyPowersOfElement(f) RL1,phiL1 = localization(R,T1) RL2,phiL2 = localization(R,T2) RQ1L1, phiQ1L1 = localization(RQ1,T1) @@ -206,9 +206,9 @@ end Q2 = ideal(R,[z,x^2-y^2]) RQ1,phiQ1 = quo(R,Q1) RQ2,phiQ2 = quo(R,Q2) - T1 = MPolyComplementOfKPointIdeal(R,[0,0,0]) + T1 = Oscar.MPolyComplementOfKPointIdeal(R,[0,0,0]) f = x-y - T2 = MPolyPowersOfElement(f) + T2 = Oscar.MPolyPowersOfElement(f) RL1,phiL1 = localization(R,T1) RL2,phiL2 = localization(R,T2) RQ1L1, phiQ1L1 = localization(RQ1,T1) @@ -299,12 +299,12 @@ end @testset "minimal and small generating sets" begin R, (x,y,z) = QQ["x","y","z"] IQ = ideal(R,[x-z]) - U1 = MPolyComplementOfKPointIdeal(R,[0,0,0]) - U2 = MPolyComplementOfKPointIdeal(R,[1,1,1]) - U3 = MPolyPowersOfElement(y) - Q1 = MPolyQuoLocRing(R,IQ,U1) - Q2 = MPolyQuoLocRing(R,IQ,U2) - Q3 = MPolyQuoLocRing(R,IQ,U3) + U1 = Oscar.MPolyComplementOfKPointIdeal(R,[0,0,0]) + U2 = Oscar.MPolyComplementOfKPointIdeal(R,[1,1,1]) + U3 = Oscar.MPolyPowersOfElement(y) + Q1 = Oscar.MPolyQuoLocRing(R,IQ,U1) + Q2 = Oscar.MPolyQuoLocRing(R,IQ,U2) + Q3 = Oscar.MPolyQuoLocRing(R,IQ,U3) J1 = ideal(Q1,[x^2-y^2,y^2-z^2,x^2-z^2]) @test length(minimal_generating_set(J1)) == 1 @test length(small_generating_set(J1)) == 1 @@ -321,7 +321,7 @@ end R, (x, y) = QQ[:x, :y] I = ideal(R, x^6-y) U = complement_of_point_ideal(R, [1, 1]) - L = MPolyQuoLocRing(R, I, U) + L = Oscar.MPolyQuoLocRing(R, I, U) J = ideal(L, [x-1, y-1])^2 minJ = minimal_generating_set(J) @test length(minJ) == 1 @@ -476,3 +476,30 @@ end L_to_Tl3 = compose(L_to_Sl3, Sl_to_Tl3) @test L_to_Tl(one(L)) == one(Tl) end + +@testset "modulus - MPAnyQuoRing MPAnyNonQuoRing" begin + R, (x,y,z) = QQ["x", "y", "z"] + I = ideal(R, [x+y+z]) + A, _ = quo(R,I) + @test modulus(R) == ideal(R,[zero(R)]) + @test modulus(A) == I + U= Oscar.MPolyComplementOfKPointIdeal(R,[0,0,0]) + Rl,_ = localization(R,U) + Il = Rl(I) + Al, _ = quo(Rl, Il) + @test modulus(Rl) == ideal(Rl,[zero(Rl)]) + @test modulus(Al) == Il + U2= Oscar.MPolyComplementOfPrimeIdeal(ideal(R,[x^2+1,y-x,z])) + Rl2,_ = localization(R,U2) + Il2 = Rl2(I) + Al2,_ = quo(Rl2,Il2) + @test modulus(Rl2) == ideal(Rl2,[zero(Rl2)]) + @test modulus(Al2) == Il2 + U3= Oscar.MPolyPowersOfElement(x+y) + Rl3,_ = localization(R,U3) + Il3 = Rl3(I) + Al3,_ = quo(Rl3,Il3) + @test modulus(Rl3) == ideal(Rl3,[zero(Rl3)]) + @test modulus(Al3) == Il3 +end + diff --git a/test/Rings/nmod-localizations.jl b/test/Rings/nmod-localizations.jl index 4c4f06df56d3..f677ec2c8164 100644 --- a/test/Rings/nmod-localizations.jl +++ b/test/Rings/nmod-localizations.jl @@ -5,12 +5,12 @@ using Oscar import Oscar.Nemo.zzModRing -import Oscar: base_ring, inverted_set, ambient_ring, localization, parent, numerator, denominator, one, zero +import Oscar: base_ring, inverted_set, ring, localization, parent, numerator, denominator, one, zero import Oscar.AbstractAlgebra: elem_type, parent_type export NmodComplementOfPrimeIdeal, NmodLocalizedRing, NmodLocalizedRingElem -export generator, ambient_ring, localization, parent, numerator, denominator +export generator, ring, localization, parent, numerator, denominator ####################################################################### @@ -42,14 +42,14 @@ function Base.in(b::zzModRingElem, S::NmodComplementOfPrimeIdeal) end ### required getter functions -ambient_ring(S::NmodComplementOfPrimeIdeal) = S.R +ring(S::NmodComplementOfPrimeIdeal) = S.R ### additional constructors NmodComplementOfPrimeIdeal(R::zzModRing, i::Oscar.IntegerUnion) = NmodComplementOfPrimeIdeal(R(i)) ### additional functionality generator(S::NmodComplementOfPrimeIdeal) = S.gen -Base.in(b::Oscar.IntegerUnion, S::NmodComplementOfPrimeIdeal) = (ambient_ring(S)(b) in S) +Base.in(b::Oscar.IntegerUnion, S::NmodComplementOfPrimeIdeal) = (ring(S)(b) in S) ####################################################################### # Localizations of ā„¤/nā„¤ # @@ -65,7 +65,7 @@ mutable struct NmodLocalizedRing{MultSetType <: AbsMultSet{zzModRing, zzModRingE S::MultSetType # the set at which has been localized function NmodLocalizedRing(S::MultSetType) where {MultSetType <: AbsMultSet{zzModRing, zzModRingElem}} - return new{MultSetType}(ambient_ring(S), S) + return new{MultSetType}(ring(S), S) end end @@ -151,9 +151,9 @@ parent_type(T::Type{NmodLocalizedRingElem{MultSetType}}) where {MultSetType} = N @test !(13^5 in U) @test !(13*4289729837 in U) @test 5783790198374098 in U - @test ambient_ring(U) == R + @test ring(U) == R W, _ = localization(U) - @test base_ring(W) == ambient_ring(U) + @test base_ring(W) == ring(U) @test inverted_set(W) == U a = W(4, 17) b = W(4*17)