An equality in matrix theory (also interesting in analysis) Let $M_{n\times n}$ be a real, symmetric matrix and 
$$
S=\left\{ \left(u_{1},\ldots,u_{k}\right)\Bigl|0\leq k\leq n,\left\{ u_{1},\ldots,u_{k}\right\} \textrm{ is an orthonormal subset in } \mathbb{R}^{n}\right\}. 
$$
 Prove that
$$
\sum_{\lambda\textrm{ are positive eigenvalues of }M}\lambda=\max_{S}\left\{ u_{1}Mu_{1}^{T}+\ldots+u_{k}Mu_{k}^{T}\right\} .
$$
A very special case is also interesting: Let $\lambda_{1}$ and $\lambda_{2}$ are positive, prove that 
$$
\lambda_{1}\left(a_{11}^{2}+a_{21}^{2}\right)+\lambda_{2}\left(a_{12}^{2}+a_{22}^{2}\right)\leq\lambda_{1}+\lambda_{2},
$$
where $a_{11}a_{21}+a_{12}a_{22}=0$ and  $a_{11}^{2}+a_{12}^{2}=a_{21}^{2}+a_{22}^{2}=1.$ 
 A: The question in matrix format is to prove that
$$
\sum \lambda_+(M)=\max_{U^TU=I}\operatorname{tr}U^TMU.
$$
The unitary diagonalization $M=Q\Lambda Q^T$ reduces the problem to proving that 
$$
\sum \lambda_+(M)=\max_{U^TU=I}\operatorname{tr}U^T\Lambda U=\max_{U^TU=I}\operatorname{tr}\Lambda UU^T.\tag{*}
$$
As @Tom Chen has answered, building the matrix $U$ of those columns of the identity matrix that correspond to positive $\lambda$'s we can prove that
$$
\sum \lambda_+(M)\le\max_{U^TU=I}\operatorname{tr}U^T\Lambda U.
$$
To prove the opposite we introduce the set of $n\times n$ matrices
$$
{\cal W}=\{W\colon W=W^T,\, 0\le W\le I\}
$$
where the inequalities are understood in the semidefinite sense, i.e. $W$ and $I-W$ are positively semidefinite matrices. Such matrices, in particular, have the diagonal elements being between $0$ and $1$ (as a simple conclusion by definition of positively semidefiniteness). We have
$$
\operatorname{tr}\Lambda W=\sum_{i=1}^n\lambda_i W_{ii}.
$$
The maximization over ${\cal W}$ is trivial - the best choice is to take $W_{ii}=1$ for a positive $\lambda_i$ and $0$ otherwise for all other $W_{ij}$. Thus,
$$
\max_{W\in{\cal W}}\operatorname{tr}\Lambda W=\sum\lambda_+(M).
$$
Finally, we rewrite the RHS in $(*)$ as
$$
\max_{U^TU=I}\operatorname{tr}\Lambda UU^T
$$
and notice that $W=UU^T\in{\cal W}$ if $U^TU=I$. Indeed, $W=W^T$ and $W\ge 0$ is clear. Furthermore, $U^TU=I$ $\Rightarrow$ $\|U\|=1$ $\Rightarrow$ $\|U^T\|=1$ $\Rightarrow$ $UU^T\le I$ $\Rightarrow$ $I-UU^T\ge 0$. Thus,
$$
\sum\lambda_+(M)=\max_{W\in{\cal W}}\operatorname{tr}\Lambda W\ge \max_{U^TU=I}\operatorname{tr}\Lambda UU^T
$$
Since the maximum over a subset is smaller. It gives the opposite inequality that proves $(*)$.
A: By properties of eigensystems, we have $Mu_i = \lambda_i u_i$ for orthonormal eigenvectors $\{u_1, \cdots, u_n\}$, hence $u_i^\intercal M u_i = \lambda_i$. For any $U \in S_M$, where $S_M \subseteq S$ is the restriction of $S$ to eigenvectors of $M$, we have  $UMU^\intercal$ corresponds to some sum of a subset of eigenvalues of $M$. Clearly the maximum sum is the sum of the positive eigenvalues of $M$, and the conclusion follows.
