# Spivak's Calculus, Ch. 13, Problem 39: Interpretation of Proof of Cauchy-Schwarz Inequality

The following is a problem from Chapter 13 "Integrals", from Spivak's Calculus.

1. Suppose that $$f$$ and $$g$$ are integrable on $$[a,b]$$. The Cauchy-Schwarz inequality states that

$$\left ( \int_a^b fg \right )^2 \leq \left ( \int_a^b f^2 \right ) \left ( \int_a^b g^2 \right )\tag{1}$$

(a) Show that the Schwarz inequality is a special case of the Cauchy-Schwarz inequality.

(b) Give three proofs of the Cauchy-Schwarz inequality by imitating the proofs of the Schwarz inequality in Problem 2-21. (The last one will take some imagination).

I am specifically interested in just one of the three proofs that are sought out in item $$(b)$$.

Let me first show what the corresponding proof in the cited Problem 2-21 was.

$$\sum\limits_{i=1}^n x_iy_i \leq \sqrt{\sum\limits_{i=1}^n x_i^2 \sum\limits_{i=1}^n y_i^2}\tag{2}$$

Proof

Let $$\vec{x}=\langle x_1,...,x_n \rangle$$ and $$\vec{y}=\langle y_1,...,y_n \rangle$$ be vectors.

Case 1: $$\vec{x}$$ and $$\vec{y}$$ are linearly independent. Ie,

$$c_1 \vec{x}+c_2\vec{y}=\vec{0} \iff c_1=c_2=0$$

Specifically, for any $$\lambda$$ we have

$$\lambda \vec{x}-\vec{y} \neq \vec{0}\tag{3}$$

and this vector has a length that is larger than zero

$$|\langle \lambda x_1-y_1,...,\lambda x_n-y_n \rangle |^2>0$$

$$(x_1-y_1)^2+...+(x_n-y_n)^2>0$$

$$\lambda^2 \sum\limits_{i=1}^n x_i^2 +\sum\limits_{i=1}^n y_i^2-2\lambda\sum\limits_{i=1}^n x_iy_i>0$$

Therefore,

$$\Delta=4\left ( \sum\limits_{i=1}^n x_iy_i \right )^2-4\sum\limits_{i=1}^n x_i^2 \sum\limits_{i=1}^n y_i^2<0$$

$$\implies \sum\limits_{i=1}^n x_iy_i < \sqrt{\sum\limits_{i=1}^n x_i^2 \sum\limits_{i=1}^n y_i^2}\tag{4}$$

Which is the strict version of the Schwarz Inequality.

Case 2: $$\vec{x}$$ and $$\vec{y}$$ are linearly dependent.

Case 2.1: at least one of the vectors is $$\vec{0}$$. Then

$$\implies \sum\limits_{i=1}^n x_iy_i = \sqrt{\sum\limits_{i=1}^n x_i^2 \sum\limits_{i=1}^n y_i^2}\tag{5}$$

because both sides are zero.

Case 2.2: neither vector is $$\vec{0}$$

Then there is some $$\lambda$$ such that $$\lambda\vec{x}-\vec{y}=0$$.

$$\sum\limits_{i=1}^n x_iy_i=\lambda\sum\limits_{i=1}^n y_i^2=\lambda > \sqrt{\sum\limits_{i=1}^n y_i^2} \sqrt{\sum\limits_{i=1}^n y_i^2}=\sqrt{\sum\limits_{i=1}^n x_i^2}\sqrt{\sum\limits_{i=1}^n y_i^2}$$

$$\implies \sum\limits_{i=1}^n x_iy_i = \sqrt{\sum\limits_{i=1}^n x_i^2 \sum\limits_{i=1}^n y_i^2}\tag{5}$$ Therefore, by proof by cases, we can conclude that $$(2)$$ is true.

My question is how to do an analogous proof for $$(1)$$, the Cauchy-Schwarz inequality, and how to interpret it.

Here is my attempt.

$$\left ( \int_a^b fg \right )^2 \leq \left ( \int_a^b f^2 \right ) \left ( \int_a^b g^2 \right )$$

Proof

Whereas previously we were dealing with the notion of a vector, now we are dealing with the notion of a function.

