Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add characteristic for multivariate quotient rings over fields #4241

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
8 changes: 8 additions & 0 deletions src/Rings/MPolyQuo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ oscar_origin_ring(Q::MPolyQuoRing) = base_ring(Q)

default_ordering(Q::MPolyQuoRing) = default_ordering(base_ring(Q))

# Only for fields for now because of things like char(ZZ[x, y]/<2>) = 2
function characteristic(Q::MPolyQuoRing{<:MPolyRingElem{T}}) where {T <: FieldElement}
if is_zero(one(Q))
return 1
end
return characteristic(coefficient_ring(Q))
end

##############################################################################
#
# Quotient ring elements
Expand Down
6 changes: 6 additions & 0 deletions test/Rings/MPolyQuo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@

B,q = quo(R, x^3+y,y^2; ordering=lex(R))
@test A.I == B.I

@test characteristic(quo(R, ideal(x))[1]) == 0
@test characteristic(quo(R, ideal(R, 1))[1]) == 1

S, (s, t) = GF(5)[:s, :t]
@test characteristic(quo(S, ideal([s, t]))[1]) == 5
end

@testset "MpolyQuo.manipulation" begin
Expand Down
Loading