Let $p, q$ be primes. Then the linear congruence
$$ap \equiv r\pmod q$$
can be solved for $a\in\mathbb Z$ and will have a unique solution for each value of $r$ such that $0\leqslant a<q$.
Am I right about this?
That brings me to my main question.
Can I apply this result for polynomial ring over ${\rm GF}(2)$ and $2$ primitive polynomials instead of $p,q$?
Consider a polynomial ring $K[X]$ over ${\rm GF}(2)$ of order $n$ and $2$ primitive polynomials $P_1$ and $P_2$ with degrees $a$ and $b$ such that $a+b=n$. Let $y$ be an arbitrary polynomial, then does the equation
$$xP_1 \equiv y\pmod{P_2}$$
always have a solution for $x\in K[X]$ and $\deg(x)\leqslant b$?
I am not a math student, so please let me know if I am saying something incorrectly or if the question is not clear.