9.5  Cauchy–Schwarz and the Triangle Inequality

Section 9.4 gave Rn a length and a distance and proved every basic property of the distance except one: that a detour through a third point is never shorter than the direct route. This section proves it. Everything rests on one inequality between the dot product and the lengths, the Cauchy–Schwarz inequality. The method that proves it is called normalizing: shrink or stretch both vectors to length 1, prove the inequality there, and scale back.

9.5.1. Two earlier proofs, and why neither transfers

The triangle inequality has been proved before in this series in two settings, for real numbers and for complex numbers. Each proof used a tool that Rn lacks.

In R. Number Systems: From N to R, Section 4.1, trapped each number between ± its absolute value, −|x|≤x≤|x|, and added the two traps. That is how it proved the triangle inequality for absolute values, Number Systems: From N to R, Proposition 4.1.3 (c)–(e). The trap compares x with the number |x|. For a vector x∈Rn with n≥2, “x≤‖x‖” compares a vector with a number, and Rn has been given no order at all.

In C=R2. Section 3.3 expanded |z+w|2 and met the cross term 2Re(zw―), which it bounded by |zw―|=|z||w| (Theorem 3.3.2). By Proposition 9.4.3, Re(zw―)=⟨z,w⟩ and |z|=‖z‖, so the key step was ⟨z,w⟩≤‖z‖‖w‖, proved with the multiplication of C: the product zw― and the rule |zw―|=|z||w|. For n≥3 this book defines no such multiplication on Rn.

The expansion itself does survive. Section 9.4 compared lengths by comparing their squares (Example (Method: expand the square)). Expanding both squares by Eq. 9.4.1 gives ‖x+y‖2=‖x‖2+2⟨x,y⟩+‖y‖2,(‖x‖+‖y‖)2=‖x‖2+2‖x‖‖y‖+‖y‖2. Everything matches except the cross terms. So the triangle inequality in Rn rests on one inequality, ⟨x,y⟩≤‖x‖‖y‖, and that inequality now needs a proof that uses only the laws of the dot product.

An attempt that stalls. Work coordinatewise: xkyk≤|xk||yk| for each k, and |xk|≤‖x‖, |yk|≤‖y‖ by Proposition 9.4.7 (a). Adding the n bounds gives ⟨x,y⟩≤∑k=1n|xk||yk|≤n‖x‖‖y‖, which is off by the factor n. Try x=y=(1,…,1): then ⟨x,y⟩=n and ‖x‖‖y‖=n, so the inequality we want holds with equality, while the attempt only gives n≤n2. Each bound |xk|≤‖x‖ is sharp only when all of x sits in coordinate k. For x≠0 and n≥2, the n bounds cannot all be sharp at once. A coordinate-by-coordinate bound loses the geometry. The proof below uses the length of a whole vector instead.

9.5.2. The Cauchy–Schwarz inequality

Start with two vectors of R2, x=(3,4) and y=(4,3). Their dot product is ⟨x,y⟩=12+12=24, and both have length 5, so ‖x‖‖y‖=25. The dot product is a little smaller than the product of the lengths. Now take y=2x=(6,8) instead. Then ⟨x,y⟩=18+32=50 and ‖x‖‖y‖=5⋅10=50: the two are equal. The theorem says that the dot product never exceeds the product of the lengths, and that equality up to sign happens exactly for parallel vectors.

Equality can hold with either sign, and the sign tells which way y points along x.

Theorem 9.5.1 (Cauchy–Schwarz Inequality)

Let n≥1 and x,y∈Rn.

  • (a) |⟨x,y⟩|≤‖x‖‖y‖.

  • (b) |⟨x,y⟩|=‖x‖‖y‖ if and only if x and y are parallel.

  • (c) ⟨x,y⟩=‖x‖‖y‖ if and only if x=0 or y=cx for some real c≥0.

(c′) ⟨x,y⟩=−‖x‖‖y‖ if and only if x=0 or y=cx for some real c≤0.

Try it first (ten minutes): for unit vectors u,v, expand ‖u−v‖2≥0. What does it say about ⟨u,v⟩? What else could you expand?

