An invariant subspace of $\mathbb{F}^n$ 
Problem: Let $A$ be a square matrix of szie $n$ over a field $\mathbb{F}$ and characteristic polynomial $$p_A (t) = a (t -
 \lambda_1)^{n_1} \dots (t - \lambda_k)^{n_k}$$ with $a_i \in
 \mathbb{F}, \lambda_i \in \mathbb{F}, \lambda_i \neq \lambda_j, 1 \leq
 i \neq j \leq k, a \neq 0$ and $n_i \in \mathbb{N}$ such that
   $\sum_{i=1}^k n_i = n$. Show that:
  
  
*
  
*$\mathcal{R}_{A,\lambda_i} = \{x \in \mathbb{F}^n \equiv
     \mathbb{F}^{n \times 1} | \exists m \in \mathbb{N}^* : (A -
     \lambda_i I_n)^m x = 0$ } is a subspace of $\mathbb{F}^n$.
  
*$\dim (\mathcal{R}_{A,\lambda_i}) = n_i, \forall n = 1, \dots, k$.

My attempt: To show that $\mathcal{R}_{A,\lambda_i}$ is a subspace of $\mathbb{F}^n$, let $x,y \in \mathcal{R}_{A,\lambda_i}$. We have 
$$(A - \lambda_i I_n)^m x + (A - \lambda_i I_n)^m y = 0+0 = 0 = (A - \lambda_i I_n)^m (x+y).$$
and 
$$\alpha (A - \lambda_i I_n)^m x = \alpha0 = 0, \alpha \in \mathbb{F}^n.$$
Is that right? How to show that $\dim (\mathcal{R}_{A,\lambda_i}) = n_i$?
 A: I'm here to give a demo. This may not be the quickest one. 
For a matrix $\newcommand\bm\boldsymbol
\DeclareMathOperator\Ker{Ker}
\newcommand\F{{\mathbb F}}
\newcommand\N {{\mathbb N}}
\bm A \in \mathrm M_n (\F)$ [i.e. $n \times n$ with entries in $\F$], let $\Ker \bm A = \{\bm x \in \F^n \colon \bm {Ax} = \bm 0\}$ From now on, let $\bm N_j = \bm A - \lambda_j \bm I_n$. 
First we figure out what exactly $W_j = R_{\bm A,\lambda_j} $ is. For any matrix $\bm P \in \mathrm M_n (\F)$, consider $\Ker(\bm P^s)$ and $\Ker(\bm P^{s+1})$ where $s \in \N$. If $\bm y \in \Ker(\bm P^s)$, i.e. $\bm P^s \bm y = \bm 0$, then clearly $\bm P^{s+1}\bm y = \bm P(\bm P^s \bm y) = \bm 0$. In other words, $\Ker(\bm P^s) \subseteq \Ker(\bm P^{s+1})$. So we have a chain:
$$
\varnothing \subseteq \Ker \bm P \subseteq \Ker (\bm P^2) \subseteq \dots \subseteq \Ker(\bm P^s) \subseteq \cdots
$$
Easy to see that each $\Ker (\bm P^s)$ is a subspace of $\F^n$. Thus $\dim(\Ker (\bm P ^s)) \leqslant n$ for all $s$. Therefore there exists some smallest $m\in \N$ s.t. $\dim(\Ker(\bm P^m)) = \dim(\Ker (\bm P^{m+p}))$ for all $p \in \N^*$. 
Additionally, we see that 

if $\dim(\Ker (\bm P^s))= \dim(\Ker (\bm P^{s+1}))$ for some $s\in \N^*$, then $\dim(\Ker (\bm P^s)) = \dim (\Ker (\bm P^{s+p}))$ for all $p \in \N^*$. 

