LeanMachineLearning

Bandits.ETC.nextArm🔗

Definition

Arm pulled by the ETC algorithm at time n + 1. For n < K * m - 1, this is arm (n + 1) % K. For n = K * m - 1, this is the arm with the highest empirical mean after the exploration phase. For n ≥ K * m, this is the same arm as at time n.

🔗def
Bandits.ETC.nextArm {K : } (hK : 0 < K) (m n : ) (h : (Finset.Iic n) Fin K × ) : Fin K
Bandits.ETC.nextArm {K : } (hK : 0 < K) (m n : ) (h : (Finset.Iic n) Fin K × ) : Fin K

Code

noncomputable def ETC.nextArm (hK : 0 < K) (m n : ) (h : Iic n Fin K × ) : Fin K := have : Nonempty (Fin K) := Fin.pos_iff_nonempty.mp hK if hn : n < K * m - 1 then RoundRobin.nextAction hK n else if hn_eq : n = K * m - 1 then argmax (empMean' n h) else (h n, by simp).1

Actions: Source · Open Issue

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