[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]