Re: The right type for the right job

Ralf Hemmecke <[email protected]>
Newsgroups gmane.comp.mathematics.axiom.general
Message-ID <[email protected]>
Hi igor,

[...]

> The above is a very nice example of a domain for a restricted use,
> where only the algebraic relation s^2+c^2=1 is important in the
> coefficients of the power series we wish to work with.

> I have a very different purpose in mind, and I wonder if anyone can
> come up with the right type for it. Say I have a few symbols
> [x,y,z,...] and a binary operagor g. I'm only interested in
> polynomials or rational functions with, say, integer coefficients in
> the formal expressions g(x,x), g(x,y), g(y,z), etc. Is there a type
> that restricts to just this sort of expressions?

Your coefficients are integers your variables are "formal expressions" 
of the form "g(x,y)" where x and y are from a fixed (finite) set of 
variables. That is VERY easy. Assume you have n variables in the set 
V={x,y,...,z} then the set of "formal" expressions

W = {g(x,x), g(x,y), ..., g(y, x), g(y,y), ..., g(z,z)}

has exactly n^2 elements.

If you form the rational function field

Q(T_xx, T_xy, ..., T_yx, T_yy, ..., T_zz)

you have exactly what you described above.

BTW, I strongly believe that what you described is not what you want.
Read my previous mail
http://lists.nongnu.org/archive/html/axiom-math/2006-08/msg00029.html
where I describe that / is not available for the rational numbers if you 
just consider them to be a ring.

That is the same here. What you get is a field of rational functions, 
but you certainly see easily that you cannot express
g(x, g(x,y)) in that ring. But, it is your fault. You did not give a 
proper specification. If you want to talk to a computer you have to be 
precise. You cannot expect that it guesses, that your specification 
might not be the thing you want. Current computer systems are in general 
not that advanced (yet).

> None of the Polynomial or
> similar domains in Axiom can handle this situation because non-symbols
> like g(x,y).

Have you ever tried to convert g(x,y) into a symbol?
I cannot do it since you haven't given me the type of g(x,y). But if we 
could say for a moment that we consider "g(x,y)" then I just type...

"g(x,y)"::Symbol

at the axiom prompt and get

    (2)  g(x,y)
                                           Type: Symbol

So don't say, it's not a symbol.

Ralf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.