The function checks whether the polynomial f has a factor of degree n defined over the field of definition. In case where the argument is an ideal I of points, we check for a subscheme of degree n.
i1 : R=ZZ/10009[x,y]
o1 = R
o1 : PolynomialRing
|
i2 : setRandomSeed("degree 3 factor");
|
i3 : f=random(8,R)
8 7 6 2 5 3 4 4 3 5 2 6
o3 = 617x + 3641x y - 3982x y - 640x y + 2859x y - 187x y - 867x y -
------------------------------------------------------------------------
7 8
2692x*y + 158y
o3 : R
|
i4 : apply(decompose ideal f,c->degree c)
o4 = {1, 2, 5}
o4 : List
|
i5 : hasFactor(f,3)
o5 = true
|
i6 : hasFactor(f,4)
o6 = false
|