HomeVideos

Convex Sets

Now Playing

Convex Sets

Transcript

340 segments

0:00

Welcome back. So we're talking about

0:02

convexity and in particular convex sets

0:06

today. So convexity is a key concept in

0:10

optimization theory. If we have a convex

0:12

optimization problem then there are a

0:15

huge wealth of techniques to solve those

0:17

problems and they're much much much

0:19

easier to solve than non-convex

0:21

optimization problems. And so there are

0:23

two ingredients to a convex optimization

0:25

problem. There's the objective function

0:28

and then there is the set of constraints

0:29

that determines a feasible set where the

0:32

optimum solution has to live. And so

0:35

today we're going to talk about what

0:36

makes a set convex or non-convex. So

0:40

here are two examples of convex sets um

0:44

a little hexagon and an oval. And we're

0:47

going to illustrate what is we're going

0:49

to define what it is to be a convex set

0:51

and then give a bunch of examples and

0:54

properties.

0:55

So the definition of a convex set is the

0:58

following. A set C like this hexagon or

1:01

this oval is convex if for every two

1:06

points inside of this set for every x

1:10

and y point uh pair of points inside of

1:12

this set the line segment connecting

1:15

those two points is also in the set. If

1:18

that's true for every pair of points, if

1:20

every pair of points has a line segment

1:22

connecting them that is also in the set,

1:25

then we would say that that set C is

1:27

convex. If that's not true, then the set

1:30

is not convex. Okay? So here uh I'm

1:34

going to illustrate it on this oval

1:35

example. So we have our set uh our set

1:38

here and we have these two points X and

1:40

Y. They're just arbitrary points. And

1:42

you can parameterize the line segment

1:44

between those points, this orange line

1:46

segment with this alpha parameter. So

1:49

when alpha is zero, we are entirely at

1:53

the point y. And when alpha is one, we

1:56

are entirely at the point x. And for an

1:59

alpha between 0 and one, I slide along

2:02

this line segment. So for every single

2:06

alpha between 0 and one, for every point

2:08

on this line segment, that point has to

2:10

be in this set in this purple region for

2:14

the set to be convex. And that has to be

2:16

true for every single pair of points I

2:19

could pick in this set. For every pair

2:20

of points I can pick, uh, in this case,

2:23

including on the boundaries, the line

2:25

segment connecting them has to be in the

2:27

set. So that's clearly true for this

2:29

oval. You can kind of verify that just

2:31

intuitively in your mind. It's also true

2:34

for this hexagon. Any two points, the

2:36

line segment connecting them is also in

2:38

the

2:39

set. This is an example of a non-convex

2:43

set because there is this uh we call

2:45

this here a concavity, this little bump

2:47

that's taken out. And if I take two

2:50

points uh x and y that are kind of

2:53

around that concavity, the line segment

2:56

connecting them, there are points that

2:58

are not inside the set. These points

3:00

here are not in the set. And that means

3:03

that that set is not convex. It's a not

3:06

it's not a convex set. Okay. So really

3:09

really important definition and actually

3:11

really simple and easy to understand.

3:14

This is kind of all there is to convex

3:16

set theory. A set is convex if and only

3:19

if for every two points in that set, the

3:22

line segment connecting those points is

3:24

also in the set. Okay? And this idea

3:27

generalizes to much higher dimensional

3:29

spaces and much kind of weirder shapes

3:33

and geometries. Okay, so this is a a

3:35

really simple definition, but this will

3:37

encapsulate a huge array of

3:40

shapes. Good. So let's look at another

3:43

example. If I have this uh this this

3:47

circular disc and the interior of that

3:49

disc is also part of the set. So this is

3:51

a shaded disc. This is a hollow circle.

3:54

The shaded disc is a convex set because

3:58

any two points the line segment

4:00

connecting them is in that shaded disc.

4:03

Whereas the ring the hollow circle or

4:06

the hollow ring is not convex because if

4:09

I take two points on the boundary the

4:11

line segment connecting them is interior

4:14

and the interior is not in the set. So

4:17

all of these dashed orange points are

4:18

not in this hollow ring set. So the

4:22

filled disc is convex but the hollow

4:24

ring is

4:26

non-convex. Um polyhedra in higher

4:30

dimensions in three dimensions, four

4:31

dimensions, n dimensions are generally

4:35

uh convex if they have this kind of this

4:38

this property. Um, but if they have

4:41

weird boundaries where some of the

4:43

boundaries are included and some of them

4:45

are not included, you might have them be

4:48

uh kind of degenerately non-convex

4:51

because if I took a point uh at this

4:53

corner and a point at this corner, there

4:55

would be points along the line

4:57

connecting them that are not in the set.

4:59

So, I've drawn this as kind of a dashed

5:00

boundary here. But usually if you do

5:03

common sense things like include the

5:05

boundaries uh or disregard all of the

5:08

boundaries then your set will be convex.

5:11

And there's a lot of pretty hairy deep

5:13

mathematical theory in set theory and

5:16

topology uh related to convex set

5:18

theory. I'm going to gloss over most of

5:20

that and just give you the intuitive

5:22

kind of common sense notions of these

5:24

things and maybe later I'll have some

5:26

more kind of deep dive math lectures on

5:28

convexity. Good. So these are some

5:31

examples. Um other good examples are a

5:34

point is convex. Um kind of trivially

5:37

convex. Uh a line segment or an infinite

5:40

line those are both convex. A section of

5:44

a plane or an entire plane or a half

5:47

plane those are also convex. Uh and

5:51

these generalize to higher and higher

5:52

dimensions. So for example a you know a

5:56

positive quadrant of a three-dimensional

5:58

space that would be convex or the entire

6:02

three space is also convex or the

6:05

positive half space where x is greater

6:07

than or equal to zero that would be

6:09

convex. So these are all building

6:11

blocks. And what we're going to see very

6:14

soon is that I can get kind of more

6:16

exotic shapes by taking the

6:18

intersections of these and I can build

6:20

these little convex sets out of these

6:23

building block pieces. So other useful

6:26

uh convex sets that are going to come up

6:27

a lot are things like spheres,

6:30

ellipsoids, and cones. And as long as

6:33

the cross-section of this cone is

6:35

convex, then if I extrude it out either

6:39

in a cylinder or a cone, that will also

6:42

be a convex set. Okay, so these are

6:45

really, really useful. And we're going

6:46

to see these all the time in

6:48

optimization theory. And remember, a lot

6:51

of our optimization problems are going

6:52

to be very highdimensional. we're going

6:54

to be trying to train a neural network

6:56

with a million parameters or doing a le

6:58

squares problem where we're fitting you

7:00

know a hundred or a thousand unknown

7:02

variables. So our notion of a convex set

7:05

is going to be in a very highdimensional

7:07

space. So we need to be able to take

7:09

these building blocks these these kind

7:11

of concepts and abstract them. An nphere

7:14

is convex. An n-dimensional ellipoid is

7:16

convex. An n- dimensional hyper plane is

7:19

also convex. Things like

7:21

that. Good. Uh so this is the notion of

7:25

kind of convex and

7:27

non-convex. One kind of other point is

7:30

if you had a non-convex shape like this

7:32

kidney beam, there's something called

7:34

the convex hole. H u ll. This is like

7:38

the hole of a ship, the the kind of body

7:41

frame of the of a of a vessel, a naval

7:43

vessel. And you would get this convex

7:46

hole by taking the smallest set that is

7:50

convex that contains that non-convex

7:53

kidney bean. And in this case, it's

7:55

really kind of intuitive how to do this.

7:57

You just kind of take those two uh edge

8:00

points and connect them and fill it in.

8:02

Um you basically fill in this concavity

8:05

here and you get a convex set called the

8:07

convex hole. So you can take non

8:10

non-convex sets and convexify them by

8:14

adding in the points that are missing

8:16

essentially. Good. Okay. So that's the

8:18

notion of convexity. Um I want to show

8:21

you how you can take inequality

8:24

constraints which are going to come up

8:25

all over the place in optimization

8:28

theory and build convex sets using these

8:31

inequality constraints. So um if I have

8:34

something like the inequality constraint

8:37

that my x variable has to be greater

8:39

than or equal to zero that sets up a

8:42

feasible region in my optimization

8:44

problem that is the right half plane

8:47

where x is greater than or equal to

8:49

zero. It also establishes what's known

8:52

as an infeasible region. The complement

8:54

of that is the set x less than zero.

8:57

Notice that if this is x is greater than

8:59

or equal to then this is x strictly less

9:02

than. The boundary has to you know be

9:04

either feasible or not feasible. It

9:06

can't be both. Okay. And so this

9:09

feasible region in this case is a convex

9:12

set. The infeasible region is also a

9:15

convex set. So this inequality

9:17

constraint in my optimization problem

9:19

establishes a feasible region that is

9:22

convex. And so that means that all of my

9:25

powerful convex optimization techniques

9:27

are going to apply when I have simple

9:29

equality and inequality

9:31

constraints. Now I can have more complex

9:34

constraints like um the radius of my x

9:37

and y point has to be less than or equal

9:39

to one and that would also establish a

9:42

convex feasible region this unit circle

9:44

here. And it would establish a nonconvex

9:48

infeasible region which is everything

9:50

outside of that circle. So what I'm

9:52

