LeanMachineLearning

Bandits.TS.integral_regret_eq_add๐Ÿ”—

Lemma

No docstring.

๐Ÿ”—theorem
Bandits.TS.integral_regret_eq_add.{u_1, u_2} {K : โ„•} [Nonempty (Fin K)] {l u ฯƒ2 ฮด : โ„} {ฮฉ : Type u_1} [MeasurableSpace ฮฉ] {๐“” : Type u_2} [MeasurableSpace ๐“”] [StandardBorelSpace ๐“”] [Nonempty ๐“”] {Q : MeasureTheory.Measure ๐“”} [MeasureTheory.IsProbabilityMeasure Q] {ฮบ : ProbabilityTheory.Kernel (๐“” ร— Fin K) โ„} [ProbabilityTheory.IsMarkovKernel ฮบ] {E : ฮฉ โ†’ ๐“”} {A : โ„• โ†’ ฮฉ โ†’ Fin K} {R : โ„• โ†’ ฮฉ โ†’ โ„} {P : MeasureTheory.Measure ฮฉ} [MeasureTheory.IsProbabilityMeasure P] (hK : 0 < K) (h : Learning.IsBayesAlgEnvSeq Q ฮบ (tsAlgorithm hK Q ฮบ) E A R P) (hm : โˆ€ (e : ๐“”) (a : Fin K), โˆซ (x : โ„), id x โˆ‚ฮบ (e, a) โˆˆ Set.Icc l u) (n : โ„•) : โˆซ (x : ฮฉ), Learning.IsBayesAlgEnvSeq.regret ฮบ E A n x โˆ‚P = โˆซ (x : ฮฉ), (fun ฯ‰ => โˆ‘ t โˆˆ Finset.range n, (Learning.IsBayesAlgEnvSeq.actionMean ฮบ E (Learning.IsBayesAlgEnvSeq.bestAction ฮบ E ฯ‰) ฯ‰ - ClippedUCB.ucb A R l u ฯƒ2 ฮด (Learning.IsBayesAlgEnvSeq.bestAction ฮบ E ฯ‰) t ฯ‰)) x โˆ‚P + โˆซ (x : ฮฉ), (fun ฯ‰ => โˆ‘ t โˆˆ Finset.range n, (ClippedUCB.ucb A R l u ฯƒ2 ฮด (A t ฯ‰) t ฯ‰ - Learning.IsBayesAlgEnvSeq.actionMean ฮบ E (A t ฯ‰) ฯ‰)) x โˆ‚P
Bandits.TS.integral_regret_eq_add.{u_1, u_2} {K : โ„•} [Nonempty (Fin K)] {l u ฯƒ2 ฮด : โ„} {ฮฉ : Type u_1} [MeasurableSpace ฮฉ] {๐“” : Type u_2} [MeasurableSpace ๐“”] [StandardBorelSpace ๐“”] [Nonempty ๐“”] {Q : MeasureTheory.Measure ๐“”} [MeasureTheory.IsProbabilityMeasure Q] {ฮบ : ProbabilityTheory.Kernel (๐“” ร— Fin K) โ„} [ProbabilityTheory.IsMarkovKernel ฮบ] {E : ฮฉ โ†’ ๐“”} {A : โ„• โ†’ ฮฉ โ†’ Fin K} {R : โ„• โ†’ ฮฉ โ†’ โ„} {P : MeasureTheory.Measure ฮฉ} [MeasureTheory.IsProbabilityMeasure P] (hK : 0 < K) (h : Learning.IsBayesAlgEnvSeq Q ฮบ (tsAlgorithm hK Q ฮบ) E A R P) (hm : โˆ€ (e : ๐“”) (a : Fin K), โˆซ (x : โ„), id x โˆ‚ฮบ (e, a) โˆˆ Set.Icc l u) (n : โ„•) : โˆซ (x : ฮฉ), Learning.IsBayesAlgEnvSeq.regret ฮบ E A n x โˆ‚P = โˆซ (x : ฮฉ), (fun ฯ‰ => โˆ‘ t โˆˆ Finset.range n, (Learning.IsBayesAlgEnvSeq.actionMean ฮบ E (Learning.IsBayesAlgEnvSeq.bestAction ฮบ E ฯ‰) ฯ‰ - ClippedUCB.ucb A R l u ฯƒ2 ฮด (Learning.IsBayesAlgEnvSeq.bestAction ฮบ E ฯ‰) t ฯ‰)) x โˆ‚P + โˆซ (x : ฮฉ), (fun ฯ‰ => โˆ‘ t โˆˆ Finset.range n, (ClippedUCB.ucb A R l u ฯƒ2 ฮด (A t ฯ‰) t ฯ‰ - Learning.IsBayesAlgEnvSeq.actionMean ฮบ E (A t ฯ‰) ฯ‰)) x โˆ‚P

Code

