LeanMachineLearning

Bandits.ArrayModel.hist_congrπŸ”—

Lemma

No docstring.

πŸ”—theorem
Bandits.ArrayModel.hist_congr.{u_1, u_2} {𝓐 : Type u_1} {R : Type u_2} {m𝓐 : MeasurableSpace 𝓐} {mR : MeasurableSpace R} [Nonempty 𝓐] [StandardBorelSpace 𝓐] [DecidableEq 𝓐] (alg : Learning.Algorithm 𝓐 R) (n : β„•) {Ο‰ Ο‰' : probSpace 𝓐 R} (hΟ‰1 : βˆ€ i ≀ n, Prod.fst Ο‰ i = Prod.fst Ο‰' i) (hΟ‰2 : βˆ€ (i : β„•) (a : 𝓐), i < Learning.pullCount (action alg) a (n + 1) Ο‰ β†’ Prod.snd Ο‰ i a = Prod.snd Ο‰' i a) : hist alg Ο‰ n = hist alg Ο‰' n
Bandits.ArrayModel.hist_congr.{u_1, u_2} {𝓐 : Type u_1} {R : Type u_2} {m𝓐 : MeasurableSpace 𝓐} {mR : MeasurableSpace R} [Nonempty 𝓐] [StandardBorelSpace 𝓐] [DecidableEq 𝓐] (alg : Learning.Algorithm 𝓐 R) (n : β„•) {Ο‰ Ο‰' : probSpace 𝓐 R} (hΟ‰1 : βˆ€ i ≀ n, Prod.fst Ο‰ i = Prod.fst Ο‰' i) (hΟ‰2 : βˆ€ (i : β„•) (a : 𝓐), i < Learning.pullCount (action alg) a (n + 1) Ο‰ β†’ Prod.snd Ο‰ i a = Prod.snd Ο‰' i a) : hist alg Ο‰ n = hist alg Ο‰' n

Code

lemma hist_congr (alg : Algorithm 𝓐 R) (n : β„•) {Ο‰ Ο‰' : probSpace 𝓐 R}
    (hΟ‰1 : βˆ€ i ≀ n, Ο‰.1 i = Ο‰'.1 i)
    (hΟ‰2 : βˆ€ i a, i < pullCount (action alg) a (n + 1) Ο‰ β†’ Ο‰.2 i a = Ο‰'.2 i a) :
    hist alg Ο‰ n = hist alg Ο‰' n
Proof
by
  induction n with
  | zero =>
    simp only [zero_add, pullCount_one] at hω2
    simp_rw [hist_zero]
    ext i : 1
    simp only [le_refl, hω1, Prod.mk.injEq, true_and]
    refine hω2 0 _ ?_
    simp [action, hω1]
  | succ n hn =>
    simp_rw [hist_add_one_eq_IicSuccProd]
    specialize hn fun i hin ↦ hΟ‰1 i (by grind)
    have h_hist : hist alg Ο‰ n = hist alg Ο‰' n := by
      refine hn fun i a hi ↦ hΟ‰2 i a (hi.trans_le ?_)
      exact pullCount_mono _ (by lia) _
    have h_action : action alg (n + 1) Ο‰ = action alg (n + 1) Ο‰' := by
      simp_rw [action_add_one_eq]
      rw [h_hist, hω1 _ le_rfl]
    congr 3
    simp only [reward_add_one, h_hist, h_action]
    refine hω2 _ _ ?_
    rw [pullCount_add_one, h_action]
    simp only [↓reduceIte]
    rw [pullCount_eq_pullCount' (R' := reward alg) (by simp)]
    simp only [Nat.add_one_sub_one]
    rw [← h_hist, hist_eq]
    change pullCount' n  (fun i ↦ (action alg i Ο‰, reward alg i Ο‰)) (action alg (n + 1) Ο‰') <
      pullCount' n (fun i ↦ (action alg i Ο‰, reward alg i Ο‰)) (action alg (n + 1) Ο‰') + 1
    grind

Actions: Source Β· Open Issue

Meaning last changed in v4.34.0-rc2-1-g439785b (2026-08-23), 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: 10 project declarations, 78 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.