Show that $K_T(A)\in\mathcal L\left(M_{n\times n}\right)$ is singular and find all matrices $T$ s.t. $\dim \operatorname{Ker}\left(K_T\right)=1$ In the very beginning, I'm going to refer to a very similar post dealing with a key question indirectly similar to my task and also a post listing a few properties matrices have to satisfy in order to commute.$\newcommand{\Ker}{\operatorname{Ker}}$


Show that $\forall\;T\in M_{n\times n},\; K_T\in\mathcal L\left(M_{n\times n}\right)$,
$$K_T(A):= AT-TA$$
is singular and find all matrices $T$ s.t. $\dim\Ker\left(K_T\right)=1$.


$K_T$ is obviously singular because $\Ker\left(K_T\right)\ne\{0\}$, i.e., it has a non-trivial kernel, e.g. $K_T(I)=0$ and $K_T(T^k)=0,\forall k\in\Bbb N$.
Just in case, according to this answer, there are at most $n$ linearly independent matrices $A$ that could commute with $T$, and, from the first post I've referred to, $\operatorname{rank}\left(K_T\right)=\operatorname{rank}(AT-TA)\leqslant n^2-n$, which I understand because $\color{blue}{n^2-n\geqslant n}$ for $n\geqslant 2$ and $\color{blue}{\operatorname{rank}(A)\leqslant n},\;\forall A\in M_{n\times n}$
$$\implies n^2-n\geqslant n\geqslant\operatorname{rank}(AT-TA)\\\color{blue}{\dim M_{n\times n}-\operatorname{rank}\left(K_T\right)=\dim \Ker\left(K_T\right)\geqslant n}$$
I think, based on two counter-examples of mine, cases in the thread in the heading, but also this:
$A=T^{-1}\implies K_T(A)=K_T\left(T^{-1}\right)=0$, $\dim\Ker(T)\ne 1$.
I know I made a mess including side-statements, but is my reasoning correct?
May I ask how I could use all the information collected to prove a more general statement that it is (im) possible that $\dim\Ker\left(K_T\right)=k, 1\lt k\lt n$, $(k=n$ obviously holds $)$ and give examples of matrices $T$ that might satisfy the condition?
Thank you in advance!

Update:
While searching the site, I found a very interesting question regarding this topic. I highly encourage the beginner readers of this post to check it because it's really important.
 A: Here is one approach: 


*

*Note that, for any invertible $P$, you have  $\ker K_T= P^{-1}\,(\ker K_{PTP^{-1}}) P$

*Because of that, you can replace $T$ by its Jordan form and the dimension of the kernel will be the same. That is, we may assume that $$T=\begin{bmatrix} \alpha_1 I_{k_1}+J_1\\ &\ddots\\&& \alpha_r I_{k_r}+J_r\end{bmatrix},$$ where $k_1+\cdots+k_r=n$ and each $J_m$ is an $k_m\times k_m$ nilpotent Jordan block.

*Then $\ker K_T$ contains the block matrices $$\begin{bmatrix} T_1\\ &\ddots\\ && T_r\end{bmatrix},$$ where $T_m\in\ker K_{\alpha_m I_{k_m}+J_m}$. 

*For a nilpotent Jordan block $J$, you have $(J+\alpha I)A-A(J+\alpha I)=JA-AJ$. So  $$\ker K_{\alpha_m I_{k_m}+J_m}=\ker K_{J_m}.$$

*Thus $$\dim \ker K_T\geq\sum_{m=1}^r\dim\ker K_{J_m}.$$

*For each $m$, an easy computation shows that the kernel of $K_{J_m}$ is made of matrices of the form $$\begin{bmatrix} a_1 & a_2 & a_3 & \cdots & a_{k_m} \\
0&a_1&a_2&\cdots&a_{k_m-1}\\
\vdots&0&\ddots&\ddots&\vdots\\
\vdots&\vdots&\ddots&a_1&a_2\\
0&0&\cdots&\cdots&a_1
\end{bmatrix}.
$$
Thus $$\dim\ker K_{J_m}=k_m.$$

*It follows that $$\dim\ker K_T\geq\sum_{m=1}^r k_m=n$$
