Documentation

CslibFrontier.MachineLearning.OnlineLearning.Blackwell

Blackwell's approachability theorem #

Formalizes Blackwell's approachability theorem [Bla56] for vector-valued repeated games with finite action sets I, J and payoff matrix m : I → J → E into a real inner product space E, targeting a nonempty complete convex set S : Set E.

In the classic characterization (satisfiesResponseCondition_iff_halfspace), the following two conditions on (m, S) are equivalent (without assuming finite dimensionality or completeness of E):

The forward direction applies von Neumann's minimax theorem (Convexity.StdSimplex.exists_forall_sum_le_of_forall_exists_sum_le) to the scalar game M i j = ⟪w, m i j⟫; the converse derives the separating hyperplane w = c* - Π_S(c*) from the nearest-pair variational inequality using Cslib.metricProjection on compact convex {m(p, q) | p ∈ Δ(I)}.

We establish both quantitative directions of approachability:

Main definitions #

Main results #

References #

Running average (T : ℝ)⁻¹ • ∑ t ∈ range T, v t of a vector sequence over T rounds.

theorem Cslib.MachineLearning.OnlineLearning.Blackwell.smul_vecAvg {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] (v : ℕ → E) {T : ℕ} (hT : 0 < T) :
↑T • vecAvg v T = ∑ t ∈ Finset.range T, v t

Distance ‖x - metricProjection S x‖ from x to a nonempty complete convex set S.

theorem Cslib.MachineLearning.OnlineLearning.Blackwell.blackwell_dist_sq_le_sum {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] {S : Set E} (hc : IsComplete S) (hS : Convex ℝ S) {s₀ : E} (hs₀ : s₀ ∈ S) (v : ℕ → E) (T : ℕ) (hstep : ∀ (t : ℕ), 0 < t → t < T → have s := metricProjection S (vecAvg v t); inner ℝ (vecAvg v t - s) (v t - s) ≤ 0) :
‖∑ t ∈ Finset.range T, v t - ↑T • metricProjection S (vecAvg v T)‖ ^ 2 ≤ ∑ t ∈ Finset.range T, ‖v t - if t = 0 then s₀ else metricProjection S (vecAvg v t)‖ ^ 2

Core quadratic Blackwell recursion: if each vector v t (1 ≤ t < T) satisfies the supporting-halfspace condition ⟪vecAvg v t - s_t, v t - s_t⟫ ≤ 0 where s_t = metricProjection S (vecAvg v t), then for any initial reference s₀ ∈ S, T ^ 2 * distToSet S (vecAvg v T) ^ 2 ≤ ∑ t < T, ‖v t - s_t‖ ^ 2.

theorem Cslib.MachineLearning.OnlineLearning.Blackwell.blackwell_dist_le_div_sqrt {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] {S : Set E} (hc : IsComplete S) (hS : Convex ℝ S) {s₀ : E} (hs₀ : s₀ ∈ S) {v : ℕ → E} {R : ℝ} (hRnn : 0 ≤ R) {T : ℕ} (hT : 0 < T) (hR : ∀ t < T, ‖v t - s₀‖ ≤ R) (hstep : ∀ (t : ℕ), 0 < t → t < T → have s := metricProjection S (vecAvg v t); inner ℝ (vecAvg v t - s) (v t - s) ≤ 0) :
distToSet S (vecAvg v T) ≤ 2 * R / √↑T

Deterministic 2 * R / √T Blackwell approachability rate: works for arbitrary (possibly unbounded) complete convex S containing s₀, whenever ‖v t - s₀‖ ≤ R and each v t (t ≥ 1) lies in the supporting halfspace ⟪vecAvg v t - s_t, v t - s_t⟫ ≤ 0.

theorem Cslib.MachineLearning.OnlineLearning.Blackwell.blackwell_cone_dist_sq_le_sum {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] {S : Set E} (hc : IsComplete S) (hS : Convex ℝ S) (hzero : 0 ∈ S) (v : ℕ → E) (T : ℕ) (hstep : ∀ t < T, have X := ∑ s ∈ Finset.range t, v s; inner ℝ (X - metricProjection S X) (v t) ≤ 0) :
distToSet S (∑ t ∈ Finset.range T, v t) ^ 2 ≤ ∑ t ∈ Finset.range T, ‖v t‖ ^ 2

Tight quadratic recursion for complete convex cones: when S contains 0 and is closed under nonnegative scalar multiplication, dropping the projection shift gives the unaveraged bound distToSet S (∑ t < T, v t) ^ 2 ≤ ∑ t < T, ‖v t‖ ^ 2 (saving a factor of 2 over general convex sets).

