FriCAS expression domains are based on notion of differential field. This
have advantages, for example some otherwise unsolvable problems became
solvable when dealing with differential fields. But this also means
that FriCAS expression behave differently than function in real analysis.
For example, in field quadratic equation have 0, 1 or 2 roots.
In particular consider equation
where
is variable of the
equation and
is element of differential field representing
variable
. This equation have exactly two
roots, namely
and
. This means that absolute value
of real function is excluded, since for real
we have
,
so
would be solution to
, but
is different
than
or
. In fact, forbiding absolute value is crucial to
solvability --- Richardson proved that equality for expressions build
from variable
, rational constants, constant
, trigonometric
functions and absolute values by composition and arithmetic operations
is undecidable. When we put functions above inside a differential
field equality becomes decidable (note: "put inside" means that
we provide extra information).
By Seidenberg theorem finitely generated differential field of characteristic
is izomorphic to a subfield of field of meromorphic functions in some
complex domain (open and connected set). And opposite: field of meromorphic
functions in complex domain is a differential field. So differential
field correspond very well to complex analysis. But there may
be some mismatch when one wants to deal with real analysis.
Dealing with differential field we implicitly remove inessential
singularities, so we treat
and
as the same function
(for more background see Division by zero during evaluation).
Also, by principle of analytic continuation we may restrict
functions to arbitrarily small open set and still get izomorphic
field. Which means that to get interesting results we may be
forced to perform analytic continuation. Since we work with
connected sets, we have to chose some branch of function
which otherwise is considered as multivalued function. Notably,
we have to chose branches of logarithms and roots. Interestingly,
in many cases choice of branches does not matter much, we get
equivalent results for different choices. What matters are
dependencies. For example at algebraic level it does not
matter which square roots of
and
we chose, all four choices
give isomorphic fields. However, when we add square root
of
, we get dependence, either
or
. In numerical computations
it is usual to make choice of root, for example to use so
called principal branch of square root. However, in purely
algebraic context there is no canonical way to distinguish roots
and all roots of the same irreducible equation play equivalent
role. In context of differential fields logarithm is determined
up to additive constant and there is no way to have canonical
choice of constant, all choices lead to izomorphic differential
fields.
Important property of Expression(Integer) is that FriCAS does not enforce
having differential field. FriCAS allows dependent root, which as
shown above lead to zero divisors. FriCAS allows both exp(x)^2 and
exp(2*x) in a single expression and by default treats them as
different quantities. Note that using differential calculus one can prove
that exp(x)^2 and exp(2*x) are equal. This means that when both
are used in a single expression then laws of differential field my by
violated. FriCAS has abs and diracDelta
and few other expressions of similar nature. In arithmetic such
expression are treated as transcendental quatities. This is sound
in sense that succesfull computation can not produce false equality.
But many such expression does not correspond to things in analitic
world. FriCAS does not have complete knowledge about such expressions,
so in some cases can not discover when in analytic world given expression
is 0. Worse, such unrecognized 0 can appear in the denominator. If some
later transformation manages to simplify the denominator, it may lead
to division by 0.
Computations which depend on having differential field usually call
normalize or similar function. This removes various redundancies
which for transcendental elementary functions means that computations
with transformed expression will work within a differential field.
In principle algebraic quantities (like square roots) and abs can
be treated by considering possible cases, but currently in few simple
cases FriCAS takes single choice and other cases are not handled at
all.
Compared to some other systems FriCAS approach have both advantages:
- FriCAS avoids unsolvability due to Richardson theorem
- there are powerful algorithms working in differential fields
but also some disadvantages. Main limitation is that with FriCAS
approach it is harder to handle solvable instances of problems
involving absolute value.