Appendix C — The Cauchy-Schwarz Inequality
In Chapter 5, we defined the standard distance function on \(\R^n\) to be
\[ d(\mathbf a,\mathbf b)=\sqrt{(b_1-a_1)^2 + \cdots + (b_n-a_n)^2} \]
where \(\mathbf a=(a_1,\ldots,a_n)\), \(\mathbf b=(b_1,\ldots,b_n).\)
we claimed that the standard distance function on \(\R^n\) satisfies the Triangle Inequality, but we never proved it. That is, for any \(\mathbf a,\mathbf b,\mathbf c\in\R^n\), we have \[ d(\mathbf a,\mathbf c)\leq d(\mathbf a,\mathbf b) + d(\mathbf b,\mathbf c). \tag{C.1}\]
As a first step, we will prove the Cauchy-Schwarz Inequality.
Theorem 3.1 Suppose \(u_1,\ldots, u_n\in\R\) and \(v_1,\ldots,v_n\in\R\). Then \[ \left(\sum_{i=1}^n u_iv_i\right)^2 \leq \left(\sum_{i=1}^n u_i^2\right)\left(\sum_{i=1}^n v_i^2\right). \]
Proof. Define a polynomial \[ p(t)=\sum_{i=1}^n (tu_i+v_i)^2. \]
Note that \(p(t)\) is never negative. Its formula can be rewritten as \[ p(t)=\sum_{i=1}^n t^2u_i^2 + 2tu_iv_i + v_i^2=t^2\left(\sum_{i=1}^n u_i^2\right)+2t\left(\sum_{i=1}^n u_iv_i\right) + \left(\sum_{i=1}^n v_i^2\right). \]
Note that \(p(t)\) is a quadratic function, so since it is never negative, its discriminantThis is a throwback to Algebra I. Remember that the discriminant of a quadratic function \(at^2+bt+c\) is \(b^2-4ac\). A quadratic function takes both positive and negative values if and only if \(\Delta>0.\) \(\Delta\) is non-positive. That is \[ 0\geq\Delta=\left(2\sum_{i=1}^n u_iv_i\right)^2-4\left(\sum_{i=1}^n u_i^2\right)\left(\sum_{i=1}^n v_i^2\right) \]
which implies \[\left(\sum_{i=1}^n u_i^2\right)\left(\sum_{i=1}^n v_i^2\right)\geq\left(\sum_{i=1}^n u_iv_i\right)^2.\]
Now that we have the Cauchy-Schwarz Inequality, the rest of the proof is just a matter of applying it and doing some algebra.
Corollary 3.2 The standard distance function on \(\R^n\) satisfies the Triangle Inequality.
Proof. Squaring both sides of Equation C.1, we will prove that for points \(\mathbf a=(a_1,\ldots,a_n)\), \(\mathbf b=(b_1,\ldots,b_n)\), and \(\mathbf c=(c_1,\ldots,c_n)\), \[ d(\mathbf a,\mathbf c)^2\leq (d(\mathbf a,\mathbf b) + d(\mathbf b,\mathbf c))^2. \]
Expanding the right side, we have \[ (d(\mathbf a,\mathbf b) + d(\mathbf b,\mathbf c))^2=d(\mathbf a,\mathbf b)^2+2d(\mathbf a,\mathbf b)d(\mathbf b,\mathbf c)+d(\mathbf b,\mathbf c)^2. \]
Letting \(u_i=b_i-a_i\) and \(v_i=c_i-b_i\), this becomes \[ \left(\sum_{i=1}^n u_i^2\right) + 2\sqrt{\left(\sum_{i=1}^n u_i^2\right)\left(\sum_{i=1}^n v_i^2\right)} + \left(\sum_{i=1}^n v_i^2\right), \]
which, by Theorem 3.1, is at least \[ \left(\sum_{i=1}^n u_i^2\right) + 2\left(\sum_{i=1}^n u_iv_i\right) + \left(\sum_{i=1}^n v_i^2\right). \]
However, this last line is equal to \[ \sum_{i=1}^n (u_i+v_i)^2=d(\mathbf a,\mathbf c)^2, \]
and so we have proven the theorem.