Effective online mistake budgets and the four predicates of Theorem 7.3
DefinitionWeightedMajority_Shifting_Supplement_EffectiveBudgetsLet be nonnegative integers and for , where represents the paper's member . An online learner sees the complete list of preceding instance/label pairs and the current instance. It has budget for a target when, for every finite sequence consistent with , its number of mistakes is at most :
The four predicates are: (a) converges and is a computable real; (b) one real constant works for every effectively presented domain and every uniformly recursive binary pool, with an effective learner having budget for every ; (c) each such domain/pool has its own constant, inclusive cutoff and effective learner with the same eventual budgets; (d) the series converges.
These predicates retain the quantifier order of Theorem 7.3. Domains carry arbitrary Mathlib primitive-codable presentations; the pool's uncurried evaluator and the learner's uncurried history/current-instance function satisfy Mathlib Computable. The published computable-real predicate supplies recursive rational approximations of error at most . Summability is asserted separately, so a divergent series cannot use a default sum. The cutoff is zero-based like the member index.
import Definitions.Def_UnderstandingML_Online
import Definitions.Def_DetParamSVP_ComputableReal
namespace WeightedMajority.Shifting.Supplement
/-- Dyadic initial weight. Index `i : ℕ` means the paper's positive index `i+1`. -/
noncomputable def budgetWeight (M : ℕ → ℕ) (i : ℕ) : ℝ := 1 / (2 : ℝ) ^ M i
/-- A real mistake budget for one target, over all finite sequences and every horizon.
The learner is the published history/current-instance online algorithm. -/
def HasBudget {X : Type*} (A : UnderstandingML.OnlineAlg X Bool) (f : X → Bool)
(B : ℝ) : Prop :=
∀ (T : ℕ) (S : Fin T → X × Bool), (∀ t, (S t).2 = f (S t).1) →
(UnderstandingML.mistakes A S : ℝ) ≤ B
/-- Theorem 7.3(a): convergence and arbitrary-precision computability of the sum.
The computable real predicate is reused, including its recursive rational approximation. -/
def BudgetA (M : ℕ → ℕ) : Prop :=
Summable (budgetWeight M) ∧ DetParamSVP.IsComputableReal (∑' i, budgetWeight M i)
/-- Theorem 7.3(b). The constant precedes every domain, encoding and recursive pool.
`Primcodable X` is an effective presentation; all such presentations are quantified over.
Computability of the uncurried evaluator is uniform in the member index. -/
def BudgetB (M : ℕ → ℕ) : Prop :=
∃ c : ℝ, ∀ (X : Type) (_ : Primcodable X) (φ : ℕ → X → Bool),
Computable (Function.uncurry φ) →
∃ A : UnderstandingML.OnlineAlg X Bool, Computable (Function.uncurry A) ∧
∀ i, HasBudget A (φ i) ((M i : ℝ) + c)
/-- Theorem 7.3(c). Here the constant, cutoff and effective learner follow the pool.
The cutoff `j : ℕ` denotes the positive paper index `j+1`; `j ≤ i` is inclusive. -/
def BudgetC (M : ℕ → ℕ) : Prop :=
∀ (X : Type) (_ : Primcodable X) (φ : ℕ → X → Bool),
Computable (Function.uncurry φ) →
∃ (c : ℝ) (j : ℕ) (A : UnderstandingML.OnlineAlg X Bool),
Computable (Function.uncurry A) ∧ ∀ i, j ≤ i → HasBudget A (φ i) ((M i : ℝ) + c)
/-- Theorem 7.3(d): convergence, without asserting an effective sum. -/
def BudgetD (M : ℕ → ℕ) : Prop := Summable (budgetWeight M)
end WeightedMajority.Shifting.Supplement