Repository navigation
feat: p-variables, exact e- and p-variables, and Markov's inequality for e-variables - #384
Merged
lmlexplore-automation[bot] merged 5 commits intoNov 14, 2026
Conversation
…for e-variables
Define `ProbabilityTheory.IsPVar`, `IsExactPVar` and `IsExactEVar` for arbitrary nulls with
ℝ≥0∞ values, prove Markov's inequality for e-variables, the e-to-p calibration `E ↦ E⁻¹`, the
level-α tests `𝟙{α⁻¹ ≤ E}` and `min (α * E) 1`, and that finite products of e-variables that are
independent under every member of the null are (exact) e-variables.
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 |
Make the finite-product independence identity a public Mathlib-style lemma lintegral_prod_eq_prod_lintegral_of_indepFun' requiring measurability only on s, add IsEVar.lintegral_le_one, generalize isExactPVar_ofReal_of_map_eq to an arbitrary null, shorten the uniform-law rewrite chain and make docstrings precise about probability measures and family-wide independence. Co-Authored-By: Claude Code <noreply@github.com>
Co-Authored-By: Claude Code <noreply@github.com>
This was referenced Nov 14, 2026
…docstring Statlib's IsEVar asks ∫ᵉ (E - 1) ∂P ≠ ⊥ and ≤ 0; the ∫⁻ E ∂P ≤ P univ form is equivalent only for finite measures, so say so and cite the two Statlib bridge lemmas. Also record the finiteness hypothesis of isExactEVar_rnDeriv in the module summary. Co-Authored-By: Claude Code <noreply@github.com>
lmlexplore-automation
Bot
removed this pull request from the merge queue due to a manual request
Nov 14, 2026
Co-Authored-By: Claude Code <noreply@github.com>
Merged
via the queue into
LeanMachineLearning:main
with commit Nov 14, 2026
d7685fb
20 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 starts the EValues roadmap with its Layer 0.1 milestone, P-variables, tests and Markov's inequality [RW, Definition 1.2, Fact 1.3, Proposition 2.1]. It adds
LMLExplore/EValues/EVariable.leanandLMLExplore/EValues/PVariable.lean, both in the namespaceProbabilityTheorynext to Statlib'sIsEVar, as the roadmap's Conventions ask. Nulls are arbitrary sets of measures and values are inℝ≥0∞.Here is how each item of the milestone is covered:
IsPVar p S(P {ω | p ω ≤ α} ≤ αfor everyP ∈ Sandα : ℝ≥0∞), exact p-variablesIsExactPVar(= αforα ≤ 1) and exact e-variablesIsExactEVar(∫⁻ E ∂P = P univ, which is= 1for probability measures:IsExactEVar.lintegral_eq_one,isExactEVar_iff).P univis used so that the definition matches Statlib'sIsEVar, which asks∫⁻ E ∂P ≤ P univ.IsEVar.measure_inv_le_le(P {ω | α⁻¹ ≤ E ω} ≤ α, includingα = 0throughIsEVar.ae_lt_top). From it come the e-to-p calibrationIsEVar.isPVar_inv, the level-αtestIsEVar.lintegral_indicator_leandIsEVar.lintegral_min_mul_le(∫⁻ min (α * E) 1 ∂P ≤ α).P ∈ Sare e-variables:isEVar_finsetProd, and the exact versionisExactEVar_finsetProd. Statlib'sIsEVar.prodis the case of the two coordinates of a product space. It stays where it is and is not restated.anti_set), congruence (congr) and composition with measurable maps (comp) for every new definition. ForIsPVarthere are alsomono,union,isPVar_union_iffand the simple-null formisPVar_singleton_iff. There is alsoisEVar_iff_lintegral_le_one, the∫⁻form of Statlib'sIsEVarfor nulls of probability measures.isExactEVar_rnDeriv: a likelihood ratioQ.rnDeriv PwithQ ≪ PandQ univ = P univis exact for{P}.isExactPVar_ofReal_volume: the identity of[0, 1]under Lebesgue measure is an exact p-variable.isExactPVar_ofReal_of_map_eq: so is every real random variable uniformly distributed on[0, 1], which Layer 0.3 (U / E) will consume.IsExactPVar.ae_le_one.Before writing, I checked for duplicates. I searched the pinned Mathlib, Tau Ceti, LML, Statlib and
LMLExplore/for p-variables (PVar,pValue,p-value), exact e-variables, and Markov-type bounds onIsEVar(⁻¹ ≤,meas_ge_le). Statlib'sEValues/hasIsEVar,IsEVar.prod,IsEVar.comp,IsEVar.congrandIsEVar.ae_lt_top, which are consumed here, and nothing else on these topics. The proofs reuse Mathlib'smeas_ge_le_lintegral_div,lintegral_prod_eq_prod_lintegral_of_indepFunwithiIndepFun.precomp,Measure.lintegral_rnDerivandReal.volume_Icc. No proof is longer than 25 lines. No public declaration is removed or renamed.Milestone: EValues Layer 0.1. After this PR, nothing remains of Layer 0.1 (Statlib's
IsEVar.prodcannot be re-derived here, since Statlib is a pinned dependency). The next milestones are Layer 0.2 (p-to-e calibrators, which consumeIsPVarandisExactPVar_ofReal_volume) and Layer 0.3 (the randomized Markov inequality).Roadmap: EValues
🤖 Prepared with Claude Code