How to Identify Convex Sets

 

How to Identify Convex Sets 

To determine whether a given set is convex or non-convex, we use several practical identification methods. In practice, you rarely rely on just one method—you combine geometry, algebra, and known results.


1. Line Segment Test (Definition Test)

Rule

A set CC is convex if for any two points
x1,x2Cx_1, x_2 \in C and any λ[0,1]\lambda \in [0,1],

λx1+(1λ)x2C\lambda x_1 + (1-\lambda)x_2 \in C

How to Apply

  1. Choose two arbitrary points in the set.

  2. Form their convex combination.

  3. Check whether the resulting point satisfies the defining condition of the set.

Example (Convex)

C={xR2:x1+x21}C = \{x \in \mathbb{R}^2 : x_1 + x_2 \le 1\}

Take x(1),x(2)Cx^{(1)}, x^{(2)} \in C. Then:

λx(1)+(1λ)x(2)x1+x21\lambda x^{(1)} + (1-\lambda)x^{(2)} \Rightarrow x_1 + x_2 \le 1

✔ Convex

Example (Non-Convex)

C={(x,y):x2+y2=1}C = \{(x,y) : x^2 + y^2 = 1\}

Points lie on a circle boundary only.
The line segment between two points lies inside the circle, not on it.
✘ Not convex


2. Shape-Based (Geometric) Identification

Rule

  • Solid shapes without dents or holes → convex

  • Shapes with holes or indentations → non-convex

Examples

ShapeConvex?
Solid disk
Square
Triangle
Donut (ring)
Crescent shape

📌 Quick classroom intuition:
“If you can stretch a rubber band between any two points and it stays inside, the set is convex.”


3. Constraint-Based Identification

Rule

A set defined by linear equalities or inequalities is convex.

C={x:Axb,  Cx=d}C = \{x : Ax \le b, \; Cx = d\}

Examples

Convex

{x:2x1x23}\{x : 2x_1 - x_2 \le 3\}
{x:x10,  x20}\{x : x_1 \ge 0,\; x_2 \ge 0\}

Non-Convex

{x:x1x21}\{x : x_1 x_2 \ge 1\}

(product of variables → usually non-convex)


4. Intersection Rule

Rule

If

C=C1C2CkC = C_1 \cap C_2 \cap \cdots \cap C_k

and each CiC_i is convex, then CC is convex.

Example

C={x:x10}{x:x20}C = \{x : x_1 \ge 0\} \cap \{x : x_2 \ge 0\}

This is the first quadrant — convex ✔


5. Norm-Based Identification

Rule

Sets defined using norms are convex.

{x:xr}\{x : \|x\| \le r\}

Examples

  • 2\ell_2 ball (circle/sphere)

  • 1\ell_1 ball (diamond shape)

  • \ell_\infty ball (square)

✔ All are convex


6. Sublevel Set Test

Rule

If f(x)f(x) is a convex function, then the set

{x:f(x)α}\{x : f(x) \le \alpha\}

is convex.

Example

f(x)=x12+x22{x:x12+x221}f(x) = x_1^2 + x_2^2 \Rightarrow \{x : x_1^2 + x_2^2 \le 1\}

✔ Convex


7. Affine Transformation Rule

Rule

If CC is convex and

T(x)=Ax+bT(x) = Ax + b

then T(C)T(C) is convex.

Example

A rotated or shifted circle remains convex.


8. Common Non-Convex Warning Signs

A set is likely non-convex if it involves:

  • Products of variables (xyxy)

  • Ratios of variables (x/yx/y)

  • Discrete choices

  • Equality constraints on curved boundaries only

Example

{x:x2+y2=1}\{x : x^2 + y^2 = 1\}

✘ Non-convex


Summary Table

MethodWhen to UseResult
Line segment test        Formal proof            Exact
Shape intuition        2D/3D geometry            Fast
Linear constraints        Optimization problems            Convex
Norm sets        Regularization            Convex
Sublevel sets        Function-based            Convex
Product constraints        Warning sign            Usually non-convex

Key Message for Students

Always identify convexity before solving an optimization problem.

Convex sets make problems solvable, stable, and predictable.


 Example

Question

Prove that the set

C={(x1,x2)R2:2x1+3x2=7}C = \{(x_1, x_2) \in \mathbb{R}^2 : 2x_1 + 3x_2 = 7\}

is a convex set.


Solution

To prove that CC is convex, we use the definition of a convex set.

A set CR2C \subseteq \mathbb{R}^2 is convex if for any two points
(x1(1),x2(1))C(x_1^{(1)}, x_2^{(1)}) \in C and (x1(2),x2(2))C(x_1^{(2)}, x_2^{(2)}) \in C, and for any
λ[0,1],

λ(x1(1),x2(1))+(1λ)(x1(2),x2(2))C.\lambda (x_1^{(1)}, x_2^{(1)}) + (1 - \lambda)(x_1^{(2)}, x_2^{(2)}) \in C.

Let

(x1(1),x2(1)), (x1(2),x2(2))C.(x_1^{(1)}, x_2^{(1)}),\ (x_1^{(2)}, x_2^{(2)}) \in C.

Then, by definition of CC,

2x1(1)+3x2(1)=7and2x1(2)+3x2(2)=7.2x_1^{(1)} + 3x_2^{(1)} = 7 \quad \text{and} \quad 2x_1^{(2)} + 3x_2^{(2)} = 7.

Consider the convex combination

(x1,x2)=λ(x1(1),x2(1))+(1λ)(x1(2),x2(2)),λ[0,1].(x_1, x_2) = \lambda (x_1^{(1)}, x_2^{(1)}) + (1 - \lambda)(x_1^{(2)}, x_2^{(2)}), \quad \lambda \in [0,1].

That is,

x1=λx1(1)+(1λ)x1(2),x2=λx2(1)+(1λ)x2(2).x_1 = \lambda x_1^{(1)} + (1 - \lambda)x_1^{(2)}, \quad x_2 = \lambda x_2^{(1)} + (1 - \lambda)x_2^{(2)}.

Now,

2x1+3x2=2[λx1(1)+(1λ)x1(2)]+3[λx2(1)+(1λ)x2(2)]=λ(2x1(1)+3x2(1))+(1λ)(2x1(2)+3x2(2))=λ(7)+(1λ)(7)=7.\begin{aligned} 2x_1 + 3x_2 &= 2[\lambda x_1^{(1)} + (1 - \lambda)x_1^{(2)}] + 3[\lambda x_2^{(1)} + (1 - \lambda)x_2^{(2)}] \\ &= \lambda (2x_1^{(1)} + 3x_2^{(1)}) + (1 - \lambda)(2x_1^{(2)} + 3x_2^{(2)}) \\ &= \lambda(7) + (1 - \lambda)(7) \\ &= 7. \end{aligned}

Thus, (x1,x2)C.


Conclusion

Since every convex combination of points in CC also belongs to CC,

C is a convex set.\boxed{C \text{ is a convex set.}}

Comments

Popular posts from this blog

Advanced Mathematics for Computer Science HNCST409 KTU BTech Honors 2024 Scheme

AKS Primality Testing

Galois Field and Operations