diff --git a/src/Rings.jl b/src/Rings.jl index f5c0504f6d..cbc9e6c17b 100644 --- a/src/Rings.jl +++ b/src/Rings.jl @@ -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)) diff --git a/src/fundamental_interface.jl b/src/fundamental_interface.jl index 38187c0128..8302391001 100644 --- a/src/fundamental_interface.jl +++ b/src/fundamental_interface.jl @@ -4,8 +4,6 @@ # ############################################################################### -# TODO: Move more generic functions to this file. - ############################################################################### # # Parents, elements and data type methods @@ -34,7 +32,6 @@ true """ function parent end -# TODO: Give example @doc raw""" elem_type(parent) elem_type(parent_type)