Could someone help clarify an example in my linear algebra book on orthonormal bases? Linear Algebra with Applications by Steven J. Leon, p.257:

Theorem 5.5.2: Let $\{\textbf{u}_1, \textbf{u}_2, \ldots, \textbf{u}_n\}$ be an orthonormal basis for an inner product space $V$.  If $\textbf{v} = \sum_{i=1}^{n} c_i \textbf{u}_i$, then $c_i = \langle \textbf{v}, \textbf{u}_i \rangle$.

I don't know if I need to include the proof, but it's short, so here it is:

Definition: $\delta_{ij} = 
\begin{cases}
 1 & \text{if } i = j \\
 0 & \text{if } i \neq j
\end{cases}$
Proof: $$\langle \textbf{v}, \textbf{u}_i \rangle = \left< \sum_{j=1}^{n} c_j \textbf{u}_j, \textbf{u}_i \right> = \sum_{j=1}^{n} c_j \langle \textbf{u}_j, \textbf{u}_i \rangle = \sum_{j=1}^{n} c_j \delta_{ij} = c_i$$

Now here's the example given in the book.  He seems to be using the theorem's logic backwards.  I don't get it.

Example: The vectors
  $$ \textbf{u}_1 = \left(\dfrac{1}{\sqrt{2}},\dfrac{1}{\sqrt{2}}\right)^T \text{  and  } \textbf{u}_2 = \left(\dfrac{1}{\sqrt{2}},-\dfrac{1}{\sqrt{2}}\right)^T$$
  form an orthonormal basis for $\mathbb{R}^2$.  If $\textbf{x} \in \mathbb{R}^2$, then
  $$\textbf{x}^T \textbf{u}_1 = \dfrac{x_1 + x_2}{\sqrt{2}} \text{  and  } \textbf{x}^T \textbf{u}_2 = \dfrac{x_1 - x_2}{\sqrt{2}}$$
  It follows from Theorem 5.5.2 that
  $$\textbf{x} = \dfrac{x_1 + x_2}{\sqrt{2}} \textbf{u}_1 + \dfrac{x_1 - x_2}{\sqrt{2}} \textbf{u}_2$$

Isn't "$\textbf{x} = \dfrac{x_1 + x_2}{\sqrt{2}} \textbf{u}_1 + \dfrac{x_1 - x_2}{\sqrt{2}} \textbf{u}_2$" referring to "$\textbf{v} = \sum_{i=1}^{n} c_i \textbf{u}_i$", and "$\textbf{x}^T \textbf{u}_1 = \dfrac{x_1 + x_2}{\sqrt{2}} \text{  and  } \textbf{x}^T \textbf{u}_2 = \dfrac{x_1 - x_2}{\sqrt{2}}$" referring to "$c_i = \langle \textbf{v}, \textbf{u}_i \rangle$"?  Shouldn't the latter follow from the former?  Or should the theorem state if and only if?  Or am I just confused?
 A: Every vector in your inner product space can be expressed as a unique linear combination of your basis elements.
Just think about it, when would $\langle \textbf{v}, \textbf{u}_i \rangle$ ever not equal the $i'$th coefficient?
That's why the converse is true.
A: We know that $x = c_1 u_1 + c_2 u_2$ for some $c_1, c_2$.
By the theorem, $c_1 = \left< x, u_1 \right>$ and $c_2 = \left< x, u_2 \right>$.
Thus $$x = \left< x, u_1 \right> u_1 + \left< x, u_2 \right> u_2 = \frac{x_1 + x_2}{\sqrt{2}} u_1 + \frac{x_1 - x_2}{\sqrt{2}} u_2$$.
A: Since $\{\mathbf{u}_1, \mathbf{u}_2\}$ is a basis for $\mathbb{R}^2$, any $\mathbf{x} \in \mathbb{R}^2$ can be uniquely written as a linear combination
$$\mathbf{x} = a_1 \mathbf{u}_1 + a_2 \mathbf{u}_2. \tag{$\ast$}$$
Taking the inner product of $(\ast)$ with $\mathbf{u}_1$, we have
\begin{align*}
\langle \mathbf{x}, \mathbf{u}_1 \rangle & = \langle a_1 \mathbf{u}_1 + a_2 \mathbf{u}_2, \mathbf{u}_1 \rangle \\
 & = \langle a_1 \mathbf{u}_1, \mathbf{u}_1 \rangle + \langle a_2 \mathbf{u}_2, \mathbf{u}_1 \rangle \\
 & = a_1 \langle \mathbf{u}_1, \mathbf{u}_1 \rangle + a_2 \langle \mathbf{u}_2, \mathbf{u}_1 \rangle \\
 & = a_1 \cdot 1 + a_2 \cdot 0 \\
 & = a_1.
\end{align*}
A similar calculation shows that
$$\langle \mathbf{x}, \mathbf{u}_2 \rangle = a_2.$$
Therefore
$$a_1 = \langle \mathbf{x}, \mathbf{u}_1 \rangle = \mathbf{x}^T \mathbf{u}_1,$$
$$a_2 = \langle \mathbf{x}, \mathbf{u}_2 \rangle = \mathbf{x}^T \mathbf{u}_2.$$
This process can be used to show that the converse of the theorem is true.
