Let x1,...,xm and y1,...,yn be two sets of variables. I'd like to be
able to consider linear combinations of y1,...,yn whose coefficients
are arbitrary polynomials in x1,...,xm. That's not difficult, one just
writes them down. The next step is that I want to define a nonassociative
operation # making these linear combinations into a commutative
non-associative algebra L (i.e. not necessarily associative) over the
ring R of polynomials in x1,...,xm. I can certainly create a nonassociative
operation by declaring infix("#"). I just don't know how to do anything
with it. I need to be able to tell maxima that:
(1) a # b is additive in a and additive in b. There is an OPPROPERTY called
ADDITIVE but I don't know how to invoke it and I don't know whether it
implies biadditivity in the case of a binary operation.
(2) * has higher precedence than #, so that a # b*c means a # (b*c), and
# has higher precedence than +,-.
(3) We're given an n x n matrix M whose entries are elements of L.
(4) With biadditivity, if a,b are elements of L then a # b is reducible,
using (1),(2), to a sum of terms of the form m1*yi # m2*yj where m1,m2
are monomials (maybe with integer coefficients) in x1,...,xm. I need to
be able to tell Maxima that this simplifies to m1*m2*M[i,j]. (Thus, the
# product of two linear combinations turns out to be another linear
combination, so L is a nonassociative algebra over R.
How do I do that?
In REDUCE, it was possible to do some of this conveniently by means of
commands such as (I forget exactly):
FOR ALL A,B,C LET F(A+B,C)=F(A,C)+F(B,C);
i.e. you could define stuff by induction on the structure of expressions.
I'm not sure this was entirely documented. I tried it once as an act of
desperation and it worked. I don't think I ever got anything this complicated
to work in REDUCE though.
--
Ignorantly,
Allan Adler
* Disclaimer: I am a guest and *not* a member of the MIT CSAIL. My actions and
* comments do not reflect in any way on MIT. Also, I am nowhere near Boston.