BanditRLlib
Lean gate passed before this site build; local proof declarations are shown as compiled.

Teaching chapter · canonical scope Compiled

3. Explore-Then-Commit

Round-robin exploration, empirical means, measurable commit choices, wrong-commit tails, and expected-regret assemblies under bounded or sub-Gaussian arm laws.

Orientation

Who should read this. The shortest end-to-end stochastic-bandit route in the repository.

Learning goals

  • Decompose regret into deterministic exploration cost and wrong-commit probability.
  • Follow empirical-mean concentration into a concrete Real expected-regret bound.
  • Distinguish compiled local endpoints from the still-partial upstream-compatible port.

Textbook crosswalk

Read the mathematics before the Lean interface

The Book Map is a curated formalization curriculum anchored in Bandit Algorithms, not a chapter-for-chapter reproduction of one book. Page numbers below use its free online edition; companion papers cover algorithm-specific results.

Primary spine · free online edition

Bandit Algorithms

Tor Lattimore and Csaba Szepesvári

Location
Ch. 6
Pages
online pp. 91–96
Open the source
algorithm

Explore-Then-Commit

  1. Explore

    Pull every arm m times, usually in round-robin order.

  2. Estimate

    Compute each arm's empirical mean from its exploration samples.

  3. Commit

    Choose an empirical maximizer using a documented tie rule.

  4. Exploit

    Pull that chosen arm for every remaining round.

Source theorem · faithful restatement

Theorem 6.1 (ETC regret bound)

Original source ↗

The theorem exposes the central ETC tradeoff: more exploration costs regret now but reduces the probability of committing to a wrong arm.

Source mathematical statement. ETC regret is bounded by the exploration cost plus the remaining horizon times exponentially small wrong-commit probabilities.

BanditRLlib relationship. The local canonical route constructs a measurable generated ETC law and states explicit tie semantics before deriving bounded and sub-Gaussian expected-regret endpoints.

Natural-language and Lean side by side

The mathematical readings are explanatory summaries. The exact generated Lean statement and its source link remain authoritative for hypotheses, types, constants, and indexing.

Lean declaration

BanditRLProof.ETC.argmaxCommitOracle_encode_le_of_score_le

Compiled

Plain-English statement. The canonical Rat ETC commit oracle selects the least encoded arm among all arms tying its maximal score.

Mathematical reading. The canonical Rat ETC commit oracle selects the least encoded arm among all arms tying its maximal score.
Intuition
The strict-update fold scans arms in canonical order: a strictly better score replaces the current arm, while an equal score leaves the earlier arm in place.
Why it is needed
The generated ETC policy needs deterministic, explicit tie behavior; maximality alone does not identify which maximizing action is selected.
Place in the proof
This deterministic leaf closes the tie-semantics edge between the concrete Rat commit oracle and the canonical measurable generated ETC route.
Proof idea
Identify the fold with Mathlib's first-occurrence List.argmax, compare the selected arm's list index with any tying maximizer using index_of_argmax, and rewrite finRange indices as encodings.
Lean reading notes
The only substantive assumptions are finite Rat scores and 0<K. No measure, independence, MGF, or unique-maximum assumption is introduced.
Teaching dependencies
BanditRLProof.ETC.argmaxCommitOracle
Exact Lean statement
theorem argmaxCommitOracle_encode_le_of_score_le {K : Nat} (hK : 0 < K) (scores : Fin K -> Rat) (a : Fin K) (hscore : scores ((ETC.argmaxCommitOracle hK).choose scores) <= scores a) : Encodable.encode ((ETC.argmaxCommitOracle hK).choose scores) <= Encodable.encode a
Lean declaration

BanditRLProof.ETC.integral_real_pseudoRegret_explorationArgmaxGeneratedAction_le_canonicalSubGaussianArmPerArmIntegralRegretBoundReal

Compiled

Plain-English statement. For the generated Explore-Then-Commit policy under finite-arm sub-Gaussian reward laws, expected Real pseudo-regret is bounded by the canonical per-arm exploration-plus-commit expression.