Indeed, under the assumption, we have $\Ker (\bm P^s) = \Ker (\bm P^{s+1})$. Then for each $\ell\in \N^*$,if $\bm y\in \Ker(\bm P^{s+\ell})$, i.e. $\bm P^{s+\ell} \bm y = \bm 0$, then $\bm P^{s+1} (\bm P^{\ell-1} \bm y)= \bm 0$, hence $\bm P^{\ell-1} \bm y \in \Ker(\bm P^{s+1})$. Use the assumption $\Ker(\bm P^s) = \Ker(\bm P^{s+1})$, we have $\bm P^{\ell-1}\bm y \in \Ker(\bm P^s)$ or $\bm P^{s+\ell -1} \bm y =\bm 0$, thus $\bm y \in \Ker(\bm P^{s+\ell -1})$. Conclusively 
$$
\Ker (\bm P^{s+\ell-1}) = \Ker (\bm P^{s+\ell}), \quad \ell \in \N^*, 
$$
now let $\ell = 1, 2, \dots, p-1$ and the claim is proved. To be clearer, we have the following chain:
$$
\varnothing \subset \Ker(\bm P) \subset \dots \subset \Ker(\bm P^{m-1}) \subset \Ker(\bm P^m) = \Ker (\bm P^{m+1}) = \cdots \subseteq \F^n,
$$
where $\subset$ means $\subsetneq$. 
Now focus on each $\bm N_j$. Let the corresponding integer $m$ be $m_j$. Consider $W_j$ and $\Ker(\bm N_j^{m_j})$. By the definition of $W_j$, clearly $\Ker(\bm N_j^{m_j}) \subseteq W_j$. Conversely if $\bm x \in W_j$, then there is some $p\in \N^*$ s.t. $\bm N_j^p \bm x = \bm 0$ by definition, or $\bm x \in \Ker (\bm N_j^p)$. According to the chain above, $\Ker (\bm N_j^p) \subseteq \Ker(\bm N_j^{m_j})$. Therefore we actually have
$$
W_j = \Ker(\bm N_j^{m_j}), j = 1,2, \dots, k. 
$$
Now we prove that 
$$
W = \sum_1^k \Ker(\bm N_j ^{m_j}) = \sum_1^k W_j \tag {1}
$$
is also a direct sum. 
Equivalently we need to show

If $\bm 0 = \sum_1^k \bm w_j$ where $w_j \in W_j$ for each $j$, then $\bm w_j =\bm 0$ for all $j$. 

Let $f_j (t) = (t - \lambda_j)^{m_j} \in \F[t]$ and $g_j (t) = \prod_{\ell \neq j} f_\ell (t)$ for each $j$. Clearly $\mathrm{gcd}(g_j, f_j) = 1$. Thus there exists $u_j, v_j \in F[t]$ such that 
$$
u_j f_j + v_j g_j = 1. 
$$
Hence 
$$
u_j (\bm A) f_j(\bm A) + v_j (\bm A) g_j(\bm A) = \bm I_n, 
$$
and for each $\bm y \in \F^n$, 
$$
\bm y = u_j (\bm A) f_j(\bm A)\bm y + v_j (\bm A) g_j(\bm A) \bm y. \tag{2}
$$
If $\bm y \in \Ker(f_j (\bm A)) \cap \Ker (g_j(\bm A))$, i.e. $f_j(\bm A) \bm y =g_j(\bm A)\bm y = \bm 0$, then $(2)$ becomes $\bm y = \bm 0$. Hence $\Ker (f_j(\bm A)) \cap \Ker(g_j (\bm A)) = \{\bm 0\}$. Now suppose $\bm 0 = \sum_1^k \bm w_j$ where $\bm w_j \in W_j$ for each $j$, then by the definition of $\bm w_j$, $g_\ell (\bm A) \bm w_j = \bm 0$ if $\ell \neq j$. Thus $\bm w_\ell \in \Ker(g_\ell (\bm A)) \cap \Ker(f_\ell (\bm A)) = 0$, then $\bm w_\ell = \bm 0$ for each $\ell$. Therefore $(1)$ is proved. 
Finally we get the goal: by the definition of $W_j$, we have $\Ker(\bm N_j ^{n_j}) \subseteq W_j$ for each $j$. Now compute the dimension by using the dimension formula of direct sums, we have 
$$
n = \dim (\F^n) \geqslant \dim W = \dim \left(\bigoplus _1^k W_j\right) = \sum_1^k \dim \left( W_j\right) \geqslant \sum_1^k \dim (\Ker(\bm N_j ^{n_j})) = \sum_1^k n_j = n,
$$
so actually the $\geqslant$'s are all $=$. Hence each $\dim(\Ker (\bm N_j^{n_j})) = \dim (W_j) = n_j$, QED. 
