Documentation

LeanMachineLearning.SequentialLearning.BayesStationaryEnv

Bayesian stationary environments #

This file defines the structure IsBayesAlgEnvSeq and provides its basic properties.

Main definitions #

Main results #

structure Learning.IsBayesAlgEnvSeq {๐“” : Type u_1} {๐“ : Type u_2} {๐“จ : Type u_3} {ฮฉ : Type u_4} [MeasurableSpace ๐“”] [MeasurableSpace ๐“] [MeasurableSpace ๐“จ] [MeasurableSpace ฮฉ] [StandardBorelSpace ๐“] [Nonempty ๐“] [StandardBorelSpace ๐“จ] [Nonempty ๐“จ] (Q : MeasureTheory.Measure ๐“”) (ฮบ : ProbabilityTheory.Kernel (๐“” ร— ๐“) ๐“จ) (alg : Algorithm ๐“ ๐“จ) (E : ฮฉ โ†’ ๐“”) (A : โ„• โ†’ ฮฉ โ†’ ๐“) (Y : โ„• โ†’ ฮฉ โ†’ ๐“จ) (P : MeasureTheory.Measure ฮฉ) [MeasureTheory.IsFiniteMeasure P] :

IsBayesAlgEnvSeq Q ฮบ alg E A Y P states that there is a measure P : Measure ฮฉ such that the parameter E : ฮฉ โ†’ ๐“” has law Q and that the sequences of actions A : โ„• โ†’ ฮฉ โ†’ ๐“ and feedbacks Y : โ„• โ†’ ฮฉ โ†’ ๐“จ are generated by the algorithm alg : Algorithm ๐“ ๐“จ interacting with an underlying environment that depends on E and ฮบ (stationaryEnv (ฮบ.sectR (E ฯ‰))).

