We need to prove two things: that given any
\(g\) there are polynomials
\(q,r\) satisfying properties (i) and (ii), and furthermore that the pair
\((q,r)\) is unique.
We begin with existence. Let \(X\) be the set of all pairs of polynomials \((q',r')\) satisfying condition (i) (but not necessarily (ii)). We will show that there is a pair \((q,r)\in X\) that also satisfies (ii). Observe that \(X\) is nonempty, since in particular it contains the pair \((0,g)\text{.}\) If \((q,0)\in X\text{,}\) then this pair satisfies (ii) since \(\deg 0=-\infty< \deg f\) (\(f\) being a nonzero polynomial). Otherwise, let \((q,r)\) be an element of \(X\) for which \(r\) has minimal finite degree. (Such a pair exists since the set \(\{\deg r'\mid (q',r')\in X\}\) is a nonempty subset of \(\Z_{\geq 0}\text{,}\) and hence has a minimal element.) We claim that \(\deg r< \deg f\text{,}\) and hence that \((q,r)\) satisfies (ii). Suppose, by contradiction, that \(r(x)=\bmpoly\) with \(\deg r=m\geq \deg f=n\text{.}\) Since the leading term \(a_n\) of \(f\) is a unit, we can write
\begin{align*}
r(x) \amp b_ma_n^{-1}x^{m-n}f(x)+r(x)-b_ma_n^{-1}x^{m-n}f(x)\\
\amp =h(x)f(x)+s(x)\text{,}
\end{align*}
where \(h(x)=b_ma_n^{-1}x^{m-n}\text{,}\) and where
\begin{align*}
s(x) \amp =r(x)-b_ma_n^{-1}x^{m-n}f(x)\\
\amp = r(x)-b_ma_n^{-1}x^{m-n}(\anpoly)\\
\amp =(b_m-b_m)x^{m}+(b_{m-1}-b_ma_n^{-1}a_{n-1})x^{m-1}+\cdots\\
\amp =(b_{m-1}-b_ma_{n}^{-1}a_{n-1})x^{n-1}+\cdots
\end{align*}
has degree at most \(m-1\text{.}\) But then we have
\begin{align*}
g\amp =qf+r \\
\amp = qf+hf+s\\
\amp = (q+h)f+s\text{,}
\end{align*}
showing that \((q+h,s)\in X\) and \(\deg s< \deg r\text{.}\) This contradicts the minimality of \(\deg r\text{.}\) Thus \(\deg r< \deg f\text{,}\) and we are done.
We now prove that there is exactly one pair \((q,r)\) satisfying (i) and (ii). Indeed, suppose \((q,r)\) and \((q',r')\) both satisfy these properties. From \(g=qf+r=q'f+r'\text{,}\) it follows that
\begin{align*}
(q-q')f \amp =(r'-r)\text{.}
\end{align*}
If \(q-q'\ne 0\text{,}\) then since the leading coefficient of \(f\) is a unit, it is easy to see that \(\deg (q-q')f\geq \deg f\text{.}\) But then we would have
\begin{align*}
\deg r'-r \amp =\deg (q-q')f \geq \deg f\text{,}
\end{align*}
a contradiction since \(\deg (r-r')\leq \max\{\deg r,\deg r'\}< \deg f\text{.}\) Thus \(q-q'=0\text{,}\) from which it follows that \(r'-r=0\text{.}\) We conclude that \(q=q'\) and \(r=r'\text{,}\) and thus that \((q,r)=(q',r')\text{,}\) as desired.