Stat.Minimax.Mixture

This file defines finite mixtures of measures with nonnegative extended-real weights.

Moment­Matched 80 core · 88 supporting · 6 submodules The method of two fuzzy hypotheses with moment-matched priors, in a model-agnostic form. Poisson­Latent­Sign 23 core · 40 supporting · 6 submodules This module collects reusable likelihood, coefficient, and cross-moment results for a Poisson-sized cell whose records share a symmetric latent sign.
Mixture 4 core · 7 supporting This file defines finite mixtures of measures with nonnegative extended-real weights. ★ mixtureReal_le★ kernel_comp_priorPredictive

Finite Mixtures of Measures

This file defines finite mixtures of measures with nonnegative extended-real weights. It proves evaluation, probability-measure, and domination facts used to transfer componentwise bounds to mixtures in minimax arguments.

def mixture reviewed
Causalean.Stat

Given a sample space equipped with a σ-algebra, a finite index set, nonnegative extended-real weights indexed by that set, and a measure for each index, the finite mixture measure is the sum of the component measures, each scaled by its corresponding weight.

Definition (Lean source)
Ω :
Type u_1
shared
ι :
Type u_2
shared
w :
ι → ℝ≥0∞
P :
ι → Measure Ω
mixture w P :
∑ i, w i • P i
theorem mixtureReal_le reviewed
Causalean.Stat

Domination. If the mixture weights w sum to 1, each component measure P i is a probability measure, and every component assigns .real-mass at most B to the set A, then the mixture measure also assigns .real-mass at most B to A.

Formal statement
Ω :
Type u_1
shared
ι :
Type u_2
shared
w :
ι → ℝ≥0∞
hw :
∑ i, w i = 1
P :
ι → Measure Ω
A :
Set Ω
B :
ℝ
hB :
∀ i, (P i).real A ≤ B
(mixture w P).real A ≤ B
Proof (Lean source)
theorem mixtureReal_le (w : ι → ℝ≥0∞) (hw : ∑ i, w i = 1) (P : ι → Measure Ω) [∀ i, IsProbabilityMeasure (P i)] (A : Set Ω) (B : ℝ) (hB : ∀ i, (P i).real A ≤ B) : (mixture w P).real A ≤ B := by have hwfin : ∀ i, w i ≠ ⊤ := by intro i have hle : w i ≤ 1 := le_of_le_of_eq (Finset.single_le_sum (f := w) (fun j _ => zero_le) (Finset.mem_univ i)) hw exact ne_top_of_le_ne_top ENNReal.one_ne_top hle have hterm : ∀ i, w i * P i A ≠ ⊤ := by intro i exact ENNReal.mul_ne_top (hwfin i) (measure_ne_top _ _) rw [Measure.real, mixture_apply, ENNReal.toReal_sum (fun i _ => hterm i)] have hsum : (∑ i, (w i * P i A).toReal) ≤ ∑ i, (w i).toReal * B := by refine Finset.sum_le_sum (fun i _ => ?_) rw [ENNReal.toReal_mul] refine mul_le_mul_of_nonneg_left ?_ ENNReal.toReal_nonneg have : (P i).real A = (P i A).toReal := rfl rw [← this] exact hB i refine hsum.trans ?_ rw [← Finset.sum_mul] have hwsum : (∑ i, (w i).toReal) = 1 := by rw [← ENNReal.toReal_sum (fun i _ => hwfin i), hw, ENNReal.toReal_one] rw [hwsum, one_mul]
Causalean.Stat.mixtureReal_le · Causalean/Stat/Minimax/Mixture.lean:59 · uses mixture
def priorPredictive reviewed
Causalean.Stat.Minimax.MomentMatchedMixture

Given a prior measure and a measurable experiment kernel, the prior-predictive law first draws a parameter from the prior and then draws an observation from the experiment at that parameter.

Definition (Lean source)
Θ :
Type u_1
shared
X :
Type u_2
shared
π :
K :
Kernel Θ X
priorPredictive π K :
π.bind fun θ => K θ
Causalean.Stat.Minimax.MomentMatchedMixture.priorPredictive · Causalean/Stat/Minimax/Mixture.lean:116
theorem kernel_comp_priorPredictive reviewed
Causalean.Stat.Minimax.MomentMatchedMixture

Given a probability prior, an experiment Markov kernel, and a common post-processing Markov kernel, mixing the composed experiment equals post-processing the prior-predictive mixture.

Formal statement
priorPredictive pi (R ∘ₖ K) = R ∘ₘ priorPredictive pi K
Proof (Lean source)
theorem kernel_comp_priorPredictive {Theta A B : Type*} [MeasurableSpace Theta] [MeasurableSpace A] [MeasurableSpace B] (pi : Measure Theta) [IsProbabilityMeasure pi] (K : Kernel Theta A) [IsMarkovKernel K] (R : Kernel A B) [IsMarkovKernel R] : priorPredictive pi (R ∘ₖ K) = R ∘ₘ priorPredictive pi K := by unfold priorPredictive exact Measure.comp_assoc.symm
Causalean.Stat.Minimax.MomentMatchedMixture.kernel_comp_priorPredictive · Causalean/Stat/Minimax/Mixture.lean:165 · uses priorPredictive
7 supporting declarations (lemmas, instances)
Iid 3 core · 11 supporting This module proves the Radon--Nikodym density formula for finite iid product laws, expands uniform finite-mixture chi-squared second moments into pairwise overlaps, and identifies iid overlaps as powers of their one-samp ★ one_add_chiSqDiv_uniformMixture_iid★ product_pair_overlap

Iid second moments of uniform finite mixtures

This module proves the Radon--Nikodym density formula for finite iid product laws, expands uniform finite-mixture chi-squared second moments into pairwise overlaps, and identifies iid overlaps as powers of their one-sample versions.

def uniformMixture reviewed
Causalean.Stat.Minimax.Mixture

Given a finite nonempty family of measures, the uniform finite mixture assigns equal mass to every component.

Definition (Lean source)
Ω S :
Type*
Nonempty S
Q :
S → Measure Ω
uniformMixture Q :
mixture (fun _ => (Fintype.card S : ℝ≥0∞)⁻¹) Q
Causalean.Stat.Minimax.Mixture.uniformMixture · Causalean/Stat/Minimax/Mixture/Iid.lean:81
theorem one_add_chiSqDiv_uniformMixture_iid reviewed
Causalean.Stat.Minimax.Mixture

Given a finite nonempty family of probability laws, a reference probability law, componentwise domination, integrable pairwise one-observation density products, and a sample size, one plus the chi-squared divergence, from the iid product of the reference law, of the uniform mixture of the components' iid product laws equals the average over all ordered pairs of components of the one-observation overlap raised to the sample size, where the overlap of two components is the reference-law integral of the product of their densities.

Formal statement
Ω S :
Type*
Nonempty S
Q :
S → Measure Ω
hac :
∀ s, Q s ≪ P
hpair :
∀ s t, Integrable (fun x => ((Q s).rnDeriv P x).toReal * ((Q t).rnDeriv P x).toReal) P
n :
ℕ
1
+ chiSqDiv (uniformMixture (fun s => Measure.pi (fun _ : Fin n => Q s))) (Measure.pi (fun _ : Fin n => P))
= (∑ s : S, ∑ t : S, (∫ x, ((Q s).rnDeriv P x).toReal * ((Q t).rnDeriv P x).toReal ∂P) ^ n) / (Fintype.card S : ℝ) ^ 2
Proof (Lean source)
theorem one_add_chiSqDiv_uniformMixture_iid {Ω S : Type*} [MeasurableSpace Ω] [Fintype S] [Nonempty S] (Q : S → Measure Ω) (P : Measure Ω) [IsProbabilityMeasure P] [∀ s, IsProbabilityMeasure (Q s)] (hac : ∀ s, Q s ≪ P) (hpair : ∀ s t, Integrable (fun x => ((Q s).rnDeriv P x).toReal * ((Q t).rnDeriv P x).toReal) P) (n : ℕ) : 1 + chiSqDiv (uniformMixture (fun s => Measure.pi (fun _ : Fin n => Q s))) (Measure.pi (fun _ : Fin n => P)) = (∑ s : S, ∑ t : S, (∫ x, ((Q s).rnDeriv P x).toReal * ((Q t).rnDeriv P x).toReal ∂P) ^ n) / (Fintype.card S : ℝ) ^ 2 := by classical haveI : ∀ s : S, IsProbabilityMeasure (Measure.pi (fun _ : Fin n => Q s)) := by infer_instance have hpi : ∀ s : S, Measure.pi (fun _ : Fin n => Q s) ≪ Measure.pi (fun _ : Fin n => P) := by intro s exact pi_iid_absolutelyContinuous (Q s) P (hac s) n have hbase := one_add_chiSqDiv_uniformMixture (fun s => Measure.pi (fun _ : Fin n => Q s)) (Measure.pi (fun _ : Fin n => P)) hpi (fun s t => iidPairIntegrable P (Q s) (Q t) (hac s) (hac t) (hpair s t) n) rw [hbase] congr 1 apply Finset.sum_congr rfl intro s _ apply Finset.sum_congr rfl intro t _ exact iidPairOverlap P (Q s) (Q t) (hac s) (hac t) n
Causalean.Stat.Minimax.Mixture.one_add_chiSqDiv_uniformMixture_iid · Causalean/Stat/Minimax/Mixture/Iid.lean:291 · uses uniformMixture , chiSqDiv
theorem product_pair_overlap reviewed
Causalean.Stat.Minimax.Mixture

Given the first channel sample space, the second channel sample space, the first channel's reference and component laws, the second channel's reference and component laws, and domination in both channels, the overlap of the two product component laws, meaning the integral under the product reference law of the product of their densities, is the product of the two channels' separate overlaps.