Idea (Scratch work). The attempt gives 0≤‖u−v‖2=1−2⟨u,v⟩+1, so ⟨u,v⟩≤1. That is one half of the goal for unit vectors, and nothing yet about general x,y. For general vectors the same expansion gives only 2⟨x,y⟩≤‖x‖2+‖y‖2. Its right side equals 2‖x‖‖y‖ only when ‖x‖=‖y‖. So we make the lengths equal, to 1, and pay for it by scaling back.

We know We want
x,y∈Rn |⟨x,y⟩|≤‖x‖‖y‖
x,y≠0 (if one is 0, both sides are 0); u:=x/‖x‖, v:=y/‖y‖ are unit vectors |⟨u,v⟩|≤1, because both sides of the old goal are ‖x‖‖y‖ times those of the new one
‖u−v‖2=2−2⟨u,v⟩≥0 −1≤⟨u,v⟩≤1; the upper half is done
‖u+v‖2=2+2⟨u,v⟩≥0 the lower half is done: the gap closes

The passage to unit vectors is allowed because the statement is homogeneous: replacing x by ax with a>0 multiplies both sides by a, and likewise for y. For the equality cases, ask when ‖u−v‖2 or ‖u+v‖2 is 0.

Before reading on: where is x≠0 used, and why are both expansions needed?

Proof. Let x,y∈Rn.

  • (a) If x=0 or y=0, then ⟨x,y⟩=0, because a dot product with the zero vector is 0. Also ‖x‖‖y‖=0, since ‖0‖=0. So (a) reads 0≤0.

Let x≠0 and y≠0. Then ‖x‖>0 and ‖y‖>0, because only the zero vector has length 0 (Proposition 9.4.1 (a)). So u:=(1/‖x‖)x and v:=(1/‖y‖)y are unit vectors, and x=‖x‖u, y=‖y‖v. Pulling the two scalars out of the dot product gives

⟨x,y⟩=‖x‖‖y‖⟨u,v⟩.
(9.5.1)

Expanding by Eq. 9.4.1, with ‖u‖2=‖v‖2=1, 0≤‖u−v‖2=‖u‖2−2⟨u,v⟩+‖v‖2=2−2⟨u,v⟩,0≤‖u+v‖2=2+2⟨u,v⟩. Add 2⟨u,v⟩ to the first line and −2 to the second, and multiply both by 12>0. This gives −1≤⟨u,v⟩≤1, that is, |⟨u,v⟩|≤1. Now multiply by ‖x‖‖y‖>0. By Eq. 9.5.1 and the rule |ab|=|a||b|, |⟨x,y⟩|=‖x‖‖y‖|⟨u,v⟩|≤‖x‖‖y‖.

  • (c) (⇐) If x=0, both sides are 0. If y=cx with c≥0, then ⟨x,y⟩=c⟨x,x⟩=c‖x‖2. Also ‖x‖‖cx‖=|c|‖x‖2=c‖x‖2, because c≥0.

(⇒) If x=0 we are done, and if y=0, then y=0x with c=0. Otherwise x,y≠0. With u,v as in (a), Eq. 9.5.1 gives ‖x‖‖y‖⟨u,v⟩=‖x‖‖y‖. Cancelling the non-zero factor ‖x‖‖y‖ gives ⟨u,v⟩=1. Then ‖u−v‖2=2−2=0, so ‖u−v‖=0, and u=v because only the zero vector has length 0. Hence y=‖y‖u=cx with c:=‖y‖/‖x‖>0.

(c′) Replacing y by −y changes the sign of the dot product but not the length: ⟨x,−y⟩=−⟨x,y⟩ and ‖−y‖=‖y‖. So ⟨x,y⟩=−‖x‖‖y‖ holds if and only if ⟨x,−y⟩=‖x‖‖−y‖. By (c) applied to x and −y, this holds if and only if x=0 or −y=cx with c≥0. That is, y=(−c)x with −c≤0.

  • (b) Since ‖x‖‖y‖≥0, the definition of the absolute value gives |⟨x,y⟩|=‖x‖‖y‖ if and only if ⟨x,y⟩=±‖x‖‖y‖. By (c) and (c′) this holds if and only if x=0 or y=cx for some real c. That is exactly the statement that x and y are parallel. Indeed, 0 is parallel to every vector, and for x≠0, y is parallel to x if and only if y=cx for some c. Section 9.2 noted this right after defining parallel vectors (Definition 9.2.3). This proves the theorem.

