How to justify the coefficients in Bezout's identity can be used to invert a number?

28 Views Asked by At

I'm getting familiar with solving equations with modulo. After some trial and error and getting help on this website, I've found this method works.

Given the following equation $$ax \equiv b \pmod{c}$$

  1. Establish whether it has a solution
  2. Find the GCD between $a,b$ and simplify the equation if needed
  3. Rewrite the CGD as $pa + qb$ for some $p,q \in \mathbb{Z}$ as per Bezout's identity
  4. Multiply all the terms by the number $p$ found. $p$ is going to be the inverse of $a$ modulo $c$, so the equation will now be $x \equiv pb \pmod{c}$
  5. Substitute $pb$ with its modulo from the division by $c$
  6. The equation will now be in the form $x\equiv b'\pmod{c}$ and that's the set of the solutions

I am after a formal explanation of why, in step 4, the coefficient of $a$ in Bezout's identity is, in fact, its inverse in set of integers modulo $c$.

Should you find yourself having to write a justification in, say, a test, what would you write?