Stat.Minimax.Moment­Matched­Mixture

This umbrella module exports a model-agnostic path from exponential likelihood inner products and matched bounded-prior moments, through one-coordinate and finite-product total variation, to explicit squared-error lower

Finite­Signed­Moment­Marked­Poisson­Mixture 9 to review 31 core · 39 supporting · 5 submodules Finite signed moment marked-Poisson mixtures: normalized atomic signed moment certificates, Jordan and zero-inflated priors, aggregate and label-gated Poisson experiments, and geometric total-variation bounds for finite iid products.
Exponential­Energy 4 core · 2 supporting 1 to review This module isolates the scalar analytic core of moment matching. ★ exponentialPriorEnergy_quadratic_le_tail

Exponential energies of bounded priors

This module isolates the scalar analytic core of moment matching. It expands the exponential-kernel energy of two bounded probability priors into their moments and bounds the quadratic energy left after matching finitely many moments.

def exponentialSeriesTail reviewed
Causalean.Stat.Minimax.MomentMatchedMixture

Given a matched degree and a real series argument, the exponential-series tail is the sum of the exponential-series terms whose degree is strictly larger than the matched degree.

Definition (Lean source)
degree :
z :
exponentialSeriesTail degree z :
∑' n : ℕ, if degree < n then z ^ n / (n.factorial : ℝ) else 0
Causalean.Stat.Minimax.MomentMatchedMixture.exponentialSeriesTail · Causalean/Stat/Minimax/MomentMatchedMixture/ExponentialEnergy.lean:18
def priorMoment unreviewed
Causalean.Stat.Minimax.MomentMatchedMixture

Given a real-valued prior and a nonnegative integer order, its raw moment of that order is the prior average of the corresponding power, taken as a Bochner integral, which is zero when the power is not integrable. It coincides with Causalean.Stat.MomentProblems.rawMoment.

Definition (Lean source)
π :
n :
priorMoment π n :
∫ θ, θ ^ n ∂π
Causalean.Stat.Minimax.MomentMatchedMixture.priorMoment · Causalean/Stat/Minimax/MomentMatchedMixture/ExponentialEnergy.lean:24
def exponentialPriorEnergy reviewed
Causalean.Stat.Minimax.MomentMatchedMixture

Given two real-valued priors and an interaction scale, their exponential prior energy averages the exponential of the scaled product over independent draws from the priors, as a nested Bochner integral: an inner or outer integrand that is not integrable contributes zero, so this is the exponential prior energy only when those integrals exist (for example for compactly supported probability priors).

Definition (Lean source)
π ρ :
lambda :
exponentialPriorEnergy π ρ lambda :
∫ θ, ∫ θ', exp (lambda * θ * θ') ∂ρ ∂π
Causalean.Stat.Minimax.MomentMatchedMixture.exponentialPriorEnergy · Causalean/Stat/Minimax/MomentMatchedMixture/ExponentialEnergy.lean:31
theorem exponentialPriorEnergy_quadratic_le_tail reviewed
Causalean.Stat.Minimax.MomentMatchedMixture

Given two probability priors, a nonnegative interaction scale, a nonnegative common support radius, and a matching degree, if both priors are supported within that radius and their moments agree through the matching degree, then their alternating exponential energy is at most four times the unmatched exponential-series tail.

Formal statement
lambda a :
degree :
hlambda :
0 ≤ lambda
ha :
0 ≤ a
hsupp0 :
π0 {θ | |θ| ≤ a} = 1
hsupp1 :
π1 {θ | |θ| ≤ a} = 1
hmom :
∀ n ≤ degree, priorMoment π0 n = priorMoment π1 n
exponentialPriorEnergy π0 π0 lambda
- exponentialPriorEnergy π0 π1 lambda
- exponentialPriorEnergy π1 π0 lambda
+ exponentialPriorEnergy π1 π1 lambda
≤ 4 * exponentialSeriesTail degree (lambda * a ^ 2)
Proof (Lean source)
theorem exponentialPriorEnergy_quadratic_le_tail (π0 π1 : Measure ℝ) [IsProbabilityMeasure π0] [IsProbabilityMeasure π1] (lambda a : ℝ) (degree : ℕ) (hlambda : 0 ≤ lambda) (ha : 0 ≤ a) (hsupp0 : π0 {θ | |θ| ≤ a} = 1) (hsupp1 : π1 {θ | |θ| ≤ a} = 1) (hmom : ∀ n ≤ degree, priorMoment π0 n = priorMoment π1 n) : exponentialPriorEnergy π0 π0 lambda - exponentialPriorEnergy π0 π1 lambda - exponentialPriorEnergy π1 π0 lambda + exponentialPriorEnergy π1 π1 lambda ≤ 4 * exponentialSeriesTail degree (lambda * a ^ 2) := by rw [exponentialPriorEnergy_quadratic_eq_tsum π0 π1 lambda a hlambda ha hsupp0 hsupp1, exponentialSeriesTail] have h00 := summable_priorMoment_product π0 π0 lambda a hlambda ha hsupp0 hsupp0 have h01 := summable_priorMoment_product π0 π1 lambda a hlambda ha hsupp0 hsupp1 have h10 := summable_priorMoment_product π1 π0 lambda a hlambda ha hsupp1 hsupp0 have h11 := summable_priorMoment_product π1 π1 lambda a hlambda ha hsupp1 hsupp1 have hseries : Summable fun n : ℕ ↦ lambda ^ n / (n.factorial : ℝ) * (priorMoment π0 n - priorMoment π1 n) ^ 2 := by apply (((h00.sub h01).sub h10).add h11).congr intro n ring have htail : Summable fun n : ℕ ↦ if degree < n then (lambda * a ^ 2) ^ n / (n.factorial : ℝ) else 0 := by apply Summable.of_nonneg_of_le (fun n ↦ by by_cases hn : degree < n · simp only [if_pos hn] positivity · simp only [if_neg hn] positivity) (fun n ↦ by by_cases hn : degree < n · simp only [if_pos hn] exact le_rfl · simp only [if_neg hn] positivity) (Real.summable_pow_div_factorial (lambda * a ^ 2)) have hbound (n : ℕ) : lambda ^ n / (n.factorial : ℝ) * (priorMoment π0 n - priorMoment π1 n) ^ 2 ≤ 4 * (if degree < n then (lambda * a ^ 2) ^ n / (n.factorial : ℝ) else 0) := by by_cases hn : degree < n · rw [if_pos hn] have h0 := abs_priorMoment_le_pow_of_supported π0 a n ha hsupp0 have h1 := abs_priorMoment_le_pow_of_supported π1 a n ha hsupp1 have hdiff : |priorMoment π0 n - priorMoment π1 n| ≤ 2 * a ^ n := by calc |priorMoment π0 n - priorMoment π1 n| ≤ |priorMoment π0 n| + |priorMoment π1 n| := abs_sub _ _ _ ≤ a ^ n + a ^ n := add_le_add h0 h1 _ = 2 * a ^ n := by ring have hsq : (priorMoment π0 n - priorMoment π1 n) ^ 2 ≤ (2 * a ^ n) ^ 2 := (sq_le_sq).2 (by rw [abs_of_nonneg (mul_nonneg (by norm_num) (pow_nonneg ha n))] exact hdiff) calc lambda ^ n / (n.factorial : ℝ) * (priorMoment π0 n - priorMoment π1 n) ^ 2 ≤ lambda ^ n / (n.factorial : ℝ) * (2 * a ^ n) ^ 2 := by exact mul_le_mul_of_nonneg_left hsq (by positivity) _ = 4 * ((lambda * a ^ 2) ^ n / (n.factorial : ℝ)) := by ring · have hndeg : n ≤ degree := by omega simp [hn, hmom n hndeg] have hscaled := htail.mul_left 4 have hle := hseries.tsum_le_tsum hbound hscaled simpa only [tsum_mul_left] using hle
Causalean.Stat.Minimax.MomentMatchedMixture.exponentialPriorEnergy_quadratic_le_tail · Causalean/Stat/Minimax/MomentMatchedMixture/ExponentialEnergy.lean:190 · uses exponentialPriorEnergy , exponentialSeriesTail , priorMoment
2 supporting declarations (lemmas, instances)
  • abs_priorMoment_le_pow_of_supported theorem — The absolute raw moment of order n of a probability prior is at most the support radius raised to that order when the radius is nonnegative and the prior is supported within that radius.
    a :
    n :
    ha :
    0 ≤ a
    hsupp :
    π {θ | |θ| ≤ a} = 1
    |priorMoment π n| ≤ a ^ n
    Proof (Lean source)
    theorem abs_priorMoment_le_pow_of_supported (π : Measure ℝ) [IsProbabilityMeasure π] (a : ℝ) (n : ℕ) (ha : 0 ≤ a) (hsupp : π {θ | |θ| ≤ a} = 1) : |priorMoment π n| ≤ a ^ n := by have hset : MeasurableSet {θ : ℝ | |θ| ≤ a} := measurableSet_le continuous_abs.measurable measurable_const have hmem : ∀ᵐ θ ∂π, |θ| ≤ a := by change {θ : ℝ | |θ| ≤ a} ∈ ae π rw [mem_ae_iff, measure_compl hset (measure_ne_top π _), measure_univ, hsupp, tsub_self] have hbound : ∀ᵐ θ ∂π, ‖θ ^ n‖ ≤ a ^ n := hmem.mono fun θ hθ ↦ by rw [norm_pow, Real.norm_eq_abs] exact pow_le_pow_left₀ (abs_nonneg θ) hθ n simpa [priorMoment, Real.norm_eq_abs] using (norm_integral_le_of_norm_le_const hbound)
    Causalean.Stat.Minimax.MomentMatchedMixture.abs_priorMoment_le_pow_of_supported · Causalean/Stat/Minimax/MomentMatchedMixture/ExponentialEnergy.lean:126
  • exponentialPriorEnergy_quadratic_eq_tsum theorem — Given two probability priors, a nonnegative interaction scale, and a nonnegative common support radius, if both priors are supported within that radius, then the alternating sum of their four exponential energies equals the convergent exponential series of squared moment differences.
    lambda a :
    hlambda :
    0 ≤ lambda
    ha :
    0 ≤ a
    hsupp0 :
    π0 {θ | |θ| ≤ a} = 1
    hsupp1 :
    π1 {θ | |θ| ≤ a} = 1
    exponentialPriorEnergy π0 π0 lambda
    - exponentialPriorEnergy π0 π1 lambda
    - exponentialPriorEnergy π1 π0 lambda
    + exponentialPriorEnergy π1 π1 lambda
    = ∑' n : ℕ, lambda ^ n / (n.factorial : ℝ) * (priorMoment π0 n - priorMoment π1 n) ^ 2
    Proof (Lean source)
    theorem exponentialPriorEnergy_quadratic_eq_tsum (π0 π1 : Measure ℝ) [IsProbabilityMeasure π0] [IsProbabilityMeasure π1] (lambda a : ℝ) (hlambda : 0 ≤ lambda) (ha : 0 ≤ a) (hsupp0 : π0 {θ | |θ| ≤ a} = 1) (hsupp1 : π1 {θ | |θ| ≤ a} = 1) : exponentialPriorEnergy π0 π0 lambda - exponentialPriorEnergy π0 π1 lambda - exponentialPriorEnergy π1 π0 lambda + exponentialPriorEnergy π1 π1 lambda = ∑' n : ℕ, lambda ^ n / (n.factorial : ℝ) * (priorMoment π0 n - priorMoment π1 n) ^ 2 := by rw [exponentialPriorEnergy_eq_tsum π0 π0 lambda a hlambda ha hsupp0 hsupp0, exponentialPriorEnergy_eq_tsum π0 π1 lambda a hlambda ha hsupp0 hsupp1, exponentialPriorEnergy_eq_tsum π1 π0 lambda a hlambda ha hsupp1 hsupp0, exponentialPriorEnergy_eq_tsum π1 π1 lambda a hlambda ha hsupp1 hsupp1] have h00 := summable_priorMoment_product π0 π0 lambda a hlambda ha hsupp0 hsupp0 have h01 := summable_priorMoment_product π0 π1 lambda a hlambda ha hsupp0 hsupp1 have h10 := summable_priorMoment_product π1 π0 lambda a hlambda ha hsupp1 hsupp0 have h11 := summable_priorMoment_product π1 π1 lambda a hlambda ha hsupp1 hsupp1 have hsum := ((h00.hasSum.sub h01.hasSum).sub h10.hasSum).add h11.hasSum rw [← hsum.tsum_eq] apply tsum_congr intro n ring
    Causalean.Stat.Minimax.MomentMatchedMixture.exponentialPriorEnergy_quadratic_eq_tsum · Causalean/Stat/Minimax/MomentMatchedMixture/ExponentialEnergy.lean:164
Analytic 2 core · 5 supporting This module turns an exponential likelihood inner-product identity and agreement of bounded prior moments into an explicit total-variation bound for the corresponding predictive mixtures. ★ momentMatchedMixture_tv_le_sqrt_tail

Moment matching and likelihood inner products

This module turns an exponential likelihood inner-product identity and agreement of bounded prior moments into an explicit total-variation bound for the corresponding predictive mixtures.

def mixtureLikelihood reviewed
Causalean.Stat.Minimax.MomentMatchedMixture

Given a real-valued prior, a parameter-indexed likelihood family, and an observation, the mixture likelihood is the prior average of the component likelihoods at that observation, taken as a Bochner integral: it is zero when the likelihood is not integrable against the prior, so it is the mixture likelihood for a probability prior and an integrable likelihood.

Definition (Lean source)
X :
Type u_1
shared
π :
likelihood :
ℝ → X → ℝ
x :
X
mixtureLikelihood π likelihood x :
∫ θ, likelihood θ x ∂π
Causalean.Stat.Minimax.MomentMatchedMixture.mixtureLikelihood · Causalean/Stat/Minimax/MomentMatchedMixture/Analytic.lean:20
theorem momentMatchedMixture_tv_le_sqrt_tail reviewed
Causalean.Stat.Minimax.MomentMatchedMixture

Given two probability priors, a probability experiment kernel, a probability dominating law, a jointly measurable nonnegative likelihood family, a nonnegative interaction scale, a nonnegative support radius, and a matching degree, if each experiment law has the stated density, likelihood inner products have the exponential product form, both priors are supported within the radius, and their moments agree through that degree, then the two one-coordinate prior-predictive mixtures are within the square root of the explicit unmatched series tail in total variation.

