Repository navigation
feat: the Bernoulli maximal inequality, counts versus pseudo-counts [DLB17, Lemma F.4] - #292
Conversation
…DLB17, Lemma F.4] Co-Authored-By: Claude Code <noreply@github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0196ftMV379vy48QfzHBVNvo
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 |
…oulli maximal bound Use `exp_mul_le_one_sub_add_mul_exp`, `Integrable.of_mem_Icc` and `integrable_exp_mul_of_mem_Icc` in the one-step bound, avoid the Pi zero defeq, and credit the Essakine2026Tight formalization in the module docstring. Co-Authored-By: Claude Code <noreply@github.com>
There was a problem hiding this comment.
🟡 reuse — request_changes claude/claude-opus-5-5
The two main results are new and reuse existing building blocks (the KLChernoff chord lemma, the exponential-supermartingale criterion, Ville's inequality), but a private integrability helper re-derives Mathlib's integrable_exp_mul_of_le.
LMLExplore/Probability/Martingale/BernoulliMaximal.lean:68— The privateintegrable_exp_condExp_div_two_subrebuilds integrability by hand (.of_boundplusae_bdd_abs_condExp_of_ae_bdd_absplus theexp (1/2)bound), but Mathlib'sProbabilityTheory.integrable_exp_mul_of_lealready gives it witht = 1,b = 1/2. Fix: Remove the helper. At both uses, writeby simpa using integrable_exp_mul_of_le 1 (1 / 2) zero_le_one (((stronglyMeasurable_condExp.mono hm).measurable.div_const 2).sub hX).aemeasurable (by filter_upwards [hX01, condExp_le-bound] ...), dischargingC/2 - X ≤ 1/2fromμ[X|m] ≤ 1(e.g. viacondExp_monoagainst the constant 1, or the existingae_bdd_abs_condExp_of_ae_bdd_abs). This is the same pattern asFreedman.lean:119.
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 · 42s · 323.3k in (279.4k cache read, 43.9k cache write) / 4.2k out tokens · reviewing this diff · rubric
There was a problem hiding this comment.
Addressed in e973ab3: integrable_exp_condExp_div_two_sub no longer rebuilds integrability by hand (.of_bound + the exp (1/2) norm bound are gone). It is now one call to Mathlib's ProbabilityTheory.integrable_exp_mul_of_le 1 (1 / 2) zero_le_one …, with only the C / 2 - X ≤ 1 / 2 bound discharged, exactly the pattern of Freedman.lean:119. I kept the private helper and did not inline it at its two uses (the pull-out in condExp_exp_condExp_div_two_sub_le_one and the supermartingale step in measure_exists_sum_lt_half_mul_sum_sub_le). Inlining would copy the measurability term and the bound proof twice, and the previous proof-quality round flagged exactly that kind of duplication. Freedman.lean also keeps its own private wrapper around integrable_exp_mul_of_le for the same reason.
There was a problem hiding this comment.
🟡 attribution — request_changes claude/claude-opus-5-5
The docstring credits DLB17, EV26 and Rémy Degenne's Essakine2026Tight source file, but the file's copyright and Authors header leaves out the source author. Every other file in the repo ported from Degenne's work names him there.
LMLExplore/Probability/Martingale/BernoulliMaximal.lean:2— Lines 2 and 4 give the copyright and authorship to 'LMLExplore contributors', but the file is adapted from Rémy Degenne's Apache 2.0Essakine2026Tight/.../Ville.lean. This is the only file in the repo with that header. Fix: Change line 2 toCopyright (c) 2026 Rémy Degenne. All rights reserved.and line 4 toAuthors: Rémy Degenne, as in the sibling portsVille.lean,Freedman.leanandBasic.lean.
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 · 19s · 86.1k in (75.6k cache read, 10.5k cache write) / 1.7k out tokens · reviewing this diff · rubric
AI review — changes requestedEach 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 |
…p_mul_of_le Also restore the source author, Rémy Degenne, in the file header, as in the sibling ports Ville.lean and Freedman.lean. Co-Authored-By: Claude Code <noreply@github.com>
This PR adds the Bernoulli maximal inequality [DLB17, Lemma F.4], [EV26, Lemma 20]. If
X iisℱ (i + 1)-measurable with values in[0, 1]almost surely andP iis a version ofE[X i | ℱ i], then for everyδ > 0,ℙ(∃ n, ∑_{i < n} X i < (1/2) ∑_{i < n} P i - log (1 / δ)) ≤ δ(LMLExplore.measure_exists_sum_lt_half_mul_sum_sub_le). This is the "counts versus pseudo-counts" tooln ≥ n̄/2 - log(3SAH/δ)that ReinforcementLearning Layer 19.2 (RF-Express [MDJKLV21, Theorem 1]) lists among the tools to prove. Its instance at the visits of a step–state–action pair, at confidenceδ/(3SAH), gives the counts event of that analysis. The other Layer 19.2 tools are either in flight (KL-to-Bernstein transport and variance transfers #291, the self-bounding inequality #287) or still to port (the logarithmic sum bound). After this PR, the milestone still needs the logarithmic sum bound, the threshold β from Layer 3.4, and the RF-Express algorithm with its PAC and sample-complexity theorem onstatesEnv(Layer 7.7).The new file
LMLExplore/Probability/Martingale/BernoulliMaximal.lean(160 lines) adds:LMLExplore.condExp_exp_condExp_div_two_sub_le_one: the one-step boundE[exp (E[X | m] / 2 - X) | m] ≤ 1forXmeasurable with values in[0, 1]a.s. It is proved from the chordexp (-x) ≤ 1 - (1 - e⁻¹) xon[0, 1](Mathlib'sconvexOn_exp), the pull-out property, and1 - e⁻¹ ≥ 1/2(Mathlib'sReal.exp_neg_one_lt_half).LMLExplore.measure_exists_sum_lt_half_mul_sum_sub_le: the time-uniform inequality. It goes through LMLExplore'sLMLExplore.supermartingale_exp_sum_of_condExp_exp_le_oneand Ville's inequalityMeasureTheory.Supermartingale.measure_exists_le_le.LMLExplore's fixed-
ηFreedman inequalityLMLExplore.measure_exists_mul_sum_condExp_sq_add_log_div_le_sum_le, applied toP i - X iwithη = 1/2, gives only- 2 log (1 / δ). The sharper constant needs the dedicated one-step bound above.This PR ports
Essakine2026Tight/ForLMLExplore/Probability/Martingale/Ville.leanfrom RemyDegenne/Essakine2026Tight at commit 9c77165d56f81c1db7a9835068356bb14886a3be (Apache 2.0, author Rémy Degenne). It generalizes and re-proves that material as follows:X i ∈ {0, 1}everywhere, together withP i ∈ [0, 1]andℱ i-strong measurability ofP i. HereX i ∈ [0, 1]holds only almost surely, andP iis any version of the conditional mean. Its range and measurability are then derived rather than assumed, and the convexity chord replaces the{0, 1}identity.LMLExplorenamespace, next to Freedman's inequality, rather than inMeasureTheory.condExp_exp_sub_le_onetocondExp_exp_condExp_div_two_sub_le_one, to name its conclusion.No declaration is removed or renamed on
main.Roadmap: ReinforcementLearning
Paper: RemyDegenne/Essakine2026Tight
Item: R12
🤖 Prepared with Claude Code