Prove that if $A\in M_{n}\left(\mathbb{F}\right)$ matrix with a characteristic polynomial that can be written as a product $\left(x-\lambda_{1}\right)^{r_1}\dots\left(x-\lambda_{k}\right)^{r_k}$ of linear polynomials, then $A$ is similar to an upper triangular matrix.
My attempt:
Well first I showed that if $\lambda$ is an eigenvalue of $A$ then it can be written as
$P^{-1}AP=\left(\begin{matrix}\lambda & * & \cdots & *\\ 0 & \ulcorner & & \urcorner\\ \vdots & & B\\ 0 & \llcorner & & \lrcorner \end{matrix}\right)$
for some invertible $P \in M_{n}\left(\mathbb{F}\right)$.
Then by induction on n I showed that for a $2\times 2$ matrix the claim holds using the above lemma. I've assumed correctness for some $n$. And then I tried proving it for $n+1$: I used the lemma for the $\left(n+1\right) \times \left(n+1\right)$ matrix (because we assume that its characteristic polynomial can be reduced).
Then I tried using the induction hypothesis on the inner $B$ of the $\left(n+1\right) \times \left(n+1\right)$ matrix. So I've concluded that there's some matrix $Q\in M_{n}\left(\mathbb{F}\right)$ so that $Q^{-1}BQ$ is upper triangular.
The next step was to use it for my current matrix so I've decided to cunstruct the following matrices:
$ Q^{'}=\left(\begin{matrix}1 & 0 & \cdots & 0\\ 0 & \ulcorner & & \urcorner\\ \vdots & & Q\\ 0 & \llcorner & & \lrcorner \end{matrix}\right) $ and $ Q^{'-1}=\left(\begin{matrix}1 & 0 & \cdots & 0\\ 0 & \ulcorner & & \urcorner\\ \vdots & & Q^{-1}\\ 0 & \llcorner & & \lrcorner \end{matrix}\right) $
So that now I can claim that
$Q^{'-1}\left(\begin{matrix}\lambda & * & \cdots & *\\ 0 & \ulcorner & & \urcorner\\ \vdots & & B\\ 0 & \llcorner & & \lrcorner \end{matrix}\right)Q^{'} = \left(\begin{matrix}\lambda & * & \cdots & *\\ 0 & \ulcorner & & \urcorner\\ \vdots & & Q^{-1}BQ\\ 0 & \llcorner & & \lrcorner \end{matrix}\right) $
which is essentially an upper triangular matrix.
But I'm having hard time determining whether it's correct at all because to be honest a lot of indices confuse me :) and I would really like to know whether my proof is correct and is there a more solid\clear\intuitive way to explain the last conclusion.
Edit 1: I'll try to make my question clearer: We are usually required to be extremely rigorous, so the $Q^{'-1} P^{-1} A P Q^{'}$ part needs to be explained as well but I can't seem to find a better explanation then something like "well it has identity in the upper left corner so that's what happens" but I can't figure a nice way of writing this mathematically without babbling too much.