import Mathlib.MeasureTheory.Order.Lattice import Mathlib.Probability.Kernel.IonescuTulcea.Traj import Mathlib.Probability.Process.FiniteDimensionalLaws import Mathlib.Probability.HasCondDistrib import Mathlib.MeasureTheory.Measure.ProbabilityMeasure import Mathlib.Probability.Independence.Basic import Mathlib.Probability.Independence.Conditional import Mathlib.MeasureTheory.Measure.SubFinite import Mathlib.Probability.Kernel.RadonNikodym import Mathlib.Analysis.Normed.Ring.Basic import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic import Mathlib.Probability.Kernel.Composition.MapComap import Mathlib.Probability.Kernel.Composition.IntegralCompProd import Mathlib.Analysis.Convex.Integral /-! # Standalone extraction for `Learning.means_obliviousEnv` Definitions are copied verbatim; theorem proofs are replaced by `sorry`. Auto-generated by Referee. -/ set_option quotPrecheck false -- Namespace stubs (so later `open`s resolve). namespace Finset end Finset namespace MeasureTheory end MeasureTheory namespace ProbabilityTheory end ProbabilityTheory namespace ENNReal end ENNReal namespace Learning end Learning -- ═══ ForMathlib.MeasureTheory.Order.Lattice ═══ section open Finset variable {α δ : Type*} [MeasurableSpace δ] [SemilatticeInf α] {m : MeasurableSpace α} [MeasurableInf₂ α] attribute [to_dual existing] MeasurableInf₂ end -- ═══ SequentialLearning.Algorithm ═══ section open MeasureTheory ProbabilityTheory Filter Real Finset open scoped ENNReal NNReal namespace Learning variable {𝓐 𝓨 Ω : Type*} {m𝓐 : MeasurableSpace 𝓐} {m𝓨 : MeasurableSpace 𝓨} {mΩ : MeasurableSpace Ω} /-- A stochastic environment. -/ 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] section IsAlgEnvSeq variable {A : ℕ → Ω → 𝓐} {Y : ℕ → Ω → 𝓨} {env : Environment 𝓐 𝓨} {P : Measure Ω} [IsFiniteMeasure P] {N : ℕ} /-- History of the algorithm-environment sequence up to time `n`. -/ def history (A : ℕ → Ω → 𝓐) (Y : ℕ → Ω → 𝓨) (n : ℕ) (ω : Ω) : Iic n → 𝓐 × 𝓨 := fun i ↦ (A i ω, Y i ω) end IsAlgEnvSeq end Learning end -- ═══ SequentialLearning.StationaryEnv ═══ section open MeasureTheory ProbabilityTheory Filter Real Finset open scoped ENNReal NNReal namespace Learning variable {𝓐 𝓨 : Type*} {m𝓐 : MeasurableSpace 𝓐} {m𝓨 : MeasurableSpace 𝓨} /-- An oblivious environment, in which the distribution of the next feedback depends only on the last action, but in a possibly time-dependent manner. -/ @[simps] def obliviousEnv (ν : ℕ → Kernel 𝓐 𝓨) [∀ n, IsMarkovKernel (ν n)] : Environment 𝓐 𝓨 where feedback n := (ν (n + 1)).prodMkLeft _ ν0 := ν 0 variable {Ω : Type*} {mΩ : MeasurableSpace Ω} {ν : Kernel 𝓐 𝓨} [IsMarkovKernel ν] {P : Measure Ω} [IsProbabilityMeasure P] {A : ℕ → Ω → 𝓐} {Y : ℕ → Ω → 𝓨} end Learning end -- ═══ SequentialLearning.Means ═══ section open MeasureTheory ProbabilityTheory Filter Finset open scoped ENNReal namespace Learning variable {Ω 𝓐 𝓨 : Type*} {mΩ : MeasurableSpace Ω} {m𝓐 : MeasurableSpace 𝓐} {m𝓨 : MeasurableSpace 𝓨} [NormedAddCommGroup 𝓨] [NormedSpace ℝ 𝓨] {A : ℕ → Ω → 𝓐} {Y : ℕ → Ω → 𝓨} {P : Measure Ω} [IsFiniteMeasure P] {env : Environment 𝓐 𝓨} /-- The kernel that gives the measure of the feedback distribution as a function of the action chosen at time `n`. -/ noncomputable def Environment.measure (env : Environment 𝓐 𝓨) (A : ℕ → Ω → 𝓐) (Y : ℕ → Ω → 𝓨) (n : ℕ) (ω : Ω) : Kernel 𝓐 𝓨 := if n = 0 then env.ν0 else (env.feedback (n - 1)).sectR (history A Y (n - 1) ω) /-- The means of the feedback distribution as a function of the action chosen at time `n`. -/ noncomputable def Environment.means (env : Environment 𝓐 𝓨) (A : ℕ → Ω → 𝓐) (Y : ℕ → Ω → 𝓨) (k : 𝓐) (n : ℕ) (ω : Ω) : 𝓨 := (env.measure A Y n ω k)[id] lemma means_obliviousEnv (ν : ℕ → Kernel 𝓐 𝓨) [∀ n, IsMarkovKernel (ν n)] (k : 𝓐) (n : ℕ) (ω : Ω) : (obliviousEnv ν).means A Y k n ω = (ν n k)[id] := sorry end Learning end