Proving a matrix is semipositive definite Let $n \ge 2$, $\lambda_i>0$, $i=1,2,\cdots, n$. Let $\Lambda=\sum_{i=1}^n\lambda_i$. Let $$a_{ij}=\begin{cases}\frac{\Lambda}{\lambda_i}-1\quad &i=j\\
1\quad &i\ne j\end{cases}$$
My question is that, is $(a_{ij})$ a semipositive definite matrix?
I know that when $n=2$, each $a_{ii}$ is positive, and the determinant is $$(\frac{\Lambda}{\lambda_1}-1)(\frac{\Lambda}{\lambda_2}-1)-1=\frac{\lambda_2}{\lambda_1}\frac{\lambda_1}{\lambda_2}-1=0.$$Hence $(a_{ij})$ is semipositive definite for $n=2$. How to show the matrix is also semipositive definite for any $n \ge 3$? Even for $n=3$, the computation is very complicated. I'm wondering if there is a neat way of seeing this, since the matrix is highly symmetric.
 A: I assume we have the usual ordering $\lambda_1\geq \lambda_2 \geq .... \geq \lambda_n \gt 0$.  Since $n=2$ is already dealt with I only consider $n\geq 3$ below.  And for $n\geq 3$ it is actually true that $A \succ \mathbf 0$.
