My apologies if this has been asked before. Please also be gentle, as this is my first question here.
I am trying to define a commutative algebra by generators and relations in the following way. For a simple example, we can consider the Z[b] algebra generated by a, modulo a^2=b. I would like to introduce a rule (or a list of rules in more complicated examples):
In: TheAlgebra = a*a -> b
It would be cool to evaluate products like this:
In: a^3 //. TheAlgebra
However, this input simply returns the symbol
a^3. I would have expected the result
a*b. The following input works though:
In': (a*a//.TheAlgebra)*a //. TheAlgebra
My question is this: how can I get Mathematica to simplify an expression such as a^kb^l in a smart way? There are similar questions on the site, but maybe the answer for this one is simpler, since I'm only interested in simplifying products of the various symbols together with some integers.
Maybe there is a way to force Mathematica to write
a^3 in a full-form expression that I like, such as: