# How to show a set is convex

Looking for a hint on show to show convexity in a set....

Let $f\colon \mathbb{R}^n \rightarrow \mathbb{R}$ be a convex function and let $c$ be some constant.

Show that the set $s=\{x \in \mathbb{R}^n \mid f(x) \le c \}$ is convex.

-
Sorry for the editing confusion. I realise I don't know how latex works here. –  Rasmus Sep 30 '10 at 18:08

## 1 Answer

Hint: Well, just write down a convex combination of elements in s and verify that it belong to s. You will find the convexity of f useful for this.

-
Note: I didn't answer the question completely since it could be homework and since the OP asked for a hint. I hope that it is appropriate to post this as an answer. –  Rasmus Sep 29 '10 at 17:15
So every point in between points of the set can be written as: a1x1 + a2x2 + ...anxn where every ai >= 0 and the sum of the a values is 1. How can it be shown this belongs to s? –  GBa Sep 29 '10 at 21:10
@Greg: What does it mean to belong to s? –  Rasmus Sep 30 '10 at 8:49
if an element is in s then f (λx1 + (1 − λ)x2 ) ≤ λf (x1 ) + (1 − λ)f (x2 ) which is ≤ c .... I'm just confused how c fits in with this problem. –  GBa Sep 30 '10 at 16:56
@Greg: there you have the proof: if x1 and x2 are in s then the line segment they define is totally contained in s, and so s is convex, by definition. –  lhf Sep 30 '10 at 18:17