# Generating a Large (possibly infinite list) of Formulas From A Group

Here's a little background, I have a finite list of linear formulas in 6 variables and 6 linear transformations in these variables. Obviously I can apply these transformations with /. to my current formulas to get new formulas. I would like to automate the following process in mathematica:

1. apply all the transformations to my current list of formulas
2. take the union of my new formulas and old formulas to get a new list
3. apply step 1 to this new list
4. stop after n iterations of steps 1-3 for some integer n
5. Sort my final list in a canonical manner where all formulas are naturally factored

Is there a simple way I can do this in mathematica? I'm not too familiar with the program at all. By the way this is not homework, I just have a conjecture on my mind and I'd like to skip pages and pages of handwork where I may make errors. If it helps at all these formulas form a group.

Test this carefully

n=3;
eqns={x+y==0,2x-3z==0,x-y+z==0};
xform={x->2y-z,y->3x+y,z->2z-x};
f[eqns_]:=Union[Simplify[Flatten[{eqns,Map[eqns/.#&,xform]}]]];
Nest[f,eqns,n]


and see if it is doing exactly what you expect. You might start with n=1 and see if the result seems correct with a single iteration. If that seems correct then try with n=2, etc.

I am not convinced this will do exactly what you are expecting. If you can point out any specific flaws in the result then we can try to track down the source and see if we can correct it for you.

• I replaced your equations with formulas (removed the ==0) bit and everything is working as expected! Might you know how mathematica sorts formulas canonically (if this is possible)? Commented Sep 9, 2019 at 2:52
• Alternatively is there a way to display the elements of the output list with a term factored out (from a fixed list) if I know one of them will appear? For instance, say I know $2x(y+z)$ or $3z(y-z)$ will appear in every term, then I would like my output to read something like $2x(y+z)-z-2x, 3z(y-z)+10y$, etc. Commented Sep 9, 2019 at 3:34
• Look at reference.wolfram.com/language/ref/Sort.html and click on the orange Details for some information about cannonical ordering. It might be possible to extract common elements and put them at the beginning of an expression, but the default behavior might immediately rearrange the entire expression.
– Bill
Commented Sep 9, 2019 at 3:46
• For formatting your results with a common factor there is one trick that you might look at to see if it would be acceptable. Suppose your common factor is 2x(x+1). Then sol={2x(x+y)+z,4(x+y)x+2z}; Expand[Simplify[sol,2x(x+y)==a]] substitutes a for your common factor and the variable a is displayed to the left of b, c, etc. giving {a+z,2 a+2 z}. Yes I know that doesn't display the 2x(x+y) but that can deal with all kinds of complications and maybe gets you closer to what you want.
– Bill
Commented Sep 9, 2019 at 16:42