假设有两个向量 $\boldsymbol{a}$ 和 $\boldsymbol{b}$ ,则有:
$\begin{aligned}\|\boldsymbol{a}-\boldsymbol{b}\|^{2} &=(\boldsymbol{a}-\boldsymbol{b})^{T}(\boldsymbol{a}-\boldsymbol{b}) \\&=\left(\boldsymbol{a}^{T}-\boldsymbol{b}^{T}\right)(\boldsymbol{a}-\boldsymbol{b}) \\&=\boldsymbol{a}^{T} \boldsymbol{a}-\boldsymbol{a}^{T} \boldsymbol{b}-\boldsymbol{b}^{T} \boldsymbol{a}+\boldsymbol{b}^{T} \boldsymbol{b} \\&=\|\boldsymbol{a}\|^{2}-2 \boldsymbol{a}^{T} \boldsymbol{b}+\|\boldsymbol{b}\|^{2} \\&=\|\boldsymbol{a}\|^{2}-2<\boldsymbol{a}, \boldsymbol{b}>+\|\boldsymbol{b}\|^{2}\end{aligned}$