Uses: Proposition 9.3.1 (a), (b), (e) (symmetry, scalars, zero vector); Proposition 9.4.1 (a)–(c) (length zero, scaling, squares); Definition 9.4.2; Proposition 9.2.1 (e), (f), (i) (scalar rules, signs); Number Systems: From N to R, Proposition 2.4.3 (b), (c), (e) (adding, multiplying, squares); Number Systems: From N to R, Proposition 4.1.3 (b), (d) (products, two-sided bounds); Number Systems: From N to R, Definition 4.1.1.

For n=1 the theorem says little: |xy|=|x||y| always, and any two reals are parallel. The content is in n≥2, where most pairs of vectors are not parallel and the inequality is strict for them.

Quick check. For x=(1,2,2) and y=(2,0,1), compute both sides of (a). Is the inequality strict, and does (b) predict the answer?

Solution. ⟨x,y⟩=2+0+2=4, ‖x‖=3 and ‖y‖=5. Since 42=16<45=(35)2 and both numbers are non-negative, 4<35: strict. Yes: y=cx would need c=2 from the first coordinate and c=0 from the second. And x=cy is impossible since y2=0≠2=x2. So x, y are not parallel and (b) forbids equality.

Squaring (a) gives the form used for sums of real numbers. For example, with (1,2,3) and (4,5,6) the sum of products is 4+10+18=32, and the sums of squares are 14 and 77. The squared form reads 322=1024≤14⋅77=1078.

Corollary 9.5.2 (Cauchy–Schwarz Inequality for Sums)

Let n≥1 and x1,…,xn,y1,…,yn∈R. Then (∑k=1nxkyk)2≤(∑k=1nxk2)(∑k=1nyk2), with equality if and only if (x1,…,xn) and (y1,…,yn) are parallel vectors of Rn.

Proof. Let x:=(x1,…,xn) and y:=(y1,…,yn). The three sums are ⟨x,y⟩, ‖x‖2 and ‖y‖2. By Theorem 9.5.1 (a), 0≤|⟨x,y⟩|≤‖x‖‖y‖. Squaring keeps an inequality between non-negative numbers, so |⟨x,y⟩|2≤‖x‖2‖y‖2. And |⟨x,y⟩|2=⟨x,y⟩2. Two non-negative reals with equal squares are equal (comparing squares, Section 9.4). So equality holds exactly when |⟨x,y⟩|=‖x‖‖y‖, that is, by Theorem 9.5.1 (b), when x and y are parallel.

In the example above the inequality is strict, because the two triples are not parallel. Exercise C2 below proves it a second way, from Lagrange’s identity. For n=2 that identity reads (ac+bd)2+(ad−bc)2=(a2+b2)(c2+d2). Chapter 3 mentioned this case as a second route in the solution of its chapter check, Exercise C1 of Section 3.3 (Exercise (C1: Exit check: the triangle inequality)).

9.5.3. The method: normalize

The proof of Theorem 9.5.1 did its work for unit vectors and then scaled back. This way of proving is called normalizing.

Example (Method: normalize)

How it goes. Suppose a statement about x and y is homogeneous: replacing x by ax with a>0 multiplies both sides by the same positive factor, and likewise for y. Then:

  1. Settle x=0 and y=0 separately.
  2. For x,y≠0, put u:=x/‖x‖ and v:=y/‖y‖, and prove the statement for the unit vectors u, v.
  3. Scale back, multiplying by the positive factor.

When to use it. Inequalities between ⟨x,y⟩ and products of lengths; statements about directions rather than sizes.

Common mistakes. Normalizing the zero vector is impossible: it has no direction, and x/‖x‖ would divide by 0. Scaling by a negative factor breaks the method, since x↦−x changes the sign of ⟨x,y⟩ but not of ‖x‖‖y‖. A statement that is not homogeneous cannot be normalized. For example, ‖u+v‖≤2 holds for all unit u,v. By Cauchy–Schwarz, ‖u+v‖2=2+2⟨u,v⟩≤2+2‖u‖‖v‖=4, and comparing squares of non-negative numbers gives ‖u+v‖≤2. And yet ‖x+y‖≤2 fails for x=y=2e1, where ‖x+y‖=4.

