LeanMachineLearning exposition

Learning.IsBayesAlgEnvSeq.ae_IsAlgEnvSeqπŸ”—

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.

Minimal Lean file

ae_IsAlgEnvSeqπŸ”—

LemmaLearning.IsBayesAlgEnvSeq.ae_IsAlgEnvSeq

No docstring.

πŸ”—theorem
Learning.IsBayesAlgEnvSeq.ae_IsAlgEnvSeq.{u_1, u_2, u_3, u_4} {𝓔 : Type u_1} {𝓐 : Type u_2} {𝓨 : Type u_3} {Ξ© : Type u_4} [MeasurableSpace 𝓔] [MeasurableSpace 𝓐] [MeasurableSpace 𝓨] [MeasurableSpace Ξ©] {Q : MeasureTheory.Measure 𝓔} {ΞΊ : ProbabilityTheory.Kernel (𝓔 Γ— 𝓐) 𝓨} {alg : Algorithm 𝓐 𝓨} {E : Ξ© β†’ 𝓔} {A : β„• β†’ Ξ© β†’ 𝓐} {Y : β„• β†’ Ξ© β†’ 𝓨} {P : MeasureTheory.Measure Ξ©} [MeasureTheory.IsFiniteMeasure P] [StandardBorelSpace 𝓐] [Nonempty 𝓐] [StandardBorelSpace 𝓨] [Nonempty 𝓨] [ProbabilityTheory.IsMarkovKernel ΞΊ] (h : IsBayesAlgEnvSeq Q ΞΊ alg E A Y P) : βˆ€α΅ (e : 𝓔) βˆ‚Q, IsAlgEnvSeq IT.action IT.feedback alg (stationaryEnv (ProbabilityTheory.Kernel.sectR ΞΊ e)) (𝓛[trajectory A Y | E; P] e)
Learning.IsBayesAlgEnvSeq.ae_IsAlgEnvSeq.{u_1, u_2, u_3, u_4} {𝓔 : Type u_1} {𝓐 : Type u_2} {𝓨 : Type u_3} {Ξ© : Type u_4} [MeasurableSpace 𝓔] [MeasurableSpace 𝓐] [MeasurableSpace 𝓨] [MeasurableSpace Ξ©] {Q : MeasureTheory.Measure 𝓔} {ΞΊ : ProbabilityTheory.Kernel (𝓔 Γ— 𝓐) 𝓨} {alg : Algorithm 𝓐 𝓨} {E : Ξ© β†’ 𝓔} {A : β„• β†’ Ξ© β†’ 𝓐} {Y : β„• β†’ Ξ© β†’ 𝓨} {P : MeasureTheory.Measure Ξ©} [MeasureTheory.IsFiniteMeasure P] [StandardBorelSpace 𝓐] [Nonempty 𝓐] [StandardBorelSpace 𝓨] [Nonempty 𝓨] [ProbabilityTheory.IsMarkovKernel ΞΊ] (h : IsBayesAlgEnvSeq Q ΞΊ alg E A Y P) : βˆ€α΅ (e : 𝓔) βˆ‚Q, IsAlgEnvSeq IT.action IT.feedback alg (stationaryEnv (ProbabilityTheory.Kernel.sectR ΞΊ e)) (𝓛[trajectory A Y | E; P] e)

Code

lemma ae_IsAlgEnvSeq [IsMarkovKernel ΞΊ] (h : IsBayesAlgEnvSeq Q ΞΊ alg E A Y P) :
    βˆ€α΅ e βˆ‚Q, IsAlgEnvSeq IT.action IT.feedback alg (stationaryEnv (ΞΊ.sectR e))
      (condDistrib (trajectory A Y) E P e)
Type uses (7)
Body uses (9)
Used by (3)

Actions: Source Β· Open Issue

Proof
by
  filter_upwards [hasLaw_IT_action_zero h, hasCondDistrib_IT_feedback_zero h,
    ae_all_iff.2 (hasCondDistrib_IT_action h), ae_all_iff.2 (hasCondDistrib_IT_feedback h)]
    with _ ha0 hr0 hA hR
  exact ⟨IT.measurable_action, IT.measurable_feedback, ha0, hr0, hA, hR⟩

Dependency graph

Type dependencies (7)

AlgorithmπŸ”—

StructureLearning.Algorithm

A stochastic, sequential algorithm.

πŸ”—structure
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

IsBayesAlgEnvSeqπŸ”—

StructureLearning.IsBayesAlgEnvSeq

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 Ο‰))).

πŸ”—structure
Learning.IsBayesAlgEnvSeq.{u_1, u_2, u_3, u_4} {𝓔 : Type u_1} {𝓐 : Type u_2} {𝓨 : Type u_3} {Ξ© : Type u_4} [MeasurableSpace 𝓔] [MeasurableSpace 𝓐] [MeasurableSpace 𝓨] [MeasurableSpace Ξ©] (Q : MeasureTheory.Measure 𝓔) (ΞΊ : ProbabilityTheory.Kernel (𝓔 Γ— 𝓐) 𝓨) (alg : Algorithm 𝓐 𝓨) (E : Ξ© β†’ 𝓔) (A : β„• β†’ Ξ© β†’ 𝓐) (Y : β„• β†’ Ξ© β†’ 𝓨) (P : MeasureTheory.Measure Ξ©) [MeasureTheory.IsFiniteMeasure P] : Prop
Learning.IsBayesAlgEnvSeq.{u_1, u_2, u_3, u_4} {𝓔 : Type u_1} {𝓐 : Type u_2} {𝓨 : Type u_3} {Ξ© : Type u_4} [MeasurableSpace 𝓔] [MeasurableSpace 𝓐] [MeasurableSpace 𝓨] [MeasurableSpace Ξ©] (Q : MeasureTheory.Measure 𝓔) (ΞΊ : ProbabilityTheory.Kernel (𝓔 Γ— 𝓐) 𝓨) (alg : Algorithm 𝓐 𝓨) (E : Ξ© β†’ 𝓔) (A : β„• β†’ Ξ© β†’ 𝓐) (Y : β„• β†’ Ξ© β†’ 𝓨) (P : MeasureTheory.Measure Ξ©) [MeasureTheory.IsFiniteMeasure P] : Prop

