axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Axiom-developer] Re: coerce, cast, partial fractions


From: William Sit
Subject: Re: [Axiom-developer] Re: coerce, cast, partial fractions
Date: Sat, 11 Oct 2003 03:34:46 -0400

Dylan Thurston wrote:
> 
> On Thu, Oct 09, 2003 at 10:31:55AM -0400, Tim Daly wrote:
> > If I understand the partialFraction answer (perhaps I don't) the
> > result given is a partial fraction as far as Axiom is concerned.
> > Partial fractions work on the factored equation and it appears
> > that Axiom doesn't think it can factor the equation over the
> > target domain so the partial fraction uses the "fully factored"
> > value. The issue appears to be that the target domain chosen by
> > the interpreter is one in which there are no factors. Or perhaps
> > it is just a street-level bug :-)
> 
> But how could x^2-1 not be factorizable in any reasonable domain?
> 
> I can see that AXIOM might pick a domain where it doesn't know how to
> factor, but I would be very surprised to see one coming from an
> expression like this!
> 
Surely, x^2 -1 can be factored in POLY INT and Axiom behaves correctly. So the
problem is not with factoring.

Remember that algorithms in Axiom are categorical. From the documentation in
partialFraction:

"For a general euclidean domain, it is not known how to factor the denominator.
Thus the function partialFraction takes as its second argument an element of
Factored(R)."

It also states that the requirement for R to be a euclidean domain is to
normalize the denominator.

The fact that SOME domains (or denominators) can be factored is irrelevant to
Axiom.

An example is:
a = DMP([x,y], FRAC INT) does not have EuclideanDomain
b = DMP([x], FRAC INT) does not have EuclideanDomain
c = UP(x, FRAC INT) has EuclideanDomain

even though mathematically, b and c are the same. But categorically, the DMP
constructor does not have EuclideanDomain. Of course, nothing prevents us from
saying something like:
  DMP(varlist, ring) ...
  if size?(varlist,1) then EuclideanDomain
or if size?(varlist,1) then UnivariatePolynomialCategory

but this is not done.

Expression Integer has EuclideanDomain returns true.  Why?
It seems to inherit this from FunctionSpace(Integer), but I searched the sources
fspace.spad and expr.spad and neither reference EuclideanDomain directly. (This
shows how difficult it is to construct the graph of hierarchy based on source
files).

The problem with partialFraction not working over R = POLY INT is because POLY
INT does not belong to the category EuclideanDomain (it is multivariate).

However, there is definitely something wrong with the interpreter. In the NAG
2.3 version, I actually have:

G82322 (3) -> )clear all
   All user variables and function definitions have been cleared.
G82322 (1) -> up:= UP(x,FRAC INT)

   (1)  UnivariatePolynomial(x,Fraction Integer)
                                                                 Type: Domain
G82322 (2) -> a:up:=1-x^2

           2
   (2)  - x  + 1
                               Type: UnivariatePolynomial(x,Fraction Integer)
G82322 (3) -> b:up:=2*x^3

          3
   (3)  2x
                               Type: UnivariatePolynomial(x,Fraction Integer)
G82322 (4) -> partialFraction(b,factor(a))

                 1       1
   (4)  - 2x - ----- - -----
               x - 1   x + 1
               Type: PartialFraction UnivariatePolynomial(x,Fraction Integer)
G82322 (5) -> partialFraction(b,a)

                 1       1
   (5)  - 2x - ----- - -----
               x - 1   x + 1
               Type: PartialFraction UnivariatePolynomial(x,Fraction Integer)
G82322 (6) -> partialFraction(2*x^3::up, 1-x^2::up)

              3
            2x
   (6)  - ------
           2
          x  - 1
                                     Type: PartialFraction Expression Integer
G82322 (7) -> partialFraction(b,a)

                 1       1
   (7)  - 2x - ----- - -----
               x - 1   x + 1
               Type: PartialFraction UnivariatePolynomial(x,Fraction Integer)


I did (7) just to make sure that (5) does not come because of (4) (and (7) does
not come because of (6)).

But why do (5) and (6) behave differently? Aren't these two syntactically the
same? In each case the second parameter need to be coerced to Factored(R) but
the two R's are different in (5) and (6).  The behavior in the NAG 2.3 version
is also different from the one reported by Tim Daly :

Tim:(8) -> partialFraction((2*x^3)::UP(x, FRAC INT), (1-x^2))

                 2x
   (8)  - 2x - ------
                2
               x  - 1
               Type: PartialFraction UnivariatePolynomial(x,Fraction Integer)
Tim:(9) -> partialFraction((2*x^3), (1-x^2)::UP(x, FRAC INT))

                 1       1
   (9)  - 2x - ----- - -----
               x - 1   x + 1
               Type: PartialFraction UnivariatePolynomial(x,Fraction Integer)

I have:
partialFraction(2*x^3::UP(x, FRAC INT), 1-x^2)


              3
            2x
   (6)  - ------
           2
          x  - 1
                                     Type: PartialFraction Expression Integer

but I also got Tim's (9) the same.


William




reply via email to

[Prev in Thread] Current Thread [Next in Thread]