Inner product (source code)

= Inner product
{title2=$\langle\cdot,\cdot\rangle$}
{wiki}

An inner product assigns a scalar $\langle u,v\rangle$ to two <vectors> and supplies their lengths and <orthogonality>. Using the convention linear in the first argument, it satisfies
$$
\langle au+bv,w\rangle=a\langle u,w\rangle+b\langle v,w\rangle,\qquad
\langle u,v\rangle=\overline{\langle v,u\rangle},\qquad
\langle v,v\rangle>0\quad(v\ne0).
$$
The resulting <norm> is $\|v\|=\sqrt{\langle v,v\rangle}$. Over the <real numbers>, conjugation has no effect and the form is symmetric and <bilinear>. Over the <complex numbers>, it is <sesquilinear>; the convention linear in the second argument is also common, so formulas for <coefficients> must match the stated convention.

The Euclidean example is $\langle u,v\rangle=\sum_i u_i\overline{v_i}$. For real $u=(2,1)$ and $v=(1,3)$ this gives $\langle u,v\rangle=5$, while $\|u\|^2=5$ and $\|v\|^2=10$. If $r=(-1,2)$, then $\langle r,u\rangle=0$: perpendicularity becomes an algebraic equation. The <Cauchy-Schwarz inequality> gives $|\langle u,v\rangle|\leq\|u\|\|v\|$, and in a real <inner product space> it makes the angle formula $\cos\theta=\langle u,v\rangle/(\|u\|\|v\|)$ meaningful for nonzero <vectors>.

Different <inner products> express different measurements. The weighted example $\langle u,v\rangle=4u_1v_1+u_2v_2$ on $\mathbb R^2$ gives $\|(x,y)\|^2=4x^2+y^2$, so its unit-length <vectors> lie on an ellipse. For <functions>, an <integral> such as $\langle f,g\rangle=\int f\overline g$ supplies the geometry of the <L2 space>. This lets <orthogonal projection> and <least-squares solutions> apply to curves as well as coordinate lists.