I am looking at https://math.berkeley.edu/~ecarter/Summer08/110/notes/lec19.pdf
and trying understand the proof for the theorem that states:
Given a nonzero ideal I in $P(F)$, there is a monic polynomial $p(t)$ such that
$$I=\left\{q(t)p(t) | q(t) \in P(F) \right\}$$
Proof goes like
Since $I$ contains at least one nonzero element, we can let $p(t)$ be a nonzero element of $I$ of minimum degree. We can show that every element of $I$ is a multiple of $p(t)$. Let $f(t) \in I$. Then there exist $q(t),r(t) \in P(F)$ such that
$$f(t) = q(t)p(t) + r(t)$$ and deg $r(t)$ < deg $p(t)$. Since $p(t) \in I$, so is $q(t)p(t)$, and therefore so is $$r(t) = f(t) -q(t)p(t)$$.
By the choice of $p(t),r(t) = 0$, so $f(t)$ is a multiple of $p(t)$.
What I am having trouble understanding is why $r(t)$ must equal $0$. If someone can explain why it is, I'd appreciate it.