凸函数的定义:
一个凸集内的任意两个点x1与x2,任意 θ∈[0,1]⇒f(θ x1+(1−θ )x2)≤θ f(x1)+(1−θ )f(x2)一个凸集内的任意两个点 x_1 与 x_2,任意~ \theta\in[0, 1]\Rightarrow f(\theta~x_1+(1-\theta~)x_2)\leq \theta~f(x_1)+(1-\theta~)f(x_2)一个凸集内的任意两个点x1与x2,任意 θ∈[0,1]⇒f(θ x1+(1−θ )x2)≤θ f(x1)+(1−θ )f(x2)
或者微积分定义:
f(x1)≥f(x2)+(x1−x2)f′(x2)f(x_1)\geq f(x_2)+(x_1-x_2)f'(x_2) f(x1)≥f(x2)+(x1−x2)f′(x2)
我之前一直忽略了一个重要性质:
若f(x)与g(x)都是凸函数,则h(x)=max{f(x),g(x)}也是凸函数。若 f(x) 与 g(x) 都是凸函数,则 h(x)=\max\{f(x), g(x)\} 也是凸函数。若f(x)与g(x)都是凸函数,则h(x)=max{f(x),g(x)}也是凸函数。
证明方法为分情况讨论。也可以按照下面的思路
证明:
f(θ x1+(1−θ )x2)≤θ f(x1)+(1−θ )f(x2)≤θ h(x1)+(1−θ )h(x2)\begin{aligned} f(\theta~x_1+(1-\theta~)x_2)\leq &\theta~f(x_1)+(1-\theta~)f(x_2)\\ \leq &\theta~h(x_1)+(1-\theta~)h(x_2) \end{aligned}f(θ x1+(1−θ )x2)≤≤θ f(x1)+(1−θ )f(x2)θ h(x1)+(1−θ )h(x2)
g(θ x1+(1−θ )x2)≤θ g(x1)+(1−θ )g(x2)≤θ h(x1)+(1−θ )h(x2)\begin{aligned} g(\theta~x_1+(1-\theta~)x_2)&\leq \theta~g(x_1)+(1-\theta~)g(x_2)\\ &\leq \theta~h(x_1)+(1-\theta~)h(x_2)\\ \end{aligned}g(θ x1+(1−θ )x2)≤θ g(x1)+(1−θ )g(x2)≤θ h(x1)+(1−θ )h(x2)
⇓h(θ x1+(1−θ )x2)=max{f(θ x1+(1−θ )x2),g(θ x1+(1−θ )x2)}≤θ h(x1)+(1−θ )h(x2) □ \begin{aligned} \Downarrow&\\ h(\theta~x_1+(1-\theta~)x_2)&=\max\big\{f(\theta~x_1+(1-\theta~)x_2), g(\theta~x_1+(1-\theta~)x_2)\big\}\\ &\leq \theta~h(x_1)+(1-\theta~)h(x_2) \qquad~~~~~~\Box \end{aligned} ⇓h(θ x1+(1−θ )x2)=max{f(θ x1+(1−θ )x2),g(θ x1+(1−θ )x2)}≤θ h(x1)+(1−θ )h(x2) □
按照这个性质,那么 max{f(x),0}\max\{f(x), 0\}max{f(x),0} 也是凸函数。