Dear Forum, dear Marc Bogaerts,
> I want to know if x is an algebraic integer by inspecting the coefficients
> of its minimal polynomial using tne command
> PolynomialCoefficientsOfPolynomial.
PolynomialCoefficientsofPolynomial always returns (as the name says, and to be
consistent with the multivariate case) coefficients that are polynomials, that
cc[1] is really -6*a^0.
gap> p:=a^3-8*a-6;
a^3-8*a-6
gap> cc:=PolynomialCoefficientsOfPolynomial(p,a);
[ -6, -8, 0, 1 ]
gap> cc[1]=-6;
false
gap> cc[1]=-6*a^0;
true
(As the objects display the same way, you could detect this by looking for
example at the categories of the coefficients:
gap> CategoriesOfObject(cc[1]);
[ "IsExtAElement", "IsNearAdditiveElement", "IsNearAdditiveElementWithZero",
"IsNearAdditiveElementWithInverse", "IsAdditiveElement", "IsExtLElement",
"IsExtRElement", "IsMultiplicativeElement", "IsMultiplicativeElementWithOne"
, "IsMultiplicativeElementWithInverse", "IsZDFRE", "IsPolynomialFunction",
"IsRationalFunction", "IsPolynomialFunctionsFamilyElement",
"IsRationalFunctionsFamilyElement" ]
while integers look very different:
gap> CategoriesOfObject(6);
[ "IsInt", "IsRat", "IsCyc", "IsExtAElement", "IsNearAdditiveElement",
"IsNearAdditiveElementWithZero", "IsNearAdditiveElementWithInverse",
"IsAdditiveElement", "IsExtLElement", "IsExtRElement",
"IsMultiplicativeElement", "IsMultiplicativeElementWithOne",
"IsMultiplicativeElementWithInverse", "IsZDFRE", "IsAssociativeElement",
"IsAdditivelyCommutativeElement", "IsCommutativeElement", "IsCyclotomic",
"IsPosRat" ] )
If you use instead CoefficientsOfUnivariatePolynomial, you get the integer
coefficients as desired:
gap> cc:=CoefficientsOfUnivariatePolynomial(p);
[ -6, -8, 0, 1 ]
gap> List(cc,c->c in Integers);
[ true, true, true, true ]
Best wishes,
Alexander Hulpke
-- Colorado State University, Department of Mathematics,
Weber Building, 1874 Campus Delivery, Fort Collins, CO 80523-1874, USA
email: [email protected], Phone: ++1-970-4914288
http://www.math.colostate.edu/~hulpke
_______________________________________________
Forum mailing list
[email protected]
http://mail.gap-system.org/mailman/listinfo/forum