Examples of convex sets
A set $K \subset \mathbb{R}^n$ is called convex if for each $x,y \in K$ and for each $0 \leq \lambda \leq 1$, $(1- \lambda)x+ \lambda y \in K$.
$$D=\{ (x_1, x_2): x_1^2+x_2^2<1 \}$$
$$D \cup \{ A \} \cup \{ B \} \Rightarrow \text{ it is convex, but it is neither closed nor open }$$
$$A=(a_1, a_2), B=(b_1, b_2)$$
$D$ is convex because either we take two inner points or we take the point $A$ with the point $B$ or an inner point with the point $A$ or $B$, the line that connects these points is in the inner of the circle or at the part that connects $A$ with $B$, right?
Also, it holds that $(0,1]$ is convex, but neither open nor closed.
To show that it is convex , we have to show that for any $0 \leq \lambda \leq 1, x, y \in (0,1]$ we have $0< (1- \lambda) x+ \lambda y \leq 1$, right?
$1- \lambda \geq 0 \Rightarrow (1- \lambda) x \geq 0 $
$\lambda \geq 0 \Rightarrow \lambda y \geq 0$
$\Rightarrow (1- \lambda) x+ \lambda y \geq 0$
$\lambda y \leq y \leq 1$
$(1- \lambda) x \leq 1- \lambda$
$\Rightarrow (1- \lambda) x+ \lambda y \leq 2- \lambda \leq 2$
How can we show that $(1- \lambda) x+ \lambda y \leq 1$ ?
Also is it neither open nor closed because at the left side we have $($ and at the right $]$ ?
$\endgroup$2 Answers
$\begingroup$You are right about why the set are neither open nor closed. For the inequality, you have immediately \begin{equation} (1- \lambda) x+ \lambda y \le 1-\lambda+\lambda\le1, \end{equation} having used that $x,y\le1$
$\endgroup$ 4 $\begingroup$$$||(1- \lambda) x+ \lambda y||\leq ||\lambda y||+||(1-\lambda)x||=\lambda||y||+(1-\lambda)||x||< \lambda+(1-\lambda)=1$$
Note $x$ and $y$ are $\color{red}{ vectors} $. It does not mean $(1- \lambda) x+ \lambda y\leq 1$.
$\endgroup$