Formal statement
Ω₁ Ω₂ :
P₁ Q₁ R₁ :
Measure Ω₁
P₂ Q₂ R₂ :
Measure Ω₂
hQ₁ :
Q₁ ≪ P₁
hR₁ :
R₁ ≪ P₁
hQ₂ :
Q₂ ≪ P₂
hR₂ :
R₂ ≪ P₂
(∫ z, ((Q₁.prod Q₂).rnDeriv (P₁.prod P₂) z).toReal * ((R₁.prod R₂).rnDeriv (P₁.prod P₂) z).toReal ∂(P₁.prod P₂))
= (∫ x, (Q₁.rnDeriv P₁ x).toReal * (R₁.rnDeriv P₁ x).toReal ∂P₁) * (∫ x, (Q₂.rnDeriv P₂ x).toReal * (R₂.rnDeriv P₂ x).toReal ∂P₂)
Proof (Lean source)
theorem product_pair_overlap {Ω₁ Ω₂ : Type*} [MeasurableSpace Ω₁] [MeasurableSpace Ω₂] (P₁ Q₁ R₁ : Measure Ω₁) (P₂ Q₂ R₂ : Measure Ω₂) [IsProbabilityMeasure P₁] [IsProbabilityMeasure Q₁] [IsProbabilityMeasure R₁] [IsProbabilityMeasure P₂] [IsProbabilityMeasure Q₂] [IsProbabilityMeasure R₂] (hQ₁ : Q₁ ≪ P₁) (hR₁ : R₁ ≪ P₁) (hQ₂ : Q₂ ≪ P₂) (hR₂ : R₂ ≪ P₂) : (∫ z, ((Q₁.prod Q₂).rnDeriv (P₁.prod P₂) z).toReal * ((R₁.prod R₂).rnDeriv (P₁.prod P₂) z).toReal ∂(P₁.prod P₂)) = (∫ x, (Q₁.rnDeriv P₁ x).toReal * (R₁.rnDeriv P₁ x).toReal ∂P₁) * (∫ x, (Q₂.rnDeriv P₂ x).toReal * (R₂.rnDeriv P₂ x).toReal ∂P₂) := by have hQ := Causalean.Mathlib.Probability.ProductAbsolutelyContinuous.rnDeriv_prod_eq Q₁ P₁ Q₂ P₂ hQ₁ hQ₂ have hR := Causalean.Mathlib.Probability.ProductAbsolutelyContinuous.rnDeriv_prod_eq R₁ P₁ R₂ P₂ hR₁ hR₂ have hEq : (fun z => ((Q₁.prod Q₂).rnDeriv (P₁.prod P₂) z).toReal * ((R₁.prod R₂).rnDeriv (P₁.prod P₂) z).toReal) =ᵐ[P₁.prod P₂] (fun z => ((Q₁.rnDeriv P₁ z.1).toReal * (R₁.rnDeriv P₁ z.1).toReal) * ((Q₂.rnDeriv P₂ z.2).toReal * (R₂.rnDeriv P₂ z.2).toReal)) := by filter_upwards [hQ, hR] with z hzQ hzR simp only [hzQ, hzR, ENNReal.toReal_mul] ring rw [integral_congr_ae hEq] exact integral_prod_mul (fun x => (Q₁.rnDeriv P₁ x).toReal * (R₁.rnDeriv P₁ x).toReal) (fun x => (Q₂.rnDeriv P₂ x).toReal * (R₂.rnDeriv P₂ x).toReal)
Causalean.Stat.Minimax.Mixture.product_pair_overlap · Causalean/Stat/Minimax/Mixture/Iid.lean:404
11 supporting declarations (lemmas, instances)
  • iidRnDeriv_eq_prod theorem — Given two probability laws on a measurable sample space, the second law is dominated by the first, and a sample size, the Radon--Nikodym density of the iid product law is almost everywhere the product of the one-observation densities.
    Ω :
    hQ :
    Q ≪ P
    n :
    ℕ
    (Measure.pi (fun _ : Fin n => Q)).rnDeriv (Measure.pi (fun _ : Fin n => P))
    =ᵐ[Measure.pi (fun _ : Fin n => P)] (fun x => ∏ i : Fin n, Q.rnDeriv P (x i))
    Proof (Lean source)
    theorem iidRnDeriv_eq_prod {Ω : Type*} [MeasurableSpace Ω] (P Q : Measure Ω) [IsProbabilityMeasure P] [IsProbabilityMeasure Q] (hQ : Q ≪ P) (n : ℕ) : (Measure.pi (fun _ : Fin n => Q)).rnDeriv (Measure.pi (fun _ : Fin n => P)) =ᵐ[Measure.pi (fun _ : Fin n => P)] (fun x => ∏ i : Fin n, Q.rnDeriv P (x i)) := by induction n with | zero => have heq : Measure.pi (fun _ : Fin 0 => Q) = Measure.pi (fun _ : Fin 0 => P) := by rw [Measure.pi_of_empty, Measure.pi_of_empty] rw [heq] simpa using (Measure.rnDeriv_self (Measure.pi (fun _ : Fin 0 => P))) | succ n ih => let e := piFinSuccAbove (fun _ : Fin (n + 1) => Ω) 0 have hQmap := measurePreserving_piFinSuccAbove (fun _ : Fin (n + 1) => Q) 0 have hPmap := measurePreserving_piFinSuccAbove (fun _ : Fin (n + 1) => P) 0 have htail : Measure.pi (fun _ : Fin n => Q) ≪ Measure.pi (fun _ : Fin n => P) := pi_iid_absolutelyContinuous Q P hQ n have hb := rnDeriv_prod_eq Q P (Measure.pi (fun _ : Fin n => Q)) (Measure.pi (fun _ : Fin n => P)) hQ htail have hitail := (Measure.quasiMeasurePreserving_snd (μ := P) (ν := Measure.pi (fun _ : Fin n => P))).ae_eq_comp ih have hprod : (Q.prod (Measure.pi (fun _ : Fin n => Q))).rnDeriv (P.prod (Measure.pi (fun _ : Fin n => P))) =ᵐ[ P.prod (Measure.pi (fun _ : Fin n => P))] fun z => Q.rnDeriv P z.1 * ∏ i, Q.rnDeriv P (z.2 i) := by filter_upwards [hb, hitail] with z hz ht simp only [Function.comp_apply] at ht rw [hz, ht] have hpull := hPmap.quasiMeasurePreserving.ae_eq_comp hprod have hmap := e.measurableEmbedding.rnDeriv_map (Measure.pi (fun _ : Fin (n + 1) => Q)) (Measure.pi (fun _ : Fin (n + 1) => P)) filter_upwards [hmap, hpull] with x hm hp simp only [Function.comp_apply] at hp rw [← hm, hQmap.map_eq, hPmap.map_eq, hp, Fin.prod_univ_succ] congr 1
    Causalean.Stat.Minimax.Mixture.iidRnDeriv_eq_prod · Causalean/Stat/Minimax/Mixture/Iid.lean:22
  • iidRnDeriv_toReal_eq_prod theorem — Given two probability laws on a measurable sample space, the second law is dominated by the first, and a sample size, the real-valued Radon--Nikodym density of the iid product law is almost everywhere the product of the real-valued one-observation densities.
    Ω :
    hQ :
    Q ≪ P
    n :
    ℕ
    (fun x => ((Measure.pi (fun _ : Fin n => Q)).rnDeriv (Measure.pi (fun _ : Fin n => P)) x).toReal)
    =ᵐ[ Measure.pi (fun _ : Fin n => P)] (fun x => ∏ i : Fin n, (Q.rnDeriv P (x i)).toReal)
    Proof (Lean source)
    theorem iidRnDeriv_toReal_eq_prod {Ω : Type*} [MeasurableSpace Ω] (P Q : Measure Ω) [IsProbabilityMeasure P] [IsProbabilityMeasure Q] (hQ : Q ≪ P) (n : ℕ) : (fun x => ((Measure.pi (fun _ : Fin n => Q)).rnDeriv (Measure.pi (fun _ : Fin n => P)) x).toReal) =ᵐ[ Measure.pi (fun _ : Fin n => P)] (fun x => ∏ i : Fin n, (Q.rnDeriv P (x i)).toReal) := by filter_upwards [iidRnDeriv_eq_prod P Q hQ n] with x hx simpa only [hx, ENNReal.toReal_prod]
    Causalean.Stat.Minimax.Mixture.iidRnDeriv_toReal_eq_prod · Causalean/Stat/Minimax/Mixture/Iid.lean:67
  • uniformMixture_isProbability theorem — Given a finite nonempty family of probability measures, its uniform mixture is a probability measure.
    Ω S :
    Type*
    Nonempty S
    Q :
    S → Measure Ω
    IsProbabilityMeasure (uniformMixture Q)
    Proof (Lean source)
    theorem uniformMixture_isProbability {Ω S : Type*} [MeasurableSpace Ω] [Fintype S] [Nonempty S] (Q : S → Measure Ω) [∀ s, IsProbabilityMeasure (Q s)] : IsProbabilityMeasure (uniformMixture Q) := by apply Causalean.Stat.mixture_isProbabilityMeasure have hc : (Fintype.card S : ℝ≥0∞) ≠ 0 := by exact_mod_cast Fintype.card_ne_zero rw [Finset.sum_const, nsmul_eq_mul] exact ENNReal.mul_inv_cancel hc (by simp)
    Causalean.Stat.Minimax.Mixture.uniformMixture_isProbability · Causalean/Stat/Minimax/Mixture/Iid.lean:87
  • uniformMixture_absolutelyContinuous theorem — Given a finite nonempty family of measures, a reference measure, and componentwise domination by that reference, the uniform mixture is also dominated by the reference measure.
    Ω S :
    Type*
    Nonempty S
    Q :
    S → Measure Ω
    P :
    hac :
    ∀ s, Q s ≪ P
    uniformMixture Q ≪ P
    Proof (Lean source)
    theorem uniformMixture_absolutelyContinuous {Ω S : Type*} [MeasurableSpace Ω] [Fintype S] [Nonempty S] (Q : S → Measure Ω) (P : Measure Ω) (hac : ∀ s, Q s ≪ P) : uniformMixture Q ≪ P := by unfold uniformMixture mixture have h (t : Finset S) : t.sum (fun s => (Fintype.card S : ℝ≥0∞)⁻¹ • Q s) ≪ P := by classical induction t using Finset.induction_on with | empty => simp | @insert s t hs ih => simpa [Finset.sum_insert hs] using Measure.AbsolutelyContinuous.add_left ((hac s).smul_left ((Fintype.card S : ℝ≥0∞)⁻¹)) ih exact h univ
    Causalean.Stat.Minimax.Mixture.uniformMixture_absolutelyContinuous · Causalean/Stat/Minimax/Mixture/Iid.lean:99
  • uniformMixture_rnDeriv theorem — Given a finite nonempty family of probability laws and a reference probability law, the real-valued density of the uniform mixture is almost everywhere the average of the component densities.
    Ω S :
    Type*
    Nonempty S
    Q :
    S → Measure Ω
    (fun x => ((uniformMixture Q).rnDeriv P x).toReal)
    =ᵐ[P] (fun x => (∑ s, ((Q s).rnDeriv P x).toReal) / (Fintype.card S : ℝ))
    Proof (Lean source)
    theorem uniformMixture_rnDeriv {Ω S : Type*} [MeasurableSpace Ω] [Fintype S] [Nonempty S] (Q : S → Measure Ω) (P : Measure Ω) [IsProbabilityMeasure P] [∀ s, IsProbabilityMeasure (Q s)] : (fun x => ((uniformMixture Q).rnDeriv P x).toReal) =ᵐ[P] (fun x => (∑ s, ((Q s).rnDeriv P x).toReal) / (Fintype.card S : ℝ)) := by classical let w : ℝ≥0∞ := (Fintype.card S : ℝ≥0∞)⁻¹ have hw : w ≠ ⊤ := by simp [w] haveI (s : S) : IsFiniteMeasure (w • Q s) := (Q s).smul_finite hw have hrn (t : Finset S) : (t.sum (fun s => w • Q s)).rnDeriv P =ᵐ[P] fun x => t.sum (fun s => w * (Q s).rnDeriv P x) := by induction t using Finset.induction_on with | empty => filter_upwards [Measure.rnDeriv_zero P] with x hx simpa using hx | @insert s t hs ih => haveI : IsFiniteMeasure (t.sum (fun s => w • Q s)) := inferInstance have hadd := Measure.rnDeriv_add (w • Q s) (t.sum (fun s => w • Q s)) P have hsmul := Measure.rnDeriv_smul_left_of_ne_top (Q s) P hw filter_upwards [hadd, hsmul, ih] with x hx ha hb simpa [Finset.sum_insert hs, Pi.add_apply, Pi.smul_apply, smul_eq_mul, ha, hb] using hx have hfinite : ∀ᵐ x ∂P, ∀ s : S, (Q s).rnDeriv P x ≠ ⊤ := by rw [Filter.eventually_all] intro s exact (Measure.rnDeriv_lt_top (Q s) P).mono (fun x hx => ne_of_lt hx) filter_upwards [hrn univ, hfinite] with x hx hfx change ((Finset.univ.sum (fun s => w • Q s)).rnDeriv P x).toReal = (∑ s, ((Q s).rnDeriv P x).toReal) / (Fintype.card S : ℝ) rw [hx, ENNReal.toReal_sum (fun s _ => ENNReal.mul_ne_top hw (hfx s))] simp_rw [ENNReal.toReal_mul] simp [w, ENNReal.toReal_inv, ENNReal.toReal_natCast, div_eq_mul_inv, Finset.mul_sum, mul_comm]
    Causalean.Stat.Minimax.Mixture.uniformMixture_rnDeriv · Causalean/Stat/Minimax/Mixture/Iid.lean:116
  • one_add_chiSqDiv_uniformMixture theorem — Given a finite nonempty family of probability laws, a reference probability law, componentwise domination, and integrable pairwise density products, one plus the chi-squared divergence of the uniform mixture is the average of all pairwise Radon--Nikodym overlaps.
    Ω S :
    Type*
    Nonempty S
    Q :
    S → Measure Ω
    hac :
    ∀ s, Q s ≪ P
    hpair :
    ∀ s t, Integrable (fun x => ((Q s).rnDeriv P x).toReal * ((Q t).rnDeriv P x).toReal) P
    1 + chiSqDiv (uniformMixture Q) P
    = (∑ s : S, ∑ t : S, ∫ x, ((Q s).rnDeriv P x).toReal * ((Q t).rnDeriv P x).toReal ∂P) / (Fintype.card S : ℝ) ^ 2
    Proof (Lean source)
    theorem one_add_chiSqDiv_uniformMixture {Ω S : Type*} [MeasurableSpace Ω] [Fintype S] [Nonempty S] (Q : S → Measure Ω) (P : Measure Ω) [IsProbabilityMeasure P] [∀ s, IsProbabilityMeasure (Q s)] (hac : ∀ s, Q s ≪ P) (hpair : ∀ s t, Integrable (fun x => ((Q s).rnDeriv P x).toReal * ((Q t).rnDeriv P x).toReal) P) : 1 + chiSqDiv (uniformMixture Q) P = (∑ s : S, ∑ t : S, ∫ x, ((Q s).rnDeriv P x).toReal * ((Q t).rnDeriv P x).toReal ∂P) / (Fintype.card S : ℝ) ^ 2 := by classical haveI : IsProbabilityMeasure (uniformMixture Q) := uniformMixture_isProbability Q let d (s : S) (x : Ω) : ℝ := ((Q s).rnDeriv P x).toReal let p (x : Ω) : ℝ := ((uniformMixture Q).rnDeriv P x).toReal let n : ℝ := Fintype.card S have hdouble : Integrable (fun x => ∑ s : S, ∑ t : S, d s x * d t x) P := by apply integrable_finsetSum Finset.univ intro s _ apply integrable_finsetSum Finset.univ intro t _ exact hpair s t have hpoint : ∀ᵐ x ∂P, p x ^ 2 = (∑ s : S, ∑ t : S, d s x * d t x) / n ^ 2 := by filter_upwards [uniformMixture_rnDeriv Q P] with x hx change p x = (∑ s : S, d s x) / n at hx rw [hx, div_pow, sq, Finset.sum_mul_sum] have hsq : Integrable (fun x => p x ^ 2) P := by exact (hdouble.div_const (n ^ 2)).congr (hpoint.mono fun x hx => hx.symm) have hp : Integrable p P := Measure.integrable_toReal_rnDeriv have hdev : Integrable (fun x => (p x - 1) ^ 2) P := by have heq : (fun x => (p x - 1) ^ 2) = (fun x => p x ^ 2 - 2 * p x + 1) := by funext x; ring rw [heq] exact (hsq.sub (hp.const_mul 2)).add (integrable_const 1) have hint : (∫ x, p x ^ 2 ∂P) = (∑ s : S, ∑ t : S, ∫ x, d s x * d t x ∂P) / n ^ 2 := by calc (∫ x, p x ^ 2 ∂P) = ∫ x, (∑ s : S, ∑ t : S, d s x * d t x) / n ^ 2 ∂P := integral_congr_ae hpoint _ = (∫ x, ∑ s : S, ∑ t : S, d s x * d t x ∂P) / n ^ 2 := integral_div _ _ _ = (∑ s : S, ∑ t : S, ∫ x, d s x * d t x ∂P) / n ^ 2 := by rw [integral_finsetSum] · congr 1 apply Finset.sum_congr rfl intro s _ rw [integral_finsetSum] intro t _ exact hpair s t · intro s _ apply integrable_finsetSum Finset.univ intro t _ exact hpair s t have hchi := chiSqDiv_eq (uniformMixture_absolutelyContinuous Q P hac) hdev change chiSqDiv (uniformMixture Q) P = (∫ x, p x ^ 2 ∂P) - 1 at hchi rw [hchi, hint] ring
    Causalean.Stat.Minimax.Mixture.one_add_chiSqDiv_uniformMixture · Causalean/Stat/Minimax/Mixture/Iid.lean:156
  • iidPairIntegrable theorem — Given a reference probability law and two dominated probability laws, domination of the two laws, an integrable one-observation density product, and a sample size, the product of their iid sample densities is integrable.
    Ω :
    hQ :
    Q ≪ P
    hR :
    R ≪ P
    hint :
    Integrable (fun x => (Q.rnDeriv P x).toReal * (R.rnDeriv P x).toReal) P
    n :
    ℕ
    Integrable (fun x => (((Measure.pi (fun _ : Fin n => Q)).rnDeriv (Measure.pi (fun _ : Fin n => P)) x).toReal) * (((Measure.pi (fun _ : Fin n => R)).rnDeriv (Measure.pi (fun _ : Fin n => P)) x).toReal)) (Measure.pi (fun _ : Fin n => P))
    Proof (Lean source)
    theorem iidPairIntegrable {Ω : Type*} [MeasurableSpace Ω] (P Q R : Measure Ω) [IsProbabilityMeasure P] [IsProbabilityMeasure Q] [IsProbabilityMeasure R] (hQ : Q ≪ P) (hR : R ≪ P) (hint : Integrable (fun x => (Q.rnDeriv P x).toReal * (R.rnDeriv P x).toReal) P) (n : ℕ) : Integrable (fun x => (((Measure.pi (fun _ : Fin n => Q)).rnDeriv (Measure.pi (fun _ : Fin n => P)) x).toReal) * (((Measure.pi (fun _ : Fin n => R)).rnDeriv (Measure.pi (fun _ : Fin n => P)) x).toReal)) (Measure.pi (fun _ : Fin n => P)) := by have hprod : Integrable (fun x : Fin n → Ω => ∏ i : Fin n, (Q.rnDeriv P (x i)).toReal * (R.rnDeriv P (x i)).toReal) (Measure.pi (fun _ : Fin n => P)) := Integrable.fin_nat_prod (fun _ => hint) have heq : (fun x => (((Measure.pi (fun _ : Fin n => Q)).rnDeriv (Measure.pi (fun _ : Fin n => P)) x).toReal) * (((Measure.pi (fun _ : Fin n => R)).rnDeriv (Measure.pi (fun _ : Fin n => P)) x).toReal)) =ᵐ[ Measure.pi (fun _ : Fin n => P)] (fun x => ∏ i : Fin n, (Q.rnDeriv P (x i)).toReal * (R.rnDeriv P (x i)).toReal) := by filter_upwards [iidRnDeriv_toReal_eq_prod P Q hQ n, iidRnDeriv_toReal_eq_prod P R hR n] with x hqx hrx rw [hqx, hrx, ← Finset.prod_mul_distrib] exact hprod.congr heq.symm
    Causalean.Stat.Minimax.Mixture.iidPairIntegrable · Causalean/Stat/Minimax/Mixture/Iid.lean:221
  • iidPairOverlap theorem — Given a reference probability law and two dominated probability laws, domination of the two laws, and a sample size, the overlap of their iid sample laws is the corresponding power of the one-observation overlap.
    Ω :
    hQ :
    Q ≪ P
    hR :
    R ≪ P
    n :
    ℕ
    (∫ x, (((Measure.pi (fun _ : Fin n => Q)).rnDeriv (Measure.pi (fun _ : Fin n => P)) x).toReal) * (((Measure.pi (fun _ : Fin n => R)).rnDeriv (Measure.pi (fun _ : Fin n => P)) x).toReal) ∂(Measure.pi (fun _ : Fin n => P)))
    = (∫ x, (Q.rnDeriv P x).toReal * (R.rnDeriv P x).toReal ∂P) ^ n
    Proof (Lean source)
    theorem iidPairOverlap {Ω : Type*} [MeasurableSpace Ω] (P Q R : Measure Ω) [IsProbabilityMeasure P] [IsProbabilityMeasure Q] [IsProbabilityMeasure R] (hQ : Q ≪ P) (hR : R ≪ P) (n : ℕ) : (∫ x, (((Measure.pi (fun _ : Fin n => Q)).rnDeriv (Measure.pi (fun _ : Fin n => P)) x).toReal) * (((Measure.pi (fun _ : Fin n => R)).rnDeriv (Measure.pi (fun _ : Fin n => P)) x).toReal) ∂(Measure.pi (fun _ : Fin n => P))) = (∫ x, (Q.rnDeriv P x).toReal * (R.rnDeriv P x).toReal ∂P) ^ n := by have heq : (fun x => (((Measure.pi (fun _ : Fin n => Q)).rnDeriv (Measure.pi (fun _ : Fin n => P)) x).toReal) * (((Measure.pi (fun _ : Fin n => R)).rnDeriv (Measure.pi (fun _ : Fin n => P)) x).toReal)) =ᵐ[ Measure.pi (fun _ : Fin n => P)] (fun x => ∏ i : Fin n, (Q.rnDeriv P (x i)).toReal * (R.rnDeriv P (x i)).toReal) := by filter_upwards [iidRnDeriv_toReal_eq_prod P Q hQ n, iidRnDeriv_toReal_eq_prod P R hR n] with x hqx hrx rw [hqx, hrx, ← Finset.prod_mul_distrib] rw [integral_congr_ae heq] simpa using (integral_fintype_prod_eq_pow (ι := Fin n) (μ := P) (fun x => (Q.rnDeriv P x).toReal * (R.rnDeriv P x).toReal))
    Causalean.Stat.Minimax.Mixture.iidPairOverlap · Causalean/Stat/Minimax/Mixture/Iid.lean:255
  • iid_absolutelyContinuous_of_likelihood theorem — Given a measurable sample space, a reference probability law, an alternative probability law, a likelihood, its likelihood representation, and a sample size, the iid alternative law is dominated by the iid reference law.
    Ω :
    L :
    Ω → ℝ
    hQ :
    Q = μ.withDensity (fun x => ofReal (L x))
    n :
    ℕ
    Measure.pi (fun _ : Fin n => Q) ≪ Measure.pi (fun _ : Fin n => μ)
    Proof (Lean source)
    theorem iid_absolutelyContinuous_of_likelihood {Ω : Type*} [MeasurableSpace Ω] (μ Q : Measure Ω) [IsProbabilityMeasure μ] [IsProbabilityMeasure Q] (L : Ω → ℝ) (hQ : Q = μ.withDensity (fun x => ofReal (L x))) (n : ℕ) : Measure.pi (fun _ : Fin n => Q) ≪ Measure.pi (fun _ : Fin n => μ) := by apply pi_iid_absolutelyContinuous Q μ _ n rw [hQ] exact withDensity_absolutelyContinuous μ _
    Causalean.Stat.Minimax.Mixture.iid_absolutelyContinuous_of_likelihood · Causalean/Stat/Minimax/Mixture/Iid.lean:336
  • iid_pair_integrable_of_likelihood theorem — Given a measurable sample space, a reference probability law and two alternative probability laws, two likelihoods, their measurability, their nonnegativity, their likelihood representations, an integrable one-observation likelihood product, and a sample size, the product of the iid densities is integrable under the iid reference law.
    Ω :
    L M :
    Ω → ℝ
    hL :
    hM :
    hL0 :
    ∀ x, 0 ≤ L x
    hM0 :
    ∀ x, 0 ≤ M x
    hQ :
    Q = μ.withDensity (fun x => ofReal (L x))
    hR :
    R = μ.withDensity (fun x => ofReal (M x))
    hpairInt :
    Integrable (fun x => L x * M x) μ
    n :
    ℕ
    Integrable (fun x => (((Measure.pi (fun _ : Fin n => Q)).rnDeriv (Measure.pi (fun _ : Fin n => μ)) x).toReal) * (((Measure.pi (fun _ : Fin n => R)).rnDeriv (Measure.pi (fun _ : Fin n => μ)) x).toReal)) (Measure.pi (fun _ : Fin n => μ))
    Proof (Lean source)
    theorem iid_pair_integrable_of_likelihood {Ω : Type*} [MeasurableSpace Ω] (μ Q R : Measure Ω) [IsProbabilityMeasure μ] [IsProbabilityMeasure Q] [IsProbabilityMeasure R] (L M : Ω → ℝ) (hL : Measurable L) (hM : Measurable M) (hL0 : ∀ x, 0 ≤ L x) (hM0 : ∀ x, 0 ≤ M x) (hQ : Q = μ.withDensity (fun x => ofReal (L x))) (hR : R = μ.withDensity (fun x => ofReal (M x))) (hpairInt : Integrable (fun x => L x * M x) μ) (n : ℕ) : Integrable (fun x => (((Measure.pi (fun _ : Fin n => Q)).rnDeriv (Measure.pi (fun _ : Fin n => μ)) x).toReal) * (((Measure.pi (fun _ : Fin n => R)).rnDeriv (Measure.pi (fun _ : Fin n => μ)) x).toReal)) (Measure.pi (fun _ : Fin n => μ)) := by have hLeq : (fun x => (Q.rnDeriv μ x).toReal) =ᵐ[μ] L := by rw [hQ] filter_upwards [Measure.rnDeriv_withDensity μ hL.ennreal_ofReal] with x hx simp [hx, ENNReal.toReal_ofReal (hL0 x)] have hMeq : (fun x => (R.rnDeriv μ x).toReal) =ᵐ[μ] M := by rw [hR] filter_upwards [Measure.rnDeriv_withDensity μ hM.ennreal_ofReal] with x hx simp [hx, ENNReal.toReal_ofReal (hM0 x)] have hprod : (fun x => (Q.rnDeriv μ x).toReal * (R.rnDeriv μ x).toReal) =ᵐ[μ] (fun x => L x * M x) := by filter_upwards [hLeq, hMeq] with x hx hy simp [hx, hy] have hacQ : Q ≪ μ := by rw [hQ] exact withDensity_absolutelyContinuous μ _ have hacR : R ≪ μ := by rw [hR] exact withDensity_absolutelyContinuous μ _ have hint : Integrable (fun x => (Q.rnDeriv μ x).toReal * (R.rnDeriv μ x).toReal) μ := hpairInt.congr hprod.symm exact iidPairIntegrable μ Q R hacQ hacR hint n
    Causalean.Stat.Minimax.Mixture.iid_pair_integrable_of_likelihood · Causalean/Stat/Minimax/Mixture/Iid.lean:347
  • product_pair_integrable theorem — Given the first channel sample space, the second channel sample space, the first channel's reference and component laws, the second channel's reference and component laws, domination in both channels, and integrable component-density products in both channels, the product joint-density product is integrable under the product reference law.
    Ω₁ Ω₂ :
    P₁ Q₁ R₁ :
    Measure Ω₁
    P₂ Q₂ R₂ :
    Measure Ω₂
    hQ₁ :
    Q₁ ≪ P₁
    hR₁ :
    R₁ ≪ P₁
    hQ₂ :
    Q₂ ≪ P₂
    hR₂ :
    R₂ ≪ P₂
    hInt₁ :
    Integrable (fun x => (Q₁.rnDeriv P₁ x).toReal * (R₁.rnDeriv P₁ x).toReal) P₁
    hInt₂ :
    Integrable (fun x => (Q₂.rnDeriv P₂ x).toReal * (R₂.rnDeriv P₂ x).toReal) P₂
    Integrable (fun z => ((Q₁.prod Q₂).rnDeriv (P₁.prod P₂) z).toReal * ((R₁.prod R₂).rnDeriv (P₁.prod P₂) z).toReal) (P₁.prod P₂)
    Proof (Lean source)
    theorem product_pair_integrable {Ω₁ Ω₂ : Type*} [MeasurableSpace Ω₁] [MeasurableSpace Ω₂] (P₁ Q₁ R₁ : Measure Ω₁) (P₂ Q₂ R₂ : Measure Ω₂) [IsProbabilityMeasure P₁] [IsProbabilityMeasure Q₁] [IsProbabilityMeasure R₁] [IsProbabilityMeasure P₂] [IsProbabilityMeasure Q₂] [IsProbabilityMeasure R₂] (hQ₁ : Q₁ ≪ P₁) (hR₁ : R₁ ≪ P₁) (hQ₂ : Q₂ ≪ P₂) (hR₂ : R₂ ≪ P₂) (hInt₁ : Integrable (fun x => (Q₁.rnDeriv P₁ x).toReal * (R₁.rnDeriv P₁ x).toReal) P₁) (hInt₂ : Integrable (fun x => (Q₂.rnDeriv P₂ x).toReal * (R₂.rnDeriv P₂ x).toReal) P₂) : Integrable (fun z => ((Q₁.prod Q₂).rnDeriv (P₁.prod P₂) z).toReal * ((R₁.prod R₂).rnDeriv (P₁.prod P₂) z).toReal) (P₁.prod P₂) := by have hQ := Causalean.Mathlib.Probability.ProductAbsolutelyContinuous.rnDeriv_prod_eq Q₁ P₁ Q₂ P₂ hQ₁ hQ₂ have hR := Causalean.Mathlib.Probability.ProductAbsolutelyContinuous.rnDeriv_prod_eq R₁ P₁ R₂ P₂ hR₁ hR₂ have hEq : (fun z => ((Q₁.prod Q₂).rnDeriv (P₁.prod P₂) z).toReal * ((R₁.prod R₂).rnDeriv (P₁.prod P₂) z).toReal) =ᵐ[P₁.prod P₂] (fun z => ((Q₁.rnDeriv P₁ z.1).toReal * (R₁.rnDeriv P₁ z.1).toReal) * ((Q₂.rnDeriv P₂ z.2).toReal * (R₂.rnDeriv P₂ z.2).toReal)) := by filter_upwards [hQ, hR] with z hzQ hzR simp only [hzQ, hzR, ENNReal.toReal_mul] ring exact (Integrable.mul_prod hInt₁ hInt₂).congr hEq.symm
    Causalean.Stat.Minimax.Mixture.product_pair_integrable · Causalean/Stat/Minimax/Mixture/Iid.lean:380
