FriCAS now modified equality so the problem is not present. I try : fricas (1) -> a := 3 + sqrt 5
Type: AlgebraicNumber?
fricas (-a = (a^2)^(1/2))::Boolean
Type: Boolean
But fricas (sqrt 2 = - sqrt 2)::Boolean
Type: Boolean
I expect the same result, and I prefer false. meaning of sqrt --Bill Page, Wed, 19 Apr 2006 10:30:27 -0500 reply Do you consider to be a particular (single) solution
of , e.g. the positive one, or the general solution of
this polynomial? I prefer the latter, so I think both (2) and (3)
should be true .
Axiom's sqrt does not seem to be multiple valued, so therefore I
disagree with you Bill, it cannot be the general solution of the
polynomial. As with most other systems, sqrt is taken to be the
positive root only, and if it comes from the solution of a quadratic,
the +/- multiple valued-ness must be encoded elsewhere.
e.g. fricas sqrt(2)::Float
Type: Float
gives only one value. Also note that axiom is not even self-consistent here: fricas -a::Float
Type: Float
fricas (a^2)^(1/2)::Float
Type: Expression(Float)
which clearly are not equal. If you write:fricas -a=(a^2)^(1/2)
Type: Equation(AlgebraicNumber?)
fricas coerce(%%(7))$Equation(AlgebraicNumber)
Type: Boolean
you are asking about equality in the domain of AlgebraicNumber? (whatever that happens to be). But if you write: fricas coerce(%%(7)::Equation(Float))$Equation(Float)
Type: Boolean
then you are referring to equality in the domain
Float. These need not be the same thing. But I agree
that Axiom does not have an entirely consistent
treatment of http://wiki.axiom-developer.org/axiom--test--1/src/algebra/ConstantSpad In AlgebraicNumber? we find: a=b == trueEqual((a-b)::Rep,0::Rep) In InnerAlgebraicNumber? it says: trueEqual(a,b) == -- if two algebraic numbers have the same norm (after deleting repeated -- roots, then they are certainly conjugates. Note that we start with a -- monic polynomial, so don't have to check for constant factors. -- this will be fooled by sqrt(2) and -sqrt(2), but the = in -- AlgebraicNumber knows what to do about this. but unfortunately is seems that the special treatment of
Apparently IAN implements trueEqual : (%,%) -> Boolean ++ trueEqual(x,y) tries to determine if the two numbers are equal fricas trueEqual(sqrt(2),This is quite strange. As I understand it, AN is almost IAN (only three functions have over-riding implementations: zero? , one? , and = ) and yet, = in AN is not transitive, but apparently, trueEqual in IAN is:
fricas a:AN:=sqrt(5)+3
Type: AlgebraicNumber?
fricas b:=(a^2)^(1/2)
Type: AlgebraicNumber?
fricas (a=b)::Boolean
Type: Boolean
fricas (a=-b)::Boolean
Type: Boolean
fricas (b=-b)::Boolean
Type: Boolean
fricas f:IAN:=sqrt(5)+3 But this is deceptive since
There is also Perhaps Two elements alpha, beta of a field K, which is an extension field of a field F, are called conjugate (over F) if they are both algebraic over F and have the same minimal polynomial. ... This conjugacy relation is an equivalence relation on the set of algebraic elements in a given extension K of the field F. So if Some details of the algorithm are here: http://www.csd.uwo.ca/~watt/pub/reprints/1995-issac-dynev.pdf See especially reference [DDD]. Anonymous wrote:I expect the same result, and I prefer false. This result is possible using the RealClosure package: fricas Ran := RealClosure( Fraction(Integer) )
Type: Type
fricas a1:Ran := 3 + sqrt 5
Type: RealClosure(Fraction(Integer))
fricas (-a1 = (a1^2)^(1/2))::Boolean
Type: Boolean
fricas a2:=sqrt(2)$Ran
Type: RealClosure(Fraction(Integer))
fricas a3:=-sqrt(2)$Ran
Type: RealClosure(Fraction(Integer))
fricas (a2=a3)::Boolean
Type: Boolean
Status: open => closed
|