Total Sum of Squares Algebraic proofs learning stats from https://newonlinecourses.science.psu.edu/stat414/node/218/ but having a hard time trying to do the algebra. Need to show $SS(TO)=\sum_{i=1}^{m}\sum_{i=1}^{n}(X_{ij}-\bar{X}_{..})^2=\sum_{i=1}^{m}\sum_{i=1}^{n}X_{ij}^2-\frac{X_{..}^2}{N}$.
Just wondering why $X_{ij}X_{..}=0$ 
Similarly for treatment sum of squares, need to show $SS(T)=\sum_{i=1}^{k}n_i(\bar{X}_{i.}-\bar{X}_{..})^2=\sum_{i=1}^{k}n_i\bar{X}^2_{i.}-N\bar{X}_{..}^2$. So why does $\bar{X}_{i.}\bar{X}_{..}=0$
Thanks!
 A: Here is the setup (why am I writing this out?..). $X_{ij}$ are given for $1\leqslant i\leqslant m$ and $1\leqslant i\leqslant n_{\color{red}{i}}$. $\bar{X}_{..}$ is defined as $\frac{1}{\color{red}{n}}\sum\limits_{i=1}^{m}\sum\limits_{j=1}^{n_{\color{red}{i}}}X_{ij}$, where it is not explicitly stated what $n$ is, but it is clear from the context that $n=\sum\limits_{i=1}^{m}n_i$. Similarly, $SS(TO)$ is defined as $\sum\limits_{i=1}^{m}\sum\limits_{j=1}^{n_{\color{red}{i}}}(X_{ij}-\bar{X}_{..})^2$. (Done with the setup.) Which equals
$$\sum_{i=1}^{m}\sum_{j=1}^{n_i}(X_{ij}^2-2X_{ij}\bar{X}_{..}+\bar{X}_{..}^2)=\sum_{i=1}^{m}\sum_{j=1}^{n_i}X_{ij}^2-\underbrace{2(n\bar{X}_{..})\bar{X}_{..}+n\bar{X}_{..}^2}_{\text{here is the cancellation}}.$$
A: Method of proof is similar to the proof of the so-called 'computational formula' for
the sample variance $S^2$ of a sample $X_1, X_2, \dots, X_n$ with sample mean $\bar X = \frac 1n \sum_{i=1}^n X_i.$ [All sums are over $i = 1, 2, \dots, n.]$
$$(n-1)S^2 = \sum_i (X_i - \bar X)^2
= \sum_i [X_i^2 - 2\bar X X_i + \bar X^2] \\
= \sum_i X_i^2 - 2\bar X\sum_i X_i + n\bar X^2\\
= \sum_i X_i^2 -2n\bar X^2 + n\bar X^2 \\
= \sum_i X_i^2 -n\bar X^2.$$
The equality between the first and second lines uses $\sum_i \bar X^2 = n\bar X^2$ and
the equality between the second and third lines uses the definition of $\bar X.$