trying to get at here is that you know

9:53

in our optimization problem our

9:56

constraints are generally going to be

9:58

written as either linear or nonlinear

10:02

inequality constraints and those are

10:04

going to establish feasible regions

10:06

which may or may not be convex. I could

10:09

easily write down an equation where the

10:12

feasible region is weird and

10:14

nonconvex. Uh but in these cases our

10:17

feasible region is in fact convex. So

10:20

that's kind of where we, you know,

10:22

inequality constraints often give you

10:24

convex sets. Linear inequalities will

10:27

always give you convex sets. Nonlinear

10:29

inequality equations may or may not give

10:31

you convex sets. Good. And the

10:35

intersection of two convex sets is also

10:38

convex. This is always true. Um, I'm

10:41

going to prove this in another video.

10:42

It's actually a really simple proof, so

10:44

I'm just going to like do it because

10:45

it's good for you to see it. If I have

10:47

two sets C1 and C2, the intersection

10:51

this C1 and that should be a C2. C1 and

10:56

C2 uh is this intersection of the two

10:59

sets. We call it C. And that means that

11:02

any point in this middle region has to

11:04

belong to both C1 and to C2 to be in

11:08

this intersection. And you can prove

11:11

pretty easily that if C1 is convex and

11:14

if C2 is convex then this kind of

11:16

intersection region in the middle has to

11:18

be convex. It has that property that

11:20

every line segment connecting any two

11:22

points lies entirely in that set. Okay.

11:26

And if this is true for two sets it's

11:29

true for three or for four or for n. I

11:31

can take the intersection of as many

11:33

sets as I want and I still if they're

11:35

convex the resulting set is still

11:38

convex. So this is huge. This is how

11:40

we're going to build convex feasible

11:42

regions with our constraint equations in

11:46

optimization. So for example, if I have

11:48

this matrix system of inequality

11:50

constraints, a bunch of inequality

11:52

constraints that can determine a convex

11:55

feasible set C uh like this kind of

11:59

quadrilateral here. So for example, I

12:01

might have two um inequality constraints

12:04

that y has to be greater than or equal

12:06

to zero and x has to be greater than or

12:08

equal to zero. Those are these kind of

12:10

very lightly shaded purple half planes.

12:13

Those are convex. And so their

12:15

intersection, the positive quadrant up

12:18

here is also

12:19

convex. And then I might add two more

12:21

constraints that y has to be less than

12:24

or equal to 2/3 and x + y has to be less

12:27

than or equal to 1. Again, the

12:29

intersection of these four constraint

12:31

equations, these four convex sets gives

12:33

me this feasible convex set here in the

12:36

middle. And this is where my optimum

12:39

value, my the solution of my

12:40

optimization problem has to live in this

12:43

convex feasible set given by these

12:46

inequality constraints. So super super

12:48

useful. The property that the

12:50

intersection of two convex sets is also

12:52

convex is what allows us to build these

12:55

convex feasible regions in optimization

12:58

problems. Super powerful, really

13:00

fundamental. And I'm going to show you a

13:02

proof of this in a future

13:05

video. Good. Um, and this again, like I

13:08

said, this establishes the feasible sets

13:11

that we're going to use for every linear

13:13

programming problem and for every

13:15

quadratic programming problem. the

13:17

constraints are going to be of this form

13:19

and so we're going to get these convex

13:22

feasible sets. So that's that's one of

13:24

the nice things about linear programming

13:25

and quadratic programming is that

13:27

they're convex optimization problems

13:29

that have really uh good generic

13:31

solution

13:34

techniques. Okay, so that's kind of all

13:37

I wanted to tell you at the beginning

13:39

with convex sets. Um, it's really just

13:42

defined by this simple definition that a

13:44

set is convex if for every two points X

13:47

and Y in the set, the line segment

13:49

connecting those two points is also in

13:51

the set. So these are examples of convex

13:53

sets. This set is nonconvex because it

13:56

does not satisfy that property. And this

13:58

is one of the most useful uh ideas in

14:01

set theory and in

14:03

optimization. So soon we're going to

14:05

talk about what it means to make a

14:07

function convex. So we can have convex

14:09

sets and also convex optim uh objective

14:13

functions. And so we'll talk about what

14:14

it means for a function to be convex

14:16

soon. All right. Thank you.

Interactive Summary

This video provides an introduction to the concept of convex sets, which are foundational to optimization theory. The speaker defines a set as convex if, for any two points within it, the line segment connecting them also lies entirely within that set. The video covers examples of convex versus non-convex shapes, discusses the importance of the convex hull, and explains how inequality constraints and the intersection of convex sets are used to define feasible regions in optimization problems.

Suggested questions

3 ready-made prompts