0

Below is a definition and a theorem.

I have a question about one condition in the theorem and one implication of the definition.

Definition: If $a\not\equiv0 \pmod m$ then $\overline a\in\mathbb{Z}$ is an inverse of $a \pmod m$ if $a\overline a\equiv1\pmod m$.

Theorem: If $\gcd(a,m)=1$ then $a$ has a unique inverse $a^{-1}\in\{0,1,...,m-1\}$ modulo m.

See my question below.

Question

Regarding the definition, why must $a$ not be congruent to $0$ modulo m?

Regarding the theorem, why is the unique inverse $a^{-1}$ at most $m-1$?

Thank you.

Bill Dubuque
  • 272,048
  • Note that finding the inverse between $0$ and $m - 1$ as in the theorem is a choice---there are many other inverses of $a$ modulo $m$ (indeed, every integer congruent to $a^{-1}$ modulo $m$). So the theorem is not saying that $a^{-1}$ is the only inverse, it's just saying that if you look at the set of all inverses of $a$ modulo $m$, only one of them is between $0$ and $m - 1$. – Jakob Streipel Jul 13 '22 at 06:47
  • There is no need to exclude $,a\equiv 0,$ since $,0,$ is invertible only in the degenerate case when the modulus has magnitude $1$ (if $,0,$ has inverse $k$ then $!\bmod m!:\ 1 \equiv 0k\equiv 0,,$ so $,m\mid 1!-!0,,$ so $, |m| = 1).,$ Generally, by first dupe: $a$ is invertible $!\bmod m\iff \gcd(a,m)=1.,$ Inverses are always unique by second dupe. By the third dupe, every integer is congruent to a unique element in a given complete system of residues, such as ${0,1,\ldots,m!-!1}\pmod m,,$ whose reps are "at most $m-1$". – Bill Dubuque Jul 13 '22 at 11:10

3 Answers3

0

If $a \equiv 0 \mod m$, then we have $ab \equiv 0b \equiv 0 \mod m$ for any other $b \in \mathbb Z$, hence it can never be $1$. This is exactly the same phenomenon that happens in other sets you might be more familiar with, such as $\mathbb R$ (that is, not being able to divide by zero).

On the other hand, we can pick $a^{-1}$ to be at most $m-1$ because of euclidean division: suppose you have any number $b \in \mathbb Z$, then one can write:

$$b = mq + r$$

with $q \in \mathbb Z$, $r \in \{0,\dots,m-1\}$ (the remainder). But then $b \equiv mq + r \equiv 0 + r \equiv r \mod m$, so we can choose $r$ instead if we are working mod $m$.

0

If $a$ has an inverse modulo $m$ then it means there is some integer $b$ such that $ab \equiv 1\pmod m$. This means $m$ divides $ab - 1$ $\implies$ there is integer $n$ such that $ab - 1 = mn$ or $ab - mn = 1$ or replacing $n$ with $-n$ you have $ab + mn = 1$.

Now if we had $a \equiv 0\pmod m$ then $m$ would divide $a$, say $a = qm$ for some integer $q$. Then for any integers $b$ and $n$, $ab + mn = (qb + n)m$. This is always a multiple of $m$. It can never equal $1$ and hence $a$ cannot have a multiplicative inverse modulo $m$.

For the unique inverse $\in \{1,\ldots , m-1\}$, note that if $ab \equiv 1\pmod m$ then $a(b + nm) \equiv 1\pmod m$ for any integer $n$. This gives you infinitely many inverses. Taking it from $\{1,\ldots , m-1\}$ is just a convenient choice.

Rishi
  • 154
0

You're right to have doubts on the definition.

In the following, $m$ is a fixed integer with $m>1$.

Let $a\in\mathbb{Z}$; we say that $\bar{a}\in\mathbb{Z}$ is an inverse of $a$ modulo $m$ if $a\bar{a}\equiv1\pmod{m}$

There's no point in excluding multiples of $m$ from the definition; on the other hand, they cannot have an inverse modulo $m$, but the same is true also for other integers, unless $m$ is prime. For instance $2$ has no inverse modulo $6$.

Why cannot multiples of $m$ have an inverse modulo $m$? If $a$ is a multiple of $m$, then $ab\equiv0\pmod{m}$ for every $b\in\mathbb{Z}$, and $0\not\equiv1\pmod{m}$ because $m>1$.

The condition that $\bar{a}$ (why changing notation?) belongs to $\{0,1,\dots,m-1\}$ in the theorem is stated in order to achieve uniqueness.

Indeed the inverse, if it exists, is only determined up to multiples of $m$: you can easily see that $4$ is an inverse of $2$ modulo $7$, but so are $11$, $-3$, $18$, $-10$ and so on.

More precisely, if $\bar{a}$ is an inverse of $a$ modulo $m$, then also $\bar{a}+km$ is, for every $k\in\mathbb{Z}$. Indeed $$ a(\bar{a}+km)\equiv a\bar{a}+akm\equiv a\bar{a}\equiv1\pmod{m} $$ Also the converse is true: if $b$ and $c$ are inverse of $a$ modulo $m$, then $b\equiv c\pmod{m}$. Here's the proof: $$ c\equiv c1\equiv c(ab)\equiv (ca)b \equiv 1b\equiv b\pmod{m} $$

Thus, if an inverse modulo $m$ exists, also its remainder modulo $m$ is an inverse. And there can be only one in the range $\{0,1,\dots,m-1\}$ because two inverses are congruent modulo $m$, but distinct numbers in that range aren't congruent modulo $m$.

egreg
  • 238,574