I am now trying to solve the question that proving $$f(x,y) = |xy| + a(x^2 + y^2) \text{ is convex if and only if } a \ge 1/2$$ Proof of that $f(x,y) = |xy| + a(x^2 + y^2)$ is convex when $a \ge 1/2$ is provided in another question. I have tried to code some program for visualizing the convexity on some line $y=kx+b$ of function $f(x,y)$ which has the same convexity of the $f(x,y)$. But the plot I draw all seems to have the convexity so far. I am also wondering what is the usual way to prove that a function is not convex.
Asked
Active
Viewed 72 times
0
-
do you have the definfition of convex in your mind? – Dr. Sonnhard Graubner Mar 18 '18 at 11:53
-
@Dr.SonnhardGraubner I think it should be $f(\lambda x + (1 - \lambda) y) \le \lambda f(x) + (1 - \lambda) f(y) \quad \forall \lambda \in [0,1], x,y\in \text{dom} f$ – david Mar 18 '18 at 12:00
-
But in the other threed was proved that your function is convex for $a\geq \frac{1}{2}$ – Dr. Sonnhard Graubner Mar 18 '18 at 12:12
-
By the way that is not the definition of a convex function as the argument of the function is (x,y). A convex combination is of the form $(tx_1+(1-t)x_2,ty_1+(1-t)y_2)$. – Keen-ameteur Mar 18 '18 at 12:15
-
@Dr.SonnhardGraubner In the other thread the if part was proved but not the only if part. I think to prove the only if part we need to prove that $f$ is not convex for $a < 1/2$. – david Mar 18 '18 at 12:17
-
@Keen-ameteur Well, I mean $x,y$ are actually vectors. So maybe the following will look nicer. $f(\lambda \mathbf{x} + (1 - \lambda) \mathbf{y}) \le \lambda f(\mathbf{x}) + (1 - \lambda) f(\mathbf{y}) \quad \forall \lambda \in [0,1], \mathbf{x},\mathbf{y}\in \text{dom} f$ – david Mar 18 '18 at 12:19
-
I thought this might be a cause why you were not succesful. Never mind my comment then. – Keen-ameteur Mar 18 '18 at 12:22
1 Answers
2
If $f(x,y)$ is convex so it must be that $$f(\lambda(1,0)+(1-\lambda)(0,1))\le\lambda f(1,0)+(1-\lambda)f(0,1)$$or$$\lambda(1-\lambda)+a(\lambda^2+(1-\lambda)^2)\le a$$which leads to $$a\ge \dfrac{1}{2}$$so this constraint is necessary. Next we prove that this is also sufficient. If $a\ge \dfrac{1}{2}$ we have$$f(x,y)=(a-\dfrac{1}{2})(x^2+y^2)+\dfrac{1}{2}(|x|+|y|)^2$$which is convex since both $(a-\dfrac{1}{2})(x^2+y^2)$ and $\dfrac{1}{2}(|x|+|y|)^2$ are convex and summation of two convex functions always is a convex function. So the condition $a\ge\dfrac{1}{2}$ is necessary and sufficient.
Here is a sketch for $a=\dfrac{1}{2}$
Mostafa Ayaz
- 31,924
-
What is the intuition that you check the convexity of $f$ on points $(0, 1)$ and $(1, 0)$? – david Mar 18 '18 at 12:43
-
If a 3D function is convex so must be any projection of it on straight lines. – Mostafa Ayaz Mar 18 '18 at 12:47
-
I think the plot you added provides a intuition that we should check the convexity on $(1, 0)$ and $(0, 1)$ as the contour of the function looks like diamond. So maybe the line $(1,0)$ and $(0,1)$ are critical points. – david Mar 18 '18 at 12:59
-
In other words, the definition of convexity in 3D is $$f(\lambda_1x_1+\lambda_2x_2+(1-\lambda_1-\lambda_2)x_3,\lambda_1y_1+\lambda_2y_2+(1-\lambda_1-\lambda_2)y_3)\le\lambda_1f(x_1,y_1)+\lambda_2f(x_2,y_2)+(1-\lambda_1-\lambda_2)f(x_3,y_3)$$and i took $(x_1,y_1)=(1,0)$ and $(x_2,y_2)=(x_3,y_3)=(0,1)$ – Mostafa Ayaz Mar 18 '18 at 13:02