theorem Cslib.MachineLearning.OnlineLearning.Blackwell.blackwell_cone_dist_le {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] {S : Set E} (hc : IsComplete S) (hS : Convex ℝ S) (hzero : 0 ∈ S) {v : ℕ → E} {R : ℝ} (hRnn : 0 ≤ R) (T : ℕ) (hR : ∀ t < T, ‖v t‖ ≤ R) (hstep : ∀ t < T, have X := ∑ s ∈ Finset.range t, v s; inner ℝ (X - metricProjection S X) (v t) ≤ 0) :
distToSet S (∑ t ∈ Finset.range T, v t) ≤ R * √↑T

Square-root form of blackwell_cone_dist_sq_le_sum (distToSet S (∑ t < T, v t) ≤ R * √T).

noncomputable def Cslib.MachineLearning.OnlineLearning.Blackwell.expectedPayoff {I : Type u_1} {J : Type u_2} {E : Type u_3} [Fintype I] [NormedAddCommGroup E] [InnerProductSpace ℝ E] (m : I → J → E) (p : I → ℝ) (j : J) :
E

Expected vector payoff ∑ i, p i • m i j when the row player plays mixed weights p against pure column action j.

noncomputable def Cslib.MachineLearning.OnlineLearning.Blackwell.bilinearPayoff {I : Type u_1} {J : Type u_2} {E : Type u_3} [Fintype I] [Fintype J] [NormedAddCommGroup E] [InnerProductSpace ℝ E] (m : I → J → E) (p : I → ℝ) (q : J → ℝ) :
E

Bilinear expected vector payoff ∑ i, ∑ j, (p i * q j) • m i j.

theorem Cslib.MachineLearning.OnlineLearning.Blackwell.bilinearPayoff_eq_sum_row {I : Type u_1} {J : Type u_2} {E : Type u_3} [Fintype I] [Fintype J] [NormedAddCommGroup E] [InnerProductSpace ℝ E] (m : I → J → E) (p : I → ℝ) (q : J → ℝ) :
bilinearPayoff m p q = ∑ i : I, p i • ∑ j : J, q j • m i j
theorem Cslib.MachineLearning.OnlineLearning.Blackwell.bilinearPayoff_eq_sum_col {I : Type u_1} {J : Type u_2} {E : Type u_3} [Fintype I] [Fintype J] [NormedAddCommGroup E] [InnerProductSpace ℝ E] (m : I → J → E) (p : I → ℝ) (q : J → ℝ) :
bilinearPayoff m p q = ∑ j : J, q j • expectedPayoff m p j

Blackwell's response condition: for every mixed column strategy q ∈ Δ(J), there exists a mixed row strategy p ∈ Δ(I) placing the expected vector payoff bilinearPayoff m p q in S.

Blackwell's halfspace condition: every closed halfspace {x | ⟪w, x⟫ ≤ c} containing S is forceable by some mixed row strategy p ∈ Δ(I) against all pure column actions j : J.

Von Neumann minimax implies Blackwell's halfspace condition from the response condition [Bla56].

Blackwell's characterization theorem for convex sets [Bla56]: for a nonempty complete convex set S in a real inner product space E, SatisfiesResponseCondition m S holds iff SatisfiesHalfspaceCondition m S holds.

theorem Cslib.MachineLearning.OnlineLearning.Blackwell.exists_nonapproachable_dist_ge {I : Type u_1} {J : Type u_2} {E : Type u_3} [Fintype I] [Fintype J] [NormedAddCommGroup E] [InnerProductSpace ℝ E] [Nonempty I] {m : I → J → E} {S : Set E} (hSne : S.Nonempty) (hSc : IsComplete S) (hScvx : Convex ℝ S) (hfail : ¬SatisfiesResponseCondition m S) :
∃ (q : J → ℝ) (δ : ℝ), (∀ (j : J), 0 ≤ q j) ∧ ∑ j : J, q j = 1 ∧ 0 < δ ∧ ∀ (T : ℕ), 0 < T → ∀ (p : ℕ → I → ℝ), (∀ t < T, (∀ (i : I), 0 ≤ p t i) ∧ ∑ i : I, p t i = 1) → δ ≤ distToSet S (vecAvg (fun (t : ℕ) => bilinearPayoff m (p t) q) T)

