I don't understand the following proof from my textbook: Prove that ${\rm sgn}(p\circ q)={\rm sgn}(p)\times{\rm sgn} (q)$:
$${\rm sgn}(p\circ q)=\prod_{i<j} \frac{p(q(j))-p(q(i))}{j-i}$$ $$=\prod_{i<j} \frac{p(q(j))-p(q(i))}{q(j)-q(i)}\times\prod_{i<j} \frac{q(j)-q(i)}{j-i}$$ $$=\prod_{i<j}\frac{p(j)-p(i)}{j-i}\times\prod_{i<j}\frac{q(j)-q(i)}{j-i}$$ $$={\rm sgn}(p)\times{\rm sgn} (q)$$
I understand that the second row is equal to the first one, but I don't understand how they got the third row from the second one. How did they figure out that $\prod_{i<j} \frac{p(q(j))-p(q(i))}{q(j)-q(i)}=\prod_{i<j}\frac{p(j)-p(i)}{j-i}$? I tried to see that on one example and I convinced myself that's true, but I wouldn't have ever thought of that, since I don't understand it intuitively. Can someone explain?
Instead of thinking of this product as a product over all pairs $i<j$, think of it as a product over all distinct unordered pairs $\{i,j\}$. In the third line, you have a product over all pairs $\{q(i),q(j)\}$ -- but these are all the distinct unordered pairs all the same (because $q$ is a bijection). In other words, you could rewrite the first product in the third line as $$ \prod_{q(i)<q(j)}\frac{p(q(j))-p(q(i))}{q(j)-q(i)}. $$