Distance of set of points to straight line going through 0 in $R^n$ Here is an old exercise I found, I've been going at it for the better part of 2 hours now and can't seem to find the correct proof.
Suppose $a_1, \ldots, a_m \in R^n$ is a set of point satisfying $\sum_i a_i = 0$.
Define
$$
L_{z,v} = \{ z+ \lambda v: \lambda \in R\}.
$$
Show that
$$
\sum_i d(a_i, L_{0,v})^2 \leq \sum_i d(a_i, L_{z,v})^2 \quad \forall z \in R^n.
$$
I've tried using induction on $n$ as well as $m$, I've tried to project all the elements into a plane perpendicular to $L_{0,v}$ and yet, I can't seem to figure it out.
Any tips would be greatly appreciated, thanks.
 A: First notice that we may always assume $|v|=1$, so that we have a neat formula for the projection of $a_i$ onto $v$ and so
$$
d(a_i,L_{0,v})^2= |a_i-\langle a_i,v\rangle v|^2= |a_i|^2-2\langle a_i,v\rangle^2+ \langle a_i,v\rangle^2.
$$
Summing over $i$ the middle term vanishes by the condition on the $a_i$, so
$$
\sum_{i=1}^m d(a_i,L_{0,v})= \sum_{i=1}^m (|a_i|^2-\langle a_i,v\rangle^2).
$$
Now we use the same idea to compute the distances $d(a_i,L_{z,v})$, the only difference being that we have to first translate our reference system by $z$, so that our line passes through the origin and we can repeat the above:
$$
d(a_i,L_{z,v})^2= |a_i-z - \langle a_i-z, v\rangle v|^2 = |a_i-z|^2-\langle a_i-z,v\rangle^2= |a_i|^2-2\langle a_i,z\rangle +|z|^2- \langle a_i, v\rangle^2 + 2 \langle a_i,v\rangle\langle z,v\rangle -\langle z,v\rangle^2.
$$
Summing over $i$, we see that
$$
\sum_{i=1}^m d(a_i,L_{z,v})^2= \sum_{i=1}^m (|a_i|^2-\langle a_i,v\rangle^2) + m[|z|^2-\langle z,v\rangle^2],
$$
and the quantity in brackets is nonnegative by Cauchy-Schwarz.
