login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

This page gives a few comments about the expression domain Expression Integer and the use of more specific domains.

The Integer in Expression Integer is maybe misleading. Just think of Expression Integer as something that makes panAxiom behave like a (nearly) untyped computer algebra system like Maple or Mathematica.

Roughly speaking, you forget about all the type stuff. That's not totally true, but for a new user it is probably the best way to do the first steps just with (untyped) expressions.

You can only appreciate all those different types if you do more advanced things in panAxiom. Types especially become important if one wants to implement a bigger library.

One big difference for example is: In Expression Integer it is undecidable whether an element is actually equal to zero. Consequently, expressions which mathematically have the same value may be different as elements of Expression(Integer). Actually, arithmetic in Expression(Integer) is automatically doing algebraic simplifications, but otherwise treats quantities as independent. So if you say zero?(e) for some expresssion e you might get false although e can actually be simplified to zero.

fricas
(1) -> e: Expression Integer := sin(x)^2 -1 + cos(x)^2

\label{eq1}{{\sin \left({x}\right)}^{2}}+{{\cos \left({x}\right)}^{2}}- 1(1)
Type: Expression(Integer)
fricas
zero? e

\label{eq2} \mbox{\rm false} (2)
Type: Boolean
fricas
simplify e

\label{eq3}0(3)
Type: Expression(Integer)

Technically, expression above is an algebraic relation between transcendental quantities sin(x) and cos(x). FriCAS can handle such relations between elementary functions (via normalize), but does not do this automatically. But elementary constants cause theoretical trouble (see SchanuelConjecture?). And nonelementary functions may satisfy relations unknown to FriCAS.

Similarly, Expression(Integer) treats algebraic quantities as independent:

fricas
a := x^(1/4)

\label{eq4}\root{4}\of{x}(4)
Type: Expression(Integer)
fricas
b := sqrt(x)

\label{eq5}\sqrt{x}(5)
Type: Expression(Integer)
fricas
a^2 - b

\label{eq6}{{\root{4}\of{x}}^{2}}-{\sqrt{x}}(6)
Type: Expression(Integer)
fricas
-a^2 - b

\label{eq7}-{{\root{4}\of{x}}^{2}}-{\sqrt{x}}(7)
Type: Expression(Integer)

Mathematically, for given x in a field, one of the two expressions above must be zero. But FriCAS shows both as if they were nonzero.

At deeper level, FriCAS treats expression as rational function of kernels. Simple calculations in Expression(Integer) are correct only if kernels are independent, that is transcentental kernels are algebraically independent and defining polynomials of algebraic kernels are irreducible.

For transcendental elementary functions normalize from ElementaryFunctionStructurePackage rewrites expression in terms of algebraically independent kernels.

Note: For simpler, more specialized domains like 'DMP([a,b]?, Integer)', the function zero? always returns what you expect.




  Subject:   Be Bold !!
  ( 15 subscribers )  
Please rate this page: