feat(MeasureTheory): Introduce MassFunction α giving rise to a Measure α ⊤#34138
feat(MeasureTheory): Introduce MassFunction α giving rise to a Measure α ⊤#34138pfaffelh wants to merge 1012 commits intoleanprover-community:masterfrom
MassFunction α giving rise to a Measure α ⊤#34138Conversation
PR summary cd20542aceImport changes for modified filesNo significant changes to the import graph Import changes for all files
|
giving rise to a Measure α ⊤`MassFunction α giving rise to a Measure α ⊤
…ver-community#34783) Preliminary PR for leanprover-community#26770 (subgraph). Adds the `Compatible` predicate and basic API to `Mathlib.Combinatorics.Graph.Basic`. - **Compatible**: two graphs are compatible if they agree on incidence for every edge in the intersection of their edge sets. - Includes `Compatible.isLink_iff`, reflexivity/symmetry instances, `IsLink.of_compatible`, `Compatible.of_disjoint_edgeSet`, and the `Inc`/`IsLoopAt`/`IsNonloopAt` variants. - **copy** API for copying a graph with new vertex/edge sets and `IsLink`.
…leanprover-community#35461) We also make the universe heterogeneous instances lower priority, so Lean can more easily elaborate universes. Co-authored-by: vihdzp <vi.hdz.p@mgmail.com>
…etion.map` (leanprover-community#35595) This PR extracts the change of the definition of `AdicCompletion.map` from leanprover-community#34936. @Thmoas-Guan expressed interest in using this result, so I am splitting it out here to unblock it.
…over-community#35557) We add a variant of `TensorProduct.AlgebraTensorModule.assoc` stated in terms of `IsTensorProduct`. From Pi1.
If a natural transformation is an isomorphism, then the induced morphism on (co)limits is an isomorphism.
…-community#35258) This adds an API lemma for `Finsupp` that turned out to be useful in [Heights](github.com/MichaelStollBayreuth/Heights).
…nity#35553) The plan is to instead make `Order.succ_eq_add_one` a simp lemma, i.e. write `x + 1` instead of `succ x`. We have the typeclass `SuccAddOrder` which can be used to transfer the relevant theorems from `succ x` to the `x + 1` spelling.
…r-community#35691) A product of two finally small categories is finally small.
…unity#35284) and versions for `(m)fderivWithin` versions. This generalises the existing lemmas `(m)differentiableAt_of_isInvertible_(m)fderiv` and friends. Extracted from leanprover-community#35078; from the path to immersions, embeddings and submanifolds.
…y#35476) We insert a newline between the end of markdown lists and following text. In the absence of these newlines, doc-gen4 will render the following text as part of the last item of the list.
…35520) This PR adds three Python scripts for managing `set_option backward.isDefEq.respectTransparency false in` when testing Lean PRs that change this behaviour: - `scripts/dag_traversal.py` — reusable parallel DAG traversal library for Lean import graphs, with both library and CLI interfaces - `scripts/add_backward_defeq.py` — adds `set_option` before failing declarations, traversing the DAG forward (roots first) so each module is only built after its imports are clean - `scripts/remove_backward_defeq.py` — removes unnecessary `set_option` lines (skipping those with trailing comments), traversing the DAG backward (leaves first) to avoid invalidating cached builds 🤖 Prepared with Claude Code
…rover-community#35579) Co-authored-by: Batixx <s59fpern@uni-bonn.de>
Co-authored-by: bwangpj <70694994+bwangpj@users.noreply.github.com>
…35644) This lets `measurability` solve goals like `MeasurableSet {x | f x ∈ s}`.
…y#35704) Currently, this shows up [in the docs](https://leanprover-community.github.io/mathlib4_docs/Mathlib/RingTheory/Kaehler/Basic.html#KaehlerDifferential.kerTotal) as: > The `S`-submodule of `S →₀ S` (the direct sum of copies of `S` indexed by `S`) generated by the relations: > 1. `dx + dy = d(x + y)` > 2. `x dy + y dx = d(x * y)` > 3. `dr = 0` for `r ∈ R` where `db` is the unit in the copy of `S` with index `b`. > > This is the kernel of the surjection `Finsupp.linearCombination S Ω[S⁄R] S (KaehlerDifferential.D R S)`. See `KaehlerDifferential.kerTotal_eq` and `KaehlerDifferential.linearCombination_surjective`.
…ommunity#34643) Given a model category `C`, we show that a few localizer morphisms are localized weak equivalences, which can be understood by saying that we obtain the same localized category (up to equivalence) by inverting weak equivalences in `C`, `CofibrantObject C`, `FibrantObject C` or `BifibrantObject C`.
…over-community#35898) and attribute `IsStarProjection.{isIdempotentElem, isSelfAdjoint}` with `aesop` and `grind`.
|
Thanks for this and also for splitting out #37060 which hopefully we can merge soon. Part of the reason we've been slow with review here is that there is a plan to deprecate PMF and instead just work with sums of Dirac masses. For example there are two open PRs in this direction #36374 and #36378 which are likely to be merged soon. I have asked for some measure theory experts to weigh up the pros and cons one last time and I hope to return here (or let them do so) with concrete proposals for how to resolve the proposal here soon. |
|
Thanks for the update! I welcome if
|
|
WIP + |
|
+WIP (assuming this is what was intended here) |
|
Thanks again for this work. I can't quite tell from these words what you're planning but I'll happily take a close look once you're ready for review again. Note that #37060 has been delegated so it may help to resolve that first. |
|
Yes, thanks for taking care! (I am on vacation, back at the computer next week.) There was a disussion in the geometric distribution PR, 36768. @EtienneC30 concluded "We could treat MassFunction like ProbabilityMeasure type where it should only be used when one wants to use the structure on the type (the topology in the case of ProbabilityMeasure or the monad and do notation in the case of MF) but should otherwise just use measure and the rest of the measure theory API." which found some agreement. My idea is to change the current PR in this direction. |
Define
MassFunction α := α → ℝ≥0∞Define
toMeasure (w : MassFunction α) : @Measure α ⊤as a sum of diracsShow properties of the resulting objects
This PR intends to start a more userfriendly interaction with probability mass functions (
PMF). There are two main differences betweenMassFunctionandPMF:PMFhast the additional propertyHasSum 1, making the resulting measure a probability measure. (ForMassFunction, I intend to use the typeclassIsProbabilityMeasurein a later PR instead.)toMeasurefunction ofMassFunctiondirectly defines the measure as a sum of diracs, which immediately makes computations possible.Discussion thread on zulip
Set.indicatoron a disjoint union equals the sum of individualSet.indicator#37060