The proof of Theorem 9.5.1 is the first worked example. It settles the zero case, proves the bound for unit vectors by expanding ‖u∓v‖2, and scales back by multiplying by ‖x‖‖y‖. Part (b) below is a second.

Example (Two uses of Cauchy–Schwarz)
  • (a) Show that (a+b+c)2≤3(a2+b2+c2) for all real a,b,c, with equality if and only if a=b=c.

  • (b) Find the largest value of 2x1+3x2−x3 over all unit vectors x∈R3, and every unit vector where it is attained.

Solution.

  • (a) Apply Corollary 9.5.2 to (a,b,c) and w:=(1,1,1). The left side is (a+b+c)2 and the right side is (a2+b2+c2)⋅3. Equality holds if and only if (a,b,c) is parallel to w. Since w≠0, this means (a,b,c)=tw for some t, that is, a=b=c.

  • (b) Let p:=(2,3,−1), so the expression is ⟨p,x⟩ and ‖p‖=14. The statement ⟨p,x⟩≤14‖x‖ is homogeneous in x. So by normalizing it is enough to look at unit x, which is what the question does. For unit x, using t≤|t| and then Theorem 9.5.1 (a), ⟨p,x⟩≤|⟨p,x⟩|≤‖p‖‖x‖=14. The value 14 is attained at x0:=p/14, a unit vector, since ⟨p,x0⟩=14/14=14 (because 14⋅14=14). Conversely, suppose ⟨p,x⟩=14=‖p‖‖x‖. Since p≠0, Theorem 9.5.1 (c), with p in the first place, gives x=cp with c≥0. Then 1=‖x‖=c14, so c=1/14 and x=x0. The largest value is 14, attained only at (2,3,−1)/14. For x=0 both sides of ⟨p,x⟩≤14‖x‖ are 0. Scaling back the other x, 2x1+3x2−x3≤14‖x‖ for every x∈R3.

Uses: Definition 9.2.3 and the remark after it (parallel to w≠0); Number Systems: From N to R, Proposition 4.1.3 (c) (t≤|t|).

9.5.4. The triangle inequality

With the cross term under control, the expansion at the start of the section finishes the job. For instance, x=(3,4) and y=(4,3) give x+y=(7,7), and ‖x+y‖2=98<100=(‖x‖+‖y‖)2.

Theorem 9.5.3 (Triangle Inequality for Vectors)

Let x,y,z∈Rn.

  • (a) ‖x+y‖≤‖x‖+‖y‖, with equality if and only if x=0 or y=cx for some real c≥0.
  • (b) |‖x‖−‖y‖|≤‖x−y‖.
  • (c) d(x,z)≤d(x,y)+d(y,z).

Idea. As in Example (Method: expand the square): compare squares, expand, and bound the cross term 2⟨x,y⟩ by 2‖x‖‖y‖, now with Cauchy–Schwarz. Parts (b) and (c) are (a) applied to well-chosen vectors.

Before reading on: which equality case of Theorem 9.5.1 does the equality case of (a) use, and why not (b)?

Proof.

  • (a) Expand the square, then use ⟨x,y⟩≤|⟨x,y⟩| and Theorem 9.5.1 (a), adding the inequalities: ‖x+y‖2=‖x‖2+2⟨x,y⟩+‖y‖2≤‖x‖2+2|⟨x,y⟩|+‖y‖2≤‖x‖2+2‖x‖‖y‖+‖y‖2=(‖x‖+‖y‖)2. Both ‖x+y‖ and ‖x‖+‖y‖ are non-negative, so comparing squares (Section 9.4) gives ‖x+y‖≤‖x‖+‖y‖. For the same reason the two lengths are equal if and only if their squares are. Comparing the first and last expressions of the display, this means 2⟨x,y⟩=2‖x‖‖y‖. By Theorem 9.5.1 (c), this holds if and only if x=0 or y=cx with c≥0.

  • (b) The argument is the one Section 3.3 used for complex numbers (Corollary 3.3.3 (a)), with ‖⋅‖ in place of |⋅|. Apply (a) to x=(x−y)+y. This gives ‖x‖−‖y‖≤‖x−y‖. Exchanging x and y gives ‖y‖−‖x‖≤‖y−x‖. Also ‖y−x‖=‖x−y‖, since y−x=(−1)(x−y). The two bounds together say −‖x−y‖≤‖x‖−‖y‖≤‖x−y‖, which is (b).

  • (c) By Proposition 9.2.1, x−z=(x−y)+(y−z). So by (a) and the definition of distance, d(x,z)=‖(x−y)+(y−z)‖≤‖x−y‖+‖y−z‖=d(x,y)+d(y,z). This proves the theorem.

