Proof.
We leave to the reader the proof of the uniqueness of the
quotient and the remainder of
a
mathend000# w.r.t. to b
mathend000#.
So we focus now on the complexity result
Consider an iteration of the for loop
where
deg r = m + i
mathend000# holds at the begining of the loop.
Observe that r
mathend000# and qixib
mathend000# have the same leading coefficient.
Since
deg b = m
mathend000#, computing the reductum of qixib
mathend000# requires m
mathend000# operations.
Then subtracting the reductum of qixib
mathend000# to that of r
mathend000# requires again m
mathend000# operations.
Hence each iteration of the for loop requires at most 2m + 1
mathend000# operations in R
mathend000#,
since we need also to count 1
mathend000# for the computation of qi
mathend000#.
The number of for loops is n - m + 1
mathend000#.
Therefore Algorithm 1
requires
(2m + 1)(n - m + 1)
mathend000#.