On Tue, Mar 11, 2025 at 11:22:23AM +0100, 'Ralf Hemmecke' via FriCAS - computer algebra system wrote: > Dear Waldek, > > On 3/7/25 19:16, Waldek Hebisch wrote: > > AFAICS you are interested in _very_ special cases. > > Yes, of course. But this discussion helped me to realize, > that I actually have a bit more freedom. I have to anyway investigate > all the conjugates where in the end I only care about real roots. > > > > Additionally, given an algebraic number z, it would be great if > > > FriCAS had a way to find a p \in Z[x] such that p(z)=0 (minimal > > > poly for z). > > > Yes, it would be nice to have this, but it is currently > > unimplemented. > > See attachment. That is only a proof-of-concept approach. > I haven't thought very much about it, but I am mostly interested in radical > expressions (so, restriction to algebraic numbers. > Am I right with the assumption that the only operator in a kernel of > AlgebraicNumber is nthRoot?
No, there is also 'rootOf'. > Doesn't that say that the function (from AN) > > minPoly: Kernel % -> SparseUnivariatePolynomial % > > always return a polynomial of the form (x^n - t) where t is a rational > expression in "lower depth" kernels. minPoly is in terms of lower oder kernels. For 'rootOf' minPoly is not a binomial. > In other words sorting the variables as > I did for the lex Groebner basis computation doesn't actually waste time for > the polynomials corresponding to the tower(q) > (where q is the algebraic number I want to find the minimal polynomial for). > So lexGroebner should be the optimal approach to find the minimal > polynomial. > > If you think that would be a reasonable approach, I will prepare a patch for > > minimalPolynomial: % -> SparseUnivariatePolynomial Integer > > in AlgebraicNumber. I tried your code replacing definition of 'q' by: p4 := legendre(4)$PolynomialNumberTheoryFunctions a := rootOf(p4) q := sqrt(a - 1) Clearly, minimal polynomial of 'q' is given by: (14) -> pp := p4(z^2 + 1) 8 6 4 2 35 z + 140 z + 180 z + 80 z + 8 (14) ----------------------------------- 8 Type: Fraction(Polynomial(Integer)) and it checks: (15) -> eval(pp, z = q) (15) 0 Type: Fraction(Polynomial(AlgebraicNumber)) The code fails in 'rootFactor' (which looks like a bug in 'rootFactor'). After commenting out line calling 'rootFactor' we get mp := last gb 8 6 4 2 11 (37) x + 4 x + 6 x + 4 x + -- 8 Type: Polynomial(Fraction(Integer)) factor mp 8 6 4 2 11 (38) x + 4 x + 6 x + 4 x + -- 8 Type: Factored(Polynomial(Fraction(Integer))) which is not the minimal polynomial (plugging in 'q' does not give 0). AFAICS this is because the code only handle radicals. There is also question what to do with final 'factor'. If all intermediate root are independent, and generic case we will get irreducible polynomial. However, in non-generic case, that is when 'q' generates proper subfield of the field generated by roots (I think that such cases are extremally rare, but possible) I am not sure what will come out from Groebner basis computation. -- Waldek Hebisch -- You received this message because you are subscribed to the Google Groups "FriCAS - computer algebra system" group. To unsubscribe from this group and stop receiving emails from it, send an email to fricas-devel+unsubscr...@googlegroups.com. To view this discussion visit https://groups.google.com/d/msgid/fricas-devel/Z9HLrIPDaMH3Er4o%40fricas.org.