Bandits.condDistrib_reward''
This page has the declaration's own card below, then its dependency graph, then a card for each dependency (type dependencies first, then the rest of the transitive closure). For a theorem, the graph and the dependency cards only follow its statement's dependencies (its proof is replaced by sorry, so what it proves doesn't depend on how); for everything else, both the type and the body/value are followed, since their content is part of what later declarations build on.
condDistrib_reward''π
Bandits.condDistrib_reward''No docstring.
Bandits.condDistrib_reward''.{u_1, u_2} {π : Type u_1} {Ξ© : Type u_2} {mπ : MeasurableSpace π} {mΞ© : MeasurableSpace Ξ©} {A : β β Ξ© β π} {R : β β Ξ© β β} {P : MeasureTheory.Measure Ξ©} [MeasureTheory.IsProbabilityMeasure P] {alg : Learning.Algorithm π β} {Ξ½ : ProbabilityTheory.Kernel π β} [ProbabilityTheory.IsMarkovKernel Ξ½] [Countable π] (h : Learning.IsAlgEnvSeq A R alg (Learning.stationaryEnv Ξ½) P) (n : β) : βπ[fun Ο => R n (Prod.fst Ο) | fun Ο => A n (Prod.fst Ο); MeasureTheory.Measure.prod P (streamMeasure Ξ½)] =α΅[MeasureTheory.Measure.map (fun Ο => A n (Prod.fst Ο)) (MeasureTheory.Measure.prod P (streamMeasure Ξ½))] βΞ½Bandits.condDistrib_reward''.{u_1, u_2} {π : Type u_1} {Ξ© : Type u_2} {mπ : MeasurableSpace π} {mΞ© : MeasurableSpace Ξ©} {A : β β Ξ© β π} {R : β β Ξ© β β} {P : MeasureTheory.Measure Ξ©} [MeasureTheory.IsProbabilityMeasure P] {alg : Learning.Algorithm π β} {Ξ½ : ProbabilityTheory.Kernel π β} [ProbabilityTheory.IsMarkovKernel Ξ½] [Countable π] (h : Learning.IsAlgEnvSeq A R alg (Learning.stationaryEnv Ξ½) P) (n : β) : βπ[fun Ο => R n (Prod.fst Ο) | fun Ο => A n (Prod.fst Ο); MeasureTheory.Measure.prod P (streamMeasure Ξ½)] =α΅[MeasureTheory.Measure.map (fun Ο => A n (Prod.fst Ο)) (MeasureTheory.Measure.prod P (streamMeasure Ξ½))] βΞ½
Code
lemma condDistrib_reward'' [Countable π]
(h : IsAlgEnvSeq A R alg (stationaryEnv Ξ½) P) (n : β) :
π[fun Ο β¦ R n Ο.1 | fun Ο β¦ A n Ο.1; π] =α΅[(π).map (fun Ο β¦ A n Ο.1)] Ξ½Type uses (5)
Body uses (2)
Used by (1)
Actions: Source Β· Open Issue
Proof
by
have hA := h.measurable_action
have hR := h.measurable_feedback
have h_ra' : π[R n | A n; P] =α΅[P.map (A n)] Ξ½ := h.condDistrib_feedback_stationaryEnv n
have h_law : (π).map (fun Ο β¦ A n Ο.1) = P.map (A n) := by
change ((π).map (A n β Prod.fst)) = _
rw [β Measure.map_map (by fun_prop) (by fun_prop), β Measure.fst, Measure.fst_prod]
rw [h_law]
have h_prod : π[fun Ο β¦ R n Ο.1 | fun Ο β¦ A n Ο.1; π]
=α΅[P.map (A n)] π[R n | A n; P] :=
condDistrib_fst_prod _ (by fun_prop) _
filter_upwards [h_ra', h_prod] with Ο h_eq h_prod
rw [h_prod, h_eq]Dependency graph
Type dependencies (5)
Algorithmπ
Learning.AlgorithmA stochastic, sequential algorithm.
Learning.Algorithm.{u_4, u_5} (π : Type u_4) (π¨ : Type u_5) [MeasurableSpace π] [MeasurableSpace π¨] : Type (max u_4 u_5)Learning.Algorithm.{u_4, u_5} (π : Type u_4) (π¨ : Type u_5) [MeasurableSpace π] [MeasurableSpace π¨] : Type (max u_4 u_5)
Code
structure Algorithm (π π¨ : Type*) [MeasurableSpace π] [MeasurableSpace π¨] where /-- Policy or sampling rule: distribution of the next action. -/ policy : (n : β) β Kernel (Iic n β π Γ π¨) π /-- The policy is a Markov kernel. -/ [h_policy : β n, IsMarkovKernel (policy n)] /-- Distribution of the first action. -/ p0 : Measure π /-- The first action distribution is a probability measure. -/ [hp0 : IsProbabilityMeasure p0]
Used by (216)
Actions: Source Β· Open Issue
IsAlgEnvSeqπ
Learning.IsAlgEnvSeqAn algorithm-environment sequence: a sequence of actions and feedbacks generated by an algorithm interacting with an environment.
Learning.IsAlgEnvSeq.{u_1, u_2, u_3} {π : Type u_1} {π¨ : Type u_2} {Ξ© : Type u_3} {mπ : MeasurableSpace π} {mπ¨ : MeasurableSpace π¨} {mΞ© : MeasurableSpace Ξ©} (A : β β Ξ© β π) (Y : β β Ξ© β π¨) (alg : Algorithm π π¨) (env : Environment π π¨) (P : MeasureTheory.Measure Ξ©) [MeasureTheory.IsFiniteMeasure P] : PropLearning.IsAlgEnvSeq.{u_1, u_2, u_3} {π : Type u_1} {π¨ : Type u_2} {Ξ© : Type u_3} {mπ : MeasurableSpace π} {mπ¨ : MeasurableSpace π¨} {mΞ© : MeasurableSpace Ξ©} (A : β β Ξ© β π) (Y : β β Ξ© β π¨) (alg : Algorithm π π¨) (env : Environment π π¨) (P : MeasureTheory.Measure Ξ©) [MeasureTheory.IsFiniteMeasure P] : Prop
Code
structure IsAlgEnvSeq
(A : β β Ξ© β π) (Y : β β Ξ© β π¨) (alg : Algorithm π π¨) (env : Environment π π¨)
(P : Measure Ξ©) [IsFiniteMeasure P] : Prop where
/-- The action sequence is measurable. -/
measurable_action n : Measurable (A n) := by fun_prop
/-- The feedback sequence is measurable. -/
measurable_feedback n : Measurable (Y n) := by fun_prop
/-- The first action has the correct law. -/
hasLaw_action_zero : HasLaw (fun Ο β¦ (A 0 Ο)) alg.p0 P
/-- The first feedback has the correct conditional distribution. -/
hasCondDistrib_feedback_zero : HasCondDistrib (Y 0) (A 0) env.Ξ½0 P
/-- The next action has the correct conditional distribution given the history. -/
hasCondDistrib_action n :
HasCondDistrib (A (n + 1)) (history A Y n) (alg.policy n) P
/-- The next feedback has the correct conditional distribution given the history and
next action. -/
hasCondDistrib_feedback n :
HasCondDistrib (Y (n + 1)) (fun Ο β¦ (history A Y n Ο, A (n + 1) Ο))
(env.feedback n) PType uses (3)
Used by (111)
Actions: Source Β· Open Issue
stationaryEnvπ
Learning.stationaryEnvA stationary environment, in which the distribution of the next feedback depends only on the last action.
Learning.stationaryEnv.{u_1, u_2} {π : Type u_1} {π¨ : Type u_2} {mπ : MeasurableSpace π} {mπ¨ : MeasurableSpace π¨} (Ξ½ : ProbabilityTheory.Kernel π π¨) [ProbabilityTheory.IsMarkovKernel Ξ½] : Environment π π¨Learning.stationaryEnv.{u_1, u_2} {π : Type u_1} {π¨ : Type u_2} {mπ : MeasurableSpace π} {mπ¨ : MeasurableSpace π¨} (Ξ½ : ProbabilityTheory.Kernel π π¨) [ProbabilityTheory.IsMarkovKernel Ξ½] : Environment π π¨
Code
def stationaryEnv (Ξ½ : Kernel π π¨) [IsMarkovKernel Ξ½] : Environment π π¨ := obliviousEnv fun _ β¦ Ξ½
Type uses (1)
Body uses (1)
Used by (81)
Actions: Source Β· Open Issue
streamMeasureπ
Bandits.streamMeasureMeasure of an infinite stream of rewards from each action.
Bandits.streamMeasure.{u_1, u_2} {π : Type u_1} {R : Type u_2} {mπ : MeasurableSpace π} {mR : MeasurableSpace R} (Ξ½ : ProbabilityTheory.Kernel π R) : MeasureTheory.Measure (β β π β R)Bandits.streamMeasure.{u_1, u_2} {π : Type u_1} {R : Type u_2} {mπ : MeasurableSpace π} {mR : MeasurableSpace R} (Ξ½ : ProbabilityTheory.Kernel π R) : MeasureTheory.Measure (β β π β R)
Code
noncomputable def streamMeasure (Ξ½ : Kernel π R) : Measure (β β π β R) := Measure.infinitePi fun _ β¦ Measure.infinitePi Ξ½
Used by (56)
Actions: Source Β· Open Issue
instIsProbabilityMeasureForallNatForallStreamMeasureOfIsMarkovKernelπ
Bandits.instIsProbabilityMeasureForallNatForallStreamMeasureOfIsMarkovKernelNo docstring.
Bandits.instIsProbabilityMeasureForallNatForallStreamMeasureOfIsMarkovKernel.{u_1, u_2} {π : Type u_1} {R : Type u_2} {mπ : MeasurableSpace π} {mR : MeasurableSpace R} (Ξ½ : ProbabilityTheory.Kernel π R) [ProbabilityTheory.IsMarkovKernel Ξ½] : MeasureTheory.IsProbabilityMeasure (streamMeasure Ξ½)Bandits.instIsProbabilityMeasureForallNatForallStreamMeasureOfIsMarkovKernel.{u_1, u_2} {π : Type u_1} {R : Type u_2} {mπ : MeasurableSpace π} {mR : MeasurableSpace R} (Ξ½ : ProbabilityTheory.Kernel π R) [ProbabilityTheory.IsMarkovKernel Ξ½] : MeasureTheory.IsProbabilityMeasure (streamMeasure Ξ½)
Code
instance (Ξ½ : Kernel π R) [IsMarkovKernel Ξ½] : IsProbabilityMeasure (streamMeasure Ξ½)
Type uses (1)
Actions: Source Β· Open Issue
Proof
by unfold streamMeasure infer_instance
All dependencies, transitively (3)
Environmentπ
Learning.EnvironmentA stochastic environment.
Learning.Environment.{u_4, u_5} (π : Type u_4) (π¨ : Type u_5) [MeasurableSpace π] [MeasurableSpace π¨] : Type (max u_4 u_5)Learning.Environment.{u_4, u_5} (π : Type u_4) (π¨ : Type u_5) [MeasurableSpace π] [MeasurableSpace π¨] : Type (max u_4 u_5)
Code
structure Environment (π π¨ : Type*) [MeasurableSpace π] [MeasurableSpace π¨] where /-- Distribution of the next observation as function of the past history. -/ feedback : (n : β) β Kernel ((Iic n β π Γ π¨) Γ π) π¨ /-- The feedback kernels are Markov kernels. -/ [h_feedback : β n, IsMarkovKernel (feedback n)] /-- Distribution of the first observation given the first action. -/ Ξ½0 : Kernel π π¨ /-- The initial observation kernel is a Markov kernel. -/ [hp0 : IsMarkovKernel Ξ½0]
Actions: Source Β· Open Issue
historyπ
Learning.history
History of the algorithm-environment sequence up to time n.
Learning.history.{u_1, u_2, u_3} {π : Type u_1} {π¨ : Type u_2} {Ξ© : Type u_3} (A : β β Ξ© β π) (Y : β β Ξ© β π¨) (n : β) (Ο : Ξ©) : β₯(Finset.Iic n) β π Γ π¨Learning.history.{u_1, u_2, u_3} {π : Type u_1} {π¨ : Type u_2} {Ξ© : Type u_3} (A : β β Ξ© β π) (Y : β β Ξ© β π¨) (n : β) (Ο : Ξ©) : β₯(Finset.Iic n) β π Γ π¨
Code
def history (A : β β Ξ© β π) (Y : β β Ξ© β π¨) (n : β) (Ο : Ξ©) : Iic n β π Γ π¨ := fun i β¦ (A i Ο, Y i Ο)
Actions: Source Β· Open Issue
obliviousEnvπ
Learning.obliviousEnvAn oblivious environment, in which the distribution of the next feedback depends only on the last action, but in a possibly time-dependent manner.
Learning.obliviousEnv.{u_1, u_2} {π : Type u_1} {π¨ : Type u_2} {mπ : MeasurableSpace π} {mπ¨ : MeasurableSpace π¨} (Ξ½ : β β ProbabilityTheory.Kernel π π¨) [β (n : β), ProbabilityTheory.IsMarkovKernel (Ξ½ n)] : Environment π π¨Learning.obliviousEnv.{u_1, u_2} {π : Type u_1} {π¨ : Type u_2} {mπ : MeasurableSpace π} {mπ¨ : MeasurableSpace π¨} (Ξ½ : β β ProbabilityTheory.Kernel π π¨) [β (n : β), ProbabilityTheory.IsMarkovKernel (Ξ½ n)] : Environment π π¨
Code
def obliviousEnv (Ξ½ : β β Kernel π π¨) [β n, IsMarkovKernel (Ξ½ n)] : Environment π π¨ where feedback n := (Ξ½ (n + 1)).prodMkLeft _ Ξ½0 := Ξ½ 0
Type uses (1)
Used by (10)
Actions: Source Β· Open Issue