The functioni $f:\mathbb{R}^{n} \to \mathbb{R}$ is convex, $a \in \mathbb{R}^{n}$ and $b \in \mathbb{R}$. I need to check whether the set $$ \mathcal{B} = \{ x \in \mathbb{R}^{n}: f(x) = 0, \, \langle a,x \rangle \leq b, \, x \geq 0 \} $$
is convex. If it is, I need to provide appropriate argumentation, and if it is not, I need to exhibit a counterexample.
My approach was to consider, for $x,y \in \mathcal{B}$, the linear combination $\lambda x + (1-\lambda)y$ where $0<\lambda < 1$.
Then, since $f$ is convex, $f(\lambda x + (1-\lambda)y) \leq \lambda f(x) + (1-\lambda)f(y) \leq 0$, since $f(x) \leq 0$, $f(y) \leq 0$, and $\lambda$ and $1-\lambda$ are both positive.
However, In order to show that $\lambda x + (1-\lambda)y \in \mathcal{B}$, I need to show that $f(\lambda x + (1-\lambda)y) = 0$ and not is simply $\leq 0$.
There is nothing I know in general about convex functions that would guarantee to me that I would also have $f(\lambda x + (1-\lambda) y ) \geq 0$, which would give me what I need. Therefore, I suspect that $\mathcal{B}$ is not convex.
To that end, I would need to exhibit a convex function from $\mathbb{R}^{n} \to \mathbb{R}$ where even though $f(x) = 0$ and $f(y) = 0$, $f(\lambda x + (1-\lambda)y) < 0$. But, I cannot think of one.
I considered the quadratic form $f(x) = x^{T}Qx + c^{T}x + d$ and tried to show that $$f(\lambda x + (1-\lambda)y) = (\lambda x + (1-\lambda)y)^{T}Q (\lambda x + (1-\lambda)y) + c^{T}(\lambda x + (1-\lambda)y) + d < 0$$ where $Q$ is an $n \times n$ matrix, $c$ is a vector in $\mathbb{R}^{n}$ and $d$ is a constant by first looking at it in the case where $n = 2$.
However, when I did that, I found that the operation $(\lambda x + (1-\lambda)y)^{T}Q (\lambda x + (1-\lambda) y)$ is undefined, since $(\lambda x + (1-\lambda)y)$ is $1 \times 2$, its transpose is $2 \times 1$ and $Q$ is $2 \times 2$. Unless I am doing something wrong here?
Could somebody please help me figure out what I'm doing wrong and how to finish this problem?
Thank you.
Consider $f: \Bbb R^2\to \Bbb R$ as $f(x_1,x_2)=x_1^2+x_2^2-\frac{1}{4}.$ Obviously, $f$ is convex. Put $a= (1,1)^T$ and $b=1.$ Then, your set is
$$\mathcal{B}= \{x\in \Bbb R^2: x_1^2+x_2^2=\frac{1}{4},\; x_1+x_2\leq 1,\; x\geq 0\},$$ which is just the arc of the circunference with center at the origin and radius $\frac{1}{2}$ with positive components. This set is obviously nonconvex.
Hope this helps