Documentation

CslibFrontier.Probability.Minimax.Dantzig

Linear programs as symmetric zero-sum games #

A zero-sum game with skew-symmetric payoff matrix P (Pᵀ = -P) is symmetric, and a solution of it is a mixed strategy z with 0 ≤ P *ᵥ z ([Adl13], (3)): played against z the opponent's every pure strategy pays at least 0, the value of the game. By the minimax theorem every symmetric game has a solution (exists_isSymmetricGameSolution, [Adl13], Theorem 1). This file formalizes the converse of the reduction of games to linear programs: the reduction of linear programs to symmetric games of [Dan51], and the repair by [Adl13] of the case in which that reduction fails.

Dantzig's game and its gap #

For the linear program min {c ⬝ᵥ x | b ≤ A *ᵥ x, 0 ≤ x} and its dual max {y ⬝ᵥ b | y ᵥ* A ≤ c, 0 ≤ y} ([Adl13], (1)–(2)), the Dantzig game (dantzigGame A b c) has the skew-symmetric payoff matrix

    ( 0   A  -b)
P = (-Aᵀ  0   c)
    ( bᵀ -cᵀ  0)

([Adl13], (4)). A solution (y, x, t) satisfies t • b ≤ A *ᵥ x, y ᵥ* A ≤ t • c and c ⬝ᵥ x ≤ y ⬝ᵥ b (isSymmetricGameSolution_dantzigGame_iff, [Adl13], (5)), and Dantzig reads the linear program off it ([Adl13], Theorem 2):

The reduction is incomplete: a solution may have t = 0 and c ⬝ᵥ x = y ⬝ᵥ b, and then it says nothing about the program ([Adl13], p. 166, citing [Dan51]). The original example exists_dantzigGame_undetermined exhibits the gap: one strategy with t = 0 and c ⬝ᵥ x = y ⬝ᵥ b solves the Dantzig games of two programs, one of which has an optimal solution and the other of which is infeasible. Repairing the reduction for linear programs themselves, through the feasibility problem below, remains open.

Adler's repair #

[Adl13] works with the linear feasibility problem F(A, b): find x with 0 ≤ x and A *ᵥ x = b, or show that there is none. A pair of dual programs is one feasibility problem (the primal and dual constraints together with c ⬝ᵥ x ≤ y ⬝ᵥ b; [Adl13], p. 167), a step not formalized here. Writing A *ᵥ x = b as b ≤ A *ᵥ x and ∑ i, (A *ᵥ x) i ≤ ∑ i, b i, the Dantzig game of the program min {u | b ≤ A *ᵥ x + u • 1, ∑ i, (A *ᵥ x) i - u ≤ ∑ i, b i, 0 ≤ x, 0 ≤ u} is the Dantzig game associated with F(A, b) (feasibilityGame A b; its solutions are [Adl13], (6a)–(6g)). Its solutions (y, v, x, u, t) resolve F(A, b) unless t = 0. Three steps of the reduction below, after [Adl13], Proposition 4, say so:

Adding the variable s and the constraint ∑ j, x j + s = β makes the solution set bounded, so the Dantzig game of the bounded problem F(Â, b̂(β)) has no solution with t = 0 (IsSymmetricGameSolution.pos_of_feasibilityGame_bounded, [Adl13], Proposition 6); and for β at least the total weight of some solution of F(A, b), the two problems are solvable together ([Adl13], Proposition 7). For integer data with entries of absolute value at most B, the bound card n * ((card n)! * (card m * B ^ 2 + 1) ^ card n) from Cramer's rule (Matrix.exists_int_nonneg_mulVec_eq) is such a β, and every solution of the bounded game resolves F(A, b) (resolves_of_feasibilityGame_bounded). This is the Karp-type reduction of [Adl13], Section 3.1, with the Leibniz bound on determinants in place of Adler's Hadamard bound m (√m θ) ^ m + 1.

So every linear feasibility problem with integer data over a linearly ordered field is solved by solving one symmetric zero-sum game with card m + card n + 5 pure strategies, built from the data alone. Here the minimax theorem is itself proved from linear-programming duality (exists_isMinimaxValue), so these results do not give a second proof of duality: their content is the reduction, that the status of the problem is read off any solution of the game.

Main definitions #

Main results #

The remaining parts of [Adl13] are open here: the reduction of a pair of dual programs to one feasibility problem (p. 167), the bound on β for algebraic data (Section 3.1), the Cook-type reduction (Section 3.2) and the derivation of Farkas' lemma from the minimax theorem (Section 4).

References #

Symmetric games #

structure Cslib.Probability.IsSymmetricGameSolution {K : Type u_1} [Field K] [LinearOrder K] {ι : Type u_2} [Fintype ι] (P : Matrix ι ι K) (z : ι → K) :

z solves the symmetric game with payoff matrix P ([Adl13], (3)): z is a mixed strategy and 0 ≤ P *ᵥ z. For skew-symmetric P the value of the game is 0, and the solutions are its optimal strategies.

  • nonneg : 0 ≤ z

    Every weight is nonnegative.

  • sum_eq_one : ∑ i : ι, z i = 1

    The weights sum to 1.

  • mulVec_nonneg : 0 ≤ P.mulVec z

    Every pure strategy of the opponent pays at least 0 against z.

theorem Cslib.Probability.exists_isSymmetricGameSolution {K : Type u_1} [Field K] [LinearOrder K] [IsStrictOrderedRing K] {ι : Type u_2} [Fintype ι] [Nonempty ι] {P : Matrix ι ι K} (hP : P.transpose = -P) :
∃ (z : ι → K), IsSymmetricGameSolution P z

The minimax theorem for symmetric games ([Adl13], Theorem 1): every skew-symmetric matrix P has a solution. The value v of the game (exists_isMinimaxValue) is also the value -v of the game with the players' roles exchanged, so v = 0, and an optimal strategy of the column player solves the game.

Dantzig's game of a linear program #

def Cslib.Probability.dantzigGame {K : Type u_1} [Field K] {m : Type u_2} {n : Type u_3} (A : Matrix m n K) (b : m → K) (c : n → K) :
Matrix (m ⊕ n ⊕ Unit) (m ⊕ n ⊕ Unit) K

The Dantzig game of the linear program min {c ⬝ᵥ x | b ≤ A *ᵥ x, 0 ≤ x} and its dual max {y ⬝ᵥ b | y ᵥ* A ≤ c, 0 ≤ y} ([Adl13], (4); [Dan51]): the skew-symmetric matrix with block rows (0, A, -b), (-Aᵀ, 0, c) and (bᵀ, -cᵀ, 0), indexed by m ⊕ n ⊕ Unit. A strategy Sum.elim y (Sum.elim x fun _ => t) puts weight y on the dual variables, x on the primal variables and t on the right-hand side.

theorem Cslib.Probability.dantzigGame_transpose {K : Type u_1} [Field K] {m : Type u_2} {n : Type u_3} (A : Matrix m n K) (b : m → K) (c : n → K) :

The Dantzig game is symmetric.

theorem Cslib.Probability.isSymmetricGameSolution_dantzigGame_iff {K : Type u_1} [Field K] [LinearOrder K] [IsStrictOrderedRing K] {m : Type u_2} {n : Type u_3} [Fintype m] [Fintype n] {A : Matrix m n K} {b : m → K} {c : n → K} {y : m → K} {x : n → K} {t : K} :
IsSymmetricGameSolution (dantzigGame A b c) (Sum.elim y (Sum.elim x fun (x : Unit) => t)) ↔ 0 ≤ y ∧ 0 ≤ x ∧ 0 ≤ t ∧ ∑ i : m, y i + ∑ j : n, x j + t = 1 ∧ t • b ≤ A.mulVec x ∧ Matrix.vecMul y A ≤ t • c ∧ c ⬝ᵥ x ≤ y ⬝ᵥ b

A solution (y, x, t) of the Dantzig game is a nonnegative strategy with t • b ≤ A *ᵥ x, y ᵥ* A ≤ t • c and c ⬝ᵥ x ≤ y ⬝ᵥ b ([Adl13], (5)).

theorem Cslib.Probability.IsSymmetricGameSolution.mul_sub_eq_zero_of_dantzigGame {K : Type u_1} [Field K] [LinearOrder K] [IsStrictOrderedRing K] {m : Type u_2} {n : Type u_3} [Fintype m] [Fintype n] {A : Matrix m n K} {b : m → K} {c : n → K} {y : m → K} {x : n → K} {t : K} (h : IsSymmetricGameSolution (dantzigGame A b c) (Sum.elim y (Sum.elim x fun (x : Unit) => t))) :
t * (y ⬝ᵥ b - c ⬝ᵥ x) = 0