Necessity of Blackwell's condition [Bla56]: if ¬ SatisfiesResponseCondition m S for a nonempty complete convex set S, then there exist a stationary mixed adversary strategy q ∈ Δ(J) and a gap δ > 0 such that every horizon T ≥ 1 and every sequence of mixed row strategies p t ∈ Δ(I) has δ ≤ distToSet S (vecAvg (fun t => bilinearPayoff m (p t) q) T).

A randomized causal strategy for repeated play: given the reverse-ordered history h : List I of realized pure row actions played so far, selects a probability distribution over I.

  • prob : List I → I → ℝ

    Mixed action weights prob h : I → ℝ played after observing history h.

  • nonneg (h : List I) (i : I) : 0 ≤ self.prob h i

    Every probability weight is nonnegative.

  • sum_eq_one (h : List I) : ∑ i : I, self.prob h i = 1

    Weights sum to 1 at every history.

noncomputable def Cslib.MachineLearning.OnlineLearning.Blackwell.expectHistory {I : Type u_1} [Fintype I] (strat : ApproachStrategy I) :
ℕ → List I → (List I → ℝ) → ℝ

Exact t-round expectation of a real-valued function f : List I → ℝ along randomized play of strat, starting from prefix history h : List I (stored most-recent-first).

theorem Cslib.MachineLearning.OnlineLearning.Blackwell.expectHistory_const {I : Type u_1} [Fintype I] (strat : ApproachStrategy I) (t : ℕ) (h : List I) (c : ℝ) :
(expectHistory strat t h fun (x : List I) => c) = c
theorem Cslib.MachineLearning.OnlineLearning.Blackwell.expectHistory_add {I : Type u_1} [Fintype I] (strat : ApproachStrategy I) (t : ℕ) (h : List I) (f g : List I → ℝ) :
(expectHistory strat t h fun (x : List I) => f x + g x) = expectHistory strat t h f + expectHistory strat t h g
theorem Cslib.MachineLearning.OnlineLearning.Blackwell.expectHistory_smul {I : Type u_1} [Fintype I] (strat : ApproachStrategy I) (t : ℕ) (h : List I) (c : ℝ) (f : List I → ℝ) :
(expectHistory strat t h fun (x : List I) => c * f x) = c * expectHistory strat t h f
theorem Cslib.MachineLearning.OnlineLearning.Blackwell.expectHistory_mono {I : Type u_1} [Fintype I] (strat : ApproachStrategy I) {t : ℕ} {h : List I} {f g : List I → ℝ} (hfg : ∀ (x : List I), x.length = h.length + t → f x ≤ g x) :
expectHistory strat t h f ≤ expectHistory strat t h g
theorem Cslib.MachineLearning.OnlineLearning.Blackwell.expectHistory_nonneg {I : Type u_1} [Fintype I] (strat : ApproachStrategy I) {t : ℕ} {h : List I} {f : List I → ℝ} (hf : ∀ (x : List I), 0 ≤ f x) :
0 ≤ expectHistory strat t h f
theorem Cslib.MachineLearning.OnlineLearning.Blackwell.expectHistory_succ_right {I : Type u_1} [Fintype I] (strat : ApproachStrategy I) (t : ℕ) (h : List I) (f : List I → ℝ) :
expectHistory strat (t + 1) h f = expectHistory strat t h fun (x : List I) => ∑ i : I, strat.prob x i * f (i :: x)

Discrete one-step expansion appending expectHistory strat (t + 1) h f.

theorem Cslib.MachineLearning.OnlineLearning.Blackwell.sq_expectHistory_le {I : Type u_1} [Fintype I] (strat : ApproachStrategy I) (t : ℕ) (h : List I) (f : List I → ℝ) :
expectHistory strat t h f ^ 2 ≤ expectHistory strat t h fun (x : List I) => f x ^ 2

Jensen / Cauchy–Schwarz inequality for expectHistory: 𝔼[f] ^ 2 ≤ 𝔼[f ^ 2].

theorem Cslib.MachineLearning.OnlineLearning.Blackwell.expectHistory_indicator_le {I : Type u_1} [Fintype I] (strat : ApproachStrategy I) (t : ℕ) (h : List I) (f : List I → ℝ) (hf : ∀ (x : List I), 0 ≤ f x) {c : ℝ} (hc : 0 < c) :
(expectHistory strat t h fun (x : List I) => if c ≤ f x then 1 else 0) ≤ expectHistory strat t h f / c

Markov's inequality for expectHistory: Pr[c ≤ f] ≤ 𝔼[f] / c for nonnegative f and c > 0.

