Need little help in the proof of Bessel inequality:
Here is the statement:
Let $V$ be an inner product space if $\{ x_{1}, x_{2} ... , x_{n} \}$ is an orthonormal subset of Inner Product Space $V$ then
$\sum_{i=1}^{n} |\langle \mathbf{x},\boldsymbol{x}_i \rangle|^2 \leq \lVert
\mathbf{x} \rVert^2 \quad \text{for every } \mathbf{x}\in {V}$.
Proof Proof that I am reading is given below
Let $y = x - \langle \mathbf{x},\boldsymbol{x}_1 \rangle x_1 - \langle \mathbf{x},\boldsymbol{x}_2 \rangle x_2 \ldots - \langle \mathbf{x},\boldsymbol{x}_n \rangle x_n$
then $y = x - \alpha_1 x_1 - \alpha_2 x_2 - \ldots - \alpha_n x_n $, where $\alpha_i = \langle \mathbf{x},\boldsymbol{x}_i \rangle $ (STEP A)
Further $\langle \mathbf{y},\boldsymbol y \rangle = ||x||^2 - |\alpha _1|^2 - |\alpha _2|^2 \ldots - |\alpha _n|^2$ (STEP B)
I am confused about the step B. How it came after Step A. Kindly help me. I am not able to fill this gap. Thanks in advance
\begin{align} \langle y,y\rangle &=\langle x-\sum_{i=1}^n\alpha_i x_i,x-\sum_{j=1}^n\alpha_j x_j\rangle \\ &=\langle x,x\rangle-\sum_{j=1}^n \alpha_j\langle x, x_j\rangle -\sum_{i=1}^n\alpha_i\langle x_i,x\rangle+\sum_{i=1}^n\sum_{j=1}^n\alpha_i\alpha_j\langle x_i,x_j\rangle \\ &=\|x\|^2-\sum_{j=1}^n \alpha_j^2-\sum_{i=1}^n\alpha_i^2+\sum_{i=1}^n\sum_{j=1}^n\alpha_i\alpha_j\delta_{i,j} \\ &=\|x\|^2-\sum_{i=1}^n \alpha_i^2. \end{align}