Skip to content

chore(MeasureTheory): generalize hypotheses to NullMeasurableSet - #42924

Open
D-Thomine wants to merge 6 commits into
leanprover-community:masterfrom
D-Thomine:D-Thomine/null_measurable_things
Open

chore(MeasureTheory): generalize hypotheses to NullMeasurableSet#42924
D-Thomine wants to merge 6 commits into
leanprover-community:masterfrom
D-Thomine:D-Thomine/null_measurable_things

Conversation

@D-Thomine

@D-Thomine D-Thomine commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

This PR generalizes many statements in Mathlib.MeasureTheory from MeasurableSet s to NullMeasurableSet s μ.

This is particularly useful for lemmas around uniform integrability. A few technical statements which existed only to work around issues of measurability are deprecated thanks to this: MemLp.eLpNorm_indicator_le_of_meas, UniformIntegrable.spec', MemLp.uniformIntegrable_of_identDistrib_aux. This PR is a preliminary (and necessary) work before a much more thorough refactor of MeasureTheory.Function.UniformIntegrable.

I have chosen to change the hypotheses in place (generalizing the lemmas) instead of adding variants with the new hypothesis, in order to limit quasi-duplicates. There are some limits to this strategy, and a few lemmas have now both MeasurableSet and NullMeasurableSet versions:

  • either if the MeasurableSet version was tagged as simp;
  • or integrable_indicator_iff₀, setLIntegral_congr_fun_ae₀, setLIntegral_congr_fun₀, setLIntegral_eq_zero₀, lintegral_add_compl₀, setLIntegral_compl₀.

The latter 6 lemmas account for the largest potential downstream effects of this PR. If I did not keep the former versions of these 6 lemmas, this PR would have affected five time as many files, including files in e.g. Geometry or NumberTheory. It seems reasonable that, for quality of life purposes, we keep a few files with MeasurableSet hypotheses which are widely used in settings where measurability is essentially a given.


Open in Gitpod

@github-actions

github-actions Bot commented Aug 19, 2026

Copy link
Copy Markdown

PR summary 41781a779e

Import changes for modified files

No significant changes to the import graph

Import changes for all files
Files Import difference

Declarations diff (regex)

+ ae_restrict_eq₀
+ integrable_indicator_iff₀
+ le_eLpNorm_of_bddBelow'
+ lintegral_add_compl₀
+ restrict_add_restrict_compl₀
+ setLIntegral_compl₀
+ setLIntegral_congr_fun_ae₀
+ setLIntegral_congr_fun₀
+ setLIntegral_eq_zero₀

You can run this locally as follows
## from your `mathlib4` directory:
git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci

## summary with just the declaration names:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh <optional_commit>

## more verbose report:
../mathlib-ci/scripts/pr_summary/declarations_diff.sh long <optional_commit>

The doc-module for scripts/pr_summary/declarations_diff.sh in the mathlib-ci repository contains some details about this script.

Declarations diff (Lean)

Lean-aware diff — post-build, computed from the Lean environment (commit 41781a7).

  • +9 new declarations
  • −0 removed declarations
+MeasureTheory.Measure.restrict_add_restrict_compl₀
+MeasureTheory.ae_restrict_eq₀
+MeasureTheory.integrable_indicator_iff₀
+MeasureTheory.le_eLpNorm_of_bddBelow'
+MeasureTheory.lintegral_add_compl₀
+MeasureTheory.setLIntegral_compl₀
+MeasureTheory.setLIntegral_congr_fun_ae₀
+MeasureTheory.setLIntegral_congr_fun₀
+MeasureTheory.setLIntegral_eq_zero₀

No changes to strong technical debt.

No changes to weak technical debt.

Current commit 41781a779e
Reference commit 4ac22c7efc

This script lives in the mathlib-ci repository. To run it locally, from your mathlib4 directory:

git clone https://github.com/leanprover-community/mathlib-ci.git ../mathlib-ci
../mathlib-ci/scripts/reporting/technical-debt-metrics.sh pr_summary
  • The relative value is the weighted sum of the differences with weight given by the inverse of the current value of the statistic.
  • The absolute value is the relative value divided by the total sum of the inverses of the current values (i.e. the weighted average of the differences).

@github-actions github-actions Bot added the t-measure-probability Measure theory / Probability theory label Aug 19, 2026
@D-Thomine
D-Thomine marked this pull request as ready for review August 19, 2026 00:29

@felixpernegger felixpernegger left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI I also have #42406 open (though i need to fix some stuff);

for this PR this is not a big issue, but later it will probably be a wise idea to have multiple large scale refactors around the same files open simultaneously :)

variable {f : α → ε'}

theorem integrable_indicator_iff (hs : MeasurableSet s) :
theorem integrable_indicator_iff (hs : NullMeasurableSet s μ) :

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should depcrecate the old name (in case you didnt, maybe i overlooked it)


theorem MemLp.eLpNormEssSup_indicator_norm_ge_eq_zero (hf : MemLp f ∞ μ)
(hmeas : StronglyMeasurable f) :
(hmeas : AEStronglyMeasurable f μ) :

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would help to split this PR up in slightly smaller pieces (unless this causes big annoyances)

I.e. first PR for the lemmas you need, second for Measurable => AEMeasurable and third for MeasurableSet => NullMeasurable or whatever

This would make reviewing somewhat easier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-measure-probability Measure theory / Probability theory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants