Skip to content

chore(Measure/Comap): Move lemmas to simplify imports#42018

Draft
D-Thomine wants to merge 10 commits into
leanprover-community:masterfrom
D-Thomine:D-Thomine/comap_move
Draft

chore(Measure/Comap): Move lemmas to simplify imports#42018
D-Thomine wants to merge 10 commits into
leanprover-community:masterfrom
D-Thomine:D-Thomine/comap_move

Conversation

@D-Thomine

@D-Thomine D-Thomine commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Everything is in MeasureTheory.Measure. We move a few lemmas around (from .QuasiMeasurePreserving to .AbsolutelyContinuous, from .Restrict to .QuasiMeasurePreserving...). The goal is to put .QuasiMeasurePreserving downstream of the other files, which will allow to import .Comap into .QuasiMeasurePreserving without looping.

This works quite well since the occurrences of QuasiMeasurePreserving maps in the other files were either about QuasiMeasurePreserving maps (so could be moved to .QuasiMeasurePreserving), or could be significantly simplified while removing QuasiMeasurePreserving maps.


Open in Gitpod

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown

PR summary 250177e777

Import changes for modified files

Dependency changes

File Base Count Head Count Change
Mathlib.MeasureTheory.Measure.QuasiMeasurePreserving 1522 1531 +9 (+0.59%)
Mathlib.MeasureTheory.Measure.Comap 1523 1521 -2 (-0.13%)
Mathlib.MeasureTheory.Measure.Restrict 1524 1522 -2 (-0.13%)
Mathlib.MeasureTheory.Measure.AEMeasurable 1531 1529 -2 (-0.13%)
Import changes for all files
Files Import difference
106 files Mathlib.Analysis.Asymptotics.ExpGrowth Mathlib.Analysis.Complex.BranchLogRoot Mathlib.Analysis.Complex.CanonicalDecomposition Mathlib.Analysis.Complex.CoveringMap Mathlib.Analysis.Complex.RiemannMapping Mathlib.Analysis.Complex.SqrtDeriv Mathlib.Analysis.InnerProductSpace.NormPow Mathlib.Analysis.Meromorphic.Basic Mathlib.Analysis.Meromorphic.Divisor Mathlib.Analysis.Meromorphic.FactorizedRational Mathlib.Analysis.Meromorphic.IsolatedZeros Mathlib.Analysis.Meromorphic.NormalForm Mathlib.Analysis.Meromorphic.Order Mathlib.Analysis.Meromorphic.RCLike Mathlib.Analysis.Meromorphic.TrailingCoefficient Mathlib.Analysis.Normed.Lp.MeasurableSpace Mathlib.Analysis.SpecialFunctions.Complex.LogDeriv Mathlib.Analysis.SpecialFunctions.Log.ENNRealLogExp Mathlib.Analysis.SpecialFunctions.Pow.Deriv Mathlib.Analysis.SpecialFunctions.Sigmoid Mathlib.Analysis.SpecialFunctions.Trigonometric.Meromorphic Mathlib.Computability.AkraBazzi.AkraBazzi Mathlib.Dynamics.TopologicalEntropy.CoverEntropy Mathlib.Dynamics.TopologicalEntropy.NetEntropy Mathlib.Dynamics.TopologicalEntropy.Semiconj Mathlib.Dynamics.TopologicalEntropy.Subset Mathlib.MeasureTheory.Constructions.BorelSpace.Basic Mathlib.MeasureTheory.Constructions.BorelSpace.Complex Mathlib.MeasureTheory.Constructions.BorelSpace.ContinuousLinearMap Mathlib.MeasureTheory.Constructions.BorelSpace.Metric Mathlib.MeasureTheory.Constructions.BorelSpace.Metrizable Mathlib.MeasureTheory.Constructions.BorelSpace.Order Mathlib.MeasureTheory.Constructions.BorelSpace.Real Mathlib.MeasureTheory.Constructions.BorelSpace.WithTop Mathlib.MeasureTheory.Constructions.ClosedCompactCylinders Mathlib.MeasureTheory.Constructions.Polish.Basic Mathlib.MeasureTheory.Constructions.Polish.EmbeddingReal Mathlib.MeasureTheory.Constructions.ProjectiveFamilyContent Mathlib.MeasureTheory.Constructions.Projective Mathlib.MeasureTheory.Covering.Vitali Mathlib.MeasureTheory.Function.AEMeasurableOrder Mathlib.MeasureTheory.Function.Egorov Mathlib.MeasureTheory.Function.Floor Mathlib.MeasureTheory.Function.SimpleFuncDense Mathlib.MeasureTheory.Function.SimpleFunc Mathlib.MeasureTheory.Function.SpecialFunctions.Arctan Mathlib.MeasureTheory.Function.SpecialFunctions.Basic Mathlib.MeasureTheory.Function.SpecialFunctions.Inner Mathlib.MeasureTheory.Function.SpecialFunctions.RCLike Mathlib.MeasureTheory.Function.StronglyMeasurable.Basic Mathlib.MeasureTheory.Group.Arithmetic Mathlib.MeasureTheory.Group.MeasurableEquiv Mathlib.MeasureTheory.Group.Pointwise Mathlib.MeasureTheory.Integral.Indicator Mathlib.MeasureTheory.Integral.Lebesgue.Add Mathlib.MeasureTheory.Integral.Lebesgue.Basic Mathlib.MeasureTheory.Integral.Lebesgue.DominatedConvergence Mathlib.MeasureTheory.Integral.Lebesgue.Markov Mathlib.MeasureTheory.Integral.Lebesgue.Norm Mathlib.MeasureTheory.Integral.Lebesgue.Sub Mathlib.MeasureTheory.Integral.MeanInequalities Mathlib.MeasureTheory.Integral.RieszMarkovKakutani.Basic Mathlib.MeasureTheory.Measure.AEMeasurable Mathlib.MeasureTheory.Measure.Comap Mathlib.MeasureTheory.Measure.Complex Mathlib.MeasureTheory.Measure.Content Mathlib.MeasureTheory.Measure.Count Mathlib.MeasureTheory.Measure.Decomposition.Exhaustion Mathlib.MeasureTheory.Measure.Decomposition.Hahn Mathlib.MeasureTheory.Measure.Dirac Mathlib.MeasureTheory.Measure.MeasuredSets Mathlib.MeasureTheory.Measure.MutuallySingular Mathlib.MeasureTheory.Measure.OpenPos Mathlib.MeasureTheory.Measure.PreVariation Mathlib.MeasureTheory.Measure.Real Mathlib.MeasureTheory.Measure.Regular Mathlib.MeasureTheory.Measure.RegularityCompacts Mathlib.MeasureTheory.Measure.Restrict Mathlib.MeasureTheory.Measure.Stieltjes Mathlib.MeasureTheory.Measure.Sub Mathlib.MeasureTheory.Measure.Support Mathlib.MeasureTheory.Measure.Trim Mathlib.MeasureTheory.Measure.Typeclasses.Finite Mathlib.MeasureTheory.Measure.Typeclasses.NullSingletonClass Mathlib.MeasureTheory.Measure.Typeclasses.Probability Mathlib.MeasureTheory.Measure.Typeclasses.SFinite Mathlib.MeasureTheory.Measure.Typeclasses.ZeroOne Mathlib.MeasureTheory.Measure.WithDensityFinite Mathlib.MeasureTheory.Order.Group.Lattice Mathlib.MeasureTheory.Order.Lattice Mathlib.MeasureTheory.OuterMeasure.OfAddContent Mathlib.MeasureTheory.Topology Mathlib.MeasureTheory.VectorMeasure.Basic Mathlib.MeasureTheory.VectorMeasure.Decomposition.Hahn Mathlib.MeasureTheory.VectorMeasure.Decomposition.JordanSub Mathlib.MeasureTheory.VectorMeasure.Decomposition.Jordan Mathlib.MeasureTheory.VectorMeasure.Variation.Basic Mathlib.MeasureTheory.VectorMeasure.Variation.Defs Mathlib.MeasureTheory.VectorMeasure.Variation.Semivariation Mathlib.MeasureTheory.VectorMeasure.Variation.SignedMeasure Mathlib.NumberTheory.EulerProduct.ExpLog Mathlib.Probability.ConditionalProbability Mathlib.Probability.ProbabilityMassFunction.Basic Mathlib.Probability.ProbabilityMassFunction.Monad Mathlib.Topology.Baire.BaireMeasurable Mathlib.Topology.EMetricSpace.PairReduction
-2
Mathlib.Dynamics.BirkhoffSum.QuasiMeasurePreserving Mathlib.MeasureTheory.Measure.QuasiMeasurePreserving 9