Sign­Overlap 2 core · 2 supporting When two hypotheses are drawn independently and uniformly from the 2^K sign vectors in {−1, +1}^K, the chi-square (second-moment) computation for the resulting mixture reduces to an average of powers of 1 + ρ ⟨s, t⟩ / K ★ uniform_sign_twoPower_le_exp

Exponential bounds for averages over pairs of sign vectors

When two hypotheses are drawn independently and uniformly from the 2^K sign vectors in {−1, +1}^K, the chi-square (second-moment) computation for the resulting mixture reduces to an average of powers of 1 + ρ ⟨s, t⟩ / K over all pairs (s, t). This module bounds such averages: for two sample sizes n₁, n₂ and overlap coefficients ρ₁, ρ₂ with nonnegative bases,

average over (s, t) of (1 + ρ₁⟨s,t⟩/K)^n₁ (1 + ρ₂⟨s,t⟩/K)^n₂ ≤ exp((n₁ρ₁ + n₂ρ₂)² / (2K)).

Main definitions and results

* innerSign — the inner product ⟨s, t⟩ of two Boolean vectors read as ±1 signs. * uniform_innerSign_exp_le — the average of exp(t ⟨s,u⟩ / K) over pairs is at most exp(t² / (2K)). * sign_twoPower_pointwise_le_exp — (1 + ρ₁x)^n₁ (1 + ρ₂x)^n₂ ≤ exp((n₁ρ₁ + n₂ρ₂) x). * uniform_sign_twoPower_le_exp — the displayed two-sample bound.