A step of Dantzig's read-off (optimal_of_dantzigGame, not_feasible_of_dantzigGame), after [Adl13], Theorem 2(a): a solution (y, x, t) of the Dantzig game has t * (y ⬝ᵥ b - c ⬝ᵥ x) = 0.

theorem Cslib.Probability.IsSymmetricGameSolution.optimal_of_dantzigGame {K : Type u_1} [Field K] [LinearOrder K] [IsStrictOrderedRing K] {m : Type u_2} {n : Type u_3} [Fintype m] [Fintype n] {A : Matrix m n K} {b : m → K} {c : n → K} {y : m → K} {x : n → K} {t : K} (h : IsSymmetricGameSolution (dantzigGame A b c) (Sum.elim y (Sum.elim x fun (x : Unit) => t))) (ht : 0 < t) :
(0 ≤ t⁻¹ • x ∧ b ≤ A.mulVec (t⁻¹ • x)) ∧ (∀ (x' : n → K), 0 ≤ x' → b ≤ A.mulVec x' → c ⬝ᵥ t⁻¹ • x ≤ c ⬝ᵥ x') ∧ (0 ≤ t⁻¹ • y ∧ Matrix.vecMul (t⁻¹ • y) A ≤ c) ∧ ∀ (y' : m → K), 0 ≤ y' → Matrix.vecMul y' A ≤ c → y' ⬝ᵥ b ≤ t⁻¹ • y ⬝ᵥ b

Dantzig's read-off ([Adl13], Theorem 2(b); [Dan51]): if (y, x, t) solves the Dantzig game and 0 < t, then x / t is an optimal solution of min {c ⬝ᵥ x | b ≤ A *ᵥ x, 0 ≤ x} and y / t is an optimal solution of its dual max {y ⬝ᵥ b | y ᵥ* A ≤ c, 0 ≤ y}.

theorem Cslib.Probability.IsSymmetricGameSolution.not_feasible_of_dantzigGame {K : Type u_1} [Field K] [LinearOrder K] [IsStrictOrderedRing K] {m : Type u_2} {n : Type u_3} [Fintype m] [Fintype n] {A : Matrix m n K} {b : m → K} {c : n → K} {y : m → K} {x : n → K} {t : K} (h : IsSymmetricGameSolution (dantzigGame A b c) (Sum.elim y (Sum.elim x fun (x : Unit) => t))) (hlt : c ⬝ᵥ x < y ⬝ᵥ b) :
¬((∃ (x' : n → K), 0 ≤ x' ∧ b ≤ A.mulVec x') ∧ ∃ (y' : m → K), 0 ≤ y' ∧ Matrix.vecMul y' A ≤ c)

If (y, x, t) solves the Dantzig game with c ⬝ᵥ x < y ⬝ᵥ b, then the program min {c ⬝ᵥ x | b ≤ A *ᵥ x, 0 ≤ x} or its dual is infeasible ([Adl13], Theorem 2(c); [Dan51]).

theorem Cslib.Probability.exists_dantzigGame_undetermined {K : Type u_1} [Field K] [LinearOrder K] [IsStrictOrderedRing K] :
∃ (A : Matrix Unit Unit K) (b₀ : Unit → K) (b₁ : Unit → K) (c : Unit → K) (y : Unit → K) (x : Unit → K), IsSymmetricGameSolution (dantzigGame A b₀ c) (Sum.elim y (Sum.elim x fun (x : Unit) => 0)) ∧ IsSymmetricGameSolution (dantzigGame A b₁ c) (Sum.elim y (Sum.elim x fun (x : Unit) => 0)) ∧ c ⬝ᵥ x = y ⬝ᵥ b₀ ∧ c ⬝ᵥ x = y ⬝ᵥ b₁ ∧ (∃ (x₀ : Unit → K), (0 ≤ x₀ ∧ b₀ ≤ A.mulVec x₀) ∧ ∀ (x' : Unit → K), 0 ≤ x' → b₀ ≤ A.mulVec x' → c ⬝ᵥ x₀ ≤ c ⬝ᵥ x') ∧ ¬∃ (x' : Unit → K), 0 ≤ x' ∧ b₁ ≤ A.mulVec x'

An example of the gap in Dantzig's reduction (original; it illustrates the remark of [Adl13], p. 166, which cites [Dan51]): a solution (y, x, 0) of the Dantzig game with c ⬝ᵥ x = y ⬝ᵥ b does not determine the program. The same such strategy solves the Dantzig games of min {0 | 0 ≤ 0, 0 ≤ x}, which has an optimal solution, and of min {0 | 1 ≤ 0, 0 ≤ x}, which is infeasible.

Adler's repair: linear feasibility problems #

def Cslib.Probability.feasibilityGame {K : Type u_1} [Field K] {m : Type u_2} {n : Type u_3} [Fintype m] (A : Matrix m n K) (b : m → K) :
Matrix ((m ⊕ Unit) ⊕ (n ⊕ Unit) ⊕ Unit) ((m ⊕ Unit) ⊕ (n ⊕ Unit) ⊕ Unit) K

The Dantzig game associated with the linear feasibility problem F(A, b) (0 ≤ x, A *ᵥ x = b) ([Adl13], Section 2): the Dantzig game of the program min {u | b ≤ A *ᵥ x + u • 1, ∑ i, (A *ᵥ x) i - u ≤ ∑ i, b i, 0 ≤ x, 0 ≤ u}, whose constraint matrix has block rows (A, 1) and (-1ᵀ A, 1). A strategy Sum.elim (Sum.elim y fun _ => v) (Sum.elim (Sum.elim x fun _ => u) fun _ => t) is Adler's (y, v, x, u, t).

theorem Cslib.Probability.feasibilityGame_transpose {K : Type u_1} [Field K] {m : Type u_2} {n : Type u_3} [Fintype m] (A : Matrix m n K) (b : m → K) :

The Dantzig game associated with F(A, b) is symmetric.

theorem Cslib.Probability.IsSymmetricGameSolution.mulVec_eq_of_feasibilityGame {K : Type u_1} [Field K] [LinearOrder K] [IsStrictOrderedRing K] {m : Type u_2} {n : Type u_3} [Fintype m] [Fintype n] {A : Matrix m n K} {b y : m → K} {v : K} {x : n → K} {u t : K} (h : IsSymmetricGameSolution (feasibilityGame A b) (Sum.elim (Sum.elim y fun (x : Unit) => v) (Sum.elim (Sum.elim x fun (x : Unit) => u) fun (x : Unit) => t))) (ht : 0 < t) (hu : u = 0) :
0 ≤ t⁻¹ • x ∧ A.mulVec (t⁻¹ • x) = b

A step of Adler's reduction (resolves_of_feasibilityGame_bounded, [Adl13], Section 3.1), after [Adl13], Proposition 4(a)(i): if (y, v, x, u, t) solves the Dantzig game associated with F(A, b), 0 < t and u = 0, then x / t solves F(A, b).

theorem Cslib.Probability.IsSymmetricGameSolution.not_exists_of_feasibilityGame {K : Type u_1} [Field K] [LinearOrder K] [IsStrictOrderedRing K] {m : Type u_2} {n : Type u_3} [Fintype m] [Fintype n] {A : Matrix m n K} {b y : m → K} {v : K} {x : n → K} {u t : K} (h : IsSymmetricGameSolution (feasibilityGame A b) (Sum.elim (Sum.elim y fun (x : Unit) => v) (Sum.elim (Sum.elim x fun (x : Unit) => u) fun (x : Unit) => t))) (hu : 0 < u) :
¬∃ (x' : n → K), 0 ≤ x' ∧ A.mulVec x' = b

A step of Adler's reduction (resolves_of_feasibilityGame_bounded, [Adl13], Section 3.1), after [Adl13], Proposition 4(a)(ii), which also assumes 0 < t: if (y, v, x, u, t) solves the Dantzig game associated with F(A, b) and 0 < u, then F(A, b) has no solution; y - v • 1 is a certificate of infeasibility.

theorem Cslib.Probability.IsSymmetricGameSolution.mulVec_eq_zero_of_feasibilityGame {K : Type u_1} [Field K] [LinearOrder K] [IsStrictOrderedRing K] {m : Type u_2} {n : Type u_3} [Fintype m] [Fintype n] {A : Matrix m n K} {b y : m → K} {v : K} {x : n → K} {u : K} (h : IsSymmetricGameSolution (feasibilityGame A b) (Sum.elim (Sum.elim y fun (x : Unit) => v) (Sum.elim (Sum.elim x fun (x : Unit) => u) fun (x : Unit) => 0))) :
x ≠ 0 ∧ 0 ≤ x ∧ A.mulVec x = 0

A step of Adler's reduction (resolves_of_feasibilityGame_bounded, [Adl13], Section 3.1), after [Adl13], Proposition 4(b): if (y, v, x, 0) solves the Dantzig game associated with F(A, b), then x is a nonzero solution of 0 ≤ x, A *ᵥ x = 0. Such x exist whenever the solutions of F(A, b) are unbounded, so they do not resolve F(A, b).

theorem Cslib.Probability.IsSymmetricGameSolution.pos_of_feasibilityGame_bounded {K : Type u_1} [Field K] [LinearOrder K] [IsStrictOrderedRing K] {m : Type u_2} {n : Type u_3} [Fintype m] [Fintype n] {A : Matrix m n K} {b : m → K} {v u t β : K} {y : m ⊕ Unit → K} {x : n ⊕ Unit → K} (h : IsSymmetricGameSolution (feasibilityGame (Matrix.fromBlocks A 0 (Matrix.of fun (x : Unit) (x_1 : n) => 1) 1) (Sum.elim b fun (x : Unit) => β)) (Sum.elim (Sum.elim y fun (x : Unit) => v) (Sum.elim (Sum.elim x fun (x : Unit) => u) fun (x : Unit) => t))) :
0 < t

Bounding removes the gap ([Adl13], Proposition 6): the Dantzig game associated with the bounded problem F(Â, b̂(β)), namely 0 ≤ (x, s), A *ᵥ x = b and ∑ j, x j + s = β, has no solution with t = 0. Adler assumes 0 < β; the proof does not need it.

theorem Cslib.Probability.resolves_of_feasibilityGame_bounded {K : Type u_1} [Field K] [LinearOrder K] [IsStrictOrderedRing K] {m : Type u_2} {n : Type u_3} [Fintype m] [Fintype n] {A : Matrix m n ℤ} {b : m → ℤ} {B : ℕ} (hA : ∀ (i : m) (j : n), |A i j| ≤ ↑B) (hb : ∀ (i : m), |b i| ≤ ↑B) {β : K} (hβ : ↑(Fintype.card n * ((Fintype.card n).factorial * (Fintype.card m * B ^ 2 + 1) ^ Fintype.card n)) ≤ β) {y : m ⊕ Unit → K} {v : K} {x : n ⊕ Unit → K} {u t : K} (h : IsSymmetricGameSolution (feasibilityGame (Matrix.fromBlocks (A.map Int.cast) 0 (Matrix.of fun (x : Unit) (x_1 : n) => 1) 1) (Sum.elim (fun (i : m) => ↑(b i)) fun (x : Unit) => β)) (Sum.elim (Sum.elim y fun (x : Unit) => v) (Sum.elim (Sum.elim x fun (x : Unit) => u) fun (x : Unit) => t))) :
0 < t ∧ (u = 0 → 0 ≤ t⁻¹ • x ∘ Sum.inl ∧ (A.map Int.cast).mulVec (t⁻¹ • x ∘ Sum.inl) = fun (i : m) => ↑(b i)) ∧ (0 < u → ¬∃ (x' : n → K), 0 ≤ x' ∧ (A.map Int.cast).mulVec x' = fun (i : m) => ↑(b i))

Adler's reduction of linear feasibility to one symmetric game ([Adl13], Section 3.1, Propositions 4, 6 and 7), for integer data. Let A *ᵥ x = b, 0 ≤ x be an integer system with entries of absolute value at most B, and let β ≥ card n * ((card n)! * (card m * B ^ 2 + 1) ^ card n). Every solution (y, v, x, u, t) of the Dantzig game associated with the bounded problem F(Â, b̂(β)) has 0 < t, and it resolves F(A, b) over K: if u = 0, the first card n coordinates of x / t solve it; if 0 < u, it has no solution. Since 0 ≤ u, one of the two holds, and solutions exist by exists_isSymmetricGameSolution and feasibilityGame_transpose. Adler's bound m (√m θ) ^ m + 1 (Hadamard) is replaced by the Leibniz bound of Matrix.exists_int_nonneg_mulVec_eq; that the reduction is strongly polynomial is not formalized.