| Line Projection |
\operatorname{proj}_{\mathbf{w}}\mathbf{v} = \frac{\mathbf{v}\cdot\mathbf{w}}{\mathbf{w}\cdot\mathbf{w}}\mathbf{w} |
Residual \mathbf{r} = \mathbf{v} - \operatorname{proj}_{\mathbf{w}}\mathbf{v} \perp \mathbf{w}; Pythagoras \|\mathbf{v}\|^2 = \|\operatorname{proj}\|^2 + \|\mathbf{r}\|^2 |
| Cauchy–Schwarz & Angle |
|\mathbf{v}\cdot\mathbf{w}| \le \|\mathbf{v}\|\|\mathbf{w}\|, \cos\theta = \frac{\mathbf{v}\cdot\mathbf{w}}{\|\mathbf{v}\|\|\mathbf{w}\|} |
Keeps cosine in [-1, 1] in any dimension; clip to [-1, 1] in float arithmetic |
| Subspace Projector |
\mathbf{P} = \mathbf{Q}\mathbf{Q}^\top (\mathbf{Q}^\top\mathbf{Q} = \mathbf{I}_k) |
Unique closest point in S; idempotent (\mathbf{P}^2 = \mathbf{P}) and symmetric (\mathbf{P}^\top = \mathbf{P}) |
| Least Squares & QR |
\mathbf{A}^\top\mathbf{A}\hat{\mathbf{x}} = \mathbf{A}^\top\mathbf{y}, \mathbf{A} = \mathbf{Q}\mathbf{R} |
Gram–Schmidt / Householder QR avoids squaring \kappa(\mathbf{A}) in normal equations |
| Random Cosines in \mathbb{R}^d |
\mathbb{E}[\cos\theta] = 0, \operatorname{Var}(\cos\theta) = 1/d |
Random directions are within \pm 1/\sqrt{d} of orthogonal; attention scales by 1/\sqrt{d} |
| Hyperplane & Nearest Mean |
\text{dist}(\mathbf{x}) = \frac{\mathbf{w}\cdot\mathbf{x} + b}{\|\mathbf{w}\|}, \mathbf{w} = \bar{\mathbf{x}}_1 - \bar{\mathbf{x}}_0 |
Midpoint bisector achieves 92\% on t-shirts vs. trousers; linear layers stack m hyperplanes |