# When does the distributive propertive hold for inner products?

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: $\|$. – t.b. Jul 26 '11 at 15:09
Thanks @Theo. That makes sense. – user815423426 Jul 26 '11 at 15:09

## 1 Answer

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.

-
Thanks, I fixed the dot product in the question. So I guess all inner products over $\mathbb{R}$ induce norms, and the above always satisfies for them? – user815423426 Jul 26 '11 at 15:08

1
@AmV: yes. For complex inner products one instead gets $||a||^2 + ||b||^2 - 2 \text{Re}(a \cdot b)$ (exercise). – Qiaochu Yuan Jul 26 '11 at 15:12

1
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}$. – Willie Wong♦ Jul 26 '11 at 15:14
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 13, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": false, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.8899670243263245, "perplexity_flag": "middle"}