I came across a proof which had the following sequence:
$$\sum_{i=1}^n k_i y_i = \sum_{i=1}^n \frac{(x_i - \bar x)y_i}{\sum_{j=1}^n (x_j - \bar x)^2}$$
where
$$k_i = \frac{(x_i - \bar x)}{\sum_{j=1}^n (x_j - \bar x)^2}.$$
(Whatever the value of i, the denominator of $k_i$ is the same). Now,
$$\begin{align} \sum_{i=1}^n k_i^2 & = \sum_{i=1}^n\left[\frac{(x_i - \bar x)}{\sum_{j=1}^n (x_j - \bar x)^2}\right]^2 = \frac{1}{\sum_{j=1}^n (x_j - \bar x)^2}. \end{align}$$
I'm not quite sure how this inference is made. Could somebody show me (slowly) the steps in between? I am particularly confused about how the summation operators work in this situation.