|
|
last edited 8 years ago by test1 |
1 2 3 | ||
Editor:
Time: 2007/11/17 22:21:16 GMT-8 |
||
Note: |
changed: - I try : \begin{axiom} a := 3 + sqrt 5 (-a = (a^2)^(1/2))::Boolean \end{axiom} But \begin{axiom} (sqrt 2 = - sqrt 2)::Boolean \end{axiom} I expect the same result, and I prefer false. From BillPage Wed Apr 19 10:30:27 -0500 2006 From: Bill Page Date: Wed, 19 Apr 2006 10:30:27 -0500 Subject: meaning of sqrt Message-ID: <20060419103027-0500@wiki.axiom-developer.org> Do you consider $\sqrt{2}$ to be a particular (single) solution of $x^2-2=0$, 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'. From BobMcElrath Wed Apr 19 11:11:19 -0500 2006 From: Bob McElrath Date: Wed, 19 Apr 2006 11:11:19 -0500 Subject: meaning of sqrt Message-ID: <20060419161112.GA28426@mcelrath.org> In-Reply-To: <20060419103027-0500@wiki.axiom-developer.org> 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. \begin{axiom} sqrt(2)::Float \end{axiom} gives only one value. Also note that axiom is not even self-consistent here: \begin{axiom} -a::Float (a^2)^(1/2)::Float \end{axiom} which clearly are not equal. From BillPage Wed Apr 19 18:11:31 -0500 2006 From: Bill Page Date: Wed, 19 Apr 2006 18:11:31 -0500 Subject: equality is domain specific Message-ID: <20060419181131-0500@wiki.axiom-developer.org> If you write: \begin{axiom} -a=(a^2)^(1/2) coerce(%%(7))$Equation(AlgebraicNumber) \end{axiom} you are asking about equality in the domain of AlgebraicNumber (whatever that happens to be). But if you write: \begin{axiom} coerce(%%(7)::Equation(Float))$Equation(Float) \end{axiom} 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 'sqrt' even within a given domain. :( From BillPage Wed Apr 19 18:22:55 -0500 2006 From: Bill Page Date: Wed, 19 Apr 2006 18:22:55 -0500 Subject: equality in AlgebraicNumber Message-ID: <20060419182255-0500@wiki.axiom-developer.org> From: 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 'sqrt(2)' (and similar algebraic numbers) was never implemented. :( From BillPage Wed Apr 19 20:35:13 -0500 2006 From: Bill Page Date: Wed, 19 Apr 2006 20:35:13 -0500 Subject: equality in InnerAlgebraicNumber Message-ID: <20060419203513-0500@wiki.axiom-developer.org> InnerAlgebraicNumber (IAN) is described as -- Algebraic closure of the rational numbers. while AlgebraicNumber (AN) is described as -- Algebraic closure of the rational numbers, with mathematical = Apparently IAN implements 'trueEqual' as the equivalence relation defined by conjugation:: trueEqual : (%,%) -> Boolean ++ trueEqual(x,y) tries to determine if the two numbers are equal \begin{axiom} trueEqual(sqrt(2),-sqrt(2))$IAN \end{axiom} From WilliamSit Wed Apr 19 22:18:11 -0500 2006 From: William Sit Date: Wed, 19 Apr 2006 22:18:11 -0500 Subject: So = in AN is not transitive. Message-ID: <20060419221811-0500@wiki.axiom-developer.org> 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: \begin{axiom} a:AN:=sqrt(5)+3 b:=(a^2)^(1/2) (a=b)::Boolean (a=-b)::Boolean (b=-b)::Boolean f:IAN:=sqrt(5)+3 g:=(f^2)^(1/2) trueEqual(f,-g) trueEqual(f,g) trueEqual(g,-g) \end{axiom} But this is deceptive since 'trueEqual(g, -g)' is not 'trueEqual(g+g,0)'. Note we cannot use 'trueEqual(a,b)' or 'trueEqual(a-b,0)' since there is *no* coercion from 'AN' to 'IAN' . Moreover, 'trueEqual' is not transitive either. \begin{axiom} trueEqual(g+g,0) -- not the same as trueEqual(g, -g) trueEqual(-f,g) trueEqual(f,-f) \end{axiom} There is also '=' in 'IAN', which is implemented using '=' in 'EXPR INT' . Perhaps 'trueEqual' should be called 'conjugate?' instead and exported from 'AN', and '=' in 'AN' is really not possible. Also, 'trueEqual' is only used in 'constant.spad' and changing its name will not affect any other constructors. But From BillPage Thu Apr 20 00:16:28 -0500 2006 From: Bill Page Date: Thu, 20 Apr 2006 00:16:28 -0500 Subject: conjugacy relation is an equivalence relation Message-ID: <20060420001628-0500@wiki.axiom-developer.org> http://mathworld.wolfram.com/ConjugateElements.html > 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 'trueEqual' is supposed to implement 'conjugate?' then the bug must be in 'trueEqual', I think. Some details of the algorithm are here: http://www.csd.uwo.ca/~watt/pub/reprints/1995-issac-dynev.pdf See especially reference ![DDD]. From BillPage Thu Apr 20 00:47:57 -0500 2006 From: Bill Page Date: Thu, 20 Apr 2006 00:47:57 -0500 Subject: Message-ID: <20060420004757-0500@wiki.axiom-developer.org> Anonymous wrote: > I expect the same result, and I prefer false. This result is possible using the RealClosure package: \begin{axiom} Ran := RealClosure( Fraction(Integer) ) a1:Ran := 3 + sqrt 5 (-a1 = (a1^2)^(1/2))::Boolean a2:=sqrt(2)$Ran a3:=-sqrt(2)$Ran (a2=a3)::Boolean \end{axiom}
I try :
a := 3 + sqrt 5
(1) |
(-a = (a^2)^(1/2))::Boolean
(2) |
But
(sqrt 2 = - sqrt 2)::Boolean
(3) |
I expect the same result, and I prefer false.
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.
sqrt(2)::Float
(4) |
gives only one value.
Also note that axiom is not even self-consistent here:
-a::Float
(5) |
(a^2)^(1/2)::Float
(6) |
which clearly are not equal.
If you write:-a=(a^2)^(1/2)
(7) |
coerce(%%(7))$Equation(AlgebraicNumber)
(8) |
you are asking about equality in the domain of AlgebraicNumber? (whatever that happens to be). But if you write:
coerce(%%(7)::Equation(Float))$Equation(Float)
(9) |
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 sqrt
even within a given domain. :(
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 sqrt(2)
(and similar algebraic numbers) was never implemented. :(
Apparently IAN implements trueEqual
as the equivalence relation
defined by conjugation:
trueEqual : (%,%) -> Boolean ++ trueEqual(x,y) tries to determine if the two numbers are equal
trueEqual(sqrt(2),-sqrt(2))$IAN
(10) |
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:
a:AN:=sqrt(5)+3
(11) |
b:=(a^2)^(1/2)
(12) |
(a=b)::Boolean
(13) |
(a=-b)::Boolean
(14) |
(b=-b)::Boolean
(15) |
f:IAN:=sqrt(5)+3
(16) |
g:=(f^2)^(1/2)
(17) |
trueEqual(f,-g)
(18) |
trueEqual(f,g)
(19) |
trueEqual(g,-g)
(20) |
But this is deceptive since trueEqual(g, -g)
is not trueEqual(g+g,0)
. Note we cannot use trueEqual(a,b)
or trueEqual(a-b,0)
since there is no coercion from AN
to IAN
. Moreover, trueEqual
is not transitive either.
trueEqual(g+g,0)
(21) |
trueEqual(-f,g)
(22) |
trueEqual(f,-f)
(23) |
There is also =
in IAN
, which is implemented using =
in EXPR INT
.
Perhaps trueEqual
should be called conjugate?
instead and exported from AN
, and =
in AN
is really not possible. Also, trueEqual
is only used in constant.spad
and changing its name will not affect any other constructors. But
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 trueEqual
is supposed to implement conjugate?
then
the bug must be in trueEqual
, I think.
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:
Ran := RealClosure( Fraction(Integer) )
(24) |
a1:Ran := 3 + sqrt 5
(25) |
(-a1 = (a1^2)^(1/2))::Boolean
(26) |
a2:=sqrt(2)$Ran
(27) |
a3:=-sqrt(2)$Ran
(28) |
(a2=a3)::Boolean
(29) |