lemma integral_regret_eq_add (hK : 0 < K) (h : IsBayesAlgEnvSeq Q ฮบ (tsAlgorithm hK Q ฮบ) E A R P)
    (hm : โˆ€ e a, (ฮบ (e, a))[id] โˆˆ (Set.Icc l u)) (n : โ„•) :
    P[IsBayesAlgEnvSeq.regret ฮบ E A n] =
      P[fun ฯ‰ โ†ฆ โˆ‘ t โˆˆ range n,
        (actionMean ฮบ E (bestAction ฮบ E ฯ‰) ฯ‰ - ucb A R l u ฯƒ2 ฮด (bestAction ฮบ E ฯ‰) t ฯ‰)] +
      P[fun ฯ‰ โ†ฆ โˆ‘ t โˆˆ range n,
        (ucb A R l u ฯƒ2 ฮด (A t ฯ‰) t ฯ‰ - actionMean ฮบ E (A t ฯ‰) ฯ‰)]
Proof
by
  have hua (t : โ„•) : Integrable (fun ฯ‰ โ†ฆ ucb A R l u ฯƒ2 ฮด (A t ฯ‰) t ฯ‰) P :=
    integrable_uncurry_ucb_comp h.measurable_action h.measurable_feedback (h.measurable_action t)
      measurable_const
  have hub (t : โ„•) : Integrable (fun ฯ‰ โ†ฆ ucb A R l u ฯƒ2 ฮด (bestAction ฮบ E ฯ‰) t ฯ‰) P :=
    integrable_uncurry_ucb_comp h.measurable_action h.measurable_feedback
      (IsBayesAlgEnvSeq.measurable_bestAction h.measurable_param) measurable_const
  have haa (t : โ„•) : Integrable (fun ฯ‰ โ†ฆ actionMean ฮบ E (A t ฯ‰) ฯ‰) P :=
    IsBayesAlgEnvSeq.integrable_uncurry_actionMean_comp h.measurable_param
      (h.measurable_action t) hm
  have hab : Integrable (fun ฯ‰ โ†ฆ actionMean ฮบ E (bestAction ฮบ E ฯ‰) ฯ‰) P :=
      IsBayesAlgEnvSeq.integrable_uncurry_actionMean_comp h.measurable_param
        (IsBayesAlgEnvSeq.measurable_bestAction h.measurable_param) hm
  calc
    _  = (โˆ‘ t โˆˆ range n, โˆซ ฯ‰, actionMean ฮบ E (bestAction ฮบ E ฯ‰) ฯ‰ โˆ‚P) -
            โˆ‘ t โˆˆ range n, โˆซ ฯ‰, actionMean ฮบ E (A t ฯ‰) ฯ‰ โˆ‚P := by
        simp_rw [IsBayesAlgEnvSeq.regret_eq_sum_gap, IsBayesAlgEnvSeq.gap_eq_sub]
        rw [integral_finsetSum _ (by fun_prop), โ† Finset.sum_sub_distrib]
        simp_rw [integral_sub hab (haa _)]
    _ = ((โˆ‘ t โˆˆ range n, โˆซ ฯ‰, actionMean ฮบ E (bestAction ฮบ E ฯ‰) ฯ‰ โˆ‚P) -
            โˆ‘ t โˆˆ range n, โˆซ ฯ‰, ucb A R l u ฯƒ2 ฮด (bestAction ฮบ E ฯ‰) t ฯ‰ โˆ‚P) +
          ((โˆ‘ t โˆˆ range n, โˆซ ฯ‰, ucb A R l u ฯƒ2 ฮด (A t ฯ‰) t ฯ‰ โˆ‚P) -
            โˆ‘ t โˆˆ range n, โˆซ ฯ‰, actionMean ฮบ E (A t ฯ‰) ฯ‰ โˆ‚P) := by
        simp [integral_ucb_action_eq_integral_ucb_bestAction hK h]
    _ = (โˆ‘ t โˆˆ range n, โˆซ ฯ‰, actionMean ฮบ E (bestAction ฮบ E ฯ‰) ฯ‰ -
              ucb A R l u ฯƒ2 ฮด (bestAction ฮบ E ฯ‰) t ฯ‰ โˆ‚P) +
          โˆ‘ t โˆˆ range n, โˆซ ฯ‰, ucb A R l u ฯƒ2 ฮด (A t ฯ‰) t ฯ‰ -
            actionMean ฮบ E (A t ฯ‰) ฯ‰ โˆ‚P := by
        rw [โ† Finset.sum_sub_distrib, โ† Finset.sum_sub_distrib]
        simp_rw [โ† integral_sub hab (hub _), โ† integral_sub (hua _) (haa _)]
    _ = _ := by
        rw [โ† integral_finsetSum _ (by fun_prop), โ† integral_finsetSum _ (by fun_prop)]

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: 27 project declarations, 140 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.