axiom-developer
[Top][All Lists]

## Re: [Axiom-developer] about Expression Integer

 From: Ralf Hemmecke Subject: Re: [Axiom-developer] about Expression Integer Date: Fri, 24 Feb 2006 11:12:18 +0100 User-agent: Thunderbird 1.5 (X11/20051201)

Perhaps I should have said this differently. Yes, I do agree that
the 'x' in '1/x' and '2*x' are different. But they are not
different in the sense in which 'x' and 'y' are different, i.e.
they are not different variables - they are the same variable
used in two different ways.



What is a variable anyway? Roughly speaking, it is something that has just a name. Some people like variables to behave transcendentally.


Let us take again the view that a polynomial ring "R[x]" (it's in quotes since I haven't defined that notation yet) is the ring

P = \bigoplus_{e \in N} R

where N are the non-negative integers.

Elements in P (the polynomials) are just functions with finite support from N to R. So the are nothing else than (infinite) sequences of numbers from R where only a finite non-zeros appear.

Now, let x \in P be such that x(1)=1 and x(e)=0 for e \in N\setminus\{1\}.


If you like, you can consider this x to be the "indeterminate" or "variable" of P.


It is also clear that by construction this x is different from anything that lives in R.


Further, if you take a ring R and a monoid M then there is the monoid ring RM which consists of all (finite) R-linear combinations of elements of M. (Well, R and M have to subsets of some common (bigger) ring S such that this construction makes sense.) Note that it is nowhere said that M must contain an element that is not in R. But, of course, with the above construction RR = R.


If [x] with the x from above is the free (abelian) monoid generated by x, then R[x] is a polynomial ring.


**What is differentiation in P?**

(That is a bit informal here.)

Given that elements in P have finite support, we can represent them as finite tuples. Let a := (a_0, a_1, ..., a_n) \in P, then the (formal) derivative of a is

a' = (a_1, 2 a_2, 3 a_3, ..., n a_n)

(Note that a_0 is missing.)

If you write a as a formal sum, using the x introduced above, you get.

a = \sum_{e=0}^n a_e x^e

a' = \sum_{e=0}^{n-1} a_{e+1} x^e

just as expected.


I very much have the impression that Bill likes to treat polynomials as functions in contrast to formal objects.

For example, let F be the Galois field with two elements. As polynomials

p(x) = x + 1 and q(x) = x^2 + 1 are clearly different since they have different support. But as polynomial functions from F to F, they are equal.

p(0) = 1 = q(0), p(1) = 0 = q(1)


If we were to treat polynomials in R[x_1,...,x_n] as functions from R^n to R, then I think it would be reasonable to differentiate also in the coefficient domain (but first define exactly what differentiation is, before such a domain is implemented).


I think that the current implementation of polynomials in Axiom more closely follow the formal approach. If somebody wants polynomials to behave differently, then there should be a clear documentation and an **additional** domain that support these ideas. But, please don't modify the existing polynomials in Axiom.


I guess you know that, so there is probably a misunderstanding
somewhere. Just to be clear:


sin x + y*cos x + y^2* tan x
is perfectly allright a polynomial in y.


I agree, but it is also a perfectly good polynomial in x
provided that it can appear as a member of the coefficient
domain:


Bill, if this is your terminology, I strongly disagree with you.

If I say something is "polynomial in x" then I mean if the expression is written as an expression tree then in the path from every x to the root I should at most see "^", "*", "+" (and "-").


(1) -> (sin x + y*cos x + y^2* tan x)$UP(x,EXPR INT) 2 (1) y tan(x) + sin(x) + y cos(x) Type: UnivariatePolynomial(x,Expression Integer) (2) -> degree % (2) 0 Type: NonNegativeInteger    Yes, Axiom is correct _and_ confusing! If a user want to construct something like UP(x,EXPR INT), then he should know what he is doing. Unfortunately, beginners probably don't know what they do when they type in UP(x,EXPR INT). And they will be surprise by the strange results. And I very much think that they will turn their back to Axiom, because it is so confusing. (Which would be a pity.)   Of course, if you claim that x+1/sin(x) is a polynomial, than I'm out of luck.  Indeed, I think you are out of luck. :( (3) -> ex1:=(x+1/sin(x))$UP(x,EXPR INT)

1
(3)  x + ------
sin(x)
Type: UnivariatePolynomial(x,Expression Integer)



Just for fun... who else on the list votes for x+1/sin(x) to be a "polynomial in x"? (Don't consider (3) when you vote.)
For me it's not a "polynomial in x". ;-)


Note that b::UP([x], INT) or b::POLY INT give errors!



Hey, if coerce: SOMETHING -> UP(x, INT) is a total function, then what does that mean?

>>> Obviouse 'b' has no representation in these domains.

Does someone believe that "coerce" always has to be an inclusion function?


Yes it has: 1 is a UP([x], INT).



No! 'b' for example in:

(9) ->   P := UP(x, EXPR INT)

(9)  UnivariatePolynomial(x,Expression Integer)
Type: Domain

(10) ->   a :P := x

(10)  x
Type: UnivariatePolynomial(x,Expression Integer)

(11) ->   b := a/x

1
(11)  - x
x
Type: UnivariatePolynomial(x,Expression Integer)

is not the same a '1\$P'


What does that matter? If we have two domains A and B, two elements
a \in A, b \in B, a function coerce: A->B, and coerce(a) = b.
The whole relation between a and b is clear.

But where is it written, that coerce in Axiom has to be a homomorphism? (BTW, a homomorphism of which type? Homomorphism of rings, of groups, of sets?)

Ralf