LeanMachineLearning

Learning.IsAlgEnvSeq.law_pullCount_sumRewards_unique'๐Ÿ”—

Lemma

No docstring.

๐Ÿ”—theorem
Learning.IsAlgEnvSeq.law_pullCount_sumRewards_unique'.{u_1, u_2, u_3} {๐“ : Type u_1} {ฮฉ : Type u_2} {ฮฉ' : Type u_3} [DecidableEq ๐“] {m๐“ : MeasurableSpace ๐“} {mฮฉ : MeasurableSpace ฮฉ} {mฮฉ' : MeasurableSpace ฮฉ'} {P : MeasureTheory.Measure ฮฉ} [MeasureTheory.IsProbabilityMeasure P] {P' : MeasureTheory.Measure ฮฉ'} [MeasureTheory.IsProbabilityMeasure P'] {alg : Algorithm ๐“ โ„} {ฮฝ : ProbabilityTheory.Kernel ๐“ โ„} [ProbabilityTheory.IsMarkovKernel ฮฝ] {A : โ„• โ†’ ฮฉ โ†’ ๐“} {R : โ„• โ†’ ฮฉ โ†’ โ„} {Aโ‚‚ : โ„• โ†’ ฮฉ' โ†’ ๐“} {Rโ‚‚ : โ„• โ†’ ฮฉ' โ†’ โ„} {n : โ„•} [MeasurableSingletonClass ๐“] (h1 : IsAlgEnvSeq A R alg (stationaryEnv ฮฝ) P) (h2 : IsAlgEnvSeq Aโ‚‚ Rโ‚‚ alg (stationaryEnv ฮฝ) P') : ProbabilityTheory.IdentDistrib (fun ฯ‰ a => (pullCount A a n ฯ‰, sumRewards A R a n ฯ‰)) (fun ฯ‰ a => (pullCount Aโ‚‚ a n ฯ‰, sumRewards Aโ‚‚ Rโ‚‚ a n ฯ‰)) P P'
Learning.IsAlgEnvSeq.law_pullCount_sumRewards_unique'.{u_1, u_2, u_3} {๐“ : Type u_1} {ฮฉ : Type u_2} {ฮฉ' : Type u_3} [DecidableEq ๐“] {m๐“ : MeasurableSpace ๐“} {mฮฉ : MeasurableSpace ฮฉ} {mฮฉ' : MeasurableSpace ฮฉ'} {P : MeasureTheory.Measure ฮฉ} [MeasureTheory.IsProbabilityMeasure P] {P' : MeasureTheory.Measure ฮฉ'} [MeasureTheory.IsProbabilityMeasure P'] {alg : Algorithm ๐“ โ„} {ฮฝ : ProbabilityTheory.Kernel ๐“ โ„} [ProbabilityTheory.IsMarkovKernel ฮฝ] {A : โ„• โ†’ ฮฉ โ†’ ๐“} {R : โ„• โ†’ ฮฉ โ†’ โ„} {Aโ‚‚ : โ„• โ†’ ฮฉ' โ†’ ๐“} {Rโ‚‚ : โ„• โ†’ ฮฉ' โ†’ โ„} {n : โ„•} [MeasurableSingletonClass ๐“] (h1 : IsAlgEnvSeq A R alg (stationaryEnv ฮฝ) P) (h2 : IsAlgEnvSeq Aโ‚‚ Rโ‚‚ alg (stationaryEnv ฮฝ) P') : ProbabilityTheory.IdentDistrib (fun ฯ‰ a => (pullCount A a n ฯ‰, sumRewards A R a n ฯ‰)) (fun ฯ‰ a => (pullCount Aโ‚‚ a n ฯ‰, sumRewards Aโ‚‚ Rโ‚‚ a n ฯ‰)) P P'

Code

