Documentation

ReflectiveSubsystems.LearnerFibers

Learners with any states: what a state tells apart, and the count billed by the fibers #

[Discovery] §3.4 Proposition 3.11 prices the error count of a deterministic learner by what one state cannot tell apart. This file states the learner over any type of states (Learner), the relation behind the proposition (Learner.Reaches: a candidate reaches a state from a state when the state errs against it at some vector and moves to that state at the outcome the candidate gives), and the proposition's first clause (Learner.ForgettingBound): from a state, among at least two candidates, one state is reached by all but max 1 ⌈log₂ m⌉ of them, m the size of any finset holding the reached states. The clause is proved (Learner.forgettingBound), from Erdős (1963, Theorem 1) on the property B of families of sets.

Main results #

A deterministic learner over C candidates, with any type of states. The type of states with a start state, a prediction from the state and the vector of the candidates' predictions, and a transition from the state, that vector and the outcome. A FiniteLearner is one whose states are finitely many (FiniteLearner.toLearner).

  • S : Type

    The type of states.

  • start : self.S

    The state a run starts in.

  • pred : self.S → (Fin C → Bool) → Bool

    The prediction of a state on the vector of the candidates' predictions.

  • step : self.S → (Fin C → Bool) → Bool → self.S

    The transition on the vector of the candidates' predictions and the outcome.

