Documentation

CslibFrontier.MachineLearning.OnlineLearning.ConstantSum

External regret in constant-sum games and the online-learning minimax proof #

This module formalizes [BlumMansour2007AGT, §4.4.1–§4.4.2, pp. 88–90], reusing Cslib.Probability.IsMinimaxValue and Cslib.MachineLearning.OnlineLearning.Experts.averageProb from ZeroSum.lean:

Main results #

References #

Constant-sum value duality and Theorem 4.9 #

theorem Cslib.MachineLearning.OnlineLearning.Experts.isMinimaxValue_swap_of_add_eq {I : Type u_1} {J : Type u_2} [Fintype I] [Fintype J] {s₁ s₂ : I → J → ℝ} {c v₁ : ℝ} (hcs : ∀ (i : I) (j : J), s₁ i j + s₂ i j = c) (hv₁ : Probability.IsMinimaxValue s₁ v₁) :

If s₁ and s₂ sum to c on every outcome and s₁ has minimax value v₁, then player 2's transposed loss matrix Function.swap s₂ has minimax value c - v₁ [BlumMansour2007AGT, §4.4.2, p. 89].

theorem Cslib.MachineLearning.OnlineLearning.Experts.average_loss_le_of_isMinimaxValue {I : Type u_1} {J : Type u_2} [Fintype I] [Fintype J] {M : I → J → ℝ} {v R : ℝ} (hv : Probability.IsMinimaxValue M v) {p : ℕ → I → ℝ} {q : ℕ → J → ℝ} {T : ℕ} (hT : 0 < T) (hq0 : ∀ t < T, ∀ (j : J), 0 ≤ q t j) (hq1 : ∀ t < T, ∑ j : J, q t j = 1) (hreg : ∀ (i : I), ∑ t ∈ Finset.range T, ∑ i' : I, p t i' * ∑ j : J, q t j * M i' j ≤ ∑ t ∈ Finset.range T, ∑ j : J, q t j * M i j + R) :
(∑ t ∈ Finset.range T, ∑ i : I, p t i * ∑ j : J, q t j * M i j) / ↑T ≤ v + R / ↑T

Average loss of an external-regret row learner against an arbitrary opponent [BlumMansour2007AGT, §4.4.2, Theorem 4.9, p. 89]: if M has minimax value v, q is any sequence of mixed column strategies over T > 0 rounds, and p achieves external regret at most R against the induced stage loss vectors i ↦ ∑ j, q t j * M i j, then the row learner's average expected loss is at most v + R / T.

theorem Cslib.MachineLearning.OnlineLearning.Experts.constantSum_col_average_loss_le {I : Type u_1} {J : Type u_2} [Fintype I] [Fintype J] {s₁ s₂ : I → J → ℝ} {c v₁ R : ℝ} (hcs : ∀ (i : I) (j : J), s₁ i j + s₂ i j = c) (hv₁ : Probability.IsMinimaxValue s₁ v₁) {p : ℕ → I → ℝ} {q : ℕ → J → ℝ} {T : ℕ} (hT : 0 < T) (hp0 : ∀ t < T, ∀ (i : I), 0 ≤ p t i) (hp1 : ∀ t < T, ∑ i : I, p t i = 1) (hreg : ∀ (j : J), ∑ t ∈ Finset.range T, ∑ j' : J, q t j' * ∑ i : I, p t i * s₂ i j' ≤ ∑ t ∈ Finset.range T, ∑ i : I, p t i * s₂ i j + R) :
(∑ t ∈ Finset.range T, ∑ j : J, q t j * ∑ i : I, p t i * s₂ i j) / ↑T ≤ c - v₁ + R / ↑T

Average loss of an external-regret column learner in a constant-sum game [BlumMansour2007AGT, §4.4.2, Theorem 4.9, p. 89]: if ∀ i j, s₁ i j + s₂ i j = c and s₁ has minimax value v₁, then any column learner q achieving external regret at most R over T > 0 rounds against j ↦ ∑ i, p t i * s₂ i j incurs average expected loss at most (c - v₁) + R / T against every sequence p of mixed row strategies.

theorem Cslib.MachineLearning.OnlineLearning.Experts.constantSum_average_loss_mem_Icc {I : Type u_1} {J : Type u_2} [Fintype I] [Fintype J] {s₁ s₂ : I → J → ℝ} {c v₁ R₁ R₂ : ℝ} (hcs : ∀ (i : I) (j : J), s₁ i j + s₂ i j = c) (hv₁ : Probability.IsMinimaxValue s₁ v₁) {p : ℕ → I → ℝ} {q : ℕ → J → ℝ} {T : ℕ} (hT : 0 < T) (hp0 : ∀ t < T, ∀ (i : I), 0 ≤ p t i) (hp1 : ∀ t < T, ∑ i : I, p t i = 1) (hq0 : ∀ t < T, ∀ (j : J), 0 ≤ q t j) (hq1 : ∀ t < T, ∑ j : J, q t j = 1) (hreg₁ : ∀ (i : I), ∑ t ∈ Finset.range T, ∑ i' : I, p t i' * ∑ j : J, q t j * s₁ i' j ≤ ∑ t ∈ Finset.range T, ∑ j : J, q t j * s₁ i j + R₁) (hreg₂ : ∀ (j : J), ∑ t ∈ Finset.range T, ∑ j' : J, q t j' * ∑ i : I, p t i * s₂ i j' ≤ ∑ t ∈ Finset.range T, ∑ i : I, p t i * s₂ i j + R₂) :
(∑ t ∈ Finset.range T, ∑ i : I, p t i * ∑ j : J, q t j * s₁ i j) / ↑T ∈ Set.Icc (v₁ - R₂ / ↑T) (v₁ + R₁ / ↑T)

Simultaneous external-regret bounds in a constant-sum game [BlumMansour2007AGT, §4.4.2, pp. 89–90]: when player 1 achieves external regret at most R₁ and player 2 achieves external regret at most R₂ over T > 0 rounds of a constant-sum game s₁ + s₂ = c with player-1 value v₁, player 1's average expected loss lies in [v₁ - R₂ / T, v₁ + R₁ / T].

§4.4.2: Coupled no-regret proof of von Neumann's minimax theorem #

theorem Cslib.MachineLearning.OnlineLearning.Experts.ciSup_ciInf_eq_ciInf_ciSup {I : Type u_1} {J : Type u_2} [Fintype I] [Fintype J] [Nonempty I] [Nonempty J] (M : I → J → ℝ) :
⨆ (q : Convexity.StdSimplex ℝ J), ⨅ (i : I), ∑ j : J, q.weights j * M i j = ⨅ (p : Convexity.StdSimplex ℝ I), ⨆ (j : J), ∑ i : I, p.weights i * M i j

Online-learning proof of von Neumann's minimax identity [BlumMansour2007AGT, §4.4.2, pp. 89–90]: (⨆ q : StdSimplex ℝ J, ⨅ i : I, ∑ j, q.weights j * M i j) equals ⨅ p : StdSimplex ℝ I, ⨆ j : J, ∑ i, p.weights i * M i j for every finite real matrix game M, proved via coupled mwFactor self-play and T → ∞ without LP duality or Sion's theorem.

theorem Cslib.MachineLearning.OnlineLearning.Experts.isMinimaxValue_ciInf_ciSup {I : Type u_1} {J : Type u_2} [Fintype I] [Fintype J] [Nonempty I] [Nonempty J] (M : I → J → ℝ) :
Probability.IsMinimaxValue M (⨅ (p : Convexity.StdSimplex ℝ I), ⨆ (j : J), ∑ i : I, p.weights i * M i j)

Attained minimax value via coupled no-regret learning [BlumMansour2007AGT, §4.4.2, pp. 89–90]: combining ciSup_ciInf_eq_ciInf_ciSup with compactness of StdSimplex ℝ yields optimal mixed strategies witnessing IsMinimaxValue M (⨅ p : StdSimplex ℝ I, ⨆ j : J, ∑ i, p.weights i * M i j) without invoking exists_isMinimaxValue or Sion's theorem.