# of solutions to linear congruences

50 Views Asked by At

in every proof I've seen that the equation $$ax\equiv b\pmod{m}$$ has $\gcd(a, m$) solutions if $\gcd(a,m)\mid b$, the author shows that there exists one solution $r$, assumes there exists another solution $s$ and then shows that, for any $t\in \{0,1,\dots, m-1\}$, $s+t\cdot\frac{m}{\gcd(a,m)}$ is another solution.

What I'm having problems with is the assumption that there exists another solution $s$, don't we need to prove that as well ?

1

There are 1 best solutions below

0
On

Let's start with $ax \equiv b \bmod m$.

Let $g=\gcd{(a,m)}$. Lets suppose that $g \mid b$. Then $\dfrac ag x \equiv \dfrac bg \, \bmod{\dfrac mg}$.

Note that $\bigg(\dfrac ag \bigg)^{-1}$ exists because $\operatorname{gcd}\bigg(\dfrac ag, \dfrac mg \bigg)=1$.

Then $x \equiv \dfrac bg\bigg(\dfrac ag \bigg)^{-1} \operatorname{mod}\bigg(\dfrac mg \bigg)$

Let $s$ be the unique integer such that $0 \le s \lt \dfrac mg$ and $s \equiv \dfrac bg\bigg(\dfrac ag \bigg)^{-1} \operatorname{mod}\bigg(\dfrac mg \bigg)$

Then we have $x \equiv s \operatorname{mod}\bigg(\dfrac mg \bigg)$, which is equivalent to $x = s + t\bigg(\dfrac mg \bigg)$.

If we desire $0 \le s \lt m$, then we need to require $t = 0,1,\dots,g-1$, not, as you said, $m-1$.