LeanMachineLearning

Bandits.ArrayModel.stepsUntil_congr_auxπŸ”—

Lemma

No docstring.

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

Code

lemma stepsUntil_congr_aux (alg : Algorithm 𝓐 R)
    (a : 𝓐) (m n : β„•) {Ο‰ Ο‰' : probSpace 𝓐 R}
    (hΟ‰1 : βˆ€ i, Ο‰.1 i = Ο‰'.1 i) (hΟ‰2_ne : βˆ€ i b, b β‰  a β†’ Ο‰.2 i b = Ο‰'.2 i b)
    (hΟ‰2_eq : βˆ€ i, i + 1 ≀ m β†’ Ο‰.2 i a = Ο‰'.2 i a)
    (h_eq : action alg (n + 1) Ο‰ = a ∧ pullCount (action alg) a (n + 1) Ο‰ = m) :
    action alg (n + 1) Ο‰' = a ∧ pullCount (action alg) a (n + 1) Ο‰' = m
Proof
by
  obtain ⟨h_action, h_pc⟩ := h_eq
  have h_hist := hist_congr alg n (Ο‰ := Ο‰) (Ο‰' := Ο‰') (by grind) fun i b hi ↦ ?_
  swap
  Β· rcases eq_or_ne b a with (rfl | hba)
    · refine hω2_eq i ?_
      rw [h_pc] at hi
      grind
    Β· grind
  constructor
  Β· rw [← h_action, action_add_one_eq]
    simp [h_hist, hω1]
  Β· simp_rw [← h_pc, pullCount_eq_sum]
    refine Finset.sum_congr rfl fun i hi ↦ ?_
    congr 2
    rw [hist_eq _ _ n, hist_eq _ _ n, funext_iff] at h_hist
    unfold action
    specialize h_hist ⟨i, by grind⟩
    simp only at h_hist
    rw [h_hist]

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, 77 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.