Proof that if $a$ and $b$ must be coprime, $a$ has an inverse $\pmod{b}$

508 Views Asked by At

Assume there exists some integer $x$ for which $ax \equiv 1\pmod{b}$; $a \in \mathbb{Z}, b \in \mathbb{Z}-\{0\} $ \begin{align*} ax &\equiv 1\pmod{b}\\ ax&=qb+1 &&\text{ for some integer $q$ by the division algorithm}\\ \gcd(&qb,qb+1)=1 &&\text{ since any pair of consecutive integers are coprime}\\ \gcd(&qb,ax)=1 &&\text{ by substitution}\\ \gcd(&b,a)=1 \end{align*} Thus $a$ and $b$ are coprime. In other words, if there exists some inverse of $a \pmod{b}$, then $a$ and $b$ must be coprime.


Is this proof valid? Are there any improvements I could make?

1

There are 1 best solutions below

1
On BEST ANSWER

I think it's fine. For me I just find it more direct to look at $ax+qb=1$ and see that any divisor of $a$ and $b$ divides the LHS, hence divides the RHS, or $1$.