flint icon indicating copy to clipboard operation
flint copied to clipboard

Definition of irreducibility

Open thofma opened this issue 11 months ago • 5 comments

At the moment, the *_poly_is_irreducible functions over finite fields say that constant polynomials are irreducible

julia> Fx, x = GF(2)["x"];

julia> is_irreducible(x^0)
true

julia> is_irreducible(0*x)
true

Before I try to fix this, I wanted to ask what the convention is that flint follows. Surely units should not be irreducible, but what about the zero polynomial?

thofma avatar Jan 08 '25 19:01 thofma

I would say that units are not irreducible.

For these kinds of things lately, I am a great fan of looking at what mathlib says, https://leanprover-community.github.io/mathlib4_docs/Mathlib/Algebra/Prime/Defs.html#Irreducible, as they need to choose a consistent definition.

edgarcosta avatar Jan 08 '25 20:01 edgarcosta

I wasn't even aware that there is a debate to be had here, all text books I looked at agree on this, units and zero are never irreducible.

fingolfin avatar Jan 09 '25 08:01 fingolfin

If one wants a consistent theory of factorization in rings, allowing non-domains, it is common to have a definition that implies that 0 is irreducible in domains.

thofma avatar Jan 09 '25 08:01 thofma

Agree with following mathlib.

fredrik-johansson avatar Jan 09 '25 09:01 fredrik-johansson

Related to #2094

albinahlback avatar Jan 09 '25 10:01 albinahlback