Can we express sum of products as product of sums?

I've got an expression which is sum of products like:

$$a_1 a_2 + b_1 b_2 + c_1 c_2 + \cdots,$$

but the real problem I'm solving could be easily solved if I could convert this expression into something like :

$$(a_1+b_1+c_1+\cdots) \cdot (a_2+b_2+c_2+\cdots)$$

If some additional constants are added or subtracted, it's no problem, in fact, it's obvious.

First query: Can we convert it into something like required form?

Second query: If yes, how?


Solution 1:

In general, one can write a product of sums as a sum of a products: $$\left(\sum_{i \in I} x_i\right)\left(\sum_{j \in J} y_j \right) = \sum_{i \in I, j \in J} x_i y_j.$$ One cannot, however, in general reverse this process, that is, write a sum of products, $$\phantom{(\ast) \qquad} \sum_{k \in K} x_k y_k, \qquad (\ast)$$ as a product of sums. (In this answer we assume that the index sets, $I, J$, etc., are finite, though with some care we can extend them to infinite sets under suitable conditions.) Note that the factors $x_k, y_k$ of each summand in $(\ast)$ are indexed by the same set $K$, whereas that is not (generally) the case for the sum of products in the first display equation. When they are, we can write the sum of products in terms of a product of sums with a correction term, namely as $$\sum_{k \in K} x_k y_k = \left(\sum_{k \in K} x_k\right) \left(\sum_{k' \in K} y_{k'}\right) - \sum_{k, k' \in K; k \neq k'} x_k y_{k'},$$ but this is really just a reorganization, and not really an algebraic simplification.

The expression $(\ast)$ can be factored in the sense that it is precisely the standard "dot product" on the space $\oplus_{k \in K} R$ of vectors (with components indexed by some finite set $K$) of ${\bf x} := (x_k)$ and ${\bf y} := (y_k)$ with entries in some ring $R$, $${\bf x} \cdot {\bf y} := \sum_{k \in K} x_k y_k,$$ though as the notation suggests, this is a definition and again not an simplification per se.