flintlib / flint

FLINT (Fast Library for Number Theory)
http://www.flintlib.org
GNU Lesser General Public License v3.0
446 stars 244 forks source link

`fmpz_poly_is_squarefree` wrong results? #2084

Open fingolfin opened 1 month ago

fingolfin commented 1 month ago

It indicates that 4x is square-free, but that doesn't agree with its documentation, which states

Returns whether the polynomial poly is square-free. A non-zero polynomial is defined to be square-free if it has no non-unit square factors. We also define the zero polynomial to be square-free.

See also https://github.com/Nemocas/Nemo.jl/pull/1742 and https://github.com/Nemocas/Nemo.jl/issues/1311

albinahlback commented 1 month ago

A change to something like

Returns whether the polynomial poly is square-free. A non-zero polynomial is defined to be square-free if its factorisation contains no non-constant square factors. We also define the zero polynomial to be square-free.

would work, right?

fingolfin commented 1 month ago

Thank you. That would at least clarify that it deviates from the usual mathematical definition. Perhaps it could be made even more explicitly by in addition inserting something like this:

This differs somewhat from the usual definition, e.g. we consider the polynomial 4x in Z[x] as square-free.

thofma commented 1 month ago

Or just write, that it returns whether poly is squarefree as a polynomial over the rationals.

edgarcosta commented 1 month ago

That or just say it doesn't double roots over the complex numbers