Starkware cryptography uses a simplification result that I don't fully understand and I was hoping someone could help explain it to me.
https://medium.com/starkware/arithmetization-ii-403c3b3f4355
Basically the product of $$x^{|G|}= \prod_{g \in G}(x-g)$$
The product of $\prod_{i=0}^k (x-g^i) =x^k - 1$ if $g$ is a subgroup of size $k$ in $\mod P$, some prime $P$. Why is this the case?
I think I figured it out. I had the exponent in the wrong place in the type out above (fixed now).
I think if you expand out the product list to $$(x-g^1) \cdot (x-g^2) \cdot ... \cdot (x-g^k)$$ and realize that the cyclical nature of the g means that every g in the first half of k has a negative pair, thus regrouping into pairs, we get $$(x-g^1)(x+g^1) \cdot(x-g^2)(x+g^2) \cdot ... \cdot(x-g^{k/2})(x+g^{k/2})$$.
Then you multiply similar terms into a difference of two squares: $$(x^2-1) \cdot (x^2-(g^2)^2) \cdot... \cdot(x^2-(g^k)^2)$$. This again can be simplified with positive and negative pairs, until finally you get $$(x^{k/2} - 1) \cdot (x^{k/2} +1)$$ and the result.