AbstractAlgebra.jl icon indicating copy to clipboard operation
AbstractAlgebra.jl copied to clipboard

is_nilpotent for NCPolyRingElem

Open thofma opened this issue 9 months ago • 3 comments

Both the implementation for is_unit and is_nilpotent claim that they work for NCPolyRingElem: https://github.com/Nemocas/AbstractAlgebra.jl/blob/41d9716d403c83689cd5d08007c8e5c632e317da/src/NCPoly.jl#L812-L816 But I don't think this is true:

  1. For technical reasons one gets:
julia> is_nilpotent(f)
ERROR: MethodError: no method matching coefficients(::AbstractAlgebra.Generic.NCPoly{AbstractAlgebra.Generic.MatRingElem{BigInt}})
The function `coefficients` exists, but no method is defined for this combination of argument types.
  1. It seems to be wrong mathematically:
julia> R = matrix_ring(ZZ, 2);

julia> S, y = polynomial_ring(R, "y");

julia> f = R([0 1; 0 0]) * y + R([0 0; 1 0]);

julia> f^2
y

julia> f^3
[0 1; 0 0]*y^2 + [0 0; 1 0]*y

julia> f^4
y^2

julia> f^5
[0 1; 0 0]*y^3 + [0 0; 1 0]*y^2

julia> is_nilpotent(coeff(f, 0)) && is_nilpotent(coeff(f, 1))
true

thofma avatar Mar 10 '25 07:03 thofma

I think those functions were added by @JohnAAbbott. Is there a reference?

thofma avatar Mar 10 '25 07:03 thofma

It works if the coefficients are commutative: (a+b)^k = \sum_j binom(k,j)*a^j*b^(k-j) Your example shows that it may not be true if the coefficients of the polynomial are not pairwise commutative. I need to think a moment about the case of non-commutative coefficients: the simple change is to restrict to commutative coefficients...

JohnAAbbott avatar Mar 14 '25 12:03 JohnAAbbott

I believe the function is correct in a local ring. Not (yet?) sure how to make it more general.

JohnAAbbott avatar Mar 14 '25 13:03 JohnAAbbott

I think this was resolved by PR #2037 -- can you confirm and close this then?

fingolfin avatar Nov 26 '25 13:11 fingolfin

Yes, it was resolved by PR #2037 so closing

JohnAAbbott avatar Nov 26 '25 17:11 JohnAAbbott