Repository navigation
feat: model-based policy evaluation over the full range of sample sizes [LWCGC24, Lemmas 1–2] - #372
Merged
lmlexplore-automation[bot] merged 5 commits intoNov 14, 2026
Conversation
…es [LWCGC24, Lemmas 1-2] Add the comparison of the resolvents of two kernels under Bernstein-type deviations on the iterated resolvents of the one-step standard deviations [LWCGC24, Lemma 2], Bernstein's inequality for the empirical state kernel of a stationary policy, and the policy-evaluation bound of the empirical MDP under the generative model [LWCGC24, Lemma 1]. Co-Authored-By: Claude Code <noreply@github.com>
RemyDegenne
commented
Nov 14, 2026
RemyDegenne
commented
Nov 14, 2026
RemyDegenne
commented
Nov 14, 2026
RemyDegenne
commented
Nov 14, 2026
Contributor
Author
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 |
…tein bound - Split the simulation bound `abs_integral_resolvent_sub_integral_resolvent_le` and the scalar recursion out of the Lemma 2 proof. - Add `sqrt_variance_le_of_abs_le` and use it in Resolvent.lean and Simulation.lean. - Add `measureReal_sqrt_add_le_abs_sub_inv_mul_sum_le`, Bernstein's inequality for the means of a function of the samples under the stream model, and derive the per-key and state-kernel Bernstein lemmas from it. - Make `integral_stateKernel_eq_sum` public in MarkovPolicy.lean; use `Convex.sum_mem`; drop unused imports; fix the Lemma 1 docstring on the constant of Lemma 11. Co-Authored-By: Claude Code <noreply@github.com>
…n bound Co-Authored-By: Claude Code <noreply@github.com>
…in bound Co-Authored-By: Claude Code <noreply@github.com>
Co-Authored-By: Claude Code <noreply@github.com>
Merged
via the queue into
LeanMachineLearning:main
with commit Nov 14, 2026
34d96f1
23 of 25 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR proves model-based policy evaluation with a generative model over the full range of sample sizes [LWCGC24, Lemma 1], together with its deterministic core [LWCGC24, Lemma 2]. It is ReinforcementLearning Layer 15.4 (b): for a stationary policy
πfixed independently of the data, with probability at least1 - δ, the value ofπin the empirical MDPM.empirical N ωis within3 C √(2 L / (N (1 - γ) ^ 3))of its value inM, withL = log (4 S log (e / (1 - γ)) / δ), as soon as18 L ≤ (1 - γ) N.LMLExplore/Probability/Kernel/Resolvent.lean(+271 lines) adds, for Markov kernels on a general measurable space:Kernel.measurable_of_eq_integral_resolvent_sqrt_varianceandKernel.mem_Icc_of_eq_integral_resolvent_sqrt_variance. For0 ≤ f ≤ C, take the iterated resolventsV 0 = R_γ f,V (l + 1) = R_γ √Var_κ(V l)of the one-step standard deviations, which are the vectorsV^(l)of [LWCGC24, (69)]. They are measurable, and0 ≤ V l ≤ C / ((1 - γ) (γ √(1 - γ)) ^ l), using main's Lemma 11 (integral_sqrt_variance_integral_resolvent_le) at each step ([LWCGC24, (73)]).Kernel.abs_integral_resolvent_sub_integral_resolvent_le_of_abs_sub_le[LWCGC24, Lemma 2]. Supposeκ'deviates fromκby|κ' V l - κ V l| ≤ √(ε Var_κ(V l)) + ε b lon the levelsl ≤ m, withlog (1 - γ)⁻¹ ≤ mand9 ε ≤ 1 - γ. Then|R_γ(κ') f - R_γ(κ) f| ≤ 3 C √(ε / (1 - γ) ^ 3). The proof is the level-by-level expansion [LWCGC24, (74)–(81)]: it uses the simulation identity on main and runs a backward induction over the levels.LMLExplore/ReinforcementLearning/Generative/PolicyEvaluation.lean(new, 360 lines) adds:Learning.MDP.measureReal_sqrt_variance_add_le_abs_integral_sub_integral_stateKernel_empirical_le: Bernstein's inequality for the empirical state kernel of a (possibly stochastic) stationary policy, with the variance under the true state kernel. Thei-th summand∑ a, π(a | s) V (ω i (s, a))is a mixture of independent samples, and Jensen's inequality bounds its variance byVar_{P_π s}(V). The bound is then the shared stream-model Bernstein inequalitymeasureReal_sqrt_add_le_abs_sub_inv_mul_sum_le(see review round 1 below).Learning.MDP.le_streamMeasure_forall_abs_value_empirical_sub_value_le[LWCGC24, Lemma 1]. It applies Lemma 2 withε = 2 L / Nandm = ⌈log (1 - γ)⁻¹⌉₊. The bound for each level and state comes from the Bernstein inequality above, since theV ldepend only onMandπ. A union bound over the(m + 1) S ≤ 2 S log (e / (1 - γ))levels and states finishes the proof. The caseγ = 0is handled directly.Differences from the roadmap statement and the source, all of which make the result stronger. [LWCGC24] and the roadmap assume
N ≥ 32 e² L / (1 - γ)and prove the constant6for rewards in[0, 1]and deterministic policies. Here the hypothesis is18 L ≤ (1 - γ) N, whichN ≥ 32 e² L / (1 - γ)implies. The constant is3, from the constant1(instead of4) of main's Lemma 11. Rewards may lie in any[0, C], and the policy may be stochastic. Lemma 2 is stated with the a priori boundb l ≥ ‖V^(l)‖∞in place of the source's‖V^(l)‖∞, which makes its hypothesis weaker. The instance-dependent first line of [LWCGC24, (31)] is not stated.Milestone: ReinforcementLearning Layer 15.4 "The full range of accuracies" [LWCGC24]. This PR closes item (b). After it, 15.4 still needs (a), Theorem 4 for finite horizons (which needs the episodic generative model of 14.3), and (c), Theorem 1 for the perturbed plug-in policy. The proof of (c) uses
Kernel.abs_integral_resolvent_sub_integral_resolvent_le_of_abs_sub_le(Lemma 2) for a policy that depends on the data, where it supplies the Bernstein-type condition through a decoupling argument.Self-review against the rubrics. Reuse: I searched Mathlib, Tau Ceti, Statlib, LML and
LMLExplore/for a resolvent comparison of this kind and for a Bernstein bound for mixtures or state kernels, and found neither. The per-keymeasureReal_sqrt_variance_add_le_abs_integral_sub_integral_empiricalKernel_leonly covers deterministic policies. The standard-deviation bound and the finite-sum form ofintegral_stateKernelare now shared lemmas (see review round 1 below). Generality: the Bernstein lemma assumes[Finite 𝓢] [Finite 𝓐], which are used for integrability and for the action weights. Lemma 1 assumes[Fintype 𝓢]forS. The deterministic lemmas hold on any measurable space.0 < γis needed there because the level bounds divide byγ, and Lemma 1 coversγ = 0separately. Documentation: proof sketches are in comments, not in the theorem docstrings. No public declaration is removed or renamed. No Mathlib material is vendored.Review round 1 (commit 1650682), all within the topic:
Probability/Moments/Variance.lean: newProbabilityTheory.sqrt_variance_le_of_abs_le(|X| ≤ Ba.e.,0 ≤ Bgives√Var[X; μ] ≤ B), used inResolvent.lean(twice),Simulation.lean(twice) andsqrt_variance_le_sqrt_variance_add_of_abs_sub_le.Probability/Kernel/Resolvent.lean: the Lemma 2 proof is split. The simulation boundKernel.abs_integral_resolvent_sub_integral_resolvent_le(new, public) gives|R_γ(κ') f - R_γ(κ) f| ≤ γ R_γ(κ') ewhen|(κ' - κ) R_γ(κ) f| ≤ e. The scalar backward recursion over the levels is the file-localle_three_mul_sqrt_of_le_mul_add.Probability/Kernel/Empirical.lean: newLMLExplore.measureReal_sqrt_add_le_abs_sub_inv_mul_sum_le, Bernstein's inequality for the meansN⁻¹ ∑_{i < N} Z (ω i)of a bounded functionZof the samples understreamMeasure. The per-keymeasureReal_sqrt_variance_add_le_abs_integral_sub_integral_empiricalKernel_leand the new state-kernel lemma are both derived from it, so the shared tail is no longer duplicated.MarkovDecisionProcess/MarkovPolicy.lean:Learning.MDP.integral_stateKernel_eq_sumis now public here. It is the finite-action form ofintegral_stateKerneland takes an integrability hypothesis instead of[Finite 𝓢]. The private copy in the new file is removed.PolicyEvaluation.lean: the convex combination step usesConvex.sum_mem, the unused importsMathlib.Analysis.Complex.ExponentialBoundsandLMLExplore.Probability.Moments.Bernsteinare dropped, and the Lemma 1 docstring now credits the constant1tointegral_sqrt_variance_integral_resolvent_le, which improves the4of [LWCGC24, Lemma 11].No public declaration is removed or renamed.
Local verification after round 1 (local checks, not CI):
scope: scoped: against 42580bf73ba1354d3254a4de5c926dc5fb16c409. The whole-librarylake build --iofailsucceeded (Build completed successfully (8531 jobs).).local-axioms: checked 6 changed module(s), 167 declaration(s); 0 violation(s). The module-system, header-style and environment-lint checks (6 changed modules, 167 declarations) also passed.Roadmap: ReinforcementLearning
🤖 Prepared with Claude Code