Repository navigation
feat: conditional e-variables, test supermartingales and wealth processes - #385
Merged
lmlexplore-automation[bot] merged 4 commits intoNov 14, 2026
Conversation
…sses Co-Authored-By: Claude Code <noreply@github.com>
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 |
…lemmas simp Make the private `adapted_mul_prod` public as `MeasureTheory.adapted_mul_prod_range`, for any commutative monoid with measurable multiplication, in the new file `LMLExplore/Probability/Process/Adapted.lean`. Tag `isCondEVar_one` and `isExactCondEVar_one` `@[simp]`, and state the finite-measure hypothesis of `isCondEVar_bot_iff` in its docstrings. Co-Authored-By: Claude Code <noreply@github.com>
This was referenced Nov 14, 2026
Co-Authored-By: Claude Code <noreply@github.com>
RemyDegenne
commented
Nov 14, 2026
RemyDegenne
commented
Nov 14, 2026
…ing pair Relate IsCondEVar and IsExactCondEVar to Mathlib's condLExp under sigma-finite restrictions, correct the module doc, derive lintegral_mul_ofReal_le_of_condExp_le from the new pull-out lemma, and rename the betting theorems to free the Layer 4.4 name. Co-Authored-By: Claude Code <noreply@github.com>
Merged
via the queue into
LeanMachineLearning:main
with commit Nov 14, 2026
c6fc99c
23 of 27 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 builds most of the EValues Layer 2.1 milestone, Conditional e-variables, test supermartingales and wealth [RW, Definitions 7.3(i) and 7.19, Propositions 7.9 and 7.20; GdHK24, Definition 1, Proposition 2; WSR24, Proposition 3; WSJ26; ShSVV11]. It adds the three process predicates of the roadmap, the bridges with Mathlib's real supermartingales, the wealth of portfolios with its special cases, and the converse factorization. Everything is in
ℝ≥0∞, stated with set integrals, for any filtration and any nullS : Set (Measure Ω), in the namespaceProbabilityTheorynext to Statlib'sIsEVar, as the roadmap's Conventions ask.Roadmap: EValues
Here is how each item of Layer 2.1 is covered:
IsCondEVar X m S(∫⁻ ω in s, X ω ∂P ≤ P sfor everyP ∈ Sandm-measurables) and its exact versionIsExactCondEVar(= P s), inEValues/CondEVariable.lean. They come with:anti_set,of_le(coarser σ-algebra) andcongr;isCondEVar_iff_withDensity_trim_leandisExactCondEVar_iff_withDensity_trim_eq;ℝ≥0∞conditional expectationcondLExp, when the restrictionsP.trim hmare σ-finite:isCondEVar_iff_condLExp_le(P⁻[X|m] ≤ᵐ[P] 1) andisExactCondEVar_iff_condLExp_eq(P⁻[X|m] =ᵐ[P] 1). The set-integral definition is kept because it needs no σ-finiteness;isCondEVar_bot_iff: given⊥, these are exactly Statlib's e-variables;IsCondEVar.isEVar;IsCondEVar.lintegral_mul_le,setLIntegral_mul_leand the exact…_mul_eqversions;isCondEVar_oneandisExactCondEVar_one;isCondEVar_sum_mul(weights summing to at most1) andisExactCondEVar_sum_mul(summing to1).IsENNSupermartingale M ℱ S,IsTestSupermartingale M ℱ S(which extends it with∫⁻ M 0 ∂P ≤ 1) andIsTestMartingale M ℱ S, with the field shapes ofSuggested.lean. Adaptedness is Mathlib'sAdapted ℱ M. These live inEValues/TestSupermartingale.lean, withmeasurable,anti_setandcongrfor each, plus:setLIntegral_leandlintegral_le(monotonicity across anyi ≤ j), and for test martingalessetLIntegral_eqandlintegral_eq;lintegral_le_oneandisEVar(everyM nis an e-variable);IsTestMartingale.isTestSupermartingaleandisTestMartingale_one(the completion check "the constant process1is a test martingale").Supermartingale.isTestSupermartingale_ofReal: a real nonnegative supermartingale with∫ M 0 ≤ 1gives a test supermartingale for{P}throughENNReal.ofReal.IsTestSupermartingale.ae_lt_top: a test supermartingale is almost surely finite at every time.IsTestSupermartingale.supermartingale_toReal: itstoRealis a real supermartingale. This goes through the existingLMLExplore.supermartingale_of_setLIntegral_succ_le, as the roadmap prescribes.IsENNSupermartingaleversions of the last two assume only∫⁻ M 0 ∂P ≠ ∞.isTestSupermartingale_mul_prodandisTestMartingale_mul_prod:M₀ * ∏ k < n, F kfor anℱ 0-measurableM₀with∫⁻ M₀ ≤ 1andℱ (k + 1)-measurable (exact) conditional e-variablesF k.isTestSupermartingale_portfolioandisTestMartingale_portfolio[WSJ26]: theSuggested.leanstatement, with a general initialM₀. For the supermartingale version the weights need only sum to at most1.isTestSupermartingale_prodandisTestMartingale_prod[RW, Proposition 7.20; GdHK24, Proposition 2] (one coordinate), and betting∏ (1 - c k + c k * E k)withc k ≤ 1,isTestSupermartingale_betting_condEVarandisTestMartingale_betting_condEVar[RW, Definition 7.21]. The_condEVarsuffix leaves the nameisTestSupermartingale_bettingfree for the Layer 4.4 theorem on betting against conditional constraints (two coordinates, one of which is1).IsENNSupermartingale.isCondEVar_div: the ratiosM (k + 1) / M kare conditional e-variables. No hypothesis is needed, becausex / ∞ = 0and(M k)⁻¹ * M k ≤ 1.IsENNSupermartingale.ae_eq_mul_prod_divandIsTestSupermartingale.ae_eq_mul_prod_div: almost surely,M n = M 0 * ∏ k < n, M (k + 1) / M k, with0 / 0 = 0.One general measure-theory tool goes in its own file,
MeasureTheory/Measure/WithDensity.lean, next to Mathlib'strim_withDensity. It islintegral_mul_le_lintegral_mul_of_forall_setLIntegral_le: if the set integrals offare at most those ofgover them-measurable sets, then∫⁻ Y * f ≤ ∫⁻ Y * gfor everym-measurableY : Ω → ℝ≥0∞. Its equality version, the two characterizationswithDensity_trim_{le,eq}_withDensity_trim_iffbehind them, andlintegral_mul_eq_lintegral_trim_withDensitycome with it. This is theℝ≥0∞"pull out what is known" step with no integrability. It is used for conditional e-variables (g = 1) and for the supermartingale ratios (f = M (k + 1),g = M k). The existingLMLExplore.lintegral_mul_ofReal_le_of_condExp_le(MeasureTheory/Function/ConditionalExpectation/LebesgueBochner.lean) proved the same pull-out step by its ownMeasurable.ennreal_induction. As the reuse review asked, it is now derived from the new lemma, and the induction is deleted. Its statement does not change, so its two callers are untouched.Before writing, I checked for duplicates. I searched the pinned Mathlib, Tau Ceti, LML, Statlib and
LMLExplore/for conditional e-variables,ℝ≥0∞-valued or test (super)martingales (TestMartingale,CondEVar,ENNSupermartingale), wealth and product processes, and the pulling-out lemma (forall_setLIntegral,withDensity/trimcomparisons). None of these exist. Mathlib hastrim_withDensity, the conditional expectationcondLExpofℝ≥0∞-valued variables (bridged to above) andae_le_of_forall_setLIntegral_le_of_sigmaFinite(the converse direction), and these are not restated. The proofs reuse Mathlib'slintegral_trim,lintegral_withDensity_eq_lintegral_mul₀,Measure.le_iff,Supermartingale.setIntegral_leandofReal_integral_eq_lintegral_ofReal, and LMLExplore'ssupermartingale_of_setLIntegral_succ_le. No proof is longer than 30 lines. The adaptedness of the wealthM₀ * ∏ k < n, F kis the publicMeasureTheory.adapted_mul_prod_range, for any commutative monoid with measurable multiplication, in its own fileProbability/Process/Adapted.lean, next to Mathlib'sAdapted. No public declaration is removed or renamed.This PR does not depend on the open Layer 0.1 PR #384: it uses only Statlib's
IsEVar, and the two touch disjoint files.Milestone: EValues Layer 2.1. After this PR, what remains of Layer 2.1 is the last bullet: mixtures
∫⁻ θ, M θ n ω ∂πof test supermartingales, minima of two test supermartingales, stopped processes and optional continuation [RW, Proposition 7.9]. Layer 2.2 (convergence and optional stopping) and Layer 3 (e-processes) consume the predicates defined here.Local checks (not CI):
tauceti-local-checks verify --policy ordinaryexited 0 on the current head.scope: scoped: against c4a9e04dde775bf5a60d932b093c88ab01b9246alake build --iofailsucceeded (8579 jobs).local-axioms: checked 5 changed module(s), 109 declaration(s); 0 violation(s)🤖 Prepared with Claude Code