lemma _root_.Learning.IsAlgEnvSeq.law_pullCount_sumRewards_unique' [MeasurableSingletonClass ๐“]
    (h1 : IsAlgEnvSeq A R alg (stationaryEnv ฮฝ) P)
    (h2 : IsAlgEnvSeq Aโ‚‚ Rโ‚‚ alg (stationaryEnv ฮฝ) P') :
    IdentDistrib (fun ฯ‰ a โ†ฆ (pullCount A a n ฯ‰, sumRewards A R a n ฯ‰))
      (fun ฯ‰ a โ†ฆ (pullCount Aโ‚‚ a n ฯ‰, sumRewards Aโ‚‚ Rโ‚‚ a n ฯ‰)) P P'
Proof
by
  have hA := h1.measurable_action
  have hR := h1.measurable_feedback
  have hA2 := h2.measurable_action
  have hR2 := h2.measurable_feedback
  constructor
  ยท refine Measurable.aemeasurable ?_
    rw [measurable_pi_iff]
    exact fun a โ†ฆ Measurable.prod (by fun_prop) (measurable_sumRewards hA hR _ _)
  ยท refine Measurable.aemeasurable ?_
    rw [measurable_pi_iff]
    exact fun a โ†ฆ Measurable.prod (by fun_prop) (measurable_sumRewards hA2 hR2 _ _)
  have h_unique := isAlgEnvSeq_unique h1 h2
  let f := fun (p : โ„• โ†’ ๐“ ร— โ„ ) (a : ๐“) โ†ฆ (โˆ‘ i โˆˆ range n, if (p i).1 = a then 1 else 0,
    โˆ‘ i โˆˆ range n, if (p i).1 = a then (p i).2 else 0)
  have hf : Measurable f := by
    rw [measurable_pi_iff]
    intro a
    refine Measurable.prod ?_ ?_
    ยท simp only [f]
      refine measurable_sum _ fun i hi โ†ฆ Measurable.ite ?_ (by fun_prop) (by fun_prop)
      exact (measurableSet_singleton _).preimage (by fun_prop)
    ยท simp only [f]
      refine measurable_sum _ fun i hi โ†ฆ Measurable.ite ?_ (by fun_prop) (by fun_prop)
      exact (measurableSet_singleton _).preimage (by fun_prop)
  have h_eq_comp : (fun ฯ‰ a โ†ฆ (pullCount A a n ฯ‰, sumRewards A R a n ฯ‰))
      = f โˆ˜ (trajectory A R) := by
    ext ฯ‰ a : 2
    rw [pullCount_eq_comp (R := R), sumRewards_eq_comp]
    grind
  have h_eq_comp2 : (fun ฯ‰ a โ†ฆ (pullCount Aโ‚‚ a n ฯ‰, sumRewards Aโ‚‚ Rโ‚‚ a n ฯ‰))
      = f โˆ˜ (trajectory Aโ‚‚ Rโ‚‚) := by
    ext ฯ‰ a : 2
    rw [pullCount_eq_comp (R := Rโ‚‚), sumRewards_eq_comp]
    grind
  rw [h_eq_comp, h_eq_comp2, โ† Measure.map_map hf, h_unique, Measure.map_map hf,
    โ† h_eq_comp2]
  ยท rw [measurable_pi_iff]
    exact fun n โ†ฆ Measurable.prodMk (hA2 n) (hR2 n)
  ยท rw [measurable_pi_iff]
    exact fun n โ†ฆ Measurable.prodMk (hA n) (hR n)

Actions: Source ยท Open Issue

Meaning last changed in v4.34.0-rc2-14-gf86702d (2026-08-25), the 5th recorded change.

Self-contained, with its dependencies inlined and proofs replaced by sorry: download the raw file ยท open it in the Lean web editor.

Dependency graph

Audit surface: 8 project declarations, 63 external constants

โœ“ Proved: no sorry anywhere in its closure

This is the tool's own reading of one build's recorded axioms, and it is not robust against an author who wants it to pass. Checking meant to be relied on should go through Comparator, which replays the proof through the kernel from an export against an explicit list of permitted axioms.