3
$\begingroup$

Going though some papers in clustering in machine learning, I often find the following claim:

$(a-b)(a-b) = \|a\|^2 + \|b\|^2 - 2a \cdot b$

My question is: When does this hold? (i.e. what type of norms or inner products satisfy this)? Is this only true for the $L_2$ inner product and its induced norm?

Also, would you call the above an example of distributivity in inner products? Does distributivity hold for inner products?

  • 2
    A minor LaTeX thing: it's a bit better to use `\|` or `\Vert` instead of `||` to get double norm-strokes: $\|$.2011-07-26

1 Answers 1

5

All inner products (over $\mathbb{R}$) satisfy this, if by the LHS you mean $(a - b) \cdot (a - b)$. It follows from bilinearity (which you can call distributivity if you want, but it would be better to call it bilinearity because the result of an inner product is a scalar, not a vector) and symmetry. You can call it the law of cosines if you want.

  • 2
    To add to what Qiaochu said, let $\odot$ be any *bilinear* operation on a vector space (that is, if $\vec{v},\vec{w},\vec{u}$ are vectors and $a,b,c$ are scalars, then we require $(a\vec{v}+b\vec{w})\odot (c\vec{u}) = ac (\vec{v}\odot \vec{u}) + bc (\vec{w}\odot \vec{u})$ and similarly $(a\vec{v})\odot(b\vec{w} + c\vec{u}) = ab (\vec{v}\odot \vec{w}) + ac (\vec{v}\odot \vec{u})$), then necessarily $(\vec{v}+\vec{w})\odot(\vec{v}+\vec{w}) = \vec{v}\odot \vec{v} + \vec{w}\odot \vec{w} + \vec{v}\odot\vec{w} + \vec{w}\odot\vec{v}$.2011-07-26