orthonormal basis for $\mathbb{R}^n$ Let $\{u_1,u_2,\dots, u_n\}$ be an orthonormal basis for $\mathbb{R}^n$.
Show that
$$ \Vert v \Vert^2 = (v\cdot u_1)^2+(v\cdot u_2)^2+\dots+(v\cdot u_n)^2.$$
By the properties of a basis, $v$ can be written as $v=c_1u_1+c_2u_2+\dots+c_nu_n$.
I tried this

 A: Since $\{u_1,\cdots, u_n\}$ is a basis for $\mathbb{R}^n$ then these vectors span $\mathbb{R}^n$ and we can write
$$v=c_1 u_1+\cdots c_n u_n \qquad (1)$$
for some $c_i \in \mathbb{R}$.
Take the inner-product (the scalar product) of both sides of (1) by $u_i$ to get that
$$v\cdot u_i=c_1 u_1\cdot u_i+\cdots c_i u_i\cdot u_i+\cdots c_n u_n\cdot u_i=
c_i $$
becaue $u_i\cdot u_i=1$ and $u_j\cdot u_i=0$ if $j\neq i$.
Therefore, by (1), we have the representation
$$v= (u_1\cdot v) u_1+\cdots (u_n\cdot v) u_n.$$
Now,
$$\|v\|^2= v\cdot v=
\left((u_1\cdot v) u_1+\cdots (u_n\cdot v) u_n\right)\cdot\left(
(u_1\cdot v) u_1+\cdots (u_n\cdot v) u_n\right)$$
$$=\sum_{i=1}^{n}\sum_{j=1}^{n} (u_i\cdot v)(u_j\cdot v)  u_i \cdot u_j$$
$$=\sum_{i=1}^{n} (u_i\cdot v)(u_i\cdot v)  u_i \cdot u_i=
\sum_{i=1}^{n} (u_i\cdot v)^2.$$
A: For each $i\in\{1,\ldots,n\}$, let $u^i\colon \mathbf{R}^n\to\mathbf{R}$ be the unique linear function satisfying
$$u^i(u_j)=\delta_{ij}$$
for all $i,j\in\{1,\ldots,n\}$. Then
$$v=\sum_{i=1}^n u^i(v) u_i$$
for all $v\in\mathbf{R}^n$. This is true for any basis. Since we are considering an orthonormal basis, it follows from our definition of $u^i$ that $u^i(v)=\langle u_i, v\rangle$. Thus,
\begin{align}
\Vert v \Vert^2 =\langle v,v\rangle=\langle\sum_{i=1}^n \langle u_i, v\rangle u_i,\sum_{j=1}^n \langle u_j, v\rangle u_j\rangle=\sum_{i=1}^n\sum_{j=1}^n \langle u_i, v\rangle \langle u_j, v\rangle\langle u_i, u_j\rangle\\=\sum_{i=1}^n\sum_{j=1}^n \langle u_i, v\rangle \langle u_j, v\rangle\delta_{ij}= \sum_{i=1}^n\langle u_i,v\rangle^2
\end{align}
