# What's wrong with this argument for finding Aut($\mathbb{Z_p} \times \mathbb{Z_p}$)?

I happen to know that Aut($\mathbb{Z_p} \times \mathbb{Z_p}$) $\simeq$ $GL_2(p)$, and so has order $p(p^2-1)(p-1)$.

Which means something is wrong with the following argument:

An automorphism $\phi$ is determined by its value on the two generating elements $(1,0)$ and $(0,1)$ of $\mathbb{Z_p} \times \mathbb{Z_p}$.

These must be sent to elements of the same order, $p$. In fact every nonzero element of $\mathbb{Z_p} \times \mathbb{Z_p}$ has order $p$, so there are $p^2-1$ choices to which each generator must go. Therefore the number of automorphisms is $(p^2-1)^2$.

So I've overcounted by $(p^2-1)(p-1)$; I imagine some of the homomorphisms in my argument were not distinct, or not isomorphisms. is there a way to easily rectify for the overcounting? Or do we throw the whole argument away?

You are correct in saying that there are $p^2-1$ choices for where one of the generators, say $(1,0)$, is mapped. However, once you have chosen that, you have also determined the images of $(2,0)$, $(3,0)$, $\dots$, $(p-1,0)$. You cannot map the second generator to the same thing as any of those elements listed, so this excludes $p-1$ elements. Of course we also want to exclude $0$, so that leaves $p^2-p$ choices for where the second generator is mapped.
This gives the correct order, $(p^2-1)(p^2-p)$.