MathAnalytic geometry

Convex set

5 minutes read

In this topic, we are going to study convex sets. The usage of convex sets is very wide and varies from optimization to machine learning. The reason we need to learn them is their close relation with linear programming. If we are able to determine that a given set is convex, it makes our lives easier. In this case, we can use special theorems to immediately find the solution for linear programming problems (even those with large dimensions). Thus, studying convex sets is the first step to solve linear programming problems. Further in this topic, we will define convex sets using line segments, have a look at the most popular examples of convex sets, and prove their property that we will need in linear programming theorems.

A few examples

For this topic, it is important to remember that some sets can be represented graphically, because this is the easiest way to understand why a set is convex (or non-convex). Let's take a look at some examples of sets and their corresponding geometric shapes:

  • unit circle R={(x,y):x2+y21}R = \{(x, y): x^2 + y^2 \leq 1\}

    Unit circle

  • part of the plane bounded by the deltoid curve (the Steiner curve) D={(x,y):(x2+y2)2+18(x2+y2)8x324y2x+27}D = \{(x,y): (x^2 + y^2)^2 + 18 (x^2 + y^2) \leq 8x^3 - 24y^{2}x+27\}

Steiner curve

  • ring K={(x,y):x2+y21,x2+y22}K = \{(x,y): x^2 + y^2 \geq 1, x^2 + y^2 \leq 2 \}

Ring

Line segment

As you can see from the name of this topic, the main discussion is going to be about convex sets. However, to define convex sets, it is necessary to understand the concept of a line segment, since this concept is used in the definition of a convex set.

Definition. Line segment between points pp and qq is all points x=(1t)p+tqx = (1-t)p+ tq with 0t10\leq t \leq 1.

The notation of points here and further is not that significant. You can choose any you like: p,q,n,s,r,p,q,n,s,r ,\ldots.

Line segment

All points x=(1t)p+tqx = (1-t)p + tq with 0t10\leq t \leq 1" means that depending on the value of the parameter tt, we can get any point of the segment, including the extreme points. You can check this fact by putting different values of 0t10\leq t \leq 1 into the equation x=(1t)p+tqx = (1-t)p + tq.

One more  line segment

Now, a line segment is a part of a line that is bounded by two distinct end points and contains every point on the line that is between its endpoints.

What is a convex set?

Two sets

Look at these sets. Try to guess, which of them is convex?

If you've chosen the left one, you are absolutely right. Probably, the reason you picked set AA and not set BB is that the latter has a small cavity. What a nice intuition you have!

A convex set and set having a small cavity

So, a convex set is a set that doesn't have any cavities. This is for sure an informal definition. How can we formalize it? In other words, how can we define cavities?

Let us select two points in the set AA and draw a line segment between them. It is well seen that this line segment lies inside the region of set AA. Moreover, no matter which points in the set AA we select, all line segments between them will also lie inside the corresponding region.

Points and line segments in the set

Now, let us do the same with the set BB. Can we find such points in set BB that, if we draw a line segment between them, some parts of this line segment will lie outside the region of set BB? Yes, we can! This is how we can describe a cavity.

Part of the segment outside the set

Now we can define convex sets using line segments.

Set AA is convex if the line segment between any two points in AA lies in AA. The set that is not convex is called non-convex or concave.

In non-convex sets line segments between some points may lie in the set. If at least one line segment lies outside the set, this set is non-convex.

Definition. A set AA is convex if for all points p,qA,(1t)p+tqAp, q \in A, (1-t)p + tq \in A with 0t10\leq t\leq 1.

This is a coordinate formula, which means that it can be used for both xx-coordinates and yy-coordinates of points pp and qq. In the following section, you can see how it is possible to use this formula.

You can find more examples of convex and non-convex sets below.

Convex sets:

Convex sets

Non-convex sets:

Non-convex sets

Special cases

So, now you can tell convex sets from non-convex ones if they are represented graphically. However, it is also very important to spot convex sets if they are written in the analytical form, because that is how they usually appear in mathematical problems, in particular, in linear programming. Below you can find a few important examples of convex sets.

  • Empty set

The empty set is a set that contains no elements.

  • Singleton set

The singleton set is a set that contains just 1 element. For example, A={3.14}A=\{3.14\}.

  • Half-plane

A half-plane is a planar region consisting of all points on one side of an infinite straight line, and no points on the other side. The examples are shown below.

Half-plane

Another half-plane

Take notice that a solution set LL for the linear inequality a1x1+a2x2+a3x3++anxnba_1 x_1 + a_2 x_2 + a_3 x_3 +\ldots + a_n x_n \leq b is a half-plane.

Hence, the solution set for any linear inequality is a convex set.

Never believe a word without checking it. Do not forget that you can always check if a set is convex using the definition.

Let's prove the convexity of half-plane a1x+a2yb,(b0)a_1 x + a_2 y \leq b, (b \geq 0), using the definition of convex set. Suppose that two points p1=(x1,y1)\mathbf{p_1}=(x_1, y_1) and p2=(x2,y2)\mathbf{p_2}=(x_2, y_2) are chosen from the half-plane. This means that their coordinates satisfy the half-plane equation, i.e. the following inequalities are true:

a1x1+a2y1b,a1x2+a2y2b.a_1x_1 + a_2 y_1 \leq b, \qquad a_1x_2 + a_2 y_2 \leq b.Remember them, they will come in handy soon.

Then the coordinates of any point p\mathbf{p} lying between the points p1\mathbf{p_1} and p2\mathbf{p_2} are determinated by line segment equation. Let's write this equation:

p=(1t)p1+tp2=((1t)x1+tx2(1t)y1+ty2),\mathbf{p} = (1-t)\mathbf{p_1}+ t\mathbf{p_2} = \begin{pmatrix} (1 - t)x_1 + tx_2\\ (1 - t)y_1 + ty_2 \end{pmatrix},where 0t10\leq t \leq 1.

Thus, xx-coordinate of point p\mathbf{p} is equal to (1t)x1+tx2(1 - t)x_1 + tx_2, and yy-coordinate of point p\mathbf{p} is equal to (1t)y1+ty2(1 - t)y_1 + ty_2. Now we can check if point p\mathbf{p} lies in the half-plane. Let's substitute coordinates of point p\mathbf{p} in half-plane equation:

a1[(1t)x1+tx2]+a2[(1t)y1+ty2].a_1 \left[ (1 - t) x_1 + tx_2 \right] + a_2 \left[ (1 - t)y_1 + ty_2 \right].Let's open brackets:

a1(1t)x1+a1tx2+a2(1t)y1+a2ty2.a_1(1-t)x_1 + a_1t x_2 + a_2 (1-t) y_1 + a_2 t y_2.We group similar terms at tt and (1t)(1-t).

a1(1t)x1+a2(1t)y1+a1tx2+a2ty2=(1t)[a1x1+a2y1]+t[a1x2+a2y2]a_1(1-t)x_1 + a_2 (1-t) y_1 + a_1t x_2 + a_2 t y_2 = (1-t) \left[ a_1 x_1 + a_2 y_1 \right] + t \left[ a_1 x_2 + a_2 y_2 \right]Look at the expressions in square brackets and compare them with the inequalities of the coordinates of p1\mathbf{p_1} and p2\mathbf{p_2} mentioned above. The expressions in square brackets represent the left side of those coordinate expressions. Let's replace these expressions with the right side and expand the brackets.

(1t)[a1x1+a2y1]+t[a1x2+a2y2](1t)b+tb=btb+tb=b.(1-t) \left[ a_1 x_1 + a_2 y_1 \right] + t \left[ a_1 x_2 + a_2 y_2 \right] \leq (1-t)b + tb = b - tb + tb = b.Removing all unnecessary transformations, we can write the following:

a1[(1t)x1+tx2]+a2[(1t)y1+ty2]ba_1 \left[ (1 - t) x_1 + tx_2 \right] + a_2 \left[ (1 - t)y_1 + ty_2 \right] \leq bThis means that when the coordinates of the point p\mathbf{p} are substituted into the inequality a1x+a2yba_1 x + a_2 y \leq b, it remains true. Hence, the point p\mathbf{p} belongs to the half-plane given by this inequality.

The proof is complete.

  • Polyhedron

Polyhedron

A polyhedron can be interpreted as an intersection of many half-planes.

Let's now discuss one important property of convex sets.

An intersection of any number of convex sets is convex.

Proof. If the intersection is empty, or consists of a single point, the theorem is true by definition (empty and singleton sets are always convex). Otherwise, let AA and BB be two convex sets. Let's take any two points pp, qq in the intersection of AA and BB. Let point hh lie on the line segment between pp, qq, then, hh lies in AA, because AA is convex, and similarly, hh lies in BB, because BB is also convex. Therefore, hh lies in the intersection of AA and BB. The proof is complete.

Intersection of convex sets

The proof can be also extended to multiple convex sets. Based on this property, we can argue that the polyhedron is a convex set, because it consists of the intersection of half-planes, and as we've found out, a half-plane is a convex set.

Conclusion

Let's go over the main points of the topic:

  • a line segment is a part of a line that is bounded by two distinct endpoints;
  • a convex set is a set that has no cavities;
  • you can check if a set is convex using the definition of convex sets;
  • a solution set for the linear inequality is a half-plane (which is a convex set);
  • the fact that intersection of convex sets is also a convex set will be useful later in linear programming;
  • never trust anyone (even this topic), always check.
4 learners liked this piece of theory. 0 didn't like it. What about you?
Report a typo