On 1 Jun., 18:56, Carl Witty <[EMAIL PROTECTED]> wrote: > Sage has such a decision procedure built in to its implementation of > QQbar, the algebraic numbers.
But I have to say they are quite hidden in the reference manual. Thank you for this hint. I also found AA the algebraic reals if your computations only involve reals. > sage: QQbar(sqrt(-2)*sqrt(-3) + sqrt(6)) == 0 > True Using QQbar or AA also my previous example works: QQbar(sqrt(5+2*sqrt(2)*sqrt(3))-sqrt(2)-sqrt(3)) == 0 True AA(sqrt(5+2*sqrt(2)*sqrt(3))-sqrt(2)-sqrt(3)) == 0 True However is it a *bug* that this does not work in the symbolic Ring with is_zero? (sqrt(5+2*sqrt(2)*sqrt(3))-sqrt(2)-sqrt(3)).is_zero() False And good to know that with QQbar or AA the rule of coercing to the lowest precision works. AA(sqrt(2))*1.0 1.41421356237309 QQbar(sqrt(2)) * CC(1.0) 1.41421356237309 But back to SymbolicRing and SymbolicConstant. I have the following improvement SUGGESTION: when creating sqrt(2) or other roots from integers, then assign to them the parent AlgebraicReal or AlgebraicNumer accordingly instead of the too general Symbolic Ring. Coercing (see above) and calculating with AA and QQbar works well, for example: sqrt(AA(sqrt(2))).parent() Algebraic Real Field sqrt(-AA(sqrt(2))).parent() Algebraic Field For future development maybe one can introduce a RealSymbolicConstant (and ComplexSymbolicConstant) which allow application of the common real functions like +,-,*,/,^, exp, log, sin, cos, etc. However the difficulty I see here is that we must be able to decide whether such an expression is 0 if we want to reject expr1/expr2 or log(expr2) for expr2 being 0. We also must be able to decide whether such an expression is greater 0. When we want to determine the outcome (RealSymbolicConstant or ComplexSymbolicConstant) of log(expr) or expr ** (1/n). So maybe this isnt possible from a theoretical point of view as those questions maybe undecidable (opposed to the algebraic case) which however is not yet clear for me. --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---