For the proof, let p and q be coprime
Rearrangement
Subtract a from both equations
The Underlying Problem
Let m be an integer from 0 to q-1 (inclusive), and r be an integer from 0 to q-1 (inclusive)
There are q possible values of m, and q possible values of r.
Since p and q are coprime, the remainders cannot repeat until after m > q-1
Therefore, there is a unique value of m to produce any remainder r in the above equation.
Putting it all Together
If we look at the last equation in Rearrangement, we see it matches the equation in The Underlying Problem, where b-a corresponds to r, and x-a corresponds to mp.
So, we can see there is one unique solution for x in the interval of 0 to pq-1 (inclusive)
We can extend this by saying there will be a solution pq larger than another solution, making the solutions expressible via mod.
The Underlying Problem (but rigour)
Again start with
Suppose and are two that give the same . Then . By the cancellation law , since .
Cancellation Law Proof (Brownie Points)
Know divides since they are both the same mod , therefore divides the RHS. By Euclid’s Lemma must divide , meaning .
Final Theorem
Let p and q be coprime. If:
then:
exists and is unique.
Notes
both mean x is divisible by y.