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 is_trivial(::NCRing) #1848

Merged
merged 1 commit into from
Oct 8, 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
15 changes: 15 additions & 0 deletions src/Rings.jl
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,21 @@
#
###############################################################################

@doc raw"""
is_trivial(R::NCRing)

Test whether the ring $R$ is trivial. A ring is trivial if it consists
of a single element, or equivalently if its characteristic is 1. Such
rings are also called zero rings.
"""
is_trivial(F::NCRing) = characteristic(F) == 1
is_trivial(F::Field) = false

Check warning on line 183 in src/Rings.jl

View check run for this annotation

Codecov / codecov/patch

src/Rings.jl#L182-L183

Added lines #L182 - L183 were not covered by tests

@doc raw"""
is_perfect(F::Field)

Test whether the field $F$ is perfect.
"""
is_perfect(F::Field) = characteristic(F) == 0 || F isa FinField ||
throw(NotImplementedError(:is_perfect, F))

Expand Down
3 changes: 0 additions & 3 deletions src/fundamental_interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
#
###############################################################################

# TODO: Move more generic functions to this file.

###############################################################################
#
# Parents, elements and data type methods
Expand Down Expand Up @@ -34,7 +32,6 @@ true
"""
function parent end

# TODO: Give example
@doc raw"""
elem_type(parent)
elem_type(parent_type)
Expand Down
Loading