Hey so I'm working on an assignment right now and am having trouble with a question.

So what I'm having trouble is showing that the generator of the ideal, call it I, is the minimal polynomial of A.
What I have so far is that if a polynomial ideal is generated by some g in I, we know that for f in I we have f = gq for some q in K[x].
This also tells us that g divides f.
From what I understand though (probably wrong..), doesn't it being the minimal polynomial of A come from the definition of a generator?
g is in I so g(A) = 0 and we got g by assuming it was of least degree, as shown by the following proof from my textbook:
Let g be a polynomial in I that is nonzero and of
least degree. By the division algorithm, for any f in I we have:
f = gq + r for some q,r in K[x] with deg r < deg g. Then we have r = f - gq. We can see r is also in I.
Since deg r < deg g (I also don't really understand this step), we must have r = 0. Hence f = gq and g divides f.
SO since we assume g is of least degree isn't it automatically the minimal polynomial of A? Would I just say that it follows from the definition of g that it is the minimal polynomial of A?
Any help is appreciated, thanks
This post was edited by Bloo_Guardian on Feb 20 2015 10:39pm