[proofplan]
We restrict attention to the generalised eigenspace $G_\lambda = \ker(A - \lambda I)^n$ and observe that $N = (A - \lambda I)|_{G_\lambda}$ is nilpotent. Within a Jordan block decomposition of $G_\lambda$, we compute $\operatorname{rank} N^k$ by summing contributions from each block. The first differences of the rank sequence count blocks of length exceeding $k$, and the second differences isolate blocks of exactly size $k$. Finally, we verify that $\operatorname{rank}(A - \lambda I)^k$ on all of $\mathbb{C}^n$ differs from $\operatorname{rank} N^k$ on $G_\lambda$ by a constant, so the second-difference formula is the same.
[/proofplan]
[step:Decompose $\mathbb{C}^n$ into the generalised eigenspace $G_\lambda$ and its complement]
Define the generalised eigenspace $G_\lambda := \ker(A - \lambda I)^n$. Since $A$ is a matrix over $\mathbb{C}$, the space $\mathbb{C}^n$ decomposes as
\begin{align*}
\mathbb{C}^n &= G_\lambda \oplus G',
\end{align*}
where $G' = \bigoplus_{\mu \neq \lambda} G_\mu$ is the direct sum of the generalised eigenspaces for all other eigenvalues $\mu$. Both $G_\lambda$ and $G'$ are $(A - \lambda I)$-invariant. The dimension of $G_\lambda$ equals the algebraic multiplicity $m$ of $\lambda$.
On $G'$, the operator $(A - \lambda I)|_{G'}$ is invertible: for each $\mu \neq \lambda$, the restriction $(A - \lambda I)|_{G_\mu}$ has the form $(A - \mu I + (\mu - \lambda)I)|_{G_\mu}$, where $(A - \mu I)|_{G_\mu}$ is nilpotent and $(\mu - \lambda) \neq 0$, making the sum invertible. Therefore $\operatorname{rank}(A - \lambda I)^k|_{G'} = \dim G' = n - m$ for all $k \geq 0$.
[guided]
The matrix $A$ may have multiple eigenvalues, and the Jordan blocks for eigenvalues other than $\lambda$ do not contribute to the block-size count for $\lambda$. We isolate $\lambda$'s contribution by decomposing $\mathbb{C}^n$ via generalised eigenspaces.
Define $G_\lambda = \ker(A - \lambda I)^n$, the generalised eigenspace for $\lambda$. By the generalised eigenspace decomposition theorem, $\mathbb{C}^n$ decomposes as
\begin{align*}
\mathbb{C}^n &= G_\lambda \oplus G',
\end{align*}
where $G' = \bigoplus_{\mu \neq \lambda} G_\mu$ is the direct sum of generalised eigenspaces for all other eigenvalues. Both summands are invariant under $A - \lambda I$: they are invariant under $A$ (each $G_\mu$ is $A$-invariant), hence under $A - \lambda I = A - \lambda \cdot \operatorname{Id}$.
Why is $(A - \lambda I)|_{G'}$ invertible? On each $G_\mu$ with $\mu \neq \lambda$, write
\begin{align*}
(A - \lambda I)|_{G_\mu} &= (A - \mu I)|_{G_\mu} + (\mu - \lambda)I_{G_\mu}.
\end{align*}
The operator $(A - \mu I)|_{G_\mu}$ is nilpotent (by definition of generalised eigenspace), and $(\mu - \lambda)I$ is a non-zero scalar multiple of the identity since $\mu \neq \lambda$. A nilpotent operator plus a non-zero scalar is always invertible: its eigenvalues are all $\mu - \lambda \neq 0$. So $(A - \lambda I)|_{G_\mu}$ is invertible for each $\mu \neq \lambda$, and therefore $(A - \lambda I)|_{G'}$ is invertible on all of $G'$.
This means $(A - \lambda I)^k|_{G'}$ is invertible for every $k \geq 0$, contributing $\operatorname{rank}((A - \lambda I)^k|_{G'}) = \dim G' = n - m$ to the total rank at every value of $k$. The rank changes as $k$ increases come entirely from $G_\lambda$.
[/guided]
[/step]
[step:Express $r_k$ in terms of the nilpotent restriction on $G_\lambda$]
Define $N := (A - \lambda I)|_{G_\lambda}: G_\lambda \to G_\lambda$. Since $G_\lambda = \ker(A - \lambda I)^n$, the operator $N$ is nilpotent with $N^n = 0$ (in fact $N^m = 0$ since $\dim G_\lambda = m$).
By the invariant decomposition $\mathbb{C}^n = G_\lambda \oplus G'$:
\begin{align*}
r_k = \operatorname{rank}(A - \lambda I)^k &= \operatorname{rank} N^k + \operatorname{rank}((A - \lambda I)^k|_{G'}) = \operatorname{rank} N^k + (n - m).
\end{align*}
Therefore, for consecutive values:
\begin{align*}
r_{k-1} - r_k &= \operatorname{rank} N^{k-1} - \operatorname{rank} N^k,
\end{align*}
since the constant $n - m$ cancels. The second difference is
\begin{align*}
r_{k-1} - 2r_k + r_{k+1} &= (\operatorname{rank} N^{k-1} - \operatorname{rank} N^k) - (\operatorname{rank} N^k - \operatorname{rank} N^{k+1}).
\end{align*}
[/step]
[step:Compute $\operatorname{rank} N^k$ from the Jordan block structure on $G_\lambda$]
By the [Nilpotent Jordan Decomposition](/theorems/3283) theorem, $G_\lambda$ decomposes as $G_\lambda = C_1 \oplus \cdots \oplus C_r$, where $C_i$ is a cyclic subspace of dimension $m_i$ (the size of the $i$-th Jordan block for $\lambda$). The operator $N$ acts on each $C_i$ as a nilpotent Jordan block of size $m_i$.
For a single cyclic subspace $C_i$ with basis $\{v_i, Nv_i, \ldots, N^{m_i - 1}v_i\}$:
\begin{align*}
\operatorname{rank}(N^k|_{C_i}) &= \dim N^k(C_i) = \begin{cases} m_i - k & \text{if } k < m_i, \\ 0 & \text{if } k \geq m_i. \end{cases}
\end{align*}
This holds because $N^k(C_i) = \operatorname{span}(N^k v_i, N^{k+1} v_i, \ldots, N^{m_i - 1} v_i)$, which has dimension $m_i - k$ when $k < m_i$. Summing over all blocks:
\begin{align*}
\operatorname{rank} N^k &= \sum_{i=1}^r \max(m_i - k, 0).
\end{align*}
[guided]
We need to compute how $\operatorname{rank} N^k$ depends on the block sizes $m_1, \ldots, m_r$. The key structural fact is that the direct sum decomposition $G_\lambda = \bigoplus_{i=1}^r C_i$ with each $C_i$ being $N$-invariant implies
\begin{align*}
\operatorname{im} N^k &= \bigoplus_{i=1}^r N^k(C_i),
\end{align*}
so the rank of $N^k$ is the sum of the ranks of $N^k$ restricted to each block: $\operatorname{rank} N^k = \sum_{i=1}^r \operatorname{rank}(N^k|_{C_i})$.
Now consider a single cyclic subspace $C_i$ of dimension $m_i$, with Jordan chain $v_i, Nv_i, \ldots, N^{m_i - 1}v_i$. What does $N^k$ do to this chain? Applying $N^k$ shifts the chain by $k$ positions: it maps $N^j v_i \mapsto N^{j+k} v_i$. The image $N^k(C_i)$ is therefore spanned by $N^k v_i, N^{k+1} v_i, \ldots, N^{m_i - 1} v_i$ — the last $m_i - k$ vectors of the chain. By the [Jordan Chains Are Linearly Independent](/theorems/3282) theorem, these vectors are linearly independent (they are a sub-chain of the original Jordan chain). So when $k < m_i$:
\begin{align*}
\operatorname{rank}(N^k|_{C_i}) &= \dim N^k(C_i) = m_i - k.
\end{align*}
When $k \geq m_i$, the chain is exhausted: $N^k v_i = 0$ (since $N^{m_i} v_i = 0$), so $N^k(C_i) = \{0\}$ and $\operatorname{rank}(N^k|_{C_i}) = 0$.
Combining both cases: $\operatorname{rank}(N^k|_{C_i}) = \max(m_i - k, 0)$. Summing over all blocks:
\begin{align*}
\operatorname{rank} N^k &= \sum_{i=1}^r \max(m_i - k, 0).
\end{align*}
[/guided]
[/step]
[step:Take the second difference to count blocks of exactly size $k$]
The first difference of the rank sequence is
\begin{align*}
\operatorname{rank} N^{k-1} - \operatorname{rank} N^k &= \sum_{i=1}^r [\max(m_i - k + 1, 0) - \max(m_i - k, 0)].
\end{align*}
The summand equals $1$ when $m_i \geq k$ (i.e., $m_i - k + 1 \geq 1$ and $m_i - k \geq 0$, so the difference is $1$), and equals $0$ when $m_i < k$. Therefore
\begin{align*}
\operatorname{rank} N^{k-1} - \operatorname{rank} N^k &= |\{i : m_i \geq k\}|,
\end{align*}
the number of Jordan blocks of size at least $k$.
The second difference is
\begin{align*}
(r_{k-1} - r_k) - (r_k - r_{k+1}) &= |\{i : m_i \geq k\}| - |\{i : m_i \geq k+1\}| = |\{i : m_i = k\}|.
\end{align*}
This is precisely the number of Jordan blocks for $\lambda$ of size exactly $k$, which gives the stated formula $r_{k-1} - 2r_k + r_{k+1}$.
[guided]
The first difference $r_{k-1} - r_k$ has a clean combinatorial interpretation. From the formula $\operatorname{rank} N^k = \sum_{i=1}^r \max(m_i - k, 0)$, we compute the difference between consecutive ranks:
\begin{align*}
r_{k-1} - r_k &= \sum_{i=1}^r [\max(m_i - k + 1, 0) - \max(m_i - k, 0)].
\end{align*}
For each block $C_i$, the summand equals $1$ when $m_i \geq k$ (because then $\max(m_i - k + 1, 0) = m_i - k + 1$ and $\max(m_i - k, 0) = m_i - k$, giving a difference of $1$). When $m_i < k$, both terms are $0$, contributing $0$. Geometrically, each block of size $m_i \geq k$ contributes a rank drop of exactly $1$ at step $k$: the vector $N^{k-1}v_i$ was in the image of $N^{k-1}$ but $N^k v_i = N^{k-1}(Nv_i)$ has been shifted one step further, losing one dimension. Therefore
\begin{align*}
r_{k-1} - r_k &= |\{i : m_i \geq k\}|,
\end{align*}
the number of blocks of size at least $k$. Now take the second difference — the difference of consecutive first differences:
\begin{align*}
(r_{k-1} - r_k) - (r_k - r_{k+1}) &= |\{i : m_i \geq k\}| - |\{i : m_i \geq k + 1\}|.
\end{align*}
The blocks counted by the first set but not the second are precisely those with $m_i \geq k$ but $m_i < k + 1$, i.e., $m_i = k$. Therefore
\begin{align*}
r_{k-1} - 2r_k + r_{k+1} &= |\{i : m_i = k\}|,
\end{align*}
the number of Jordan blocks for $\lambda$ of size exactly $k$. Since the left-hand side involves only $r_j = \operatorname{rank}(A - \lambda I)^j$, which depends only on $A$ and $\lambda$ (not on any choice of Jordan basis or decomposition), the number of blocks of each size is uniquely determined. This completes the proof.
[/guided]
[/step]