Repository navigation
feat: large deviations of the empirical means of a run under static allocations, and the error exponent of static proportions - #383
Conversation
…llocations, and the error exponent of static proportions Co-Authored-By: Claude Code <noreply@github.com>
AI review — approvedEach rubric is judged independently by multiple review agents; the PR merges only once every rubric is green — any rubric that is not green (changes requested, blocked, errored, stale, or not yet run) blocks the merge. See the rubrics.
♻️ = approved on an earlier commit, re-run before merge. Reviewing this diff at head |
- reuse measure_exists_pullCount_sumRewards_pi_le in the upper transfer - state the i.i.d. split lemma for a general space and a set of Fin n → X - make the convergence lemma public in Analysis/SpecificLimits/Basic - add measurable_empMean_pi and use it at the three call sites Co-Authored-By: Claude Code <noreply@github.com>
…/Constructions/Pi Co-Authored-By: Claude Code <noreply@github.com>
…m explicit Rewrite with Set.preimage_comp before the closing rfl and explain why the remaining equality holds definitionally. Co-Authored-By: Claude Code <noreply@github.com>
…inf_log_pi docstring Co-Authored-By: Claude Code <noreply@github.com>
There was a problem hiding this comment.
🟡 placement — request_changes claude/claude-opus-5-5
The new Measure.infinitePi lemma is in the finite-product file MeasureTheory/Constructions/Pi.lean, which now publicly imports Mathlib.Probability.Independence.InfinitePi and passes it on to everything that imports the file. All other new material and imports are where they belong.
LMLExplore/MeasureTheory/Constructions/Pi.lean:109—infinitePi_fin_mem_and_forall_add_memconcernsMeasure.infinitePiand needs independence, but it lives in the finiteMeasure.pifile. That forces a newpublic import Mathlib.Probability.Independence.InfinitePi(line 10) on the file and on every file that imports it. Fix: Move the lemma to a newLMLExplore/Probability/ProductMeasure.lean, mirroring Mathlib'sinfinitePihome. Import that file fromStaticAllocation.lean, drop theIndependence.InfinitePiimport and the infinitePi docstring lines fromConstructions/Pi.lean, and remove the old declaration there.
Reply in this thread to contest a finding; that re-runs only this rubric and posts an answer here. (To fix it, just push a commit — that re-reviews on its own. To contest again after an answer, post a NEW reply rather than editing an old one.)
claude/claude-opus-5-5 · 40s · 241.9k in (227k cache read, 14.9k cache write) / 3.5k out tokens · reviewing this diff · rubric ·
…roductMeasure The lemma concerns `Measure.infinitePi` and uses independence, so it now lives in a new `LMLExplore/Probability/ProductMeasure.lean`, mirroring Mathlib's home of `infinitePi`. `MeasureTheory/Constructions/Pi.lean` no longer imports `Mathlib.Probability.Independence.InfinitePi`. Co-Authored-By: Claude Code <noreply@github.com>
…_arm_mem Match the naming of the sibling stream lemmas, which call the reward sequence (ω i a)_i of arm a "arm". Co-Authored-By: Claude Code <noreply@github.com>
9c0ace1
This PR proves the large deviation principle for the empirical means of a run whose numbers of pulls stay within
kofT walmost surely, and derives from it the error exponent of the static proportions families of fixed-budget identification. It is the Identification roadmap's Layer 8.3 (Large deviations under static allocations), second bullet: "Deduce that the static-proportions algorithm recommendingi*(μ̂), for a task asking about the means (Layer 1.1), has error exponent the infimum of∑_a w_a I_a(x_a)over the vectors of meansxfor whichi*(μ)is not correct [GJ04]". The first bullet (the product principlehasLDP_pi_cramer, #369) handles fixed numbers of samples. Here the numbers of pulls are random and may depend on the rewards, so the law ofμ̂_Tis not a product, and the first bullet's principle has to be carried over to runs.Roadmap: Identification
Paper: RemyDegenne/Degenne2023Existence
Item: R12
New file
LMLExplore/SequentialLearning/StaticAllocation.lean(namespaceLMLExplore):hasLDP_empMean_of_abs_pullCount_sub_le: the main theorem [GJ04; D23, Theorem 12]. Take families of runsIsAlgEnvSeq (O T) (A T) (R T) (alg T) (Environment.bandit ν) (P T)with|N_{T,a} - T w a| ≤ kalmost surely, and per-arm empirical-mean laws that satisfy LDPs with good rate functionsI a. Then the laws ofμ̂_TsatisfyHasLDPwith speed1 / Tand rate functionx ↦ ∑ a, w a I a (x a).hasLDP_empMean_rateFunction_of_abs_pullCount_sub_leis the Cramér instance, for arms whose cgf is finite near0.measure_empMean_mem_le_streamMeasureandstreamMeasure_le_measure_empMean_memtransfer events aboutμ̂_Tbetween the run and LML's reward stream, in both directions, when the pull counts lie a.s. in a setS. The upper direction comes frommeasure_exists_pullCount_armObs_pi_leand needs no measurability. The lower direction goes through the rewards by count (hasLaw_rewardByCount_streamMeasure).eventually_streamMeasure_mean_mem_le_expandexists_eventually_le_streamMeasure_forall_mean_memgive exponential upper and lower bounds for the stream means, uniformly over a window of sample counts. The upper bound picks a violating count vector for eachTand applieshasLDP_pi_comp_of_tendsto_divto that sequence. The lower bound asks the first⌈T w a - k⌉₊entries of each row to have a mean near the target and the next2kentries to lie in a fixed ball, and uses the product lower bound at a box.Measure.infinitePi_mean_mem_and_forall_mem: for an i.i.d. sequence, the mean of the firstnterms and the nextmterms are independent.Additions to existing files:
SequentialLearning/SumRewards.lean:streamMeasure_map_mean(the law of the vector of stream means isMeasure.piof the per-arm laws) andstreamMeasure_forall_row_mem(events about different rows of the stream are independent), next to their siblings.streamMeasure_forall_mean_memis now re-proved as the box case ofstreamMeasure_map_mean, with its statement unchanged.Probability/LargeDeviations/Pi.lean:neg_sum_le_liminf_log_piwasprivateand is now public. It is the product lower bound, which needs no goodness, and the window lower bound uses it.Identification/StaticProportions.lean:IsStaticProportions.hasLDP_empMean, thenIsStaticProportions.limsup_log_errorProb_div_leandIsStaticProportions.neg_le_liminf_log_errorProb_div. These bound(1/T) log p_{θ,T}between-infof∑ w_a I_aover the closure and over the interior of{x | rec x ∉ correct θ}. When the two infima agree,IsStaticProportions.tendsto_log_errorProb_divgives the exact exponent andIsStaticProportions.tendsto_errorComplexitythe limit of the error complexity. The rulerecis arbitrary (not necessarily measurable), and the model needs only a measurable set of correct answers.No public declaration is removed or renamed;
neg_sum_le_liminf_log_piis the only visibility change.The statements and proofs are adapted from the formalization of [D23] in the paper project RemyDegenne/Degenne2023Existence (same author; credited in the module docstring). That formalization works in LML's array model for trajectory measures. Here the results hold for every algorithm-environment sequence against the bandit, the transfer goes through the rewards by count, and the fixed-count bounds come from LMLExplore's product principle rather than a separate compact-cover argument.
What remains of Layer 8.3 bullet 2 after this PR is its exponential-family form [D23, Theorems 1, 12]. Under the regularity of the task, the closure and interior infima coincide and equal
inf_{λ ∈ ¬i*(μ)} ∑_a w_a d(λ_a, μ_a)(alternative first), which is whatstaticDifficultyuses. Bullet 3 (two arms, [KCG16, Theorems 12–13]) is separate.Local checks (
tauceti-local-checks verify --policy ordinary) passed:scope: scoped: against a4fdeb88b5aeb10c0dca836626263ee24dc2ee9c;local-axioms: checked 4 changed module(s), 124 declaration(s); 0 violation(s); whole-librarylake build --iofailgreen, module-system, header-style and changed-module environment lint passed. These are local checks; CI verifies the pushed PR.🤖 Prepared with Claude Code