逐步主鏈
S01 · definition
操作前
\text{find the best candidate}操作後
\min_{s\in S}f(s),\ \ \operatorname{argmin}=\{s^*\in S\mid \forall s\in S:\ f(s^*)\le f(s)\}條件:無
規則:mko_opt_def · 依賴:G1, G2, G3
葉節點依據:mko_opt_def + def_intro
依 MKO 寫出問題:最優點必須屬於可行集合 S,並且對 S 中每一點目標值都不大於該點的值。最優值是一個數;argmin 是所有最優點的集合,可能不只一點。 這裡將 MKO 的目標函數取為 f|S;候選域 C 上的同名公式仍可用來說明不可行點的值,但那些點不參與最優比較。
S02 · equivalent
操作前
C
操作後
|C|=9,\ C=\{0,1,2\}\times\{0,1,2\}條件:無
規則:cartesian_product_def · 依賴:G1
葉節點依據:cartesian_product_def + finite_counting_basics
G1 列出的九點正是 {0,1,2}×{0,1,2} 的全部有序對,3·3=9,沒有重複也沒有遺漏。之後的所有結論只關於這九點。
S03 · equivalent
操作前
g(x,y)=x+2y\ \text{on }C操作後
\text{mask: }0,2,4,1,3,5,2,4,6\ \Rightarrow\ \text{F,F,T,F,T,T,F,T,T}條件:無
規則:numeric_evaluation · 依賴:S02, G2
葉節點依據:numeric_evaluation + order_basics
依 MKO,先判可行性。對九點依次計算 g=x+2y,再與 3 比較,得到可行遮罩;計算按 x 分三列在 S03.1 到 S03.3。
S04 · equivalent
操作前
S=\{(x,y)\in C\mid x+2y\ge 3\}操作後
S=\{(0,2),(1,1),(1,2),(2,1),(2,2)\},\ |S|=5條件:無
規則:set_builder · 依賴:S03, G2
葉節點依據:set_builder + set_extensionality
依集合建構式,S 恰由遮罩為真的五點組成;(0,0)、(0,1)、(1,0)、(2,0) 不可行。S 非空,所以最小值有機會存在。依掃描次序記 s_1=(0,2)、s_2=(1,1)、s_3=(1,2)、s_4=(2,1)、s_5=(2,2)。
S05 · equivalent
操作前
f(s_1),f(s_2),f(s_3),f(s_4),f(s_5)
操作後
2,\ 2,\ 3,\ 3,\ 4
條件:無
規則:numeric_evaluation · 依賴:S04, G3
葉節點依據:numeric_evaluation
只對可行點計算目標值:f(0,2)=2,f(1,1)=2,f(1,2)=3,f(2,1)=3,f(2,2)=4。
S06 · implies
操作前
m_1=f(s_1),\ A_1=\{s_1\}操作後
m_k=\min_{1\le j\le k}f(s_j),\ A_k=\{s_j\mid 1\le j\le k,\ f(s_j)=m_k\}\ \text{for }k=1,2,3,4,5條件:無
規則:L_scan_invariant · 依賴:S04, L_scan_invariant
葉節點依據:nat_induction + case_analysis + order_basics
掃描演算法:以 m_1=f(s_1)、A_1={s_1} 開始(只看一點時顯然成立),之後依 L_scan_invariant 的三種情況更新。引理(在 S06.1 到 S06.3 分情況證明)說明每次更新都保持不變量,所以由 k=1 逐步歸納到 k=5,不變量一直成立。演算法在處理完 |S|=5 個點後停止。
S07 · implies
操作前
k=1:\ s_1=(0,2)
操作後
m_1=2,\ A_1=\{(0,2)\}條件:無
規則:def_intro · 依賴:S05, S06
葉節點依據:def_intro + numeric_evaluation
追蹤:起始點 s_1=(0,2),f=2,所以 m_1=2,A_1={(0,2)}。
S08 · implies
操作前
k=2:\ f(1,1)=2=m_1
操作後
m_2=2,\ A_2=\{(0,2),(1,1)\}條件:f(s_2)=m_1
規則:L_scan_invariant · 依賴:S07, S05, L_scan_invariant
葉節點依據:L_scan_invariant
s_2=(1,1) 的值 2 等於目前最小值,屬於平手情況(S06.2),加入平手集合。
S09 · implies
操作前
k=3,4,5:\ f=3,3,4
操作後
m_5=2,\ A_5=\{(0,2),(1,1)\}條件:3>2,\ 3>2,\ 4>2
規則:L_scan_invariant · 依賴:S08, S05, L_scan_invariant
葉節點依據:L_scan_invariant + order_basics
其餘三點都屬於「較大」情況,m 與 A 不變;逐點細節在 S09.1 到 S09.3。
S10 · implies
操作前
m_5=2,\ A_5=\{(0,2),(1,1)\}操作後
m=\min_{s\in S}f(s)=2,\ \operatorname{argmin}=\{(0,2),(1,1)\}條件:k=|S|=5
規則:L_scan_invariant · 依賴:S06, S09
葉節點依據:L_scan_invariant + finite_counting_basics
終止時 k=5,不變量說 m_5 是 f 在 s_1 到 s_5(即整個 S)上的最小值,A_5 是全部達到它的點。所以最優值 m=2,argmin={(0,2),(1,1)},有兩個平手最優點。
S11 · implies
操作前
\forall s\in S:\ f(0,2)\le f(s)\ \land\ f(1,1)\le f(s)
操作後
(0,2),(1,1)\ \text{satisfy the MKO definition of minimizer}條件:無
規則:mko_opt_def · 依賴:S05, S10, mko_opt_def
葉節點依據:mko_opt_def + forall_intro + order_basics
直接用 MKO 的定義交叉核對:2≤2、2≤2、2≤3、2≤3、2≤4,五個比較涵蓋 S 的每一點,所以 (0,2) 與 (1,1) 都是最小化點;另外三點的值 3、3、4 都大於某個可行點的值 2,所以不是最小化點。
S12 · implies
操作前
f(0,0)=0<2,\ f(2,0)=2=m
操作後
(0,0),(2,0)\notin\operatorname{argmin}條件:(0,0),(2,0)\notin S
規則:mko_opt_notes · 依賴:S03, S04, mko_opt_notes
葉節點依據:mko_opt_notes + set_builder
依 MKO,不可行點即使數值更好也不能成為最優解。(0,0) 的值 0 比 2 小,但 g(0,0)=0<3;(2,0) 的值恰為 2,但 g(2,0)=2<3。兩者都不在 S 中,所以都不在 argmin 中,也不使最優值變成 0。
S13 · implies
操作前
\max_{s\in S}f(s)操作後
\max=4,\ \operatorname{argmax}=\{(2,2)\}條件:無
規則:mko_opt_def · 依賴:S05, mko_opt_def
葉節點依據:mko_opt_def + order_basics
最大化把不等號反向:要求 f(s*)≥f(s) 對每個 s∈S。逐一比較:4≥2、4≥2、4≥3、4≥3、4≥4,所以 (2,2) 是最大化點;其他點的值都小於 4,所以這裡最大化點唯一。唯一與否要由列舉決定,最小化那邊就不唯一。
S14 · implies
操作前
\min\{x+y\mid x,y\in\mathbb{R},\ x,y\ge 0,\ x+2y\ge 3\}操作後
=\tfrac{3}{2}\ \text{at }(0,\tfrac{3}{2})\notin C條件:x\ge 0,\ y\ge 0
規則:order_basics · 依賴:G2, G3
葉節點依據:order_basics + distributive
說明有限枚舉不能外推:若把候選改成實數非負象限,同一限制下的最小值是 3/2,達到點 (0,3/2) 不在 C 中;證明在 S14.1 到 S14.3。所以「最優值 2」只是宣告的九點集合上的結論。
S15 · implies
操作前
\text{proved facts}操作後
m=2,\ \operatorname{argmin}=\{(0,2),(1,1)\},\ \max=4,\ \operatorname{argmax}=\{(2,2)\}條件:無
規則:and_intro_elim · 依賴:S10, S11, S12, S13, S14
葉節點依據:and_intro_elim
合併結論:在宣告的九點中,可行點五個;最小值 2 由 (0,2) 與 (1,1) 平手達到;不可行的 (0,0)、(2,0) 被排除;最大值 4 由 (2,2) 唯一達到;這些結論不外推到實數可行域(那裡最小值為 3/2)。
局部子步與引理
S03.1 · equivalent
操作前
(0,0),(0,1),(0,2)
操作後
g=0,2,4;\ \text{feasible only }(0,2)條件:無
規則:numeric_evaluation · 依賴:G2
葉節點依據:numeric_evaluation + order_basics
x=0:g(0,0)=0<3,g(0,1)=2<3,g(0,2)=4≥3。
S03.2 · equivalent
操作前
(1,0),(1,1),(1,2)
操作後
g=1,3,5;\ \text{feasible }(1,1),(1,2)條件:無
規則:numeric_evaluation · 依賴:G2
葉節點依據:numeric_evaluation + order_basics
x=1:g(1,0)=1<3,g(1,1)=3≥3(等號也可行),g(1,2)=5≥3。
S03.3 · equivalent
操作前
(2,0),(2,1),(2,2)
操作後
g=2,4,6;\ \text{feasible }(2,1),(2,2)條件:無
規則:numeric_evaluation · 依賴:G2
葉節點依據:numeric_evaluation + order_basics
x=2:g(2,0)=2<3,g(2,1)=4≥3,g(2,2)=6≥3。
S06.1 · implies
操作前
f(s_{k+1})<m_k操作後
m_{k+1}=f(s_{k+1}),\ A_{k+1}=\{s_{k+1}\}條件:f(s_{k+1})<m_k
規則:order_basics · 依賴:order_basics
葉節點依據:order_basics
若 f(s_(k+1))<m_k,則對 j≤k 有 f(s_j)≥m_k>f(s_(k+1)),所以 f(s_(k+1)) 是前 k+1 點的最小值,而且只有 s_(k+1) 達到它(其他點嚴格較大)。
S06.2 · implies
操作前
f(s_{k+1})=m_k操作後
m_{k+1}=m_k,\ A_{k+1}=A_k\cup\{s_{k+1}\}條件:f(s_{k+1})=m_k
規則:order_basics · 依賴:order_basics
葉節點依據:order_basics + set_operations_def
若相等,最小值不變,而達到它的點多了 s_(k+1):這就是平手。把 s_(k+1) 加入而不是丟棄,才能報告全部最優點。
S06.3 · implies
操作前
f(s_{k+1})>m_k操作後
m_{k+1}=m_k,\ A_{k+1}=A_k條件:f(s_{k+1})>m_k
規則:order_basics · 依賴:order_basics
葉節點依據:order_basics + case_analysis
若較大,最小值不變,s_(k+1) 不達到它,平手集合不變。三種情況由三分律涵蓋全部可能。S06.1 到 S06.3 合起來證得引理 L_scan_invariant。
S09.1 · implies
操作前
k=3:\ f(1,2)=3
操作後
3>2:\ m_3=2,\ A_3=A_2
條件:3>2
規則:L_scan_invariant · 依賴:S08, S05, L_scan_invariant
葉節點依據:L_scan_invariant + order_basics
f(1,2)=3>2,不改變。
S09.2 · implies
操作前
k=4:\ f(2,1)=3
操作後
3>2:\ m_4=2,\ A_4=A_3
條件:3>2
規則:L_scan_invariant · 依賴:S09.1, S05, L_scan_invariant
葉節點依據:L_scan_invariant + order_basics
f(2,1)=3>2,不改變。
S09.3 · implies
操作前
k=5:\ f(2,2)=4
操作後
4>2:\ m_5=2,\ A_5=A_4
條件:4>2
規則:L_scan_invariant · 依賴:S09.2, S05, L_scan_invariant
葉節點依據:L_scan_invariant + order_basics
f(2,2)=4>2,不改變。掃描結束。
S14.1 · equivalent
操作前
x+y
操作後
\tfrac{1}{2}(x+2y)+\tfrac{1}{2}x條件:無
規則:distributive · 依賴:distributive
葉節點依據:distributive + frac_rules
展開右邊:x/2+y+x/2=x+y,所以這是對所有實數成立的恆等式(N9)。
S14.2 · implies
操作前
\tfrac{1}{2}(x+2y)+\tfrac{1}{2}x,\ x+2y\ge 3,\ x\ge 0操作後
x+y\ge\tfrac{3}{2}條件:x\ge 0; x+2y\ge 3
規則:order_basics · 依賴:S14.1, order_basics
葉節點依據:order_basics
由 x+2y≥3 得 (x+2y)/2≥3/2(乘正數 1/2),由 x≥0 得 x/2≥0,兩者相加得 x+y≥3/2。
S14.3 · implies
操作前
(x,y)=(0,\tfrac{3}{2})操作後
x+2y=3,\ x+y=\tfrac{3}{2},\ (0,\tfrac{3}{2})\notin C條件:無
規則:numeric_evaluation · 依賴:S14.2
葉節點依據:numeric_evaluation + exists_intro
(0,3/2) 滿足 x,y≥0 與 0+2·(3/2)=3≥3,且值為 3/2,所以下界被達到,實數鬆弛的最小值是 3/2。3/2 不是整數,(0,3/2) 不在 C 中。