Documentation

LeanMachineLearning.Online.Bandit.ArrayProbSpace

Array-of-rewards probability space for stochastic bandits #

We build a particular probability space for stochastic bandits, called the "array model", in which an infinite array of i.i.d. rewards is first produced for all actions. When the algorithm chooses action a for the nth time, it receives the reward in the row a of the array and column n.

Some statements about bandit algorithms are easier to prove in this space, and can then be transferred to any other probability space using the fact that the conditional distributions of the arms and rewards specified in the bandit model determine their laws uniquely.

Main definitions #

noncomputable def Bandits.streamMeasure {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} (ฮฝ : ProbabilityTheory.Kernel ๐“ ๐“ก) :
MeasureTheory.Measure (โ„• โ†’ ๐“ โ†’ ๐“ก)

Measure of an infinite stream of rewards from each action.

Equations
Instances For
    instance Bandits.instIsProbabilityMeasureForallNatForallStreamMeasureOfIsMarkovKernel {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} (ฮฝ : ProbabilityTheory.Kernel ๐“ ๐“ก) [ProbabilityTheory.IsMarkovKernel ฮฝ] :
    theorem Bandits.hasLaw_eval_streamMeasure {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} (ฮฝ : ProbabilityTheory.Kernel ๐“ ๐“ก) [ProbabilityTheory.IsMarkovKernel ฮฝ] (n : โ„•) :
    ProbabilityTheory.HasLaw (fun (h : โ„• โ†’ ๐“ โ†’ ๐“ก) => h n) (MeasureTheory.Measure.infinitePi โ‡‘ฮฝ) (streamMeasure ฮฝ)
    theorem Bandits.hasLaw_eval_eval_streamMeasure {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} (ฮฝ : ProbabilityTheory.Kernel ๐“ ๐“ก) [ProbabilityTheory.IsMarkovKernel ฮฝ] (n : โ„•) (a : ๐“) :
    ProbabilityTheory.HasLaw (fun (h : โ„• โ†’ ๐“ โ†’ ๐“ก) => h n a) (ฮฝ a) (streamMeasure ฮฝ)
    theorem Bandits.hasLaw_snd_apply_prod_streamMeasure {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} {ฮฉ : Type u_3} {mฮฉ : MeasurableSpace ฮฉ} (ฮผ : MeasureTheory.Measure ฮฉ) [MeasureTheory.IsProbabilityMeasure ฮผ] (ฮฝ : ProbabilityTheory.Kernel ๐“ ๐“ก) [ProbabilityTheory.IsMarkovKernel ฮฝ] (n : โ„•) (a : ๐“) :
    ProbabilityTheory.HasLaw (fun (ฯ‰ : ฮฉ ร— (โ„• โ†’ ๐“ โ†’ ๐“ก)) => ฯ‰.2 n a) (ฮฝ a) (ฮผ.prod (streamMeasure ฮฝ))

    Under a product measure ฮผ.prod (streamMeasure ฮฝ), the entry (n, a) of the reward array has law ฮฝ a.

    theorem Bandits.identDistrib_eval_eval_id_streamMeasure {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} (ฮฝ : ProbabilityTheory.Kernel ๐“ ๐“ก) [ProbabilityTheory.IsMarkovKernel ฮฝ] (n : โ„•) (a : ๐“) :
    ProbabilityTheory.IdentDistrib (fun (h : โ„• โ†’ ๐“ โ†’ ๐“ก) => h n a) id (streamMeasure ฮฝ) (ฮฝ a)
    theorem Bandits.integrable_eval_streamMeasure {๐“ : Type u_1} {m๐“ : MeasurableSpace ๐“} (ฮฝ : ProbabilityTheory.Kernel ๐“ โ„) [ProbabilityTheory.IsMarkovKernel ฮฝ] (n : โ„•) (a : ๐“) (h_int : MeasureTheory.Integrable id (ฮฝ a)) :
    MeasureTheory.Integrable (fun (h : โ„• โ†’ ๐“ โ†’ โ„) => h n a) (streamMeasure ฮฝ)
    theorem Bandits.integral_eval_streamMeasure {๐“ : Type u_1} {m๐“ : MeasurableSpace ๐“} (ฮฝ : ProbabilityTheory.Kernel ๐“ โ„) [ProbabilityTheory.IsMarkovKernel ฮฝ] (n : โ„•) (a : ๐“) :
    โˆซ (h : โ„• โ†’ ๐“ โ†’ โ„), h n a โˆ‚streamMeasure ฮฝ = โˆซ (x : โ„), id x โˆ‚ฮฝ a
    theorem Bandits.iIndepFun_eval_streamMeasure' {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} (ฮฝ : ProbabilityTheory.Kernel ๐“ ๐“ก) [ProbabilityTheory.IsMarkovKernel ฮฝ] :
    ProbabilityTheory.iIndepFun (fun (n : โ„•) (ฯ‰ : โ„• โ†’ ๐“ โ†’ ๐“ก) => ฯ‰ n) (streamMeasure ฮฝ)
    theorem Bandits.iIndepFun_eval_streamMeasure'' {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} (ฮฝ : ProbabilityTheory.Kernel ๐“ ๐“ก) [ProbabilityTheory.IsMarkovKernel ฮฝ] (a : ๐“) :
    ProbabilityTheory.iIndepFun (fun (n : โ„•) (ฯ‰ : โ„• โ†’ ๐“ โ†’ ๐“ก) => ฯ‰ n a) (streamMeasure ฮฝ)
    theorem Bandits.iIndepFun_eval_streamMeasure {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} (ฮฝ : ProbabilityTheory.Kernel ๐“ ๐“ก) [ProbabilityTheory.IsMarkovKernel ฮฝ] :
    ProbabilityTheory.iIndepFun (fun (p : โ„• ร— ๐“) (ฯ‰ : โ„• โ†’ ๐“ โ†’ ๐“ก) => ฯ‰ p.1 p.2) (streamMeasure ฮฝ)
    theorem Bandits.indepFun_eval_streamMeasure {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} (ฮฝ : ProbabilityTheory.Kernel ๐“ ๐“ก) [ProbabilityTheory.IsMarkovKernel ฮฝ] {n m : โ„•} {a b : ๐“} (h : n โ‰  m โˆจ a โ‰  b) :
    ProbabilityTheory.IndepFun (fun (ฯ‰ : โ„• โ†’ ๐“ โ†’ ๐“ก) => ฯ‰ n a) (fun (ฯ‰ : โ„• โ†’ ๐“ โ†’ ๐“ก) => ฯ‰ m b) (streamMeasure ฮฝ)
    theorem Bandits.indepFun_eval_streamMeasure' {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} (ฮฝ : ProbabilityTheory.Kernel ๐“ ๐“ก) [ProbabilityTheory.IsMarkovKernel ฮฝ] {a b : ๐“} (h : a โ‰  b) :
    ProbabilityTheory.IndepFun (fun (ฯ‰ : โ„• โ†’ ๐“ โ†’ ๐“ก) (n : โ„•) => ฯ‰ n a) (fun (ฯ‰ : โ„• โ†’ ๐“ โ†’ ๐“ก) (n : โ„•) => ฯ‰ n b) (streamMeasure ฮฝ)
    theorem Bandits.iIndepFun_snd_apply_prod_streamMeasure {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} {ฮฉ : Type u_3} {mฮฉ : MeasurableSpace ฮฉ} (ฮผ : MeasureTheory.Measure ฮฉ) [MeasureTheory.IsProbabilityMeasure ฮผ] (ฮฝ : ProbabilityTheory.Kernel ๐“ ๐“ก) [ProbabilityTheory.IsMarkovKernel ฮฝ] :
    ProbabilityTheory.iIndepFun (fun (p : โ„• ร— ๐“) (ฯ‰ : ฮฉ ร— (โ„• โ†’ ๐“ โ†’ ๐“ก)) => ฯ‰.2 p.1 p.2) (ฮผ.prod (streamMeasure ฮฝ))

    Under a product measure ฮผ.prod (streamMeasure ฮฝ), the entries of the reward array are independent.

    theorem Bandits.indepFun_snd_apply_prod_streamMeasure_update {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [DecidableEq ๐“] {ฮฉ : Type u_3} {mฮฉ : MeasurableSpace ฮฉ} (ฮผ : MeasureTheory.Measure ฮฉ) [MeasureTheory.IsProbabilityMeasure ฮผ] (ฮฝ : ProbabilityTheory.Kernel ๐“ ๐“ก) [ProbabilityTheory.IsMarkovKernel ฮฝ] (m : โ„•) (a : ๐“) (x : ๐“ก) :
    ProbabilityTheory.IndepFun (fun (ฯ‰ : ฮฉ ร— (โ„• โ†’ ๐“ โ†’ ๐“ก)) => ฯ‰.2 m a) (fun (ฯ‰ : ฮฉ ร— (โ„• โ†’ ๐“ โ†’ ๐“ก)) => (ฯ‰.1, fun (i : โ„•) (b : ๐“) => if i = m โˆง b = a then x else ฯ‰.2 i b)) (ฮผ.prod (streamMeasure ฮฝ))

    Under a product measure ฮผ.prod (streamMeasure ฮฝ), the entry (m, a) of the reward array is independent of the pair formed by the first coordinate and the reward array in which the entry (m, a) is replaced by a constant x.

    @[reducible, inline]
    abbrev Bandits.ArrayModel.probSpace (๐“ : Type u_1) (๐“ก : Type u_2) :
    Type (max u_1 u_2)

    Probability space for the array model of stochastic bandits.

    Equations
    Instances For
      noncomputable def Bandits.ArrayModel.arrayMeasure {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} (ฮฝ : ProbabilityTheory.Kernel ๐“ ๐“ก) :
      MeasureTheory.Measure (probSpace ๐“ ๐“ก)

      Probability measure for the array model of stochastic bandits.

      Equations
      Instances For
        instance Bandits.ArrayModel.instIsProbabilityMeasureProbSpaceArrayMeasureOfIsMarkovKernel {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} (ฮฝ : ProbabilityTheory.Kernel ๐“ ๐“ก) [ProbabilityTheory.IsMarkovKernel ฮฝ] :
        theorem Bandits.ArrayModel.hasLaw_fst_apply_arrayMeasure {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} (ฮฝ : ProbabilityTheory.Kernel ๐“ ๐“ก) [ProbabilityTheory.IsMarkovKernel ฮฝ] (n : โ„•) :
        ProbabilityTheory.HasLaw (fun (ฯ‰ : probSpace ๐“ ๐“ก) => ฯ‰.1 n) MeasureTheory.volume (arrayMeasure ฮฝ)
        theorem Bandits.ArrayModel.hasLaw_snd_apply_arrayMeasure {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} (ฮฝ : ProbabilityTheory.Kernel ๐“ ๐“ก) [ProbabilityTheory.IsMarkovKernel ฮฝ] (n : โ„•) (a : ๐“) :
        ProbabilityTheory.HasLaw (fun (ฯ‰ : probSpace ๐“ ๐“ก) => ฯ‰.2 n a) (ฮฝ a) (arrayMeasure ฮฝ)
        theorem Bandits.ArrayModel.map_snd_apply_arrayMeasure {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} {ฮฝ : ProbabilityTheory.Kernel ๐“ ๐“ก} [ProbabilityTheory.IsMarkovKernel ฮฝ] (n : โ„•) (a : ๐“) :
        MeasureTheory.Measure.map (fun (ฯ‰ : probSpace ๐“ ๐“ก) => ฯ‰.2 n a) (arrayMeasure ฮฝ) = ฮฝ a
        def Bandits.ArrayModel.truncRow {๐“ : Type u_1} {๐“ก : Type u_2} [DecidableEq ๐“] (a : ๐“) (m : โ„•) (ฯ‰ : probSpace ๐“ ๐“ก) :
        probSpace ๐“ ๐“ก

        Modification of ฯ‰ in which the rewards of action a are read only up to index m - 1: in row a of the reward array, the entry at index i is kept if i < m and replaced by the entry at index m + 1 + i otherwise. The result does not depend on the coordinate (m, a) of the array.

        Equations
        Instances For
          theorem Bandits.ArrayModel.measurable_truncRow {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ก : MeasurableSpace ๐“ก} [DecidableEq ๐“] (a : ๐“) (m : โ„•) :
          noncomputable def Bandits.ArrayModel.algFunction {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (n : โ„•) :
          Learning.Hist Unit ๐“ ๐“ก n โ†’ โ†‘unitInterval โ†’ ๐“

          The next action is the image of the history and a uniform random variable by this function.

          Equations
          Instances For
            theorem Bandits.ArrayModel.algFunction_map {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (n : โ„•) (h : Learning.Hist Unit ๐“ ๐“ก n) :
            theorem Bandits.ArrayModel.algFunction_zero_map {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] (alg : Learning.Algorithm Unit ๐“ ๐“ก) :

            The initial action is the image of a uniform random variable by algFunction alg 0 default.

            theorem Bandits.ArrayModel.measurable_algFunction {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (n : โ„•) :
            noncomputable def Bandits.ArrayModel.hist {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (ฯ‰ : probSpace ๐“ ๐“ก) (n : โ„•) :
            Learning.Hist Unit ๐“ ๐“ก n

            History of actions and rewards before time n in the array model.

            Equations
            Instances For
              @[simp]
              theorem Bandits.ArrayModel.hist_zero {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (ฯ‰ : probSpace ๐“ ๐“ก) :
              hist alg ฯ‰ 0 = default
              theorem Bandits.ArrayModel.hist_add_one {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (ฯ‰ : probSpace ๐“ ๐“ก) (n : โ„•) :
              hist alg ฯ‰ (n + 1) = Fin.snoc (hist alg ฯ‰ n) ((), algFunction alg n (hist alg ฯ‰ n) (ฯ‰.1 n), ฯ‰.2 (Learning.pullCount' n (hist alg ฯ‰ n) (algFunction alg n (hist alg ฯ‰ n) (ฯ‰.1 n))) (algFunction alg n (hist alg ฯ‰ n) (ฯ‰.1 n)))
              theorem Bandits.ArrayModel.hist_add_one_eq_finSuccProd' {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (ฯ‰ : probSpace ๐“ ๐“ก) (n : โ„•) :
              hist alg ฯ‰ (n + 1) = (MeasurableEquiv.finSuccProd (Learning.Round Unit ๐“ ๐“ก) n).symm (hist alg ฯ‰ n, (), algFunction alg n (hist alg ฯ‰ n) (ฯ‰.1 n), ฯ‰.2 (Learning.pullCount' n (hist alg ฯ‰ n) (algFunction alg n (hist alg ฯ‰ n) (ฯ‰.1 n))) (algFunction alg n (hist alg ฯ‰ n) (ฯ‰.1 n)))
              noncomputable def Bandits.ArrayModel.action {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (n : โ„•) (ฯ‰ : probSpace ๐“ ๐“ก) :
              ๐“

              Action taken at time n in the array model.

              Equations
              Instances For
                theorem Bandits.ArrayModel.action_eq {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (n : โ„•) :
                action alg n = fun (ฯ‰ : probSpace ๐“ ๐“ก) => algFunction alg n (hist alg ฯ‰ n) (ฯ‰.1 n)
                theorem Bandits.ArrayModel.action_zero {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] (alg : Learning.Algorithm Unit ๐“ ๐“ก) :
                action alg 0 = fun (ฯ‰ : probSpace ๐“ ๐“ก) => algFunction alg 0 default (ฯ‰.1 0)
                noncomputable def Bandits.ArrayModel.reward {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (n : โ„•) (ฯ‰ : probSpace ๐“ ๐“ก) :
                ๐“ก

                Reward received at time n in the array model.

                Equations
                Instances For
                  theorem Bandits.ArrayModel.reward_eq' {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (n : โ„•) (ฯ‰ : probSpace ๐“ ๐“ก) :
                  reward alg n ฯ‰ = ฯ‰.2 (Learning.pullCount' n (hist alg ฯ‰ n) (action alg n ฯ‰)) (action alg n ฯ‰)
                  theorem Bandits.ArrayModel.hist_succ {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (ฯ‰ : probSpace ๐“ ๐“ก) (n : โ„•) :
                  hist alg ฯ‰ (n + 1) = Fin.snoc (hist alg ฯ‰ n) ((), action alg n ฯ‰, reward alg n ฯ‰)
                  theorem Bandits.ArrayModel.hist_succ_eq_finSuccProd {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (ฯ‰ : probSpace ๐“ ๐“ก) (n : โ„•) :
                  hist alg ฯ‰ (n + 1) = (MeasurableEquiv.finSuccProd (Learning.Round Unit ๐“ ๐“ก) n).symm (hist alg ฯ‰ n, (), action alg n ฯ‰, reward alg n ฯ‰)
                  theorem Bandits.ArrayModel.hist_apply_last {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (ฯ‰ : probSpace ๐“ ๐“ก) (n : โ„•) :
                  hist alg ฯ‰ (n + 1) (Fin.last n) = ((), action alg n ฯ‰, reward alg n ฯ‰)
                  theorem Bandits.ArrayModel.hist_eq {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (ฯ‰ : probSpace ๐“ ๐“ก) (n : โ„•) :
                  hist alg ฯ‰ n = fun (i : Fin n) => ((), action alg (โ†‘i) ฯ‰, reward alg (โ†‘i) ฯ‰)
                  theorem Bandits.ArrayModel.hist_eq_history {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (ฯ‰ : probSpace ๐“ ๐“ก) (n : โ„•) :
                  hist alg ฯ‰ n = Learning.history (Learning.noObs (probSpace ๐“ ๐“ก)) (action alg) (reward alg) n ฯ‰

                  The history in the array model is the history of the action and reward processes.

                  theorem Bandits.ArrayModel.pullCount_action_eq {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (a : ๐“) (n : โ„•) (ฯ‰ : probSpace ๐“ ๐“ก) :
                  Learning.pullCount (action alg) a n ฯ‰ = Learning.pullCount' n (hist alg ฯ‰ n) a
                  theorem Bandits.ArrayModel.pullCount_action_eq_comp {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (a : ๐“) (n : โ„•) :
                  Learning.pullCount (action alg) a n = (fun (h : Learning.Hist Unit ๐“ ๐“ก n) => Learning.pullCount' n h a) โˆ˜ fun (x : probSpace ๐“ ๐“ก) => hist alg x n
                  theorem Bandits.ArrayModel.reward_eq {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (n : โ„•) :
                  reward alg n = fun (ฯ‰ : probSpace ๐“ ๐“ก) => ฯ‰.2 (Learning.pullCount (action alg) (action alg n ฯ‰) n ฯ‰) (action alg n ฯ‰)
                  theorem Bandits.ArrayModel.sumRewards_eq {๐“ : Type u_1} {m๐“ : MeasurableSpace ๐“} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] (alg : Learning.Algorithm Unit ๐“ โ„) (a : ๐“) (n : โ„•) (ฯ‰ : probSpace ๐“ โ„) :
                  Learning.sumRewards (action alg) (reward alg) a n ฯ‰ = โˆ‘ i โˆˆ Finset.range (Learning.pullCount (action alg) a n ฯ‰), ฯ‰.2 i a
                  theorem Bandits.ArrayModel.measurable_action' {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] {alg : Learning.Algorithm Unit ๐“ ๐“ก} (n : โ„•) (h : Measurable fun (x : probSpace ๐“ ๐“ก) => hist alg x n) :
                  Measurable fun (x : probSpace ๐“ ๐“ก) => algFunction alg n (hist alg x n) (x.1 n)
                  theorem Bandits.ArrayModel.measurable_pullCount'_action {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] {alg : Learning.Algorithm Unit ๐“ ๐“ก} (n : โ„•) (h_hist : Measurable fun (x : probSpace ๐“ ๐“ก) => hist alg x n) :
                  Measurable fun (x : probSpace ๐“ ๐“ก) => Learning.pullCount' n (hist alg x n) (algFunction alg n (hist alg x n) (x.1 n))
                  theorem Bandits.ArrayModel.measurable_hist {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] [Countable ๐“] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (n : โ„•) :
                  Measurable fun (ฯ‰ : probSpace ๐“ ๐“ก) => hist alg ฯ‰ n
                  theorem Bandits.ArrayModel.measurable_action {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] [Countable ๐“] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (n : โ„•) :
                  theorem Bandits.ArrayModel.measurable_reward {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] [Countable ๐“] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (n : โ„•) :
                  theorem Bandits.ArrayModel.measurable_pullCount_action {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] [Countable ๐“] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (n : โ„•) :
                  Measurable fun (ฯ‰ : probSpace ๐“ ๐“ก) => Learning.pullCount (action alg) (action alg n ฯ‰) n ฯ‰
                  theorem Bandits.ArrayModel.hist_congr {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (n : โ„•) {ฯ‰ ฯ‰' : probSpace ๐“ ๐“ก} (hฯ‰1 : โˆ€ i < n, ฯ‰.1 i = ฯ‰'.1 i) (hฯ‰2 : โˆ€ (i : โ„•) (a : ๐“), i < Learning.pullCount (action alg) a n ฯ‰ โ†’ ฯ‰.2 i a = ฯ‰'.2 i a) :
                  hist alg ฯ‰ n = hist alg ฯ‰' n
                  theorem Bandits.ArrayModel.action_eq_and_pullCount_eq_congr_aux {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (a : ๐“) (m n : โ„•) {ฯ‰ ฯ‰' : probSpace ๐“ ๐“ก} (hฯ‰1 : โˆ€ (i : โ„•), ฯ‰.1 i = ฯ‰'.1 i) (hฯ‰2_ne : โˆ€ (i : โ„•) (b : ๐“), b โ‰  a โ†’ ฯ‰.2 i b = ฯ‰'.2 i b) (hฯ‰2_eq : โˆ€ (i : โ„•), i + 1 โ‰ค m โ†’ ฯ‰.2 i a = ฯ‰'.2 i a) (h_eq : action alg n ฯ‰ = a โˆง Learning.pullCount (action alg) a n ฯ‰ = m) :
                  action alg n ฯ‰' = a โˆง Learning.pullCount (action alg) a n ฯ‰' = m
                  theorem Bandits.ArrayModel.action_eq_and_pullCount_eq_congr {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (a : ๐“) (m n : โ„•) {ฯ‰ ฯ‰' : probSpace ๐“ ๐“ก} (hฯ‰1 : โˆ€ (i : โ„•), ฯ‰.1 i = ฯ‰'.1 i) (hฯ‰2_ne : โˆ€ (i : โ„•) (b : ๐“), b โ‰  a โ†’ ฯ‰.2 i b = ฯ‰'.2 i b) (hฯ‰2_eq : โˆ€ (i : โ„•), i + 1 โ‰ค m โ†’ ฯ‰.2 i a = ฯ‰'.2 i a) :
                  action alg n ฯ‰ = a โˆง Learning.pullCount (action alg) a n ฯ‰ = m โ†” action alg n ฯ‰' = a โˆง Learning.pullCount (action alg) a n ฯ‰' = m
                  theorem Bandits.ArrayModel.indicator_action_eq_and_pullCount_eq_congr {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (a : ๐“) (m n : โ„•) {ฯ‰ ฯ‰' : probSpace ๐“ ๐“ก} (hฯ‰1 : โˆ€ (i : โ„•), ฯ‰.1 i = ฯ‰'.1 i) (hฯ‰2_ne : โˆ€ (i : โ„•) (b : ๐“), b โ‰  a โ†’ ฯ‰.2 i b = ฯ‰'.2 i b) (hฯ‰2_eq : โˆ€ (i : โ„•), i + 1 โ‰ค m โ†’ ฯ‰.2 i a = ฯ‰'.2 i a) :
                  {ฯ‰ : probSpace ๐“ ๐“ก | action alg n ฯ‰ = a โˆง Learning.pullCount (action alg) a n ฯ‰ = m}.indicator (fun (x : probSpace ๐“ ๐“ก) => 1) ฯ‰ = {ฯ‰ : probSpace ๐“ ๐“ก | action alg n ฯ‰ = a โˆง Learning.pullCount (action alg) a n ฯ‰ = m}.indicator (fun (x : probSpace ๐“ ๐“ก) => 1) ฯ‰'
                  theorem Bandits.ArrayModel.measurable_hist_comap {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] [Countable ๐“] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (n : โ„•) :
                  Measurable fun (x : probSpace ๐“ ๐“ก) => hist alg x n
                  noncomputable def Bandits.ArrayModel.truncRowPullCount {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (a : ๐“) (n : โ„•) (ฯ‰ : probSpace ๐“ ๐“ก) :
                  probSpace ๐“ ๐“ก

                  truncRow at the number of pulls of a before time n: the rewards of action a that have not been observed before time n are replaced. The history before time n is measurable with respect to this function (see measurable_hist_truncRowPullCount), and on the event pullCount (action alg) a n = m it coincides with truncRow a m.

                  Equations
                  Instances For
                    theorem Bandits.ArrayModel.measurable_hist_truncRowPullCount {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] [Countable ๐“] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (a : ๐“) (n : โ„•) :
                    Measurable fun (x : probSpace ๐“ ๐“ก) => hist alg x n
                    theorem Bandits.ArrayModel.measurableSet_action_eq_and_pullCount_eq {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] [Countable ๐“] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (a : ๐“) (n m : โ„•) :
                    MeasurableSet {ฯ‰ : probSpace ๐“ ๐“ก | action alg n ฯ‰ = a โˆง Learning.pullCount (action alg) a n ฯ‰ = m}
                    theorem Bandits.ArrayModel.preimage_action_pullCount_eq {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (a : ๐“) (n m : โ„•) :
                    (fun (ฯ‰ : probSpace ๐“ ๐“ก) => (action alg n ฯ‰, Learning.pullCount (action alg) (action alg n ฯ‰) n ฯ‰)) โปยน' {(a, m)} = ({ฯ‰ : probSpace ๐“ ๐“ก | action alg n ฯ‰ = a โˆง Learning.pullCount (action alg) a n ฯ‰ = m}.indicator fun (x : probSpace ๐“ ๐“ก) => 1) โปยน' {1}
                    theorem Bandits.ArrayModel.measurable_indicator_action_eq_and_pullCount_eq {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] [Countable ๐“] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (a : ๐“) (m n : โ„•) :
                    Measurable ({ฯ‰ : probSpace ๐“ ๐“ก | action alg n ฯ‰ = a โˆง Learning.pullCount (action alg) a n ฯ‰ = m}.indicator fun (x : probSpace ๐“ ๐“ก) => 1)
                    theorem Bandits.ArrayModel.measurable_pullCount_action_hist {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (n : โ„•) :
                    Measurable fun (ฯ‰ : probSpace ๐“ ๐“ก) => Learning.pullCount (action alg) (action alg n ฯ‰) n ฯ‰
                    theorem Bandits.ArrayModel.indepFun_fst_snd {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} (ฮฝ : ProbabilityTheory.Kernel ๐“ ๐“ก) [ProbabilityTheory.IsMarkovKernel ฮฝ] :
                    theorem Bandits.ArrayModel.indepFun_fst_zero_snd_zero_action {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} (ฮฝ : ProbabilityTheory.Kernel ๐“ ๐“ก) [ProbabilityTheory.IsMarkovKernel ฮฝ] (a : ๐“) :
                    ProbabilityTheory.IndepFun (fun (ฯ‰ : probSpace ๐“ ๐“ก) => ฯ‰.1 0) (fun (ฯ‰ : probSpace ๐“ ๐“ก) => ฯ‰.2 0 a) (arrayMeasure ฮฝ)
                    theorem Bandits.ArrayModel.indepFun_fst_aux {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} (ฮฝ : ProbabilityTheory.Kernel ๐“ ๐“ก) [ProbabilityTheory.IsMarkovKernel ฮฝ] (n : โ„•) :
                    ProbabilityTheory.IndepFun (fun (ฯ‰ : probSpace ๐“ ๐“ก) => ฯ‰.1 n) (fun (ฯ‰ : probSpace ๐“ ๐“ก) => (fun (i : Fin n) => ฯ‰.1 โ†‘i, ฯ‰.2)) (arrayMeasure ฮฝ)
                    theorem Bandits.ArrayModel.indepFun_fst_hist {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] [StandardBorelSpace ๐“ก] [Nonempty ๐“ก] [Countable ๐“] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (ฮฝ : ProbabilityTheory.Kernel ๐“ ๐“ก) [ProbabilityTheory.IsMarkovKernel ฮฝ] (n : โ„•) :
                    ProbabilityTheory.IndepFun (fun (ฯ‰ : probSpace ๐“ ๐“ก) => ฯ‰.1 n) (fun (x : probSpace ๐“ ๐“ก) => hist alg x n) (arrayMeasure ฮฝ)
                    theorem Bandits.ArrayModel.indepFun_snd_apply_truncRow {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [DecidableEq ๐“] (ฮฝ : ProbabilityTheory.Kernel ๐“ ๐“ก) [ProbabilityTheory.IsMarkovKernel ฮฝ] (a : ๐“) (m : โ„•) :
                    ProbabilityTheory.IndepFun (fun (ฯ‰ : probSpace ๐“ ๐“ก) => ฯ‰.2 m a) (truncRow a m) (arrayMeasure ฮฝ)

                    The reward ฯ‰.2 m a is independent of truncRow a m, which reads only other coordinates.

                    theorem Bandits.ArrayModel.indepFun_snd_apply_pullCount_action {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] [Countable ๐“] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (ฮฝ : ProbabilityTheory.Kernel ๐“ ๐“ก) [ProbabilityTheory.IsMarkovKernel ฮฝ] (a : ๐“) (m n : โ„•) :
                    ProbabilityTheory.IndepFun (fun (ฯ‰ : probSpace ๐“ ๐“ก) => ฯ‰.2 m a) ({ฯ‰ : probSpace ๐“ ๐“ก | action alg n ฯ‰ = a โˆง Learning.pullCount (action alg) a n ฯ‰ = m}.indicator fun (x : probSpace ๐“ ๐“ก) => 1) (arrayMeasure ฮฝ)
                    theorem Bandits.ArrayModel.indepFun_snd_hist_cond {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] [StandardBorelSpace ๐“ก] [Nonempty ๐“ก] [Countable ๐“] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (ฮฝ : ProbabilityTheory.Kernel ๐“ ๐“ก) [ProbabilityTheory.IsMarkovKernel ฮฝ] (a : ๐“) (n m : โ„•) :
                    ProbabilityTheory.IndepFun (fun (ฯ‰ : probSpace ๐“ ๐“ก) => ฯ‰.2 m a) (fun (x : probSpace ๐“ ๐“ก) => hist alg x n) (arrayMeasure ฮฝ)[|(fun (ฯ‰ : probSpace ๐“ ๐“ก) => (action alg n ฯ‰, Learning.pullCount (action alg) (action alg n ฯ‰) n ฯ‰)) โปยน' {(a, m)}]
                    theorem Bandits.ArrayModel.hasCondDistrib_action' {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] [Countable ๐“] [StandardBorelSpace ๐“ก] [Nonempty ๐“ก] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (ฮฝ : ProbabilityTheory.Kernel ๐“ ๐“ก) [ProbabilityTheory.IsMarkovKernel ฮฝ] (n : โ„•) :
                    ProbabilityTheory.HasCondDistrib (action alg n) (fun (x : probSpace ๐“ ๐“ก) => hist alg x n) ((alg.policy n).sectL ()) (arrayMeasure ฮฝ)
                    theorem Bandits.ArrayModel.reward_ae_eq_cond {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] [Countable ๐“] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (ฮฝ : ProbabilityTheory.Kernel ๐“ ๐“ก) (a : ๐“) (n m : โ„•) :
                    reward alg n =แต[(arrayMeasure ฮฝ)[|(fun (ฯ‰ : probSpace ๐“ ๐“ก) => (action alg n ฯ‰, Learning.pullCount (action alg) (action alg n ฯ‰) n ฯ‰)) โปยน' {(a, m)}]] fun (ฯ‰ : probSpace ๐“ ๐“ก) => ฯ‰.2 m a
                    theorem Bandits.ArrayModel.hasCondDistrib_reward_hist_action_pullCount {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] [Countable ๐“] [StandardBorelSpace ๐“ก] [Nonempty ๐“ก] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (ฮฝ : ProbabilityTheory.Kernel ๐“ ๐“ก) [ProbabilityTheory.IsMarkovKernel ฮฝ] (n : โ„•) :
                    ProbabilityTheory.HasCondDistrib (reward alg n) (fun (ฯ‰ : probSpace ๐“ ๐“ก) => (hist alg ฯ‰ n, action alg n ฯ‰, Learning.pullCount (action alg) (action alg n ฯ‰) n ฯ‰)) (ProbabilityTheory.Kernel.prodMkLeft (Learning.Hist Unit ๐“ ๐“ก n) (ProbabilityTheory.Kernel.prodMkRight โ„• ฮฝ)) (arrayMeasure ฮฝ)

                    The conditional distribution of the reward at time n, given the history before time n, the action at time n, and the number of times that action has been pulled before time n, is equal to the kernel ฮฝ.

                    theorem Bandits.ArrayModel.condIndepFun_reward_hist {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] [Countable ๐“] [StandardBorelSpace ๐“ก] [Nonempty ๐“ก] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (ฮฝ : ProbabilityTheory.Kernel ๐“ ๐“ก) [ProbabilityTheory.IsMarkovKernel ฮฝ] (n : โ„•) :
                    ProbabilityTheory.CondIndepFun (MeasurableSpace.comap (fun (ฯ‰ : probSpace ๐“ ๐“ก) => (action alg n ฯ‰, Learning.pullCount (action alg) (action alg n ฯ‰) n ฯ‰)) inferInstance) โ‹ฏ (reward alg n) (fun (x : probSpace ๐“ ๐“ก) => hist alg x n) (arrayMeasure ฮฝ)

                    The reward at time n is conditionally independent of the history before time n, given the action at time n and the number of times that action has been pulled before time n.

                    theorem Bandits.ArrayModel.hasCondDistrib_reward' {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] [Countable ๐“] [StandardBorelSpace ๐“ก] [Nonempty ๐“ก] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (ฮฝ : ProbabilityTheory.Kernel ๐“ ๐“ก) [ProbabilityTheory.IsMarkovKernel ฮฝ] (n : โ„•) :
                    ProbabilityTheory.HasCondDistrib (reward alg n) (fun (ฯ‰ : probSpace ๐“ ๐“ก) => (hist alg ฯ‰ n, action alg n ฯ‰)) (ProbabilityTheory.Kernel.prodMkLeft (Learning.Hist Unit ๐“ ๐“ก n) ฮฝ) (arrayMeasure ฮฝ)

                    The conditional distribution of the reward at time n, given the history before time n and the action at time n, is equal to the kernel ฮฝ.

                    theorem Bandits.ArrayModel.hasCondDistrib_action {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] [Countable ๐“] [StandardBorelSpace ๐“ก] [Nonempty ๐“ก] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (ฮฝ : ProbabilityTheory.Kernel ๐“ ๐“ก) [ProbabilityTheory.IsMarkovKernel ฮฝ] (n : โ„•) :
                    ProbabilityTheory.HasCondDistrib (action alg n) (fun (ฯ‰ : probSpace ๐“ ๐“ก) => (Learning.history (Learning.noObs (probSpace ๐“ ๐“ก)) (action alg) (reward alg) n ฯ‰, Learning.noObs (probSpace ๐“ ๐“ก) n ฯ‰)) (alg.policy n) (arrayMeasure ฮฝ)
                    theorem Bandits.ArrayModel.hasCondDistrib_reward {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] [Countable ๐“] [StandardBorelSpace ๐“ก] [Nonempty ๐“ก] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (ฮฝ : ProbabilityTheory.Kernel ๐“ ๐“ก) [ProbabilityTheory.IsMarkovKernel ฮฝ] (n : โ„•) :
                    ProbabilityTheory.HasCondDistrib (reward alg n) (fun (ฯ‰ : probSpace ๐“ ๐“ก) => ((Learning.history (Learning.noObs (probSpace ๐“ ๐“ก)) (action alg) (reward alg) n ฯ‰, Learning.noObs (probSpace ๐“ ๐“ก) n ฯ‰), action alg n ฯ‰)) ((Learning.stationaryEnv ฮฝ).feedback n) (arrayMeasure ฮฝ)
                    theorem Bandits.ArrayModel.isAlgEnvSeq_arrayMeasure {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] [Countable ๐“] [StandardBorelSpace ๐“ก] [Nonempty ๐“ก] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (ฮฝ : ProbabilityTheory.Kernel ๐“ ๐“ก) [ProbabilityTheory.IsMarkovKernel ฮฝ] :
                    Learning.IsAlgEnvSeq (Learning.noObs (probSpace ๐“ ๐“ก)) (action alg) (reward alg) alg (Learning.stationaryEnv ฮฝ) (arrayMeasure ฮฝ)
                    theorem Bandits.ArrayModel.hasLaw_action_zero {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] [Countable ๐“] [StandardBorelSpace ๐“ก] [Nonempty ๐“ก] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (ฮฝ : ProbabilityTheory.Kernel ๐“ ๐“ก) [ProbabilityTheory.IsMarkovKernel ฮฝ] :
                    theorem Bandits.ArrayModel.hasCondDistrib_reward_zero {๐“ : Type u_1} {๐“ก : Type u_2} {m๐“ : MeasurableSpace ๐“} {m๐“ก : MeasurableSpace ๐“ก} [Nonempty ๐“] [StandardBorelSpace ๐“] [DecidableEq ๐“] [Countable ๐“] [StandardBorelSpace ๐“ก] [Nonempty ๐“ก] (alg : Learning.Algorithm Unit ๐“ ๐“ก) (ฮฝ : ProbabilityTheory.Kernel ๐“ ๐“ก) [ProbabilityTheory.IsMarkovKernel ฮฝ] :