H. E. Krogstad, TMA 4180 Optimeringsteori KARUSH-KUHN-TUCKER THEOREM
KKT条件在处理有约束问题的时候很有用, 但是对KKT的适用性一直不是很理解, 看了这篇讲解整理一下.
基本内容
问题
min
x
∈
Ω
f
(
x
)
,
(1)
\tag{1} \min_{x \in \Omega} f(x),
x∈Ωminf(x),(1)
在等式约束条件:
c
i
(
x
)
=
0
,
i
∈
ξ
,
(2)
\tag{2} c_i(x) = 0, i \in \xi,
ci(x)=0,i∈ξ,(2)
及不等约束条件:
c
i
(
x
)
≥
0
,
i
∈
I
.
(3)
\tag{3} c_i(x) \ge 0, i \in \mathcal{I}.
ci(x)≥0,i∈I.(3)
不妨就记
Ω
=
{
x
:
c
i
(
x
)
=
0
,
i
∈
ξ
,
c
i
(
x
)
≥
0
,
i
∈
I
}
.
\Omega = \{x: c_i(x) = 0, i \in \xi, c_i(x)\ge 0, i \in \mathcal{I}\}.
Ω={x:ci(x)=0,i∈ξ,ci(x)≥0,i∈I}.
在不等式约束中, 即只有当我们所寻的极值点
x
∗
x^*
x∗处,
c
i
(
x
∗
)
=
0
,
i
∈
I
c_i(x^*)=0, i \in \mathcal{I}
ci(x∗)=0,i∈I称之为激活不等式约束(active inequality constraints), 否则为不激活的, 我们记激活的不等式约束和等式约束为
A
\mathcal{A}
A.
注: 均连续可微.
对于任意一个可行点
x
0
x_0
x0, 令
x
(
t
)
,
t
≥
0
x(t), t\ge 0
x(t),t≥0为一连续路径, 满足
t
→
0
,
x
(
t
)
→
x
0
t\rightarrow 0, x(t) \rightarrow x_0
t→0,x(t)→x0,定义
d
d
d为:
x
(
t
)
−
x
0
∥
x
(
t
)
−
x
0
∥
→
t
→
0
d
∥
d
∥
.
\frac{x(t) - x_0}{\|x(t)-x_0\|} \mathop{\rightarrow } \limits_{t \rightarrow 0} \frac{d}{\|d\|}.
∥x(t)−x0∥x(t)−x0t→0→∥d∥d.
有如下性质:
∇
c
i
(
x
)
d
=
0
,
i
∈
ξ
∇
c
i
(
x
)
d
≥
0
,
i
∈
I
∩
A
,
(8,9)
\tag{8,9} \nabla c_i(x) d = 0, i \in \xi \\ \nabla c_i(x) d \ge 0, i \in \mathcal{I \cap A},
∇ci(x)d=0,i∈ξ∇ci(x)d≥0,i∈I∩A,(8,9)
其中, 我们假设梯度向量为行向量.
证明:
c
i
(
x
(
t
)
)
−
c
i
(
x
0
)
=
∇
c
i
(
x
0
)
(
x
(
t
)
−
x
0
)
+
o
(
∥
x
(
t
)
−
x
0
∥
)
=
0
,
i
∈
ξ
c_i(x(t)) - c_i(x_0) = \nabla c_i(x_0)(x(t)-x_0) + o(\|x(t)-x_0\|) = 0, i \in \xi
ci(x(t))−ci(x0)=∇ci(x0)(x(t)−x0)+o(∥x(t)−x0∥)=0,i∈ξ
两边同除以
∥
x
(
t
)
−
x
0
∥
\|x(t)-x_0\|
∥x(t)−x0∥, 并令
t
→
0
t \rightarrow 0
t→0即可得.
c
i
(
x
(
t
)
)
−
c
i
(
x
0
)
=
∇
c
i
(
x
0
)
(
x
(
t
)
−
x
0
)
+
o
(
∥
x
(
t
)
−
x
0
∥
)
=
c
i
(
x
(
t
)
)
≥
0
,
i
∈
I
∩
A
c_i(x(t)) - c_i(x_0) = \nabla c_i(x_0)(x(t)-x_0) + o(\|x(t)-x_0\|) = c_i(x(t)) \ge 0, i \in \mathcal{I \cap A}
ci(x(t))−ci(x0)=∇ci(x0)(x(t)−x0)+o(∥x(t)−x0∥)=ci(x(t))≥0,i∈I∩A
与上面同样的操作即可得.
我们把这些由路径引导出来的可行方向
d
d
d的集合记为
T
(
x
)
=
{
d
:
d
f
e
a
s
i
b
l
e
d
i
r
e
c
t
i
o
n
o
u
t
f
r
o
m
x
}
.
(10)
\tag{10} \mathcal{T}(x) = \{d: d \: feasible \: di rection \: out \: from \: x\}.
T(x)={d:dfeasibledirectionoutfromx}.(10)
而记满足
(
8
,
9
)
(8, 9)
(8,9)的一切
d
d
d的集合记为
F
(
x
)
\mathcal{F}(x)
F(x), 显然
T
(
x
)
⊂
F
(
x
)
\mathcal{T}(x) \subset \mathcal{F}(x)
T(x)⊂F(x), 且均为锥(即
d
d
d属于此集合, 则
α
d
,
α
>
0
\alpha d, \alpha > 0
αd,α>0也属于此集合).
LICQ 假设
点
x
0
x_0
x0满足LICQ假设, 当
{
∇
c
i
(
x
0
)
}
,
i
∈
A
,
(14)
\tag{14} \{\nabla c_i(x_0)\}, i \in \mathcal{A},
{∇ci(x0)},i∈A,(14)
是线性独立的.
线性不独立: 当集合中存在一个向量能够由其他向量线性表出, 否则称此集合线性独立. 显然这是比线性无关更强的一个概念.
KKT 定理
假设
x
∗
x^*
x∗是问题(1)在等式约束(2)以及不等式约束(3)的限制下的局部最小值点, 且满足LICQ假设. 则存在
λ
i
∗
\lambda_i^*
λi∗满足:
∇
f
(
x
∗
)
=
∑
i
∈
ξ
∪
I
λ
i
∗
∇
c
i
(
x
∗
)
,
(17)
\tag{17} \nabla f(x^*) = \sum_{i \in \xi \cup \mathcal{I}} \lambda_i^* \nabla c_i(x^*),
∇f(x∗)=i∈ξ∪I∑λi∗∇ci(x∗),(17)
且
(
i
)
λ
i
∗
⋅
c
i
(
x
∗
)
=
0
,
i
∈
ξ
∪
I
,
(
i
i
)
λ
i
∗
≥
0
,
i
∈
I
.
(18)
\tag{18} \begin{array}{lc} (i) & \lambda_i^* \cdot c_i(x^*) = 0, i \in \xi \cup \mathcal{I}, \\ (ii) & \lambda_i^* \ge 0, i \in \mathcal{I}. \end{array}
(i)(ii)λi∗⋅ci(x∗)=0,i∈ξ∪I,λi∗≥0,i∈I.(18)
KKT定理的证明
记:
A
=
[
∇
c
1
(
x
)
⋮
∇
c
m
(
x
)
]
A = \left [ \begin{array}{c} \nabla c_1(x) \\ \vdots \\ \nabla c_m(x) \end{array} \right ]
A=⎣⎢⎡∇c1(x)⋮∇cm(x)⎦⎥⎤
属于
A
\mathcal{A}
A的所有
c
i
c_i
ci的梯度的综合表示,
c
(
x
)
=
[
c
1
(
x
)
,
…
,
c
m
(
x
)
]
T
.
c(x) = [c_1(x), \ldots, c_m(x)]^T.
c(x)=[c1(x),…,cm(x)]T.
引理A
引理A: 当 x ∈ R n x \in \R^n x∈Rn满足LICQ假设, 则 T ( x ) = F ( x ) \mathcal{T}(x) = \mathcal{F}(x) T(x)=F(x).
证明:
既然
T
(
x
)
⊂
F
(
x
)
\mathcal{T}(x) \subset \mathcal{F}(x)
T(x)⊂F(x), 我们只需要证明
F
(
x
)
⊂
T
(
x
)
\mathcal{F}(x) \subset \mathcal{T}(x)
F(x)⊂T(x).
下面, ∀ d ∈ F ( x ) \forall d \in \mathcal{F}(x) ∀d∈F(x), 我们将构造 y ( t ) , t ≥ 0 y(t), t \ge 0 y(t),t≥0, 为一连续的起点为 y ( 0 ) = x y(0)=x y(0)=x的路径, 且在 x x x的足够小的一个邻域内 y ( t ) y(t) y(t)满足等式约束和不等式约束, 一旦找到这样的 y ( t ) y(t) y(t), 证明也就完成了.
根据假设可知, dim(
A
A
A) =
m
m
m, 则
A
A
A的核的维数为
d
i
m
(
N
(
A
)
)
=
n
−
m
dim(N(A))=n-m
dim(N(A))=n−m, 我们从核空间中抽取一组基作为行向量构建
Z
′
Z'
Z′, 则
[
A
Z
′
]
(24)
\tag{24} \left [ \begin{array}{c} A \\ Z' \end{array} \right ]
[AZ′](24)
是一个非奇异的
n
×
n
n\times n
n×n的方阵.
考虑如下的非线性方程系统(显然有解
t
=
0
,
y
=
x
t=0,y=x
t=0,y=x)
R
(
y
,
t
)
=
[
c
(
y
)
−
t
A
d
Z
′
(
y
−
x
−
t
d
)
]
=
0.
(25)
\tag{25} R(y, t) = \left [ \begin{array}{c} c(y) - tAd \\ Z'(y - x -td) \end{array} \right ] = 0.
R(y,t)=[c(y)−tAdZ′(y−x−td)]=0.(25)
关于
y
y
y的加科比行列式为
∂
R
∂
y
∣
t
=
0
=
[
A
Z
′
]
,
(26)
\tag{26} \frac{\partial R}{\partial y} |_{t=0} = \left [ \begin{array}{c} A \\ Z' \end{array} \right ],
∂y∂R∣t=0=[AZ′],(26)
非奇异, 所以根据隐函数定理可知, 在
t
t
t足够小的时候, 存在连续可微函数
y
(
t
)
y(t)
y(t), 且
y
(
0
)
=
x
y(0)=x
y(0)=x.
既然
c
(
y
)
=
c
(
x
)
+
∇
c
(
x
)
(
y
−
x
)
+
o
(
∥
y
−
x
∥
)
=
A
(
y
−
x
)
+
o
(
∥
y
−
x
∥
)
,
(27)
\tag{27} c(y)=c(x) + \nabla c(x)(y-x) + o(\|y-x\|) = A(y-x)+o(\|y-x\|),
c(y)=c(x)+∇c(x)(y−x)+o(∥y−x∥)=A(y−x)+o(∥y−x∥),(27)
我们有
0
=
R
(
y
(
t
)
,
t
)
=
[
A
Z
′
]
(
y
(
t
)
−
x
−
t
d
)
+
o
(
∥
y
(
t
)
−
x
∥
)
.
(28)
\tag{28} 0=R(y(t),t) = \left [ \begin{array}{c} A \\ Z' \end{array} \right ] (y(t)-x-td) + o(\|y(t)-x\|).
0=R(y(t),t)=[AZ′](y(t)−x−td)+o(∥y(t)−x∥).(28)
也就是说
y
(
t
)
−
x
=
t
d
+
o
(
∥
y
(
t
)
−
x
∥
)
,
(29)
\tag{29} y(t)-x=td+o(\|y(t)-x\|),
y(t)−x=td+o(∥y(t)−x∥),(29)
俩边令
t
→
0
t \rightarrow 0
t→0, 可知
y
(
t
)
y(t)
y(t)为
d
d
d的一个连续路径.
又结合(25)
c
(
y
(
t
)
)
−
t
A
d
=
0
,
(30)
\tag{30} c(y(t))-tAd=0,
c(y(t))−tAd=0,(30)
c
i
(
y
(
t
)
)
=
t
∇
c
i
(
x
)
d
=
{
0
,
i
∈
ξ
≥
0
,
i
∈
I
∩
A
.
(31)
\tag{31} c_i(y(t))=t\nabla c_i(x)d = \left \{ \begin{array}{ll} 0, & i \in \xi \\ \ge 0 , & i \in \mathcal{I \cap A} . \end{array} \right .
ci(y(t))=t∇ci(x)d={0,≥0,i∈ξi∈I∩A.(31)
所以对于任意的
i
∈
A
i \in \mathcal{A}
i∈A,
y
(
t
)
y(t)
y(t)是可行路径, 对于未激活的不等式约束, 既然
y
(
t
)
y(t)
y(t)是连续的, 当
t
t
t足够效地时候容易得到
c
i
(
y
(
t
)
)
>
0
,
i
∈
I
,
i
∉
A
c_i(y(t)) > 0, i \in \mathcal{I}, i \not \in \mathcal{A}
ci(y(t))>0,i∈I,i∈A. 这样便证明了,
∀
d
∈
F
(
x
)
\forall d \in \mathcal{F}(x)
∀d∈F(x), 均为可行方向, 故
F
(
x
)
=
T
(
x
)
\mathcal{F}(x) =\mathcal{T}(x)
F(x)=T(x).
Farkas 引理
Farkas 引理: 令
g
g
g和
{
a
i
}
i
=
1
m
\{a_i\}_{i=1}^m
{ai}i=1m为
n
n
n维行向量且
S
=
{
d
∈
R
n
;
g
d
<
0
,
a
i
d
≥
0
,
i
=
1
,
…
,
m
}
,
(33)
\tag{33} \mathcal{S} = \{ d \in \mathbb{R}^n; gd<0 , a_id \ge 0, i=1, \ldots, m\},
S={d∈Rn;gd<0,aid≥0,i=1,…,m},(33)
则
S
=
∅
\mathcal{S} = \empty
S=∅当且仅当存在非负向量
λ
∈
R
m
\lambda \in \mathbb{R}^m
λ∈Rm 使得
g
=
∑
i
=
1
m
λ
i
a
i
.
(34)
\tag{34} g = \sum_{i=1}^m \lambda_i a_i.
g=i=1∑mλiai.(34)
证明:
⇐ \Leftarrow ⇐
∀
d
∈
S
\forall d \in \mathcal{S}
∀d∈S,
0
>
g
d
=
∑
i
=
1
m
λ
i
a
i
d
≥
0
,
0 > gd = \sum_{i=1}^m \lambda_i a_id \ge 0,
0>gd=i=1∑mλiaid≥0,
故
S
=
∅
\mathcal{S} = \empty
S=∅.
⇒ \Rightarrow ⇒
若不存在这样的
λ
\lambda
λ, 即对于任意的
λ
\lambda
λ,
g
≠
∑
i
=
1
m
λ
i
a
i
g \not =\sum_{i=1}^m \lambda_i a_i
g=∑i=1mλiai, 则
g
g
g不能由
{
a
i
}
\{a_i\}
{ai}线性表出. 不妨假设
{
a
i
}
\{a_i\}
{ai}与
g
g
g按序进行施密特正交化过程, 可得
{
a
^
i
}
\{\hat{a}_i\}
{a^i}为
{
a
i
}
\{a_i\}
{ai}的一正交向量组,
h
h
h为
h
=
g
−
∑
i
⟨
g
,
a
^
i
⟩
a
^
i
,
h = g- \sum_i \langle g,\hat{a}_i\rangle \hat{a}_i,
h=g−i∑⟨g,a^i⟩a^i,
则
⟨
h
,
a
i
⟩
=
0
,
⟨
h
,
g
⟩
=
l
≠
0.
\langle h, a_i \rangle = 0, \\ \langle h, g \rangle = l \not = 0.
⟨h,ai⟩=0,⟨h,g⟩=l=0.
不妨设
l
<
0
l<0
l<0(否则
h
=
−
h
h=-h
h=−h), 则
h
∈
S
h \in \mathcal{S}
h∈S, 这与
S
=
∅
\mathcal{S} = \empty
S=∅矛盾.
证毕.
定义问题
P
\mathcal{P}
P:
g
d
<
0
,
A
d
≥
0.
(36)
\tag{36} gd < 0, \\ Ad \ge 0.
gd<0,Ad≥0.(36)
定义问题
D
\mathcal{D}
D:
g
=
λ
T
A
,
λ
≥
0.
(37)
\tag{37} g = \lambda^T A, \lambda \ge 0.
g=λTA,λ≥0.(37)
推论
推论: 要么问题 P \mathcal{P} P存在解, 要么 D \mathcal{D} D存在解, 二者不能同时成立.
KKT定理的证明
既然
x
∗
x^*
x∗是一局部极值点, 则
∇
f
(
x
∗
)
d
≥
0
,
∀
d
∈
T
(
x
∗
)
=
F
(
x
∗
)
,
(38)
\tag{38} \nabla f(x^*) d \ge 0, \forall d \in \mathcal{T} (x^*) =\mathcal{F}(x^*),
∇f(x∗)d≥0,∀d∈T(x∗)=F(x∗),(38)
将
∇
f
(
x
∗
)
\nabla f(x^*)
∇f(x∗)视作Farkas引理中的
g
g
g,
A
A
A即为我们最开始定义的
A
A
A, 则
∀
A
d
≥
0
\forall Ad \ge 0
∀Ad≥0,
d
∈
F
(
x
)
d \in \mathcal{F}(x)
d∈F(x), 这是因为所有等式约束
c
i
(
x
)
=
0
c_i(x)=0
ci(x)=0, 都可以变成俩个不等式约束
c
i
(
x
)
≥
0
,
−
c
i
(
x
)
≥
0
c_i(x)\ge0, -c_i(x) \ge 0
ci(x)≥0,−ci(x)≥0. 这也就是说, 问题
P
\mathcal{P}
P无解, 则
D
\mathcal{D}
D有解, 即存在
λ
∗
≥
0
\lambda^* \ge 0
λ∗≥0:
∇
f
(
x
∗
)
=
∑
λ
i
∗
∇
c
i
(
x
∗
)
,
λ
i
∗
≥
0.
(39)
\tag{39} \nabla f(x^*) = \sum \lambda_i^* \nabla c_i(x^*), \lambda_i^* \ge 0.
∇f(x∗)=∑λi∗∇ci(x∗),λi∗≥0.(39)
对于任意的
i
∉
A
i \not \in \mathcal{A}
i∈A, 我们只需取
λ
i
∗
=
0
\lambda_i^*=0
λi∗=0, (39)依然成立, 同时原定理(18)中的(i)(ii)也同样容易证明.