def innerSign reviewed
Causalean.Stat.Minimax.Mixture.SignOverlap

Given a sign-vector length and two Boolean sign vectors, the inner sign product is given by summing coordinatewise products after interpreting Boolean values as plus or minus one.

Definition (Lean source)
K :
ℕ
s t :
Fin K → Bool
innerSign s t :
ℝ
∑ j : Fin K, (if s j then (1 : ℝ) else -1) * (if t j then (1 : ℝ) else -1)
Causalean.Stat.Minimax.Mixture.SignOverlap.innerSign · Causalean/Stat/Minimax/Mixture/SignOverlap.lean:25
theorem uniform_sign_twoPower_le_exp reviewed
Causalean.Stat.Minimax.Mixture.SignOverlap

Given a positive sign-vector length and two sample sizes, two overlap coefficients, and bases 1 + ρ₁⟨s,t⟩/K and 1 + ρ₂⟨s,t⟩/K that are nonnegative for every pair of sign vectors, where ⟨s,t⟩ is the inner sign product, the average over all pairs of sign vectors of (1 + ρ₁⟨s,t⟩/K)^n₁ · (1 + ρ₂⟨s,t⟩/K)^n₂ is at most exp((n₁ρ₁ + n₂ρ₂)² / (2K)).

Formal statement
K n₁ n₂ :
ℕ
ρ₁ ρ₂ :
ℝ
hbase₁ :
∀ s t : Fin K → Bool, 0 ≤ 1 + ρ₁ * innerSign s t / (K : ℝ)
hbase₂ :
∀ s t : Fin K → Bool, 0 ≤ 1 + ρ₂ * innerSign s t / (K : ℝ)
(∑ s : Fin K → Bool, ∑ t : Fin K → Bool, (1 + ρ₁ * innerSign s t / (K : ℝ)) ^ n₁ * (1 + ρ₂ * innerSign s t / (K : ℝ)) ^ n₂) / (card (Fin K → Bool) : ℝ) ^ 2
≤ exp (((n₁ : ℝ) * ρ₁ + (n₂ : ℝ) * ρ₂) ^ 2 / (2 * (K : ℝ)))
Proof (Lean source)
theorem uniform_sign_twoPower_le_exp (K n₁ n₂ : ℕ) [NeZero K] (ρ₁ ρ₂ : ℝ) (hbase₁ : ∀ s t : Fin K → Bool, 0 ≤ 1 + ρ₁ * innerSign s t / (K : ℝ)) (hbase₂ : ∀ s t : Fin K → Bool, 0 ≤ 1 + ρ₂ * innerSign s t / (K : ℝ)) : (∑ s : Fin K → Bool, ∑ t : Fin K → Bool, (1 + ρ₁ * innerSign s t / (K : ℝ)) ^ n₁ * (1 + ρ₂ * innerSign s t / (K : ℝ)) ^ n₂) / (card (Fin K → Bool) : ℝ) ^ 2 ≤ exp (((n₁ : ℝ) * ρ₁ + (n₂ : ℝ) * ρ₂) ^ 2 / (2 * (K : ℝ))) := by classical have hcard : 0 ≤ (card (Fin K → Bool) : ℝ) ^ 2 := by positivity calc _ ≤ (∑ s : Fin K → Bool, ∑ t : Fin K → Bool, exp (((n₁ : ℝ) * ρ₁ + (n₂ : ℝ) * ρ₂) * innerSign s t / (K : ℝ))) / (card (Fin K → Bool) : ℝ) ^ 2 := by apply div_le_div_of_nonneg_right _ hcard apply Finset.sum_le_sum intro s hs apply Finset.sum_le_sum intro t ht have hb₁ : 0 ≤ 1 + ρ₁ * (innerSign s t / (K : ℝ)) := by simpa only [mul_div_assoc] using hbase₁ s t have hb₂ : 0 ≤ 1 + ρ₂ * (innerSign s t / (K : ℝ)) := by simpa only [mul_div_assoc] using hbase₂ s t simpa only [mul_div_assoc] using sign_twoPower_pointwise_le_exp n₁ n₂ ρ₁ ρ₂ (innerSign s t / (K : ℝ)) hb₁ hb₂ _ ≤ _ := uniform_innerSign_exp_le K ((n₁ : ℝ) * ρ₁ + (n₂ : ℝ) * ρ₂)
Causalean.Stat.Minimax.Mixture.SignOverlap.uniform_sign_twoPower_le_exp · Causalean/Stat/Minimax/Mixture/SignOverlap.lean:104 · uses innerSign
2 supporting declarations (lemmas, instances)
  • sign_twoPower_pointwise_le_exp theorem — Given two sample sizes, two overlap coefficients, an overlap coordinate, and nonnegative overlap bases, the product of two overlap powers is bounded by its linearized exponential.
    n₁ n₂ :
    ℕ
    ρ₁ ρ₂ x :
    ℝ
    hbase₁ :
    0 ≤ 1 + ρ₁ * x
    hbase₂ :
    0 ≤ 1 + ρ₂ * x
    (1 + ρ₁ * x) ^ n₁ * (1 + ρ₂ * x) ^ n₂ ≤ exp (((n₁ : ℝ) * ρ₁ + (n₂ : ℝ) * ρ₂) * x)
    Proof (Lean source)
    theorem sign_twoPower_pointwise_le_exp (n₁ n₂ : ℕ) (ρ₁ ρ₂ x : ℝ) (hbase₁ : 0 ≤ 1 + ρ₁ * x) (hbase₂ : 0 ≤ 1 + ρ₂ * x) : (1 + ρ₁ * x) ^ n₁ * (1 + ρ₂ * x) ^ n₂ ≤ exp (((n₁ : ℝ) * ρ₁ + (n₂ : ℝ) * ρ₂) * x) := by have h₁ : (1 + ρ₁ * x) ^ n₁ ≤ (exp (ρ₁ * x)) ^ n₁ := pow_le_pow_left₀ hbase₁ (by simpa [add_comm] using Real.add_one_le_exp (ρ₁ * x)) _ have h₂ : (1 + ρ₂ * x) ^ n₂ ≤ (exp (ρ₂ * x)) ^ n₂ := pow_le_pow_left₀ hbase₂ (by simpa [add_comm] using Real.add_one_le_exp (ρ₂ * x)) _ calc (1 + ρ₁ * x) ^ n₁ * (1 + ρ₂ * x) ^ n₂ ≤ (exp (ρ₁ * x)) ^ n₁ * (exp (ρ₂ * x)) ^ n₂ := mul_le_mul h₁ h₂ (pow_nonneg hbase₂ _) (pow_nonneg (Real.exp_pos _).le _) _ = exp (((n₁ : ℝ) * ρ₁ + (n₂ : ℝ) * ρ₂) * x) := by rw [← Real.exp_nat_mul, ← Real.exp_nat_mul, ← Real.exp_add] congr 1 ring
    Causalean.Stat.Minimax.Mixture.SignOverlap.sign_twoPower_pointwise_le_exp · Causalean/Stat/Minimax/Mixture/SignOverlap.lean:30
  • uniform_innerSign_exp_le theorem — Given a positive sign-vector length and an exponential coefficient, the uniform double average of the scaled inner-sign exponential is bounded by its Gaussian moment expression.
    K :
    ℕ
    t :
    ℝ
    (∑ s : Fin K → Bool, ∑ u : Fin K → Bool, exp (t * innerSign s u / (K : ℝ))) / (card (Fin K → Bool) : ℝ) ^ 2
    ≤ exp (t ^ 2 / (2 * (K : ℝ)))
    Proof (Lean source)
    theorem uniform_innerSign_exp_le (K : ℕ) [NeZero K] (t : ℝ) : (∑ s : Fin K → Bool, ∑ u : Fin K → Bool, exp (t * innerSign s u / (K : ℝ))) / (card (Fin K → Bool) : ℝ) ^ 2 ≤ exp (t ^ 2 / (2 * (K : ℝ))) := by classical have hK : (K : ℝ) ≠ 0 := by exact_mod_cast (NeZero.ne K) have hcard : (card (Fin K → Bool) : ℝ) = (2 : ℝ) ^ K := by simp [Fintype.card_bool] have hinner (s : Fin K → Bool) : (∑ u : Fin K → Bool, exp (t * innerSign s u / (K : ℝ))) / (card (Fin K → Bool) : ℝ) ≤ exp (t ^ 2 / (2 * (K : ℝ))) := by have hswap (u : Fin K → Bool) : innerSign s u = ∑ j : Fin K, (if u j then (1 : ℝ) else -1) * (if s j then (1 : ℝ) else -1) := by unfold innerSign apply Finset.sum_congr rfl intro j hj ring have hsquares : (∑ j : Fin K, (if s j then (1 : ℝ) else -1) ^ 2) = (K : ℝ) := by simp have hm := signMGF_le (fun j : Fin K => if s j then (1 : ℝ) else -1) (t / (K : ℝ)) convert hm using 1 · rw [hcard] congr 1 apply Finset.sum_congr rfl intro u hu congr 1 rw [hswap] ring · rw [hsquares] field_simp calc (∑ s : Fin K → Bool, ∑ u : Fin K → Bool, exp (t * innerSign s u / (K : ℝ))) / (card (Fin K → Bool) : ℝ) ^ 2 = (∑ s : Fin K → Bool, (∑ u : Fin K → Bool, exp (t * innerSign s u / (K : ℝ))) / (card (Fin K → Bool) : ℝ)) / (card (Fin K → Bool) : ℝ) := by simp only [Finset.sum_div] apply Finset.sum_congr rfl intro s hs apply Finset.sum_congr rfl intro u hu ring _ ≤ (∑ _s : Fin K → Bool, exp (t ^ 2 / (2 * (K : ℝ)))) / (card (Fin K → Bool) : ℝ) := by apply div_le_div_of_nonneg_right · exact Finset.sum_le_sum fun s _ => hinner s · rw [hcard] positivity _ = exp (t ^ 2 / (2 * (K : ℝ))) := by simp [Fintype.card_bool]
    Causalean.Stat.Minimax.Mixture.SignOverlap.uniform_innerSign_exp_le · Causalean/Stat/Minimax/Mixture/SignOverlap.lean:47