Uses: Eq. 9.4.1; Number Systems: From N to R, Proposition 4.1.3 (c), (d) (t≤|t|, two-sided bounds); Number Systems: From N to R, Proposition 2.4.3 (b) (adding inequalities); Proposition 9.4.1 (b) with c=−1; Definition 9.4.3.

The equality case of (a) uses Theorem 9.5.1 (c), not (b). The first inequality of the display is an equality only when ⟨x,y⟩≥0. So a negative ⟨x,y⟩ with |⟨x,y⟩|=‖x‖‖y‖ still leaves a gap.

Warning. “Equality in Cauchy–Schwarz holds for parallel vectors, and the triangle inequality comes from Cauchy–Schwarz, so parallel vectors give ‖x+y‖=‖x‖+‖y‖.” The conclusion is false. For x=e1 and y=−e1, which are parallel, ‖x+y‖=0 and ‖x‖+‖y‖=2. The argument forgets the step ⟨x,y⟩≤|⟨x,y⟩|, which is strict whenever ⟨x,y⟩<0.

For n=2, (a) is the triangle inequality of Section 3.3 (Theorem 3.3.2), now proved by a route with no complex multiplication. The translation between the two is Proposition 9.4.3 (c). Chapter 3 found its equality case in a different form: zw― is a non-negative real (Exercise (B1: The equality case)). Section 9.6 returns to the comparison in a review exercise.

Quick check. Let x=(1,−2,3) and y=−2x. Is |⟨x,y⟩|=‖x‖‖y‖? Is ‖x+y‖=‖x‖+‖y‖?

Solution. ⟨x,y⟩=−2⋅14=−28 and ‖x‖‖y‖=14⋅214=28: yes, as (b) of Theorem 9.5.1 predicts for parallel vectors. But x+y=−x, so ‖x+y‖=14, while ‖x‖+‖y‖=314: no, since y=cx with c=−2<0.

9.5.5. Sums of many vectors

Adding one vector at a time extends (a) to any finite number of terms. For instance, in R3, e1+e2+e3=(1,1,1) has length 3, while the three lengths add up to 3, and 3≤3 because 3≤9.

Corollary 9.5.4 (Triangle Inequality for Finite Sums)

For every m∈N and all v1,…,vm∈Rn, ‖∑j=1mvj‖≤∑j=1m‖vj‖.

Proof. We use induction on m≥0. The sums are defined by recursion, as in Lemma 9.2.2. For m=0 both sides are 0. Suppose the inequality holds for m. Split off the last term by the recursion, apply Theorem 9.5.3 (a), and then add ‖vm+1‖ to both sides of the inequality for m: ‖∑j=1m+1vj‖≤‖∑j=1mvj‖+‖vm+1‖≤∑j=1m+1‖vj‖.

Length and the sum of the absolute values of the coordinates are comparable, with constants 1 and n. For x=(3,4), the length is 5 and the sum is 7. Indeed 5≤7, and 7≤2⋅5 because 49≤50.

Corollary 9.5.5 (Length against the Sum of the Coordinates)

For every x∈Rn, ‖x‖≤∑k=1n|xk|≤n‖x‖.

Proof. By Proposition 9.2.3, x=∑kxkek. So Corollary 9.5.4 gives ‖x‖≤∑k‖xkek‖=∑k|xk|, since ‖xkek‖=|xk|. For the second inequality let a:=(|x1|,…,|xn|) and w:=(1,…,1). Then ⟨a,w⟩=∑k|xk| and ‖w‖=n. Also ‖a‖=‖x‖: both are non-negative with the same square ∑kxk2, and a non-negative square root is unique (Number Systems: From N to R, Proposition 6.1.4). Using t≤|t| and then Theorem 9.5.1 (a), ∑k|xk|≤|⟨a,w⟩|≤‖a‖‖w‖=n‖x‖.

