From 02b981cfb30c8d07437027b93464c3b275da0fc4 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 8 Oct 2024 11:56:43 +0200 Subject: [PATCH] Add is_trivial(::NCRing) Also remove some outdated or pointless TODO comments, and add a docstring for is_perfect --- src/Rings.jl | 15 +++++++++++++++ src/fundamental_interface.jl | 3 --- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/Rings.jl b/src/Rings.jl index f5c0504f6..cbc9e6c17 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 38187c012..830239100 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)