Finite­Cells 2 core · 3 supporting This module turns finite observed-cell masses into likelihood representations of measures. ★ eq_withDensity_of_cellSetMass

Finite-cell likelihood assembly

This module turns finite observed-cell masses into likelihood representations of measures. It covers a finite latent choice assembled by Measure.bind and an exact event-mass interface suitable for other finite-cell experiments.

def cellSetMass reviewed
Causalean.Stat.Minimax.Mixture.FiniteCells

Given a covariate sample space, a finite observed-cell space, a covariate law, nonnegative masses for every cell, and an observed event, the finite-cell event mass is given by integrating the masses of event cells.

Definition (Lean source)
X C :
ν :
m :
X → C → ℝ≥0∞
A :
Set (X × C)
cellSetMass ν m A :
ℝ≥0∞
by classical exact ∫⁻ x, ∑ c : C, if (x, c) ∈ A then m x c else 0 ∂ν
Causalean.Stat.Minimax.Mixture.FiniteCells.cellSetMass · Causalean/Stat/Minimax/Mixture/FiniteCells.lean:15
theorem eq_withDensity_of_cellSetMass reviewed
Causalean.Stat.Minimax.Mixture.FiniteCells

Given a covariate sample space, a finite observed-cell space, a covariate law, reference and alternative observed laws, reference and alternative cell masses, a likelihood, measurable reference masses, a measurable likelihood, finite-cell event-mass representations, and each alternative cell mass equal to the reference cell mass times the likelihood at that covariate value and cell, the alternative law is the measure having that likelihood as its density with respect to the reference law.