Uses: Proposition 9.4.1 (b), (e) (‖xkek‖=|xk|); Number Systems: From N to R, Proposition 4.1.3 (b), (c) (|t|2=t2, t≤|t|).

For n=2 the first inequality is the last one of Lemma 3.3.1. Both are sharp: x=e1 gives equality on the left, and x=(1,…,1) on the right.

9.5.6. Exercises

A. Check your understanding

Exercise (A1)

These questions are about the proof of Theorem 9.5.1.

  • (a) Where is x≠0 used?
  • (b) Which expansion gives which half of −1≤⟨u,v⟩≤1?
  • (c) Run the proof on x=(3,4), y=(4,3): compute u, v, ⟨u,v⟩ and ‖u−v‖2.
  • (d) In the scratch work, what goes wrong with the expansion of ‖u−v‖2 if u is not a unit vector?
  • (e) Give the idea of the proof in two sentences.

Solution.

  • (a) To form u=x/‖x‖, which needs ‖x‖≠0, that is, x≠0 (Proposition 9.4.1 (a)). The zero case is settled separately.

  • (b) ‖u−v‖2=2−2⟨u,v⟩≥0 gives ⟨u,v⟩≤1; ‖u+v‖2=2+2⟨u,v⟩≥0 gives ⟨u,v⟩≥−1.

  • (c) ‖x‖=‖y‖=5, u=(35,45), v=(45,35), ⟨u,v⟩=2425, and ‖u−v‖2=125+125=225=2−4825. Scaling back, ⟨x,y⟩=25⋅2425=24≤25.

  • (d) The expansion becomes ‖u−v‖2=‖u‖2−2⟨u,v⟩+‖v‖2, not 2−2⟨u,v⟩. It only gives ⟨u,v⟩≤12(‖u‖2+‖v‖2), which exceeds ‖u‖‖v‖ unless ‖u‖=‖v‖, since 12(a2+b2)−ab=12(a−b)2>0 for real a≠b.

  • (e) The inequality is homogeneous, so after disposing of zero vectors it is enough to prove |⟨u,v⟩|≤1 for unit vectors. That follows from ‖u∓v‖2=2∓2⟨u,v⟩≥0.

B. Practice

Exercise (B1: Proof ordering)

The eight lines below are shuffled. Six of them, in a suitable order, prove Theorem 9.5.3 (b) from (a); the other two belong in no proof. Write an admissible order without rereading the proof above, and say why each of the two other lines fails.

  • (i) So ‖x‖−‖y‖≤‖x−y‖.

  • (ii) ‖−y‖=−‖y‖.

  • (iii) So −‖x−y‖≤‖x‖−‖y‖≤‖x−y‖, and Number Systems: From N to R, Proposition 4.1.3 (d) gives |‖x‖−‖y‖|≤‖x−y‖.

  • (iv) x=(x−y)+y.

  • (v) ‖y−x‖=‖x−y‖, by Proposition 9.4.1 (b) with c=−1.

  • (vi) The same with x and y exchanged: ‖y‖−‖x‖≤‖y−x‖.

  • (vii) ‖x−y‖≤‖x‖−‖y‖, by (a) applied to x and −y.

  • (viii) So ‖x‖≤‖x−y‖+‖y‖, by (a).

Solution. An admissible order is (iv), (viii), (i), (vi), (v), (iii). Line (iv) must precede (viii), and (viii) must precede (i). Line (i) must precede (vi), which repeats (iv), (viii), (i) with the letters exchanged. Line (v) may stand anywhere before (iii). Line (iii) comes last, since it uses (i), (vi) and (v).

Line (vii) fails: (a) applied to x and −y gives ‖x−y‖≤‖x‖+‖−y‖=‖x‖+‖y‖, with a plus sign. The claim itself is false: at y=−x≠0 it reads 2‖x‖≤0. Line (ii) is false for every y≠0: by Proposition 9.4.1 (b), ‖−y‖=|−1|‖y‖=‖y‖>0>−‖y‖.

Exercise (B2)

Prove that ‖x−y‖=‖x+y‖ if and only if x⊥y. You may start from the two expansions ‖x+y‖2=‖x‖2+2⟨x,y⟩+‖y‖2,‖x−y‖2=‖x‖2−2⟨x,y⟩+‖y‖2. Name the method, then use it.

