Proof of Pocklingtons theorem: why do we have $\text{ord}_n(a) \mid (q-1)$ but $\text{ord}_n(a) \nmid (n-1)/p_i$ ? And why does $p_i^{\alpha_i} \mid \text{ord}_n(a)$ ?
I see that $\text{ord}_n(a)$ must divide $n-1$, since the order of an integer $\pmod n$ always divide any power $k$ of $a$ such that $a^k \equiv 1 \pmod n$.
But why are $\text{ord}_n(a) \mid (q-1)$ and $\text{ord}_n(a) \nmid (n-1)/p_i$ true ? And why does $p_i^{\alpha_i} \mid \text{ord}_n(a)$ ?

I believe there is a typo; the proof makes complete sense if $ord_n(a)$ is replaced by $ord_q(a)$.
Indeed: