[step:Put the system into Kalman controllability form]Let $\mathcal{C} \subset \mathbb{R}^n$ denote the controllable subspace of the pair $(A,B)$, defined by
\begin{align*}
\mathcal{C} := \operatorname{span}_{\mathbb{R}}\{A^j Bv : 0 \leq j \leq n-1,\ v \in \mathbb{R}^m\}.
\end{align*}
Let $r := \dim \mathcal{C}$. Since $A\mathcal{C} \subset \mathcal{C}$ and $\operatorname{Range}(B) \subset \mathcal{C}$, choose a basis of $\mathbb{R}^n$ whose first $r$ vectors form a basis of $\mathcal{C}$, and let $T \in GL(n,\mathbb{R})$ be the change-of-basis matrix with those basis vectors as columns. In the coordinates $z = T^{-1}x$, define
\begin{align*}
\widetilde{A} := T^{-1}AT \in \mathbb{R}^{n \times n}
\end{align*}
and
\begin{align*}
\widetilde{B} := T^{-1}B \in \mathbb{R}^{n \times m}.
\end{align*}
The invariance $A\mathcal{C} \subset \mathcal{C}$ and the inclusion $\operatorname{Range}(B) \subset \mathcal{C}$ imply that there are matrices
\begin{align*}
A_c \in \mathbb{R}^{r \times r}, \quad A_{12} \in \mathbb{R}^{r \times (n-r)}, \quad A_u \in \mathbb{R}^{(n-r) \times (n-r)}, \quad B_c \in \mathbb{R}^{r \times m}
\end{align*}
such that, with respect to the decomposition $\mathbb{R}^n = \mathbb{R}^r \oplus \mathbb{R}^{n-r}$, the transformed dynamics are given by
\begin{align*}
\widetilde{A}(z_c,z_u) = (A_c z_c + A_{12}z_u, A_u z_u)
\end{align*}
for $z_c \in \mathbb{R}^r$ and $z_u \in \mathbb{R}^{n-r}$, and the transformed input map is given by
\begin{align*}
\widetilde{B}v = (B_c v,0)
\end{align*}
for $v \in \mathbb{R}^m$. These formulas include the degenerate cases $r=0$ and $r=n$, with the corresponding zero-dimensional summand interpreted in the standard way. Moreover, by construction, the pair $(A_c,B_c)$ is controllable, and the eigenvalues of $A_u$ are precisely the uncontrollable eigenvalues of $(A,B)$ in the Popov-Belevitch-Hautus sense:
\begin{align*}
\operatorname{rank}_{\mathbb{C}}\begin{pmatrix}\lambda I_n - A & B\end{pmatrix} < n.
\end{align*}
This is the Kalman controllability decomposition. The theorem is being cited as an external standard result not yet resolved in the wiki: Kalman controllability decomposition.[/step]