Solution. The method is to expand the square (Example (Method: expand the square)). Both lengths are non-negative, so they are equal if and only if their squares are (comparing squares, Section 9.4). Subtracting the two expansions gives ‖x+y‖2−‖x−y‖2=4⟨x,y⟩, which is Proposition 9.4.6 (a) multiplied by 4. This is 0 if and only if ⟨x,y⟩=0. Indeed, if 4⟨x,y⟩=0, then 4=0 or ⟨x,y⟩=0 (Number Systems: From N to R, Lemma 4.1.1 (d)), and 4≠0 since 4>0 in the ordered field R. By the definition of orthogonal vectors, ⟨x,y⟩=0 holds if and only if x⊥y.

Exercise (B3: Prove or disprove)

For each statement about all x,y∈Rn (or all unit vectors u,v), prove it or give a counterexample.

  • (a) ⟨x,y⟩≤12(‖x‖2+‖y‖2).
  • (b) ‖x+y‖≥‖x‖.
  • (c) Unit vectors u,v with ⟨u,v⟩=1 are equal.
  • (d) Equality |⟨x,y⟩|=‖x‖‖y‖ holds only when x=y.
  • (e) ⟨x,y⟩≤12‖x‖‖y‖.

Solution.

  • (a) True. 0≤‖x−y‖2=‖x‖2−2⟨x,y⟩+‖y‖2; add 2⟨x,y⟩ and halve.

  • (b) False. For x=e1, y=−e1: ‖x+y‖=0<1=‖x‖.

  • (c) True. ‖u−v‖2=2−2⋅1=0, so u−v=0 by Proposition 9.4.1 (a).

  • (d) False. For x=e1, y=2e1: |⟨x,y⟩|=2=1⋅2, and x≠y.

  • (e) False. For x=y=e1 it reads 1≤12. The statement is homogeneous, so normalizing is legitimate here: it reduces the claim to “⟨u,v⟩≤12 for unit u,v”, which fails at u=v.

Exercise (B4)
  • (a) Prove that (∑k=1nxk)2≤n∑k=1nxk2 for real x1,…,xn, with equality if and only if all xk are equal.
  • (b) Find the smallest value of ‖x‖2 over all x∈R3 with x1+2x2+2x3=9, and every x where it is attained.

Solution.

  • (a) Apply Corollary 9.5.2 to x and w:=(1,…,1), with ∑k12=n. Equality holds if and only if x is parallel to w≠0, that is, x=tw for some t: all xk are equal.

  • (b) Let p:=(1,2,2), so ‖p‖=3 and the condition is ⟨p,x⟩=9. By Theorem 9.5.1 (a), 9=⟨p,x⟩≤|⟨p,x⟩|≤‖p‖‖x‖=3‖x‖. So ‖x‖≥3, and squaring gives ‖x‖2≥9. If ‖x‖2=9, then ‖x‖=3 and ⟨p,x⟩=9=‖p‖‖x‖. Since p≠0, Theorem 9.5.1 (c) gives x=cp with c≥0, and the condition gives 9c=9, so x=(1,2,2). This point satisfies the condition, 1+4+4=9, and ‖(1,2,2)‖2=9. The smallest value is 9, attained only at (1,2,2).

Uses: Definition 9.2.3 and the remark after it (parallel to w≠0); Number Systems: From N to R, Proposition 4.1.3 (c) (t≤|t|); Number Systems: From N to R, Proposition 4.1.2 (d) (squaring keeps ≤).

C. Going deeper

Exercise (C1: Chapter check: Cauchy–Schwarz)

Use only the definitions of the dot product and the length and the results of Sections 9.2–9.4. Prove that for all x,y∈Rn: (a) |⟨x,y⟩|≤‖x‖‖y‖; (b) equality holds if and only if x and y are parallel.

Solution (Hint 1). Dispose of the zero cases, then scale both vectors to length 1.

Solution (Hint 2). For unit u,v, expand ‖u−v‖2 and ‖u+v‖2.