Consider the function $$(f-\lambda g)^2 \geq 0$$ and the integral

$$\int_a^b (f-\lambda g)^2\tag{6}$$

We know that $$(6)$$ is $$\geq 0$$, so there are two possible cases.

Case 1: $$\int_a^b (f-\lambda g)^2>0$$

$$\int_a^b (f^2-2\lambda fg+\lambda^2g^2)\geq 0$$

$$=\lambda^2 \int_a^b g^2-2\lambda \int_a^b fg +\int_a^b f^2 \geq 0\tag{6}$$

$$\Delta = 4\left (\int_a^b fg \right)^2-4\int_a^b g^2 \int_a^b f^2 < 0$$

$$\implies \left (\int_a^b fg \right)^2 < \int_a^b f^2 \int_a^b g^2$$

Case 2: $$\int_a^b (f-\lambda g)^2=0$$

$$\lambda^2 \int_a^b g^2-2\lambda \int_a^b fg +\int_a^b f^2 =0\tag{7}$$

$$\Delta = 0$$

$$\implies \left (\int_a^b fg \right)^2 = \int_a^b f^2 \int_a^b g^2$$

Therefore, in all possible cases we have $$\left ( \int_a^b fg \right )^2 \leq \left ( \int_a^b f^2 \right ) \left ( \int_a^b g^2 \right )$$, which is what we wanted to prove.

In the case of vectors, we could think of linear independence. But in the case of these functions, I am not sure if that concept translates perfectly.

$$f$$ doesn't have to be a multiple of $$g$$ at every point in $$[a,b]$$ for the integral $$(6)$$ to be zero. In fact $$f$$ and $$g$$ could differ at finitely many points, or even infinitely many points.

Note that in case 2, we can solve for $$\lambda$$.

$$\lambda=\frac{\int_a^b fg}{\int_a^b g^2}$$

What does this mean? It means that the function $$f-\lambda g$$ is such that the integral $$(6)$$ equals zero. This doesn't necessarily mean that $$f$$ is a multiple of $$g$$ at every point in $$[a,b]$$.

For example, we could have

You're absolutely right, and this is why on the space of Riemann-integrable functions, $$f\mapsto \sqrt{\int_a^bf^2}$$ is not a norm; it's only a semi-norm (equivalently, $$(f,g)\mapsto \langle f,g\rangle_2:=\int_a^bfg$$ is not an inner product; it fails positive-definiteness). However, if you quotient out by an appropriate subspace, then you do indeed get a norm (resp. inner product), and this is precisely what one does in the Lebesgue theory in defining the $$L^p$$ spaces (in particular $$L^2$$).
More precisely, let $$\mathcal{R}_{ab}$$ denote the set of Riemann-integrable functions on the interval $$[a,b]$$, and let $$\mathcal{N}$$ be the set of $$f\in\mathcal{R}_{ab}$$ such that $$\int_a^bf^2=0$$. You can verify that $$\mathcal{N}$$ is a vector subspace of $$\mathcal{R}_{ab}$$. One can phrase the Cauchy-Schwarz equality condition as $$\left(\int_a^bfg\right)^2=\left(\int_a^b f^2\right)\left(\int_a^b g^2\right)$$ if and only if there is some $$\lambda\in\Bbb{R}$$ such that $$\int_a^b(f-\lambda g)^2=0$$ or $$\int_a^b(\lambda f-g)^2=0$$, i.e if and only if $$\lambda f-g\in \mathcal{N}$$ or $$f-\lambda g\in\mathcal{N}$$. In other words, equality holds in Cauchy-Schwarz if and only if the equivalence classes $$[f],[g]$$ are linearly dependent in the quotient space $$\mathcal{R}_{ab}/\mathcal{N}$$.
This quotient space approach rigorously describes in what sense we should understand the linear dependence. However, if you're not comfortable with quotient vector spaces, you can for now roughly think of equality in Cauchy-Schwarz as being equivalent to '$$f$$ and $$g$$ are almost linearly dependent functions'. Alternatively, you could just restrict yourself to look at continuous functions; in this case such pathologies do not arise: $$\int_a^bf^2=0$$ implies $$f=0$$ on $$[a,b]$$ (your type of counterexample with a single point messing things up will no longer work here).