0

I am reading the following proof of this proposition: Let $m, x$ be positive integers such that $\gcd(m, x) = 1.$ Then $x$ has a multiplicative inverse modulo $m$, and it is unique (modulo $m$). There are 2 things about it I don't understand: 1.if $(a-b)x=km$ where $k$ is an integer, why does the fact that $x$ and $m$ are relatively prime imply that $m$ divides $(a-b)$ and 2. How can $k$ be negative or zero here (as stated by the proof) when $(a-b), x,$ and $m$ are positive? Here is the proof:

Consider the sequence of $m$ numbers $0, x, 2 x, \ldots(m-1) x$. We claim that these are all distinct modulo $m$. Since there are only $m$ distinct values modulo $m$, it must then be the case that $a x \equiv 1(\bmod m)$ for exactly one $a$ (modulo $m$ ). This $a$ is the unique multiplicative inverse of $x$. To verify the above claim, suppose for contradiction that $a x \equiv b x(\bmod m)$ for two distinct values $a, b$ in the range $0 \leq b \leq a \leq m-1$. Then we would have $(a-b) x \equiv 0(\bmod m)$, or equivalently, $(a-b) x=k m$ for some integer $k$ (possibly zero or negative).However, $x$ and $m$ are relatively prime, so $x$ cannot share any factors with $m$. This implies that $a-b$ must be an integer multiple of $m$. This is not possible, since $a-b$ ranges between 1 and $m-1$.

Princess Mia
  • 2,403
  • Instead of thinking of $(a-b)x=km$ for some $k$, think about $(a-b)x \equiv 0 \pmod{m}$ as $m \mid (a-b)x$ so then, as Dietrich Burde pointed out, you can use Euclid’s lemma.
  • – shanksion Aug 22 '23 at 16:30
  • Technically, the way the problem is written has it assumes without loss of generality $b < a$ so in this case $k$ will be nonnegative. In full generality though the author did not need to assume this order (nor did they have to assume a and b were distinct if they wanted to do a direct proof), in which case $k$ can be any integer
  • – shanksion Aug 22 '23 at 16:38