Repository navigation
feat: p-to-e calibrators, their admissibility, rescaling, mixtures and the power calibrators - #393
Merged
lmlexplore-automation[bot] merged 5 commits intoNov 14, 2026
Conversation
…d the power calibrators 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
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 |
…alibrator semicontinuity - Move `IsPVar.measure_preimage_le`, `IsPVar.lintegral_comp_le` and the uniform-law distribution lemma `volume_restrict_Icc_ofReal_lt` (now public) to `PVariable.lean`, and extract its `≤` twin `volume_restrict_Icc_ofReal_le` from `isExactPVar_ofReal_volume`. - Rename `measurable_powCalibrator` to `measurable_uncurry_powCalibrator`. - Extract `upperSemicontinuous_powCalibrator` and a private `toReal_le_one_of_le_one`. - Fix overclaiming docstrings (κ ranges, probability-measure nulls, leftLim module doc). Co-Authored-By: Claude Code <noreply@github.com>
…trings Co-Authored-By: Claude Code <noreply@github.com>
…mplify arithmetic closes Move `hasDerivAt_rpow_sub_one_mul` to a public `Real.hasDerivAt_rpow_sub_one_mul` in `LMLExplore/Analysis/SpecialFunctions/Pow/Deriv.lean`, replace the private `toReal_le_one_of_le_one` by the Mathlib lemma `ENNReal.toReal_le_of_le_ofReal`, and close the arithmetic in `setLIntegral_powCalibrator` and `h_inv` with `simp`. Co-Authored-By: Claude Code <noreply@github.com>
…ow_sub_one_mul_div The lemma differentiates in the exponent, so it follows Mathlib's `const_rpow` convention, and the name now records the `/ log x ^ 2` factor. 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
Merged
via the queue into
LeanMachineLearning:main
with commit Nov 14, 2026
bc0ac73
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 adds p-to-e calibrators to the EValues library [RW, Definition 2.3, Propositions 2.5–2.6, (2.1)–(2.2); VW21, Proposition 2.1]. It covers the definition, its validity for every null on every measurable space, its converse, and the characterization of admissible calibrators. It also adds the rescaling, mixtures, and the power calibrators with their mixture in closed form. Everything is in
ℝ≥0∞and lives in the namespaceProbabilityTheory, next toIsPVarand Statlib'sIsEVar, as the roadmap's Conventions ask.Roadmap: EValues
Milestone: EValues Layer 0.2, Calibrators. Here is how each item is covered (new file
EValues/Calibrator.lean):IsPToECalibrator f: an antitonef : ℝ≥0∞ → ℝ≥0∞, zero on(1, ∞], with∫⁻ x in Icc 0 1, f (ENNReal.ofReal x) ≤ 1. As the roadmap asks, the characterization of [RW, Proposition 2.5] is the definition. It also providesIsPToECalibrator.measurable.IsPToECalibrator.isEVar_comp: for a null of probability measures,f ∘ pis an e-variable for every p-variablep[VW21, Proposition 2.1]. The proof goes through two public lemmas:IsPVar.measure_preimage_le: a p-variable charges every lower set ofℝ≥0∞at most as much as the uniform law on[0, 1]does.IsPVar.lintegral_comp_le: for every antitonef,∫⁻ f ∘ p ∂P ≤ ∫⁻ x in Icc 0 1, f (ofReal x), under any measure of mass at most1. This uses the layer cake formula on both sides.isPToECalibrator_iff_isEVar: an antitonefvanishing on(1, ∞]is a calibrator exactly whenfapplied to the identity of[0, 1]under Lebesgue measure is an e-variable. This uses the existingisExactPVar_ofReal_volume.IsPToECalibrator.le_inv:f x ≤ x⁻¹([RW], text after (2.5)).IsAdmissiblePToECalibrator: every calibratorg ≥ fisf[RW, Definition 2.3(iii)].isAdmissiblePToECalibrator_iff: a calibrator is admissible exactly when it isUpperSemicontinuous,f 0 = ∞and∫₀¹ f = 1[RW, Proposition 2.5].fequals each of three calibrators that dominate it. They arefplus the constant1 - ∫₀¹ fon[0, 1];fset to∞at0; and Mathlib's left limitFunction.leftLim f. The last differs fromfonly at its countably many discontinuities (Antitone.countable_not_continuousAt).falmost everywhere (ae_eq_of_ae_le_of_lintegral_le), and upper semicontinuity rules out a gap to the left of any point.IsPToECalibrator.const_mul_comp_mulandIsAdmissiblePToECalibrator.const_mul_comp_mulshow thatx ↦ a f (a x), fora : ℝ≥0with1 ≤ a, is a calibrator, resp. an admissible one.isPToECalibrator_lintegral:x ↦ ∫⁻ i, f i x ∂πis a calibrator for a probability measureπand a jointly measurable family that isπ-a.e. a calibrator (Tonelli, no integrability).powCalibrator κ:x ↦ κ x ^ (κ - 1)on[0, 1], zero above. It comes withpowCalibrator_def, simp lemmaspowCalibrator_of_le_one/powCalibrator_of_one_lt,measurable_powCalibratorandsetLIntegral_powCalibrator.0 < κ ≤ 1and admissible for0 < κ < 1(isAdmissiblePToECalibrator_powCalibrator) [RW, (2.1)].powMixCalibrator, its mixture overκuniform on(0, 1), is a calibrator (derived fromisPToECalibrator_lintegral).powMixCalibrator_ofRealgives its closed form(1 - x + x log x) / (x (log x) ^ 2)on(0, 1)[RW, (2.2)], by the fundamental theorem of calculus.Two general lemmas go to their natural homes:
Antitone.upperSemicontinuous_leftLim, in the new fileTopology/Order/LeftRightLim.lean, next to Mathlib'sTopology/Order/LeftRightLim.lean: the left limit of an antitone function is upper semicontinuous.UpperSemicontinuous.ennreal_const_mul, inTopology/Semicontinuity/ENNReal.lean, beside the existingLowerSemicontinuous.ennreal_const_mul(whose docstring is adapted).Reuse: before writing, I searched Mathlib, Tau Ceti, LML, Statlib and
LMLExplore/for calibrators (calibrat), for integral comparisons under stochastic dominance, and for semicontinuity ofleftLim. None of these exist. Tau Ceti'sProbability/StochasticOrder.leancompares cdfs and couplings of real laws and has no integral comparison of antitone functions inℝ≥0∞. The proofs reuse:ℝ≥0∞layer cake formulaTauCeti.lintegral_rpow_eq_lintegral_meas_ofReal_lt_mul(at exponent1),TauCeti.setLIntegral_comp_mul_left_mul_rpow(the change of variables of the rescaling) andTauCeti.lintegral_ofReal_rpow_Ioo(the integral ofx ^ (κ - 1));Function.leftLimAPI,Antitone.countable_not_continuousAt,ae_eq_of_ae_le_of_lintegral_le,lintegral_lintegral_swap,Real.hasStrictDerivAt_const_rpowandintervalIntegral.integral_eq_sub_of_hasDerivAt.No proof is longer than 35 lines. No public declaration is removed or renamed.
What remains of Layer 0.2 after this PR: the e-to-p direction, that
t ↦ min 1 t⁻¹is the only admissible e-to-p calibrator [RW, Proposition 2.4], and the representation of e-variables for an atomless law as calibrated exact p-variables [RW, Proposition 2.7]. The admissibility of the mixturepowMixCalibratoris also not proved here: its integral is1and it is∞at0, but its upper semicontinuity needs a monotone-convergence argument.Local checks (not CI):
tauceti-local-checks verify --policy ordinaryexited 0 on the pushed head.scope: scoped: against 9c0ace1dc80645e20b280043bb50daf007ee6723lake build --iofailsucceeded (8625 jobs).local-axioms: checked 3 changed module(s), 58 declaration(s); 0 violation(s)🤖 Prepared with Claude Code