# In general, is $U(R\times S) \cong U(R)\times U(S)$? How do I show it?

Some context: I'm trying to find $\text{Aut}(\mathbb{Z}_n)$ for any natural number $n$ (Problem I.2.15c in Hungerford, if you're wondering), and I'm using the Chinese Remainder Theorem to deduce that if $$n=p_1^{r_1}\dots p_k^{r_k},$$ then $$\mathbb{Z}_n \cong \mathbb{Z}_{p_1^{r_1}} \times \dots\times \mathbb{Z}_{p_k^{r_k}},$$ and since $\text{Aut}(\mathbb{Z}_n)$ has the same order as $U(\mathbb{Z}_n)$ (I'm thinking they're isomorphic, too, but I can't think of a way to prove it), I'd think $$U(\mathbb{Z}_n)\cong U(\mathbb{Z}_{p_1^{r_1}}) \times\dots\times U(\mathbb{Z}_{p_k^{r_k}}).$$ That's the source of my question. From there, I know $U(\mathbb{Z}_{p_i^{r_i}})$ has order $p_i^{r_i} - p_i^{r_i-1}$, but I'm hard pressed to determine general structure. I know $U(\mathbb{Z}_{p_i^{r_i}})$ is a product of cyclic groups (since it's abelian) of orders of powers of $p$ with the last cyclic group of the product having order $p^j (p-1)$ , but I have no idea what else I can say about them specifically.

Thanks so much!

-
To do sub/superscripts, wrap the formulas in $...$ and write $x^r$ to get $x^r$, and $x_r$ to get $x_r$. – Mariano Suárez-Alvarez Oct 7 '11 at 6:15
And kindly leave out the "kicking my ass" nonsense and stick to the mathematics. That space would be better spent on defining your notation. – Alex B. Oct 7 '11 at 6:30
Thanks Mariano and Alex and whoever edited my explanation to make the notation more readable. Also, I'm new to the site, so I'm not familiar with the etiquette. I was under the impression it was a little less formal, but I'll take note. – Reeve Oct 7 '11 at 6:44
I am wondering, what is $U$? – Rasmus Oct 7 '11 at 7:14
Rasmus: U is the group of units in a ring. I should have switched G and H with R and S respectively. – Reeve Oct 7 '11 at 16:24

The more common notation for the cyclic group (ring) of order $n$ is $\mathbb{Z}/n\mathbb{Z}$, since $\mathbb{Z}_p$ usually denotes the $p$-adic integers. Also, I will denote the multiplicative group of units of a ring $R$ by $R^\times$.
First, it seems pretty hard to me to prove that $\text{Aut}(\mathbb{Z}/n\mathbb{Z})$ has the same order as $(\mathbb{Z}/n\mathbb{Z})^\times$ without actually proving that they are isomorphic. The proof can be found in almost any algebra text book and goes as follows: fix a generator $x$ of $\mathbb{Z}/n\mathbb{Z}$. The action of any automorphism is determined by what it does to $x$, and the result can again be expressed as a power of $x$ ($x$ being a generator). The map $\sigma_i: x\mapsto x^i$ is an automorphism if and only if $x^i$ has the same order as $x$ if and only if $i$ is coprime to $n$, and different $i$ define different automorphisms. Moreover, composition $\sigma_i\circ\sigma_j$ corresponds to multiplication $ij$, so $\sigma_i\mapsto i$ establishes an isomorphism between $\text{Aut}(\mathbb{Z}/n\mathbb{Z})$ and $(\mathbb{Z}/n\mathbb{Z})^\times$.
Next, the fact that $(R\times S)^\times = R^\times\times S^\times$ is true for any rings $R$ and $S$. This just follows from the definition of direct products, specifically of the multiplication of elements of a direct product.
Finally, given a prime $p$ and an integer $k$, the group of units $(\mathbb{Z}/p^k\mathbb{Z})^\times$ is cyclic (of order $p^k-p^{k-1}$) if $p$ is odd, and is isomorphic to $\mathbb{Z}/2\mathbb{Z}\times \mathbb{Z}/2^{k-2}\mathbb{Z}$ if $p=2$ and $k\geq 2$. That is a bit harder to prove than all of the above, but a proof can also be found in many places. I don't have Hungerford in front of me, so don't know if it's in there, but you can find it online, e.g. here.
If it's hard to prove Aut(Z/nZ) has the same number of elements as $(Z/nZ)^\times$ , maybe I'm doing something else wrong, since I found that easy. Here's my reasoning: I know that an element is a unit in Z/nZ if and only if it is relatively prime to n and that a unit in Z/nZ must generate Z/nZ (additively), so I have as many automorphisms as I have units, since the generator 1 must map to a generator of Z/nZ. Am I doing something wrong? Thanks, Alex! – Reeve Oct 7 '11 at 16:37