Instances For
    def ReflectiveSubsystems.Learner.state {C : ℕ} (L : Learner C) (v : ℕ → Fin C → Bool) (y : ℕ → Bool) :
    ℕ → L.S

    The run. The state sequence from the start: the transition applied, at each time, to the current state, that time's prediction vector and that time's outcome.

    Equations
    Instances For
      def ReflectiveSubsystems.Learner.missCount {C : ℕ} (L : Learner C) (v : ℕ → Fin C → Bool) (y : ℕ → Bool) (n : ℕ) :

      The count. The number of times t < n at which the learner's prediction, from its state at time t and that time's prediction vector, differs from the outcome.

      Equations
      Instances For
        def ReflectiveSubsystems.Learner.Reaches {C : ℕ} (L : Learner C) (s : L.S) (c : Fin C) (σ : L.S) :

        A candidate reaches a state. From the state s, the candidate c reaches σ when at some vector the state errs against the candidate, its prediction differing from the candidate's value, and moves to σ at the outcome the candidate gives ([Discovery] §3.4 Proposition 3.11).

        Equations
        Instances For

          A state tells apart all but a logarithm of the candidates that reach it ([Discovery] §3.4 Proposition 3.11(i)), in the form the counting arguments use. For every learner L, state s, finset R of states that holds every state some member of U reaches from s, and set U of at least two candidates, some state σ of R is reached from s by all but max 1 ⌈log₂ |R|⌉ members of U. The max 1 is needed: a state dictating one candidate has one successor and leaves that candidate out. It is proved as Learner.forgettingBound.

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

            A state tells apart all but a logarithm of the candidates that reach it ([Discovery] §3.4 Proposition 3.11(i)), from Erdős (1963, Theorem 1). Suppose every state of R leaves out at least p = max 1 ⌈log₂ |R|⌉ + 1 members of U from those that reach it. The sets left out number at most 2 ^ (p - 1) and have at least p ≥ 2 members each, so some set B of candidates meets each and contains none (PropertyB.of_card_le_two_pow). At the vector true on B and outside U, false on U outside B, the state errs against every member of U in one colour at the outcome they share, so they reach one successor, which lies in R, and the set left out at it misses that colour, a contradiction.

            theorem ReflectiveSubsystems.Learner.exists_missCount_ge_of_fibers {C : ℕ} (L : Learner C) (Ω : ℕ → Finset L.S) (h0 : L.start ∈ Ω 0) (hΩ : ∀ (t : ℕ), ∀ s ∈ Ω t, ∀ (v : Fin C → Bool) (y : Bool), L.step s v y ∈ Ω (t + 1)) (K : ℕ) (hK : ∑ i ∈ Finset.range K, max 1 (Nat.clog 2 (Ω (i + 1)).card) + 1 < C) :
            ∃ (v : ℕ → Fin C → Bool) (y : ℕ → Bool), FiniteLearner.Realizable v y ∧ ∃ (n : ℕ), K + 1 ≤ L.missCount v y n

            The fiber bill. Let Ω t be finsets of states, holding the start at time 0 and carried into Ω (t + 1) by every transition. Over some realizable stream the count reaches K + 1 at some horizon whenever the logarithms of the fibers, max 1 ⌈log₂ |Ω (i + 1)|⌉ for i < K, sum to less than C - 1. Run along a candidate: at each step Learner.forgettingBound at the current state, with the fiber of the next time as the finset of states, gives a state reached by all but max 1 ⌈log₂ |Ω (i + 1)|⌉ of the candidates still in play, and the run goes on from it; this applies [Discovery] §3.4 Proposition 3.11(i) step by step.

            theorem ReflectiveSubsystems.Learner.exists_missCount_ge_of_fibers_card_le_pow {C : ℕ} (L : Learner C) (Ω : ℕ → Finset L.S) (h0 : L.start ∈ Ω 0) (hΩ : ∀ (t : ℕ), ∀ s ∈ Ω t, ∀ (v : Fin C → Bool) (y : Bool), L.step s v y ∈ Ω (t + 1)) (n : ℕ) (hcard : ∀ (t : ℕ), (Ω t).card ≤ 2 ^ (n + 2 * t)) (K : ℕ) (hK : K * (K + 1 + n) + 1 < C) :
            ∃ (v : ℕ → Fin C → Bool) (y : ℕ → Bool), FiniteLearner.Realizable v y ∧ ∃ (m : ℕ), K + 1 ≤ L.missCount v y m

            The fiber bill for fibers of at most 2 ^ (n + 2 t) states. If the finsets carrying the start satisfy |Ω t| ≤ 2 ^ (n + 2 t) at every time, then the count reaches K + 1 at some horizon over some realizable stream whenever K * (K + 1 + n) + 1 < C: the logarithm of the fiber at time i + 1 is at most n + 2 (i + 1), and those sum to K * n + K * (K + 1).

            theorem ReflectiveSubsystems.Learner.exists_missCount_ge_of_fibers_nonvacuous :
            ∃ (C : ℕ) (L : Learner C) (Ω : ℕ → Finset L.S), Infinite L.S ∧ L.start ∈ Ω 0 ∧ (∀ (t : ℕ), ∀ s ∈ Ω t, ∀ (v : Fin C → Bool) (y : Bool), L.step s v y ∈ Ω (t + 1)) ∧ (∀ (t : ℕ), (Ω t).card < (Ω (t + 1)).card) ∧ ∃ (K : ℕ), 1 ≤ K ∧ ∑ i ∈ Finset.range K, max 1 (Nat.clog 2 (Ω (i + 1)).card) + 1 < C

            The fiber bill applies beyond the finite-state learners. A learner over three candidates whose type of states is infinite, with fibers that grow with the time, and a count to bill for K = 1: the hypotheses of the fiber bill hold together, so the bill is not vacuous.

            theorem ReflectiveSubsystems.Learner.exists_missCount_ge_of_fibers_card_le_pow_nonvacuous :
            ∃ (C : ℕ) (L : Learner C) (Ω : ℕ → Finset L.S) (n : ℕ) (K : ℕ), Infinite L.S ∧ L.start ∈ Ω 0 ∧ (∀ (t : ℕ), ∀ s ∈ Ω t, ∀ (v : Fin C → Bool) (y : Bool), L.step s v y ∈ Ω (t + 1)) ∧ (∀ (t : ℕ), (Ω t).card < (Ω (t + 1)).card) ∧ (∀ (t : ℕ), (Ω t).card ≤ 2 ^ (n + 2 * t)) ∧ 1 ≤ K ∧ K * (K + 1 + n) + 1 < C

            The fiber bill for fibers of at most 2 ^ (n + 2 t) states applies beyond the finite-state learners. A learner over four candidates whose type of states is infinite, with fibers that grow with the time and satisfy |Ω t| ≤ 2 ^ (0 + 2 t), at n = 0 and K = 1, where K * (K + 1 + n) + 1 < C: the hypotheses hold together.

            theorem ReflectiveSubsystems.Learner.exists_missCount_ge_of_branching {C : ℕ} (hC : 0 < C) (L : Learner C) (m : ℕ) (hm : 2 ≤ m) (R : L.S → Finset L.S) (hR : ∀ (s : L.S) (v : Fin C → Bool) (y : Bool), L.step s v y ∈ R s) (hcard : ∀ (s : L.S), (R s).card ≤ m) :
            ∃ (v : ℕ → Fin C → Bool) (y : ℕ → Bool), FiniteLearner.Realizable v y ∧ ∃ (t : ℕ), C ≤ Nat.clog 2 m * L.missCount v y t + 1

            The branching bill ([Discovery] §3.4 Proposition 3.23). If every state s of a learner has a finset R s of at most m ≥ 2 states holding every state it moves to, at every vector and outcome, then over some realizable stream the count reaches C ≤ ⌈log₂ m⌉ * count + 1 at some horizon, with no hypothesis on the start. The induction of the fiber bill, with R s in place of the fiber of the next time: at each step Learner.forgettingBound at the current state, with R s as the finset of states, gives a state reached by all but ⌈log₂ m⌉ of the candidates still in play.

            theorem ReflectiveSubsystems.Learner.exists_missCount_ge_of_branching_nonvacuous :
            ∃ (C : ℕ) (_ : 0 < C) (L : Learner C) (m : ℕ) (R : L.S → Finset L.S), 3 ≤ C ∧ m = 2 ∧ 2 ≤ m ∧ (∀ (s : L.S) (v : Fin C → Bool) (y : Bool), L.step s v y ∈ R s) ∧ ∀ (s : L.S), (R s).card ≤ m

            The branching bill applies to a learner. Over three candidates, the learner that moves to the outcome it sees has two states, each of which moves to either: the finsets of successors hold every transition and have at most m = 2 members, so the hypotheses of the bill hold together.

            A finite-state learner as a learner. The same start, prediction and transition.

            Equations
            Instances For
              theorem ReflectiveSubsystems.FiniteLearner.missCount_toLearner {C : ℕ} (L : FiniteLearner C) (v : ℕ → Fin C → Bool) (y : ℕ → Bool) (n : ℕ) :
              L.toLearner.missCount v y n = L.missCount v y n

              The run and the count of a finite-state learner are those of the learner it determines.

              theorem ReflectiveSubsystems.FiniteLearner.exists_missCount_mul_clog_ge {C : ℕ} (hC : 0 < C) (L : FiniteLearner C) (hS : 2 ≤ Fintype.card L.S) :
              ∃ (v : ℕ → Fin C → Bool) (y : ℕ → Bool), Realizable v y ∧ ∃ (n : ℕ), C ≤ Nat.clog 2 (Fintype.card L.S) * L.missCount v y n + 1

              Proposition 3.11(ii): at every number of states ([Discovery] §3.4 Proposition 3.11(ii)), from the first clause (Learner.forgettingBound). A learner with S ≥ 2 states has, over some realizable stream and at some horizon, a count m with C ≤ ⌈log₂ S⌉ * m + 1, that is, a count of at least (C - 1) / ⌈log₂ S⌉: the fiber bill with every fiber the whole set of states, each of the first K fibers costing ⌈log₂ S⌉.

              theorem ReflectiveSubsystems.FiniteLearner.exists_missCount_ge_of_card_le_add {C : ℕ} (hC : 0 < C) (t : ℕ) (L : FiniteLearner C) (hcard : Fintype.card L.S ≤ C + t) :
              ∃ (v : ℕ → Fin C → Bool) (y : ℕ → Bool), Realizable v y ∧ ∃ (n : ℕ), C ≤ L.missCount v y n + 1 + t * (Nat.clog 2 (C + t) - 1)

              Proposition 3.11(iii): past C states ([Discovery] §3.4 Proposition 3.11(iii)), from the first clause (Learner.forgettingBound). A learner with at most C + t states has, over some realizable stream and at some horizon, a count m with C ≤ m + 1 + t * (⌈log₂ (C + t)⌉ - 1). A learner some candidate of which has no state dictating it misses at every step of a realizable stream (exists_adversary). Otherwise at most t states dictate no candidate. A state dictating a candidate removes at most that candidate from the ones still in play at one miss, and at a state dictating none the first clause leaves all but ⌈log₂ (C + t)⌉ of them together; the further states a surviving candidate reaches along its misses number one fewer after such a step, since a candidate that returns to a further state along its misses has arbitrarily many misses from it.

              The bound at every number of states applies to a learner. At three candidates, the trio chain with one trio has four states, so the hypotheses of the bound hold together.

              The bound past C states applies to a learner. At three candidates and one state past them, the trio chain with one trio has C + 1 states, so the hypotheses of the bound hold together.