Formal statement
ν :
μ Q :
Measure (X × C)
p q :
X → C → ℝ≥0∞
L :
X × C → ℝ
hp :
∀ c, Measurable fun x => p x c
hL :
hμ :
∀ A
then
μ A = cellSetMass ν p A
hQ :
∀ A
then
Q A = cellSetMass ν q A
hratio :
∀ x c, q x c = p x c * ofReal (L (x, c))
Q = μ.withDensity (fun z => ofReal (L z))
Proof (Lean source)
theorem eq_withDensity_of_cellSetMass {X C : Type*} [MeasurableSpace X] [MeasurableSpace C] [Fintype C] (ν : Measure X) (μ Q : Measure (X × C)) (p q : X → C → ℝ≥0∞) (L : X × C → ℝ) (hp : ∀ c, Measurable fun x => p x c) (hL : Measurable L) (hμ : ∀ A, MeasurableSet A → μ A = cellSetMass ν p A) (hQ : ∀ A, MeasurableSet A → Q A = cellSetMass ν q A) (hratio : ∀ x c, q x c = p x c * ofReal (L (x, c))) : Q = μ.withDensity (fun z => ofReal (L z)) := by classical let k : X → Measure (X × C) := fun x => ∑ c : C, p x c • Measure.dirac (x, c) have hk : Measurable k := by unfold k refine Measure.measurable_of_measurable_coe _ fun s hs => ?_ simp only [Measure.finsetSum_apply] apply Finset.measurable_fun_sum intro c hc simp only [Measure.smul_apply, smul_eq_mul, Measure.dirac_apply' _ hs] exact (hp c).mul (measurable_one.indicator (hs.preimage (measurable_id.prodMk measurable_const))) have hμbind : μ = ν.bind k := by ext A hA rw [hμ A hA] have hb := bind_latent_map_cellSetMass ν p (fun _ c => c) hp (fun _ => measurable_const) A hA rw [hb] unfold cellSetMass apply lintegral_congr intro x apply Finset.sum_congr rfl intro c hc simp let f : X × C → ℝ≥0∞ := fun z => ofReal (L z) have hf : Measurable f := hL.ennreal_ofReal ext A hA have hg : Measurable (A.indicator f) := hf.indicator hA calc Q A = ∫⁻ x, ∑ c : C, if (x, c) ∈ A then q x c else 0 ∂ν := hQ A hA _ = ∫⁻ x, ∑ c : C, if (x, c) ∈ A then p x c * f (x, c) else 0 ∂ν := by apply lintegral_congr intro x apply Finset.sum_congr rfl intro c hc simp only [hratio] rfl _ = (μ.withDensity f) A := by rw [withDensity_apply _ hA, ← lintegral_indicator hA, hμbind] rw [Measure.lintegral_bind hk.aemeasurable hg.aemeasurable] apply lintegral_congr intro x change (∑ c : C, if (x, c) ∈ A then p x c * f (x, c) else 0) = ∫⁻ z, A.indicator f z ∂k x unfold k rw [lintegral_finsetSum_measure] simp_rw [lintegral_smul_measure, lintegral_dirac' _ hg] apply Finset.sum_congr rfl intro c hc simp [indicator, smul_eq_mul]
Causalean.Stat.Minimax.Mixture.FiniteCells.eq_withDensity_of_cellSetMass · Causalean/Stat/Minimax/Mixture/FiniteCells.lean:86 · uses cellSetMass
3 supporting declarations (lemmas, instances)
  • isProbability_of_cellSetMass theorem — Given a covariate sample space, a finite observed-cell space, a probability covariate law, an observed law, cell masses, an exact finite-cell event-mass representation, and cell masses that sum to one at every covariate value, the observed law is a probability measure.
    Q :
    Measure (X × C)
    q :
    X → C → ℝ≥0∞
    hQ :
    ∀ A
    then
    Q A = cellSetMass ν q A
    hsum :
    ∀ x, ∑ c : C, q x c = 1
    Proof (Lean source)
    theorem isProbability_of_cellSetMass {X C : Type*} [MeasurableSpace X] [MeasurableSpace C] [Fintype C] (ν : Measure X) [IsProbabilityMeasure ν] (Q : Measure (X × C)) (q : X → C → ℝ≥0∞) (hQ : ∀ A, MeasurableSet A → Q A = cellSetMass ν q A) (hsum : ∀ x, ∑ c : C, q x c = 1) : IsProbabilityMeasure Q := by apply isProbabilityMeasure_iff.mpr rw [hQ univ MeasurableSet.univ] simp [cellSetMass, hsum]
    Causalean.Stat.Minimax.Mixture.FiniteCells.isProbability_of_cellSetMass · Causalean/Stat/Minimax/Mixture/FiniteCells.lean:23
  • bind_latent_map_cellSetMass theorem — Given a covariate sample space, a finite observed-cell space, a finite latent-state space, a covariate law, latent-state weights, an observed-cell reporting map, measurable weights, and a measurable reporting map, the bound latent law has the stated finite-cell event masses.
    ν :
    w :
    X → Z → ℝ≥0∞
    obs :
    X → Z → C
    hw :
    ∀ z, Measurable fun x => w x z
    hobs :
    ∀ z, Measurable fun x => obs x z
    A :
    (ν.bind (fun x => ∑ z : Z, w x z • Measure.dirac (x, obs x z))) A
    = cellSetMass ν (fun x c => ∑ z : Z, if obs x z = c then w x z else 0) A
    Proof (Lean source)
    theorem bind_latent_map_cellSetMass {X C Z : Type*} [MeasurableSpace X] [MeasurableSpace C] [Fintype C] [DecidableEq C] [Fintype Z] (ν : Measure X) (w : X → Z → ℝ≥0∞) (obs : X → Z → C) (hw : ∀ z, Measurable fun x => w x z) (hobs : ∀ z, Measurable fun x => obs x z) : ∀ A, MeasurableSet A → (ν.bind (fun x => ∑ z : Z, w x z • Measure.dirac (x, obs x z))) A = cellSetMass ν (fun x c => ∑ z : Z, if obs x z = c then w x z else 0) A := by intro A hA have hk : Measurable (fun x => ∑ z : Z, w x z • Measure.dirac (x, obs x z)) := by classical refine Measure.measurable_of_measurable_coe _ fun s hs => ?_ simp only [Measure.finsetSum_apply] apply Finset.measurable_fun_sum intro z hz simp only [Measure.smul_apply, smul_eq_mul, Measure.dirac_apply' _ hs] exact (hw z).mul (measurable_one.indicator (hs.preimage (measurable_id.prodMk (hobs z)))) rw [Measure.bind_apply hA hk.aemeasurable] unfold cellSetMass apply lintegral_congr intro x classical simp only [Measure.finsetSum_apply, Measure.smul_apply, smul_eq_mul, Measure.dirac_apply' _ hA] calc (∑ z : Z, w x z * A.indicator 1 (x, obs x z)) = ∑ z : Z, if (x, obs x z) ∈ A then w x z else 0 := by apply Finset.sum_congr rfl intro z hz simp [indicator, mul_ite] _ = ∑ z : Z, ∑ c : C, if (x, c) ∈ A then (if obs x z = c then w x z else 0) else 0 := by apply Finset.sum_congr rfl intro z hz calc (if (x, obs x z) ∈ A then w x z else 0) = ∑ c : C, if obs x z = c then (if (x, c) ∈ A then w x z else 0) else 0 := by simp _ = ∑ c : C, if (x, c) ∈ A then (if obs x z = c then w x z else 0) else 0 := by apply Finset.sum_congr rfl intro c hc split_ifs <;> simp_all _ = ∑ c : C, ∑ z : Z, if (x, c) ∈ A then (if obs x z = c then w x z else 0) else 0 := Finset.sum_comm _ = ∑ c : C, if (x, c) ∈ A then (∑ z : Z, if obs x z = c then w x z else 0) else 0 := by apply Finset.sum_congr rfl intro c hc split_ifs <;> simp
    Causalean.Stat.Minimax.Mixture.FiniteCells.bind_latent_map_cellSetMass · Causalean/Stat/Minimax/Mixture/FiniteCells.lean:34
  • bind_cells_eq_withDensity theorem — Given a covariate sample space, a finite observed-cell space, a covariate law, reference and alternative cell masses, a likelihood, measurable masses, a measurable likelihood, and the cellwise likelihood ratio identity, the alternative finite-cell bound law is the likelihood tilt of the reference bound law.
    ν :
    p q :
    X → C → ℝ≥0∞
    L :
    X × C → ℝ
    hp :
    ∀ c, Measurable fun x => p x c
    hq :
    ∀ c, Measurable fun x => q x c
    hL :
    hratio :
    ∀ x c, q x c = p x c * ofReal (L (x, c))
    ν.bind (fun x => ∑ c : C, q x c • Measure.dirac (x, c))
    = (ν.bind (fun x => ∑ c : C, p x c • Measure.dirac (x, c))).withDensity (fun z => ofReal (L z))
    Proof (Lean source)
    theorem bind_cells_eq_withDensity {X C : Type*} [MeasurableSpace X] [MeasurableSpace C] [Fintype C] (ν : Measure X) (p q : X → C → ℝ≥0∞) (L : X × C → ℝ) (hp : ∀ c, Measurable fun x => p x c) (hq : ∀ c, Measurable fun x => q x c) (hL : Measurable L) (hratio : ∀ x c, q x c = p x c * ofReal (L (x, c))) : ν.bind (fun x => ∑ c : C, q x c • Measure.dirac (x, c)) = (ν.bind (fun x => ∑ c : C, p x c • Measure.dirac (x, c))).withDensity (fun z => ofReal (L z)) := by classical apply eq_withDensity_of_cellSetMass ν _ _ p q L hp hL · intro A hA rw [bind_latent_map_cellSetMass ν p (fun _ c => c) hp (fun _ => measurable_const) A hA] unfold cellSetMass apply lintegral_congr intro x apply Finset.sum_congr rfl intro c hc simp · intro A hA rw [bind_latent_map_cellSetMass ν q (fun _ c => c) hq (fun _ => measurable_const) A hA] unfold cellSetMass apply lintegral_congr intro x apply Finset.sum_congr rfl intro c hc simp · exact hratio
    Causalean.Stat.Minimax.Mixture.FiniteCells.bind_cells_eq_withDensity · Causalean/Stat/Minimax/Mixture/FiniteCells.lean:149
Two­Channel 1 core · 4 supporting This module turns explicit likelihoods and one-observation overlap identities into iid and independent two-channel overlaps. ★ one_add_chiSqDiv_uniformMixture_twoChannel_sign_le_exp

Two-channel iid sign mixtures

This module turns explicit likelihoods and one-observation overlap identities into iid and independent two-channel overlaps. Its uniform-mixture result feeds the finite-sign Gaussian moment bound without application-specific constants.

theorem one_add_chiSqDiv_uniformMixture_twoChannel_sign_le_exp reviewed
Causalean.Stat.Minimax.Mixture.TwoChannel

Given a positive sign-vector length and two sample sizes, two measurable sample spaces, two reference laws, two sign-indexed families of probability laws, two likelihood families, their measurability, their nonnegativity, their likelihood representations, integrable pair products, two overlap coefficients, and pairwise overlap identities stating that in each channel the reference-law mean of the product of the likelihoods at sign vectors s and t is 1 + ρ⟨s,t⟩/K, with ⟨s,t⟩ the inner sign product, one plus the chi-squared divergence of the uniform mixture over sign vectors of the two-channel iid product laws, relative to the product of the iid reference laws, is at most exp((n₁ρ₁ + n₂ρ₂)² / (2K)).