Formal statement
X :
Type u_1
shared
π0 π1 :
K :
Kernel ℝ X
Q :
likelihood :
ℝ → X → ℝ
hK :
∀ θ, IsProbabilityMeasure (K θ)
lambda a :
degree :
hlambda :
0 ≤ lambda
ha :
0 ≤ a
hmeas :
Measurable fun p : ℝ × X => likelihood p.1 p.2
hnonneg :
∀ θ x, 0 ≤ likelihood θ x
hdensity :
∀ θ, K θ = Q.withDensity fun x => ofReal (likelihood θ x)
hinner :
∀ θ θ', ∫ x, likelihood θ x * likelihood θ' x ∂Q = exp (lambda * θ * θ')
hsupp0 :
π0 {θ | |θ| ≤ a} = 1
hsupp1 :
π1 {θ | |θ| ≤ a} = 1
hmom :
∀ n ≤ degree, ∫ θ, θ ^ n ∂π0 = ∫ θ, θ ^ n ∂π1
sqrt (exponentialSeriesTail degree (lambda * a ^ 2))
Proof (Lean source)
theorem momentMatchedMixture_tv_le_sqrt_tail (π0 π1 : Measure ℝ) (K : Kernel ℝ X) (Q : Measure X) (likelihood : ℝ → X → ℝ) [IsProbabilityMeasure π0] [IsProbabilityMeasure π1] [IsProbabilityMeasure Q] (hK : ∀ θ, IsProbabilityMeasure (K θ)) (lambda a : ℝ) (degree : ℕ) (hlambda : 0 ≤ lambda) (ha : 0 ≤ a) (hmeas : Measurable fun p : ℝ × X => likelihood p.1 p.2) (hnonneg : ∀ θ x, 0 ≤ likelihood θ x) (hdensity : ∀ θ, K θ = Q.withDensity fun x => ofReal (likelihood θ x)) (hinner : ∀ θ θ', ∫ x, likelihood θ x * likelihood θ' x ∂Q = exp (lambda * θ * θ')) (hsupp0 : π0 {θ | |θ| ≤ a} = 1) (hsupp1 : π1 {θ | |θ| ≤ a} = 1) (hmom : ∀ n ≤ degree, ∫ θ, θ ^ n ∂π0 = ∫ θ, θ ^ n ∂π1) : tvDist (priorPredictive π0 K) (priorPredictive π1 K) ≤ sqrt (exponentialSeriesTail degree (lambda * a ^ 2)) := by -- Rewrite both predictive measures with `priorPredictive_eq_withDensity_mixtureLikelihood`. -- Establish integrability of the squared density difference using the same four -- nonnegative cross terms as the energy identity (or an integrable pointwise upper -- bound by the sum of the two squared mixture likelihoods). Then combine -- `tvDist_le_half_sqrt_integral_sq_density_sub` with -- `integral_sq_mixtureLikelihood_sub_le_tail`; monotonicity of `sqrt` and -- `sqrt (4 * t) = 2 * sqrt t` finish, using nonnegativity of the series tail. have hpred (π : Measure ℝ) [IsProbabilityMeasure π] : priorPredictive π K = Q.withDensity fun x => ofReal (mixtureLikelihood π likelihood x) := by have hfiber (θ : ℝ) : ∫⁻ x, ofReal (likelihood θ x) ∂Q = 1 := by calc ∫⁻ x, ofReal (likelihood θ x) ∂Q = (Q.withDensity fun x => ofReal (likelihood θ x)) univ := by rw [withDensity_apply _ MeasurableSet.univ, Measure.restrict_univ] _ = K θ univ := by rw [hdensity θ] _ = 1 := isProbabilityMeasure_iff.mp (hK θ) have hjoint : Integrable (fun p : ℝ × X => likelihood p.1 p.2) (π.prod Q) := by refine ⟨hmeas.aestronglyMeasurable, ?_⟩ apply (hasFiniteIntegral_iff_ofReal (ae_of_all _ fun p : ℝ × X => hnonneg p.1 p.2)).2 rw [lintegral_prod _ hmeas.ennreal_ofReal.aemeasurable] simp_rw [hfiber] simp have hsections : ∀ᵐ x ∂Q, Integrable (fun θ => likelihood θ x) π := hjoint.prod_left_ae have haverage : ∀ᵐ x ∂Q, ofReal (mixtureLikelihood π likelihood x) = ∫⁻ θ, ofReal (likelihood θ x) ∂π := by filter_upwards [hsections] with x hx exact ofReal_integral_eq_lintegral_ofReal hx (ae_of_all _ fun θ => hnonneg θ x) refine Measure.ext fun A hA => ?_ rw [priorPredictive_apply π K hA, withDensity_apply _ hA] simp_rw [hdensity, withDensity_apply _ hA] calc ∫⁻ θ, ∫⁻ x in A, ofReal (likelihood θ x) ∂Q ∂π = ∫⁻ x in A, ∫⁻ θ, ofReal (likelihood θ x) ∂π ∂Q := by apply lintegral_lintegral_swap exact hmeas.ennreal_ofReal.aemeasurable _ = ∫⁻ x in A, ofReal (mixtureLikelihood π likelihood x) ∂Q := by apply lintegral_congr_ae filter_upwards [ae_restrict_of_ae haverage] with x hx exact hx.symm have hmix_meas (π : Measure ℝ) [IsProbabilityMeasure π] : Measurable (mixtureLikelihood π likelihood) := by exact hmeas.stronglyMeasurable.integral_prod_left'.measurable have hmix_nonneg (π : Measure ℝ) (x : X) : 0 ≤ mixtureLikelihood π likelihood x := integral_nonneg fun θ => hnonneg θ x have hset : MeasurableSet {θ : ℝ | |θ| ≤ a} := measurableSet_le continuous_abs.measurable measurable_const have hsupp_ae (π : Measure ℝ) [IsProbabilityMeasure π] (hsupp : π {θ | |θ| ≤ a} = 1) : ∀ᵐ θ ∂π, |θ| ≤ a := by change {θ : ℝ | |θ| ≤ a} ∈ ae π rw [mem_ae_iff, measure_compl hset (measure_ne_top π _), measure_univ, hsupp, tsub_self] have hprod_int (θ θ' : ℝ) : Integrable (fun x => likelihood θ x * likelihood θ' x) Q := by by_contra h have heq := hinner θ θ' rw [integral_undef h] at heq exact Real.exp_ne_zero _ heq.symm have hmix_sq_int (π : Measure ℝ) [IsProbabilityMeasure π] (hsupp : π {θ | |θ| ≤ a} = 1) : Integrable (fun x => mixtureLikelihood π likelihood x * mixtureLikelihood π likelihood x) Q := by let g : (ℝ × ℝ) × X → ℝ := fun z => likelihood z.1.1 z.2 * likelihood z.1.2 z.2 have hgmeas : Measurable g := by unfold g fun_prop have hpairs : ∀ᵐ z ∂π.prod π, |z.1| ≤ a ∧ |z.2| ≤ a := by apply (Measure.ae_prod_iff_ae_ae ((measurableSet_le (continuous_abs.measurable.comp measurable_fst) measurable_const).inter (measurableSet_le (continuous_abs.measurable.comp measurable_snd) measurable_const))).2 filter_upwards [hsupp_ae π hsupp] with θ hθ filter_upwards [hsupp_ae π hsupp] with θ' hθ' exact ⟨hθ, hθ'⟩ have hexp_int : Integrable (fun z : ℝ × ℝ => exp (lambda * z.1 * z.2)) (π.prod π) := by apply (integrable_const (μ := π.prod π) (exp (lambda * a ^ 2))).mono' (by fun_prop) filter_upwards [hpairs] with z hz rcases hz with ⟨hz1, hz2⟩ rw [Real.norm_eq_abs, abs_of_pos (Real.exp_pos _)] apply Real.exp_le_exp.mpr calc lambda * z.1 * z.2 ≤ |lambda * z.1 * z.2| := le_abs_self _ _ = lambda * |z.1| * |z.2| := by rw [abs_mul, abs_mul, abs_of_nonneg hlambda] _ ≤ lambda * a * a := by gcongr _ = lambda * a ^ 2 := by ring have hg_int : Integrable g ((π.prod π).prod Q) := by rw [integrable_prod_iff hgmeas.aestronglyMeasurable] constructor · filter_upwards with z simpa [g] using hprod_int z.1 z.2 · convert hexp_int using 1 funext z calc ∫ x, ‖g (z, x)‖ ∂Q = ∫ x, likelihood z.1 x * likelihood z.2 x ∂Q := by apply integral_congr_ae filter_upwards with x simp only [g, Real.norm_eq_abs, abs_of_nonneg (mul_nonneg (hnonneg _ _) (hnonneg _ _))] _ = exp (lambda * z.1 * z.2) := hinner z.1 z.2 apply hg_int.integral_prod_right.congr filter_upwards with x change (∫ z : ℝ × ℝ, likelihood z.1 x * likelihood z.2 x ∂π.prod π) = _ exact integral_prod_mul (fun θ => likelihood θ x) (fun θ => likelihood θ x) have hsq0 := hmix_sq_int π0 hsupp0 have hsq1 := hmix_sq_int π1 hsupp1 have hmajorant : Integrable (fun x => 2 * (mixtureLikelihood π0 likelihood x * mixtureLikelihood π0 likelihood x + mixtureLikelihood π1 likelihood x * mixtureLikelihood π1 likelihood x)) Q := (hsq0.add hsq1).const_mul 2 have hdiff_sq : Integrable (fun x => (mixtureLikelihood π0 likelihood x - mixtureLikelihood π1 likelihood x) ^ 2) Q := by apply hmajorant.mono' ((hmix_meas π0).sub (hmix_meas π1) |>.pow_const 2).aestronglyMeasurable filter_upwards with x rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)] simp only [Pi.sub_apply] nlinarith [sq_nonneg (mixtureLikelihood π0 likelihood x + mixtureLikelihood π1 likelihood x)] let t := exponentialSeriesTail degree (lambda * a ^ 2) have ht : 0 ≤ t := by unfold t exponentialSeriesTail apply tsum_nonneg intro n by_cases hn : degree < n · simp only [if_pos hn] positivity · simp only [if_neg hn] exact le_rfl letI : IsProbabilityMeasure (priorPredictive π0 K) := priorPredictive_isProbability π0 K hK letI : IsProbabilityMeasure (priorPredictive π1 K) := priorPredictive_isProbability π1 K hK have htv := tvDist_le_half_sqrt_integral_sq_density_sub (priorPredictive π0 K) (priorPredictive π1 K) Q (mixtureLikelihood π0 likelihood) (mixtureLikelihood π1 likelihood) (hmix_meas π0) (hmix_meas π1) (hmix_nonneg π0) (hmix_nonneg π1) (hpred π0) (hpred π1) hdiff_sq have htail := integral_sq_mixtureLikelihood_sub_le_tail π0 π1 Q likelihood lambda a degree hlambda ha hmeas hnonneg hinner hsupp0 hsupp1 hmom change _ ≤ sqrt t calc tvDist (priorPredictive π0 K) (priorPredictive π1 K) ≤ (1 / 2 : ℝ) * sqrt (∫ x, (mixtureLikelihood π0 likelihood x - mixtureLikelihood π1 likelihood x) ^ 2 ∂Q) := htv _ ≤ (1 / 2 : ℝ) * sqrt (4 * t) := by gcongr _ = sqrt t := by rw [Real.sqrt_mul (by norm_num : (0 : ℝ) ≤ 4)] rw [show sqrt 4 = 2 by rw [show (4 : ℝ) = 2 ^ 2 by norm_num, Real.sqrt_sq (by norm_num)]] ring
Causalean.Stat.Minimax.MomentMatchedMixture.momentMatchedMixture_tv_le_sqrt_tail · Causalean/Stat/Minimax/MomentMatchedMixture/Analytic.lean:368 · uses exponentialSeriesTail , priorPredictive , tvDist
5 supporting declarations (lemmas, instances)
  • priorPredictive_eq_withDensity_mixtureLikelihood theorem — Given a probability prior, an experiment kernel, a σ-finite dominating measure, and a jointly measurable nonnegative likelihood family, if every experiment law is a probability law and has the stated density against the dominating measure, then the prior-predictive law has density equal to the prior average of the component likelihoods.
    X :
    Type u_1
    shared
    π :
    K :
    Kernel ℝ X
    Q :
    likelihood :
    ℝ → X → ℝ
    hK :
    ∀ θ, IsProbabilityMeasure (K θ)
    hmeas :
    Measurable fun p : ℝ × X => likelihood p.1 p.2
    hnonneg :
    ∀ θ x, 0 ≤ likelihood θ x
    hdensity :
    ∀ θ, K θ = Q.withDensity fun x => ofReal (likelihood θ x)
    = Q.withDensity fun x => ofReal (mixtureLikelihood π likelihood x)
    Proof (Lean source)
    theorem priorPredictive_eq_withDensity_mixtureLikelihood (π : Measure ℝ) (K : Kernel ℝ X) (Q : Measure X) (likelihood : ℝ → X → ℝ) [IsProbabilityMeasure π] [SigmaFinite Q] (hK : ∀ θ, IsProbabilityMeasure (K θ)) (hmeas : Measurable fun p : ℝ × X => likelihood p.1 p.2) (hnonneg : ∀ θ x, 0 ≤ likelihood θ x) (hdensity : ∀ θ, K θ = Q.withDensity fun x => ofReal (likelihood θ x)) : priorPredictive π K = Q.withDensity fun x => ofReal (mixtureLikelihood π likelihood x) := by -- Sigma-finiteness of the dominator is essential for swapping the two lower -- integrals. Without it the claim is false: for counting measure on an -- uncountable Borel space, Dirac fibres have singleton-indicator likelihoods, -- whose pointwise prior averages vanish under a nonatomic prior even though the -- predictive measure is that prior. Here the probability-fibre hypothesis makes -- the nonnegative joint likelihood integrable under `π.prod Q`, so the Bochner -- prior average agrees a.e. with its Tonelli lower-integral version. have hfiber (θ : ℝ) : ∫⁻ x, ofReal (likelihood θ x) ∂Q = 1 := by calc ∫⁻ x, ofReal (likelihood θ x) ∂Q = (Q.withDensity fun x => ofReal (likelihood θ x)) univ := by rw [withDensity_apply _ MeasurableSet.univ, Measure.restrict_univ] _ = K θ univ := by rw [hdensity θ] _ = 1 := isProbabilityMeasure_iff.mp (hK θ) have hjoint : Integrable (fun p : ℝ × X => likelihood p.1 p.2) (π.prod Q) := by refine ⟨hmeas.aestronglyMeasurable, ?_⟩ apply (hasFiniteIntegral_iff_ofReal (ae_of_all _ fun p : ℝ × X => hnonneg p.1 p.2)).2 rw [lintegral_prod _ hmeas.ennreal_ofReal.aemeasurable] simp_rw [hfiber] simp have hsections : ∀ᵐ x ∂Q, Integrable (fun θ => likelihood θ x) π := hjoint.prod_left_ae have haverage : ∀ᵐ x ∂Q, ofReal (mixtureLikelihood π likelihood x) = ∫⁻ θ, ofReal (likelihood θ x) ∂π := by filter_upwards [hsections] with x hx exact ofReal_integral_eq_lintegral_ofReal hx (ae_of_all _ fun θ => hnonneg θ x) refine Measure.ext fun A hA => ?_ rw [priorPredictive_apply π K hA, withDensity_apply _ hA] simp_rw [hdensity, withDensity_apply _ hA] calc ∫⁻ θ, ∫⁻ x in A, ofReal (likelihood θ x) ∂Q ∂π = ∫⁻ x in A, ∫⁻ θ, ofReal (likelihood θ x) ∂π ∂Q := by apply lintegral_lintegral_swap exact hmeas.ennreal_ofReal.aemeasurable _ = ∫⁻ x in A, ofReal (mixtureLikelihood π likelihood x) ∂Q := by apply lintegral_congr_ae filter_upwards [ae_restrict_of_ae haverage] with x hx exact hx.symm
    Causalean.Stat.Minimax.MomentMatchedMixture.priorPredictive_eq_withDensity_mixtureLikelihood · Causalean/Stat/Minimax/MomentMatchedMixture/Analytic.lean:28
  • integral_sq_mixtureLikelihood_sub_eq_exponentialPriorEnergy theorem — Given two probability priors, a probability dominating measure, a jointly measurable nonnegative likelihood family, a nonnegative interaction scale, and a nonnegative support radius, if likelihood inner products have the exponential product form and both priors are supported within the radius, then the squared distance between their mixture likelihoods equals the alternating sum of the four exponential prior energies.
    X :
    Type u_1
    shared
    π0 π1 :
    Q :
    likelihood :
    ℝ → X → ℝ
    lambda a :
    hlambda :
    0 ≤ lambda
    ha :
    0 ≤ a
    hmeas :
    Measurable fun p : ℝ × X => likelihood p.1 p.2
    hnonneg :
    ∀ θ x, 0 ≤ likelihood θ x
    hinner :
    ∀ θ θ', ∫ x, likelihood θ x * likelihood θ' x ∂Q = exp (lambda * θ * θ')
    hsupp0 :
    π0 {θ | |θ| ≤ a} = 1
    hsupp1 :
    π1 {θ | |θ| ≤ a} = 1
    ∫ x, (mixtureLikelihood π0 likelihood x - mixtureLikelihood π1 likelihood x) ^ 2 ∂Q
    = exponentialPriorEnergy π0 π0 lambda
    - exponentialPriorEnergy π0 π1 lambda
    - exponentialPriorEnergy π1 π0 lambda
    + exponentialPriorEnergy π1 π1 lambda
    Proof (Lean source)
    theorem integral_sq_mixtureLikelihood_sub_eq_exponentialPriorEnergy (π0 π1 : Measure ℝ) (Q : Measure X) (likelihood : ℝ → X → ℝ) [IsProbabilityMeasure π0] [IsProbabilityMeasure π1] [IsProbabilityMeasure Q] (lambda a : ℝ) (hlambda : 0 ≤ lambda) (ha : 0 ≤ a) (hmeas : Measurable fun p : ℝ × X => likelihood p.1 p.2) (hnonneg : ∀ θ x, 0 ≤ likelihood θ x) (hinner : ∀ θ θ', ∫ x, likelihood θ x * likelihood θ' x ∂Q = exp (lambda * θ * θ')) (hsupp0 : π0 {θ | |θ| ≤ a} = 1) (hsupp1 : π1 {θ | |θ| ≤ a} = 1) : ∫ x, (mixtureLikelihood π0 likelihood x - mixtureLikelihood π1 likelihood x) ^ 2 ∂Q = exponentialPriorEnergy π0 π0 lambda - exponentialPriorEnergy π0 π1 lambda - exponentialPriorEnergy π1 π0 lambda + exponentialPriorEnergy π1 π1 lambda := by -- Prove the four cross-term identities before expanding the square. For priors -- `π,ρ`, Tonelli applied to the nonnegative jointly measurable likelihood product -- identifies -- `∫ (∫ Lθ dπ) (∫ Lθ' dρ) dQ` -- with the iterated prior integral of `∫ Lθ Lθ' dQ`; `hinner` then gives the -- corresponding `exponentialPriorEnergy`. The support bounds make every such -- energy finite (bounded by `exp (lambda * a^2)`), which supplies the Bochner -- integrability needed to pass back from `lintegral` and expand the signed square. have hset : MeasurableSet {θ : ℝ | |θ| ≤ a} := measurableSet_le continuous_abs.measurable measurable_const have hsupp_ae (π : Measure ℝ) [IsProbabilityMeasure π] (hsupp : π {θ | |θ| ≤ a} = 1) : ∀ᵐ θ ∂π, |θ| ≤ a := by change {θ : ℝ | |θ| ≤ a} ∈ ae π rw [mem_ae_iff, measure_compl hset (measure_ne_top π _), measure_univ, hsupp, tsub_self] have hprod_int (θ θ' : ℝ) : Integrable (fun x => likelihood θ x * likelihood θ' x) Q := by by_contra h have heq := hinner θ θ' rw [integral_undef h] at heq exact (Real.exp_ne_zero _ heq.symm) have hcross (π ρ : Measure ℝ) [IsProbabilityMeasure π] [IsProbabilityMeasure ρ] (hsuppπ : π {θ | |θ| ≤ a} = 1) (hsuppρ : ρ {θ | |θ| ≤ a} = 1) : Integrable (fun x => mixtureLikelihood π likelihood x * mixtureLikelihood ρ likelihood x) Q ∧ ∫ x, mixtureLikelihood π likelihood x * mixtureLikelihood ρ likelihood x ∂Q = exponentialPriorEnergy π ρ lambda := by let g : (ℝ × ℝ) × X → ℝ := fun z => likelihood z.1.1 z.2 * likelihood z.1.2 z.2 have hgmeas : Measurable g := by unfold g fun_prop have hpairs : ∀ᵐ z ∂π.prod ρ, |z.1| ≤ a ∧ |z.2| ≤ a := by apply (Measure.ae_prod_iff_ae_ae ((measurableSet_le (continuous_abs.measurable.comp measurable_fst) measurable_const).inter (measurableSet_le (continuous_abs.measurable.comp measurable_snd) measurable_const))).2 filter_upwards [hsupp_ae π hsuppπ] with θ hθ filter_upwards [hsupp_ae ρ hsuppρ] with θ' hθ' exact ⟨hθ, hθ'⟩ have hexp_int : Integrable (fun z : ℝ × ℝ => exp (lambda * z.1 * z.2)) (π.prod ρ) := by apply (integrable_const (μ := π.prod ρ) (exp (lambda * a ^ 2))).mono' (by fun_prop) filter_upwards [hpairs] with z hz rcases hz with ⟨hz1, hz2⟩ rw [Real.norm_eq_abs, abs_of_pos (Real.exp_pos _)] apply Real.exp_le_exp.mpr calc lambda * z.1 * z.2 ≤ |lambda * z.1 * z.2| := le_abs_self _ _ = lambda * |z.1| * |z.2| := by rw [abs_mul, abs_mul, abs_of_nonneg hlambda] _ ≤ lambda * a * a := by gcongr _ = lambda * a ^ 2 := by ring have hg_int : Integrable g ((π.prod ρ).prod Q) := by rw [integrable_prod_iff hgmeas.aestronglyMeasurable] constructor · filter_upwards with z simpa [g] using hprod_int z.1 z.2 · convert hexp_int using 1 funext z calc ∫ x, ‖g (z, x)‖ ∂Q = ∫ x, likelihood z.1 x * likelihood z.2 x ∂Q := by apply integral_congr_ae filter_upwards with x simp only [g, Real.norm_eq_abs, abs_of_nonneg (mul_nonneg (hnonneg _ _) (hnonneg _ _))] _ = exp (lambda * z.1 * z.2) := hinner z.1 z.2 have hpoint (x : X) : (∫ z : ℝ × ℝ, g (z, x) ∂π.prod ρ) = mixtureLikelihood π likelihood x * mixtureLikelihood ρ likelihood x := by change (∫ z : ℝ × ℝ, likelihood z.1 x * likelihood z.2 x ∂π.prod ρ) = (∫ θ, likelihood θ x ∂π) * ∫ θ, likelihood θ x ∂ρ exact integral_prod_mul (fun θ => likelihood θ x) (fun θ => likelihood θ x) have hmix_int : Integrable (fun x => mixtureLikelihood π likelihood x * mixtureLikelihood ρ likelihood x) Q := hg_int.integral_prod_right.congr (ae_of_all _ hpoint) refine ⟨hmix_int, ?_⟩ calc ∫ x, mixtureLikelihood π likelihood x * mixtureLikelihood ρ likelihood x ∂Q = ∫ x, ∫ z : ℝ × ℝ, g (z, x) ∂π.prod ρ ∂Q := by exact integral_congr_ae (ae_of_all _ fun x => (hpoint x).symm) _ = ∫ z : ℝ × ℝ, ∫ x, g (z, x) ∂Q ∂π.prod ρ := (integral_integral_swap hg_int).symm _ = ∫ z : ℝ × ℝ, exp (lambda * z.1 * z.2) ∂π.prod ρ := by apply integral_congr_ae filter_upwards with z exact hinner z.1 z.2 _ = exponentialPriorEnergy π ρ lambda := by rw [exponentialPriorEnergy, integral_prod] exact hexp_int obtain ⟨h00i, h00⟩ := hcross π0 π0 hsupp0 hsupp0 obtain ⟨h01i, h01⟩ := hcross π0 π1 hsupp0 hsupp1 obtain ⟨h10i, h10⟩ := hcross π1 π0 hsupp1 hsupp0 obtain ⟨h11i, h11⟩ := hcross π1 π1 hsupp1 hsupp1 have hsq : (fun x => (mixtureLikelihood π0 likelihood x - mixtureLikelihood π1 likelihood x) ^ 2) = fun x => mixtureLikelihood π0 likelihood x * mixtureLikelihood π0 likelihood x - mixtureLikelihood π0 likelihood x * mixtureLikelihood π1 likelihood x - mixtureLikelihood π1 likelihood x * mixtureLikelihood π0 likelihood x + mixtureLikelihood π1 likelihood x * mixtureLikelihood π1 likelihood x := by funext x ring rw [hsq] change ∫ x, (((fun x => mixtureLikelihood π0 likelihood x * mixtureLikelihood π0 likelihood x) - (fun x => mixtureLikelihood π0 likelihood x * mixtureLikelihood π1 likelihood x) - (fun x => mixtureLikelihood π1 likelihood x * mixtureLikelihood π0 likelihood x)) + (fun x => mixtureLikelihood π1 likelihood x * mixtureLikelihood π1 likelihood x)) x ∂Q = _ calc _ = (∫ x, ((fun x => mixtureLikelihood π0 likelihood x * mixtureLikelihood π0 likelihood x) - (fun x => mixtureLikelihood π0 likelihood x * mixtureLikelihood π1 likelihood x) - (fun x => mixtureLikelihood π1 likelihood x * mixtureLikelihood π0 likelihood x)) x ∂Q) + ∫ x, mixtureLikelihood π1 likelihood x * mixtureLikelihood π1 likelihood x ∂Q := integral_add ((h00i.sub h01i).sub h10i) h11i _ = ((∫ x, ((fun x => mixtureLikelihood π0 likelihood x * mixtureLikelihood π0 likelihood x) - (fun x => mixtureLikelihood π0 likelihood x * mixtureLikelihood π1 likelihood x)) x ∂Q) - ∫ x, mixtureLikelihood π1 likelihood x * mixtureLikelihood π0 likelihood x ∂Q) + ∫ x, mixtureLikelihood π1 likelihood x * mixtureLikelihood π1 likelihood x ∂Q := by congr 1 exact integral_sub (h00i.sub h01i) h10i _ = ((∫ x, mixtureLikelihood π0 likelihood x * mixtureLikelihood π0 likelihood x ∂Q) - ∫ x, mixtureLikelihood π0 likelihood x * mixtureLikelihood π1 likelihood x ∂Q - ∫ x, mixtureLikelihood π1 likelihood x * mixtureLikelihood π0 likelihood x ∂Q) + ∫ x, mixtureLikelihood π1 likelihood x * mixtureLikelihood π1 likelihood x ∂Q := by congr 2 exact integral_sub h00i h01i _ = _ := by rw [h00, h01, h10, h11]
    Causalean.Stat.Minimax.MomentMatchedMixture.integral_sq_mixtureLikelihood_sub_eq_exponentialPriorEnergy · Causalean/Stat/Minimax/MomentMatchedMixture/Analytic.lean:85
  • integral_sq_mixtureLikelihood_sub_le_tail theorem — Given two probability priors, a probability dominating measure, a jointly measurable nonnegative likelihood family, a nonnegative interaction scale, a nonnegative support radius, and a matching degree, if likelihood inner products have the exponential product form, both priors are supported within the radius, and their moments agree through that degree, then the squared distance between their mixture likelihoods is at most four times the unmatched exponential-series tail.
    X :
    Type u_1
    shared
    π0 π1 :
    Q :
    likelihood :
    ℝ → X → ℝ
    lambda a :
    degree :
    hlambda :
    0 ≤ lambda
    ha :
    0 ≤ a
    hmeas :
    Measurable fun p : ℝ × X => likelihood p.1 p.2
    hnonneg :
    ∀ θ x, 0 ≤ likelihood θ x
    hinner :
    ∀ θ θ', ∫ x, likelihood θ x * likelihood θ' x ∂Q = exp (lambda * θ * θ')
    hsupp0 :
    π0 {θ | |θ| ≤ a} = 1
    hsupp1 :
    π1 {θ | |θ| ≤ a} = 1
    hmom :
    ∀ n ≤ degree, ∫ θ, θ ^ n ∂π0 = ∫ θ, θ ^ n ∂π1
    ∫ x, (mixtureLikelihood π0 likelihood x - mixtureLikelihood π1 likelihood x) ^ 2 ∂Q
    ≤ 4 * exponentialSeriesTail degree (lambda * a ^ 2)
    Proof (Lean source)
    theorem integral_sq_mixtureLikelihood_sub_le_tail (π0 π1 : Measure ℝ) (Q : Measure X) (likelihood : ℝ → X → ℝ) [IsProbabilityMeasure π0] [IsProbabilityMeasure π1] [IsProbabilityMeasure Q] (lambda a : ℝ) (degree : ℕ) (hlambda : 0 ≤ lambda) (ha : 0 ≤ a) (hmeas : Measurable fun p : ℝ × X => likelihood p.1 p.2) (hnonneg : ∀ θ x, 0 ≤ likelihood θ x) (hinner : ∀ θ θ', ∫ x, likelihood θ x * likelihood θ' x ∂Q = exp (lambda * θ * θ')) (hsupp0 : π0 {θ | |θ| ≤ a} = 1) (hsupp1 : π1 {θ | |θ| ≤ a} = 1) (hmom : ∀ n ≤ degree, ∫ θ, θ ^ n ∂π0 = ∫ θ, θ ^ n ∂π1) : ∫ x, (mixtureLikelihood π0 likelihood x - mixtureLikelihood π1 likelihood x) ^ 2 ∂Q ≤ 4 * exponentialSeriesTail degree (lambda * a ^ 2) := by rw [integral_sq_mixtureLikelihood_sub_eq_exponentialPriorEnergy π0 π1 Q likelihood lambda a hlambda ha hmeas hnonneg hinner hsupp0 hsupp1] exact exponentialPriorEnergy_quadratic_le_tail π0 π1 lambda a degree hlambda ha hsupp0 hsupp1 hmom
    Causalean.Stat.Minimax.MomentMatchedMixture.integral_sq_mixtureLikelihood_sub_le_tail · Causalean/Stat/Minimax/MomentMatchedMixture/Analytic.lean:230
  • priorPredictive_absolutelyContinuous theorem — Given a probability prior, an experiment kernel, a dominating measure, and a jointly measurable nonnegative likelihood family, if each experiment law has the stated density, then the prior-predictive mixture is absolutely continuous with respect to the dominating measure.
    X :
    Type u_1
    shared
    π :
    K :
    Kernel ℝ X
    Q :
    likelihood :
    ℝ → X → ℝ
    hmeas :
    Measurable fun p : ℝ × X => likelihood p.1 p.2
    hnonneg :
    ∀ θ x, 0 ≤ likelihood θ x
    hdensity :
    ∀ θ, K θ = Q.withDensity fun x => ofReal (likelihood θ x)
    priorPredictive π K ≪ Q
    Proof (Lean source)
    theorem priorPredictive_absolutelyContinuous (π : Measure ℝ) (K : Kernel ℝ X) (Q : Measure X) (likelihood : ℝ → X → ℝ) [IsProbabilityMeasure π] (hmeas : Measurable fun p : ℝ × X => likelihood p.1 p.2) (hnonneg : ∀ θ x, 0 ≤ likelihood θ x) (hdensity : ∀ θ, K θ = Q.withDensity fun x => ofReal (likelihood θ x)) : priorPredictive π K ≪ Q := by refine Measure.AbsolutelyContinuous.mk fun A hA hQA => ?_ rw [priorPredictive_apply π K hA] rw [lintegral_eq_zero_iff (Kernel.measurable_coe K hA)] refine ae_of_all π fun θ => ?_ change K θ A = 0 rw [hdensity θ] exact withDensity_absolutelyContinuous Q _ hQA
    Causalean.Stat.Minimax.MomentMatchedMixture.priorPredictive_absolutelyContinuous · Causalean/Stat/Minimax/MomentMatchedMixture/Analytic.lean:255
  • tvDist_le_half_sqrt_integral_sq_density_sub theorem — Given two probability laws, a probability dominating law, and two measurable nonnegative densities, if the laws have those densities and their squared difference is integrable, then their total variation distance is at most half the square root of the integrated squared density difference.
    X :
    Type u_1
    shared
    μ ν Q :
    p q :
    X → ℝ
    hpmeas :
    hqmeas :
    hpnonneg :
    ∀ x, 0 ≤ p x
    hqnonneg :
    ∀ x, 0 ≤ q x
    :
    μ = Q.withDensity fun x => ofReal (p x)
    :
    ν = Q.withDensity fun x => ofReal (q x)
    hint :
    Integrable (fun x => (p x - q x) ^ 2) Q
    tvDist μ ν ≤ (1 / 2 : ℝ) * sqrt (∫ x, (p x - q x) ^ 2 ∂Q)
    Proof (Lean source)
    theorem tvDist_le_half_sqrt_integral_sq_density_sub (μ ν Q : Measure X) (p q : X → ℝ) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] [IsProbabilityMeasure Q] (hpmeas : Measurable p) (hqmeas : Measurable q) (hpnonneg : ∀ x, 0 ≤ p x) (hqnonneg : ∀ x, 0 ≤ q x) (hμ : μ = Q.withDensity fun x => ofReal (p x)) (hν : ν = Q.withDensity fun x => ofReal (q x)) (hint : Integrable (fun x => (p x - q x) ^ 2) Q) : tvDist μ ν ≤ (1 / 2 : ℝ) * sqrt (∫ x, (p x - q x) ^ 2 ∂Q) := by have hμac : μ ≪ Q := by rw [hμ] exact withDensity_absolutelyContinuous Q _ have hνac : ν ≪ Q := by rw [hν] exact withDensity_absolutelyContinuous Q _ have hrnp_enn : μ.rnDeriv Q =ᵐ[Q] fun x => ofReal (p x) := by rw [hμ] exact Measure.rnDeriv_withDensity Q hpmeas.ennreal_ofReal have hrnq_enn : ν.rnDeriv Q =ᵐ[Q] fun x => ofReal (q x) := by rw [hν] exact Measure.rnDeriv_withDensity Q hqmeas.ennreal_ofReal have hrnp : (fun x => (μ.rnDeriv Q x).toReal) =ᵐ[Q] p := by filter_upwards [hrnp_enn] with x hx rw [hx, ENNReal.toReal_ofReal (hpnonneg x)] have hrnq : (fun x => (ν.rnDeriv Q x).toReal) =ᵐ[Q] q := by filter_upwards [hrnq_enn] with x hx rw [hx, ENNReal.toReal_ofReal (hqnonneg x)] have hpint : Integrable p Q := Measure.integrable_toReal_rnDeriv.congr hrnp have hqint : Integrable q Q := Measure.integrable_toReal_rnDeriv.congr hrnq have hdiff : Integrable (fun x => p x - q x) Q := hpint.sub hqint have hp_one : ∫ x, p x ∂Q = 1 := by calc ∫ x, p x ∂Q = ∫ x, (μ.rnDeriv Q x).toReal ∂Q := integral_congr_ae hrnp.symm _ = μ.real univ := Measure.integral_toReal_rnDeriv hμac _ = 1 := by simp have hq_one : ∫ x, q x ∂Q = 1 := by calc ∫ x, q x ∂Q = ∫ x, (ν.rnDeriv Q x).toReal ∂Q := integral_congr_ae hrnq.symm _ = ν.real univ := Measure.integral_toReal_rnDeriv hνac _ = 1 := by simp have hdiff_zero : ∫ x, (p x - q x) ∂Q = 0 := by rw [integral_sub hpint hqint, hp_one, hq_one, sub_self] have hscheffe : tvDist μ ν ≤ (1 / 2 : ℝ) * ∫ x, |p x - q x| ∂Q := by refine ciSup_le fun A => ?_ obtain ⟨A, hA⟩ := A have hgap : μ.real A - ν.real A = ∫ x in A, (p x - q x) ∂Q := by calc μ.real A - ν.real A = (∫ x in A, (μ.rnDeriv Q x).toReal ∂Q) - ∫ x in A, (ν.rnDeriv Q x).toReal ∂Q := by rw [Measure.setIntegral_toReal_rnDeriv hμac, Measure.setIntegral_toReal_rnDeriv hνac] _ = (∫ x in A, p x ∂Q) - ∫ x in A, q x ∂Q := by rw [integral_congr_ae (ae_restrict_of_ae hrnp), integral_congr_ae (ae_restrict_of_ae hrnq)] _ = ∫ x in A, (p x - q x) ∂Q := (integral_sub hpint.integrableOn hqint.integrableOn).symm rw [hgap] exact Causalean.Stat.abs_setIntegral_le_half_integral_abs_of_integral_eq_zero hdiff hdiff_zero hA have hmeasdiff : AEStronglyMeasurable (fun x => p x - q x) Q := (hpmeas.sub hqmeas).aestronglyMeasurable have hdiffL2 : MemLp (fun x => p x - q x) 2 Q := (memLp_two_iff_integrable_sq hmeasdiff).2 hint have habsL2 : MemLp (fun x => |p x - q x|) (ofReal 2) Q := by have h := hdiffL2.norm simp only [Real.norm_eq_abs] at h simpa using h have honeL2 : MemLp (fun _ : X => (1 : ℝ)) (ofReal 2) Q := by simpa using (memLp_const (1 : ℝ) : MemLp (fun _ : X => (1 : ℝ)) 2 Q) have hholder : ∫ x, |p x - q x| * (1 : ℝ) ∂Q ≤ (∫ x, |p x - q x| ^ (2 : ℝ) ∂Q) ^ (1 / (2 : ℝ)) * (∫ _x : X, (1 : ℝ) ^ (2 : ℝ) ∂Q) ^ (1 / (2 : ℝ)) := integral_mul_le_Lp_mul_Lq_of_nonneg Real.HolderConjugate.two_two (Filter.Eventually.of_forall fun x => abs_nonneg _) (Filter.Eventually.of_forall fun _ => zero_le_one) habsL2 honeL2 have hL1 : ∫ x, |p x - q x| ∂Q ≤ sqrt (∫ x, (p x - q x) ^ 2 ∂Q) := by have hsquare : ∫ x, |p x - q x| ^ (2 : ℝ) ∂Q = ∫ x, (p x - q x) ^ 2 ∂Q := by apply integral_congr_ae filter_upwards with x rw [Real.rpow_two, sq_abs] rw [show (∫ _x : X, (1 : ℝ) ^ (2 : ℝ) ∂Q) ^ (1 / (2 : ℝ)) = 1 by simp, mul_one, hsquare] at hholder simpa [Real.sqrt_eq_rpow] using hholder exact hscheffe.trans (mul_le_mul_of_nonneg_left hL1 (by norm_num))
    Causalean.Stat.Minimax.MomentMatchedMixture.tvDist_le_half_sqrt_integral_sq_density_sub · Causalean/Stat/Minimax/MomentMatchedMixture/Analytic.lean:274
Product 3 core · 5 supporting This module tensorizes one-coordinate total-variation bounds and packages the independent coordinate prior-predictive law used by high-dimensional applications. ★ momentMatchedProductMixture_tv_le

Finite products of prior-predictive mixtures

This module tensorizes one-coordinate total-variation bounds and packages the independent coordinate prior-predictive law used by high-dimensional applications.

def productPrior reviewed
Causalean.Stat.Minimax.MomentMatchedMixture

Given a dimension and a scalar prior, the independent coordinate prior is the finite product of that prior across all coordinates.

Definition (Lean source)
d :
π :
productPrior d π :
Measure (Fin d → ℝ)
Measure.pi fun _ : Fin d => π
Causalean.Stat.Minimax.MomentMatchedMixture.productPrior · Causalean/Stat/Minimax/MomentMatchedMixture/Product.lean:19
def productPriorPredictive reviewed
Causalean.Stat.Minimax.MomentMatchedMixture

Given a dimension, a scalar prior, and a one-coordinate experiment kernel, the independent coordinate prior-predictive law is the finite product of the one-coordinate mixture law.

Definition (Lean source)
X :
Type u_1
shared
d :
π :
K :
Kernel ℝ X
productPriorPredictive d π K :
Measure (Fin d → X)
Measure.pi fun _ : Fin d => priorPredictive π K
Causalean.Stat.Minimax.MomentMatchedMixture.productPriorPredictive · Causalean/Stat/Minimax/MomentMatchedMixture/Product.lean:24
theorem momentMatchedProductMixture_tv_le reviewed
Causalean.Stat.Minimax.MomentMatchedMixture

Given a dimension, two probability priors, a probability experiment kernel, a probability dominating law, a jointly measurable nonnegative likelihood family, a nonnegative interaction scale, a nonnegative support radius, and a matching degree, if each experiment law has the stated density, likelihood inner products have the exponential product form, both priors are supported within the radius, and their moments agree through that degree, then the product prior-predictive mixtures are within the dimension times the square root of the explicit unmatched series tail in total variation.

Formal statement
X :
Type u_1
shared
d :
π0 π1 :
K :
Kernel ℝ X
Q :
likelihood :
ℝ → X → ℝ
hK :
∀ θ, IsProbabilityMeasure (K θ)
lambda a :
degree :
hlambda :
0 ≤ lambda
ha :
0 ≤ a
hmeas :
Measurable fun p : ℝ × X => likelihood p.1 p.2
hnonneg :
∀ θ x, 0 ≤ likelihood θ x
hdensity :
∀ θ, K θ = Q.withDensity fun x => ofReal (likelihood θ x)
hinner :
∀ θ θ', ∫ x, likelihood θ x * likelihood θ' x ∂Q = exp (lambda * θ * θ')
hsupp0 :
π0 {θ | |θ| ≤ a} = 1
hsupp1 :
π1 {θ | |θ| ≤ a} = 1
hmom :
∀ n ≤ degree, ∫ θ, θ ^ n ∂π0 = ∫ θ, θ ^ n ∂π1
≤ d * sqrt (exponentialSeriesTail degree (lambda * a ^ 2))
Proof (Lean source)
theorem momentMatchedProductMixture_tv_le (d : ℕ) (π0 π1 : Measure ℝ) (K : Kernel ℝ X) (Q : Measure X) (likelihood : ℝ → X → ℝ) [IsProbabilityMeasure π0] [IsProbabilityMeasure π1] [IsProbabilityMeasure Q] (hK : ∀ θ, IsProbabilityMeasure (K θ)) (lambda a : ℝ) (degree : ℕ) (hlambda : 0 ≤ lambda) (ha : 0 ≤ a) (hmeas : Measurable fun p : ℝ × X => likelihood p.1 p.2) (hnonneg : ∀ θ x, 0 ≤ likelihood θ x) (hdensity : ∀ θ, K θ = Q.withDensity fun x => ofReal (likelihood θ x)) (hinner : ∀ θ θ', ∫ x, likelihood θ x * likelihood θ' x ∂Q = exp (lambda * θ * θ')) (hsupp0 : π0 {θ | |θ| ≤ a} = 1) (hsupp1 : π1 {θ | |θ| ≤ a} = 1) (hmom : ∀ n ≤ degree, ∫ θ, θ ^ n ∂π0 = ∫ θ, θ ^ n ∂π1) : tvDist (productPriorPredictive d π0 K) (productPriorPredictive d π1 K) ≤ d * sqrt (exponentialSeriesTail degree (lambda * a ^ 2)) := by -- This is the direct composition of `tvDist_pi_iid_le` and -- `momentMatchedMixture_tv_le_sqrt_tail`, after unfolding -- `productPriorPredictive` and multiplying by the nonnegative cast of `d`. letI : IsProbabilityMeasure (priorPredictive π0 K) := priorPredictive_isProbability π0 K hK letI : IsProbabilityMeasure (priorPredictive π1 K) := priorPredictive_isProbability π1 K hK unfold productPriorPredictive calc tvDist (Measure.pi fun _ : Fin d => priorPredictive π0 K) (Measure.pi fun _ : Fin d => priorPredictive π1 K) ≤ d * tvDist (priorPredictive π0 K) (priorPredictive π1 K) := tvDist_pi_iid_le d _ _ _ ≤ d * sqrt (exponentialSeriesTail degree (lambda * a ^ 2)) := mul_le_mul_of_nonneg_left (momentMatchedMixture_tv_le_sqrt_tail π0 π1 K Q likelihood hK lambda a degree hlambda ha hmeas hnonneg hdensity hinner hsupp0 hsupp1 hmom) (Nat.cast_nonneg d)
Causalean.Stat.Minimax.MomentMatchedMixture.momentMatchedProductMixture_tv_le · Causalean/Stat/Minimax/MomentMatchedMixture/Product.lean:262 · uses exponentialSeriesTail , productPriorPredictive , tvDist
5 supporting declarations (lemmas, instances)
Support­Localized 1 core · 10 supporting This module localizes the predictive-density, exponential Gram, and total-variation theory for moment-matched prior mixtures. ★ momentMatchedProductMixture_tv_le_of_supported

Support-localized moment-matched prior mixtures

This module localizes the predictive-density, exponential Gram, and total-variation theory for moment-matched prior mixtures. Likelihood nonnegativity, density representation, and inner-product identities are needed only on the bounded interval carrying the priors; values outside their support do not affect the resulting one-coordinate or finite-product bounds.

theorem momentMatchedProductMixture_tv_le_of_supported reviewed
Causalean.Stat.Minimax.MomentMatchedMixture

The finite products over the chosen number of independent coordinates of predictive laws formed from two probability priors and an experiment kernel with probability fibres are within the dimension times the square root of the unmatched exponential-series tail in total variation when their moments agree through the chosen degree, the priors are supported on the interval of parameters with absolute value at most the chosen radius, the common dominating observation law is a probability law, and the likelihood family is jointly measurable while only on that interval it is nonnegative, represents the kernel densities, and has exponential inner products at a nonnegative interaction scale, with a nonnegative support radius.

Formal statement
X :
Type u_1
shared
d :
π0 π1 :
K :
Kernel ℝ X
Q :
likelihood :
ℝ → X → ℝ
hK :
∀ θ, IsProbabilityMeasure (K θ)
lambda a :
degree :
hlambda :
0 ≤ lambda
ha :
0 ≤ a
hmeas :
Measurable fun p : ℝ × X => likelihood p.1 p.2
hnonneg :
∀ θ
if
|θ| ≤ a
then
∀ x, 0 ≤ likelihood θ x
hdensity :
∀ θ
if
|θ| ≤ a
then
K θ = Q.withDensity fun x => ofReal (likelihood θ x)
hinner :
∀ θ,
|θ|
≤ a → ∀ θ', |θ'| ≤ a → ∫ x, likelihood θ x * likelihood θ' x ∂Q = exp (lambda * θ * θ')
hsupp0 :
π0 {θ | |θ| ≤ a} = 1
hsupp1 :
π1 {θ | |θ| ≤ a} = 1
hmom :
∀ n ≤ degree, ∫ θ, θ ^ n ∂π0 = ∫ θ, θ ^ n ∂π1
≤ d * sqrt (exponentialSeriesTail degree (lambda * a ^ 2))
Proof (Lean source)
theorem momentMatchedProductMixture_tv_le_of_supported (d : ℕ) (π0 π1 : Measure ℝ) (K : Kernel ℝ X) (Q : Measure X) (likelihood : ℝ → X → ℝ) [IsProbabilityMeasure π0] [IsProbabilityMeasure π1] [IsProbabilityMeasure Q] (hK : ∀ θ, IsProbabilityMeasure (K θ)) (lambda a : ℝ) (degree : ℕ) (hlambda : 0 ≤ lambda) (ha : 0 ≤ a) (hmeas : Measurable fun p : ℝ × X => likelihood p.1 p.2) (hnonneg : ∀ θ, |θ| ≤ a → ∀ x, 0 ≤ likelihood θ x) (hdensity : ∀ θ, |θ| ≤ a → K θ = Q.withDensity fun x => ofReal (likelihood θ x)) (hinner : ∀ θ, |θ| ≤ a → ∀ θ', |θ'| ≤ a → ∫ x, likelihood θ x * likelihood θ' x ∂Q = exp (lambda * θ * θ')) (hsupp0 : π0 {θ | |θ| ≤ a} = 1) (hsupp1 : π1 {θ | |θ| ≤ a} = 1) (hmom : ∀ n ≤ degree, ∫ θ, θ ^ n ∂π0 = ∫ θ, θ ^ n ∂π1) : tvDist (productPriorPredictive d π0 K) (productPriorPredictive d π1 K) ≤ d * sqrt (exponentialSeriesTail degree (lambda * a ^ 2)) := by letI : IsProbabilityMeasure (priorPredictive π0 K) := priorPredictive_isProbability π0 K hK letI : IsProbabilityMeasure (priorPredictive π1 K) := priorPredictive_isProbability π1 K hK unfold productPriorPredictive calc tvDist (Measure.pi fun _ : Fin d => priorPredictive π0 K) (Measure.pi fun _ : Fin d => priorPredictive π1 K) ≤ d * tvDist (priorPredictive π0 K) (priorPredictive π1 K) := tvDist_pi_iid_le d _ _ _ ≤ d * sqrt (exponentialSeriesTail degree (lambda * a ^ 2)) := mul_le_mul_of_nonneg_left (momentMatchedMixture_tv_le_sqrt_tail_of_supported π0 π1 K Q likelihood hK lambda a degree hlambda ha hmeas hnonneg hdensity hinner hsupp0 hsupp1 hmom) (Nat.cast_nonneg d)
Causalean.Stat.Minimax.MomentMatchedMixture.momentMatchedProductMixture_tv_le_of_supported · Causalean/Stat/Minimax/MomentMatchedMixture/SupportLocalized.lean:473 · uses exponentialSeriesTail , productPriorPredictive , tvDist
10 supporting declarations (lemmas, instances)
  • ae_abs_le_of_measure_interval_eq_one theorem — A probability prior that assigns mass one to the interval of parameters with absolute value at most the chosen radius is almost surely concentrated on that interval.
    a :
    hsupp :
    π {θ | |θ| ≤ a} = 1
    ∀ᵐ θ ∂π, |θ| ≤ a
    Proof (Lean source)
    theorem ae_abs_le_of_measure_interval_eq_one (π : Measure ℝ) [IsProbabilityMeasure π] (a : ℝ) (hsupp : π {θ | |θ| ≤ a} = 1) : ∀ᵐ θ ∂π, |θ| ≤ a := by exact (mem_ae_iff_prob_eq_one (measurableSet_le continuous_abs.measurable measurable_const)).2 hsupp
    Causalean.Stat.Minimax.MomentMatchedMixture.ae_abs_le_of_measure_interval_eq_one · Causalean/Stat/Minimax/MomentMatchedMixture/SupportLocalized.lean:19
  • measurable_mixtureLikelihood theorem — The average under a sigma-finite prior of a real-valued likelihood family that is jointly measurable in parameter and observation is measurable as a function of the observation.
    X :
    Type u_1
    shared
    π :
    likelihood :
    ℝ → X → ℝ
    hmeas :
    Measurable fun p : ℝ × X => likelihood p.1 p.2
    Measurable (mixtureLikelihood π likelihood)
    Proof (Lean source)
    theorem measurable_mixtureLikelihood (π : Measure ℝ) [SFinite π] (likelihood : ℝ → X → ℝ) (hmeas : Measurable fun p : ℝ × X => likelihood p.1 p.2) : Measurable (mixtureLikelihood π likelihood) := by exact hmeas.stronglyMeasurable.integral_prod_left'.measurable
    Causalean.Stat.Minimax.MomentMatchedMixture.measurable_mixtureLikelihood · Causalean/Stat/Minimax/MomentMatchedMixture/SupportLocalized.lean:29
  • mixtureLikelihood_nonnegative_of_supported theorem — The average under a probability prior of a real-valued likelihood family at an observation is nonnegative when the prior is supported on the interval of parameters with absolute value at most the chosen radius and the likelihood is nonnegative throughout that interval, regardless of its values elsewhere.
    X :
    Type u_1
    shared
    π :
    likelihood :
    ℝ → X → ℝ
    a :
    hsupp :
    π {θ | |θ| ≤ a} = 1
    hnonneg :
    ∀ θ
    if
    |θ| ≤ a
    then
    ∀ x, 0 ≤ likelihood θ x
    x :
    X
    0 ≤ mixtureLikelihood π likelihood x
    Proof (Lean source)
    theorem mixtureLikelihood_nonnegative_of_supported (π : Measure ℝ) (likelihood : ℝ → X → ℝ) [IsProbabilityMeasure π] (a : ℝ) (hsupp : π {θ | |θ| ≤ a} = 1) (hnonneg : ∀ θ, |θ| ≤ a → ∀ x, 0 ≤ likelihood θ x) (x : X) : 0 ≤ mixtureLikelihood π likelihood x := by apply integral_nonneg_of_ae filter_upwards [ae_abs_le_of_measure_interval_eq_one π a hsupp] with θ hθ exact hnonneg θ hθ x
    Causalean.Stat.Minimax.MomentMatchedMixture.mixtureLikelihood_nonnegative_of_supported · Causalean/Stat/Minimax/MomentMatchedMixture/SupportLocalized.lean:38
  • integrable_mixtureLikelihood_of_supported_density theorem — The prior average of a likelihood family is integrable under a common dominating measure when the experiment kernel has probability fibres, the dominating measure is sigma-finite, the prior is supported on the interval of parameters with absolute value at most the chosen radius, the likelihood is jointly measurable and nonnegative on that interval, and supported kernel fibres have the stated likelihood densities.
    X :
    Type u_1
    shared
    π :
    K :
    Kernel ℝ X
    Q :
    likelihood :
    ℝ → X → ℝ
    hK :
    ∀ θ, IsProbabilityMeasure (K θ)
    a :
    hsupp :
    π {θ | |θ| ≤ a} = 1
    hmeas :
    Measurable fun p : ℝ × X => likelihood p.1 p.2
    hnonneg :
    ∀ θ
    if
    |θ| ≤ a
    then
    ∀ x, 0 ≤ likelihood θ x
    hdensity :
    ∀ θ
    if
    |θ| ≤ a
    then
    K θ = Q.withDensity fun x => ofReal (likelihood θ x)
    Integrable (mixtureLikelihood π likelihood) Q
    Proof (Lean source)
    theorem integrable_mixtureLikelihood_of_supported_density (π : Measure ℝ) (K : Kernel ℝ X) (Q : Measure X) (likelihood : ℝ → X → ℝ) [IsProbabilityMeasure π] [SigmaFinite Q] (hK : ∀ θ, IsProbabilityMeasure (K θ)) (a : ℝ) (hsupp : π {θ | |θ| ≤ a} = 1) (hmeas : Measurable fun p : ℝ × X => likelihood p.1 p.2) (hnonneg : ∀ θ, |θ| ≤ a → ∀ x, 0 ≤ likelihood θ x) (hdensity : ∀ θ, |θ| ≤ a → K θ = Q.withDensity fun x => ofReal (likelihood θ x)) : Integrable (mixtureLikelihood π likelihood) Q := by have hsupp_ae := ae_abs_le_of_measure_interval_eq_one π a hsupp have hfiber : ∀ᵐ θ ∂π, ∫⁻ x, ofReal (likelihood θ x) ∂Q = 1 := by filter_upwards [hsupp_ae] with θ hθ calc ∫⁻ x, ofReal (likelihood θ x) ∂Q = (Q.withDensity fun x => ofReal (likelihood θ x)) univ := by rw [withDensity_apply _ MeasurableSet.univ, Measure.restrict_univ] _ = K θ univ := by rw [hdensity θ hθ] _ = 1 := isProbabilityMeasure_iff.mp (hK θ) have hnonneg_ae : ∀ᵐ p : ℝ × X ∂π.prod Q, 0 ≤ likelihood p.1 p.2 := by apply (Measure.ae_prod_iff_ae_ae (measurableSet_le measurable_const hmeas)).2 filter_upwards [hsupp_ae] with θ hθ exact ae_of_all Q fun x => hnonneg θ hθ x have hjoint : Integrable (fun p : ℝ × X => likelihood p.1 p.2) (π.prod Q) := by refine ⟨hmeas.aestronglyMeasurable, ?_⟩ apply (hasFiniteIntegral_iff_ofReal hnonneg_ae).2 rw [lintegral_prod _ hmeas.ennreal_ofReal.aemeasurable] rw [lintegral_congr_ae hfiber] simp change Integrable (fun x => ∫ θ, likelihood θ x ∂π) Q exact hjoint.integral_prod_right
    Causalean.Stat.Minimax.MomentMatchedMixture.integrable_mixtureLikelihood_of_supported_density · Causalean/Stat/Minimax/MomentMatchedMixture/SupportLocalized.lean:51
  • priorPredictive_eq_withDensity_mixtureLikelihood_of_supported theorem — The predictive law obtained by averaging a probability prior through an experiment kernel with probability fibres equals the common dominating measure weighted by the prior-averaged likelihood when the dominating measure is sigma-finite, the likelihood family is jointly measurable, the prior is supported on the interval of parameters with absolute value at most the chosen radius, and only on that interval the likelihood is nonnegative and represents each kernel fibre's density.
    X :
    Type u_1
    shared
    π :
    K :
    Kernel ℝ X
    Q :
    likelihood :
    ℝ → X → ℝ
    hK :
    ∀ θ, IsProbabilityMeasure (K θ)
    a :
    hsupp :
    π {θ | |θ| ≤ a} = 1
    hmeas :
    Measurable fun p : ℝ × X => likelihood p.1 p.2
    hnonneg :
    ∀ θ
    if
    |θ| ≤ a
    then
    ∀ x, 0 ≤ likelihood θ x
    hdensity :
    ∀ θ
    if
    |θ| ≤ a
    then
    K θ = Q.withDensity fun x => ofReal (likelihood θ x)
    = Q.withDensity fun x => ofReal (mixtureLikelihood π likelihood x)
    Proof (Lean source)
    theorem priorPredictive_eq_withDensity_mixtureLikelihood_of_supported (π : Measure ℝ) (K : Kernel ℝ X) (Q : Measure X) (likelihood : ℝ → X → ℝ) [IsProbabilityMeasure π] [SigmaFinite Q] (hK : ∀ θ, IsProbabilityMeasure (K θ)) (a : ℝ) (hsupp : π {θ | |θ| ≤ a} = 1) (hmeas : Measurable fun p : ℝ × X => likelihood p.1 p.2) (hnonneg : ∀ θ, |θ| ≤ a → ∀ x, 0 ≤ likelihood θ x) (hdensity : ∀ θ, |θ| ≤ a → K θ = Q.withDensity fun x => ofReal (likelihood θ x)) : priorPredictive π K = Q.withDensity fun x => ofReal (mixtureLikelihood π likelihood x) := by have hsupp_ae := ae_abs_le_of_measure_interval_eq_one π a hsupp have hfiber : ∀ᵐ θ ∂π, ∫⁻ x, ofReal (likelihood θ x) ∂Q = 1 := by filter_upwards [hsupp_ae] with θ hθ calc ∫⁻ x, ofReal (likelihood θ x) ∂Q = (Q.withDensity fun x => ofReal (likelihood θ x)) univ := by rw [withDensity_apply _ MeasurableSet.univ, Measure.restrict_univ] _ = K θ univ := by rw [hdensity θ hθ] _ = 1 := isProbabilityMeasure_iff.mp (hK θ) have hnonneg_ae : ∀ᵐ p : ℝ × X ∂π.prod Q, 0 ≤ likelihood p.1 p.2 := by apply (Measure.ae_prod_iff_ae_ae (measurableSet_le measurable_const hmeas)).2 filter_upwards [hsupp_ae] with θ hθ exact ae_of_all Q fun x => hnonneg θ hθ x have hjoint : Integrable (fun p : ℝ × X => likelihood p.1 p.2) (π.prod Q) := by refine ⟨hmeas.aestronglyMeasurable, ?_⟩ apply (hasFiniteIntegral_iff_ofReal hnonneg_ae).2 rw [lintegral_prod _ hmeas.ennreal_ofReal.aemeasurable] rw [lintegral_congr_ae hfiber] simp have hsections : ∀ᵐ x ∂Q, Integrable (fun θ => likelihood θ x) π := hjoint.prod_left_ae have haverage : ∀ᵐ x ∂Q, ofReal (mixtureLikelihood π likelihood x) = ∫⁻ θ, ofReal (likelihood θ x) ∂π := by filter_upwards [hsections] with x hx apply ofReal_integral_eq_lintegral_ofReal hx filter_upwards [hsupp_ae] with θ hθ exact hnonneg θ hθ x refine Measure.ext fun A hA => ?_ rw [priorPredictive_apply π K hA, withDensity_apply _ hA] calc ∫⁻ θ, K θ A ∂π = ∫⁻ θ, ∫⁻ x in A, ofReal (likelihood θ x) ∂Q ∂π := by apply lintegral_congr_ae filter_upwards [hsupp_ae] with θ hθ rw [hdensity θ hθ, withDensity_apply _ hA] _ = ∫⁻ x in A, ∫⁻ θ, ofReal (likelihood θ x) ∂π ∂Q := by apply lintegral_lintegral_swap exact hmeas.ennreal_ofReal.aemeasurable _ = ∫⁻ x in A, ofReal (mixtureLikelihood π likelihood x) ∂Q := by apply lintegral_congr_ae filter_upwards [ae_restrict_of_ae haverage] with x hx exact hx.symm
    Causalean.Stat.Minimax.MomentMatchedMixture.priorPredictive_eq_withDensity_mixtureLikelihood_of_supported · Causalean/Stat/Minimax/MomentMatchedMixture/SupportLocalized.lean:91
  • priorPredictive_absolutelyContinuous_of_supported theorem — The predictive law obtained by averaging a probability prior through an experiment kernel is absolutely continuous with respect to a common measure when the prior is supported on the interval of parameters with absolute value at most the chosen radius and, on that interval, the likelihood family represents every kernel fibre as a density relative to the common measure.
    X :
    Type u_1
    shared
    π :
    K :
    Kernel ℝ X
    Q :
    likelihood :
    ℝ → X → ℝ
    a :
    hsupp :
    π {θ | |θ| ≤ a} = 1
    hdensity :
    ∀ θ
    if
    |θ| ≤ a
    then
    K θ = Q.withDensity fun x => ofReal (likelihood θ x)
    priorPredictive π K ≪ Q
    Proof (Lean source)
    theorem priorPredictive_absolutelyContinuous_of_supported (π : Measure ℝ) (K : Kernel ℝ X) (Q : Measure X) (likelihood : ℝ → X → ℝ) [IsProbabilityMeasure π] (a : ℝ) (hsupp : π {θ | |θ| ≤ a} = 1) (hdensity : ∀ θ, |θ| ≤ a → K θ = Q.withDensity fun x => ofReal (likelihood θ x)) : priorPredictive π K ≪ Q := by refine Measure.AbsolutelyContinuous.mk fun A hA hQA => ?_ rw [priorPredictive_apply π K hA] rw [lintegral_eq_zero_iff (Kernel.measurable_coe K hA)] filter_upwards [ae_abs_le_of_measure_interval_eq_one π a hsupp] with θ hθ change K θ A = 0 rw [hdensity θ hθ] exact withDensity_absolutelyContinuous Q _ hQA
    Causalean.Stat.Minimax.MomentMatchedMixture.priorPredictive_absolutelyContinuous_of_supported · Causalean/Stat/Minimax/MomentMatchedMixture/SupportLocalized.lean:155
  • integrable_mixtureLikelihood_mul_of_supported_exponentialGram theorem — The product of likelihood averages under two probability priors is integrable under the observation law when the priors are supported on the interval of parameters with absolute value at most the chosen radius, the observation law is a probability law, the likelihood is jointly measurable and nonnegative on that interval, and its supported fibres have exponential inner products at a nonnegative interaction scale, with a nonnegative support radius.
    X :
    Type u_1
    shared
    π ρ :
    Q :
    likelihood :
    ℝ → X → ℝ
    lambda a :
    hlambda :
    0 ≤ lambda
    ha :
    0 ≤ a
    hmeas :
    Measurable fun p : ℝ × X => likelihood p.1 p.2
    hnonneg :
    ∀ θ
    if
    |θ| ≤ a
    then
    ∀ x, 0 ≤ likelihood θ x
    hinner :
    ∀ θ,
    |θ|
    ≤ a → ∀ θ', |θ'| ≤ a → ∫ x, likelihood θ x * likelihood θ' x ∂Q = exp (lambda * θ * θ')
    hsuppπ :
    π {θ | |θ| ≤ a} = 1
    hsuppρ :
    ρ {θ | |θ| ≤ a} = 1
    Integrable (fun x => mixtureLikelihood π likelihood x * mixtureLikelihood ρ likelihood x) Q
    Proof (Lean source)
    theorem integrable_mixtureLikelihood_mul_of_supported_exponentialGram (π ρ : Measure ℝ) (Q : Measure X) (likelihood : ℝ → X → ℝ) [IsProbabilityMeasure π] [IsProbabilityMeasure ρ] [IsProbabilityMeasure Q] (lambda a : ℝ) (hlambda : 0 ≤ lambda) (ha : 0 ≤ a) (hmeas : Measurable fun p : ℝ × X => likelihood p.1 p.2) (hnonneg : ∀ θ, |θ| ≤ a → ∀ x, 0 ≤ likelihood θ x) (hinner : ∀ θ, |θ| ≤ a → ∀ θ', |θ'| ≤ a → ∫ x, likelihood θ x * likelihood θ' x ∂Q = exp (lambda * θ * θ')) (hsuppπ : π {θ | |θ| ≤ a} = 1) (hsuppρ : ρ {θ | |θ| ≤ a} = 1) : Integrable (fun x => mixtureLikelihood π likelihood x * mixtureLikelihood ρ likelihood x) Q := by exact (supported_cross_integrable_and_eq π ρ Q likelihood lambda a hlambda ha hmeas hnonneg hinner hsuppπ hsuppρ).1
    Causalean.Stat.Minimax.MomentMatchedMixture.integrable_mixtureLikelihood_mul_of_supported_exponentialGram · Causalean/Stat/Minimax/MomentMatchedMixture/SupportLocalized.lean:274
  • integral_sq_mixtureLikelihood_sub_eq_exponentialPriorEnergy_of_supported theorem — The integrated squared difference between likelihood averages under two probability priors equals the alternating sum of their four exponential prior energies when the priors are supported on the interval of parameters with absolute value at most the chosen radius, the observation law is a probability law, the likelihood is jointly measurable and nonnegative on that interval, and supported fibres have exponential inner products at a nonnegative interaction scale, with a nonnegative support radius.
    X :
    Type u_1
    shared
    π0 π1 :
    Q :
    likelihood :
    ℝ → X → ℝ
    lambda a :
    hlambda :
    0 ≤ lambda
    ha :
    0 ≤ a
    hmeas :
    Measurable fun p : ℝ × X => likelihood p.1 p.2
    hnonneg :
    ∀ θ
    if
    |θ| ≤ a
    then
    ∀ x, 0 ≤ likelihood θ x
    hinner :
    ∀ θ,
    |θ|
    ≤ a → ∀ θ', |θ'| ≤ a → ∫ x, likelihood θ x * likelihood θ' x ∂Q = exp (lambda * θ * θ')
    hsupp0 :
    π0 {θ | |θ| ≤ a} = 1
    hsupp1 :
    π1 {θ | |θ| ≤ a} = 1
    ∫ x, (mixtureLikelihood π0 likelihood x - mixtureLikelihood π1 likelihood x) ^ 2 ∂Q
    = exponentialPriorEnergy π0 π0 lambda
    - exponentialPriorEnergy π0 π1 lambda
    - exponentialPriorEnergy π1 π0 lambda
    + exponentialPriorEnergy π1 π1 lambda
    Proof (Lean source)
    theorem integral_sq_mixtureLikelihood_sub_eq_exponentialPriorEnergy_of_supported (π0 π1 : Measure ℝ) (Q : Measure X) (likelihood : ℝ → X → ℝ) [IsProbabilityMeasure π0] [IsProbabilityMeasure π1] [IsProbabilityMeasure Q] (lambda a : ℝ) (hlambda : 0 ≤ lambda) (ha : 0 ≤ a) (hmeas : Measurable fun p : ℝ × X => likelihood p.1 p.2) (hnonneg : ∀ θ, |θ| ≤ a → ∀ x, 0 ≤ likelihood θ x) (hinner : ∀ θ, |θ| ≤ a → ∀ θ', |θ'| ≤ a → ∫ x, likelihood θ x * likelihood θ' x ∂Q = exp (lambda * θ * θ')) (hsupp0 : π0 {θ | |θ| ≤ a} = 1) (hsupp1 : π1 {θ | |θ| ≤ a} = 1) : ∫ x, (mixtureLikelihood π0 likelihood x - mixtureLikelihood π1 likelihood x) ^ 2 ∂Q = exponentialPriorEnergy π0 π0 lambda - exponentialPriorEnergy π0 π1 lambda - exponentialPriorEnergy π1 π0 lambda + exponentialPriorEnergy π1 π1 lambda := by obtain ⟨h00i, h00⟩ := supported_cross_integrable_and_eq π0 π0 Q likelihood lambda a hlambda ha hmeas hnonneg hinner hsupp0 hsupp0 obtain ⟨h01i, h01⟩ := supported_cross_integrable_and_eq π0 π1 Q likelihood lambda a hlambda ha hmeas hnonneg hinner hsupp0 hsupp1 obtain ⟨h10i, h10⟩ := supported_cross_integrable_and_eq π1 π0 Q likelihood lambda a hlambda ha hmeas hnonneg hinner hsupp1 hsupp0 obtain ⟨h11i, h11⟩ := supported_cross_integrable_and_eq π1 π1 Q likelihood lambda a hlambda ha hmeas hnonneg hinner hsupp1 hsupp1 have hsq : (fun x => (mixtureLikelihood π0 likelihood x - mixtureLikelihood π1 likelihood x) ^ 2) = fun x => mixtureLikelihood π0 likelihood x * mixtureLikelihood π0 likelihood x - mixtureLikelihood π0 likelihood x * mixtureLikelihood π1 likelihood x - mixtureLikelihood π1 likelihood x * mixtureLikelihood π0 likelihood x + mixtureLikelihood π1 likelihood x * mixtureLikelihood π1 likelihood x := by funext x ring rw [hsq] change ∫ x, (((fun x => mixtureLikelihood π0 likelihood x * mixtureLikelihood π0 likelihood x) - (fun x => mixtureLikelihood π0 likelihood x * mixtureLikelihood π1 likelihood x) - (fun x => mixtureLikelihood π1 likelihood x * mixtureLikelihood π0 likelihood x)) + (fun x => mixtureLikelihood π1 likelihood x * mixtureLikelihood π1 likelihood x)) x ∂Q = _ calc _ = (∫ x, ((fun x => mixtureLikelihood π0 likelihood x * mixtureLikelihood π0 likelihood x) - (fun x => mixtureLikelihood π0 likelihood x * mixtureLikelihood π1 likelihood x) - (fun x => mixtureLikelihood π1 likelihood x * mixtureLikelihood π0 likelihood x)) x ∂Q) + ∫ x, mixtureLikelihood π1 likelihood x * mixtureLikelihood π1 likelihood x ∂Q := integral_add ((h00i.sub h01i).sub h10i) h11i _ = ((∫ x, ((fun x => mixtureLikelihood π0 likelihood x * mixtureLikelihood π0 likelihood x) - (fun x => mixtureLikelihood π0 likelihood x * mixtureLikelihood π1 likelihood x)) x ∂Q) - ∫ x, mixtureLikelihood π1 likelihood x * mixtureLikelihood π0 likelihood x ∂Q) + ∫ x, mixtureLikelihood π1 likelihood x * mixtureLikelihood π1 likelihood x ∂Q := by congr 1 exact integral_sub (h00i.sub h01i) h10i _ = ((∫ x, mixtureLikelihood π0 likelihood x * mixtureLikelihood π0 likelihood x ∂Q) - ∫ x, mixtureLikelihood π0 likelihood x * mixtureLikelihood π1 likelihood x ∂Q - ∫ x, mixtureLikelihood π1 likelihood x * mixtureLikelihood π0 likelihood x ∂Q) + ∫ x, mixtureLikelihood π1 likelihood x * mixtureLikelihood π1 likelihood x ∂Q := by congr 2 exact integral_sub h00i h01i _ = _ := by rw [h00, h01, h10, h11]
    Causalean.Stat.Minimax.MomentMatchedMixture.integral_sq_mixtureLikelihood_sub_eq_exponentialPriorEnergy_of_supported · Causalean/Stat/Minimax/MomentMatchedMixture/SupportLocalized.lean:295
  • integral_sq_mixtureLikelihood_sub_le_tail_of_supported theorem — The integrated squared difference between likelihood averages under two probability priors is at most four times the unmatched exponential-series tail when their moments agree through the chosen degree, the priors are supported on the interval of parameters with absolute value at most the chosen radius, the observation law is a probability law, the likelihood is jointly measurable and nonnegative on that interval, and supported fibres have exponential inner products at a nonnegative interaction scale, with a nonnegative support radius.
    X :
    Type u_1
    shared
    π0 π1 :
    Q :
    likelihood :
    ℝ → X → ℝ
    lambda a :
    degree :
    hlambda :
    0 ≤ lambda
    ha :
    0 ≤ a
    hmeas :
    Measurable fun p : ℝ × X => likelihood p.1 p.2
    hnonneg :
    ∀ θ
    if
    |θ| ≤ a
    then
    ∀ x, 0 ≤ likelihood θ x
    hinner :
    ∀ θ,
    |θ|
    ≤ a → ∀ θ', |θ'| ≤ a → ∫ x, likelihood θ x * likelihood θ' x ∂Q = exp (lambda * θ * θ')
    hsupp0 :
    π0 {θ | |θ| ≤ a} = 1
    hsupp1 :
    π1 {θ | |θ| ≤ a} = 1
    hmom :
    ∀ n ≤ degree, ∫ θ, θ ^ n ∂π0 = ∫ θ, θ ^ n ∂π1
    ∫ x, (mixtureLikelihood π0 likelihood x - mixtureLikelihood π1 likelihood x) ^ 2 ∂Q
    ≤ 4 * exponentialSeriesTail degree (lambda * a ^ 2)
    Proof (Lean source)
    theorem integral_sq_mixtureLikelihood_sub_le_tail_of_supported (π0 π1 : Measure ℝ) (Q : Measure X) (likelihood : ℝ → X → ℝ) [IsProbabilityMeasure π0] [IsProbabilityMeasure π1] [IsProbabilityMeasure Q] (lambda a : ℝ) (degree : ℕ) (hlambda : 0 ≤ lambda) (ha : 0 ≤ a) (hmeas : Measurable fun p : ℝ × X => likelihood p.1 p.2) (hnonneg : ∀ θ, |θ| ≤ a → ∀ x, 0 ≤ likelihood θ x) (hinner : ∀ θ, |θ| ≤ a → ∀ θ', |θ'| ≤ a → ∫ x, likelihood θ x * likelihood θ' x ∂Q = exp (lambda * θ * θ')) (hsupp0 : π0 {θ | |θ| ≤ a} = 1) (hsupp1 : π1 {θ | |θ| ≤ a} = 1) (hmom : ∀ n ≤ degree, ∫ θ, θ ^ n ∂π0 = ∫ θ, θ ^ n ∂π1) : ∫ x, (mixtureLikelihood π0 likelihood x - mixtureLikelihood π1 likelihood x) ^ 2 ∂Q ≤ 4 * exponentialSeriesTail degree (lambda * a ^ 2) := by rw [integral_sq_mixtureLikelihood_sub_eq_exponentialPriorEnergy_of_supported π0 π1 Q likelihood lambda a hlambda ha hmeas hnonneg hinner hsupp0 hsupp1] exact exponentialPriorEnergy_quadratic_le_tail π0 π1 lambda a degree hlambda ha hsupp0 hsupp1 hmom
    Causalean.Stat.Minimax.MomentMatchedMixture.integral_sq_mixtureLikelihood_sub_le_tail_of_supported · Causalean/Stat/Minimax/MomentMatchedMixture/SupportLocalized.lean:355
  • momentMatchedMixture_tv_le_sqrt_tail_of_supported theorem — The predictive laws formed from two probability priors and an experiment kernel with probability fibres are within the square root of the unmatched exponential-series tail in total variation when their moments agree through the chosen degree, the priors are supported on the interval of parameters with absolute value at most the chosen radius, the common dominating observation law is a probability law, and the likelihood family is jointly measurable while only on that interval it is nonnegative, represents the kernel densities, and has exponential inner products at a nonnegative interaction scale, with a nonnegative support radius.
    X :
    Type u_1
    shared
    π0 π1 :
    K :
    Kernel ℝ X
    Q :
    likelihood :
    ℝ → X → ℝ
    hK :
    ∀ θ, IsProbabilityMeasure (K θ)
    lambda a :
    degree :
    hlambda :
    0 ≤ lambda
    ha :
    0 ≤ a
    hmeas :
    Measurable fun p : ℝ × X => likelihood p.1 p.2
    hnonneg :
    ∀ θ
    if
    |θ| ≤ a
    then
    ∀ x, 0 ≤ likelihood θ x
    hdensity :
    ∀ θ
    if
    |θ| ≤ a
    then
    K θ = Q.withDensity fun x => ofReal (likelihood θ x)
    hinner :
    ∀ θ,
    |θ|
    ≤ a → ∀ θ', |θ'| ≤ a → ∫ x, likelihood θ x * likelihood θ' x ∂Q = exp (lambda * θ * θ')
    hsupp0 :
    π0 {θ | |θ| ≤ a} = 1
    hsupp1 :
    π1 {θ | |θ| ≤ a} = 1
    hmom :
    ∀ n ≤ degree, ∫ θ, θ ^ n ∂π0 = ∫ θ, θ ^ n ∂π1
    sqrt (exponentialSeriesTail degree (lambda * a ^ 2))
    Proof (Lean source)
    theorem momentMatchedMixture_tv_le_sqrt_tail_of_supported (π0 π1 : Measure ℝ) (K : Kernel ℝ X) (Q : Measure X) (likelihood : ℝ → X → ℝ) [IsProbabilityMeasure π0] [IsProbabilityMeasure π1] [IsProbabilityMeasure Q] (hK : ∀ θ, IsProbabilityMeasure (K θ)) (lambda a : ℝ) (degree : ℕ) (hlambda : 0 ≤ lambda) (ha : 0 ≤ a) (hmeas : Measurable fun p : ℝ × X => likelihood p.1 p.2) (hnonneg : ∀ θ, |θ| ≤ a → ∀ x, 0 ≤ likelihood θ x) (hdensity : ∀ θ, |θ| ≤ a → K θ = Q.withDensity fun x => ofReal (likelihood θ x)) (hinner : ∀ θ, |θ| ≤ a → ∀ θ', |θ'| ≤ a → ∫ x, likelihood θ x * likelihood θ' x ∂Q = exp (lambda * θ * θ')) (hsupp0 : π0 {θ | |θ| ≤ a} = 1) (hsupp1 : π1 {θ | |θ| ≤ a} = 1) (hmom : ∀ n ≤ degree, ∫ θ, θ ^ n ∂π0 = ∫ θ, θ ^ n ∂π1) : tvDist (priorPredictive π0 K) (priorPredictive π1 K) ≤ sqrt (exponentialSeriesTail degree (lambda * a ^ 2)) := by have hpred (π : Measure ℝ) [IsProbabilityMeasure π] (hsupp : π {θ | |θ| ≤ a} = 1) : priorPredictive π K = Q.withDensity fun x => ofReal (mixtureLikelihood π likelihood x) := priorPredictive_eq_withDensity_mixtureLikelihood_of_supported π K Q likelihood hK a hsupp hmeas hnonneg hdensity have hmix_meas (π : Measure ℝ) [IsProbabilityMeasure π] : Measurable (mixtureLikelihood π likelihood) := measurable_mixtureLikelihood π likelihood hmeas have hmix_nonneg (π : Measure ℝ) [IsProbabilityMeasure π] (hsupp : π {θ | |θ| ≤ a} = 1) (x : X) : 0 ≤ mixtureLikelihood π likelihood x := mixtureLikelihood_nonnegative_of_supported π likelihood a hsupp hnonneg x have hsq0 : Integrable (fun x => mixtureLikelihood π0 likelihood x * mixtureLikelihood π0 likelihood x) Q := integrable_mixtureLikelihood_mul_of_supported_exponentialGram π0 π0 Q likelihood lambda a hlambda ha hmeas hnonneg hinner hsupp0 hsupp0 have hsq1 : Integrable (fun x => mixtureLikelihood π1 likelihood x * mixtureLikelihood π1 likelihood x) Q := integrable_mixtureLikelihood_mul_of_supported_exponentialGram π1 π1 Q likelihood lambda a hlambda ha hmeas hnonneg hinner hsupp1 hsupp1 have hmajorant : Integrable (fun x => 2 * (mixtureLikelihood π0 likelihood x * mixtureLikelihood π0 likelihood x + mixtureLikelihood π1 likelihood x * mixtureLikelihood π1 likelihood x)) Q := (hsq0.add hsq1).const_mul 2 have hdiff_sq : Integrable (fun x => (mixtureLikelihood π0 likelihood x - mixtureLikelihood π1 likelihood x) ^ 2) Q := by apply hmajorant.mono' ((hmix_meas π0).sub (hmix_meas π1) |>.pow_const 2).aestronglyMeasurable filter_upwards with x rw [Real.norm_eq_abs, abs_of_nonneg (sq_nonneg _)] simp only [Pi.sub_apply] nlinarith [sq_nonneg (mixtureLikelihood π0 likelihood x + mixtureLikelihood π1 likelihood x)] let t := exponentialSeriesTail degree (lambda * a ^ 2) have ht : 0 ≤ t := by unfold t exponentialSeriesTail apply tsum_nonneg intro n by_cases hn : degree < n · simp only [if_pos hn] positivity · simp only [if_neg hn] exact le_rfl letI : IsProbabilityMeasure (priorPredictive π0 K) := priorPredictive_isProbability π0 K hK letI : IsProbabilityMeasure (priorPredictive π1 K) := priorPredictive_isProbability π1 K hK have htv := tvDist_le_half_sqrt_integral_sq_density_sub (priorPredictive π0 K) (priorPredictive π1 K) Q (mixtureLikelihood π0 likelihood) (mixtureLikelihood π1 likelihood) (hmix_meas π0) (hmix_meas π1) (hmix_nonneg π0 hsupp0) (hmix_nonneg π1 hsupp1) (hpred π0 hsupp0) (hpred π1 hsupp1) hdiff_sq have htail := integral_sq_mixtureLikelihood_sub_le_tail_of_supported π0 π1 Q likelihood lambda a degree hlambda ha hmeas hnonneg hinner hsupp0 hsupp1 hmom change _ ≤ sqrt t calc tvDist (priorPredictive π0 K) (priorPredictive π1 K) ≤ (1 / 2 : ℝ) * sqrt (∫ x, (mixtureLikelihood π0 likelihood x - mixtureLikelihood π1 likelihood x) ^ 2 ∂Q) := htv _ ≤ (1 / 2 : ℝ) * sqrt (4 * t) := by gcongr _ = sqrt t := by rw [Real.sqrt_mul (by norm_num : (0 : ℝ) ≤ 4)] rw [show sqrt 4 = 2 by rw [show (4 : ℝ) = 2 ^ 2 by norm_num, Real.sqrt_sq (by norm_num)]] ring
    Causalean.Stat.Minimax.MomentMatchedMixture.momentMatchedMixture_tv_le_sqrt_tail_of_supported · Causalean/Stat/Minimax/MomentMatchedMixture/SupportLocalized.lean:380