def Cslib.MachineLearning.OnlineLearning.Blackwell.sumPayoff {I : Type u_1} {J : Type u_2} {E : Type u_3} [NormedAddCommGroup E] (m : I → J → E) (adv : List I → J) :
List I → E

Cumulative realized vector payoff along a reverse-ordered history h : List I against an adaptive adversary adv : List I → J (at step h, the adversary sees the realized prefix h and picks adv h).

@[simp]
theorem Cslib.MachineLearning.OnlineLearning.Blackwell.sumPayoff_nil {I : Type u_1} {J : Type u_2} {E : Type u_3} [NormedAddCommGroup E] (m : I → J → E) (adv : List I → J) :
sumPayoff m adv [] = 0
@[simp]
theorem Cslib.MachineLearning.OnlineLearning.Blackwell.sumPayoff_cons {I : Type u_1} {J : Type u_2} {E : Type u_3} [NormedAddCommGroup E] (m : I → J → E) (adv : List I → J) (i : I) (h : List I) :
sumPayoff m adv (i :: h) = sumPayoff m adv h + m i (adv h)
theorem Cslib.MachineLearning.OnlineLearning.Blackwell.blackwell_expect_dist_sq_le {I : Type u_1} {J : Type u_2} {E : Type u_3} [Fintype I] [NormedAddCommGroup E] [InnerProductSpace ℝ E] {S : Set E} (hc : IsComplete S) (hS : Convex ℝ S) {s₀ : E} (hs₀ : s₀ ∈ S) (m : I → J → E) {R : ℝ} (hRnn : 0 ≤ R) (hR : ∀ (i : I) (j : J), ‖m i j - s₀‖ ≤ R) (strat : ApproachStrategy I) (adv : List I → J) (hstep : ∀ (h : List I), 0 < h.length → have y := (↑h.length)⁻¹ • sumPayoff m adv h; have s := metricProjection S y; inner ℝ (y - s) (expectedPayoff m (strat.prob h) (adv h) - s) ≤ 0) (T : ℕ) (hT : 0 < T) :
(expectHistory strat T [] fun (h : List I) => distToSet S ((↑T)⁻¹ • sumPayoff m adv h) ^ 2) ≤ (2 * R) ^ 2 / ↑T

Randomized adaptive Blackwell squared-distance bound [Bla56]: if at every nonempty history h, strat.prob h places the expected vector payoff inside the supporting halfspace at s = metricProjection S (h.length⁻¹ • sumPayoff m adv h), then for all T ≥ 1, 𝔼[distToSet S (T⁻¹ • sumPayoff m adv h) ^ 2] ≤ (2 * R) ^ 2 / T.

theorem Cslib.MachineLearning.OnlineLearning.Blackwell.blackwell_expect_dist_le {I : Type u_1} {J : Type u_2} {E : Type u_3} [Fintype I] [NormedAddCommGroup E] [InnerProductSpace ℝ E] {S : Set E} (hc : IsComplete S) (hS : Convex ℝ S) {s₀ : E} (hs₀ : s₀ ∈ S) (m : I → J → E) {R : ℝ} (hRnn : 0 ≤ R) (hR : ∀ (i : I) (j : J), ‖m i j - s₀‖ ≤ R) (strat : ApproachStrategy I) (adv : List I → J) (hstep : ∀ (h : List I), 0 < h.length → have y := (↑h.length)⁻¹ • sumPayoff m adv h; have s := metricProjection S y; inner ℝ (y - s) (expectedPayoff m (strat.prob h) (adv h) - s) ≤ 0) (T : ℕ) (hT : 0 < T) :
(expectHistory strat T [] fun (h : List I) => distToSet S ((↑T)⁻¹ • sumPayoff m adv h)) ≤ 2 * R / √↑T

L¹ expected distance bound 𝔼[dist(x̄_T, S)] ≤ 2 * R / √T via Cauchy–Schwarz/Jensen.

theorem Cslib.MachineLearning.OnlineLearning.Blackwell.blackwell_prob_dist_ge_le {I : Type u_1} {J : Type u_2} {E : Type u_3} [Fintype I] [NormedAddCommGroup E] [InnerProductSpace ℝ E] {S : Set E} (hc : IsComplete S) (hS : Convex ℝ S) {s₀ : E} (hs₀ : s₀ ∈ S) (m : I → J → E) {R : ℝ} (hRnn : 0 ≤ R) (hR : ∀ (i : I) (j : J), ‖m i j - s₀‖ ≤ R) (strat : ApproachStrategy I) (adv : List I → J) (hstep : ∀ (h : List I), 0 < h.length → have y := (↑h.length)⁻¹ • sumPayoff m adv h; have s := metricProjection S y; inner ℝ (y - s) (expectedPayoff m (strat.prob h) (adv h) - s) ≤ 0) (T : ℕ) (hT : 0 < T) {ε : ℝ} (hε : 0 < ε) :
(expectHistory strat T [] fun (h : List I) => if ε ≤ distToSet S ((↑T)⁻¹ • sumPayoff m adv h) then 1 else 0) ≤ (2 * R) ^ 2 / (↑T * ε ^ 2)

