Order-p matrices in GL2 over the prime field (source code)

= Order-p matrices in GL2 over the prime field
{title2=$g\sim\begin{pmatrix}1&1\\0&1\end{pmatrix}$}

For prime $p$, every order-$p$ element of $GL_2(\mathbb F_p)$ is conjugate to the displayed nonidentity unipotent matrix. Its cyclic subgroup has vector <group orbits> of sizes one or $p$; counting all $p^2$ vectors implies at least $p$ fixed vectors. Choose a nonzero fixed <vector> as first <basis> vector. The matrix becomes triangular with first diagonal entry one; its other diagonal entry satisfies $d^p=1$ and hence $d=1$ in the prime <finite field>. The off-diagonal entry is nonzero and can be rescaled to one. All matrices involved have invertible changes of basis.