I find that:
$$\Big(\sum_{i = 1}^n y_i\Big)^2 = \sum_{i=1}^m y_i^2 + \sum^m_{i\neq j}y_iy_j$$
where $m=(n^2-n)=n(n-1)$, the first part of the right side is the sum of the main diagonal of the matrix, and the second part is the sum of the upper and lower part of the matrix.
Then it is write that the second part can be written as:
$$\sum^m_{i\neq j}y_iy_j = 2\sum_{i=1}^n\sum_{j>i}^ny_iy_j$$
I think that this last point is not correct, in fact if we have $y_jy_i=k$, where $k$ is a constant we obtain:
$$ n(n-1)k \neq2n^2 $$
Furthermore, I think that $j = i-1$ should be better than $j>1$.
So, where is my mistake in the second part of the summation? And what about the $j$ index?