diff --git a/docs/src/AlgebraicGeometry/AlgebraicSets/AffineAlgebraicSet.md b/docs/src/AlgebraicGeometry/AlgebraicSets/AffineAlgebraicSet.md index 794199c7d52f..3d27fab2d282 100644 --- a/docs/src/AlgebraicGeometry/AlgebraicSets/AffineAlgebraicSet.md +++ b/docs/src/AlgebraicGeometry/AlgebraicSets/AffineAlgebraicSet.md @@ -91,8 +91,8 @@ AbsAffineAlgebraicSet ## Constructors One can create an algebraic set from an ideal or a multivariate polynomial. ```@docs -algebraic_set(I::MPolyIdeal{<:MPolyElem}; check::Bool=true) -algebraic_set(f::MPolyElem; check::Bool=true) +algebraic_set(I::MPolyIdeal{<:MPolyRingElem}; check::Bool=true) +algebraic_set(f::MPolyRingElem; check::Bool=true) ``` Convert an affine scheme to an affine algebraic set in order to ignore its (non-reduced) scheme structure. diff --git a/experimental/Schemes/elliptic_surface.jl b/experimental/Schemes/elliptic_surface.jl index 682e147da225..b1fb7b2526ab 100644 --- a/experimental/Schemes/elliptic_surface.jl +++ b/experimental/Schemes/elliptic_surface.jl @@ -1126,7 +1126,7 @@ function two_neighbor_step(X::EllipticSurface, F::Vector{QQFieldElem}) @assert scheme(parent(u)) === weierstrass_model(X)[1] # Helper function - my_const(u::MPolyElem) = is_zero(u) ? zero(coefficient_ring(parent(u))) : first(coefficients(u)) + my_const(u::MPolyRingElem) = is_zero(u) ? zero(coefficient_ring(parent(u))) : first(coefficients(u)) # transform to a quartic y'^2 = q(x) if iszero(P[3]) # P = O @@ -1456,13 +1456,13 @@ end @doc raw""" - elliptic_surface(g::MPolyElem, x::MPolyElem, y::MPolyElem, P::Vector{<:RingElem}) + elliptic_surface(g::MPolyRingElem, x::MPolyRingElem, y::MPolyRingElem, P::Vector{<:RingElem}) Transform a bivariate polynomial `g` of the form `y^2 - Q(x)` with `Q(x)` of degree at most ``4`` to Weierstrass form and return the corresponding elliptic surface as well as the coordinate transformation. """ -function elliptic_surface(g::MPolyElem, P::Vector{<:RingElem}) +function elliptic_surface(g::MPolyRingElem, P::Vector{<:RingElem}) R = parent(g) (x, y) = gens(R) P = base_ring(R).(P) @@ -1480,14 +1480,14 @@ function elliptic_surface(g::MPolyElem, P::Vector{<:RingElem}) end @doc raw""" - transform_to_weierstrass(g::MPolyElem, x::MPolyElem, y::MPolyElem, P::Vector{<:RingElem}) + transform_to_weierstrass(g::MPolyRingElem, x::MPolyRingElem, y::MPolyRingElem, P::Vector{<:RingElem}) Transform a bivariate polynomial `g` of the form `y^2 - Q(x)` with `Q(x)` of degree ``≤ 4`` to Weierstrass form. This returns a pair `(f, trans)` where `trans` is an endomorphism of the `fraction_field` of `parent(g)` and `f` is the transform. The input `P` must be a rational point on the curve defined by `g`, i.e. `g(P) == 0`. """ -function transform_to_weierstrass(g::MPolyElem, x::MPolyElem, y::MPolyElem, P::Vector{<:RingElem}) +function transform_to_weierstrass(g::MPolyRingElem, x::MPolyRingElem, y::MPolyRingElem, P::Vector{<:RingElem}) R = parent(g) @assert ngens(R) == 2 "input polynomial must be bivariate" @assert x in gens(R) "second argument must be a variable of the parent of the first" @@ -1568,11 +1568,11 @@ function transform_to_weierstrass(g::MPolyElem, x::MPolyElem, y::MPolyElem, P::V return result, trans end -function _is_in_weierstrass_form(f::MPolyElem) +function _is_in_weierstrass_form(f::MPolyRingElem) R = parent(f) @req ngens(R) == 2 "polynomial must be bivariate" # Helper function - my_const(u::MPolyElem) = is_zero(u) ? zero(coefficient_ring(parent(u))) : first(coefficients(u)) + my_const(u::MPolyRingElem) = is_zero(u) ? zero(coefficient_ring(parent(u))) : first(coefficients(u)) (x, y) = gens(R) f = -inv(my_const(coeff(f, [x, y], [0, 2]))) * f @@ -1645,7 +1645,7 @@ function _elliptic_parameter_conversion(X::EllipticSurface, u::VarietyFunctionFi FS = fraction_field(S) # Helper function - my_const(u::MPolyElem) = is_zero(u) ? zero(coefficient_ring(parent(u))) : first(coefficients(u)) + my_const(u::MPolyRingElem) = is_zero(u) ? zero(coefficient_ring(parent(u))) : first(coefficients(u)) # We verify the assumptions made on p. 44 of # A. Kumar: "Elliptic Fibrations on a generic Jacobian Kummer surface" diff --git a/src/AlgebraicGeometry/Schemes/AffineAlgebraicSet/Objects/Constructors.jl b/src/AlgebraicGeometry/Schemes/AffineAlgebraicSet/Objects/Constructors.jl index 7587ba523806..4b8a7dc6391b 100644 --- a/src/AlgebraicGeometry/Schemes/AffineAlgebraicSet/Objects/Constructors.jl +++ b/src/AlgebraicGeometry/Schemes/AffineAlgebraicSet/Objects/Constructors.jl @@ -31,7 +31,7 @@ defined by ideal(x^3 + y^2 + y + 1, x) ``` """ -function algebraic_set(I::MPolyIdeal{<:MPolyElem}; is_radical::Bool=false, check::Bool=true) +function algebraic_set(I::MPolyIdeal{<:MPolyRingElem}; is_radical::Bool=false, check::Bool=true) X = Spec(base_ring(I), I) return algebraic_set(X, is_reduced=is_radical, check=check) end diff --git a/src/Rings/MPolyQuo.jl b/src/Rings/MPolyQuo.jl index bda0a4db923b..8b4500b32dbe 100644 --- a/src/Rings/MPolyQuo.jl +++ b/src/Rings/MPolyQuo.jl @@ -1230,7 +1230,7 @@ function vector_space(K::AbstractAlgebra.Field, Q::MPolyQuoRing) # quotient; see Greuel/Pfister "A singular introduction to Commutative Algebra". function prim(a::MPolyQuoRingElem) @assert parent(a) === Q - b = lift(a)::MPolyElem + b = lift(a)::MPolyRingElem o = default_ordering(R) # TODO: Make sure the ordering is the same as the one used for the _kbase above @assert is_global(o) "ordering must be global" diff --git a/src/Rings/mpoly-ideals.jl b/src/Rings/mpoly-ideals.jl index ff424a751ca4..349647f5f212 100644 --- a/src/Rings/mpoly-ideals.jl +++ b/src/Rings/mpoly-ideals.jl @@ -1282,7 +1282,7 @@ julia> codim(I) 2 ``` """ -codim(I::MPolyIdeal{T}) where {T<:MPolyElem{<:FieldElem}}= nvars(base_ring(I)) - dim(I) +codim(I::MPolyIdeal{T}) where {T<:MPolyRingElem{<:FieldElem}}= nvars(base_ring(I)) - dim(I) codim(I::MPolyIdeal) = dim(base_ring(I)) - dim(I) # Some fixes which were necessary for the above diff --git a/src/Rings/mpoly-localizations.jl b/src/Rings/mpoly-localizations.jl index 94d25d8a43f7..6729cb078028 100644 --- a/src/Rings/mpoly-localizations.jl +++ b/src/Rings/mpoly-localizations.jl @@ -3095,7 +3095,7 @@ julia> minimal_generating_set(I) """ @attr Vector{<:MPolyLocRingElem} function minimal_generating_set( I::MPolyLocalizedIdeal{<:MPolyLocRing{<:Field, <:FieldElem, - <:MPolyRing, <:MPolyElem, + <:MPolyRing, <:MPolyRingElem, <:MPolyComplementOfKPointIdeal} } ) @@ -3171,11 +3171,11 @@ julia> small_generating_set(I) ``` """ small_generating_set(I::MPolyLocalizedIdeal{<:MPolyLocRing{<:Field, <:FieldElem, - <:MPolyRing, <:MPolyElem, + <:MPolyRing, <:MPolyRingElem, <:MPolyComplementOfKPointIdeal}}) = minimal_generating_set(I) function small_generating_set(I::MPolyLocalizedIdeal{<:MPolyLocRing{<:Field, <:FieldElem, - <:MPolyRing, <:MPolyElem, + <:MPolyRing, <:MPolyRingElem, <:MPolyPowersOfElement}}) L = base_ring(I) R = base_ring(L) @@ -3183,5 +3183,5 @@ function small_generating_set(I::MPolyLocalizedIdeal{<:MPolyLocRing{<:Field, <:F return filter(!iszero, I_min) end -dim(R::MPolyLocRing{<:Field, <:FieldElem, <:MPolyRing, <:MPolyElem, <:MPolyComplementOfPrimeIdeal}) = nvars(base_ring(R)) - dim(prime_ideal(inverted_set(R))) +dim(R::MPolyLocRing{<:Field, <:FieldElem, <:MPolyRing, <:MPolyRingElem, <:MPolyComplementOfPrimeIdeal}) = nvars(base_ring(R)) - dim(prime_ideal(inverted_set(R))) diff --git a/src/Rings/mpoly.jl b/src/Rings/mpoly.jl index c7d54f664e18..ecc8c7955589 100644 --- a/src/Rings/mpoly.jl +++ b/src/Rings/mpoly.jl @@ -1296,7 +1296,7 @@ end lift(f::MPolyRingElem) = f ### Hessian matrix -function hessian_matrix(f::MPolyElem) +function hessian_matrix(f::MPolyRingElem) R = parent(f) n = nvars(R) df = jacobi_matrix(f) @@ -1309,5 +1309,5 @@ function hessian_matrix(f::MPolyElem) return result end -hessian(f::MPolyElem) = det(hessian_matrix(f)) +hessian(f::MPolyRingElem) = det(hessian_matrix(f)) diff --git a/src/Rings/mpolyquo-localizations.jl b/src/Rings/mpolyquo-localizations.jl index 874c36282803..dbd05d8e21ac 100644 --- a/src/Rings/mpolyquo-localizations.jl +++ b/src/Rings/mpolyquo-localizations.jl @@ -2221,7 +2221,7 @@ If the localization is at a point, a minimal set of generators is returned. """ @attr Vector{<:MPolyQuoLocRingElem} function small_generating_set( I::MPolyQuoLocalizedIdeal{<:MPolyQuoLocRing{<:Field, <:FieldElem, - <:MPolyRing, <:MPolyElem, + <:MPolyRing, <:MPolyRingElem, <:MPolyComplementOfKPointIdeal}, <:Any,<:Any} ) @@ -2234,7 +2234,7 @@ end function small_generating_set( I::MPolyQuoLocalizedIdeal{<:MPolyQuoLocRing{<:Field, <:FieldElem, - <:MPolyRing, <:MPolyElem, + <:MPolyRing, <:MPolyRingElem, <:MPolyPowersOfElement} } ) @@ -2245,5 +2245,5 @@ function small_generating_set( return filter(!iszero, Q.(small_generating_set(J))) end -dim(R::MPolyQuoLocRing{<:Field, <:FieldElem, <:MPolyRing, <:MPolyElem, <:MPolyComplementOfPrimeIdeal}) = dim(saturated_ideal(modulus(R))) - dim(prime_ideal(inverted_set(R))) +dim(R::MPolyQuoLocRing{<:Field, <:FieldElem, <:MPolyRing, <:MPolyRingElem, <:MPolyComplementOfPrimeIdeal}) = dim(saturated_ideal(modulus(R))) - dim(prime_ideal(inverted_set(R))) diff --git a/src/Serialization/Fields.jl b/src/Serialization/Fields.jl index dcba35c4f08b..b33e0c359dbd 100644 --- a/src/Serialization/Fields.jl +++ b/src/Serialization/Fields.jl @@ -248,7 +248,7 @@ end function load_object(s::DeserializerState, ::Type{<: Union{NfAbsNSElem, Hecke.NfRelNSElem}}, terms::Vector, parents::Vector) K = parents[end] n = ngens(K) - # forces parent of MPolyElem + # forces parent of MPolyRingElem poly_ring = polynomial_ring(base_field(K), n) parents[end - 1], _ = poly_ring poly_elem_type = elem_type diff --git a/src/TropicalGeometry/groebner_fan.jl b/src/TropicalGeometry/groebner_fan.jl index 112186fe1f9d..66f08b5219c0 100644 --- a/src/TropicalGeometry/groebner_fan.jl +++ b/src/TropicalGeometry/groebner_fan.jl @@ -13,7 +13,7 @@ # Computes the space of weight vectors w.r.t. which G is weighted homogeneous @doc raw""" - homogeneity_space(G::Vector{<:MPolyElem}) + homogeneity_space(G::Vector{<:MPolyRingElem}) Return a `Cone` that is the space of all weight vectors under which all elements of `G` are weighted homogeneous. The cone will be a linear subspace without any rays. @@ -56,7 +56,7 @@ julia> rays_modulo_lineality(homogeneity_space(G3)) ``` """ -function homogeneity_space(G::Vector{<:MPolyElem}) +function homogeneity_space(G::Vector{<:MPolyRingElem}) inequalities = fmpq_mat(0,0) equations = Vector{Vector{Int}}() for g in G @@ -71,7 +71,7 @@ end @doc raw""" - homogeneity_vector(G::Vector{<:MPolyElem}) + homogeneity_vector(G::Vector{<:MPolyRingElem}) Return a positive `Vector{fmpz}` under which every element of `G` is weighted homogeneous. If no such vector exists, return `nothing`. @@ -119,7 +119,7 @@ true ``` """ -function homogeneity_vector(G::Vector{<:MPolyElem}) +function homogeneity_vector(G::Vector{<:MPolyRingElem}) homogeneitySpace = homogeneity_space(G) # return nothing if homogeneitySpace is the origin @@ -150,7 +150,7 @@ end @doc raw""" - maximal_groebner_cone(G::Oscar.IdealGens{<:MPolyElem}; homogeneityWeight::Union{Nothing,Vector{fmpz}}=nothing) + maximal_groebner_cone(G::Oscar.IdealGens{<:MPolyRingElem}; homogeneityWeight::Union{Nothing,Vector{fmpz}}=nothing) Returns the maximal Groebner cone of a Groebner basis `G`, i.e., the closure of all weight vectors with respect to whose weighted ordering `G` is a Groebner basis (independent of tie-breaker). @@ -180,7 +180,7 @@ julia> rays_modulo_lineality(maximal_groebner_cone(G)) ``` """ -function maximal_groebner_cone(G::Oscar.IdealGens{<:MPolyElem}) +function maximal_groebner_cone(G::Oscar.IdealGens{<:MPolyRingElem}) @assert is_groebner_basis(G) ord = ordering(G) G = collect(G) @@ -188,14 +188,14 @@ function maximal_groebner_cone(G::Oscar.IdealGens{<:MPolyElem}) return maximal_groebner_cone(G,ord,homogeneityWeight) end -function maximal_groebner_cone(G::Oscar.IdealGens{<:MPolyElem}, homogeneityWeight::Union{Vector{fmpz},Nothing}) +function maximal_groebner_cone(G::Oscar.IdealGens{<:MPolyRingElem}, homogeneityWeight::Union{Vector{fmpz},Nothing}) @assert is_groebner_basis(G) ord = ordering(G) G = collect(G) return maximal_groebner_cone(G,ord,homogeneityWeight) end -function maximal_groebner_cone(G::Vector{<:MPolyElem}, ord::MonomialOrdering, homogeneityWeight::Nothing) +function maximal_groebner_cone(G::Vector{<:MPolyRingElem}, ord::MonomialOrdering, homogeneityWeight::Nothing) # calling with `nothing` as homogeneityWeight # means that C needs to be restricted to the positive orthant C = maximal_groebner_cone_extended(G,ord) @@ -203,13 +203,13 @@ function maximal_groebner_cone(G::Vector{<:MPolyElem}, ord::MonomialOrdering, ho return intersect(C,positiveOrthant) end -function maximal_groebner_cone(G::Vector{<:MPolyElem}, ord::MonomialOrdering, homogeneityWeight::Vector{fmpz}) +function maximal_groebner_cone(G::Vector{<:MPolyRingElem}, ord::MonomialOrdering, homogeneityWeight::Vector{fmpz}) # calling with a positive homogeneityWeight # means that C does not be restricted to the positive orthant return maximal_groebner_cone_extended(G,ord) end -function maximal_groebner_cone_extended(G::Vector{<:MPolyElem}, ord::MonomialOrdering) +function maximal_groebner_cone_extended(G::Vector{<:MPolyRingElem}, ord::MonomialOrdering) # iterate over all elements of G and construct the inequalities inequalities = Vector{Vector{Int}}() for g in G @@ -268,7 +268,7 @@ end # Returns the initial form of polynomial g with respect to weight vector u. # Requires a monomial ordering that is compatible with respect to u, i.e., the leading monomial is of highest weighted degree. -function initial(g::MPolyElem, ordering::MonomialOrdering, u::Vector{fmpz}) +function initial(g::MPolyRingElem, ordering::MonomialOrdering, u::Vector{fmpz}) lt,tail = Iterators.peel(terms(g,ordering=ordering)); d = dot(u,fmpz.(leading_exponent_vector(lt))) initial_terms = [s for s in tail if dot(u,fmpz.(leading_exponent_vector(s)))==d] @@ -277,7 +277,7 @@ function initial(g::MPolyElem, ordering::MonomialOrdering, u::Vector{fmpz}) end # Applies the function above to each polynomial in a list of polynomials. -function initial(G::Vector{<:MPolyElem}, ord::MonomialOrdering, u::Vector{fmpz}) +function initial(G::Vector{<:MPolyRingElem}, ord::MonomialOrdering, u::Vector{fmpz}) return initial.(G,Ref(ord),Ref(u)) end @@ -287,7 +287,7 @@ end # - G is a Groebner basis with respect to ord # Returns: # - a reduced Groebner basis with respect to ord -function interreduce(G::Vector{<:MPolyElem}, ord::MonomialOrdering) +function interreduce(G::Vector{<:MPolyRingElem}, ord::MonomialOrdering) # sort G by its leading monomials (result is smallest first) # then reduce G[i] by G[1:i-1] for i=length(G),...,2 sort!(G, @@ -307,9 +307,9 @@ end # - ordH and ordG are adjacent orderings # Returns: # - Gnew, a Groebner basis of the original ideal w.r.t. ordH -function groebner_lift(Hnew::Vector{<:MPolyElem}, +function groebner_lift(Hnew::Vector{<:MPolyRingElem}, ordH::MonomialOrdering, - G::Vector{<:MPolyElem}, + G::Vector{<:MPolyRingElem}, ordG::MonomialOrdering) # lift to groebner basis Gnew = Hnew - reduce(Hnew,G,ordering=ordG,complete_reduction=true) @@ -327,7 +327,7 @@ end # Returns: # - the reduced Groebner basis with respect to the adjacent ordering # in direction v -function groebner_flip(G::Vector{<:MPolyElem}, +function groebner_flip(G::Vector{<:MPolyRingElem}, ordG::MonomialOrdering, homogeneityVector::Union{Vector{fmpz},Nothing}, interior_facet_point::Vector{fmpz},