Solve $12x\equiv9\pmod{15}$ Question:
Solve $12x\equiv9\pmod{15}$
My try:
$\gcd(12,15)=3$ so it has at least $3$ solutions.
Now
$15=12\times1+3\\
3=15-12\times 1\\
3=15+2\times(-1)\\
\implies9=15\times3+12\times(-3)\\
\implies12\times(-3)\equiv9\pmod{15}$
So $x\equiv-3\pmod{15}$
Am I correct?

Lemma: Let $gcd(a,n)=d$ and suppose that $d|b$. Then the linear congruence 
$ax \equiv b $ (mod $n$)
has exactly $d$ solutions modulo $n$. These are given by
$t,t+\dfrac{n}{d},t+\dfrac{2n}{d},\cdots,t+\dfrac{(d-1)n}{d}$
where $t$ is the solution, unique modulo $n/d$, of the linear congruence
$\dfrac{a}{d}x\equiv \dfrac{b}{d}$ (mod $\dfrac{n}{d}$).
By Lemma, we just need to consider the linear congruence $4x\equiv 3$ (mod $5$), easy to see the unique solution is $2$. Hence the all solutions of $12x\equiv 9$ (mod $15$) is $x\equiv 2,7,12$(mod $15$).
