证明:A function is convex if and only if it is convex when restricted to any line...

Boyd Convex Optimization的第3章开头给出了凸函数的定义和一种判别方法,但没有证明过程,在此给出证明。
原文这样说的:A function is convex if and only if it is convex when restricted to any line that intersects its domain.这句话看不懂,其实后面还有 in other words,…
证明:A function is convex if and only if it is convex when restricted to any line...
证明:A function is convex if and only if it is convex when restricted to any line...

这里给凸函数两个判别方式:

  • 定义,对函数 f(x)f(x) ,满足下式时定义为凸函数:

f(θx+(1θ)y)θf(x)+(1θ)f(y)x,ydomf,0θ1 f(\theta x + (1-\theta)y) \le \theta f(x) + (1-\theta)f(y)\\ x, y \in dom f, 0\le\theta\le 1

  • 函数 g(t)g(t) 是凸函数与 f(x)f(x) 是凸函数等价:

g(t)=f(x+tv)dom g=tx+tvdomf g(t)=f(x+tv) \\ dom\ g={t|x+tv\in dom f}

Boyd 的 Convex Optimization没有给出证明,在此证明一下。

  1. 证明:如果 f(x)f(x) 为凸函数,则 g(t)g(t) 也为凸函数。

证明的思路就是,要证明哪个函数是凸函数,就在这个函数上取两点,利用已知条件和凸函数的定义,来证明之。这里就是在 g(t)g(t) 上取两点 t1,t2t_1, t_2,利用与 f(x)f(x) 是凸函数这个条件,证明 $g(\theta t_1 + (1-\theta)t_2) \le \theta g(t_1) + (1-\theta) g(t_2) $。

t1,t2dom gt_1, t_2 \in dom\ g
g(θt1+(1θ)t2)=f(x+(θt1+(1θ)t2)v)=f(θx+(1θ)x+(θt1+(1θ)t2)v)=f(θ(x+t1v)+(1θ)(x+t2v))θf(x+t1v)+(1θ)(x+t2v)=θg(t1)+(1θ)g(t2) \begin{aligned} g(\theta t_1+(1-\theta)t_2)&=f(x + (\theta t_1+(1-\theta)t_2)v) \\ &=f(\theta x+(1-\theta)x +(\theta t_1+(1-\theta)t_2)v)\\ &=f(\theta(x+t_1 v)+(1-\theta)(x+t_2 v)) \\ &\le \theta f(x+t_1 v) +(1-\theta)(x+t_2 v) \\ &=\theta g(t_1) + (1-\theta)g(t_2) \\ \end{aligned}
这样,就证明了了 g(t)g(t) 是凸函数。

其实证明过程中可以先写出 g(t1)=f(x+t1v)g(t_1)=f(x+t_1 v) 这样的式子,方便知道化简的方向。

  1. 证明:如果 g(t)g(t) 是凸函数,那么 f(x)f(x) 也是凸函数。

类似的,首先取 x1,x2domfx_1, x_2 \in dom f ,取 f(x)f(x) 中的 v=(x1x2)v=(x_1-x_2) ,这里不用担心 (x1x2)(x_1-x_2) 不在 domfdom f ,因为如果不在,下面的 θ\theta 就不能取。
f(θx1+(1θ)x2)=f(x2+θ(x1x2))=g(θ)=g(θ×1+(1θ)×0)θg(1)+(1θ)g(0)=θf(x1)+(1θ)f(x2)f(x1)=f(x2+1(x1x2))=g(1)f(x2)=f(x2+0(x1x2))=g(0) \begin{aligned} f(\theta x_1+(1-\theta)x_2)&=f(x_2 + \theta (x_1-x_2)) \\ &= g(\theta) \\ &= g(\theta \times 1+(1-\theta)\times0) \\ &\le \theta g(1) + (1-\theta)g(0)\\ &=\theta f(x_1)+(1-\theta)f(x_2) \end{aligned}\\ f(x_1) = f(x_2 + 1(x_1-x_2))=g(1)\\ f(x_2) = f(x_2 + 0(x_1-x_2))=g(0)\\
要一下子想到整个过程可能有点南,但只要抓住要证的结论,把结论中的各个项想办法转换成已知条件的项,然后用已知条件的性质来证明,最后再整理整个过程使之看起来比较顺畅。