Solution.

  • (a) If x=0 or y=0, both sides are 0. Otherwise ‖x‖,‖y‖>0. Let u:=x/‖x‖ and v:=y/‖y‖: these are unit vectors with ⟨x,y⟩=‖x‖‖y‖⟨u,v⟩. From 0≤‖u∓v‖2=2∓2⟨u,v⟩ we get −1≤⟨u,v⟩≤1, so |⟨u,v⟩|≤1. Multiplying by ‖x‖‖y‖>0 gives (a).

  • (b) If x=0 or y=0, the two vectors are parallel and both sides of (a) are 0. Let x,y≠0. If equality holds, then ⟨u,v⟩=±1, so ‖u∓v‖2=0. Hence v=±u and y=±(‖y‖/‖x‖)x: parallel. Conversely, if they are parallel, then y=cx for some c (remark after Definition 9.2.3), and |⟨x,cx⟩|=|c|‖x‖2=‖x‖‖cx‖.

What a complete answer needs. (10 points) - 1: settles x=0 or y=0. - 2: reduces the general case to one it can bound, saying why the reduction is legitimate; for unit vectors: the statement is homogeneous and the factor ‖x‖‖y‖ is positive. - 3: proves |⟨u,v⟩|≤1 for unit vectors, by any correct route. - 1: scales back to (a). - 3: proves the equality case in both directions, zero vectors included.

A proof through Lagrange’s identity (C2) scores on the same points. It gets 1 for the zero cases, which are automatic there. It gets 2 + 3 + 1 for proving the identity, reading off ⟨x,y⟩2≤‖x‖2‖y‖2 and taking roots. It gets 3 for “all xjyk−xkyj=0 if and only if parallel”.

A proof that normalizes nothing, expanding ‖x−t0y‖2≥0 with t0:=⟨x,y⟩/‖y‖2, also scores on the same points. It gets 1 for y=0, 2 for setting up t0 using y≠0, 3 for the inequality on squares, 1 for taking roots, and 3 for the equality case through ‖x−t0y‖=0.

Slips that lose the step: dividing by ‖x‖ without x≠0; proving only ⟨x,y⟩≤‖x‖‖y‖ and claiming the absolute value; omitting the converse of (b).

Exercise (C2: Lagrange’s identity)

Let x,y∈Rn. Prove that (∑k=1nxk2)(∑k=1nyk2)−(∑k=1nxkyk)2=12∑j=1n∑k=1n(xjyk−xkyj)2, and deduce Corollary 9.5.2 with its equality case: equality holds if and only if xjyk=xkyj for all j,k, if and only if x and y are parallel.

Solution (Hint 1). Expand the square inside the double sum and use the product form of Proposition 1.1.6 three times.

Solution (Hint 2). For “parallel”: if x=0 it is clear; otherwise pick m with xm≠0 and set c:=ym/xm.

Solution. Write A:=∑kxk2, B:=∑kyk2, C:=∑kxkyk. Expanding each term, (xjyk−xkyj)2=xj2yk2−2(xjyj)(xkyk)+xk2yj2. Sum over j and k, splitting termwise (Lemma 1.1.3 (a), (b)). By the product form of Proposition 1.1.6, ∑j∑kxj2yk2=AB, ∑j∑kxk2yj2=BA and ∑j∑k(xjyj)(xkyk)=C2. The double sum is 2AB−2C2, and halving proves the identity.

Each term (xjyk−xkyj)2 is a square, so it is ≥0. So each inner sum is ≥0, and then so is the double sum (Proposition 1.1.5 (b)). Hence C2≤AB, which is Corollary 9.5.2. Equality holds if and only if the double sum is 0. Apply Proposition 1.1.5 (e) to the outer sum and then to each inner sum. So equality holds if and only if every term is 0, that is, xjyk=xkyj for all j,k.

It remains to match this with “parallel”. If y=cx, each xjyk−xkyj=c(xjxk−xkxj)=0; if x=cy, likewise c(yjyk−ykyj)=0. Conversely, suppose all xjyk=xkyj. If x=0, x is parallel to y. Otherwise choose m with xm≠0 and let c:=ym/xm. For every k, xmyk=xkym gives yk=cxk, so y=cx.

For n=2 the terms with j=k vanish and the other two are both (x1y2−x2y1)2, so the identity is AB−C2=(x1y2−x2y1)2.

Uses: Number Systems: From N to R, Proposition 2.4.3 (e) (squares are non-negative).