# The Orthogonal Complement of the Space of Row-null and Column-null Matrices

Lemma. Let $$Z\in\text{GL}(n,R)$$, and let $$Y\in\mathcal{S}(n,R)$$ where $$\mathcal{S}(n,R)$$ is the space of row-null column-null $$n\times n$$ matrices. Then $$\text{Tr}(ZY)=0$$ if and only if $$Z$$ has the form

$Z_{ij}=\left(p_{j}-p_{i}\right)+\left(q_{j}+q_{i}\right)$

Proof. Consider the space of row-null and column-null matrices

$\mathcal{S}(n,R)=\{Y_{ij}\in GL(n,R):\sum_{i}Y_{ij}=0,\sum_{j}Y_{ij}=0\}$

Its dimension is

$\text{dim}(S(n,R))=N^{2}-2N+1$

since the row-nullness and column-nullness are defined by $$2N$$ equations, only $$2N-1$$ of which are linearly independent.

Consider the following space

$\mathcal{G}(n,R)=\{Z_{ij}\in GL(n,R):Z_{ij}=\left(p_{j}-p_{i}\right)+\left(q_{j}+q_{i}\right)\}$

Its dimension is

$\text{dim}(G(n,R))=2N-1$

where $$N-1$$ is the contribution from the antisymmetric part and $$N$$ is from the symmetric part.

Assume $$Y\in\mathcal{S}$$ and $$Z\in\mathcal{G}$$, then the Frobenius inner product of two such elements is

\begin{split}\begin{aligned} \text{Tr}(ZY) & =\sum_{ij}\left[\left(p_{j}-p_{i}\right)Y_{ji}+\left(q_{j}+q_{i}\right)Y_{ji}\right]\\ & =\sum_{j}(q_{j}+p_{j})\sum_{i}Y_{ji}+\sum_{i}(q_{i}-p_{i})\sum_{j}Y_{ji}\\ & =0\\\end{aligned}\end{split}

Since $$\text{dim}(\mathcal{G})+\text{dim}(\mathcal{S})=\text{dim}(GL)$$ and $$\mathcal{G}\perp\mathcal{S}$$, then $$\mathcal{G}$$ and $$\mathcal{S}$$ must be complementary in $$GL$$. Therefore, if $$Y$$ is orthogonal to all the matrices in $$\mathcal{S}$$, it must lie in $$\mathcal{G}$$.