Documentation

ReflectiveSubsystems.PoolLearner

A learner that meets the fiber bill within a square-root-of-logarithm factor #

[Discovery] §3.4 Proposition 3.14. A learner over C candidates (Learner) whose states at time t lie in a finset of at most 2 ^ (n + 2 t) states carried along by its transitions, the shape that the fiber bill of Proposition 3.12(ii) (Learner.exists_missCount_ge_of_fibers_card_le_pow) prices, misses at most √(λ (C - 1)) + 2 λ - 1 times on every realizable stream, with λ = ⌊log₂ C⌋ + 1, once n is at least ⌈log₂ ((C + 1) ^ 3)⌉ + 1.

The learner (Learner.poolLearner) keeps a pool of consecutive candidates, the set of its members that have agreed with every outcome since the pool began, and its number of misses so far capped at C. It predicts the majority of that set, true on a tie, and when no member is left it takes the next min C (n - ⌈log₂ ((C + 1) ^ 3)⌉ + 2 μ) candidates as its pool, μ the misses so far; past the last candidate it moves to one further state, which predicts true and stays.

Main results #

A state of the pool learner while a pool is open. first is the first candidate of the pool, size its nominal size, misses the number of misses so far capped at the number of candidates, and alive the set of members of the pool that have agreed with every outcome since the pool began.

  • first : ℕ

    The first candidate of the pool.

  • size : ℕ

    The nominal size of the pool.

  • misses : ℕ

    The number of misses so far, capped at the number of candidates.

  • alive : Finset (Fin C)

    The members of the pool that have agreed with every outcome since the pool began.

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

      The candidates of a pool. Those among the C candidates numbered from s to s + b - 1.

      Equations
      Instances For

        The size of the pool taken after m misses, among C candidates, for the parameter n: min C (n - L + 2 m) with L = ⌈log₂ ((C + 1) ^ 3)⌉.

        Equations
        Instances For

          The prediction of an open pool: the majority of the members that have agreed so far, true on a tie.

          Equations
          Instances For

            The misses count after a step: one more, capped at C, when the prediction of the open pool differs from the outcome.

            Equations
            Instances For

              The transition of the pool learner. The members that disagree with the outcome leave. The misses count goes up by one, capped at C, when the prediction was wrong. When no member is left the next pool is taken, of the size for the misses so far, from the candidate after the last of the pool, and past the last candidate the learner moves to the further state none, which stays.

              Equations
              Instances For
                @[reducible]

                The pool learner over C candidates with parameter n. A state is an open pool (PoolState) or the further state none. The start is the first pool, the candidates numbered below poolSize C n 0, with no misses. It predicts the majority of the members that have agreed so far (PoolState.predict), true at the further state, and moves by poolStep.

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

                  The sets holding the states of the pool learner at time t: the further state and the open pools whose first candidate is at most C, whose misses are at most min t C, whose nominal size is at most poolSize C n (min t C) and whose members that have agreed so far lie in the pool (mem_poolFiber).

                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    theorem ReflectiveSubsystems.Learner.mem_poolFiber {C n t : ℕ} {σ : Option (PoolState C)} :
                    σ ∈ poolFiber C n t ↔ σ = none ∨ ∃ (q : PoolState C), σ = some q ∧ q.first ≤ C ∧ q.misses ≤ min t C ∧ q.size ≤ poolSize C n (min t C) ∧ q.alive ⊆ candidatePool C q.first q.size

                    Membership in the sets holding the states of the pool learner: the further state, or an open pool with its first candidate at most C, at most min t C misses, a nominal size at most poolSize C n (min t C), and its members that have agreed so far inside the pool.

                    The start of the pool learner lies in the first set. [Discovery] §3.4 Proposition 3.14.

                    theorem ReflectiveSubsystems.Learner.poolLearner_step_mem (C n t : ℕ) (s : (poolLearner C n).S) :
                    s ∈ poolFiber C n t → ∀ (v : Fin C → Bool) (y : Bool), (poolLearner C n).step s v y ∈ poolFiber C n (t + 1)

                    Every transition of the pool learner carries the set at time t into the set at time t + 1, at every vector and outcome: a step raises the number of misses by at most one, the sizes of pools grow with it, and the members that have agreed stay inside the pool. [Discovery] §3.4 Proposition 3.14.

                    theorem ReflectiveSubsystems.Learner.poolFiber_card_le (C n : ℕ) (hn : Nat.clog 2 ((C + 1) ^ 3) + 1 ≤ n) (t : ℕ) :
                    (poolFiber C n t).card ≤ 2 ^ (n + 2 * t)

                    The sets holding the states of the pool learner have at most 2 ^ (n + 2 t) states at time t, once n is at least ⌈log₂ ((C + 1) ^ 3)⌉ + 1. The count is at most (C + 1) ^ 3 * 2 ^ poolSize C n (min t C): the first candidate and the misses take at most C + 1 values each and the members that have agreed so far at most 2 to the nominal size. [Discovery] §3.4 Proposition 3.14.

                    theorem ReflectiveSubsystems.Learner.poolLearner_missCount_le (C n : ℕ) (hC : 0 < C) (hn : Nat.clog 2 ((C + 1) ^ 3) + 1 ≤ n) {v : ℕ → Fin C → Bool} {y : ℕ → Bool} (hr : FiniteLearner.Realizable v y) (m : ℕ) :
                    (poolLearner C n).missCount v y m + 1 ≤ ((Nat.log 2 C + 1) * (C - 1)).sqrt + 2 * (Nat.log 2 C + 1)

                    The count of the pool learner. Over every realizable stream and at every horizon m, the learner has missed at most √(λ (C - 1)) + 2 λ - 1 times, λ = ⌊log₂ C⌋ + 1, stated additively as missCount + 1 ≤ √(λ (C - 1)) + 2 λ with the integer square root. For the open pool and the number K of misses when it began: while the pool has a member that has agreed so far, at most ⌊log₂ C⌋ misses fall in it, because each at least halves those members; the pool taken after K misses has at least 1 + 2 K candidates when another follows it; and so (K - λ) ^ 2 ≤ λ * (first candidate of the pool), which is at most λ (C - 1). [Discovery] §3.4 Proposition 3.14.

                    theorem ReflectiveSubsystems.Learner.exists_missCount_le_of_fibers_card_le_pow (C n : ℕ) (hC : 0 < C) (hn : Nat.clog 2 ((C + 1) ^ 3) + 1 ≤ n) :
                    ∃ (L : Learner C) (Ω : ℕ → Finset L.S), L.start ∈ Ω 0 ∧ (∀ (t : ℕ), ∀ s ∈ Ω t, ∀ (v : Fin C → Bool) (y : Bool), L.step s v y ∈ Ω (t + 1)) ∧ (∀ (t : ℕ), (Ω t).card ≤ 2 ^ (n + 2 * t)) ∧ ∀ (v : ℕ → Fin C → Bool) (y : ℕ → Bool), FiniteLearner.Realizable v y → ∀ (m : ℕ), L.missCount v y m + 1 ≤ ((Nat.log 2 C + 1) * (C - 1)).sqrt + 2 * (Nat.log 2 C + 1)

                    A learner meeting the fiber growth 2 ^ (n + 2 t) with a count of order √(λ C). For n at least ⌈log₂ ((C + 1) ^ 3)⌉ + 1 and C positive there are a learner and finsets Ω t of states, holding the start, carried along by every transition, of at most 2 ^ (n + 2 t) states at time t, such that over every realizable stream the count at every horizon is at most √(λ (C - 1)) + 2 λ - 1, λ = ⌊log₂ C⌋ + 1, stated additively. This is the conditional assembly of the three statements about poolLearner and poolFiber. [Discovery] §3.4 Proposition 3.14.

                    theorem ReflectiveSubsystems.Learner.exists_missCount_le_of_fibers_card_le_pow_nonvacuous :
                    ∃ (C : ℕ) (n : ℕ), 0 < C ∧ Nat.clog 2 ((C + 1) ^ 3) + 1 ≤ n ∧ ((Nat.log 2 C + 1) * (C - 1)).sqrt + 2 * (Nat.log 2 C + 1) < C

                    The bound of the pool learner is below C for some C and n meeting its hypotheses. At 100 candidates and n = 21, ⌈log₂ (101 ^ 3)⌉ + 1 = 21 and √(7 * 99) + 2 * 7 = 26 + 14 = 40 < 100, so the count improves on the count C - 1 of a learner with a state for each candidate. [Discovery] §3.4 Proposition 3.14.