Proof that degree $n$ polynomial has at most $n$ roots (counting multiplicity) I am trying to prove the following statement:


  If the polynomial $f(x)$ of degree $n$ has roots $a_1,a_2,...,a_k$ with multiplicities $\alpha_1,\alpha_2,...,\alpha_k$ in a field $F$ (with $\alpha_i\geq 1$), then $f(x)$ has $(x-a_1)^{\alpha_1}\cdots (x-a_k)^{\alpha_k}$ as a factor. In particular, a polynomial of degree $n$ in one variable over a field $F$ has at most $n$ roots in $F$, even counted with multiplicity.


This is the proof that I wrote


  For the first part, we proceed by induction on $k$. If $k=1$, then by definition, we may write $f(x)=(x-a_1)^{\alpha_1}q(x)$. Now, suppose that the statement is true for up to $k$ roots, and consider a collection of $k+1$ roots. Using the inductive hypothesis, we may write
  $$f(x)=(x-a_1)^{\alpha_1}\cdots (x-a_k)^{\alpha_k}q(x)\quad\text{ and }\quad f(x)=(x-a_{k+1})^{\alpha_{k+1}}q'(x)$$
  Equating 
  $$(x-a_1)^{\alpha_1}\cdots (x-a_k)^{\alpha_k}q(x)=(x-a_{k+1})^{\alpha_{k+1}}q'(x)$$
  and using the fact that $(x-a_{k+1})$ is an irreducible element that is distinct from any on the left hand side gives us that $(x-a_{k+1})^{\alpha_{k+1}}\mid q(x)$, which proves the first statement.
  
  Now, suppose that a polynomial $f(x)$ of degree $n$ as more than $n$ roots in $F$, counted with multiplicity. From what we showed, we must have $(x-a_1)^{\alpha_1}\cdots (x-a_k)^{\alpha_k}\mid f(x)$. But $F[x]$ is an integral domain so this is impossible, as the divisor has a higher degree than $f(x)$. 


I was first wondering if the proof was correct. Moreover, in proving the first half of the statement I used the fact that an irreducible element is prime, which leverages the fact that $F[x]$ is a U.F.D. Is there a more general method of proof that works on general integral domains?
I'd state the result as follows:


  If $F$ is a field and $f \in F[x]$ not zero, then $f(x)=(x-a_1)\cdots(x-a_m)g(x)$, where $m\ge 0$, $a_i \in F$, and $g$ has no roots in $F$. In particular, $m \le n$, the degree of $f$.


and prove it by induction on the degree of $f$:

If $f$ has no roots in $F$, then take $m=0$ and $g=f$. In particular, this holds for $f$ nonzero constant.

If $f$ has a root $a_1$ in $F$, then $f(x)=(x-a_1)q(x)$ by polynomial division. The result follows by induction applied to $q$, whose degree is less than that of $f$.

No need to bring multiplicities into this argument until now. But then it is easy to conclude a result about multiplicities by grouping equal factors $x-a_i$.

Note that unique factorization is not a part of the argument.
I'd state the result as follows:


  If $F$ is a field and $f \in F[x]$ not zero, then $f(x)=(x-a_1)\cdots(x-a_m)g(x)$, where $m\ge 0$, $a_i \in F$, and $g$ has no roots in $F$. In particular, $m \le n$, the degree of $f$.


and prove it by induction on the degree of $f$:

If $f$ has no roots in $F$, then take $m=0$ and $g=f$. In particular, this holds for $f$ nonzero constant.

If $f$ has a root $a_1$ in $F$, then $f(x)=(x-a_1)q(x)$ by polynomial division. The result follows by induction applied to $q$, whose degree is less than that of $f$.

No need to bring multiplicities into this argument until now. But then it is easy to conclude a result about multiplicities by grouping equal factors $x-a_i$.

Note that unique factorization is not a part of the argument.