Solution (source code)

= Solution

Expand the <vector> in the <orthonormal basis>, $v=\sum_jv_je_j$. Using linearity in the second slot and the <Kronecker delta> gives
$$
\boxed{\langle e_i,v\rangle=\sum_jv_j\langle e_i,e_j\rangle=v_i.}
$$
Expanding both <vectors> and using conjugate linearity in the first slot therefore gives
$$
\boxed{\langle u,v\rangle=\sum_{i,j}\overline{u_i}v_j\langle e_i,e_j\rangle=\sum_i\overline{u_i}v_i.}
$$
An <orthonormal set> that is not a <basis> would recover only the coordinates of the <orthogonal projection> onto its <linear span>; here the $n$ <vectors> span $\mathbb C^n$.