chore: delete sigma-finite trim wrappers (incl. ForMathlib library) (−80 lines)#24
Merged
Merged
Conversation
The two local lemmas asserting `SigmaFinite (μ.trim hm)` for finite `μ` are now redundant: mathlib provides `isFiniteMeasure_trim` as an instance, and `IsFiniteMeasure.toSigmaFinite` chains automatically. Verified empirically that `inferInstance` finds `SigmaFinite (μ.trim hm)` at every former call site without help. Deleted: - ForMathlib/MeasureTheory/Measure/TrimInstances.lean (the `sigmaFinite_trim` wrapper, body `inferInstance`) - Exchangeability/Probability/CondExpBasic.lean (`sigmaFinite_trim_of_le`, body `(inferInstance : IsFiniteMeasure _).toSigmaFinite`) Replaced 5 call sites with `inferInstance`: - Exchangeability/Probability/CondExp.lean: 3 sites (lines 333, 359, 611); also dropped the `export MeasureTheory.Measure (sigmaFinite_trim)` line and the corresponding module-docstring entries. - Exchangeability/Probability/CondIndep/KallenbergIndicator.lean:100 - Exchangeability/DeFinetti/ViaL2/AlphaIicCE.lean:287 - Exchangeability/DeFinetti/ViaMartingale/FutureFiltration.lean:111 (the local `sigmaFinite_trim_tailSigma` lemma is now `inferInstance` too) Touches local API/export shape: - Removed `import ForMathlib.MeasureTheory.Measure.TrimInstances` from CondExp.lean. - Removed `ForMathlib.lean` (was a single-line root that imported only the deleted file). - Removed the `[[lean_lib]] name = "ForMathlib"` section and `"ForMathlib"` from `defaultTargets` in `lakefile.toml`. Project now has only one lean_lib (`Exchangeability`). The `ForMathlib` directory was a staging area for upstreaming candidates (per PR #13's blueprint). It is no longer needed — the only file it contained has been superseded by mathlib instance inference. Net -80 lines, 3 files deleted, build down from 3531 to 3528 jobs.
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.
Summary
The two local lemmas asserting
SigmaFinite (μ.trim hm)for finiteμare now redundant: mathlib providesisFiniteMeasure_trimas an instance, andIsFiniteMeasure.toSigmaFinitechains automatically.inferInstancefindsSigmaFinite (μ.trim hm)at every former call site without help — verified empirically at each site.Deleting the wrappers means the
ForMathliblibrary is now empty, so this PR also removes theForMathliblean_lib entirely.Net diff: 8 files, +10 / −90 (−80 lines). Build down from 3531 jobs to 3528.
Why this PR is bigger-shape than the others in the series
This is the item flagged by the audit as "touches local API/export shape." It does, in two ways:
export MeasureTheory.Measure (sigmaFinite_trim)re-export fromExchangeability.Probability.CondExp.lean.ForMathliblean_lib (lakefiledefaultTargetsentry,[[lean_lib]]block, and theForMathlib.leanroot + the single file it imported).Both are appropriate now: the
ForMathlibdirectory was a staging area for upstreaming candidates (per PR #13's blueprint), and the only file it ever contained has been superseded by mathlib instance inference. Keeping an empty staging library is worse than removing it.What changed
Deleted lemmas (both were
inferInstancechains)ForMathlib/MeasureTheory/Measure/TrimInstances.lean:sigmaFinite_trim(bodyinferInstance).Exchangeability/Probability/CondExpBasic.lean:sigmaFinite_trim_of_le(body(inferInstance : IsFiniteMeasure _).toSigmaFinite).Call sites updated (5)
All become
inferInstance:Exchangeability/Probability/CondExp.lean:333, 359, 611(threehaveIblocks)Exchangeability/Probability/CondIndep/KallenbergIndicator.lean:100Exchangeability/DeFinetti/ViaL2/AlphaIicCE.lean:287Exchangeability/DeFinetti/ViaMartingale/FutureFiltration.lean:111(the localsigmaFinite_trim_tailSigmalemma — its body becomes a one-lineinferInstance)Library/build-shape
Exchangeability/Probability/CondExp.lean: drop theimport ForMathlib.MeasureTheory.Measure.TrimInstances, theexport MeasureTheory.Measure (sigmaFinite_trim), and the corresponding module-docstring section ("SigmaFinite instances for trimmed measures" / "Main components" bullet forsigmaFinite_trim).Exchangeability/Probability/CondExpBasic.lean: drop the "σ-Finiteness" bullet from "Main components".ForMathlib.lean: deleted (one-line root, imported only the deleted file).ForMathlib/MeasureTheory/Measure/TrimInstances.lean: deleted.lakefile.toml: drop"ForMathlib"fromdefaultTargetsand the[[lean_lib]] name = "ForMathlib"block. Project now has one lean_lib.Verification
lake buildExchangeability)ForMathlib)Notes for review
inferInstance(rather than a custom lemma) was the load-bearing step: I tested at one call site first before deleting the wrappers, and the full build confirms it works at all five.DirectingMeasureCore→IsCondKernelCDF.toKernel.