< Return to Video

Proof of the Cauchy-Schwarz Inequality

  • 0:01 - 0:03
    Let's say that I have
    two nonzero vectors.
  • 0:05 - 0:07
    Let's say the first vector is
    x, the second vector is y.
  • 0:10 - 0:11
    They are both a part of our set.
  • 0:12 - 0:13
    They're both in the set Rn
    and they're nonzero.
  • 0:17 - 0:22
    It turns out that the absolute
    value of their-- let me do it
  • 0:22 - 0:25
    in a different color.
  • 0:25 - 0:27
    This color's nice.
  • 0:27 - 0:31
    The absolute value of their
    dot product of the two
  • 0:31 - 0:35
    vectors-- and remember, this is
    just a scalar quantity-- is
  • 0:35 - 0:41
    less than or equal to the
    product of their lengths.
  • 0:41 - 0:43
    And we've defined the dot
    product and we've defined
  • 0:43 - 0:44
    lengths already.
  • 0:44 - 0:47
    It's less than or equal to the
    product of their lengths and
  • 0:47 - 0:51
    just to push it even further,
    the only time that this is
  • 0:51 - 0:58
    equal, so the dot product of the
    two vectors is only going
  • 0:58 - 1:02
    to be equal to the lengths of
    this-- the equal and the less
  • 1:02 - 1:05
    than or equal apply only in the
    situation-- let me write
  • 1:05 - 1:11
    that down-- where one of these
    vectors is a scalar multiple
  • 1:11 - 1:12
    of the other.
  • 1:12 - 1:14
    Or they're collinear.
  • 1:14 - 1:16
    You know, one's just kind of the
    longer or shorter version
  • 1:16 - 1:18
    of the other one.
  • 1:18 - 1:22
    So only in the situation where
    let's just say x is equal to
  • 1:22 - 1:25
    some scalar multiple of y.
  • 1:28 - 1:31
    These inequalities or I guess
    the equality of this
  • 1:31 - 1:33
    inequality, this is called the
    Cauchy-Schwarz Inequality.
  • 1:33 - 1:43
    Cauchy-Shwarz Inequality
  • 1:43 - 1:46
    So let's prove it because you
    can't take something like this
  • 1:46 - 1:47
    just at face value.
  • 1:47 - 1:49
    You shouldn't just
    accept that.
  • 1:49 - 1:53
    So let me just construct a
    somewhat artificial function.
  • 1:53 - 1:58
    Let me construct some function
    of-- that's a function of some
  • 1:58 - 2:00
    variables, some scalar t.
  • 2:00 - 2:05
    Let me define p of t to be equal
    to the length of the
  • 2:05 - 2:12
    vector t times the vector-- some
    scalar t times the vector
  • 2:12 - 2:16
    y minus the vector x.
  • 2:16 - 2:17
    It's the length of
    this vector.
  • 2:17 - 2:19
    This is going to be
    a vector now.
  • 2:19 - 2:21
    That squared.
  • 2:21 - 2:23
    Now before I move forward
    I want to make one
  • 2:23 - 2:24
    little point here.
  • 2:24 - 2:30
    If I take the length of any
    vector, I'll do it here.
  • 2:30 - 2:33
    Let's say I take the length
    of some vector v.
  • 2:33 - 2:37
    I want you to accept that this
    is going to be a positive
  • 2:37 - 2:39
    number, or it's at least greater
    than or equal to 0.
  • 2:39 - 2:43
    Because this is just going to be
    each of its terms squared.
  • 2:43 - 2:45
    v2 squared all the way
    to vn squared.
  • 2:45 - 2:47
    All of these are real numbers.
  • 2:47 - 2:50
    When you square a real number,
    you get something greater than
  • 2:50 - 2:51
    or equal to 0.
  • 2:51 - 2:52
    When you sum them up, you're
    going to have something
  • 2:52 - 2:54
    greater than or equal to 0.
  • 2:54 - 2:56
    And you take the square root
    of it, the principal square
  • 2:56 - 2:57
    root, the positive square root,
    you're going to have
  • 2:57 - 2:59
    something greater than
    or equal to 0.
  • 2:59 - 3:03
    So the length of any real vector
    is going to be greater
  • 3:03 - 3:04
    than or equal to 0.
  • 3:04 - 3:07
    So this is the length
    of a real vector.
  • 3:07 - 3:11
    So this is going to be greater
    than or equal to 0.
  • 3:11 - 3:14
    Now, in the previous video, I
    think it was two videos ago, I
  • 3:14 - 3:19
    also showed that the magnitude
    or the length of a vector
  • 3:19 - 3:23
    squared can also be rewritten
    as the dot product of that
  • 3:23 - 3:25
    vector with itself.
  • 3:25 - 3:27
    So let's rewrite this
    vector that way.
  • 3:30 - 3:33
    The length of this vector
    squared is equal to the dot
  • 3:33 - 3:34
    product of that vector
    with itself.
  • 3:34 - 3:45
    So it's ty minus x
    dot ty minus x.
  • 3:45 - 3:49
    In the last video, I showed
    you that you can treat a
  • 3:49 - 3:52
    multiplication or you can treat
    the dot product very
  • 3:52 - 3:54
    similar to regular
    multiplication when it comes
  • 3:54 - 3:57
    to the associative, distributive
    and commutative
  • 3:57 - 3:58
    properties.
  • 3:58 - 4:00
    So when you multiplied these,
    you know, you could kind of
  • 4:00 - 4:02
    view this as multiplying
    these two binomials.
  • 4:02 - 4:05
    You can do it the same way as
    you would just multiply two
  • 4:05 - 4:07
    regular algebraic binomials.
  • 4:07 - 4:11
    You're essentially just using
    the distributive property.
  • 4:11 - 4:14
    But remember, this isn't just
    regular multiplication.
  • 4:14 - 4:15
    This is the dot product
    we're doing.
  • 4:15 - 4:18
    This is vector multiplication
    or one version of vector
  • 4:18 - 4:19
    multiplication.
  • 4:19 - 4:25
    So if we distribute it out, this
    will become ty dot ty.
  • 4:25 - 4:26
    So let me write that out.
  • 4:26 - 4:31
    That'll be ty dot ty.
  • 4:31 - 4:36
    And then we'll get a minus--
    let me do it this way.
  • 4:36 - 4:43
    Then we get the minus
    x times this ty.
  • 4:43 - 4:45
    Instead of saying times,
    I should be very
  • 4:45 - 4:46
    careful to say dot.
  • 4:46 - 4:52
    So minus x dot ty.
  • 4:52 - 4:59
    And then you have this ty
    times this minus x.
  • 4:59 - 5:05
    So then you have
    minus ty dot x.
  • 5:05 - 5:09
    And then finally, you have the
    x's dot with each other.
  • 5:09 - 5:13
    And you can view them as
    minus 1x dot minus 1x.
  • 5:13 - 5:16
    You could say plus minus 1x.
  • 5:16 - 5:22
    I could just view this as plus
    minus 1 or plus minus 1.
  • 5:22 - 5:26
    So this is minus 1x
    dot minus 1x.
  • 5:26 - 5:27
    So let's see.
  • 5:27 - 5:30
    So this is what my whole
    expression simplified to or
  • 5:30 - 5:31
    expanded to.
  • 5:31 - 5:33
    I can't really call this
    a simplification.
  • 5:33 - 5:35
    But we can use the fact that
    this is commutative and
  • 5:35 - 5:38
    associative to rewrite this
    expression right here.
  • 5:38 - 5:45
    This is equal to y dot
    y times t squared.
  • 5:45 - 5:47
    t is just a scalar.
  • 5:49 - 5:51
    Minus-- and actually,
    this is 2.
  • 5:51 - 5:53
    These two things
    are equivalent.
  • 5:53 - 5:55
    They're just rearrangements of
    the same thing and we saw that
  • 5:55 - 5:57
    the dot product is
    associative.
  • 5:57 - 6:06
    So this is just equal to 2
    times x dot y times t.
  • 6:06 - 6:09
    And I should do that in maybe
    a different color.
  • 6:09 - 6:13
    So these two terms result in
    that term right there.
  • 6:13 - 6:17
    And then if you just rearrange
    these you have a minus 1
  • 6:17 - 6:17
    times a minus 1.
  • 6:17 - 6:20
    They cancel out, so those will
    become plus and you're just
  • 6:20 - 6:25
    left with plus x dot x.
  • 6:25 - 6:28
    And I should do that in a
    different color as well.
  • 6:28 - 6:30
    I'll do that in an
    orange color.
  • 6:30 - 6:33
    So those terms end up
    with that term.
  • 6:33 - 6:36
    Then of course, that term
    results in that term.
  • 6:36 - 6:38
    And remember, all I did
    is I rewrote this
  • 6:38 - 6:38
    thing and said, look.
  • 6:38 - 6:42
    This has got to be greater
    than or equal to 0.
  • 6:42 - 6:45
    So I could rewrite that here.
  • 6:45 - 6:46
    This thing is still just
    the same thing.
  • 6:46 - 6:47
    I've just rewritten it.
  • 6:47 - 6:53
    So this is all going to be
    greater than or equal to 0.
  • 6:53 - 6:55
    Now let's make a little bit of
    a substitution just to clean
  • 6:55 - 6:57
    up our expression
    a little bit.
  • 6:57 - 6:59
    And we'll later back substitute
    into this.
  • 6:59 - 7:02
    Let's define this as a.
  • 7:02 - 7:08
    Let's define this piece
    right here as b.
  • 7:08 - 7:10
    So the whole thing
    minus 2x dot y.
  • 7:10 - 7:12
    I'll leave the t there.
  • 7:12 - 7:17
    And let's define this or
    let me just define this
  • 7:17 - 7:18
    right here as c.
  • 7:18 - 7:20
    X dot x as c.
  • 7:20 - 7:22
    So then, what does our
    expression become?
  • 7:22 - 7:30
    It becomes a times t squared
    minus-- I want to be careful
  • 7:30 - 7:35
    with the colors-- b
    times t plus c.
  • 7:39 - 7:41
    And of course, we know that it's
    going to be greater than
  • 7:41 - 7:42
    or equal to 0.
  • 7:42 - 7:44
    It's the same thing as
    this up here, greater
  • 7:44 - 7:44
    than or equal to 0.
  • 7:44 - 7:47
    I could write p of t here.
  • 7:47 - 7:51
    Now this is greater than or
    equal to 0 for any t that I
  • 7:51 - 7:52
    put in here.
  • 7:52 - 7:54
    For any real t that
    I put in there.
  • 8:01 - 8:05
    Let me evaluate our function
    at b over 2a.
  • 8:05 - 8:08
    And I can definitely do this
    because what was a?
  • 8:08 - 8:11
    I just have to make sure I'm not
    dividing by 0 any place.
  • 8:11 - 8:14
    So a was this vector
    dotted with itself.
  • 8:14 - 8:16
    And we said this was
    a nonzero vector.
  • 8:16 - 8:19
    So this is the square
    of its length.
  • 8:19 - 8:22
    It's a nonzero vector, so some
    of these terms up here would
  • 8:22 - 8:24
    end up becoming positively
    when you take its length.
  • 8:24 - 8:26
    So this thing right
    here is nonzero.
  • 8:26 - 8:27
    This is a nonzero vector.
  • 8:27 - 8:31
    Then 2 times the dot product
    with itself is also going to
  • 8:31 - 8:31
    be nonzero.
  • 8:31 - 8:32
    So we can do this.
  • 8:32 - 8:35
    We don't worry about dividing
    by 0, whatever else.
  • 8:35 - 8:37
    But what will this
    be equal to?
  • 8:37 - 8:39
    This'll be equal to-- and I'll
    just stick to the green.
  • 8:39 - 8:42
    It takes too long to keep
    switching between colors.
  • 8:42 - 8:45
    This is equal to a times this
    expression squared.
  • 8:45 - 8:49
    So it's b squared
    over 4a squared.
  • 8:49 - 8:52
    I just squared 2a to
    get the 4a squared.
  • 8:52 - 8:55
    Minus b times this.
  • 8:55 - 8:59
    So b times-- this is just
    regular multiplication.
  • 8:59 - 9:02
    b times b over 2a.
  • 9:02 - 9:04
    Just write regular
    multiplication there.
  • 9:04 - 9:05
    Plus c.
  • 9:05 - 9:08
    And we know all of that is
    greater than or equal to 0.
  • 9:08 - 9:12
    Now if we simplify this a little
    bit, what do we get?
  • 9:12 - 9:15
    Well this a cancels out with
    this exponent there and you
  • 9:15 - 9:18
    end up with a b squared
    right there.
  • 9:18 - 9:26
    So we get b squared over 4a
    minus b squared over 2a.
  • 9:26 - 9:28
    That's that term over there.
  • 9:28 - 9:32
    Plus c is greater than
    or equal to 0.
  • 9:32 - 9:33
    Let me rewrite this.
  • 9:33 - 9:37
    If I multiply the numerator and
    denominator of this by 2,
  • 9:37 - 9:38
    what do I get?
  • 9:38 - 9:41
    I get 2b squared over 4a.
  • 9:41 - 9:43
    And the whole reason I did
    that is to get a common
  • 9:43 - 9:45
    denominator here.
  • 9:45 - 9:46
    So what do you get?
  • 9:46 - 9:50
    You get b squared over 4a minus
    2b squared over 4a.
  • 9:50 - 9:53
    So what do these two
    terms simplify to?
  • 9:53 - 9:55
    Well the numerator is b squared
    minus 2b squared.
  • 9:55 - 10:01
    So that just becomes minus b
    squared over 4a plus c is
  • 10:01 - 10:03
    greater than or equal to 0.
  • 10:03 - 10:07
    These two terms add up to
    this one right here.
  • 10:07 - 10:11
    Now if we add this to both sides
    of the equation, we get
  • 10:11 - 10:16
    c is greater than or equal
    to b squared over 4a.
  • 10:16 - 10:18
    It was a negative on
    the left-hand side.
  • 10:18 - 10:20
    If I add it to both sides it's
    going to be a positive on the
  • 10:20 - 10:22
    right-hand side.
  • 10:22 - 10:24
    We're approaching something that
    looks like an inequality,
  • 10:24 - 10:28
    so let's back substitute our
    original substitutions to see
  • 10:28 - 10:30
    what we have now.
  • 10:30 - 10:33
    So where was my original
    substitutions that I made?
  • 10:33 - 10:36
    It was right here.
  • 10:36 - 10:38
    And actually, just to simplify
    more, let me multiply both
  • 10:38 - 10:39
    sides by 4a.
  • 10:41 - 10:43
    I said a, not only
    is it nonzero,
  • 10:43 - 10:44
    it's going to be positive.
  • 10:44 - 10:46
    This is the square
    of its length.
  • 10:46 - 10:50
    And I already showed you that
    the length of any real
  • 10:50 - 10:51
    vector's going to be positive.
  • 10:51 - 10:53
    And the reason why I'm taking
    great pains to show that a is
  • 10:53 - 10:56
    positive is because if I
    multiply both sides of it I
  • 10:56 - 10:58
    don't want to change the
    inequality sign.
  • 10:58 - 11:00
    So let me multiply both sides
    of this by a before I
  • 11:00 - 11:00
    substitute.
  • 11:00 - 11:08
    So we get 4ac is greater than
    or equal to b squared.
  • 11:08 - 11:08
    There you go.
  • 11:08 - 11:10
    And remember, I took
    great pains.
  • 11:10 - 11:13
    I just said a is definitely a
    positive number because it is
  • 11:13 - 11:17
    essentially the square of the
    length. y dot y is the square
  • 11:17 - 11:19
    of the length of y, and that's
    a positive value.
  • 11:19 - 11:20
    It has to be positive.
  • 11:20 - 11:22
    We're dealing with
    real vectors.
  • 11:22 - 11:24
    Now let's back substitute
    this.
  • 11:24 - 11:30
    So 4 times a, 4 times y dot y.
  • 11:30 - 11:33
    y dot y is also-- I might as
    well just write it there.
  • 11:33 - 11:39
    y dot y is the same thing as
    the magnitude of y squared.
  • 11:39 - 11:40
    That's y dot y.
  • 11:40 - 11:43
    This is a.
  • 11:43 - 11:46
    y dot y, I showed you that
    in the previous video.
  • 11:46 - 11:47
    Times c.
  • 11:47 - 11:50
    c is x dot x.
  • 11:50 - 11:54
    Well x dot x is the
    same thing as the
  • 11:54 - 11:56
    length of vector x squared.
  • 11:56 - 11:57
    So this was c.
  • 11:57 - 12:01
    So 4 times a times c is going
    to be greater than
  • 12:01 - 12:04
    or equal to b squared.
  • 12:04 - 12:07
    Now what was b? b was
    this thing here.
  • 12:07 - 12:15
    So b squared would be 2
    times x dot y squared.
  • 12:15 - 12:18
    So we've gotten to this
    result so far.
  • 12:18 - 12:20
    And so what can we
    do with this?
  • 12:20 - 12:21
    Oh sorry, and this whole
    thing is squared.
  • 12:21 - 12:23
    This whole thing right
    here is b.
  • 12:23 - 12:25
    So let's see if we can
    simplify this.
  • 12:25 - 12:28
    So we get-- let me switch
    to a different color.
  • 12:28 - 12:35
    4 times the length of y squared
    times the length of x
  • 12:35 - 12:38
    squared is greater than or equal
    to-- if we squared this
  • 12:38 - 12:46
    quantity right here, we
    get 4 times x dot y.
  • 12:46 - 12:55
    4 times x dot y times x dot y.
  • 12:55 - 12:57
    Actually, even better, let me
    just write it like this.
  • 12:57 - 13:01
    Let me just write 4 times
    x dot y squared.
  • 13:01 - 13:03
    Now we can divide
    both sides by 4.
  • 13:03 - 13:05
    That won't change
    our inequality.
  • 13:05 - 13:06
    So that just cancels
    out there.
  • 13:06 - 13:08
    And now let's take the
    square root of both
  • 13:08 - 13:10
    sides of this equation.
  • 13:10 - 13:13
    So the square roots of both
    sides of this equation-- these
  • 13:13 - 13:15
    are positive values, so the
    square root of this side is
  • 13:15 - 13:17
    the square root of each
    of its terms. That's
  • 13:17 - 13:18
    just an exponent property.
  • 13:18 - 13:21
    So if you take the square root
    of both sides you get the
  • 13:21 - 13:28
    length of y times the length of
    x is greater than or equal
  • 13:28 - 13:30
    to the square root of this.
  • 13:30 - 13:32
    And we're going to take the
    positive square root.
  • 13:32 - 13:33
    We're going to take the positive
    square root on both
  • 13:33 - 13:34
    sides of this equation.
  • 13:34 - 13:37
    That keeps us from having to
    mess with anything on the
  • 13:37 - 13:38
    inequality or anything
    like that.
  • 13:38 - 13:43
    So the positive square root is
    going to be the absolute value
  • 13:43 - 13:44
    of x dot y.
  • 13:44 - 13:46
    And I want to be very careful
    to say this is the absolute
  • 13:46 - 13:51
    value because it's possible that
    this thing right here is
  • 13:51 - 13:52
    a negative value.
  • 13:52 - 13:56
    But when you square it, you want
    to be careful that when
  • 13:56 - 13:57
    you take the square root
    of it that you
  • 13:57 - 13:58
    stay a positive value.
  • 13:58 - 14:02
    Because otherwise when we take
    the principal square root, we
  • 14:02 - 14:04
    might mess with the inquality.
  • 14:04 - 14:07
    We're taking the positive square
    root, which will be--
  • 14:07 - 14:09
    so if you take the absolute
    value, you're ensuring that
  • 14:09 - 14:11
    it's going to be positive.
  • 14:11 - 14:12
    But this is our result.
  • 14:12 - 14:16
    The absolute value of the dot
    product of our vectors is less
  • 14:16 - 14:20
    than the product of the
    two vectors lengths.
  • 14:20 - 14:22
    So we got our Cauchy-Schwarz
    inequality.
  • 14:28 - 14:37
    Now the last thing I said is
    look, what happens if x is
  • 14:37 - 14:40
    equal to some scalar
    multiple of y?
  • 14:40 - 14:41
    Well in that case, what's
    the absolute value?
  • 14:41 - 14:46
    The absolute value of x dot y?
  • 14:46 - 14:49
    Well that equals--
    that equals what?
  • 14:49 - 14:51
    If we make the substitution that
    equals the absolute value
  • 14:51 - 14:53
    of c times y.
  • 14:53 - 14:59
    That's just x dot y, which
    is equal to just from the
  • 14:59 - 15:01
    associative property.
  • 15:01 - 15:05
    It's equal to the absolute value
    of c times-- we want to
  • 15:05 - 15:08
    make sure our absolute value,
    keep everything positive.
  • 15:08 - 15:11
    y dot y.
  • 15:11 - 15:22
    Well this is just equal to c
    times the magnitude of y-- the
  • 15:22 - 15:24
    length of y squared.
  • 15:24 - 15:31
    Well that just is equal to the
    magnitude of c times-- or the
  • 15:31 - 15:35
    absolute value of our scalar
    c times our length of y.
  • 15:40 - 15:44
    Well this right here,
    I can rewrite this.
  • 15:44 - 15:47
    I mean you can prove this to
    yourself if you don't believe
  • 15:47 - 15:50
    it, but this-- we could put the
    c inside of the magnitude
  • 15:50 - 15:52
    and that could be a good
    exercise for you to prove.
  • 15:52 - 15:52
    But it's pretty straightforward.
  • 15:52 - 15:54
    You just do the definition
    of length.
  • 15:54 - 15:56
    And you multiply it by c.
  • 15:56 - 16:02
    This is equal to the magnitude
    of cy times-- let me say the
  • 16:02 - 16:07
    length of cy times
    the length of y.
  • 16:07 - 16:11
    I've lost my vector notation
    someplace over here.
  • 16:11 - 16:12
    There you go.
  • 16:12 - 16:14
    Now, this is x.
  • 16:14 - 16:19
    So this is equal to the length
    of x times the length of y.
  • 16:19 - 16:21
    So I showed you kind of
    the second part of the
  • 16:21 - 16:25
    Cauchy-Schwarz Inequality that
    this is only equal to each
  • 16:25 - 16:29
    other if one of them is a scalar
    multiple of the other.
  • 16:29 - 16:30
    If you're a little uncomfortable
    with some of
  • 16:30 - 16:32
    these steps I took, it might
    be a good exercise to
  • 16:32 - 16:32
    actually prove it.
  • 16:32 - 16:36
    For example, to prove that the
    absolute value of c times the
  • 16:36 - 16:39
    length of the vector y is
    the same thing as the
  • 16:39 - 16:42
    length of c times y.
  • 16:42 - 16:44
    Anyway, hopefully you found
    this pretty useful.
  • 16:44 - 16:47
    The Cauchy-Schwarz Inequality
    we'll use a lot when we prove
  • 16:47 - 16:50
    other results in
    linear algebra.
  • 16:50 - 16:51
    And in a future video, I'll
    give you a little more
  • 16:51 - 16:54
    intuition about why this makes a
    lot of sense relative to the
  • 16:54 - 16:56
    dot product.
Title:
Proof of the Cauchy-Schwarz Inequality
Description:

Proof of the Cauchy-Schwarz Inequality

more » « less
Video Language:
English
Duration:
16:55

English subtitles

Revisions