Let $T: V\rightarrow V$ be a linear map where $V$ is finite dimensional. Let $\lambda_1,\lambda_2...,\lambda_n$ be distinct eigenvalues. If the characteristic polynomial $C(x)$ is a product of linear factors then show that the sum of the algebraic multiplicities $a_1+...…+a_n=dimV$.
I know that if I Suppose that the characteristic polynomial $C(x)$ can be expressed as $C(x)=(x-B_1)…(x-B_p)$. Then as $B_1...B_p$ are the roots, it follows that $C(x)$ can be expressed as $C(x)=(x-\lambda_1)^{a_1}…(x-\lambda_n)^{a_n}$ $=$ $det(xI-A)$, where $A$ is the matrix of the linear transformation of $T$. As $V$ is finite dimensional, $A$ has $dim(V)$ rows and $dim(V)$ columns. This means that $C(x)$ is a polynomial of degree dim(V). By the fundamental theorem of algebra, $C(x)$ must have at most $dimV$ roots (What type of fields does this statement hold for?). Therefore, since $\lambda_1,...,\lambda_n$ are all the roots of the polynomial, it follows that $a_1+a_2+....+a_n\leq dimV$.
How do I show that $dimV = a_1+a_2+....+a_n$?