Stat.Minimax.MomentMatchedMixture
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
ExponentialEnergy 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.
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)
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)
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).
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
Proof (Lean source)
2 supporting declarations (lemmas, instances)
-
abs_priorMoment_le_pow_of_supportedtheorem — 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.hypothesesconclusion|priorMoment π n| ≤ a ^ nProof (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) -
exponentialPriorEnergy_quadratic_eq_tsumtheorem — 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.hypothesesπ0 π1 :lambda a :ℝhlambda :0 ≤ lambdaha :0 ≤ ahsupp0 :π0 {θ | |θ| ≤ a} = 1hsupp1 :π1 {θ | |θ| ≤ a} = 1conclusionexponentialPriorEnergy π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) ^ 2Proof (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
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.
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)
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
Proof (Lean source)
5 supporting declarations (lemmas, instances)
-
priorPredictive_eq_withDensity_mixtureLikelihoodtheorem — 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.hypothesesX :sharedType u_1π :Measure ℝK :Kernel ℝ XQ :Measure Xlikelihood :ℝ → X → ℝhK :∀ θ, IsProbabilityMeasure (K θ)hmeas :Measurable fun p : ℝ × X => likelihood p.1 p.2hnonneg :∀ θ x, 0 ≤ likelihood θ xhdensity :∀ θ, K θ = Q.withDensity fun x => ofReal (likelihood θ x)conclusionpriorPredictive π K= 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 -
integral_sq_mixtureLikelihood_sub_eq_exponentialPriorEnergytheorem — 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.hypothesesX :sharedType u_1π0 π1 :Measure ℝQ :Measure Xlikelihood :ℝ → X → ℝlambda a :ℝhlambda :0 ≤ lambdaha :0 ≤ ahmeas :Measurable fun p : ℝ × X => likelihood p.1 p.2hnonneg :∀ θ x, 0 ≤ likelihood θ xhinner :∀ θ θ', ∫ x, likelihood θ x * likelihood θ' x ∂Q = exp (lambda * θ * θ')hsupp0 :π0 {θ | |θ| ≤ a} = 1hsupp1 :π1 {θ | |θ| ≤ a} = 1conclusion∫ 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 lambdaProof (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] -
integral_sq_mixtureLikelihood_sub_le_tailtheorem — 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.hypothesesX :sharedType u_1π0 π1 :Measure ℝQ :Measure Xlikelihood :ℝ → X → ℝlambda a :ℝdegree :ℕhlambda :0 ≤ lambdaha :0 ≤ ahmeas :Measurable fun p : ℝ × X => likelihood p.1 p.2hnonneg :∀ θ x, 0 ≤ likelihood θ xhinner :∀ θ θ', ∫ x, likelihood θ x * likelihood θ' x ∂Q = exp (lambda * θ * θ')hsupp0 :π0 {θ | |θ| ≤ a} = 1hsupp1 :π1 {θ | |θ| ≤ a} = 1hmom :∀ n ≤ degree, ∫ θ, θ ^ n ∂π0 = ∫ θ, θ ^ n ∂π1conclusion∫ 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 -
priorPredictive_absolutelyContinuoustheorem — 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.hypothesesX :sharedType u_1π :Measure ℝK :Kernel ℝ XQ :Measure Xlikelihood :ℝ → X → ℝhmeas :Measurable fun p : ℝ × X => likelihood p.1 p.2hnonneg :∀ θ x, 0 ≤ likelihood θ xhdensity :∀ θ, K θ = Q.withDensity fun x => ofReal (likelihood θ x)conclusionpriorPredictive π K ≪ QProof (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 -
tvDist_le_half_sqrt_integral_sq_density_subtheorem — 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.hypothesesX :sharedType u_1μ ν Q :Measure Xp q :X → ℝhpmeas :hqmeas :hpnonneg :∀ x, 0 ≤ p xhqnonneg :∀ x, 0 ≤ q xhμ :μ = Q.withDensity fun x => ofReal (p x)hν :ν = Q.withDensity fun x => ofReal (q x)hint :Integrable (fun x => (p x - q x) ^ 2) QProof (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))
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.
Given a dimension and a scalar prior, the independent coordinate prior is the finite product of that prior across all coordinates.
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.
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
Proof (Lean source)
5 supporting declarations (lemmas, instances)
-
productPriorPredictive_isProbabilitytheorem — Given a dimension, a probability prior, and an experiment kernel whose component laws are probability laws, the independent coordinate prior-predictive law is a probability law.hypothesesconclusionProof (Lean source)
theorem productPriorPredictive_isProbability (d : ℕ) (π : Measure ℝ) (K : Kernel ℝ X) [IsProbabilityMeasure π] (hK : ∀ θ, IsProbabilityMeasure (K θ)) : IsProbabilityMeasure (productPriorPredictive d π K) := by change IsProbabilityMeasure (Measure.pi fun _ : Fin d => priorPredictive π K) exact @Measure.pi.instIsProbabilityMeasure (Fin d) (fun _ => X) inferInstance (fun _ => inferInstance) _ (fun _ => priorPredictive_isProbability π K hK) -
priorPredictive_productPrior_apply_pitheorem — Given a dimension, a probability prior, a one-coordinate experiment kernel with probability component laws, and a product experiment kernel whose fibres are the coordinatewise product laws, the mixture mass of a coordinate rectangle factors into the product of the one-coordinate predictive masses.hypothesesX :sharedType u_1d :ℕπ :Measure ℝK :Kernel ℝ XhK :∀ θ, IsProbabilityMeasure (K θ)hfiber :∀ θ, productKernel θ = Measure.pi fun i : Fin d => K (θ i)hs :∀ i, MeasurableSet (s i)conclusion= ∏ i, priorPredictive π K (s i)Proof (Lean source)
theorem priorPredictive_productPrior_apply_pi (d : ℕ) (π : Measure ℝ) (K : Kernel ℝ X) (productKernel : Kernel (Fin d → ℝ) (Fin d → X)) [IsProbabilityMeasure π] (hK : ∀ θ, IsProbabilityMeasure (K θ)) (hfiber : ∀ θ, productKernel θ = Measure.pi fun i : Fin d => K (θ i)) (s : Fin d → Set X) (hs : ∀ i, MeasurableSet (s i)) : priorPredictive (productPrior d π) productKernel (pi univ s) = ∏ i, priorPredictive π K (s i) := by rw [priorPredictive_apply _ _ (by exact MeasurableSet.pi Set.countable_univ fun i _ => hs i)] simp_rw [hfiber, Measure.pi_pi] letI : IsProbabilityMeasure (priorPredictive π K) := priorPredictive_isProbability π K hK have hprodPrior : IsProbabilityMeasure (productPrior d π) := by unfold productPrior exact @Measure.pi.instIsProbabilityMeasure (Fin d) (fun _ => ℝ) inferInstance (fun _ => inferInstance) _ (fun _ => inferInstance) letI : IsProbabilityMeasure (productPrior d π) := hprodPrior have hcoord_le (i : Fin d) (x : ℝ) : K x (s i) ≤ 1 := by letI : IsProbabilityMeasure (K x) := hK x exact (measure_mono (Set.subset_univ _)).trans_eq measure_univ have hfun_meas (i : Fin d) : Measurable fun x => K x (s i) := K.measurable_coe (hs i) have hfun_top (i : Fin d) : ∀ x, K x (s i) < ⊤ := fun x => by letI : IsProbabilityMeasure (K x) := hK x exact measure_lt_top _ _ have hprod_meas : Measurable (fun θ : Fin d → ℝ => ∏ i, K (θ i) (s i)) := by exact Finset.univ.measurable_prod fun i _ => (hfun_meas i).comp (measurable_pi_apply i) have hprod_top : ∀ θ : Fin d → ℝ, (∏ i, K (θ i) (s i)) < ⊤ := fun θ => ENNReal.prod_lt_top fun i _ => hfun_top i (θ i) have hlhs_ne : (∫⁻ (θ : Fin d → ℝ), ∏ i, K (θ i) (s i) ∂productPrior d π) ≠ ⊤ := by apply ne_of_lt refine (lintegral_le_const (c := 1) ?_).trans_lt ENNReal.one_lt_top exact Filter.Eventually.of_forall fun θ => Finset.prod_le_one' fun i _ => hcoord_le i (θ i) have hrhs_ne : (∏ i, priorPredictive π K (s i)) ≠ ⊤ := (ENNReal.prod_lt_top fun i _ => measure_lt_top _ _).ne have hfactor : (∫ θ : Fin d → ℝ, ∏ i, (K (θ i) (s i)).toReal ∂productPrior d π) = ∏ i, ∫ x, (K x (s i)).toReal ∂π := by unfold productPrior exact integral_fintype_prod_eq_prod (fun i x => (K x (s i)).toReal) have hcoord_int (i : Fin d) : (∫ x, (K x (s i)).toReal ∂π) = (priorPredictive π K (s i)).toReal := by rw [priorPredictive_apply _ _ (hs i)] exact integral_toReal (hfun_meas i).aemeasurable (Filter.Eventually.of_forall (hfun_top i)) apply (ENNReal.toReal_eq_toReal_iff' hlhs_ne hrhs_ne).mp rw [← integral_toReal hprod_meas.aemeasurable (Filter.Eventually.of_forall hprod_top)] simp_rw [ENNReal.toReal_prod] rw [hfactor] exact Finset.prod_congr rfl fun i _ => hcoord_int i -
priorPredictive_productPrior_eq_productPriorPredictivetheorem — Given a dimension, a probability prior, a one-coordinate experiment kernel with probability component laws, and a product experiment kernel whose fibres are the coordinatewise product laws, mixing the product experiment against the product prior equals the product of the one-coordinate prior-predictive mixtures.hypothesesX :sharedType u_1d :ℕπ :Measure ℝK :Kernel ℝ XhK :∀ θ, IsProbabilityMeasure (K θ)hfiber :∀ θ, productKernel θ = Measure.pi fun i : Fin d => K (θ i)conclusionProof (Lean source)
theorem priorPredictive_productPrior_eq_productPriorPredictive (d : ℕ) (π : Measure ℝ) (K : Kernel ℝ X) (productKernel : Kernel (Fin d → ℝ) (Fin d → X)) [IsProbabilityMeasure π] (hK : ∀ θ, IsProbabilityMeasure (K θ)) (hfiber : ∀ θ, productKernel θ = Measure.pi fun i : Fin d => K (θ i)) : priorPredictive (productPrior d π) productKernel = productPriorPredictive d π K := by -- Extensionality on measurable rectangles reduces both sides via `Measure.pi_pi`. -- On the left use `priorPredictive_apply` and `hfiber`; the remaining integral of -- the finite product of coordinate functions factors under `productPrior`. -- Treat `d = 0` explicitly if the finite-product integration API does so. letI : IsProbabilityMeasure (priorPredictive π K) := priorPredictive_isProbability π K hK unfold productPriorPredictive refine (Measure.pi_eq fun s hs => ?_).symm exact priorPredictive_productPrior_apply_pi d π K productKernel hK hfiber s hs -
tvDist_prod_le_addtheorem — Given two probability laws on one coordinate and two probability laws on a second coordinate, the total variation distance between the binary product laws is at most the sum of the two coordinatewise distances.Proof (Lean source)
theorem tvDist_prod_le_add {Y : Type*} [MeasurableSpace Y] (μ0 μ1 : Measure X) (ν0 ν1 : Measure Y) [IsProbabilityMeasure μ0] [IsProbabilityMeasure μ1] [IsProbabilityMeasure ν0] [IsProbabilityMeasure ν1] : tvDist (μ0.prod ν0) (μ1.prod ν1) ≤ tvDist μ0 μ1 + tvDist ν0 ν1 := by unfold tvDist refine ciSup_le fun A => ?_ have hprodReal (μ : Measure X) (ν : Measure Y) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] : (μ.prod ν).real A.1 = ∫ x, ν.real (Prod.mk x ⁻¹' A.1) ∂μ := by rw [measureReal_def, Measure.prod_apply A.2] symm exact integral_toReal (measurable_measure_prodMk_left A.2).aemeasurable (Filter.Eventually.of_forall fun x => measure_lt_top ν _) have hmeas0 : Measurable fun x => ν0.real (Prod.mk x ⁻¹' A.1) := (measurable_measure_prodMk_left A.2).ennreal_toReal have houter : |(∫ x, ν0.real (Prod.mk x ⁻¹' A.1) ∂μ0) - ∫ x, ν0.real (Prod.mk x ⁻¹' A.1) ∂μ1| ≤ tvDist μ0 μ1 := by simpa using tvDist_integral_range μ0 μ1 (fun x => ν0.real (Prod.mk x ⁻¹' A.1)) hmeas0 0 1 zero_le_one (fun x => ⟨measureReal_nonneg, by simpa only [zero_add] using (measureReal_le_one : ν0.real (Prod.mk x ⁻¹' A.1) ≤ 1)⟩) have hf0int : Integrable (fun x => ν0.real (Prod.mk x ⁻¹' A.1)) μ1 := Measure.integrable_measure_prodMk_left A.2 (measure_ne_top _ _) have hf1int : Integrable (fun x => ν1.real (Prod.mk x ⁻¹' A.1)) μ1 := Measure.integrable_measure_prodMk_left A.2 (measure_ne_top _ _) have hinner : |(∫ x, ν0.real (Prod.mk x ⁻¹' A.1) ∂μ1) - ∫ x, ν1.real (Prod.mk x ⁻¹' A.1) ∂μ1| ≤ tvDist ν0 ν1 := by rw [← integral_sub hf0int hf1int] have hnorm := norm_setIntegral_le_of_norm_le_const_ae (μ := μ1) (s := univ) (C := tvDist ν0 ν1) (measure_lt_top μ1 univ) (Filter.Eventually.of_forall fun x => by rw [Real.norm_eq_abs] exact abs_measureReal_sub_le_tvDist (μ := ν0) (ν := ν1) (A := Prod.mk x ⁻¹' A.1) (A.2.preimage (measurable_prodMk_left (x := x)))) simpa [Real.norm_eq_abs, probReal_univ] using hnorm rw [hprodReal μ0 ν0, hprodReal μ1 ν1] calc |(∫ x, ν0.real (Prod.mk x ⁻¹' A.1) ∂μ0) - ∫ x, ν1.real (Prod.mk x ⁻¹' A.1) ∂μ1| = |((∫ x, ν0.real (Prod.mk x ⁻¹' A.1) ∂μ0) - ∫ x, ν0.real (Prod.mk x ⁻¹' A.1) ∂μ1) + ((∫ x, ν0.real (Prod.mk x ⁻¹' A.1) ∂μ1) - ∫ x, ν1.real (Prod.mk x ⁻¹' A.1) ∂μ1)| := by congr 1 ring _ ≤ |(∫ x, ν0.real (Prod.mk x ⁻¹' A.1) ∂μ0) - ∫ x, ν0.real (Prod.mk x ⁻¹' A.1) ∂μ1| + |(∫ x, ν0.real (Prod.mk x ⁻¹' A.1) ∂μ1) - ∫ x, ν1.real (Prod.mk x ⁻¹' A.1) ∂μ1| := abs_add_le _ _ _ ≤ tvDist μ0 μ1 + tvDist ν0 ν1 := add_le_add houter hinner -
tvDist_pi_iid_letheorem — Given a number of coordinates and two one-coordinate probability laws, the total variation distance between their finite independent product laws is at most the number of coordinates times their one-coordinate distance.hypothesesProof (Lean source)
theorem tvDist_pi_iid_le (d : ℕ) (μ ν : Measure X) [IsProbabilityMeasure μ] [IsProbabilityMeasure ν] : tvDist (Measure.pi fun _ : Fin d => μ) (Measure.pi fun _ : Fin d => ν) ≤ d * tvDist μ ν := by induction d with | zero => rw [Measure.pi_of_empty, Measure.pi_of_empty] simp [tvDist] | succ n ih => let e : ((i : Fin (n + 1)) → X) ≃ᵐ X × ((j : Fin n) → X) := MeasurableEquiv.piFinSuccAbove (fun _ : Fin (n + 1) => X) 0 let ρ := Measure.pi (fun _ : Fin (n + 1) => μ) let σ := Measure.pi (fun _ : Fin (n + 1) => ν) have hmap_eq : tvDist (ρ.map e) (σ.map e) = tvDist ρ σ := by letI : IsProbabilityMeasure (ρ.map e) := Measure.isProbabilityMeasure_map e.measurable.aemeasurable letI : IsProbabilityMeasure (σ.map e) := Measure.isProbabilityMeasure_map e.measurable.aemeasurable apply le_antisymm · unfold tvDist refine ciSup_le fun A => ?_ rw [Measure.real, Measure.real, Measure.map_apply e.measurable A.2, Measure.map_apply e.measurable A.2] exact abs_measureReal_sub_le_tvDist (A.2.preimage e.measurable) · unfold tvDist refine ciSup_le fun A => ?_ have hB : MeasurableSet (e.symm ⁻¹' A.1) := A.2.preimage e.symm.measurable have hle := abs_measureReal_sub_le_tvDist (μ := ρ.map e) (ν := σ.map e) hB rw [Measure.real, Measure.real, Measure.map_apply e.measurable hB, Measure.map_apply e.measurable hB] at hle have hpre : e ⁻¹' (e.symm ⁻¹' A.1) = A.1 := by ext x simp rw [hpre] at hle exact hle have hμ : Measure.map e (Measure.pi (fun _ : Fin (n + 1) => μ)) = μ.prod (Measure.pi (fun _ : Fin n => μ)) := by simpa [e] using (measurePreserving_piFinSuccAbove (μ := fun _ : Fin (n + 1) => μ) (0 : Fin (n + 1))).map_eq have hν : Measure.map e (Measure.pi (fun _ : Fin (n + 1) => ν)) = ν.prod (Measure.pi (fun _ : Fin n => ν)) := by simpa [e] using (measurePreserving_piFinSuccAbove (μ := fun _ : Fin (n + 1) => ν) (0 : Fin (n + 1))).map_eq calc tvDist (Measure.pi fun _ : Fin (n + 1) => μ) (Measure.pi fun _ : Fin (n + 1) => ν) = tvDist (Measure.map e (Measure.pi fun _ : Fin (n + 1) => μ)) (Measure.map e (Measure.pi fun _ : Fin (n + 1) => ν)) := by simpa [ρ, σ] using hmap_eq.symm _ = tvDist (μ.prod (Measure.pi fun _ : Fin n => μ)) (ν.prod (Measure.pi fun _ : Fin n => ν)) := by rw [hμ, hν] _ ≤ tvDist μ ν + tvDist (Measure.pi fun _ : Fin n => μ) (Measure.pi fun _ : Fin n => ν) := tvDist_prod_le_add _ _ _ _ _ ≤ tvDist μ ν + n * tvDist μ ν := add_le_add (le_refl _) ih _ = ((n + 1 : ℕ) : ℝ) * tvDist μ ν := by rw [Nat.cast_add, cast_one] ring
SupportLocalized 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.
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
Proof (Lean source)
10 supporting declarations (lemmas, instances)
-
ae_abs_le_of_measure_interval_eq_onetheorem — 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.hypothesesconclusion∀ᵐ θ ∂π, |θ| ≤ aProof (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 -
measurable_mixtureLikelihoodtheorem — 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.hypothesesX :sharedType u_1likelihood :ℝ → X → ℝhmeas :Measurable fun p : ℝ × X => likelihood p.1 p.2conclusionMeasurable (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 -
mixtureLikelihood_nonnegative_of_supportedtheorem — 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.hypothesesX :sharedType u_1π :Measure ℝlikelihood :ℝ → X → ℝa :ℝhsupp :π {θ | |θ| ≤ a} = 1hnonneg :∀ θif|θ| ≤ athen∀ x, 0 ≤ likelihood θ xx :Xconclusion0 ≤ mixtureLikelihood π likelihood xProof (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 -
integrable_mixtureLikelihood_of_supported_densitytheorem — 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.hypothesesX :sharedType u_1π :Measure ℝK :Kernel ℝ XQ :Measure Xlikelihood :ℝ → X → ℝhK :∀ θ, IsProbabilityMeasure (K θ)a :ℝhsupp :π {θ | |θ| ≤ a} = 1hmeas :Measurable fun p : ℝ × X => likelihood p.1 p.2hnonneg :∀ θif|θ| ≤ athen∀ x, 0 ≤ likelihood θ xhdensity :∀ θif|θ| ≤ athenK θ = Q.withDensity fun x => ofReal (likelihood θ x)conclusionIntegrable (mixtureLikelihood π likelihood) QProof (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 -
priorPredictive_eq_withDensity_mixtureLikelihood_of_supportedtheorem — 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.hypothesesX :sharedType u_1π :Measure ℝK :Kernel ℝ XQ :Measure Xlikelihood :ℝ → X → ℝhK :∀ θ, IsProbabilityMeasure (K θ)a :ℝhsupp :π {θ | |θ| ≤ a} = 1hmeas :Measurable fun p : ℝ × X => likelihood p.1 p.2hnonneg :∀ θif|θ| ≤ athen∀ x, 0 ≤ likelihood θ xhdensity :∀ θif|θ| ≤ athenK θ = Q.withDensity fun x => ofReal (likelihood θ x)conclusionpriorPredictive π K= 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 -
priorPredictive_absolutelyContinuous_of_supportedtheorem — 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.hypothesesX :sharedType u_1π :Measure ℝK :Kernel ℝ XQ :Measure Xlikelihood :ℝ → X → ℝa :ℝhsupp :π {θ | |θ| ≤ a} = 1hdensity :∀ θif|θ| ≤ athenK θ = Q.withDensity fun x => ofReal (likelihood θ x)conclusionpriorPredictive π K ≪ QProof (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 -
integrable_mixtureLikelihood_mul_of_supported_exponentialGramtheorem — 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.hypothesesX :sharedType u_1π ρ :Measure ℝQ :Measure Xlikelihood :ℝ → X → ℝlambda a :ℝhlambda :0 ≤ lambdaha :0 ≤ ahmeas :Measurable fun p : ℝ × X => likelihood p.1 p.2hnonneg :∀ θif|θ| ≤ athen∀ x, 0 ≤ likelihood θ xhinner :hsuppπ :π {θ | |θ| ≤ a} = 1hsuppρ :ρ {θ | |θ| ≤ a} = 1conclusionProof (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 -
integral_sq_mixtureLikelihood_sub_eq_exponentialPriorEnergy_of_supportedtheorem — 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.hypothesesX :sharedType u_1π0 π1 :Measure ℝQ :Measure Xlikelihood :ℝ → X → ℝlambda a :ℝhlambda :0 ≤ lambdaha :0 ≤ ahmeas :Measurable fun p : ℝ × X => likelihood p.1 p.2hnonneg :∀ θif|θ| ≤ athen∀ x, 0 ≤ likelihood θ xhinner :hsupp0 :π0 {θ | |θ| ≤ a} = 1hsupp1 :π1 {θ | |θ| ≤ a} = 1conclusion∫ 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 lambdaProof (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] -
integral_sq_mixtureLikelihood_sub_le_tail_of_supportedtheorem — 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.hypothesesX :sharedType u_1π0 π1 :Measure ℝQ :Measure Xlikelihood :ℝ → X → ℝlambda a :ℝdegree :ℕhlambda :0 ≤ lambdaha :0 ≤ ahmeas :Measurable fun p : ℝ × X => likelihood p.1 p.2hnonneg :∀ θif|θ| ≤ athen∀ x, 0 ≤ likelihood θ xhinner :hsupp0 :π0 {θ | |θ| ≤ a} = 1hsupp1 :π1 {θ | |θ| ≤ a} = 1hmom :∀ n ≤ degree, ∫ θ, θ ^ n ∂π0 = ∫ θ, θ ^ n ∂π1conclusion∫ 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 -
momentMatchedMixture_tv_le_sqrt_tail_of_supportedtheorem — 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.hypothesesX :sharedType u_1π0 π1 :Measure ℝK :Kernel ℝ XQ :Measure Xlikelihood :ℝ → X → ℝhK :∀ θ, IsProbabilityMeasure (K θ)lambda a :ℝdegree :ℕhlambda :0 ≤ lambdaha :0 ≤ ahmeas :Measurable fun p : ℝ × X => likelihood p.1 p.2hnonneg :∀ θif|θ| ≤ athen∀ x, 0 ≤ likelihood θ xhdensity :∀ θif|θ| ≤ athenK θ = Q.withDensity fun x => ofReal (likelihood θ x)hinner :hsupp0 :π0 {θ | |θ| ≤ a} = 1hsupp1 :π1 {θ | |θ| ≤ a} = 1hmom :∀ n ≤ degree, ∫ θ, θ ^ n ∂π0 = ∫ θ, θ ^ n ∂π1conclusion≤ 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