Skip to content

Add conformance tests for is_unit and is_nilpotent #1941

@fingolfin

Description

@fingolfin

Some ideas (assuming we exclude zero rings at the start):

@test is_unit(one(R))
@test !is_unit(zero(R))
@test is_nilpotent(zero(R))
@test !is_nilpotent(one(R))

For a random element x:

@test !(is_unit(x) && is_nilpotent(x))
@test is_unit(x) == is_unit(x^2)
@test is_nilpotent(x) == is_nilpotent(x^2)
if characteristic(R) > 0 && is_nilpotent(x)
  @test is_unit(x+1)
end
if is_domain_type(typeof(x))
  @test is_nilpotent(x) == is_zero(x)
end

Then we have of course tests of polynomials rings over a ring -- those could also have some tests for specific polynomials, i.e. if the indeterminate is t then is_unit(1+t) == false, etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions