Solution (source code)

= Solution

Since the first $k$ basis vectors span the <invariant subspace> $W$, their images have no components in the last $n-k$ coordinates. Thus
$$
\boxed{[T]=\begin{pmatrix}A&B\\0&D\end{pmatrix}.}
$$
Here $A$ is the matrix of $T|_W$, $D$ is the matrix of the induced map on the <quotient vector space> $V/W$, and $B$ is unrestricted. The chosen complementary span need not itself be invariant, so $D$ should not in general be called a restriction to that complement. The block-triangular <determinant> gives
$$
\boxed{\chi_T(t)=\chi_A(t)\chi_D(t).}
$$