# Set is Convex regardless of b

Let the function $f$ be convex, $f :\Bbb R^n \rightarrow \Bbb R$ and let $$S = \{x : f(x) \le b\}$$

The proposition states that the set $S$ is convex regardless of $b$. Can someone explain to me how this proposition holds for all $b$?

-
For $x$ and $y\in S$ and $0\le \lambda \le 1$ , one has $f(\lambda x + (1-\lambda)y)\le \lambda f(x) + (1-\lambda)f(y)$ since $f$ is convex. What can you conclude from here? – vnd Feb 9 at 11:39

Let $x, y \in S$. Then by definition of a convex set, you need to show that the points $λx+(1-λ)y$ are in $S$ for any $λ\in[0,1]$. So, by definition of $S$ you need to show that $f(λx+(1-λ)y)\le b$. Since, the function $f$ is convex you have that $$f(λx+(1-λ)y)\overset{f\text{ convex}}\le λf(x)+(1-λ)f(y)\overset{x,y\in S}\le λb+(1-λ)b=b$$

-
Thanks for the answering the question! I have a clearer picture now. – Duck Feb 9 at 11:59

Fix $b$ any real number, then study $S$ (with $b$ fixed).

1. If it is empty, it is convex,
2. Otherwise, if $x,y \in S$, and $\mu \in [0,1]$, then what about $\mu x + (1-\mu) y$ ? Just compute $f(\mu x + (1-\mu) y) <= \mu f(x) + (1-\mu)f(y)$ by convexity of $f$, and then because $x,y\in S$, $f(x),f(y) \leq b$ (by definition). So $\mu f(x) + (1-\mu)f(y) \leq \mu b + (1-\mu) b = b$.

So regardless of the actual value for $b\in\mathbb{R}$, $S$ is convex (but $b$ is fixed).

-