Documentation

ReflectiveSubsystems.ClassLearner

The count of a finite-state learner over a class with structure #

[Discovery] §3.4 prices the count of a learner over C candidates whose vector of predictions at a stream's points may be any vector. This file prices it over a hypothesis class H : Fin C → X → Bool on a domain, a point giving the learner the vector fun c => H c x, in two anchors ([Discovery] §3.4 Proposition 3.20).

Main results #

At C = N + 1 states over C candidates with every vector on offer the least count is C - 1 ([Discovery] §3.4 Proposition 3.9); over the thresholds the same states price it at ⌊log₂ (C)⌋.

theorem ReflectiveSubsystems.FiniteLearner.exists_missCount_mul_clog_ge_of_shatters {C : ℕ} {X : Type} (H : Fin C → X → Bool) (D : Finset (Fin C)) (hD : D.Nonempty) (hsh : ∀ A ⊆ D, ∃ (x : X), ∀ c ∈ D, H c x = decide (c ∈ A)) (L : FiniteLearner C) (hS : 2 ≤ Fintype.card L.S) :
∃ (x : ℕ → X), ∃ c ∈ D, ∃ (n : ℕ), D.card ≤ Nat.clog 2 (Fintype.card L.S) * L.missCount (fun (t : ℕ) (c' : Fin C) => H c' (x t)) (fun (t : ℕ) => H c (x t)) n + 1

The dual-dimension bound ([Discovery] §3.4 Proposition 3.11 carried to a class on a domain). A hypothesis class H : Fin C → X → Bool on a domain, a point x giving the learner the vector fun c => H c x. If the points shatter a set D of candidates, every labelling of D being the vector of some point on D, then every learner with at least two states has a stream of points and a realizer c in D along which its count is at least (D.card - 1) / ⌈log₂ S⌉, in the additive form D.card ≤ ⌈log₂ S⌉ * m + 1. The learner that reads the class through shattering points is a learner over D.card candidates, to which the bound at every number of states applies.

theorem ReflectiveSubsystems.FiniteLearner.exists_missCount_mul_clog_ge_of_shatters_nonvacuous :
∃ (C : ℕ) (X : Type) (H : Fin C → X → Bool) (D : Finset (Fin C)) (L : FiniteLearner C), D.Nonempty ∧ 2 ≤ D.card ∧ (∀ A ⊆ D, ∃ (x : X), ∀ c ∈ D, H c x = decide (c ∈ A)) ∧ 2 ≤ Fintype.card L.S

The dual-dimension bound applies to a learner. At two candidates, the points of the domain Fin 2 → Bool read off a candidate each, so they shatter all of Fin 2, which has two members, and the index learner has two states: the hypotheses hold together, at a shattered set where the bound has content.

The thresholds on N points. The N + 1 hypotheses k, labelling the point x true exactly when x < k.

Equations
Instances For

    A learner over a class on a domain, read as an online learner. The history's points give the learner the vectors fun c => H c x of a hypothesis class H : Fin C → X → Bool, the history's labels its outcomes; the prediction is the learner's at the state the run reaches, on the vector of the next point.

    Equations
    Instances For
      theorem ReflectiveSubsystems.Learner.exists_missCount_ge_log_thresholdClass {N : ℕ} (hN : 0 < N) (L : Learner (N + 1)) :
      ∃ (x : ℕ → Fin N) (k : Fin (N + 1)) (n : ℕ), Nat.log 2 (N + 1) ≤ L.missCount (fun (t : ℕ) (c : Fin (N + 1)) => thresholdClass N c (x t)) (fun (t : ℕ) => thresholdClass N k (x t)) n

      The Littlestone lower bound for the thresholds, over every learner (Littlestone, 1988), finitely many states or not. On N > 0 points, every learner over the N + 1 thresholds has a stream of points and a threshold along which, at some horizon, it misses at least ⌊log₂ (N + 1)⌋ times, the Littlestone dimension of the class: the point that splits the thresholds still consistent as evenly as possible, the outcome against the prediction, so every step is a miss and the thresholds that remain are at least half, rounded down. It is the instance of Littlestone's Lemma 1 as formalized in cslib-frontier, at a complete mistake tree of the thresholds, the learner read as an online learner. See [Discovery] §3.4 Proposition 3.20.

      Binary search over the thresholds, on as many states as candidates. The states are the nodes of the balanced search tree on the N + 1 candidates, each candidate the middle of exactly one node; at a node it predicts the middle candidate's value, stays on a hit, and on a miss moves to the left half when it predicted true and to the right half when it predicted false.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For

        The search learner has one state for each candidate.

        theorem ReflectiveSubsystems.FiniteLearner.thresholdSearch_missCount_le (N : ℕ) (x : ℕ → Fin N) (k : Fin (N + 1)) (n : ℕ) :
        (thresholdSearch N).missCount (fun (t : ℕ) (c : Fin (N + 1)) => thresholdClass N c (x t)) (fun (t : ℕ) => thresholdClass N k (x t)) n ≤ Nat.log 2 (N + 1)

        The search learner's count is at most the height of the tree on every stream a threshold realizes: its count is at most ⌊log₂ (N + 1)⌋ ([Discovery] §3.4 Proposition 3.20). The invariant along a run is that the realizer lies in the node's interval and that the misses so far, with the logarithm of the interval's size, stay at most ⌊log₂ (N + 1)⌋; a miss moves to a half of at most half the size.

        theorem ReflectiveSubsystems.FiniteLearner.exists_card_eq_missCount_le_thresholdClass_iff {N : ℕ} (hN : 0 < N) (M : ℕ) :
        (∃ (L : FiniteLearner (N + 1)), Fintype.card L.S = N + 1 ∧ ∀ (x : ℕ → Fin N) (k : Fin (N + 1)) (n : ℕ), L.missCount (fun (t : ℕ) (c : Fin (N + 1)) => thresholdClass N c (x t)) (fun (t : ℕ) => thresholdClass N k (x t)) n ≤ M) ↔ Nat.log 2 (N + 1) ≤ M

        The exact price of the count over the thresholds at as many states as candidates ([Discovery] §3.4 Proposition 3.20). On N > 0 points, a learner with exactly N + 1 states and a count at most M on every stream a threshold realizes exists if and only if ⌊log₂ (N + 1)⌋ ≤ M: binary search (thresholdSearch) meets the bound, and the lower bound over every learner (Learner.exists_missCount_ge_log_thresholdClass, Littlestone, 1988) holds at the learner's states however many.