[proofplan]
We compare two decompositions of the finite-dimensional space $V$: a decomposition coming from an eigenbasis when $T$ is diagonalizable, and the internal direct sum of eigenspaces for distinct eigenvalues. In the diagonalizable direction, we write the matrix of $T$ in an eigenbasis and read the characteristic polynomial from its diagonal entries, which identifies the number of basis vectors of each eigenvalue with the exponent $m_j$. Conversely, if every eigenspace has dimension equal to its algebraic multiplicity, then the sum of all eigenspaces has dimension $\sum_{j=1}^r m_j=\dim_F V$; since distinct eigenspaces are linearly independent, this sum is direct and equals all of $V$. A basis obtained by concatenating bases of the eigenspaces is therefore an eigenbasis, so $T$ is diagonalizable.
[/proofplan]
[step:Read the algebraic multiplicities from an eigenbasis when $T$ is diagonalizable]
Since $V$ is nonzero and finite-dimensional, define $n:=\dim_F V \in \mathbb{N}$. Assume that $T$ is diagonalizable over $F$. By definition, there exists an ordered basis
\begin{align*}
\mathcal B=(v_1,\ldots,v_n)
\end{align*}
of $V$ consisting of eigenvectors of $T$. For each $i \in \{1,\ldots,n\}$, let $\mu_i \in F$ denote the eigenvalue satisfying
\begin{align*}
T v_i=\mu_i v_i.
\end{align*}
With respect to the ordered basis $\mathcal B$, the matrix of $T$ is the diagonal matrix
\begin{align*}
A=\operatorname{diag}(\mu_1,\ldots,\mu_n)\in F^{n\times n}.
\end{align*}
Therefore its characteristic polynomial is
\begin{align*}
\chi_T(X)=\det(XI_n-A)=\prod_{i=1}^{n}(X-\mu_i).
\end{align*}
Since the given factorisation
\begin{align*}
\chi_T(X)=\prod_{j=1}^{r}(X-\lambda_j)^{m_j}
\end{align*}
has distinct linear factors, uniqueness of factorisation in $F[X]$ implies that each $\mu_i$ is one of the $\lambda_j$, and that for each fixed $j \in \{1,\ldots,r\}$ exactly $m_j$ of the basis vectors $v_i$ have eigenvalue $\lambda_j$.
For each $j \in \{1,\ldots,r\}$, define
\begin{align*}
\mathcal B_j:=\{v_i \in \mathcal B:T v_i=\lambda_j v_i\}.
\end{align*}
Then $\mathcal B_j \subset E_{\lambda_j}(T)$ and $|\mathcal B_j|=m_j$. Because $\mathcal B$ is the disjoint union of the sets $\mathcal B_1,\ldots,\mathcal B_r$, every vector $x \in V$ has a unique expression
\begin{align*}
x=\sum_{i=1}^{n} a_i v_i
\end{align*}
with $a_i \in F$. If $x \in E_{\lambda_j}(T)$, then comparing the coefficients in
\begin{align*}
T x=\lambda_j x
\end{align*}
gives $a_i=0$ whenever $v_i \notin \mathcal B_j$, because then $\mu_i-\lambda_j\neq 0$. Hence $\mathcal B_j$ spans $E_{\lambda_j}(T)$. Since $\mathcal B_j$ is linearly independent as a subset of the basis $\mathcal B$, it is a basis of $E_{\lambda_j}(T)$, and therefore
\begin{align*}
\dim_F E_{\lambda_j}(T)=|\mathcal B_j|=m_j.
\end{align*}
[/step]
[step:Use the dimension hypothesis to force the eigenspaces to fill $V$]
Conversely, assume that
\begin{align*}
\dim_F E_{\lambda_j}(T)=m_j
\end{align*}
for every $j \in \{1,\ldots,r\}$. For each $j$, write
\begin{align*}
E_j:=E_{\lambda_j}(T).
\end{align*}
Because $\lambda_1,\ldots,\lambda_r$ are distinct, [citetheorem:8488] implies that the eigenspaces $E_1,\ldots,E_r$ form an internal direct sum: if $w_j \in E_j$ and
\begin{align*}
\sum_{j=1}^{r} w_j=0,
\end{align*}
then $w_j=0$ for every $j$. Indeed, after discarding the zero vectors among $w_1,\ldots,w_r$, the remaining nonzero vectors are eigenvectors belonging to distinct eigenvalues, so the cited theorem forces all their coefficients in the displayed relation to vanish. Hence
\begin{align*}
\dim_F(E_1+\cdots+E_r)=\sum_{j=1}^{r}\dim_F E_j.
\end{align*}
Using the assumed dimension equalities, we obtain
\begin{align*}
\dim_F(E_1+\cdots+E_r)=\sum_{j=1}^{r}m_j.
\end{align*}
Since $\chi_T$ has degree $\dim_F V$ and
\begin{align*}
\chi_T(X)=\prod_{j=1}^{r}(X-\lambda_j)^{m_j},
\end{align*}
we have
\begin{align*}
\sum_{j=1}^{r}m_j=\dim_F V.
\end{align*}
Therefore
\begin{align*}
\dim_F(E_1+\cdots+E_r)=\dim_F V.
\end{align*}
Since $E_1+\cdots+E_r$ is a subspace of $V$ with the same finite dimension as $V$, it follows that
\begin{align*}
V=E_1\oplus\cdots\oplus E_r.
\end{align*}
[guided]
We now prove the converse in a way that explains why the dimension condition is exactly the right one. Assume that
\begin{align*}
\dim_F E_{\lambda_j}(T)=m_j
\end{align*}
for every $j \in \{1,\ldots,r\}$. To simplify notation, define the subspace
\begin{align*}
E_j:=E_{\lambda_j}(T)
\end{align*}
for each $j \in \{1,\ldots,r\}$.
The first point is that eigenspaces corresponding to distinct eigenvalues cannot overlap in a way that creates a nontrivial linear relation. More precisely, let $w_j \in E_j$ for each $j \in \{1,\ldots,r\}$, and suppose that
\begin{align*}
\sum_{j=1}^{r}w_j=0.
\end{align*}
Discard the indices for which $w_j=0$. If any nonzero vectors remain, each remaining $w_j$ is an eigenvector of $T$ with eigenvalue $\lambda_j$, and the corresponding eigenvalues are distinct. Therefore [citetheorem:8488] applies to the remaining nonzero vectors and says that they are linearly independent. The displayed relation is a linear relation among those remaining vectors with all coefficients equal to $1$, so linear independence forces no nonzero vector to remain. Hence every $w_j$ is zero, and the sum $E_1+\cdots+E_r$ is an internal direct sum.
For an internal direct sum of finite-dimensional subspaces, dimensions add. Hence
\begin{align*}
\dim_F(E_1+\cdots+E_r)=\sum_{j=1}^{r}\dim_F E_j.
\end{align*}
Now we use the hypothesis of the theorem: each geometric multiplicity equals the corresponding exponent $m_j$ in the characteristic polynomial. Therefore
\begin{align*}
\dim_F(E_1+\cdots+E_r)=\sum_{j=1}^{r}m_j.
\end{align*}
The remaining question is: why is this sum equal to the whole dimension of $V$? The characteristic polynomial of a linear operator on an $n$-dimensional vector space has degree $n$, where $n=\dim_F V$. The displayed factorisation has degree
\begin{align*}
\sum_{j=1}^{r}m_j,
\end{align*}
because each factor $(X-\lambda_j)^{m_j}$ has degree $m_j$. Since these are two expressions for the same polynomial $\chi_T$, their degrees are equal, and so
\begin{align*}
\sum_{j=1}^{r}m_j=\dim_F V.
\end{align*}
Combining this with the preceding dimension computation gives
\begin{align*}
\dim_F(E_1+\cdots+E_r)=\dim_F V.
\end{align*}
The subspace $E_1+\cdots+E_r$ is contained in $V$, and both spaces have the same finite dimension. Therefore the subspace must be all of $V$:
\begin{align*}
V=E_1\oplus\cdots\oplus E_r.
\end{align*}
[/guided]
[/step]
[step:Construct an eigenbasis from the direct sum decomposition]
For each $j \in \{1,\ldots,r\}$, choose an ordered basis $\mathcal C_j$ of the finite-dimensional subspace $E_j$. Every vector in $\mathcal C_j$ is an eigenvector of $T$ with eigenvalue $\lambda_j$, because $E_j=E_{\lambda_j}(T)$.
Since
\begin{align*}
V=E_1\oplus\cdots\oplus E_r,
\end{align*}
the ordered list obtained by concatenating the bases
\begin{align*}
\mathcal C_1,\ldots,\mathcal C_r
\end{align*}
is a basis of $V$. Every vector in this concatenated basis is an eigenvector of $T$. Hence $V$ has a basis consisting of eigenvectors of $T$, so $T$ is diagonalizable over $F$. This proves the converse implication, and together with the first step completes the proof.
[/step]