My main problem is how one can create a "transcending between operators rule" in the same term according to the minimal example bellow.
Suppose I need to perform a replacement of the form
G[b_]*F[b_][Y_]->FG[Y]
where G has 1 argument, F has 2 arguments of the form above and FG is a new function that has only 1 argument.
The problem is that I need to apply this kind of rule in an expression of the form
G[a]*F1[a1]@F2[a2]@..@Fj[aj]@..@FN[aN]@F[a]@Y
so that in the end
F1[a1]@F2[a2]@..@Fj[aj]@..@FN[aN]@FG[a]@Y
where the Fj's have 2 arguments as F.
Notice that the ingredients of left hand-side of the rule G[b_]*F[b_][Y_]->FG[Y]
cannot be next to each other in such expressions, therefore we cannot apply the rule. Also note:
- The "separator" F1[a1]@F2[a2]@..@Fj[aj]@..@FN[N] might be anything with any number of operators.
- F[a] might be sandwiched between Fj[aj]'s and not in general the first one to be applied on Y.
So my question is:
Is there a way to modify the rule
G[b_]*F[b_][Y_]->FG[Y]
so that it can be applied to the minimal example?