Markov / Chebyshev tail probability bound Pr[dist(x̄_T, S) ≥ ε] ≤ (2 * R) ^ 2 / (T * ε ^ 2) for adaptive randomized Blackwell play.

structure Cslib.MachineLearning.OnlineLearning.Blackwell.FeedbackRule (I : Type u_4) (E : Type u_5) [Fintype I] :
Type (max u_4 u_5)

A stationary feedback rule choosing mixed weights prob y : I → ℝ from the current running average vector payoff y : E, independently of the adversary strategy.

  • prob : E → I → ℝ

    Mixed action weights chosen given current running average vector payoff y : E.

  • nonneg (y : E) (i : I) : 0 ≤ self.prob y i

    Every probability weight is nonnegative.

  • sum_eq_one (y : E) : ∑ i : I, self.prob y i = 1

    Weights sum to 1 at every vector y : E.

noncomputable def Cslib.MachineLearning.OnlineLearning.Blackwell.FeedbackRule.toStrategy {I : Type u_1} {J : Type u_2} {E : Type u_3} [Fintype I] [NormedAddCommGroup E] [InnerProductSpace ℝ E] (rule : FeedbackRule I E) (m : I → J → E) (adv : List I → J) :

Instantiate a feedback rule against a payoff matrix m and an adaptive adversary adv.

theorem Cslib.MachineLearning.OnlineLearning.Blackwell.exists_approachStrategy_of_response {I : Type u_1} {J : Type u_2} {E : Type u_3} [Fintype I] [NormedAddCommGroup E] [InnerProductSpace ℝ E] [Fintype J] [Nonempty I] {S : Set E} (hc : IsComplete S) (hS : Convex ℝ S) {s₀ : E} (hs₀ : s₀ ∈ S) (m : I → J → E) {R : ℝ} (hRnn : 0 ≤ R) (hR : ∀ (i : I) (j : J), ‖m i j - s₀‖ ≤ R) (hresp : SatisfiesResponseCondition m S) :
∃ (rule : FeedbackRule I E), (∀ (y : E) (j : J), have s := metricProjection S y; inner ℝ (y - s) (expectedPayoff m (rule.prob y) j - s) ≤ 0) ∧ ∀ (adv : List I → J) (T : ℕ), 0 < T → (expectHistory (rule.toStrategy m adv) T [] fun (h : List I) => distToSet S ((↑T)⁻¹ • sumPayoff m adv h) ^ 2) ≤ (2 * R) ^ 2 / ↑T ∧ (expectHistory (rule.toStrategy m adv) T [] fun (h : List I) => distToSet S ((↑T)⁻¹ • sumPayoff m adv h)) ≤ 2 * R / √↑T ∧ ∀ (ε : ℝ), 0 < ε → (expectHistory (rule.toStrategy m adv) T [] fun (h : List I) => if ε ≤ distToSet S ((↑T)⁻¹ • sumPayoff m adv h) then 1 else 0) ≤ (2 * R) ^ 2 / (↑T * ε ^ 2)

Blackwell's approachability theorem (existence / sufficiency) [Bla56]: for any nonempty complete convex set S, finite action game m : I → J → E, and s₀ ∈ S with ‖m i j - s₀‖ ≤ R, if SatisfiesResponseCondition m S holds, then there exists a single adversary-independent feedback rule rule : FeedbackRule I E such that against every adaptive adversary adv : List I → J, every horizon T ≥ 1, and every ε > 0:

  • ⟪y - s, m(rule.prob y, j) - s⟫ ≤ 0 for all y : E, j : J (s = metricProjection S y),
  • 𝔼[dist(x̄_T, S) ^ 2] ≤ (2 * R) ^ 2 / T,
  • 𝔼[dist(x̄_T, S)] ≤ 2 * R / √T, and
  • Pr[dist(x̄_T, S) ≥ ε] ≤ (2 * R) ^ 2 / (T * ε ^ 2).