Formal statement
Ω₁ Ω₂ :
K n₁ n₂ :
ℕ
μ₁ :
Measure Ω₁
μ₂ :
Measure Ω₂
Q₁ :
(Fin K → Bool) → Measure Ω₁
Q₂ :
(Fin K → Bool) → Measure Ω₂
∀ s, IsProbabilityMeasure (Q₁ s)
∀ s, IsProbabilityMeasure (Q₂ s)
L₁ :
(Fin K → Bool) → Ω₁ → ℝ
L₂ :
(Fin K → Bool) → Ω₂ → ℝ
hL₁ :
∀ s, Measurable (L₁ s)
hL₂ :
∀ s, Measurable (L₂ s)
hL₁0 :
∀ s x, 0 ≤ L₁ s x
hL₂0 :
∀ s x, 0 ≤ L₂ s x
hQ₁ :
∀ s, Q₁ s = μ₁.withDensity (fun x => ofReal (L₁ s x))
hQ₂ :
∀ s, Q₂ s = μ₂.withDensity (fun x => ofReal (L₂ s x))
hInt₁ :
∀ s t, Integrable (fun x => L₁ s x * L₁ t x) μ₁
hInt₂ :
∀ s t, Integrable (fun x => L₂ s x * L₂ t x) μ₂
ρ₁ ρ₂ :
ℝ
hPair₁ :
∀ s t, (∫ x, L₁ s x * L₁ t x ∂μ₁) = 1 + ρ₁ * innerSign s t / (K : ℝ)
hPair₂ :
∀ s t, (∫ x, L₂ s x * L₂ t x ∂μ₂) = 1 + ρ₂ * innerSign s t / (K : ℝ)
1
+ chiSqDiv (uniformMixture (fun s => (Measure.pi (fun _ : Fin n₁ => Q₁ s)).prod (Measure.pi (fun _ : Fin n₂ => Q₂ s)))) ((Measure.pi (fun _ : Fin n₁ => μ₁)).prod (Measure.pi (fun _ : Fin n₂ => μ₂)))
≤ exp (((n₁ : ℝ) * ρ₁ + (n₂ : ℝ) * ρ₂) ^ 2 / (2 * (K : ℝ)))
Proof (Lean source)
theorem one_add_chiSqDiv_uniformMixture_twoChannel_sign_le_exp {Ω₁ Ω₂ : Type*} [MeasurableSpace Ω₁] [MeasurableSpace Ω₂] (K n₁ n₂ : ℕ) [NeZero K] (μ₁ : Measure Ω₁) (μ₂ : Measure Ω₂) (Q₁ : (Fin K → Bool) → Measure Ω₁) (Q₂ : (Fin K → Bool) → Measure Ω₂) [IsProbabilityMeasure μ₁] [IsProbabilityMeasure μ₂] [∀ s, IsProbabilityMeasure (Q₁ s)] [∀ s, IsProbabilityMeasure (Q₂ s)] (L₁ : (Fin K → Bool) → Ω₁ → ℝ) (L₂ : (Fin K → Bool) → Ω₂ → ℝ) (hL₁ : ∀ s, Measurable (L₁ s)) (hL₂ : ∀ s, Measurable (L₂ s)) (hL₁0 : ∀ s x, 0 ≤ L₁ s x) (hL₂0 : ∀ s x, 0 ≤ L₂ s x) (hQ₁ : ∀ s, Q₁ s = μ₁.withDensity (fun x => ofReal (L₁ s x))) (hQ₂ : ∀ s, Q₂ s = μ₂.withDensity (fun x => ofReal (L₂ s x))) (hInt₁ : ∀ s t, Integrable (fun x => L₁ s x * L₁ t x) μ₁) (hInt₂ : ∀ s t, Integrable (fun x => L₂ s x * L₂ t x) μ₂) (ρ₁ ρ₂ : ℝ) (hPair₁ : ∀ s t, (∫ x, L₁ s x * L₁ t x ∂μ₁) = 1 + ρ₁ * innerSign s t / (K : ℝ)) (hPair₂ : ∀ s t, (∫ x, L₂ s x * L₂ t x ∂μ₂) = 1 + ρ₂ * innerSign s t / (K : ℝ)) : 1 + chiSqDiv (uniformMixture (fun s => (Measure.pi (fun _ : Fin n₁ => Q₁ s)).prod (Measure.pi (fun _ : Fin n₂ => Q₂ s)))) ((Measure.pi (fun _ : Fin n₁ => μ₁)).prod (Measure.pi (fun _ : Fin n₂ => μ₂))) ≤ exp (((n₁ : ℝ) * ρ₁ + (n₂ : ℝ) * ρ₂) ^ 2 / (2 * (K : ℝ))) := by have hb₁ (s t : Fin K → Bool) : 0 ≤ 1 + ρ₁ * innerSign s t / (K : ℝ) := by rw [← hPair₁ s t] exact integral_nonneg (fun x => mul_nonneg (hL₁0 s x) (hL₁0 t x)) have hb₂ (s t : Fin K → Bool) : 0 ≤ 1 + ρ₂ * innerSign s t / (K : ℝ) := by rw [← hPair₂ s t] exact integral_nonneg (fun x => mul_nonneg (hL₂0 s x) (hL₂0 t x)) rw [one_add_chiSqDiv_uniformMixture_twoChannel_sign K n₁ n₂ μ₁ μ₂ Q₁ Q₂ L₁ L₂ hL₁ hL₂ hL₁0 hL₂0 hQ₁ hQ₂ hInt₁ hInt₂ ρ₁ ρ₂ hPair₁ hPair₂] exact uniform_sign_twoPower_le_exp K n₁ n₂ ρ₁ ρ₂ hb₁ hb₂
Causalean.Stat.Minimax.Mixture.TwoChannel.one_add_chiSqDiv_uniformMixture_twoChannel_sign_le_exp · Causalean/Stat/Minimax/Mixture/TwoChannel.lean:182 · uses innerSign , uniformMixture , chiSqDiv
4 supporting declarations (lemmas, instances)
  • integral_likelihood_eq_one theorem — Given a measurable sample space, a reference probability law, an alternative probability law, a likelihood, its measurability and nonnegativity, and its likelihood representation, the likelihood integrates to one under the reference law.
    Ω :
    L :
    Ω → ℝ
    hL :
    hL0 :
    ∀ x, 0 ≤ L x
    hQ :
    Q = μ.withDensity (fun x => ofReal (L x))
    ∫ x, L x ∂μ = 1
    Proof (Lean source)
    theorem integral_likelihood_eq_one {Ω : Type*} [MeasurableSpace Ω] (μ Q : Measure Ω) [IsProbabilityMeasure μ] [IsProbabilityMeasure Q] (L : Ω → ℝ) (hL : Measurable L) (hL0 : ∀ x, 0 ≤ L x) (hQ : Q = μ.withDensity (fun x => ofReal (L x))) : ∫ x, L x ∂μ = 1 := by have hLeq : (fun x => (Q.rnDeriv μ x).toReal) =ᵐ[μ] L := by rw [hQ] filter_upwards [Measure.rnDeriv_withDensity μ hL.ennreal_ofReal] with x hx simp [hx, ENNReal.toReal_ofReal (hL0 x)] have hac : Q ≪ μ := by rw [hQ] exact withDensity_absolutelyContinuous μ _ calc ∫ x, L x ∂μ = ∫ x, (Q.rnDeriv μ x).toReal ∂μ := integral_congr_ae hLeq.symm _ = 1 := by simpa using (Measure.integral_toReal_rnDeriv hac)
    Causalean.Stat.Minimax.Mixture.TwoChannel.integral_likelihood_eq_one · Causalean/Stat/Minimax/Mixture/TwoChannel.lean:17
  • iid_pair_overlap_of_likelihood theorem — Given a measurable sample space, a reference probability law and two alternative probability laws, two likelihoods, their measurability, their nonnegativity, their likelihood representations, an integrable one-observation likelihood product, and a sample size, the iid pair overlap is the corresponding power of the one-observation overlap.
    Ω :
    L M :
    Ω → ℝ
    hL :
    hM :
    hL0 :
    ∀ x, 0 ≤ L x
    hM0 :
    ∀ x, 0 ≤ M x
    hQ :
    Q = μ.withDensity (fun x => ofReal (L x))
    hR :
    R = μ.withDensity (fun x => ofReal (M x))
    hpairInt :
    Integrable (fun x => L x * M x) μ
    n :
    ℕ
    (∫ x, (((Measure.pi (fun _ : Fin n => Q)).rnDeriv (Measure.pi (fun _ : Fin n => μ)) x).toReal) * (((Measure.pi (fun _ : Fin n => R)).rnDeriv (Measure.pi (fun _ : Fin n => μ)) x).toReal) ∂(Measure.pi (fun _ : Fin n => μ)))
    = (∫ x, L x * M x ∂μ) ^ n
    Proof (Lean source)
    theorem iid_pair_overlap_of_likelihood {Ω : Type*} [MeasurableSpace Ω] (μ Q R : Measure Ω) [IsProbabilityMeasure μ] [IsProbabilityMeasure Q] [IsProbabilityMeasure R] (L M : Ω → ℝ) (hL : Measurable L) (hM : Measurable M) (hL0 : ∀ x, 0 ≤ L x) (hM0 : ∀ x, 0 ≤ M x) (hQ : Q = μ.withDensity (fun x => ofReal (L x))) (hR : R = μ.withDensity (fun x => ofReal (M x))) (hpairInt : Integrable (fun x => L x * M x) μ) (n : ℕ) : (∫ x, (((Measure.pi (fun _ : Fin n => Q)).rnDeriv (Measure.pi (fun _ : Fin n => μ)) x).toReal) * (((Measure.pi (fun _ : Fin n => R)).rnDeriv (Measure.pi (fun _ : Fin n => μ)) x).toReal) ∂(Measure.pi (fun _ : Fin n => μ))) = (∫ x, L x * M x ∂μ) ^ n := by have hLeq : (fun x => (Q.rnDeriv μ x).toReal) =ᵐ[μ] L := by rw [hQ] filter_upwards [Measure.rnDeriv_withDensity μ hL.ennreal_ofReal] with x hx simp [hx, ENNReal.toReal_ofReal (hL0 x)] have hMeq : (fun x => (R.rnDeriv μ x).toReal) =ᵐ[μ] M := by rw [hR] filter_upwards [Measure.rnDeriv_withDensity μ hM.ennreal_ofReal] with x hx simp [hx, ENNReal.toReal_ofReal (hM0 x)] have hprod : (fun x => (Q.rnDeriv μ x).toReal * (R.rnDeriv μ x).toReal) =ᵐ[μ] (fun x => L x * M x) := by filter_upwards [hLeq, hMeq] with x hx hy simp [hx, hy] have hacQ : Q ≪ μ := by rw [hQ] exact withDensity_absolutelyContinuous μ _ have hacR : R ≪ μ := by rw [hR] exact withDensity_absolutelyContinuous μ _ have hint : Integrable (fun x => (Q.rnDeriv μ x).toReal * (R.rnDeriv μ x).toReal) μ := hpairInt.congr hprod.symm rw [iidPairOverlap μ Q R hacQ hacR n] congr 1 exact integral_congr_ae hprod
    Causalean.Stat.Minimax.Mixture.TwoChannel.iid_pair_overlap_of_likelihood · Causalean/Stat/Minimax/Mixture/TwoChannel.lean:35
  • two_channel_pair_overlap theorem — Given two measurable sample spaces, two reference laws, two pairs of alternative laws, two pairs of likelihoods, their measurability, their nonnegativity, their likelihood representations, integrable one-observation likelihood products, and two sample sizes, the independent iid pair overlap is the product of the two channel powers.
    Ω₁ Ω₂ :
    μ₁ :
    Measure Ω₁
    μ₂ :
    Measure Ω₂
    Q₁ R₁ :
    Measure Ω₁
    Q₂ R₂ :
    Measure Ω₂
    L₁ M₁ :
    Ω₁ → ℝ
    L₂ M₂ :
    Ω₂ → ℝ
    hL₁ :
    hM₁ :
    hL₂ :
    hM₂ :
    hL₁0 :
    ∀ x, 0 ≤ L₁ x
    hM₁0 :
    ∀ x, 0 ≤ M₁ x
    hL₂0 :
    ∀ x, 0 ≤ L₂ x
    hM₂0 :
    ∀ x, 0 ≤ M₂ x
    hQ₁ :
    Q₁ = μ₁.withDensity (fun x => ofReal (L₁ x))
    hR₁ :
    R₁ = μ₁.withDensity (fun x => ofReal (M₁ x))
    hQ₂ :
    Q₂ = μ₂.withDensity (fun x => ofReal (L₂ x))
    hR₂ :
    R₂ = μ₂.withDensity (fun x => ofReal (M₂ x))
    hInt₁ :
    Integrable (fun x => L₁ x * M₁ x) μ₁
    hInt₂ :
    Integrable (fun x => L₂ x * M₂ x) μ₂
    n₁ n₂ :
    ℕ
    (∫ x, ((((Measure.pi (fun _ : Fin n₁ => Q₁)).prod (Measure.pi (fun _ : Fin n₂ => Q₂))).rnDeriv ((Measure.pi (fun _ : Fin n₁ => μ₁)).prod (Measure.pi (fun _ : Fin n₂ => μ₂))) x).toReal) * ((((Measure.pi (fun _ : Fin n₁ => R₁)).prod (Measure.pi (fun _ : Fin n₂ => R₂))).rnDeriv ((Measure.pi (fun _ : Fin n₁ => μ₁)).prod (Measure.pi (fun _ : Fin n₂ => μ₂))) x).toReal) ∂((Measure.pi (fun _ : Fin n₁ => μ₁)).prod (Measure.pi (fun _ : Fin n₂ => μ₂))))
    = (∫ x, L₁ x * M₁ x ∂μ₁) ^ n₁ * (∫ x, L₂ x * M₂ x ∂μ₂) ^ n₂
    Proof (Lean source)
    theorem two_channel_pair_overlap {Ω₁ Ω₂ : Type*} [MeasurableSpace Ω₁] [MeasurableSpace Ω₂] (μ₁ : Measure Ω₁) (μ₂ : Measure Ω₂) (Q₁ R₁ : Measure Ω₁) (Q₂ R₂ : Measure Ω₂) [IsProbabilityMeasure μ₁] [IsProbabilityMeasure μ₂] [IsProbabilityMeasure Q₁] [IsProbabilityMeasure R₁] [IsProbabilityMeasure Q₂] [IsProbabilityMeasure R₂] (L₁ M₁ : Ω₁ → ℝ) (L₂ M₂ : Ω₂ → ℝ) (hL₁ : Measurable L₁) (hM₁ : Measurable M₁) (hL₂ : Measurable L₂) (hM₂ : Measurable M₂) (hL₁0 : ∀ x, 0 ≤ L₁ x) (hM₁0 : ∀ x, 0 ≤ M₁ x) (hL₂0 : ∀ x, 0 ≤ L₂ x) (hM₂0 : ∀ x, 0 ≤ M₂ x) (hQ₁ : Q₁ = μ₁.withDensity (fun x => ofReal (L₁ x))) (hR₁ : R₁ = μ₁.withDensity (fun x => ofReal (M₁ x))) (hQ₂ : Q₂ = μ₂.withDensity (fun x => ofReal (L₂ x))) (hR₂ : R₂ = μ₂.withDensity (fun x => ofReal (M₂ x))) (hInt₁ : Integrable (fun x => L₁ x * M₁ x) μ₁) (hInt₂ : Integrable (fun x => L₂ x * M₂ x) μ₂) (n₁ n₂ : ℕ) : (∫ x, ((((Measure.pi (fun _ : Fin n₁ => Q₁)).prod (Measure.pi (fun _ : Fin n₂ => Q₂))).rnDeriv ((Measure.pi (fun _ : Fin n₁ => μ₁)).prod (Measure.pi (fun _ : Fin n₂ => μ₂))) x).toReal) * ((((Measure.pi (fun _ : Fin n₁ => R₁)).prod (Measure.pi (fun _ : Fin n₂ => R₂))).rnDeriv ((Measure.pi (fun _ : Fin n₁ => μ₁)).prod (Measure.pi (fun _ : Fin n₂ => μ₂))) x).toReal) ∂((Measure.pi (fun _ : Fin n₁ => μ₁)).prod (Measure.pi (fun _ : Fin n₂ => μ₂)))) = (∫ x, L₁ x * M₁ x ∂μ₁) ^ n₁ * (∫ x, L₂ x * M₂ x ∂μ₂) ^ n₂ := by have hQ₁' := iid_absolutelyContinuous_of_likelihood μ₁ Q₁ L₁ hQ₁ n₁ have hR₁' := iid_absolutelyContinuous_of_likelihood μ₁ R₁ M₁ hR₁ n₁ have hQ₂' := iid_absolutelyContinuous_of_likelihood μ₂ Q₂ L₂ hQ₂ n₂ have hR₂' := iid_absolutelyContinuous_of_likelihood μ₂ R₂ M₂ hR₂ n₂ have hInt₁' := iid_pair_integrable_of_likelihood μ₁ Q₁ R₁ L₁ M₁ hL₁ hM₁ hL₁0 hM₁0 hQ₁ hR₁ hInt₁ n₁ have hInt₂' := iid_pair_integrable_of_likelihood μ₂ Q₂ R₂ L₂ M₂ hL₂ hM₂ hL₂0 hM₂0 hQ₂ hR₂ hInt₂ n₂ rw [product_pair_overlap (Measure.pi (fun _ : Fin n₁ => μ₁)) (Measure.pi (fun _ : Fin n₁ => Q₁)) (Measure.pi (fun _ : Fin n₁ => R₁)) (Measure.pi (fun _ : Fin n₂ => μ₂)) (Measure.pi (fun _ : Fin n₂ => Q₂)) (Measure.pi (fun _ : Fin n₂ => R₂)) hQ₁' hR₁' hQ₂' hR₂', iid_pair_overlap_of_likelihood μ₁ Q₁ R₁ L₁ M₁ hL₁ hM₁ hL₁0 hM₁0 hQ₁ hR₁ hInt₁ n₁, iid_pair_overlap_of_likelihood μ₂ Q₂ R₂ L₂ M₂ hL₂ hM₂ hL₂0 hM₂0 hQ₂ hR₂ hInt₂ n₂]
    Causalean.Stat.Minimax.Mixture.TwoChannel.two_channel_pair_overlap · Causalean/Stat/Minimax/Mixture/TwoChannel.lean:70
  • one_add_chiSqDiv_uniformMixture_twoChannel_sign theorem — Given a positive sign-vector length and two sample sizes, two measurable sample spaces, two reference laws, two sign-indexed families of probability laws, two likelihood families, their measurability, their nonnegativity, their likelihood representations, integrable pair products, two overlap coefficients, and their pairwise overlap identities, one plus the chi-squared divergence of the uniform two-channel iid mixture is the uniform double average of its sign-overlap factors.
    Ω₁ Ω₂ :
    K n₁ n₂ :
    ℕ
    μ₁ :
    Measure Ω₁
    μ₂ :
    Measure Ω₂
    Q₁ :
    (Fin K → Bool) → Measure Ω₁
    Q₂ :
    (Fin K → Bool) → Measure Ω₂
    ∀ s, IsProbabilityMeasure (Q₁ s)
    ∀ s, IsProbabilityMeasure (Q₂ s)
    L₁ :
    (Fin K → Bool) → Ω₁ → ℝ
    L₂ :
    (Fin K → Bool) → Ω₂ → ℝ
    hL₁ :
    ∀ s, Measurable (L₁ s)
    hL₂ :
    ∀ s, Measurable (L₂ s)
    hL₁0 :
    ∀ s x, 0 ≤ L₁ s x
    hL₂0 :
    ∀ s x, 0 ≤ L₂ s x
    hQ₁ :
    ∀ s, Q₁ s = μ₁.withDensity (fun x => ofReal (L₁ s x))
    hQ₂ :
    ∀ s, Q₂ s = μ₂.withDensity (fun x => ofReal (L₂ s x))
    hInt₁ :
    ∀ s t, Integrable (fun x => L₁ s x * L₁ t x) μ₁
    hInt₂ :
    ∀ s t, Integrable (fun x => L₂ s x * L₂ t x) μ₂
    ρ₁ ρ₂ :
    ℝ
    hPair₁ :
    ∀ s t, (∫ x, L₁ s x * L₁ t x ∂μ₁) = 1 + ρ₁ * innerSign s t / (K : ℝ)
    hPair₂ :
    ∀ s t, (∫ x, L₂ s x * L₂ t x ∂μ₂) = 1 + ρ₂ * innerSign s t / (K : ℝ)
    1
    + chiSqDiv (uniformMixture (fun s => (Measure.pi (fun _ : Fin n₁ => Q₁ s)).prod (Measure.pi (fun _ : Fin n₂ => Q₂ s)))) ((Measure.pi (fun _ : Fin n₁ => μ₁)).prod (Measure.pi (fun _ : Fin n₂ => μ₂)))
    = (∑ s : Fin K → Bool, ∑ t : Fin K → Bool, (1 + ρ₁ * innerSign s t / (K : ℝ)) ^ n₁ * (1 + ρ₂ * innerSign s t / (K : ℝ)) ^ n₂) / (card (Fin K → Bool) : ℝ) ^ 2
    Proof (Lean source)
    theorem one_add_chiSqDiv_uniformMixture_twoChannel_sign {Ω₁ Ω₂ : Type*} [MeasurableSpace Ω₁] [MeasurableSpace Ω₂] (K n₁ n₂ : ℕ) [NeZero K] (μ₁ : Measure Ω₁) (μ₂ : Measure Ω₂) (Q₁ : (Fin K → Bool) → Measure Ω₁) (Q₂ : (Fin K → Bool) → Measure Ω₂) [IsProbabilityMeasure μ₁] [IsProbabilityMeasure μ₂] [∀ s, IsProbabilityMeasure (Q₁ s)] [∀ s, IsProbabilityMeasure (Q₂ s)] (L₁ : (Fin K → Bool) → Ω₁ → ℝ) (L₂ : (Fin K → Bool) → Ω₂ → ℝ) (hL₁ : ∀ s, Measurable (L₁ s)) (hL₂ : ∀ s, Measurable (L₂ s)) (hL₁0 : ∀ s x, 0 ≤ L₁ s x) (hL₂0 : ∀ s x, 0 ≤ L₂ s x) (hQ₁ : ∀ s, Q₁ s = μ₁.withDensity (fun x => ofReal (L₁ s x))) (hQ₂ : ∀ s, Q₂ s = μ₂.withDensity (fun x => ofReal (L₂ s x))) (hInt₁ : ∀ s t, Integrable (fun x => L₁ s x * L₁ t x) μ₁) (hInt₂ : ∀ s t, Integrable (fun x => L₂ s x * L₂ t x) μ₂) (ρ₁ ρ₂ : ℝ) (hPair₁ : ∀ s t, (∫ x, L₁ s x * L₁ t x ∂μ₁) = 1 + ρ₁ * innerSign s t / (K : ℝ)) (hPair₂ : ∀ s t, (∫ x, L₂ s x * L₂ t x ∂μ₂) = 1 + ρ₂ * innerSign s t / (K : ℝ)) : 1 + chiSqDiv (uniformMixture (fun s => (Measure.pi (fun _ : Fin n₁ => Q₁ s)).prod (Measure.pi (fun _ : Fin n₂ => Q₂ s)))) ((Measure.pi (fun _ : Fin n₁ => μ₁)).prod (Measure.pi (fun _ : Fin n₂ => μ₂))) = (∑ s : Fin K → Bool, ∑ t : Fin K → Bool, (1 + ρ₁ * innerSign s t / (K : ℝ)) ^ n₁ * (1 + ρ₂ * innerSign s t / (K : ℝ)) ^ n₂) / (card (Fin K → Bool) : ℝ) ^ 2 := by classical have hac (s : Fin K → Bool) : (Measure.pi (fun _ : Fin n₁ => Q₁ s)).prod (Measure.pi (fun _ : Fin n₂ => Q₂ s)) ≪ (Measure.pi (fun _ : Fin n₁ => μ₁)).prod (Measure.pi (fun _ : Fin n₂ => μ₂)) := (iid_absolutelyContinuous_of_likelihood μ₁ (Q₁ s) (L₁ s) (hQ₁ s) n₁).prod (iid_absolutelyContinuous_of_likelihood μ₂ (Q₂ s) (L₂ s) (hQ₂ s) n₂) have hpair (s t : Fin K → Bool) : Integrable (fun x => (((Measure.pi (fun _ : Fin n₁ => Q₁ s)).prod (Measure.pi (fun _ : Fin n₂ => Q₂ s))).rnDeriv ((Measure.pi (fun _ : Fin n₁ => μ₁)).prod (Measure.pi (fun _ : Fin n₂ => μ₂))) x).toReal * (((Measure.pi (fun _ : Fin n₁ => Q₁ t)).prod (Measure.pi (fun _ : Fin n₂ => Q₂ t))).rnDeriv ((Measure.pi (fun _ : Fin n₁ => μ₁)).prod (Measure.pi (fun _ : Fin n₂ => μ₂))) x).toReal) ((Measure.pi (fun _ : Fin n₁ => μ₁)).prod (Measure.pi (fun _ : Fin n₂ => μ₂))) := by exact product_pair_integrable (Measure.pi (fun _ : Fin n₁ => μ₁)) (Measure.pi (fun _ : Fin n₁ => Q₁ s)) (Measure.pi (fun _ : Fin n₁ => Q₁ t)) (Measure.pi (fun _ : Fin n₂ => μ₂)) (Measure.pi (fun _ : Fin n₂ => Q₂ s)) (Measure.pi (fun _ : Fin n₂ => Q₂ t)) (iid_absolutelyContinuous_of_likelihood μ₁ (Q₁ s) (L₁ s) (hQ₁ s) n₁) (iid_absolutelyContinuous_of_likelihood μ₁ (Q₁ t) (L₁ t) (hQ₁ t) n₁) (iid_absolutelyContinuous_of_likelihood μ₂ (Q₂ s) (L₂ s) (hQ₂ s) n₂) (iid_absolutelyContinuous_of_likelihood μ₂ (Q₂ t) (L₂ t) (hQ₂ t) n₂) (iid_pair_integrable_of_likelihood μ₁ (Q₁ s) (Q₁ t) (L₁ s) (L₁ t) (hL₁ s) (hL₁ t) (hL₁0 s) (hL₁0 t) (hQ₁ s) (hQ₁ t) (hInt₁ s t) n₁) (iid_pair_integrable_of_likelihood μ₂ (Q₂ s) (Q₂ t) (L₂ s) (L₂ t) (hL₂ s) (hL₂ t) (hL₂0 s) (hL₂0 t) (hQ₂ s) (hQ₂ t) (hInt₂ s t) n₂) rw [one_add_chiSqDiv_uniformMixture (fun s => (Measure.pi (fun _ : Fin n₁ => Q₁ s)).prod (Measure.pi (fun _ : Fin n₂ => Q₂ s))) ((Measure.pi (fun _ : Fin n₁ => μ₁)).prod (Measure.pi (fun _ : Fin n₂ => μ₂))) hac hpair] congr 1 apply Finset.sum_congr rfl intro s _ apply Finset.sum_congr rfl intro t _ rw [two_channel_pair_overlap μ₁ μ₂ (Q₁ s) (Q₁ t) (Q₂ s) (Q₂ t) (L₁ s) (L₁ t) (L₂ s) (L₂ t) (hL₁ s) (hL₁ t) (hL₂ s) (hL₂ t) (hL₁0 s) (hL₁0 t) (hL₂0 s) (hL₂0 t) (hQ₁ s) (hQ₁ t) (hQ₂ s) (hQ₂ t) (hInt₁ s t) (hInt₂ s t) n₁ n₂, hPair₁ s t, hPair₂ s t]
    Causalean.Stat.Minimax.Mixture.TwoChannel.one_add_chiSqDiv_uniformMixture_twoChannel_sign · Causalean/Stat/Minimax/Mixture/TwoChannel.lean:109