I would like to verify my proof for the following exercise from Foot and Dummit's "Abstract Algebra":
I will prove the following statement:
$$ a \in (Z/nZ)^* \iff gcd(a,n) = 1 $$
Thus, the set $(Z/nZ)^*$ is precisely characterized by the elements smaller than $n$ whose gcd is 1 and thus its size is $\phi(n)$.
Proof:
$ \rightarrow $ We assume by contradiction that there exists $J>1$ s.t. $gcd(a,n)=J$.
Let $a \in (Z/nZ)^*$, then there exists $b \in Z/nZ$ s.t. $ab = 1\,(mod\,n) $.
Thus, by definition, there exists $k \in Z$ s.t. $$ab-kn=1$$ Using the Euclidean algorith we compute $gcd(ab,n)$:
If we run the algorithm it should stop at the first iteration as $ab=kn+1 \rightarrow gcd(ab,n)=1$.
By our assumption $gcd(a,n)=J>1$ and in particular - $a|J$ and $n|J$. Contradition.
$\leftarrow$ Let $a \in Z$ s.t. $gcd(a,n)=1$. Then, by "Bezout's Identity" there exists $0<x,y \in Z$ s.t. $$ ax+ny=1 $$ Thus by definition: $$ ax = 1 (mod\,n) $$ And we have found $x = [b] \in Z/nZ$ as required. Meaning $ [a] \in (Z/nZ)^* $. $\square$
Let me know what you think?
solution-verification
question to be on topic you must specify which step in the proof you question, and why so. This site is not meant to be an open-ended proof checking machine. This common exercise is already solved here many times. You should compare your proof to those before posting. – Bill Dubuque Aug 06 '22 at 17:38