Explanation of solution for $\langle x,y\rangle = x^TAy$

inner-productslinear algebramatricessymmetric matrices

Show that every scalar product can be described by a symmetrical positive definite matrix.
With $A\in \mathbb{R}^{N \times N}$ and $x,y \in \mathbb{R}^N$:
$$\langle x,y\rangle = x^TAy.$$


Solution:

\begin{align}
\langle x,y \rangle &= \left\langle \sum_{i}x_i e_i, \sum_{j}y_j e_j \right\rangle \\
&= \sum_{i}x_i \left\langle e_i, \sum_{j}y_j e_j \right\rangle \\
&= \sum_{i}\sum_{j} x_i y_j \langle e_i, e_j \rangle \\
&= x^TAy,
\end{align}

with $A_{ij} = \langle e_i, e_j \rangle$.

The defined matrix $A$ is symmetrical and positive definite because of the symmetry and positive definiteness of the scalar product.


So this is the solution, but I don’t understand it.

But shouldn’t it be like this?: $$\langle x,y \rangle = x_i y_i +\ldots + x_n y_n$$

So what was exactly done in the sum?

Could someone help me and explain the steps?

Best Answer

Your $\langle x,y \rangle = x_1 \cdot y_1 +\cdots + x_n \cdot y_n$ is just one possible inner product on $\Bbb R^n$. There are, in fact, plenty of different inner products. For instance, on $\Bbb R^2$ $$ \langle x,y\rangle =x_1y_1-\frac12x_1y_2-\frac12x_2y_1+x_2y_2 $$ is also an inner product, this is the expansion that the sum does. In this case, we have $$A=\begin{bmatrix}1&-\frac12\\-\frac12&1\end{bmatrix}$$which is symmetric positive definite, and we have $$\langle e_1,e_1\rangle =\langle e_2,e_2\rangle=1\\ \langle e_1,e_2\rangle=\langle e_2,e_1\rangle=-\frac12$$

If you like, you can twist it and say there is only one inner product, but you can change the coordinate axes, without changing the inner product. In that case, if $B$ is the change-of-basis matrix, then $A=B^TB$.

The standard inner product corresponds to $A=I$.