Documentation

ReflectiveSubsystems.SlackTwoParty

A two-party learner whose symbols may serve later vectors #

The two-party model of ReflectiveSubsystems/LaggedTwoParty.lean has an outside party that sees every vector of the candidates' predictions but learns each outcome L steps late, and an inside party that sees only the outside's symbols, one per step, and the outcomes, and predicts. Here the inside party may wait for the symbols of the next Δ steps before it predicts step t: it predicts step t from the symbols at steps 0 … t + Δ and the outcomes before t, so a symbol may serve a vector up to Δ steps before it. At Δ = 0 this is the model of ReflectiveSubsystems/LaggedTwoParty.lean.

Main results #

The method #

A candidate is consistent with a residue's known outcomes when it agrees with each of them. The outcome of step s is known to the outside by step τ when s ≤ τ - L, and the earlier steps s < t of the residue of t = τ - Δ all satisfy s ≤ t - (L - Δ) = τ - L, so at step τ the outside knows every earlier outcome of the residue of t: on that residue the learner is the halving learner. A miss at a step of a residue leaves at most half of that residue's consistent candidates, and a candidate that realizes the stream always stays, so a residue misses at most the logarithm of the number of candidates, and the L - Δ residues add.

A two-party learner whose symbols may serve later vectors. The outside party sees the vectors of the candidates' predictions at once but learns the outcome of step s only at step s + L; the inside party sees only the outside's symbols and the outcomes, and predicts step t after the symbol of step t + Δ. At Δ = 0 this is LaggedTwoPartyLearner.

  • speak (t : ℕ) : (Fin (t + 1) → H → Bool) → (Fin (t + 1 - L) → Bool) → M

    The outside's symbol at step t, from the vectors at steps 0 … t and the outcomes at steps 0 … t - L (none while t < L).

  • predict (t : ℕ) : (Fin (t + Δ + 1) → M) → (Fin t → Bool) → Bool

    The inside's prediction at step t, from the symbols at steps 0 … t + Δ and the outcomes at steps 0 … t - 1.

Instances For
    def ReflectiveSubsystems.SlackTwoPartyLearner.message {H M : Type} {L Δ : ℕ} (A : SlackTwoPartyLearner H M L Δ) (v : ℕ → H → Bool) (y : ℕ → Bool) (t : ℕ) :
    M

    The symbol at a step. What the outside sends at step t on the stream (v, y): its function speak of the vectors up to t and the outcomes up to the lag.

    Equations
    Instances For
      def ReflectiveSubsystems.SlackTwoPartyLearner.prediction {H M : Type} {L Δ : ℕ} (A : SlackTwoPartyLearner H M L Δ) (v : ℕ → H → Bool) (y : ℕ → Bool) (t : ℕ) :

      The prediction at a step. What the inside predicts at step t on the stream (v, y): its function predict of the symbols up to t + Δ and the outcomes before t.

      Equations
      Instances For
        def ReflectiveSubsystems.SlackTwoPartyLearner.missCount {H M : Type} {L Δ : ℕ} (A : SlackTwoPartyLearner H M L Δ) (v : ℕ → H → Bool) (y : ℕ → Bool) (n : ℕ) :

        The count. The number of steps t < n at which the inside's prediction differs from the outcome.

        Equations
        Instances For

          The model without slack as the case of no slack.

          Equations
          Instances For
            theorem ReflectiveSubsystems.LaggedTwoPartyLearner.missCount_toSlack {H M : Type} {L : ℕ} (A : LaggedTwoPartyLearner H M L) (v : ℕ → H → Bool) (y : ℕ → Bool) (n : ℕ) :
            A.toSlack.missCount v y n = A.missCount v y n

            The miss count of a learner without slack is that of its image in the model with slack.

            def ReflectiveSubsystems.interleavedHalving.consistent (H : Type) [Fintype H] (E t : ℕ) (u : ℕ → H → Bool) (w : ℕ → Bool) :

            The candidates consistent with the outcomes w known at the steps s < t of the residue of t modulo E, the vectors being u.

            Equations
            Instances For
              def ReflectiveSubsystems.interleavedHalving.vote (H : Type) [Fintype H] (E t : ℕ) (u : ℕ → H → Bool) (w : ℕ → Bool) :

              The majority vote, at the vector u t, of the consistent candidates: true exactly when more of them vote true than false.

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

                Interleaved halving. One halving learner for the steps of each residue modulo L - Δ: at step τ ≥ Δ the outside sends the majority vote, at the vector of step τ - Δ, of the candidates agreeing with every known outcome of that step's residue; the inside predicts the bit sent at t + Δ. At a step τ < Δ the outside sends false.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  theorem ReflectiveSubsystems.missCount_interleavedHalving_le {H : Type} [Fintype H] [DecidableEq H] {L Δ : ℕ} (hΔ : Δ < L) {v : ℕ → H → Bool} {y : ℕ → Bool} (hr : LaggedTwoPartyLearner.Realizable v y) (n : ℕ) :
                  (interleavedHalving H L Δ).missCount v y n ≤ (L - Δ) * Nat.log 2 (Fintype.card H)

                  The bound of interleaved halving. At a slack below the lag, on every realizable stream and at every horizon, interleaved halving misses at most Nat.log 2 of the number of candidates times L - Δ: its L - Δ residues are each a halving learner, whose misses each leave at most half of the consistent candidates.

                  The hypotheses of the bound hold jointly. At no slack, a lag of one step and two candidates, one of which is right at every step.

                  theorem ReflectiveSubsystems.missCount_interleavedHalving_attained :
                  (LaggedTwoPartyLearner.Realizable (fun (x : ℕ) (h : Fin 2) => decide (h = 1)) fun (x : ℕ) => true) ∧ (interleavedHalving (Fin 2) 1 0).missCount (fun (x : ℕ) (h : Fin 2) => decide (h = 1)) (fun (x : ℕ) => true) 1 = (1 - 0) * Nat.log 2 (Fintype.card (Fin 2))

                  The bound is attained. At no slack, a lag of one step and two candidates, the second right at every step, interleaved halving misses at the first step, where the votes tie and the tie goes to false: its count to horizon one is (1 - 0) * Nat.log 2 2.