Densities from laws presented as withDensity #
Two bridges from a law given as μ.withDensity f to Mathlib's MeasureTheory.HasPDF and pdf,
together with three bridges for a law presented by a nonnegative real-valued density:
integrable_withDensity_ofReal_iff and integral_withDensity_ofReal reduce integrability and
integration under such a law to the density-weighted function against the reference measure, and
measureReal_withDensity_ofReal computes the real mass of a measurable set as the integral of the
density over it.
Several of Mathlib's continuous scalar families can be presented as withDensity measures — some
by definition, others only away from a degenerate parameter — and so can laws Tau Ceti builds on top
of them, but none is connected to HasPDF. These theorems make that connection once, so no
individual family has to repeat the hasPDF_of_map_eq_withDensity hX.aemeasurable … hX.map_eq
plumbing, and the family files do not each re-prove the same density integral and mass identities.
The file is deliberately neutral: it mentions no particular distribution, so a module defining one family can import it without acquiring the others.
Main results #
hasPDF_of_hasLaw_withDensity— a law presented asμ.withDensity fgivesHasPDF;pdf_eq_of_hasLaw_withDensity— and its density isf;integrable_withDensity_ofReal_iff— under a lawμ.withDensity (ENNReal.ofReal ∘ f), a function is integrable ifff-weighted against the reference measure it is;integral_withDensity_ofReal— and its integral is the integral of thef-weighted integrand;measureReal_withDensity_ofReal— the real mass of a measurable set on which the densityfis nonnegative and integrable is its integral over that set.
The density bridges are stated for an arbitrary codomain and codomain measure, since neither proof
uses anything about ℝ or volume, and both ask only for AEMeasurable f μ.
The shared bridge. A law presented as μ.withDensity f, with f a.e. measurable, gives
HasPDF.
The density supplied by hasPDF_of_hasLaw_withDensity is the one the law was presented with.
Needs [SigmaFinite μ] on the codomain measure — satisfied by volume — and nothing on the
source measure.
Under a law presented by a real-valued density ρ, a function is integrable iff its scalar
product with ρ is integrable against the reference measure. The density need only be nonnegative
a.e.; the ℝ≥0∞-valued density used in the presentation is its ENNReal.ofReal lift.
Under a law presented by a real-valued density ρ, integration is integration of the
ρ-weighted integrand against the reference measure. This is the integral counterpart of
TauCeti.Probability.integrable_withDensity_ofReal_iff, and it needs no integrability
hypothesis: when the integrand is not integrable both sides are 0.
It specializes Mathlib's integral_withDensity_eq_integral_toReal_smul₀ to densities of the form
ENNReal.ofReal ∘ ρ, where the toReal of the density reduces to ρ itself.
Integrating a density that is nonnegative and integrable on s computes the real mass of s
under the law presented by that density. The nonnegativity hypothesis is only local to s.