Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions src/Rings/mpolyquo-localizations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1850,6 +1850,52 @@ function vector_space_dimension(R::MPolyQuoLocRing{<:Field, <:Any,<:Any, <:Any,
return vector_space_dimension(quo(base_ring(R),ideal(base_ring(R),gens(LI)))[1])
end

@doc raw"""
monomial_basis(A::MPolyQuoLocRing{<:Field, <:Any, <:Any, <:Any, <:MPolyComplementOfKPointIdeal})

If, say, `A = L/I`, where `L` is a localization of multivariate polynomial ring over a field
`K` at a point `p`, and `I` is an ideal of `L`, return a vector of monomials of `L`
such that the residue classes of these monomials form a basis of `A` as a `K`-vector
space.
!!! note
The monomials are in the varibles $x_i - p_i$. Therefore in the example below $x*y - x - y + 1 = (x-1)*(y-1)$ is a monomial.
!!! note
If `A` is not finite-dimensional as a `K`-vector space, an error is thrown.
# Examples
```jldoctest
julia> R, (x,y) = QQ["x","y"];

julia> L,_ = localization(R, complement_of_point_ideal(R, [1,1]));

julia> A,_ = quo(L, ideal(L, [(x-1)^2, (y-1)^2]));

julia> A
Localization
of quotient
of multivariate polynomial ring in 2 variables x, y
over rational field
by ideal (x^2 - 2*x + 1, y^2 - 2*y + 1)
at complement of maximal ideal of point (1, 1)

julia> monomial_basis(A)
4-element Vector{Oscar.MPolyLocRingElem{QQField, QQFieldElem, QQMPolyRing, QQMPolyRingElem, Oscar.MPolyComplementOfKPointIdeal{QQField, QQFieldElem, QQMPolyRing, QQMPolyRingElem}}}:
x*y - x - y + 1
y - 1
x - 1
1
```
"""
function monomial_basis(A::MPolyQuoLocRing{<:Field, <:Any, <:Any, <:Any, <:MPolyComplementOfKPointIdeal})
R = base_ring(A)
L = localized_ring(A)
G = numerator.(gens(modulus(A)))
shift, back_shift = base_ring_shifts(L)
G_0 = shift.(G)
S = standard_basis(ideal(R, G_0), ordering = negdeglex(R))
B = monomial_basis(quo(R, ideal(S))[1])
return L.(back_shift.(B))
end

function is_finite_dimensional_vector_space(R::MPolyQuoLocRing)
throw(NotImplementedError(:is_finite_dimensional_vector_space, R))
end
Expand Down
17 changes: 17 additions & 0 deletions test/Rings/mpolyquo-localizations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -510,3 +510,20 @@ end
@test Oscar._get_generators_string_one_line(ideal(R, x)) == "with 100 generators"
@test Oscar._get_generators_string_one_line(ideal(R, [sum(x)])) == "with 1 generator"
end


@testset "monomial_basis" begin
R, (x,y) = QQ["x", "y"]
L, _ = localization(R, complement_of_point_ideal(R, [0,0]))
Q1, _ = quo(L, ideal(L, L(1)))
Q2, _ = quo(L, ideal(L, L(x^2)))
Q3, _ = quo(L, ideal(L, L.([x^2, y^3])))
@test isempty(monomial_basis(Q1))
@test_throws InfiniteDimensionError() monomial_basis(Q2)
@test monomial_basis(Q3) == L.([x*y^2, y^2, x*y, y, x, 1])
L1, _ = localization(R, complement_of_point_ideal(R, [1,2]))
Q4, _ = quo(L1, ideal(L1, [(x-1)^2, (y-2)^2]))
@test monomial_basis(Q4) == L1.([(x-1)*(y-2), y-2, x-1, 1])
Q5, _ = quo(L1, ideal(L1, L1.([x*y, x, y])))
@test isempty(monomial_basis(Q5))
end
Comment thread
Syz-MS marked this conversation as resolved.
Outdated