LeanMachineLearning

Bandits.UCB.pullCount_le_add_three_ae๐Ÿ”—

Lemma

No docstring.

๐Ÿ”—theorem
Bandits.UCB.pullCount_le_add_three_ae.{u_1} {K : โ„•} {hK : 0 < K} {c : โ„} {ฮฝ : ProbabilityTheory.Kernel (Fin K) โ„} [ProbabilityTheory.IsMarkovKernel ฮฝ] {ฮฉ : Type u_1} {mฮฉ : MeasurableSpace ฮฉ} {P : MeasureTheory.Measure ฮฉ} [MeasureTheory.IsProbabilityMeasure P] {A : โ„• โ†’ ฮฉ โ†’ Fin K} {R : โ„• โ†’ ฮฉ โ†’ โ„} [Nonempty (Fin K)] (h : Learning.IsAlgEnvSeq A R (ucbAlgorithm hK c) (Learning.stationaryEnv ฮฝ) P) (a : Fin K) (n C : โ„•) (hC : C โ‰  0) : โˆ€แต (ฯ‰ : ฮฉ) โˆ‚P, Learning.pullCount A a n ฯ‰ โ‰ค C + 1 + โˆ‘ s โˆˆ Finset.range n, Set.indicator {s | A s ฯ‰ = a โˆง C < Learning.pullCount A a s ฯ‰ โˆง โˆซ (x : โ„), id x โˆ‚ฮฝ (bestArm ฮฝ) โ‰ค Learning.empMean A R (bestArm ฮฝ) s ฯ‰ + ucbWidth A c (bestArm ฮฝ) s ฯ‰ โˆง Learning.empMean A R (A s ฯ‰) s ฯ‰ - ucbWidth A c (A s ฯ‰) s ฯ‰ โ‰ค โˆซ (x : โ„), id x โˆ‚ฮฝ (A s ฯ‰)} 1 s + โˆ‘ s โˆˆ Finset.range n, Set.indicator {s | 0 < Learning.pullCount A (bestArm ฮฝ) s ฯ‰ โˆง Learning.empMean A R (bestArm ฮฝ) s ฯ‰ + ucbWidth A c (bestArm ฮฝ) s ฯ‰ < โˆซ (x : โ„), id x โˆ‚ฮฝ (bestArm ฮฝ)} 1 s + โˆ‘ s โˆˆ Finset.range n, Set.indicator {s | 0 < Learning.pullCount A a s ฯ‰ โˆง โˆซ (x : โ„), id x โˆ‚ฮฝ a < Learning.empMean A R a s ฯ‰ - ucbWidth A c a s ฯ‰} 1 s
Bandits.UCB.pullCount_le_add_three_ae.{u_1} {K : โ„•} {hK : 0 < K} {c : โ„} {ฮฝ : ProbabilityTheory.Kernel (Fin K) โ„} [ProbabilityTheory.IsMarkovKernel ฮฝ] {ฮฉ : Type u_1} {mฮฉ : MeasurableSpace ฮฉ} {P : MeasureTheory.Measure ฮฉ} [MeasureTheory.IsProbabilityMeasure P] {A : โ„• โ†’ ฮฉ โ†’ Fin K} {R : โ„• โ†’ ฮฉ โ†’ โ„} [Nonempty (Fin K)] (h : Learning.IsAlgEnvSeq A R (ucbAlgorithm hK c) (Learning.stationaryEnv ฮฝ) P) (a : Fin K) (n C : โ„•) (hC : C โ‰  0) : โˆ€แต (ฯ‰ : ฮฉ) โˆ‚P, Learning.pullCount A a n ฯ‰ โ‰ค C + 1 + โˆ‘ s โˆˆ Finset.range n, Set.indicator {s | A s ฯ‰ = a โˆง C < Learning.pullCount A a s ฯ‰ โˆง โˆซ (x : โ„), id x โˆ‚ฮฝ (bestArm ฮฝ) โ‰ค Learning.empMean A R (bestArm ฮฝ) s ฯ‰ + ucbWidth A c (bestArm ฮฝ) s ฯ‰ โˆง Learning.empMean A R (A s ฯ‰) s ฯ‰ - ucbWidth A c (A s ฯ‰) s ฯ‰ โ‰ค โˆซ (x : โ„), id x โˆ‚ฮฝ (A s ฯ‰)} 1 s + โˆ‘ s โˆˆ Finset.range n, Set.indicator {s | 0 < Learning.pullCount A (bestArm ฮฝ) s ฯ‰ โˆง Learning.empMean A R (bestArm ฮฝ) s ฯ‰ + ucbWidth A c (bestArm ฮฝ) s ฯ‰ < โˆซ (x : โ„), id x โˆ‚ฮฝ (bestArm ฮฝ)} 1 s + โˆ‘ s โˆˆ Finset.range n, Set.indicator {s | 0 < Learning.pullCount A a s ฯ‰ โˆง โˆซ (x : โ„), id x โˆ‚ฮฝ a < Learning.empMean A R a s ฯ‰ - ucbWidth A c a s ฯ‰} 1 s

Code

lemma pullCount_le_add_three_ae [Nonempty (Fin K)]
    (h : IsAlgEnvSeq A R (ucbAlgorithm hK c) (stationaryEnv ฮฝ) P)
    (a : Fin K) (n C : โ„•) (hC : C โ‰  0) :
    โˆ€แต ฯ‰ โˆ‚P,
    pullCount A a n ฯ‰ โ‰ค C + 1 +
      โˆ‘ s โˆˆ range n, {s | A s ฯ‰ = a โˆง C < pullCount A a s ฯ‰ โˆง
        (ฮฝ (bestArm ฮฝ))[id] โ‰ค empMean A R (bestArm ฮฝ) s ฯ‰ + ucbWidth A c (bestArm ฮฝ) s ฯ‰ โˆง
        empMean A R (A s ฯ‰) s ฯ‰ - ucbWidth A c (A s ฯ‰) s ฯ‰ โ‰ค (ฮฝ (A s ฯ‰))[id]}.indicator 1 s +
      โˆ‘ s โˆˆ range n,
        {s | 0 < pullCount A (bestArm ฮฝ) s ฯ‰ โˆง
          empMean A R (bestArm ฮฝ) s ฯ‰ + ucbWidth A c (bestArm ฮฝ) s ฯ‰ <
            (ฮฝ (bestArm ฮฝ))[id]}.indicator 1 s +
      โˆ‘ s โˆˆ range n,
        {s | 0 < pullCount A a s ฯ‰ โˆง (ฮฝ a)[id] <
          empMean A R a s ฯ‰ - ucbWidth A c a s ฯ‰}.indicator 1 s
Proof
by
  filter_upwards [pullCount_pos_of_pullCount_gt_one h a] with ฯ‰ hฯ‰
  refine (pullCount_le_add_three (R := R) a n C ฯ‰ (ฮฝ := ฮฝ) (c := c)).trans ?_
  gcongr 5 with k hk j k hk j
  ยท gcongr 1
    exact fun h_gt โ†ฆ hฯ‰ _ (lt_of_le_of_lt (by grind) h_gt) _
  ยท exact fun h_gt โ†ฆ hฯ‰ _ (lt_of_le_of_lt (by grind) h_gt) _

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: 22 project declarations, 144 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.