Skip to content

Commit

Permalink
Add is_trivial(::NCRing) (#1848)
Browse files Browse the repository at this point in the history
Also remove some outdated or pointless TODO comments, and
add a docstring for is_perfect
  • Loading branch information
fingolfin authored Oct 8, 2024
1 parent c8aec15 commit afcb420
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
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 @@ end
#
###############################################################################

@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

@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

0 comments on commit afcb420

Please sign in to comment.