Introduction
Once we have an inner product, length and distance come for free. This topic shows how, proves the most useful inequality in the subject (Cauchy–Schwarz), and defines what a metric is — the formal notion of distance that k-nearest-neighbours, k-means and similarity search depend on.