Lebesgue densities, Gaussian PDFs, and weak convergence
DefinitionDKFAsymptotics_DensitiesStates are real vectors of finite dimension and covariances are real square matrices. The multivariate Gaussian density is the standard determinant-and-quadratic-form expression. Probability density validity requires almost-everywhere nonnegativity, integrability and integral one. A Gaussian PDF additionally has an almost-everywhere representation with a positive-definite covariance. The density measure is obtained from Lebesgue measure by its nonnegative density. The norm and distance are extended nonnegative integrals. Weak convergence is expressed by convergence of integrals of every bounded continuous real function over these density measures. The definitions themselves are total; their probability and Gaussian interpretations use the explicit validity predicates in the theorem hypotheses.
import Mathlib.Analysis.Matrix.PosDef
import Mathlib.LinearAlgebra.Matrix.NonsingularInverse
import Mathlib.MeasureTheory.Measure.ProbabilityMeasure
import Mathlib.MeasureTheory.Measure.WithDensity
import Mathlib.MeasureTheory.Function.LpSeminorm.Basic
import Mathlib.MeasureTheory.Integral.Bochner.Basic
import Mathlib.MeasureTheory.Constructions.Pi
import Mathlib.Analysis.SpecialFunctions.Gaussian.GaussianIntegral
import Mathlib.Data.PNat.Basic
noncomputable section
open MeasureTheory Filter Matrix
open scoped Topology ENNReal
namespace DKFAsymptotics
abbrev State (d : ℕ) := Fin d → ℝ
abbrev Covariance (d : ℕ) := Matrix (Fin d) (Fin d) ℝ
abbrev Density (d : ℕ) := State d → ℝ
variable {d : ℕ}
def gaussianPDF (m : State d) (C : Covariance d) (z : State d) : ℝ :=
(Real.sqrt ((2 * Real.pi) ^ d * C.det))⁻¹ *
Real.exp (-((z - m) ⬝ᵥ (C⁻¹ *ᵥ (z - m))) / 2)
def IsPDF (f : Density d) : Prop :=
(∀ᵐ z ∂volume, 0 ≤ f z) ∧ Integrable f volume ∧ (∫ z, f z ∂volume) = 1
def IsGaussianPDF (f : Density d) : Prop :=
IsPDF f ∧ ∃ (m : State d) (C : Covariance d), C.PosDef ∧
f =ᵐ[volume] gaussianPDF m C
def densityMeasure (f : Density d) : Measure (State d) :=
volume.withDensity (fun z => ENNReal.ofReal (f z))
def l1Norm (f : Density d) : ℝ≥0∞ :=
∫⁻ z, ENNReal.ofReal |f z| ∂volume
def l1Distance (f g : Density d) : ℝ≥0∞ := l1Norm (f - g)
def Weakly (f : ℕ+ → Density d) (P : Measure (State d)) : Prop :=
∀ g : BoundedContinuousFunction (State d) ℝ,
Tendsto (fun n => ∫ z, g z ∂densityMeasure (f n)) atTop (𝓝 (∫ z, g z ∂P))
end DKFAsymptotics
Read-back
What the Lean code literally says, in plain math · GPT-6 (Codex independent sub-agent)
Independent mathematical read-back: density declarations
DKFAsymptotics.State
For each natural number , the state space is the set of all functions from to , identified with . No coordinates or vectors are excluded. For this is a singleton, whose sole element is the empty vector.
DKFAsymptotics.Covariance
For each natural number , the covariance type is the set of all real matrices, with row and column indices in . Membership in this type imposes no symmetry, definiteness, or invertibility condition. For it contains the unique empty matrix, whose determinant is .
DKFAsymptotics.Density
For each natural number , a density is any function , where means the space of real vectors indexed by . There is no requirement of measurability, nonnegativity, integrability, or normalization. For , such a function is specified by a single real value on the empty vector.
DKFAsymptotics.gaussianPDF
For each natural number , every vector , every real matrix , and every , this definition assigns the real number . Matrix inversion is the usual inverse when is invertible and is the zero matrix when is singular; the real square root of a nonpositive number is , and the reciprocal of is . No symmetry or positive definiteness of is assumed. In particular, when , the defined function of is identically . For , the determinant and zeroth power in the prefactor are both , both sums are empty, and the function takes the value at the unique state. The declaration itself imposes no condition that this function integrate to .
DKFAsymptotics.IsPDF
For each natural number and every function , this predicate holds exactly when all three conditions hold: for almost every with respect to the product of real Lebesgue measures, is Bochner integrable with respect to that measure, and . For a real-valued function, the integrability requirement includes almost-everywhere strong measurability and finiteness of the integral of its absolute value. Nonnegativity is required only almost everywhere; negative values on a null set are permitted. For , the product measure is unit mass on the empty vector, so this predicate holds exactly when the value there is .
DKFAsymptotics.IsGaussianPDF
For each natural number and every function , this predicate holds exactly when is nonnegative almost everywhere, is Bochner integrable, and has integral with respect to product Lebesgue measure, and there exist a vector and a real symmetric matrix such that for every nonzero vector and for product-Lebesgue-almost every . Here is the matrix inverse, with the total convention that it is zero for a singular matrix; real square roots of nonpositive numbers and the reciprocal of zero are also zero. The witnesses and are existentially quantified, without a uniqueness requirement. Equality with the displayed function need not hold at every point. The quantifier on is over all nonzero vectors; in dimension zero it has no instances, the empty matrix satisfies the symmetry and positivity condition, the product measure is unit point mass, and the predicate holds exactly when takes the value on the sole state.
DKFAsymptotics.densityMeasure
For each natural number and every function , this definition gives the measure on the standard measurable space of whose value on each measurable set is , with the nonnegative real integrand included in and denoting product Lebesgue measure. The symbol is the lower Lebesgue integral, defined for any nonnegative function as the supremum of the integrals of measurable simple functions lying pointwise below it. No measurability or integrability assumption on is present, and the resulting measure need not be finite or have total mass . Negative values of contribute zero. For , the result is point mass of weight on the unique empty vector .
DKFAsymptotics.l1Norm
For each natural number and every function , this definition assigns the extended nonnegative number , where is product Lebesgue measure and the absolute value is regarded as an extended nonnegative real. The lower integral is the supremum of integrals of measurable nonnegative simple functions bounded pointwise by . The definition assumes neither measurability nor integrability, so the value may be and applies even to nonmeasurable functions. For , product measure is unit mass at the empty vector and the value is .
DKFAsymptotics.l1Distance
For each natural number and every pair of functions , this definition assigns , with subtraction taken pointwise and denoting product Lebesgue measure. The lower integral is the supremum of integrals of measurable nonnegative simple functions bounded pointwise by the displayed absolute difference. No measurability, integrability, nonnegativity, or normalization of either function is required, and the value can be . The functions are actual functions, rather than equivalence classes under almost-everywhere equality; in particular, functions differing only on a null set have distance zero. For , the value is on the unique state .
DKFAsymptotics.Weakly
For each natural number , every sequence of arbitrary functions , and every measure on the standard measurable space of , this predicate says that, for every bounded continuous real-valued function on , the real numbers converge as through positive integers to . Here, for each measurable set , , where is product Lebesgue measure and the lower integral is the supremum of integrals of measurable nonnegative simple functions below the integrand. More explicitly, for each such and each real , there is a positive integer such that the absolute difference between these two real integrals is less than for every positive integer ; may depend on and . There is no index , and there are no measurability, integrability, nonnegativity, or probability-density hypotheses on the , nor any finiteness, probability, or sigma-finiteness hypothesis on . Both integrals of are total Bochner integrals: any of them is defined to be if is not integrable for its respective measure, despite being bounded and continuous. In dimension zero the state space is a singleton , and this predicate is equivalent to convergence of to the real mass when that mass is finite, and to when that mass is infinite.
Confirmed by the mission captain (proposal self-audit).