Inverses and cancellation in modular arithmetic I was working on a problem that resulted in the calculation:
$20 \equiv 10x \pmod{11}$.
I got the answer $x \equiv 2 \pmod{11}$ with the thought process: Since $10$ is a factor of $20$ I can rewrite $20 \pmod{11}$ as $10x \pmod{11}$ with $x=2$. But isn't this basically the same as using division, which we aren't supposed to do in modular spaces?
If I solve by multiplying $20$ by the multiplicative inverse of $10 \pmod{11}$ which is $10$, I get $200 \pmod{11}$ which simplifies to $2 \pmod{11}$ anyway. Did these numbers just happen to be the same or is my original method valid?
 A: Invertible elements are always cancellable: $\,a^{-1}$ times $\,ab\equiv ac\,\Rightarrow\,b\equiv c,\,$ i.e. $\,x\mapsto ax\,$ is $1$-$1$. Furthermore: $\ a\,$ is invertible mod $m\iff a\,$ is coprime to $m\iff x\mapsto ax\,$ is onto, see
Theorem $\ $ The following are equivalent for integers $\rm\:a, m.$
$(1)\rm\ \ \ gcd(a,m) = 1$
$(2)\rm\ \ \ a\:$ is invertible $\rm\ \ \ \,(mod\ m)$
$(3)\rm\ \ \ x\to ax\:$ is $\:1$-$1\:$ $\rm\,(mod\ m),\,$ i.e. $\rm\,a\,$ is cancellable $\!\bmod m,\,$ i.e. $\rm\,ax\equiv ay\Rightarrow x\equiv y$
$(4)\rm\ \ \ x\to ax\:$ is onto $\rm\,(mod\ m)$
Proof $\  (1\Rightarrow 2)\  $ By Bezout $\rm\, gcd(a,m)\! =\! 1\Rightarrow ja\!+\!km =\! 1\,$ for $\rm\,j,k\in\Bbb Z\,$ $\rm\Rightarrow ja\equiv 1\!\pmod{\! m}$
$(2\Rightarrow 3)\ \ \ \rm ax \equiv ay\,\Rightarrow\,a(x\!-\!y)\equiv 0\,\Rightarrow\,x\!-\!y\equiv 0\,$ by multiplying by $\rm\,a^{-1}$
$(3\Rightarrow 4)\ \  $ Every $1$-$1$ function on a finite set is onto (pigeonhole).
$(4\Rightarrow 1)\ \ \ \rm x\to ax\,$ is onto, so $\rm\,aj\equiv 1,\,$ some $\rm\,j,\,$ i.e. $\,aj\!+\!km = 1,\,$ some $\rm\,k,\,$ so $\rm\gcd(a,m)=1$
See here for a conceptual proof of said Bezout identity for the gcd.
Beware if $\,a\,$ isn't invertible it fails;  then $\ 1< d\mid a,m\,$ ao $\,dx\equiv 0\,$ has two roots $\,x\equiv 0,m/d\ $ so we can't cancel $\,d\,$ to deduce $\,x\equiv 0$
A: Your original method works only because $10$ has an inverse modulo $11$. You wrote $20 \equiv 10x \pmod{11}$ as
$$ 10(2) \equiv 10x \pmod{11}. $$
Now, using the fact that $10^{-1}$ exists, we can multiply by it to conclude $2 \equiv x \pmod{11}$. If $10$ wasn't invertible, we wouldn't be able to conclude this. For instance, $2(2) \equiv 2(3) \pmod{2}$, but $2\not\equiv 3 \pmod{2}$.
A: Let $m$ be any integer for which you can define equivalence modulo $m$
in the usual way.
If $a = by$ in ordinary arithmetic over integers $a,$ $b,$ and $y,$
and if $x \equiv y \pmod m,$
then $a \equiv bx \pmod m.$
Your method of solving $20 \equiv 10x \pmod {11}$
basically comes down to the observation
that $y = 2$ is a solution to the equation $20 = 10y.$
That is enough to conclude that $x \equiv 2 \pmod {11}$
is a solution of $20 \equiv 10x \pmod {11}.$
Notice the careful wording: "a solution" rather than "the solution."
(In slightly more formal language, "a member of the solution set"
rather than "the one and only member of the solution set.")
For example, if we apply this method to the problem
$4 \equiv 2x \pmod6,$ it will correctly tell us that $x\equiv2 \pmod6$
is a solution; but $x\equiv5 \pmod6$ is also a solution, although this method will never inform us about that solution.
The fact that $10$ has an inverse modulo $11$ is what makes your solution the solution rather than just a solution.
