During my studying linear algebra, I came across the following problem:
Let $A$ be a square matrix with real entries, $k$ be a positive integer, and assume $\operatorname{rank}(A^k)=\operatorname{rank}(A^{k+1})$. Then, prove $\operatorname{rank}(A^k)=\operatorname{rank}(A^m)$ for any integer $m \ge k$.
Below is my solution to this problem and I think it's correct, but however I can't check it by myself because there are no model answers. Could you review my proof and point out whatever you would notice?
My Solution:
Let $A$ be $n \times n$ matrix. First of all, I'll view the matrix $A$ as a linear transformation $A \colon \mathbb{R}^n \ni v \mapsto Av \in \mathbb{R}^n$. From the general theory of linear algebra, the rank of a matrix is equal to the dimension of its image space. If $\operatorname{rank}(A^k) = 0$, then the statement is obviously true, so suppose $\operatorname{rank}(A^k) > 0$. Let me take its basis $v_1, \ldots, v_m$. By definition, $\operatorname{Im}(A^{k+1})$ is a subsapce of $\operatorname{Im}(A^k)$, and their dimensions are the same, so a linear trasformation $A \colon \operatorname{Im}(A^k) \to \operatorname{Im}(A^{k+1})$ is actually a linear isomorphism and $Av_1, \ldots, Av_m$ is found to be a basis of $\operatorname{Im}(A^{k+1})$. Therefore, I can take some regular $m \times m$ matrix $P$ of a change of basis: $$ (Av_1 \cdots Av_m) = (v_1 \cdots v_m)P. $$ From this equality, I found $A^pv_1, \ldots, A^pv_m$ ($p \ge 0$) to be a basis of $\operatorname{Im}(A^{k+p})$ by the calculation $$ (A^pv_1 \cdots A^pv_m) = A^{p-1}(Av_1 \cdots Av_m) = A^{p-1}(v_1 \cdots v_m)P = (A^{p-1}v_1 \cdots A^{p-1}v_m)P = \cdots = (v_1 \cdots v_m)P^p $$ and by $P^p$ being invertible.
Most worrying thing is that I was able to correctly show $A^pv_1, \ldots, A^pv_m$ is a basis of $\operatorname{Im}(A^{k+m})$.