I reduced a confounding and challenging problem to the task of proving an unweildy inequality. Luckily, I managed to reduce the inequality to proving that a certain quadratic form is positive semidefinite. This in turn, I observed was equivalent to a certain matrix having non-negative eigenvalues. Unfortunately, now I am stuck. The problem in its most reduced form is as such:
Write the integers $1, \dots, n^2$ in a square. Let $A_n$ be an $n^2 \times n^2$ matrix where $a_{ij} = \begin{cases} (n-1)^2, i = j \\ 1-n, \, i,j \text{ adjacent} \\ 1, else\end{cases}$ where "adjacent" is defined as being in the same row or column in the square that was constructed. Prove that all eigenvalues of $A_n$ are non-negative.
We have $A_2 = \begin{bmatrix} 1 & -1 & -1 & 1 \\ -1 & 1 & 1 & -1 \\ -1 & 1 & 1 & -1 \\ 1 & -1 & -1 & 1 \end{bmatrix}, A_3 = \begin{bmatrix} 4 & -2 & -2 & -2 & 1 & 1 & -2 & 1 & 1 \\ -2 & 4 & -2 & 1 & -2 & 1 & 1 & -2 & 1 \\ -2 & -2 & 4 & 1 & 1 & -2 & 1 & 1 & -2 \\ -2 & 1 & 1 & 4 & -2 & -2 & -2 & 1 & 1 \\ 1 & -2 & 1 & -2 & 4 & -2 & 1 & -2 & 1 \\ 1 & 1 & -2 & -2 & -2 & 4 & 1 & 1 & -2 \\ -2 & 1 & 1 & -2 & 1 & 1 & 4 & -2 & -2 \\ 1 & -2 & 1 & 1 & -2 & 1 & -2 & 4 & -2 \\ 1 & 1 & -2 & 1 & 1 & -2 & -2 & -2 & 4\end{bmatrix}.$ I'm not gonna bother writing out $A_4$ or any larger matrices. It would take too much time to even input the matrix into Wolfram-Alpha.
We see that $A_2$ has rank $1$ and trace $4,$ so its eigenvalues are $4,0,0,0.$ Unfortunately, $A_3$ is not so easy to analyze, although we can see it has rank $\le 8$ and trace $36.$ Using https://matrixcalc.org/en/vectors.html, I found that it had eigenvalues $0,9$ with multiplicity $5, 4$ respectively. How could we show that in general, $A_n$ has eigenvalues $0, n^2$ with multiplicity $2n-1, (n-1)^2$ respectively? Would there be any way of arriving at this conjecture without a computer?
Update: Some info about the structure of the eigenvalues of $A_3.$ We will represent eigenvalues as $3 \times 3$ matrices for simplicity. For $0,$ any row or column can be all $1$s with everything else being a $0.$ For $9,$ certain (not all) $2 \times 2$ rectangles with $1$ on one diagonal and $-1$ on the other will work. For example, $\begin{bmatrix} 0 & 0 & 0 \\ 0 & 0 & 0 \\ 1 & 1 & 1 \end{bmatrix}, \begin{bmatrix} 1 & -1 & 0 \\ 0 & 0 & 0 \\ -1 & 1 & 0 \end{bmatrix}$ correspond to eigenvalues of $0, 9$ respectively. It easy to generalize the eigenvalue of $0$ to obtain $2n-1$ eigenvectors, but I don't see how the $(n-1)^2$ eigenvectors for $n^2$ generalize, and the fact that the eigenvalues for $9$ actually work lacks a natural explanation.
Second update: Let $J_n$ be the all ones matrix. We can write $A_3 = \begin{bmatrix} -2J' & J' & J' \\ J' & -2J' & J' \\ J' & J' & -2J' \end{bmatrix} = J'' - 3K$ where $J' = J-3I, J''$ is the all $J'$s block matrix of appropriate size, and $K$ is the block diagonal matrix with $J'$ on the diagonal. The spectrum of $J_n$ is well-known to be $\{n^{(1)}, 0^{(n-1)} \},$ so the spectrum of $J-kI$ is also easily found. Perhaps there is some trick with block matrices that will allow for an easy solution.
Notice that the condition that $i$ and $j$ are adjacent is exactly the same thing as saying that either $\lceil i/n\rceil = \lceil j/n\rceil$ or $i\equiv j$ mod $n$. Let $I_n$ denote the identity matrix and $J_n$ denote the $n\times n$ matrix of all $1$s. It can be shown that $$ A_n=(J_n-nI_n)^{\otimes 2},$$ where $A^{\otimes 2}$ denotes the Kronecker square, i.e. the Kronecker product $A\otimes A$. It follows from properties of the Kronecker product that $A_n$ has eigenvalues equal to the square of eigenvalues of $(J_n-nI_n)$. The problem is thus reduced to showing that the eigenvalues of $(J_n-nI_n)$ are real, which follows from the fact that it is a symmetric matrix.