Suppose that $V$ is an inner product space.
(a) Show that if $\{e_1, . . . , e_n\}$ is an orthonormal basis for $V$ , then $$||v||^2=\sum_{i=1}^{n}|\langle v|e_i\rangle|^2\quad \quad \text{for every $v\in V.$}$$ (b) Suppose that $\{e_1, . . . , e_k\}$ is an orthonormal set in $V$ (not necessarily a basis), and let $v ∈ V$. Show that if $$||v||^2=\sum_{i=1}^{k}|\langle v|e_i\rangle|^2\quad \quad \text{for every $v\in V$}$$ then $v = \sum_{i=1}^{k}⟨v | e_i⟩e_i.$
I tried to use the reconstruction formula but am not getting anywhere. Please help.
For (a), write $v = \sum_{i=1}^n \langle v,e_i\rangle e_i$ and find $\langle v,v\rangle$ using the conjugate-linearity of the dot-product.
For (b), extend the set to an orthonormal basis and note that if $$ \sum_{i=1}^n |\langle v,e_i\rangle|^2 = \sum_{i=1}^k |\langle v,e_i\rangle|^2 $$ with $n > k$, then $\langle v,e_i\rangle = 0$ for all $i > k$.