Declarations diff (regex)

+ _root_.AEMeasurable.comp_quasiMeasurePreserving
+ _root_.MeasureTheory.Measure.AbsolutelyContinuous.ae_eq
+ _root_.MeasureTheory.NullMeasurable.comp_quasiMeasurePreserving
+ _root_.MeasureTheory.NullMeasurableSet.mono
+ _root_.MeasureTheory.NullMeasurableSet.mono_ac
+ _root_.MeasureTheory.NullMeasurableSet.smul_measure
+ ae_eq_comp
+ restrict
- AbsolutelyContinuous.ae_eq
- Measure.QuasiMeasurePreserving.ae_eq_comp
- NullMeasurable.comp_quasiMeasurePreserving
- NullMeasurableSet.mono
- NullMeasurableSet.mono_ac
- NullMeasurableSet.smul_measure
- QuasiMeasurePreserving.restrict
- comp_quasiMeasurePreserving

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 250177e).

  • +1 new declarations
  • −1 removed declarations
+MeasureTheory.Measure.nullMeasurableSet_smul_measure_iff
-MeasureTheory.nullMeasurableSet_smul_measure_iff

No changes to strong technical debt.

No changes to weak technical debt.

Current commit 250177e777
Reference commit 2c973492e6

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 Jul 22, 2026
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.

1 participant