Code

structure IsBayesAlgEnvSeq
    (Q : Measure 𝓔) (ΞΊ : Kernel (𝓔 Γ— 𝓐) 𝓨) (alg : Algorithm 𝓐 𝓨)
    (E : Ξ© β†’ 𝓔) (A : β„• β†’ Ξ© β†’ 𝓐) (Y : β„• β†’ Ξ© β†’ 𝓨)
    (P : Measure Ξ©) [IsFiniteMeasure P] : Prop where
  measurable_param : Measurable E := by fun_prop
  measurable_action n : Measurable (A n) := by fun_prop
  measurable_feedback n : Measurable (Y n) := by fun_prop
  hasLaw_env : HasLaw E Q P
  hasCondDistrib_action_zero : HasCondDistrib (A 0) E (Kernel.const _ alg.p0) P
  hasCondDistrib_feedback_zero : HasCondDistrib (Y 0) (fun Ο‰ ↦ (E Ο‰, A 0 Ο‰)) ΞΊ P
  hasCondDistrib_action n :
    HasCondDistrib (A (n + 1)) (fun Ο‰ ↦ (E Ο‰, history A Y n Ο‰))
      ((alg.policy n).prodMkLeft _) P
  hasCondDistrib_feedback n :
    HasCondDistrib (Y (n + 1)) (fun Ο‰ ↦ (history A Y n Ο‰, E Ο‰, A (n + 1) Ο‰))
      (ΞΊ.prodMkLeft _) P
Type uses (2)
Used by (22)

Actions: Source Β· Open Issue

IsAlgEnvSeqπŸ”—

StructureLearning.IsAlgEnvSeq

An algorithm-environment sequence: a sequence of actions and feedbacks generated by an algorithm interacting with an environment.

πŸ”—structure
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] : Prop
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] : 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) P
Type uses (3)
Used by (111)

Actions: Source Β· Open Issue

actionπŸ”—

DefinitionLearning.IT.action

feedbackπŸ”—

DefinitionLearning.IT.feedback

feedback n is the feedback at time n. This is a random variable on the measurable space β„• β†’ 𝓐 Γ— 𝓨.

πŸ”—def
Learning.IT.feedback.{u_1, u_2} {𝓐 : Type u_1} {𝓨 : Type u_2} (n : β„•) (h : β„• β†’ 𝓐 Γ— 𝓨) : 𝓨
Learning.IT.feedback.{u_1, u_2} {𝓐 : Type u_1} {𝓨 : Type u_2} (n : β„•) (h : β„• β†’ 𝓐 Γ— 𝓨) : 𝓨

Code

def feedback (n : β„•) (h : β„• β†’ 𝓐 Γ— 𝓨) : 𝓨 := (h n).2
Used by (16)

Actions: Source Β· Open Issue

stationaryEnvπŸ”—

DefinitionLearning.stationaryEnv

A stationary environment, in which the distribution of the next feedback depends only on the last action.

πŸ”—def
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

trajectoryπŸ”—

DefinitionLearning.trajectory

A random variable that gives the sequence of action-feedback pairs.

πŸ”—def
Learning.trajectory.{u_1, u_2, u_3} {𝓐 : Type u_1} {𝓨 : Type u_2} {Ξ© : Type u_3} (A : β„• β†’ Ξ© β†’ 𝓐) (Y : β„• β†’ Ξ© β†’ 𝓨) (Ο‰ : Ξ©) : β„• β†’ 𝓐 Γ— 𝓨
Learning.trajectory.{u_1, u_2, u_3} {𝓐 : Type u_1} {𝓨 : Type u_2} {Ξ© : Type u_3} (A : β„• β†’ Ξ© β†’ 𝓐) (Y : β„• β†’ Ξ© β†’ 𝓨) (Ο‰ : Ξ©) : β„• β†’ 𝓐 Γ— 𝓨

Code

def trajectory (A : β„• β†’ Ξ© β†’ 𝓐) (Y : β„• β†’ Ξ© β†’ 𝓨) (Ο‰ : Ξ©) : β„• β†’ 𝓐 Γ— 𝓨 := fun n ↦ (A n Ο‰, Y n Ο‰)
Used by (18)

Actions: Source Β· Open Issue

All dependencies, transitively (3)

historyπŸ”—

DefinitionLearning.history

History of the algorithm-environment sequence up to time n.

πŸ”—def
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 Ο‰)
Used by (72)

Actions: Source Β· Open Issue

EnvironmentπŸ”—

StructureLearning.Environment

A stochastic environment.

πŸ”—structure
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]
Used by (128)

Actions: Source Β· Open Issue

obliviousEnvπŸ”—

DefinitionLearning.obliviousEnv

An oblivious environment, in which the distribution of the next feedback depends only on the last action, but in a possibly time-dependent manner.

πŸ”—def
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