If matrix $A \in \Bbb R^{d \times d}$ is positive semidefinite and tall matrix $W \in \Bbb R^{d \times c}$ (where $d > c$) has orthonormal columns, $W^T W = I_c$, does the following inequality hold?
$$\mbox{Tr} \left( W^T A W \right) \leq \mbox{Tr} (A)$$
It seems true after I run the code many times, but I can't prove it. Anyone can help? Thanks.
import numpy as np
d = 10
m = round(0.3*d)
A = np.random.randint(-100, 100, (d, d))
A = A.dot(A.T) #A is postive semidefinte now
B = np.random.randint(-100, 100, (d, m))
u, s, vh = np.linalg.svd(B)
W = u[:, 0:m]
p1 = np.trace(W.T.dot(A).dot(W))
p2 = np.trace(A)
print(p1)
print(p2)
Since $A$ is orthogonally diagonalizable, we may assume $A=\mbox{diag}(a_1, ..., a_d)$. Write $W=(w_{ij})$. Direct calculation shows that $$\operatorname{Trace}(W^TAW)=\sum_{i=1}^{c} \sum_{k=1}^{d}w_{ki} a_k w_{ki}=\sum_{k=1}^{d} a_k \left( \sum_{i=1}^{c}w_{ki} w_{ki} \right)$$
Thus it suffices to show $\sum_{i=1}^{c}w_{ki} w_{ki} \leq 1$.
To see this, note that $\sum_{k=1}^{d}w_{ki} w_{kj} = \delta_{ij}$ as $W^T W = I$. In other words, the columns $[W]^{1}, \dots, [W]^{c}$ are orthonormal. Since $c<d$, we can find $v_{c+1}, \dots, v_{d}$ in $\mathbb R^d$ such that $[W]^1, \dots, [W]^c, v_{c+1}, \dots, v_{d}$ is a orthonormal basis of $\mathbb R^{d}$. Let $Z$ be a matrix having these vectors as columns. Then $Z^TZ = I$, and thus $ZZ^T=I$, i.e. $Z^T$ is an orthogonal matrix. In particular, the columns of $Z^T$ is of length $\leq 1$. You can show $\sum_{i=1}^{c}w_{ki} w_{ki} \leq 1$ from this.