Let $V:= \mathbb{R}^{n \times n}$, $X \in V$ be given and $$ U_X := \lbrace A \in V: \mathrm{trace}(AX) = 0 \rbrace $$ a subspace. I want to find the dimension of $U_X$.
If $X = 0$, then clearly $U_X = V$ and therefore the dimension is $n^2$. If not, then I can choose $\tilde{A} \in V$ s.t. $\mathrm{trace}(\tilde{A}X) \neq 0$ and thus $A \mapsto \mathrm{trace}(AX)$ is a linear operator of rank 1. Consequently, $\dim U_X = n^2 - 1$ by the rank-nullity theorem.
Is this (short outline) correct?