Instances For
    theorem Learning.IsBayesAlgEnvSeq.hasLaw_action_zero {๐“” : Type u_1} {๐“ : Type u_2} {๐“จ : Type u_3} {ฮฉ : Type u_4} [MeasurableSpace ๐“”] [MeasurableSpace ๐“] [MeasurableSpace ๐“จ] [MeasurableSpace ฮฉ] [StandardBorelSpace ๐“] [Nonempty ๐“] [StandardBorelSpace ๐“จ] [Nonempty ๐“จ] {Q : MeasureTheory.Measure ๐“”} {ฮบ : ProbabilityTheory.Kernel (๐“” ร— ๐“) ๐“จ} {alg : Algorithm ๐“ ๐“จ} {E : ฮฉ โ†’ ๐“”} {A : โ„• โ†’ ฮฉ โ†’ ๐“} {Y : โ„• โ†’ ฮฉ โ†’ ๐“จ} {P : MeasureTheory.Measure ฮฉ} [MeasureTheory.IsFiniteMeasure P] [MeasureTheory.IsProbabilityMeasure P] (h : IsBayesAlgEnvSeq Q ฮบ alg E A Y P) :
    theorem Learning.IsBayesAlgEnvSeq.hasCondDistrib_action' {๐“” : Type u_1} {๐“ : Type u_2} {๐“จ : Type u_3} {ฮฉ : Type u_4} [MeasurableSpace ๐“”] [MeasurableSpace ๐“] [MeasurableSpace ๐“จ] [MeasurableSpace ฮฉ] [StandardBorelSpace ๐“] [Nonempty ๐“] [StandardBorelSpace ๐“จ] [Nonempty ๐“จ] {Q : MeasureTheory.Measure ๐“”} {ฮบ : ProbabilityTheory.Kernel (๐“” ร— ๐“) ๐“จ} {alg : Algorithm ๐“ ๐“จ} {E : ฮฉ โ†’ ๐“”} {A : โ„• โ†’ ฮฉ โ†’ ๐“} {Y : โ„• โ†’ ฮฉ โ†’ ๐“จ} {P : MeasureTheory.Measure ฮฉ} [MeasureTheory.IsFiniteMeasure P] (h : IsBayesAlgEnvSeq Q ฮบ alg E A Y P) (n : โ„•) :
    ProbabilityTheory.HasCondDistrib (A (n + 1)) (history A Y n) (alg.policy n) P
    theorem Learning.IsBayesAlgEnvSeq.hasCondDistrib_feedback' {๐“” : Type u_1} {๐“ : Type u_2} {๐“จ : Type u_3} {ฮฉ : Type u_4} [MeasurableSpace ๐“”] [MeasurableSpace ๐“] [MeasurableSpace ๐“จ] [MeasurableSpace ฮฉ] [StandardBorelSpace ๐“] [Nonempty ๐“] [StandardBorelSpace ๐“จ] [Nonempty ๐“จ] {Q : MeasureTheory.Measure ๐“”} {ฮบ : ProbabilityTheory.Kernel (๐“” ร— ๐“) ๐“จ} {alg : Algorithm ๐“ ๐“จ} {E : ฮฉ โ†’ ๐“”} {A : โ„• โ†’ ฮฉ โ†’ ๐“} {Y : โ„• โ†’ ฮฉ โ†’ ๐“จ} {P : MeasureTheory.Measure ฮฉ} [MeasureTheory.IsFiniteMeasure P] [ProbabilityTheory.IsFiniteKernel ฮบ] (h : IsBayesAlgEnvSeq Q ฮบ alg E A Y P) (n : โ„•) :
    ProbabilityTheory.HasCondDistrib (Y (n + 1)) (fun (ฯ‰ : ฮฉ) => (E ฯ‰, A (n + 1) ฯ‰)) ฮบ P
    theorem Learning.IsBayesAlgEnvSeq.hasLaw_IT_action_zero {๐“” : Type u_1} {๐“ : Type u_2} {๐“จ : Type u_3} {ฮฉ : Type u_4} [MeasurableSpace ๐“”] [MeasurableSpace ๐“] [MeasurableSpace ๐“จ] [MeasurableSpace ฮฉ] [StandardBorelSpace ๐“] [Nonempty ๐“] [StandardBorelSpace ๐“จ] [Nonempty ๐“จ] {Q : MeasureTheory.Measure ๐“”} {ฮบ : ProbabilityTheory.Kernel (๐“” ร— ๐“) ๐“จ} {alg : Algorithm ๐“ ๐“จ} {E : ฮฉ โ†’ ๐“”} {A : โ„• โ†’ ฮฉ โ†’ ๐“} {Y : โ„• โ†’ ฮฉ โ†’ ๐“จ} {P : MeasureTheory.Measure ฮฉ} [MeasureTheory.IsFiniteMeasure P] (h : IsBayesAlgEnvSeq Q ฮบ alg E A Y P) :
    theorem Learning.IsBayesAlgEnvSeq.hasCondDistrib_IT_feedback_zero {๐“” : Type u_1} {๐“ : Type u_2} {๐“จ : Type u_3} {ฮฉ : Type u_4} [MeasurableSpace ๐“”] [MeasurableSpace ๐“] [MeasurableSpace ๐“จ] [MeasurableSpace ฮฉ] [StandardBorelSpace ๐“] [Nonempty ๐“] [StandardBorelSpace ๐“จ] [Nonempty ๐“จ] {Q : MeasureTheory.Measure ๐“”} {ฮบ : ProbabilityTheory.Kernel (๐“” ร— ๐“) ๐“จ} {alg : Algorithm ๐“ ๐“จ} {E : ฮฉ โ†’ ๐“”} {A : โ„• โ†’ ฮฉ โ†’ ๐“} {Y : โ„• โ†’ ฮฉ โ†’ ๐“จ} {P : MeasureTheory.Measure ฮฉ} [MeasureTheory.IsFiniteMeasure P] (h : IsBayesAlgEnvSeq Q ฮบ alg E A Y P) :
    theorem Learning.IsBayesAlgEnvSeq.hasCondDistrib_IT_action {๐“” : Type u_1} {๐“ : Type u_2} {๐“จ : Type u_3} {ฮฉ : Type u_4} [MeasurableSpace ๐“”] [MeasurableSpace ๐“] [MeasurableSpace ๐“จ] [MeasurableSpace ฮฉ] [StandardBorelSpace ๐“] [Nonempty ๐“] [StandardBorelSpace ๐“จ] [Nonempty ๐“จ] {Q : MeasureTheory.Measure ๐“”} {ฮบ : ProbabilityTheory.Kernel (๐“” ร— ๐“) ๐“จ} {alg : Algorithm ๐“ ๐“จ} {E : ฮฉ โ†’ ๐“”} {A : โ„• โ†’ ฮฉ โ†’ ๐“} {Y : โ„• โ†’ ฮฉ โ†’ ๐“จ} {P : MeasureTheory.Measure ฮฉ} [MeasureTheory.IsFiniteMeasure P] (h : IsBayesAlgEnvSeq Q ฮบ alg E A Y P) (n : โ„•) :
    theorem Learning.IsBayesAlgEnvSeq.hasCondDistrib_IT_feedback {๐“” : Type u_1} {๐“ : Type u_2} {๐“จ : Type u_3} {ฮฉ : Type u_4} [MeasurableSpace ๐“”] [MeasurableSpace ๐“] [MeasurableSpace ๐“จ] [MeasurableSpace ฮฉ] [StandardBorelSpace ๐“] [Nonempty ๐“] [StandardBorelSpace ๐“จ] [Nonempty ๐“จ] {Q : MeasureTheory.Measure ๐“”} {ฮบ : ProbabilityTheory.Kernel (๐“” ร— ๐“) ๐“จ} {alg : Algorithm ๐“ ๐“จ} {E : ฮฉ โ†’ ๐“”} {A : โ„• โ†’ ฮฉ โ†’ ๐“} {Y : โ„• โ†’ ฮฉ โ†’ ๐“จ} {P : MeasureTheory.Measure ฮฉ} [MeasureTheory.IsFiniteMeasure P] [ProbabilityTheory.IsFiniteKernel ฮบ] (h : IsBayesAlgEnvSeq Q ฮบ alg E A Y P) (n : โ„•) :
    โˆ€แต (e : ๐“”) โˆ‚Q, ProbabilityTheory.HasCondDistrib (IT.feedback (n + 1)) (fun (ฯ„ : โ„• โ†’ ๐“ ร— ๐“จ) => (IT.hist n ฯ„, IT.action (n + 1) ฯ„)) (ProbabilityTheory.Kernel.prodMkLeft (โ†ฅ(Finset.Iic n) โ†’ ๐“ ร— ๐“จ) (ฮบ.sectR e)) (๐“›[trajectory A Y | E; P] e)
    theorem Learning.IsBayesAlgEnvSeq.hasLaw_IT_hist {๐“” : Type u_1} {๐“ : Type u_2} {๐“จ : Type u_3} {ฮฉ : Type u_4} [MeasurableSpace ๐“”] [MeasurableSpace ๐“] [MeasurableSpace ๐“จ] [MeasurableSpace ฮฉ] [StandardBorelSpace ๐“] [Nonempty ๐“] [StandardBorelSpace ๐“จ] [Nonempty ๐“จ] {Q : MeasureTheory.Measure ๐“”} {ฮบ : ProbabilityTheory.Kernel (๐“” ร— ๐“) ๐“จ} {alg : Algorithm ๐“ ๐“จ} {E : ฮฉ โ†’ ๐“”} {A : โ„• โ†’ ฮฉ โ†’ ๐“} {Y : โ„• โ†’ ฮฉ โ†’ ๐“จ} {P : MeasureTheory.Measure ฮฉ} [MeasureTheory.IsFiniteMeasure P] (h : IsBayesAlgEnvSeq Q ฮบ alg E A Y P) (n : โ„•) :
    theorem Learning.IsBayesAlgEnvSeq.ae_IsAlgEnvSeq {๐“” : Type u_1} {๐“ : Type u_2} {๐“จ : Type u_3} {ฮฉ : Type u_4} [MeasurableSpace ๐“”] [MeasurableSpace ๐“] [MeasurableSpace ๐“จ] [MeasurableSpace ฮฉ] [StandardBorelSpace ๐“] [Nonempty ๐“] [StandardBorelSpace ๐“จ] [Nonempty ๐“จ] {Q : MeasureTheory.Measure ๐“”} {ฮบ : ProbabilityTheory.Kernel (๐“” ร— ๐“) ๐“จ} {alg : Algorithm ๐“ ๐“จ} {E : ฮฉ โ†’ ๐“”} {A : โ„• โ†’ ฮฉ โ†’ ๐“} {Y : โ„• โ†’ ฮฉ โ†’ ๐“จ} {P : MeasureTheory.Measure ฮฉ} [MeasureTheory.IsFiniteMeasure P] [ProbabilityTheory.IsMarkovKernel ฮบ] (h : IsBayesAlgEnvSeq Q ฮบ alg E A Y P) :
    noncomputable def Learning.bayesStationaryEnv {๐“” : Type u_1} {๐“ : Type u_2} {๐“จ : Type u_3} [MeasurableSpace ๐“”] [MeasurableSpace ๐“] [MeasurableSpace ๐“จ] (Q : MeasureTheory.Measure ๐“”) [MeasureTheory.IsProbabilityMeasure Q] (ฮบ : ProbabilityTheory.Kernel (๐“” ร— ๐“) ๐“จ) [ProbabilityTheory.IsMarkovKernel ฮบ] :
    Environment ๐“ (๐“” ร— ๐“จ)

    An environment with observations in ๐“” ร— ๐“จ. The first element e of an observation is sampled from Q once and remains constant. The second element of an observation is sampled from ฮบ (e, a), where a is the corresponding action.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      theorem Learning.IsAlgEnvSeq.isBayesAlgEnvSeq {๐“” : Type u_1} {๐“ : Type u_2} {๐“จ : Type u_3} {ฮฉ : Type u_4} [MeasurableSpace ๐“”] [MeasurableSpace ๐“] [MeasurableSpace ๐“จ] [MeasurableSpace ฮฉ] [Nonempty ๐“] [Nonempty ๐“”] [Nonempty ๐“จ] [StandardBorelSpace ๐“] [StandardBorelSpace ๐“”] [StandardBorelSpace ๐“จ] {Q : MeasureTheory.Measure ๐“”} [MeasureTheory.IsProbabilityMeasure Q] {ฮบ : ProbabilityTheory.Kernel (๐“” ร— ๐“) ๐“จ} [ProbabilityTheory.IsMarkovKernel ฮบ] {alg : Algorithm ๐“ ๐“จ} {A : โ„• โ†’ ฮฉ โ†’ ๐“} {Y : โ„• โ†’ ฮฉ โ†’ ๐“” ร— ๐“จ} {P : MeasureTheory.Measure ฮฉ} [MeasureTheory.IsProbabilityMeasure P] (h : IsAlgEnvSeq A Y (Algorithm.prodLeft ๐“” alg) (bayesStationaryEnv Q ฮบ) P) :
      IsBayesAlgEnvSeq Q ฮบ alg (fun (ฯ‰ : ฮฉ) => (Y 0 ฯ‰).1) A (fun (n : โ„•) (ฯ‰ : ฮฉ) => (Y n ฯ‰).2) P
      noncomputable def Learning.IT.bayesTrajMeasure {๐“” : Type u_1} {๐“ : Type u_2} {๐“จ : Type u_3} [MeasurableSpace ๐“”] [MeasurableSpace ๐“] [MeasurableSpace ๐“จ] (Q : MeasureTheory.Measure ๐“”) [MeasureTheory.IsProbabilityMeasure Q] (ฮบ : ProbabilityTheory.Kernel (๐“” ร— ๐“) ๐“จ) [ProbabilityTheory.IsMarkovKernel ฮบ] (alg : Algorithm ๐“ ๐“จ) :
      MeasureTheory.Measure (โ„• โ†’ ๐“ ร— ๐“” ร— ๐“จ)

      A measure P on a measurable space that carries random variables E, A, and Y such that IsBayesAlgEnvSeq Q ฮบ alg E A Y P.

      Equations
      Instances For
        instance Learning.IT.instIsProbabilityMeasureForallNatProdBayesTrajMeasure {๐“” : Type u_1} {๐“ : Type u_2} {๐“จ : Type u_3} [MeasurableSpace ๐“”] [MeasurableSpace ๐“] [MeasurableSpace ๐“จ] (Q : MeasureTheory.Measure ๐“”) [MeasureTheory.IsProbabilityMeasure Q] (ฮบ : ProbabilityTheory.Kernel (๐“” ร— ๐“) ๐“จ) [ProbabilityTheory.IsMarkovKernel ฮบ] (alg : Algorithm ๐“ ๐“จ) :
        theorem Learning.IT.isBayesAlgEnvSeq_bayesTrajMeasure {๐“” : Type u_1} {๐“ : Type u_2} {๐“จ : Type u_3} [MeasurableSpace ๐“”] [MeasurableSpace ๐“] [MeasurableSpace ๐“จ] [StandardBorelSpace ๐“] [Nonempty ๐“] [StandardBorelSpace ๐“”] [Nonempty ๐“”] [StandardBorelSpace ๐“จ] [Nonempty ๐“จ] (Q : MeasureTheory.Measure ๐“”) [MeasureTheory.IsProbabilityMeasure Q] (ฮบ : ProbabilityTheory.Kernel (๐“” ร— ๐“) ๐“จ) [ProbabilityTheory.IsMarkovKernel ฮบ] (alg : Algorithm ๐“ ๐“จ) :
        IsBayesAlgEnvSeq Q ฮบ alg (fun (ฯ‰ : โ„• โ†’ ๐“ ร— ๐“” ร— ๐“จ) => (ฯ‰ 0).2.1) action (fun (n : โ„•) (ฯ‰ : โ„• โ†’ ๐“ ร— ๐“” ร— ๐“จ) => (ฯ‰ n).2.2) (bayesTrajMeasure Q ฮบ alg)
        noncomputable def Learning.IT.bayesTrajMeasurePosterior {๐“” : Type u_1} {๐“ : Type u_2} {๐“จ : Type u_3} [MeasurableSpace ๐“”] [MeasurableSpace ๐“] [MeasurableSpace ๐“จ] [StandardBorelSpace ๐“”] [Nonempty ๐“”] (Q : MeasureTheory.Measure ๐“”) [MeasureTheory.IsProbabilityMeasure Q] (ฮบ : ProbabilityTheory.Kernel (๐“” ร— ๐“) ๐“จ) [ProbabilityTheory.IsMarkovKernel ฮบ] (alg : Algorithm ๐“ ๐“จ) (n : โ„•) :
        ProbabilityTheory.Kernel (โ†ฅ(Finset.Iic n) โ†’ ๐“ ร— ๐“จ) ๐“”

        A kernel that represents the posterior over E given the history up to time n.

        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          instance Learning.IT.instIsMarkovKernelForallSubtypeNatMemFinsetIicProdBayesTrajMeasurePosterior {๐“” : Type u_3} {๐“ : Type u_1} {๐“จ : Type u_2} [MeasurableSpace ๐“”] [MeasurableSpace ๐“] [MeasurableSpace ๐“จ] [StandardBorelSpace ๐“”] [Nonempty ๐“”] (Q : MeasureTheory.Measure ๐“”) [MeasureTheory.IsProbabilityMeasure Q] (ฮบ : ProbabilityTheory.Kernel (๐“” ร— ๐“) ๐“จ) [ProbabilityTheory.IsMarkovKernel ฮบ] (alg : Algorithm ๐“ ๐“จ) (n : โ„•) :