Bezout's identity in $F[x]$
Let $F$ be a field and $F[x]$ a polynomial ring. Let $p(x)$ be an irreducible polynomial. Show that $\gcd(p(x),q(x)) = 1\Longrightarrow \exists r(x),s(x)$ such that $r(x)p(x)+s(x)q(x) = 1$.
I know the proof for Bezout's identity for integers, but this proof uses the notion of absolute value, which cannot be applied to a polynomial ring.
I am thinking about a way to prove the statement: Use the Euclidean algorithm to compute $\gcd(p(x),q(x))$ and show that the result is $1$, and somehow go backwards to obtain $r(x)p(x)+s(x)q(x) = 1$, but it is a bit messy, and I'm not yet able to see it completely.
Please offer some help. If you have some other methods, that would be great, too.
Hint $\ $ Mimic the proof for integers: $ $ the set $\rm\,I = \{a\, p + b\, q\ :\ a,b \in F[x]\}\,$ is closed under mod (remainders), so a least (degree) element $\rm\:g\ne 0\:$ must divide every element $\rm\,f\,$ (else its remainder $\rm\,f\ mod\ g\, =\, f-q\,g\in I\,$ has smaller degree than $\rm\,g,\,$ contra leastness of $\rm\:g).\,$ Thus $\rm\,p,q\in I\,\Rightarrow\,g\mid p,q,\:$ so $\rm\:g = 1,\:$ by $\rm\:gcd(p,q) = 1.\:$ Thus $\rm\:1\in I,\:$ i.e. $\rm\:1 = a\, p + b\, q.$
From André Nicolas's hint, I tried to formulate a proof. Please check if the proof is good.
Proof:
Construct $X = \{p(x)r(x)+q(x)s(x)\;|\;r(x),s(x)\in F[x]\}$, since the degree of the elements in $X$ are natural numbers (well-ordered), find a non-zero element that has minimal degree, call it $w(x)$. Let $w(x)$ be modified that its leading coefficient is positive (if not take $-w(x)$). Use euclidean division to yield $p(x) = u(x)w(x)+s(x)$. Now $s(x) = p(x)-u(x)w(x) \in X$, also euclidean algorithm tells us $\deg s(x)<\deg w(x)$, but $w(x)$ is minimal degree of the non-zero elements of $X$, therefore $s(x) = 0$. That is $w(x)$ divides $p(x)$. Using argument we can show $w(x)$ devices $q(x)$. That is $w(x)$ is a common divisor of $p(x)$ and $q(x)$ with positive leading coefficient. Let $u(x)$ be any common divisor of $p(x)$ and $q(x)$, then $u(x)$ is also a divisor of all elements in $X$, namely $w(x)$. Since $w(x)$ divides every common divisor of $p(x)$ and $q(x)$, it is the greatest common divisor of $p(x)$ and $q(x)$. $w(x) =1 $. Since $w(x)\in X$, we find some $1 = w(x) = r(x)p(x)+s(x)q(x)$.