LeanMachineLearning

Bandits.ArrayModel.prob_pullCount_prod_sumRewards_mem_le๐Ÿ”—

Lemma

No docstring.

๐Ÿ”—theorem
Bandits.ArrayModel.prob_pullCount_prod_sumRewards_mem_le.{u_1} {๐“ : Type u_1} {m๐“ : MeasurableSpace ๐“} [DecidableEq ๐“] [Countable ๐“] [StandardBorelSpace ๐“] [Nonempty ๐“] {alg : Learning.Algorithm ๐“ โ„} {ฮฝ : ProbabilityTheory.Kernel ๐“ โ„} [ProbabilityTheory.IsMarkovKernel ฮฝ] (a : ๐“) (n : โ„•) {s : Set (โ„• ร— โ„)} [DecidablePred fun x => x โˆˆ Prod.fst '' s] (hs : MeasurableSet s) : (arrayMeasure ฮฝ) {ฯ‰ | (Learning.pullCount (action alg) a n ฯ‰, Learning.sumRewards (action alg) (reward alg) a n ฯ‰) โˆˆ s} โ‰ค โˆ‘ k โˆˆ Finset.range (n + 1) with k โˆˆ Prod.fst '' s, (streamMeasure ฮฝ) {ฯ‰ | โˆ‘ i โˆˆ Finset.range k, ฯ‰ i a โˆˆ Prod.mk k โปยน' s}
Bandits.ArrayModel.prob_pullCount_prod_sumRewards_mem_le.{u_1} {๐“ : Type u_1} {m๐“ : MeasurableSpace ๐“} [DecidableEq ๐“] [Countable ๐“] [StandardBorelSpace ๐“] [Nonempty ๐“] {alg : Learning.Algorithm ๐“ โ„} {ฮฝ : ProbabilityTheory.Kernel ๐“ โ„} [ProbabilityTheory.IsMarkovKernel ฮฝ] (a : ๐“) (n : โ„•) {s : Set (โ„• ร— โ„)} [DecidablePred fun x => x โˆˆ Prod.fst '' s] (hs : MeasurableSet s) : (arrayMeasure ฮฝ) {ฯ‰ | (Learning.pullCount (action alg) a n ฯ‰, Learning.sumRewards (action alg) (reward alg) a n ฯ‰) โˆˆ s} โ‰ค โˆ‘ k โˆˆ Finset.range (n + 1) with k โˆˆ Prod.fst '' s, (streamMeasure ฮฝ) {ฯ‰ | โˆ‘ i โˆˆ Finset.range k, ฯ‰ i a โˆˆ Prod.mk k โปยน' s}

Code

lemma prob_pullCount_prod_sumRewards_mem_le (a : ๐“) (n : โ„•)
    {s : Set (โ„• ร— โ„)} [DecidablePred (ยท โˆˆ Prod.fst '' s)] (hs : MeasurableSet s) :
    ๐”“ {ฯ‰ | (pullCount A a n ฯ‰, sumRewards A R a n ฯ‰) โˆˆ s} โ‰ค
      โˆ‘ k โˆˆ (range (n + 1)).filter (ยท โˆˆ Prod.fst '' s),
        streamMeasure ฮฝ {ฯ‰ | โˆ‘ i โˆˆ range k, ฯ‰ i a โˆˆ Prod.mk k โปยน' s}
Proof
by
  simp_rw [sumRewards_eq]
  calc ๐”“ ((fun ฯ‰ โ†ฆ (pullCount A a n ฯ‰, โˆ‘ i โˆˆ range (pullCount A a n ฯ‰), ฯ‰.2 i a)) โปยน' s)
  _ โ‰ค ๐”“ {ฯ‰ | โˆƒ k โ‰ค n, (k, โˆ‘ i โˆˆ range k, ฯ‰.2 i a) โˆˆ s} := by
    refine measure_mono fun ฯ‰ hฯ‰ โ†ฆ ?_
    simp only [Set.mem_ofPred_eq] at hฯ‰ โŠข
    exact โŸจpullCount A a n ฯ‰, pullCount_le _ _ _, hฯ‰โŸฉ
  _ = ๐”“ (โ‹ƒ k โˆˆ (range (n + 1)).filter (ยท โˆˆ Prod.fst '' s),
      {ฯ‰ | (k, โˆ‘ i โˆˆ range k, ฯ‰.2 i a) โˆˆ s}) := by congr 1; ext; simp; grind
  _ โ‰ค โˆ‘ k โˆˆ (range (n + 1)).filter (ยท โˆˆ Prod.fst '' s),
      ๐”“ {ฯ‰ | โˆ‘ i โˆˆ range k, ฯ‰.2 i a โˆˆ Prod.mk k โปยน' s} := measure_biUnion_finset_le _ _
  _ = โˆ‘ k โˆˆ (range (n + 1)).filter (ยท โˆˆ Prod.fst '' s),
      (streamMeasure ฮฝ) {ฯ‰ | โˆ‘ i โˆˆ range k, ฯ‰ i a โˆˆ Prod.mk k โปยน' s} := by
    congr with k
    have : (๐”“).map (fun ฯ‰ โ†ฆ โˆ‘ i โˆˆ range k, ฯ‰.2 i a) =
        (streamMeasure ฮฝ).map (fun ฯ‰ โ†ฆ โˆ‘ i โˆˆ range k, ฯ‰ i a) :=
      (identDistrib_sum_range_snd a k).map_eq
    rw [Measure.ext_iff] at this
    specialize this (Prod.mk k โปยน' s) (hs.preimage (by fun_prop))
    rwa [Measure.map_apply (by fun_prop) (hs.preimage (by fun_prop)),
      Measure.map_apply (by fun_prop) (hs.preimage (by fun_prop))] at this

Actions: Source ยท Open Issue

Meaning last changed in v4.34.0-rc2-14-gf86702d (2026-08-25), the 6th 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: 15 project declarations, 111 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.