Show the following action preserves the set $X = \{(g_1,...,g_p) \in G^p \mid g_1g_2 \cdots g_p = e \}$ Definition: $G^p = \{ (g_1, g_2, ... , g_p) \mid g_i \in G\ \text{for all }i \}$

*

*Where $G$ is a finite group with $\lvert G \rvert = n$ and $p \geq 2$ a prime, with $p \mid n$.

*Also, where we view the indices $i$ to be representatives of the congruence classes of $\mathbb{Z}_p$ i.e., $[i]_p \in \mathbb{Z}_p$
Definition: We define an action of $\mathbb{Z}_p$ on $G^p$ by: $$a \cdot (g_1,...,g_p) = (g_{a+1},...,g_{a+p})$$ For $a \in \mathbb{Z}_p$

Problem Statement

Show that the action above preserves the set $$X = \{(g_1,...,g_p) \in G^p \mid g_1g_2 \cdots g_p = e \}$$ Where $e \in G$ is the identity.


For this, to the best of my understanding, we want to show that $$\forall a \in \mathbb{Z}_p,\ g_1 \cdots g_p = e\ \text{iff}\ g_{a+1} \cdots g_{a+p} = e$$ My attempt below is incomplete and casual. As such I would appreciate some guidance in how to proceed for that which I don't have down as well as correction/formalization for that which I have written down. Thank you.

Assume first that $g_1 \cdots g_p = e$. Since the indices $i$ are elements of $\mathbb{Z}_p$, $[i]_p \in \mathbb{Z}_p$ then we know that $g_1 \cdots g_p$ contains one $g_i$ for each $i \in \{0,...,p-1 \}$ and adding an $a$ simply "shifts" the product element by $a (\text{mod p})$ so that every value is still accounted for. So that for all $i \in \{0,...,p-1 \}$ there exists an $(a + i) \in \{0,...,p-1 \}$ so that $g_i \to g_{a+i}$. Since multiplication in groups is associative it doesn't matter the order in which we multiply and we can deduce that $$e = g_1 \cdots g_p = g_{a+1} \cdots g_{a+p} = e$$
Next, we assume that $g_{a+1} \cdots g_{a+p} = e$. Since the indices $i$ are viewed as the representatives of the congruence classes of $\mathbb{Z}_p$ we know that for any index we have $0 \leq a + i \leq p$ thus we can make the association that for some $k \in \mathbb{Z}_p$ we have $$g_{a + k} = g_i$$ For all $i \in \{0,...,p-1 \}$. Thus if $g_{a+1} \cdots g_{a+p} = e$ then $g_1 \cdots g_p = e$. By associativity of multiplication.

So I know this is nowhere near correct or clean enough for a formal proof but I kind of wanted to outline my thought process as best I could in an informal proof. Essentially, my thoughts about this problem go back to leveraging the congruence mod $p$ of the indices to show that no matter how much you "shift" them up (by adding $a$) or down (by subtracting $a$) you will still get all elements of the product in the range $g_i\ \text{for}\ i \in {0,...,p-1}$ and then by associativity it doesn't matter if it's the case that the left most element is, say, $g_5$ instead of $g_1$ the product is still the same, namely, $e$. Is this the right train of thought? As well, any guidance on how to formalize this would be appreciated.
 A: It seems like you're confusing associativity and commutativity. The fact that the operation is associative simply means that $$(g_1 g_2)g_3=g_1(g_2 g_3)$$ for any $g_1, g_2,g_3\in G$. On the other hand, you're repeatedly using that the result of the operation does not change if we rearrange the factors, which is commutativity (and does not hold if for example $G=S_3$).
If you want a hint on how to proceed, let's consider the case where $a=2$. As you observed, we want to prove that $$g_3 g_4 \cdots g_p g_1 g_2 = e \qquad (\star)$$ using the fact that $g_1 g_2 \cdots g_p=e$. If you look at the left hand side of $(\star)$, we would really like to have $g_1g_2$ before the other terms. How can we do this? Multiplying by $(g_1 g_2)^{-1} (g_1 g_2) =e$ we get $$(g_1 g_2)^{-1}  \underbrace{(g_1g_2)g_3 g_4 \cdots g_p}_{=e}\, g_1g_2 =(g_1 g_2)^{-1} (g_1 g_2) =e$$ as required. Can you see how to generalize this for any $a$?
A: The group $\mathbb{Z}_p$ acts by cyclic permutation. It suffices to show that
$$
g_1 g_2 \cdots g_p = e
\implies 
g_2 \cdots g_p g_1 = e
$$
since every other cyclic permutation is a power of this one.
A direct calculation works:
\begin{align}
g_2 \cdots g_p g_1 
&= e \bigl( g_2 \cdots g_p g_1 \bigr) \\
&= g_1^{-1} g_1 \bigl( g_2 \cdots g_p g_1 \bigr) \\
&= g_1^{-1} \bigl( g_1 g_2 \cdots g_p \bigr) g_1 \\
&= g_1^{-1} e g_1 \\
&= g_1^{-1} g_1 \\
&= e 
\end{align}
