Eigenvalues of same-row matrices It has previously been discussed here that the eigenvalues of an all-ones $n \times n$ matrix $A$ such as the following are given by $0$ with multiplicity $n - 1$ and $n$ with multiplicity $1$, hence a total multiplicity of $n$ which means that the given matrix is diagonalizable.
$$A =
\begin{bmatrix}
1 & 1 & \cdots & 1 \\
1 & 1 & \cdots & 1 \\
\vdots & \vdots & \ddots & \vdots \\
1 & 1 & \cdots & 1 \\
\end{bmatrix}
$$
I recently wrote an exam that asked us to diagonalize a matrix with multiple (3) rows that contained the same entries, so I was wondering if there was some general case to apply.
Thus the question I am asking is given the following $n \times n$ matrix A, what are its eigenvalues?
$$A =
\begin{bmatrix}
a_1 & a_2 & \cdots & a_n \\
a_1 & a_2 & \cdots & a_n \\
\vdots & \vdots & \ddots & \vdots \\
a_1 & a_2 & \cdots & a_n \\
\end{bmatrix}
$$
For the sake of simplicity, lets first assume that $a_1, a_2, \ldots, a_n \in \mathbb{R} - \{0\}$; however, what happens if any (or all) are zero?
It seems logical that there be the eigenvalue $0$ with $n - 1$ multiplicity since the rank of this matrix will be $1$ (assuming at least one nonzero entry), and that the other eigenvalue be the sum of entries on the diagonal by observation $a_1 + a_2 + \cdots + a_n$ with $1$ multiplicity. I could not, however, write a formal proof for that second statement.

*

*If all the columns are zero, it is the zero matrix which of course must be diagonalizable since the zero matrix is a diagonal matrix. $$0=I\cdot 0\cdot I$$

*If at least one of the column is non-zero, then the rank of the matrix is $1$ and the nullity is $n-1$.  We check that the all-$1$ vector is an eigenvector and the eigenvalue is $\sum a_i$. Hence if $\sum_i a_i \neq 0$, then the matrix is diaognalizable since the geometry multiplicity is equal to the algebraic multiplicity.

*However, if one of the column is non-zero and $\sum_i a_i$ is equal to $0$. Since $\operatorname{tr}(A)=0=\sum_i \lambda_i$ and the nullity is $n-1$, we know the remaining eigenvalue must also be $0$. Suppose on the contrary that it is diagonalizable, then it is similar to the zero matrix, which shows that the matrix itself is the zero matrix, which is a contradiction since we assume at least one of the column is non-zero.
For example $A=\begin{bmatrix} 1 & -1 \\ 1 & -1 \end{bmatrix}$ is not diagonalizable. Let the two eigenvalue be $\lambda_1$ and $\lambda_2$, we know that $\lambda_1+\lambda_2=0,$ and we know that at least one of them is zero, hence both of them must be zero. If it is diagonalizable. then the matrix $A=P^{-1}\cdot 0 \cdot P = 0$ which is a contradiction.
