[guided]The failure of Kalman controllability gives a nonzero vector that annihilates the columns of the Kalman matrix. We package all such vectors into the subspace
\begin{align*}
W := \{q \in \mathbb{C}^n : q^*A^kB=0 \text{ for every } k \in \{0,1,\dots,n-1\}\}.
\end{align*}
Because
\begin{align*}
\mathcal{K}(A,B)=\begin{bmatrix} B & AB & A^2B & \cdots & A^{n-1}B \end{bmatrix},
\end{align*}
the equation $q^*\mathcal{K}(A,B)=0$ is exactly the collection of equations $q^*A^kB=0$ for $0 \le k \le n-1$. Since $\operatorname{rank}\mathcal{K}(A,B)<n$, the rows of $\mathcal{K}(A,B)$ are linearly dependent, so some nonzero $q \in \mathbb{C}^n$ satisfies $q^*\mathcal{K}(A,B)=0$. Hence $W$ is nonzero.
Let $A^*$ denote the conjugate transpose of $A$. Each condition $q^*A^kB=0$ is homogeneous and linear in $q$, so $W$ is closed under addition and scalar multiplication; hence $W$ is a complex vector subspace of $\mathbb{C}^n$.
The crucial structural point is that $W$ is invariant under $A^*$. Let $q \in W$. We must prove that $A^*q$ also lies in $W$, meaning that
\begin{align*}
(A^*q)^*A^kB=0
\end{align*}
for every $k \in \{0,1,\dots,n-1\}$. For $0 \le k \le n-2$, the computation is a shift of exponent:
\begin{align*}
(A^*q)^*A^kB=q^*AA^kB=q^*A^{k+1}B.
\end{align*}
Since $k+1 \in \{1,\dots,n-1\}$ and $q \in W$, the last expression is zero.
The only exponent not covered by this shift is $k=n-1$, because it produces $A^nB$, while the definition of $W$ only controls powers up to $A^{n-1}B$. This is exactly where finite-dimensionality enters. By the [Cayley-Hamilton theorem](/theorems/923) applied to the square matrix $A \in \mathbb{C}^{n \times n}$, the matrix $A$ satisfies its characteristic polynomial, so there are coefficients $c_0,\dots,c_{n-1}\in\mathbb{C}$ such that
\begin{align*}
A^n=\sum_{j=0}^{n-1}c_jA^j.
\end{align*}
Therefore
\begin{align*}
(A^*q)^*A^{n-1}B=q^*A^nB=q^*\left(\sum_{j=0}^{n-1}c_jA^j\right)B=\sum_{j=0}^{n-1}c_jq^*A^jB.
\end{align*}
Each term $q^*A^jB$ is zero because $q \in W$ and $0 \le j \le n-1$. Hence
\begin{align*}
(A^*q)^*A^{n-1}B=0.
\end{align*}
We have verified every exponent in the defining condition of $W$, so $A^*q \in W$. Thus $W$ is a nonzero subspace invariant under $A^*$.[/guided]