$A= D + \mathbf {11}^T$
(where $\mathbf 1$ is a ones vector so $\mathbf {11}^T$ is the ones matrix sometimes denoted $J$ i.e. an outer product of two ones vectors)
Note that $A$ is a positive matrix (in the Perron Theory sense).
Then we have Diagonal matrix $D$ with diagonals
$d_{i,i} = \dfrac{\sum_{k=1}^n \lambda_k}{\lambda_i}-2$
note 1:
$d_{i,i}\leq 0\implies \sum_{k=1}^n \lambda_k\leq 2\lambda_i$
This is certainly possible for $\lambda_1$ but impossible for $j\neq 1$ because
$\sum_{k=1}^n \lambda_k \gt \lambda_1 + \lambda_2 \geq\lambda_1+\lambda_j\geq 2 \lambda_j$
(note in the disallowed $j=1$ case the middle inequality can break)
note 2:
this implies the ordering either
(i)  $0\leq d_{1,1,}\leq d_{2,2}\leq ... \leq d_{n,n}$  or
(ii)  $d_{1,1,}\lt 0\lt d_{2,2}\leq ... \leq d_{n,n}$
In case (i) we are basically done since a PSD matrix plus a PSD matrix is PSD. If $d_{1,1}\gt 0$ then it's a PD matrix plus PSD hence PD.  If $d_{1,1}=0$:
$\mathbf x \in \ker \big(D + \mathbf {11}^T\big)\implies D \mathbf x \propto \mathbf 1\implies \mathbf x \in \ker D$ (since $D$ kills the top coordinate of any vector hence its image is uniform iff zero)$\implies \mathbf x \propto \mathbf e_1$ but the first std basis vector isn't in the kernel of the ones matrix $\implies \mathbf x=\mathbf 0$, so the above matrix is PSD and invertible i.e. PD.
The remainder of the post only considers Case (ii).
The eigenvalues of $A$ interlace those of $D$ so this means $A$ has at most one eigenvalue $\leq 0$.  Thus we will prove $A$ is PD by showing it has a positive determinant.  There may be a more direct approach but one way or another we want to estimate $\text{trace}\big(D^{-1}\big)$
Now fix arbitrary (a) $\lambda_1$ and (b) $c:= \sum_{k=1}^n \lambda_k$
the mapping $x\mapsto \frac{x}{c-2x}$  (i.e. $\lambda_i\mapsto d_{i,i}^{-1}$) has second derivative $\frac{4c}{(c-2x)^3}$ which is $\gt 0$ for $x \in S =\{\lambda_2, \lambda_3,...,\lambda_n\}$ for any allowable set $S$. Hence we get a strictly Schur convex function with respect to eigenvalues 2 through n.
Thus for reasons of strict Schur convexity we have
$\text{trace}\big(D^{-1}\big)$ is minimized when $\lambda_2=\lambda_3=...=\lambda_n$  and it is 'maximized' when $\lambda_2 \approx c - \lambda_1$.  I.e. when $\lambda_j\approx 0$ for $3\leq j\leq n$. We can exploit this in a more precise way sequentially.
With $\delta_r := 2^{-r}$ (starting with large enough $r$ to make the argument sensible)
$\lambda_{2_r} := c - \lambda_1 - \delta_r$
and $\lambda_{j_r} :=\frac{\delta_r}{n-2}$ for $3\leq j\leq n$
Then consider
$\text{trace}\big(D_r^{-1}\big) = \frac{\lambda_1}{c-2\lambda_1} + \frac{\lambda_{2_r}}{c-2\lambda_{2_r}}+(n-2)\frac{\delta_r}{n-2}\frac{1}{c - 2\frac{\delta_r}{n-2}}$
$=\frac{\lambda_1}{c-2\lambda_1} + \frac{\lambda_{2_r}}{c-2\lambda_{2_r}}+(\delta_r)\frac{1}{c - 2\frac{\delta_r}{n-2}}=\frac{\lambda_1}{c-2\lambda_1}+ \frac{\lambda_{2_r}}{c-2\lambda_{2_r}} + \epsilon_r$
to show the final term  $\epsilon_r \to 0$, look at the inverse
$(\delta_r)^{-1}\big(c - 2\frac{\delta_r}{n-2}\big)$, the second term is increasing in $r$ but bounded above by $c$ while the first term $\to \infty$ hence the product $\to \infty$ and the original (inverse) $\to 0$
So we have a strictly monotone increasing sequence
$s_r = \frac{\lambda_1}{c-2\lambda_1} + \frac{\lambda_{2_r}}{c-2\lambda_{2_r}}+\epsilon_r$
(justification for monotone behavior: combining majorization with strict Schur convexity)
$\lim_{r\to \infty}s_r = \frac{\lambda_1}{c-2\lambda_1} + \frac{c-\lambda_1}{c-2 (c-\lambda_1)}=-1$
We already know the RHS is $-1$ because OP already in effect proved that in the $2\times 2$ case.  I.e. using that result in combination with the matrix determinant lemma tells us
$0=\det\big(D_{2\times 2} +\mathbf 1_2\mathbf 1_2^T\big) = \det\big(D_{2\times 2} \big)\cdot\big(1+\mathbf 1_2^T D_{2\times 2}^{-1}\mathbf 1_2\big)= \det\big(D_{2\times 2} \big)\cdot \Big(1 + \text{trace}\big(D_{2\times 2}^{-1} \big)\Big)$
$\implies \frac{\lambda_1}{c-2\lambda_1} + \frac{c-\lambda_1}{c-2 (c-\lambda_1)}= \text{trace}\big(D_{2\times 2}^{-1}\big) =-1$
by selecting $D_{2\times 2}$ based off of eigenvalues $\lambda_1'=\lambda_1$ and $\lambda_2':=c-\lambda_1$
side note: we know $\det\big(D_{2\times 2} \big) \neq 0$ because $0 \gt d^{(2\times 2)}_{1,1}$ and the only way the second component is 0 is if $\frac{\lambda_1'+\lambda_2'}{\lambda_2'}-2=0\implies \lambda_1'=\lambda_2'$  but then $0\gt d^{(2\times 2)}_{1,1} = d^{(2\times 2)}_{2,2}=0$ which is impossible)
Again fixing $\lambda_1$ and $c$ any given allowable choice of $D$ is majorized by $D_r$ for $r$ large enough so the argument is that $\text{trace}\big(D^{-1}\big) \leq \text{trace}\big(D_r^{-1}\big) = s_r \lt \lim_{r\to \infty}s_r= -1$.
Finally applying matrix determinant lemma to the problem we get
$\det\big(A\big) =\det\big(D +\mathbf {11}^T\big)  = \det\Big(D\Big)\cdot \Big(1+\mathbf 1^TD^{-1}\mathbf 1\Big)= \det\big(D\big)\cdot \Big(1+ \text{trace}\big(D^{-1}\big)\Big)\gt 0$
i.e. both terms are negative so their product is positive and $A$ must have all positive eigenvalues.
