Section 9.2 gave two operations,
adding points and scaling them, and both produce points.
Nothing so far measures anything: there is no length, no
distance and no right angle. This section introduces one
more operation, which takes two points and returns a
number, and proves the rules it obeys.
Length, distance and angle are built from it in the rest
of the chapter.
A product
that is a number
Start with the plane. By Pythagoras, the point lies at
distance from the origin, and Chapter 3 gave this
number a name: it is the modulus of Definition 3.2.1.
Pythagoras is the motivation here, not a reason; nothing
below rests on a picture.
Look at the expression under the root. It is a sum of
products of coordinates. Each coordinate is multiplied
by itself: Take this apart for two points: keep the first
factor of each product from and take the second
from another point . The result still
makes sense, in for every , and it is a real
number, not a point. The squared length is the special
case .
For instance, take and . The mixed sum is . With it is , the square of the distance of from the
origin.
Multiply coordinate by coordinate, then
add.
Definition
9.3.1 (Dot Product)
Let . The
dot product of and
in is the real number
In words: pair the coordinates place by place,
multiply each pair in , and add the products. The two
inputs must lie in the same ; for and the dot
product is not defined. You may also see the notation
. This
book always writes , with two
slots and a comma, so that the product of two points is
never confused with the scalar multiple of Section 9.2. The
sum is the finite sum of Sets and Functions, Definition 3.3.1.
The definition needs no further check, since the
coordinates of
and are
determined by the points (Definition 9.1.1).
Examples.
In the plane. , and , the square of the modulus of
Chapter 3.
Signs. , and . The dot product can be zero
or negative even when neither point is .
On the line, . A sum with one term is that term (), so for the dot product is the ordinary
product: . This is why the definition deserves the
name product. On the line, the dot product of a
point with itself is ; in it is a sum of such
squares, by law (c) below.
Change one sign. On , try . It is still symmetric, and it still
respects sums and scalar multiples in each slot. So it
satisfies laws (a) and (b) of the next proposition. Law
(c) fails: , and although . So cannot be the square of
a length. The plus signs of the definition are what make
a sum
of squares.
A number, not a point. Two features
are deliberate. First, the output is a number. A product
returning a point, such as the coordinatewise product
, would not measure anything, and Section
9.2 already set products of points aside: in this
chapter has no meaning. Second, the dot product of a
point with itself is , the expression under Pythagoras’ root.
That is exactly what Section 9.4 needs to define
length.
The laws of
the dot product
Every law below reduces, term by term, to a law of
. The sum rules
of Lemma 1.1.3
then collect the terms. For the order facts we use the
comparison rules for sums of Chapter 1 (Proposition 1.1.5).
Those rules are stated for sums indexed from , while ours run from
to . Sets and
Functions showed how to shift the index of a sum
(Sets and Functions, Definition 3.3.1,
with ). Here
the shift gives and because . So each rule holds for sums from to as well, and we apply
it in that form without repeating the shift.
First a small case. Take and in . Then
and : the order does not matter. Doubling doubles the result,
since . And
is a sum of squares, so it is not negative. The
proposition says that these laws hold for all points of
every .
Proposition
9.3.1 (Laws of the Dot Product)
Let , let
and , and
let
be the standard vectors (Definition 9.2.2).
- (a)
(Symmetry.) .
- (b) (Linearity
in each slot.) and ; and likewise in the second slot,
and .
- (c)
(Positivity.) , and
if and only if .
- (d) (Standard
vectors.) for
every , and if
, if
.
- (e) (Zero.)
.
Idea. We work coordinatewise, as in
Example (Method: work coordinatewise),
but now inside a sum. Write out each side as a sum over
. Apply the law of
to the -th term. Then let the
sum rules collect the terms. Part (c) is the one law
with content: a sum of squares in is , and it is only when every square
is .
Proof. Throughout, , and the coordinates of and are and .
(a) Each term
satisfies , because multiplication in is commutative, (F6).
So the two sums have the same terms and are
equal.
(b) For sums, the
distributive law, (F9), together with commutativity
gives for each . A sum of sums splits
into two sums, so For scalars, because multiplication
is associative, (F5). A constant factor comes out of a
finite sum, so . The second-slot rules
follow from the first-slot rules and (a): , and in the same way .
(c) The zero
vector is the scalar times the zero vector:
(Proposition 9.2.1
(i)). So (b) gives , since a
product with a factor is in . And by (a). We prove (e) before (c),
which uses it.
(d) Here with is , which
gives the formula. Each term is . If , then , since the
square of a non-zero number is positive. If , then . A sum of
non-negative terms is non-negative, the empty sum being
. So .
If
, then by (e).
Suppose . This is a sum of non-negative terms equal to
, so every term is
(Proposition 1.1.5
(e)):
for each . Then
, since only
has square . Every coordinate of
is , so by equality of
tuples.
- (d) Fix . The -th coordinate of is if and otherwise (Definition 9.2.2).
So the terms of are for and for . A sum with one non-zero term is that term
(Lemma 1.1.3
(d)), so . Taking gives , which is if and otherwise. This proves
the proposition.
Part (d) says that the dot product with reads
off the -th coordinate; we use
it whenever a coordinate has to be recovered from dot
products. Part (c) is what will make length meaningful
in Section 9.4: has a square
root, and only the zero vector has length .
One consequence of (a) and (b) is used constantly
from the next section on: a dot product of sums can be
multiplied out like a product of numbers. For , The first line is linearity in the first slot,
the second is linearity in the second slot, and the
third is symmetry, , with in . Replacing by changes the
middle term only. By (b), and . So These two expansions are the dot-product form
of (Number Systems: From to , Proposition 2.3.2
(d)), and the middle term is the one
that matters.
Orthogonal
vectors
Take the triangle with sides , and . The expansion
above says when the plane’s Pythagorean relation holds
for it. The dot product of with itself is exactly when
.
Since in
, that happens
exactly when .
In the plane we see the same thing. The points and look
perpendicular, since the second is the first turned a
quarter turn about the origin. Their dot product is
. So “dot
product zero” does the job of a right angle. It makes
sense in every , where there is no
picture to consult.
Two vectors are orthogonal when their dot product
is zero.
Definition
9.3.2 (Orthogonal Vectors)
Let .
Vectors are orthogonal, written
, if .
In words: one number, the dot product, must vanish.
The relation is symmetric, if and only if , by Proposition 9.3.1
(a), so “ and
are orthogonal”
is unambiguous. “Perpendicular” means the same. This
book says “orthogonal”, the word used in linear
algebra.
Examples.
Standard vectors. whenever
, by Proposition 9.3.1
(d).
In . , since . The third coordinate of the second vector
is irrelevant because the first vector’s third
coordinate is .
The zero vector. for
every , by Proposition 9.3.1
(e). This matters: the zero vector is orthogonal to
everything, including itself, so “orthogonal” does not
mean “pointing in different directions”. And is the
only vector orthogonal to itself: means , which
forces by Proposition 9.3.1
(c).
Moving one coordinate. Change to . Then , so and are not orthogonal. The one condition fails:
the dot product is .
One equation, linear in each vector.
We could have defined a right angle by a picture, or by
the Pythagorean relation itself. The dot product is
better: it is one equation, linear in each vector, so
orthogonality to a fixed is the solution set of
,
an equation in the coordinates of . Chapter 10 builds its
hyperplanes from equations of exactly this form.
Orthogonality also gives a way to prove that two
vectors are equal. A vector orthogonal
to everything is zero, and two vectors with the same dot
products are the same vector.
Proposition
9.3.2 (The Orthogonality Test)
Let and
.
- (a) If for
every , then .
- (b) The following
are equivalent: (i) ; (ii) for every ; (iii) for every .
Proof.
(a) The
hypothesis holds for every , in particular for
. So , and
by Proposition 9.3.1
(c).
- (b)
- (i) (ii): equal
vectors have equal dot products with every . (ii) (iii): take
. (iii)
(i): by
Proposition 9.3.1
(d), (iii) says for every . Tuples that agree in
every place are equal (Definition 9.1.1).
The hypothesis of (a) is a “for every ” statement, and the
proof uses it once, at the one vector that settles the
question.
Example
(Dot products and orthogonality computed)
- (a) Compute . (b) Show that in . (c) Find all with . (d) In
, when is
?
Solution.
(a) .
(b) , so the
two vectors are orthogonal. Neither is , and no coordinate of
either is :
orthogonality comes from cancellation between terms, not
from zero entries.
(c) means
. We
show that the solutions are exactly the vectors with . If , then , so ; take . by Proposition 9.3.1
(b). So the vectors orthogonal to are the multiples
of , and
only those.
(d) By Proposition 9.3.1
(d), . So if and only if : the vectors
orthogonal to
are those of the form .
In part (c) the vectors orthogonal to the non-zero
vector are
the multiples of one vector. In , the solutions of
one equation with are what Chapter 10 calls a hyperplane.
Warning. The dot product does not
obey every law of multiplication in . There is no
cancellation: , yet .
There is no associativity: and are both
defined, but for and the first is and the second is . And
does not force a zero factor: and are both non-zero.
What does hold is Proposition 9.3.2:
cancellation is allowed when the equation holds for
every .
Quick check. Is ? What is for ?
Solution. Yes: . And , a sum of squares, as Proposition 9.3.1
(c) says it must be.
Exercises
A. Check your
understanding
Exercise
(A1)
- (a) Compute .
- (b) True or false
for all , with a reason: .
- (c) True or false
for all , with a reason: if , then
.
- (d) True or false
for all , with a reason: if , then
or .
Solution.
(a) .
(b) False. By Proposition 9.3.1
(b) in each slot, . For the left side
is and .
(c) True: this is
the “only if” half of Proposition 9.3.1
(c).
(d) False when
: , and
neither vector is . (For the statement is
true, since and
has no zero divisors.)
B. Practice
Exercise
(B1: Orthogonal to two vectors)
Find all that are orthogonal to both and .
Solution. The conditions are and . We show
that the solutions are exactly the vectors , .
If
both hold, put . Then and , so .
By
Proposition 9.3.1
(b), and .
Hence the vectors orthogonal to both are the
multiples of .
Exercise
(B2: The difference of squares)
Prove that for all
,
naming the law used at each step. Deduce that if and only if .
Solution. Write . In
, . So linearity
in the first slot gives In ,
by the distributive law. So linearity in
the second slot turns this into By symmetry, , so the two middle terms cancel in
, leaving .
For the deduction: means
(Definition 9.3.2),
which by the identity means , that is, . Each step is an equivalence, so
both directions hold.
In the plane this says that the diagonals and of the
parallelogram on
and are
orthogonal exactly when the two sides have equal
“squared length”.
Exercise
(B3: Solving one linear equation)
Let
with , and
let . Show
that satisfies , and
that it is the only solution of that is
parallel to .
Solution. The division is
allowed. Since , by Proposition 9.3.1
(c), and , so .
Existence. By linearity in the second slot,
. Also
is parallel to
by Definition 9.2.3,
since with
.
Uniqueness among vectors parallel to . Let be parallel to with . Since
, for some , as Section 9.2
showed for vectors parallel to a non-zero vector (Definition 9.2.3).
Then , so and .
For
there are other solutions, not parallel to . Choose with and , and let . Then by Proposition 9.3.1
(b), (d), and because its -th coordinate is . So . If were parallel to , it would equal by uniqueness, giving
. For example,
with and
: , and is another
solution.
C. Going deeper
Exercise
(C1: Find the error)
Here is an argument.
Claim. Let . If for
every ,
then .
Proof. Take . Then .
Hence .
Is the claim true? Does the argument prove it? If
not, name the line that fails and what is wrong with it,
and repair the argument.
Solution. The conclusion is
true: it is Proposition 9.3.2
(a).
The argument does not prove it. The first
two lines are correct: is an allowed instance of the hypothesis,
and by Proposition 9.3.1
(d). The failing line is “Hence ”. To show we must show for
every , and the argument
checks one coordinate and concludes for all of them.
This is the error of checking some instances and
concluding “for all”, (N1) in the list of Logic and
Proof (Logic and Proof, Example (What is not allowed)).
A counterexample to the step (not to the
claim, which is true): in , the vector has
, yet . So “, hence ” leads from a true
line to a false one.
Repair. Either take : then , and
by Proposition 9.3.1
(c). Or take for each ,
which gives
for every , and
conclude by equality of tuples.
For the
step happens to be valid, since is the only
coordinate; the argument is wrong because it is written
for every .