Solution (source code)

= Solution

The sum in question is $\langle Pu,Pv\rangle$. Applying Cauchy-Schwarz and then <Bessel's inequality> gives
$$
|\langle Pu,Pv\rangle|^2\leq\|Pu\|^2\|Pv\|^2\leq\|u\|^2\|v\|^2.
$$
If either original <vector> is <zero>, equality holds. If both are nonzero, equality forces both projection <norms> to equal their original <norms> and also forces dependence of the projected <vectors>. Thus \b[apart from the <zero>-<vector> cases, equality holds exactly when $u,v\in W$ and $u,v$ are <linearly dependent>].

For the final unnumbered request, apply Cauchy-Schwarz in $\mathbb R^k$ to $p_i=a^{i/2}$ and $q_i=a^{-i/2}$. Their <inner product> is $k$, so
$$
\boxed{\left(\sum_{i=1}^ka^i\right)\left(\sum_{i=1}^ka^{-i}\right)\geq k^2.}
$$
Equality requires the positive <vectors> $p,q$ to be proportional, equivalently $a^i$ constant for $i=1,\ldots,k$. For $k\geq2$ this is \b[$a=1$]. If $k=1$, equality holds for every $a>0$.