Mathematical reading. For the generated Explore-Then-Commit policy under finite-arm sub-Gaussian reward laws, expected Real pseudo-regret is bounded by the canonical per-arm exploration-plus-commit expression.
Intuition
Exploration pays a deterministic cost; exploitation pays only when empirical noise makes the commit oracle choose the wrong arm.
Why it is needed
This is a concrete end-to-end local ETC theorem rather than only a tail lemma or theorem card.
Place in the proof
Together with the generated-law, round-robin, least-tie, and named wrong-commit declarations in the public canary, it closes the scoped local ETC chapter; direct imported-LML identity remains separate.
Proof idea
Prove empirical-mean measurability, reduce a wrong commit to a pairwise deviation event, apply the sub-Gaussian tail contract, and integrate the deterministic regret split.
Lean reading notes
The Real integral is explicit. The bound and every arm-law regularity hypothesis are visible in the Lean statement; no LML theorem card is used as a proof term.
Teaching dependencies
BanditRLProof.pseudoRegret_eq_finset_sum_gap_mul_pullCount
Exact Lean statement
theorem integral_real_pseudoRegret_explorationArgmaxGeneratedAction_le_canonicalSubGaussianArmPerArmIntegralRegretBoundReal {K : Nat} {Context : Type} [MeasurableSpace Context] (spec : ETC.Spec K) (model : FiniteBanditModel K) (armLaw : Fin K -> Measure Rat) (hprob : forall arm, IsProbabilityMeasure (armLaw arm)) (sigma2 : NNReal) (hmean : forall arm, integral (armLaw arm) (fun reward : Rat => (((reward : Rat) : Real))) = (((model.mean arm : Rat) : Real))) (hsubG : forall arm, ProbabilityTheory.HasSubgaussianMGF (fun reward : Rat => ((reward : Rat) : Real) - (((model.mean arm : Rat) : Real))) sigma2 (armLaw arm)) (context : (n : Nat) -> ((j : Finset.Iic n) -> Rat) -> Context) (hcontext : forall n : Nat, Measurable (context n)) (hexplorationPulls_pos : 0 < spec.explorationPulls) (r : Nat) : let defaultAction := ETC.exploreArm spec 0 let rewardKernel := RewardKernel.contextIndependentOfActionLaws (Context

Maintainer contract

Open the canonical completion definition and blockers

Complete when a canonical measurable generated ETC law, commit and tie semantics, wrong-commit concentration, and expected-regret endpoint compile under one documented local toolchain, and every claimed upstream compatibility surface is verified exactly.

Remaining blockers

  • No remaining blocker inside the canonical local ETC scope: the public Book Map canary certifies the generated law, round-robin exploration, Rat first-occurrence/least-encoded tie rule, named wrong-commit concentration, and bounded/sub-Gaussian expected-regret endpoints. Pinned LML material remains theorem-card-only and outside this completion claim.

Chapter implementation status

MilestoneStatusLean declarationRemaining gap
Canonical sub-Gaussian ETC expected regretCompiledBanditRLProof.ETC.integral_real_pseudoRegret_explorationArgmaxGeneratedAction_le_canonicalSubGaussianArmPerArmIntegralRegretBoundReal
Canonical Rat ETC least-encoded tie ruleCompiledBanditRLProof.ETC.argmaxCommitOracle_argmax_finRange
BanditRLProof.ETC.argmaxCommitOracle_encode_le_of_score_le
Local ETC endpoint aligned with the LML theorem cardCompiledBanditRLProof.ETC.integral_real_pseudoRegret_explorationArgmaxGeneratedAction_le_canonicalSubGaussianArmPerArmIntegralRegretBoundRealDirect imported-LML symbol and toolchain identity remains cross-toolchain work.

Open boundaries

  • Direct LML symbol integration remains optional cross-toolchain work even though the local canonical chapter route compiles.
  • The website never upgrades a theorem card into a local proof certificate.

All Lean modules in this chapter

Open the complete module list (37 modules)
ModuleDeclarationsProject importsStatus
BanditRLProof.Algorithms.ETC81Compiled
BanditRLProof.Algorithms.ETCArgmaxOracle101Compiled
BanditRLProof.Algorithms.ETCBoundedRewardInfinitePiSource73Compiled
BanditRLProof.Algorithms.ETCBoundedRewardSource173Compiled
BanditRLProof.Algorithms.ETCBoundedRewardSubGaussian82Compiled
BanditRLProof.Algorithms.ETCCenteredDiffCanonicalTail31Compiled
BanditRLProof.Algorithms.ETCCenteredDiffRewardIndependence11Compiled
BanditRLProof.Algorithms.ETCCenteredDiffRewardSubGaussian32Compiled
BanditRLProof.Algorithms.ETCCenteredDiffSubGaussianWitnesses21Compiled
BanditRLProof.Algorithms.ETCCondSubGaussianWitnesses244Compiled
BanditRLProof.Algorithms.ETCCountLemmas42Compiled
BanditRLProof.Algorithms.ETCEmpiricalMean63Compiled
BanditRLProof.Algorithms.ETCEmpiricalMeanMeasurability43Compiled
BanditRLProof.Algorithms.ETCExactSubGaussianTail52Compiled
BanditRLProof.Algorithms.ETCExpectedPullCount42Compiled
BanditRLProof.Algorithms.ETCExpectedRegretAssembly42Compiled
BanditRLProof.Algorithms.ETCFiniteArmRewardLaw515Compiled
BanditRLProof.Algorithms.ETCGeneratedHistoryPolicy83Compiled
BanditRLProof.Algorithms.ETCInfinitePiExpectedRegretAssembly273Compiled
BanditRLProof.Algorithms.ETCMeasurability192Compiled
BanditRLProof.Algorithms.ETCPairwiseCenteredSubGaussianTail13Compiled
BanditRLProof.Algorithms.ETCPairwiseSubGaussianTail12Compiled
BanditRLProof.Algorithms.ETCPairwiseTailContract32Compiled
BanditRLProof.Algorithms.ETCRatArmLawRealKernel82Compiled
BanditRLProof.Algorithms.ETCRealArgmaxTie141Compiled
BanditRLProof.Algorithms.ETCRealEmpiricalMean152Compiled
BanditRLProof.Algorithms.ETCRealHistoryScore101Compiled
BanditRLProof.Algorithms.ETCRealInfinitePiTail174Compiled
BanditRLProof.Algorithms.ETCRealLMLCompat21Compiled
BanditRLProof.Algorithms.ETCRealPrefixLawTransport232Compiled
BanditRLProof.Algorithms.ETCRealSourceAdapter11Compiled
BanditRLProof.Algorithms.ETCRegretLemmas82Compiled
BanditRLProof.Algorithms.ETCSumRewardsDiff62Compiled
BanditRLProof.Algorithms.ETCTrace42Compiled
BanditRLProof.Algorithms.ETCTraceCountLemmas93Compiled
BanditRLProof.Algorithms.ETCWrongCommitCanonicalTail11Compiled
BanditRLProof.Algorithms.ETCWrongCommitRegretAssembly11Compiled