Infinite series are challenging (even when you know it)! I describe some background before asking my question(s).
A programming assignment asked to use an abstraction called product to verify the following approximation of $\pi$:
$$ \frac{\pi}{4}=\frac{2\cdot 4\cdot 4\cdot 6\cdot 6\cdot 8\cdot 8 \cdots}{3\cdot 3\cdot 5\cdot 5\cdot 7\cdot 7 \cdots}\tag{1}\label{eq1} $$
I, rather credulously, rearranged the series in \eqref{eq1} as:
$$
{\pi\over 4}=2\cdot \left(\frac{4\cdot 4}{3\cdot 3} \right)\cdot \left(\frac{6\cdot 6}{5\cdot 5} \right)\cdot \left(\frac{8\cdot 8}{7\cdot 7} \right)\cdots = 2\cdot\prod_{i=1}^{\infty} \left(\frac{2i+2}{2i+1} \right)^2
\tag{2}\label{eq2}
$$
Then I wrote the program (using $10$ terms of the form $\left(\frac{2i+2}{2i+1} \right)^2$ where $i$ goes from $1$ to $10$) only to realize that I had committed a blunder. My faithful program calculated ${\pi\over 4}$ as $17.675817$.
I then looked up Wallis Product on Wikipedia which defines it as: $$ {\pi\over \textbf{2}}= \left(\frac{2\cdot 2}{1\cdot 3} \right)\cdot \left(\frac{4\cdot 4}{3\cdot 5} \right)\cdot \left(\frac{6\cdot 6}{5\cdot 7} \right)\cdots = \prod_{n=1}^{\infty}\frac{4n^2}{4n^2-1} \tag{3}\label{eq3} $$
I removed the bug in my program by using Wallis Product as defined in \eqref{eq3}.
I am somewhat aware of the convergent tests of infinite series, but I guess I am not that familiar with their valid manipulations. Here are my questions based on this experience:
Exactly what disallows equation \eqref{eq2} as a rearrangement of \eqref{eq1}? Why aren't these two equations equivalent?
Why is \eqref{eq3} a valid rearrangement of \eqref{eq1} (if it is, that is)?
For one thing: (1) does not make sense. There is no question about re-arranging it because it is not an infinite product. It is not of the form $\prod_{n=1}^\infty a_n$. How are you even supposed to calculate it? Multiply $2\cdot 4\cdot 4\cdot 6\cdot 6\cdots$ (which is infinite) and then multiply $3\cdot 3\cdot 5\cdot 5\cdot 7\cdot 7\cdots$ (which is also infinite) and then divide one infinity with the other??!
The actual Wallis product is (3) and you can get $\pi/4$ if you halve the first term $\frac{2\cdot 2}{1\cdot 3}$ to be just $\frac{2}{3}$ and leave all the other terms intact.
The other aspect is that (2) is not a rearrangement of (3), it has completely different terms and no wonder it is different. In fact, it diverges. To see that, let's see the partial products in the Wallis product:
$$P_n=\left(\frac{2\cdot 2}{1\cdot 3}\right)\left(\frac{4\cdot 4}{3\cdot 5}\right)\cdots\left(\frac{(2n)(2n)}{(2n-1)(2n+1)}\right)$$
with the partial products in (2):
$$Q_n=2\left(\frac{4\cdot 4}{3\cdot 3}\right)\left(\frac{6\cdot 6}{5\cdot 5}\right)\cdots\left(\frac{(2n)(2n)}{(2n-1)(2n-1)}\right)$$
Note that the terms are completely different, and moreover $\frac{P_n}{2}=\frac{Q_n}{2n+1}$ i.e. $Q_n=\frac{2n+1}{2}P_n$. As $P_n\to\pi/2$ and $\frac{2n+1}{2}\to\infty$ when $n\to\infty$, it follows that $Q_n\to\infty$, so your "rearrangement" (which, to emphasise again, isn't a rearrangement) is divergent.
As for the theorems when the re-arrangement is allowed:
None of those rules give you right to break up the terms themselves and re-arrange the pieces.