[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [Axiom-developer] about Expression Integer
From: |
Page, Bill |
Subject: |
RE: [Axiom-developer] about Expression Integer |
Date: |
Thu, 23 Feb 2006 18:38:46 -0500 |
On Wednesday, February 22, 2006 1:11 PM Francois Maltey wrote:
>
> "Bill Page" writes :
>
> > > > Could you please define in what sense "Otherwise we don't
> > > > get a polynomial, obviously."? To me this is not obvious -
> > > > it is wrong.
> > >
> > > Why should this be wrong?
> > >
> > > Here's a definition for polynomial from wikipedia:
> > >
> > > In mathematics, a polynomial is an expression in which
> > > constants and variables are combined using (only) addition,
> > > subtraction, and multiplication. Thus, 7x^2+4x-5 is a
> > > polynomial; 2/x is not.
>
> I have the same point of view than Martin, everything is done
> in DMP in order to have a polynomial ring, DMP isn't only a
> << collect >> command which factorise x and so.
I agree with you that DMP must be a polynomial ring.
In Axiom, when we define a polynomial we must say over what
ring the polynomial is defined. The first parameter of DMP
is a list of variables, the second parameter is the name of
a ring - any ring. It is usual to define, for example:
DMP([x,y],Integer)
where 'Integer' is the underlying ring. This means that we
will allow polynomials with variables 'x' and 'y' and where
the coefficients are integers.
And 'DMP([x,y],Integer)' itself is a ring.
'Expression Integer' is also a ring. 'Expression Integer'
includes expressions such as '1/x'.
So it makes sense to write:
'DMP([x,y],Expression Integer)' where now the coefficients
come from the ring 'Expression Integer'.
'DMP([x,y],Expression Integer)' is still a ring. Axiom will
not confuse the '1/x' which can occur as a coefficient, with
the 'x' or 'y' that appears as a polynomial variable.
Everything works as it should, no?
>
> > I think this definition is less general than it needs to
> > be and difficult to apply in the context of Axiom.
>
> If we change DMP assumption, it's no more ring.
I do *not* propose to change the way DMP is implemented.
I think it is correct except for the way 'differentiate' is
defined.
>
> > We need to know what are "constants" and what are "variables"
>
> So the same variable is forbidden in the constant ring.
> I find it's a bug to allow DMP([X,Z], DMP([X,Y], INT))
It is not a bug. I hope that you agree that 'DMP([X,Y], INT)'
is a ring. That is all that is required for 'DMP([X,Z], ... )'
to be a polynomial. Axiom will keep [X,Z] that appears in
the polynomial separate from the [X,Y] that appear in the
coefficients of this polynomial.
That is why I said the definition of polynomial above is not
good for Axiom. Axiom does not implement the idea of "variable"
and a "constant" in this way.
>
> > > I recall that in the Algebra course I attended, the
> > > polynomial ring was defined as a ring (of coefficients)
> > > together with a variable which is to be transcendent over
> > > that ring.
> >
> > That definition is much better. In the case we are discussing
> > the ring of coefficients is the domain 'EXPR INT' which
> > includes expressions of the form '1/x' and so it is correct
> > to say that '2/x' is not in itself a polynomial but it can
> > be a coefficient in a polynomial.
>
> I don't think so, a polynomial ring has variables which are
> not in the initial ring.
The polynomial ring is a different domain than the initial
ring. So I agree that the 'x' that appears as the polynomial
variable is different than the 'x' that appears in the
coefficient '1/x'. I do not like to say "variable" because
Axiom does not have any concept of variable outside of the
context of some domain. To speak in the most accurate way
possible, we must say that the same *symbol* 'x' is used in
two different ways.
> The DMP error (for derivative) isn't in the derivative
> function but in the fact that axiom accepts 1/x has
> variable in DMP[x].
First you must agree that '1/x' is a member of the ring
'Expression Integer'. Yes?
In 'Expression Integer', the result of 'differentiate(1/x,x)'
is '-1/x^2'. Of course.
If DMP is defined over the ring 'Expression Integer' then
'1/x' can be a coefficient of the polynomial. Yes?
Comparing DMP (DistributedMultivariatePolynomial) to UP
(Univariate Polynomial), we see in the source code for UP it
states that if the ring over which a polynomial is defined is
itself a polynomial ring, then 'differentiate' in DMP is defined
as the 'DifferentialExtension' of 'differentiate' in the
underlying ring. This works correctly in the case of the
domain 'UnivariatePolynomial' but fails in the case of DMP
defined over only one variable even though these two domains
should be functionally equivalent. In the latter case DMP
treats '1/x' as if it was a constant.
>
> And 1/x isn't transcendent over that ring because y=1/x is
> solution of xy-1=0 in this field.
No, that is not true because
1
- x
x
is not 1 in DMP([x,y],EXPR INT) if '1/x' is the coefficient
and the 'x' on the right is the polynomial variable!
Perhaps that is what seems strange to you. The problem is that
you are not taking account of the *domain* in which these
expressions are defined.
>
> Either we say to the user he _must_ be careful with this,
> (only in the EXPR INTEGER field?)
> Either monomial command of DMP reject 1/x coefficient if x is
> a variable.
>
I think we must say to the user that he _must_ be careful because
Axiom strictly implements the concept of 'domain' (which is just
another way of saying that Axiom is strongly typed) but often in
mathematics this notion is used only informally, if at all.
The concept of domain allows us to be more precise when we
encounter expressions such as:
1
- x
x
Whether this expression is identical to 1 or not depends on the
domain. This distinction is very similar to whether we treat
'x * y * x' as equivalent to 'x^2*y'. This depends on whether
or not in this domain the operation '*' is commutative.
> In France we say we can be << jesuite >> :
> The real axiom accepts coefficients as 1/x in DMP ([x], EXPR INT)
> because axiom EXPR INT isn't perfect, but it shouldn't.
> But I'm sure it's a mistake to change derivative.
>
I do not propose to change the derivative. I expect that DMP
should treat the derivative of the polynomial as an extension
of the derivative of the underlying ring in the same way that
UP does this.
> > How would you use such a domain to solve the problem originally
> > posed by Francois about expansion of trigonometric expressions
> > that started this thread?
>
> When we expand a trigonometric expression,
> the question is a << linear one >> not a polynomial one.
>
> We expand more often sin (4*x+5*y) than sin (x^2+x) ;
> for sin (x^2+x) we use series.
>
Sure, but Axiom already defines the trigonometric expansion of
'sin(x^2+x)' in the same way as other systems such as Maple and
Mupad:
(1) -> expand sin(x^2+x)
2 2
(1) cos(x)sin(x ) + cos(x )sin(x)
Type: Expression Integer
Your question was about the proper treatment of expressions
involving terms like '1/x'. My point is that the Axiom domain
'DMP([x,y],EXPR INT)' treats '1/x' in the way that you need
for this expansion.
Regards,
Bill Page.
- Re: [Axiom-developer] about Expression Integer, (continued)
- Re: [Axiom-developer] about Expression Integer, Ralf Hemmecke, 2006/02/21
- RE: [Axiom-developer] about Expression Integer, Bill Page, 2006/02/21
- Re: [Axiom-developer] about Expression Integer, Doug Stewart, 2006/02/20
- RE: [Axiom-developer] about Expression Integer, Bill Page, 2006/02/21
- Re: [Axiom-developer] about Expression Integer, Francois Maltey, 2006/02/19
- RE: [Axiom-developer] about Expression Integer, Bill Page, 2006/02/19
- Re: [Axiom-developer] about Expression Integer, Ralf Hemmecke, 2006/02/19
- Re: [Axiom-developer] about Expression Integer, William Sit, 2006/02/21
- RE: [Axiom-developer] about Expression Integer, Bill Page, 2006/02/21
- RE: [Axiom-developer] about Expression Integer,
Page, Bill <=
- RE: [Axiom-developer] about Expression Integer, Page, Bill, 2006/02/24
- RE: [Axiom-developer] about Expression Integer, Page, Bill, 2006/02/24