Mathlib.Probability.Independence.Conditional
Tools for working with conditional independence of random variables and σ-algebras.
AELift 1 core · 3 supporting This file proves generic almost-everywhere equality lifting lemmas under an overlap-style null-set hypothesis. ★ ae_eq_of_ae_eq_restrict_arm
Almost-Everywhere Lifts Under Overlap
This file proves generic almost-everywhere equality lifting lemmas under an overlap-style null-set hypothesis.
The exported support lemmas convert between restricted a.e. equality and
indicator equality (indicator_aeEq_of_aeEq_restrict,
aeEq_restrict_of_indicator_aeEq) and propagate vanishing through conditional
expectation (condExp_indicator_aeEq_zero). The main public theorem is
ae_eq_of_ae_eq_restrict_arm.
Restricted-set a.e.-equality lift for σ-measurable functions. For a sub-σ-algebra m such that m is coarser than the ambient σ-algebra, if f and g agree on an m-measurable set, they agree almost everywhere on the restriction of the measure to a set E, and every m-measurable set whose intersection with E is null is itself null, then f and g agree almost everywhere on the whole space.
Formal statement
Proof (Lean source)
3 supporting declarations (lemmas, instances)
-
indicator_aeEq_of_aeEq_restrictlemma — Push an a.e.-equality under μ.restrict s to a global equality of s-indicators.hypothesesΩ :hs :β :h :f =ᵐ[μ.restrict s] gconclusions.indicator f =ᵐ[μ] s.indicator gProof (Lean source)
lemma indicator_aeEq_of_aeEq_restrict {Ω : Type*} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {s : Set Ω} (hs : MeasurableSet s) {β : Type*} [Zero β] {f g : Ω → β} (h : f =ᵐ[μ.restrict s] g) : s.indicator f =ᵐ[μ] s.indicator g := by have h_on : ∀ᵐ ω ∂(μ.restrict s), s.indicator f ω = s.indicator g ω := by filter_upwards [h, ae_restrict_mem hs] with ω hω hωs rw [Set.indicator_of_mem hωs, Set.indicator_of_mem hωs, hω] have h_off : ∀ᵐ ω ∂(μ.restrict sᶜ), s.indicator f ω = s.indicator g ω := by rw [ae_restrict_iff' hs.compl] filter_upwards with ω hωs rw [Set.indicator_of_notMem hωs, Set.indicator_of_notMem hωs] exact MeasureTheory.ae_of_ae_restrict_of_ae_restrict_compl s h_on h_off -
aeEq_restrict_of_indicator_aeEqlemma — Recover a μ.restrict s a.e.-equality from a global equality of s-indicators.hypothesesΩ :hs :β :h :s.indicator f =ᵐ[μ] s.indicator gconclusionf =ᵐ[μ.restrict s] gProof (Lean source)
lemma aeEq_restrict_of_indicator_aeEq {Ω : Type*} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {s : Set Ω} (hs : MeasurableSet s) {β : Type*} [Zero β] {f g : Ω → β} (h : s.indicator f =ᵐ[μ] s.indicator g) : f =ᵐ[μ.restrict s] g := by rw [EventuallyEq, ae_restrict_iff' hs] filter_upwards [h] with ω hω hωs have hf : s.indicator f ω = f ω := Set.indicator_of_mem hωs f have hg : s.indicator g ω = g ω := Set.indicator_of_mem hωs g simpa [hf, hg] using hω -
condExp_indicator_aeEq_zerolemma — If an integrable function vanishes after restriction by an m-measurable indicator, so does its conditional expectation.hypothesesconclusions.indicator (μ[f | m]) =ᵐ[μ] 0Proof (Lean source)
lemma condExp_indicator_aeEq_zero {Ω : Type*} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} {m : MeasurableSpace Ω} {s : Set Ω} (hs : MeasurableSet[m] s) {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] [CompleteSpace E] {f : Ω → E} (hf : Integrable f μ) (h : s.indicator f =ᵐ[μ] 0) : s.indicator (μ[f | m]) =ᵐ[μ] 0 := by have hCE_ind := MeasureTheory.condExp_indicator (m := m) hf hs have hLHS_zero : μ[s.indicator f | m] =ᵐ[μ] 0 := by refine (MeasureTheory.condExp_congr_ae (m := m) h).trans ?_ rw [MeasureTheory.condExp_zero (m := m) (μ := μ) (E := E)] exact hCE_ind.symm.trans hLHS_zero
CondExp_Part1 1 core · 3 supporting This first half proves drop-of-conditioning and product-factorization identities implied by conditional independence. ★ condExp_mul_of_condIndep
Conditional Expectations Under Conditional Independence
This first half proves drop-of-conditioning and product-factorization identities implied by conditional independence. These identities express how irrelevant conditioning information can be removed and how conditionally independent factors separate inside conditional expectations.
The central exported lemmas are condExp_sup_comap_eq_of_condIndep_comap and
condExp_sup_comap_eq_of_condIndep for removing irrelevant conditioning
variables, condExp_mul_of_condIndep for factoring a product's conditional
expectation. CondExp_Part2.lean imports this module and adds weak union,
measurable-coordinate extension, and semigraphoid contraction.
Conditional-independence factorization of a product's conditional expectation. For a sub-σ-algebra m coarser than the ambient σ-algebra, measurable maps f and g that are conditionally independent given m, and measurable real-valued functions u and v such that u ∘ f, v ∘ g, and their pointwise product are all integrable, then the conditional expectation, given m, of the product (u ∘ f)·(v ∘ g) equals the product of the separate conditional expectations of u ∘ f and v ∘ g given m.
Formal statement
Proof (Lean source)
3 supporting declarations (lemmas, instances)
-
setIntegral_condExp_indep_indicatortheorem — Under conditional independence of two variables given a σ-algebra, integrating the conditional expectation of a constant times an event indicator over the intersection of a conditioning event and an event determined by one variable equals integrating that indicator directly.hypothesesΩ α β :Type*hm :m ≤ mΩμ :f :Ω → αg :Ω → βhf :hg :hCI :CondIndepFun m hm g f μS A F :Set ΩhS :hA :MeasurableSet[m] AhF :c :ℝconclusion∫ x in A ∩ F, (μ[S.indicator (fun _ : Ω => c) | m]) x ∂μ= ∫ x in A ∩ F, S.indicator (fun _ : Ω => c) x ∂μProof (Lean source)
theorem setIntegral_condExp_indep_indicator {Ω α β : Type*} {m mΩ : MeasurableSpace Ω} (hm : m ≤ mΩ) [MeasurableSpace α] [MeasurableSpace β] [StandardBorelSpace Ω] {μ : Measure Ω} [IsFiniteMeasure μ] {f : Ω → α} {g : Ω → β} (hf : Measurable f) (hg : Measurable g) (hCI : CondIndepFun m hm g f μ) {S A F : Set Ω} (hS : MeasurableSet[comap g inferInstance] S) (hA : MeasurableSet[m] A) (hF : MeasurableSet[comap f inferInstance] F) (c : ℝ) : ∫ x in A ∩ F, (μ[S.indicator (fun _ : Ω => c) | m]) x ∂μ = ∫ x in A ∩ F, S.indicator (fun _ : Ω => c) x ∂μ := by let oneS : Ω → ℝ := S.indicator (fun _ => (1 : ℝ)) have hsmul_fun : (fun ω => c • oneS ω) = S.indicator (fun _ : Ω => c) := by ext ω by_cases hω : ω ∈ S <;> simp [oneS, hω] have hsmul_ae : (fun ω => c • oneS ω) =ᵐ[μ] S.indicator (fun _ : Ω => c) := by exact MeasureTheory.ae_of_all μ fun ω => congrFun hsmul_fun ω have hce : μ[S.indicator (fun _ : Ω => c) | m] =ᵐ[μ] fun ω => c * (μ⟦S | m⟧) ω := by have h1 : μ[S.indicator (fun _ : Ω => c) | m] =ᵐ[μ] μ[fun ω => c • oneS ω | m] := by exact (MeasureTheory.condExp_congr_ae hsmul_ae).symm have h2 := MeasureTheory.condExp_smul (μ := μ) (c := c) (f := oneS) (m := m) refine h1.trans ?_ filter_upwards [h2] with ω hω exact hω calc ∫ x in A ∩ F, (μ[S.indicator (fun _ : Ω => c) | m]) x ∂μ = ∫ x in A ∩ F, (fun ω => c * (μ⟦S | m⟧) ω) x ∂μ := by refine MeasureTheory.setIntegral_congr_ae ((hm _ hA).inter (hf.comap_le _ hF)) ?_ exact hce.mono fun x hx _ => hx _ = c * ∫ x in A ∩ F, (μ⟦S | m⟧) x ∂μ := by rw [MeasureTheory.integral_const_mul] _ = c * ∫ x in A ∩ F, oneS x ∂μ := by rw [setIntegral_condExp_indep_indicator_one hm hf hg hCI hS hA hF] _ = ∫ x in A ∩ F, (fun ω => c * oneS ω) x ∂μ := by rw [MeasureTheory.integral_const_mul] _ = ∫ x in A ∩ F, S.indicator (fun _ : Ω => c) x ∂μ := by refine MeasureTheory.setIntegral_congr_fun ((hm _ hA).inter (hf.comap_le _ hF)) ?_ intro x _hx simpa [Pi.smul_apply, smul_eq_mul] using congrFun hsmul_fun x -
condExp_sup_comap_eq_of_condIndep_comaptheorem — If g is conditionally independent of f given m, conditioning a σ(g)-measurable integrable real function on m ⊔ σ(f) is the same as conditioning it on m, up to μ-a.e. equality.hypothesesΩ α β :Type*hm :m ≤ mΩμ :f :Ω → αg :Ω → βhf :hg :hCI :CondIndepFun m hm g f μY :Ω → ℝhY_meas :hY_int :Integrable Y μconclusionμ[Y | m ⊔ comap f inferInstance] =ᵐ[μ] μ[Y | m]Proof (Lean source)
theorem condExp_sup_comap_eq_of_condIndep_comap {Ω α β : Type*} {m mΩ : MeasurableSpace Ω} (hm : m ≤ mΩ) [MeasurableSpace α] [MeasurableSpace β] [StandardBorelSpace Ω] {μ : Measure Ω} [IsFiniteMeasure μ] {f : Ω → α} {g : Ω → β} (hf : Measurable f) (hg : Measurable g) (hCI : CondIndepFun m hm g f μ) {Y : Ω → ℝ} (hY_meas : @Measurable Ω ℝ (MeasurableSpace.comap g inferInstance) _ Y) (hY_int : Integrable Y μ) : μ[Y | m ⊔ MeasurableSpace.comap f inferInstance] =ᵐ[μ] μ[Y | m] := by let mf : MeasurableSpace Ω := MeasurableSpace.comap f inferInstance let mg : MeasurableSpace Ω := MeasurableSpace.comap g inferInstance let M : MeasurableSpace Ω := m ⊔ mf have hmM : M ≤ mΩ := by dsimp [M, mf] exact sup_le hm hf.comap_le have hmg : mg ≤ mΩ := by dsimp [mg] exact hg.comap_le haveI : SigmaFinite (μ.trim hm) := by infer_instance haveI : SigmaFinite (μ.trim hmM) := by infer_instance haveI : SigmaFinite (μ.trim hmg) := by infer_instance let T_M : (Ω →₁[μ] ℝ) →L[ℝ] Ω →₁[μ] ℝ := MeasureTheory.condExpL1CLM ℝ hmM μ let T_m : (Ω →₁[μ] ℝ) →L[ℝ] Ω →₁[μ] ℝ := MeasureTheory.condExpL1CLM ℝ hm μ have hL1 : T_M (hY_int.toL1 Y) = T_m (hY_int.toL1 Y) := by have hP_ind : ∀ (c : ℝ) {s : Set Ω} (hs : MeasurableSet[mg] s) (hμs : μ s < ⊤), T_M (@MeasureTheory.Lp.simpleFunc.indicatorConst Ω ℝ mΩ _ (1 : ENNReal) μ s (hmg s hs) hμs.ne c) = T_m (@MeasureTheory.Lp.simpleFunc.indicatorConst Ω ℝ mΩ _ (1 : ENNReal) μ s (hmg s hs) hμs.ne c) := by intro c s hs hμs have hsΩ : @MeasurableSet Ω mΩ s := hmg s hs have hs_int : Integrable (s.indicator (fun _ : Ω => c)) μ := by refine (MeasureTheory.integrable_indicator_iff (μ := μ) hsΩ).2 ?_ exact MeasureTheory.integrableOn_const have hind_eq : @MeasureTheory.Lp.simpleFunc.indicatorConst Ω ℝ mΩ _ (1 : ENNReal) μ s (hmg s hs) hμs.ne c = hs_int.toL1 (s.indicator (fun _ : Ω => c)) := by apply MeasureTheory.Lp.ext refine (@MeasureTheory.indicatorConstLp_coeFn Ω ℝ mΩ (1 : ENNReal) μ _ s (hmg s hs) hμs.ne c).trans ?_ exact hs_int.coeFn_toL1.symm rw [hind_eq] apply MeasureTheory.Lp.ext have hM := MeasureTheory.condExp_ae_eq_condExpL1CLM hmM hs_int have hm' := MeasureTheory.condExp_ae_eq_condExpL1CLM hm hs_int have hdrop : μ[s.indicator (fun _ : Ω => c) | M] =ᵐ[μ] μ[s.indicator (fun _ : Ω => c) | m] := by dsimp [M, mf] exact condExp_indicator_sup_comap_eq_of_condIndep hm hf hg hCI hs c exact hM.symm.trans (hdrop.trans hm') have hP_add : ∀ ⦃u v : Ω → ℝ⦄, ∀ hu : MemLp u 1 μ, ∀ hv : MemLp v 1 μ, @StronglyMeasurable Ω ℝ _ mg u → @StronglyMeasurable Ω ℝ _ mg v → Disjoint (support u) (support v) → T_M (hu.toLp u) = T_m (hu.toLp u) → T_M (hv.toLp v) = T_m (hv.toLp v) → T_M (hu.toLp u + hv.toLp v) = T_m (hu.toLp u + hv.toLp v) := by intro u v hu hv _hu_meas _hv_meas _hdisj hu_eq hv_eq simp [T_M, T_m, map_add, hu_eq, hv_eq] have hP_closed : IsClosed {u : @MeasureTheory.lpMeas Ω ℝ ℝ _ _ _ mg mΩ (1 : ENNReal) μ | T_M (u : @Lp Ω ℝ mΩ _ (1 : ENNReal) μ) = T_m (u : @Lp Ω ℝ mΩ _ (1 : ENNReal) μ)} := by exact isClosed_eq (T_M.continuous.comp continuous_subtype_val) (T_m.continuous.comp continuous_subtype_val) exact MeasureTheory.Lp.induction_stronglyMeasurable hmg (by norm_num) (fun u : Ω →₁[μ] ℝ => T_M u = T_m u) hP_ind hP_add hP_closed (hY_int.toL1 Y) (hY_meas.stronglyMeasurable.aestronglyMeasurable.congr hY_int.coeFn_toL1.symm) have hM := MeasureTheory.condExp_ae_eq_condExpL1CLM hmM hY_int have hm' := MeasureTheory.condExp_ae_eq_condExpL1CLM hm hY_int have hL1_ae : (T_M (hY_int.toL1 Y) : Ω → ℝ) =ᵐ[μ] (T_m (hY_int.toL1 Y) : Ω → ℝ) := by rw [hL1] exact hM.trans (hL1_ae.trans hm'.symm) -
condExp_sup_comap_eq_of_condIndeptheorem — If a conditioning σ-algebra is coarser than the ambient one, random elements f and g are measurable, g is conditionally independent of f given that σ-algebra, and a real-valued transform h is measurable with h(g) integrable, then adding the information generated by f does not change the conditional expectation of h(g), almost everywhere.hypothesesΩ α β :Type*hm :m ≤ mΩμ :f :Ω → αg :Ω → βhf :hg :hCI :CondIndepFun m hm g f μh :β → ℝhh :hhg :Integrable (fun ω => h (g ω)) μconclusionμ[fun ω => h (g ω) | m ⊔ comap f inferInstance]=ᵐ[μ] μ[fun ω => h (g ω) | m]Proof (Lean source)
theorem condExp_sup_comap_eq_of_condIndep {Ω α β : Type*} {m mΩ : MeasurableSpace Ω} (hm : m ≤ mΩ) [MeasurableSpace α] [MeasurableSpace β] [StandardBorelSpace Ω] {μ : Measure Ω} [IsFiniteMeasure μ] {f : Ω → α} {g : Ω → β} (hf : Measurable f) (hg : Measurable g) (hCI : CondIndepFun m hm g f μ) {h : β → ℝ} (hh : Measurable h) (hhg : Integrable (fun ω => h (g ω)) μ) : μ[fun ω => h (g ω) | m ⊔ comap f inferInstance] =ᵐ[μ] μ[fun ω => h (g ω) | m] := by have hg_comap : @Measurable Ω β (comap g inferInstance) _ g := by exact Measurable.of_comap_le le_rfl have hY_meas : @Measurable Ω ℝ (comap g inferInstance) _ (fun ω => h (g ω)) := by exact hh.comp hg_comap exact condExp_sup_comap_eq_of_condIndep_comap hm hf hg hCI hY_meas hhg
CondExp_Part2 3 core · 1 supporting This file proves conditional-expectation identities implied by conditional independence, including drop-of-conditioning, product factorization, weak union, and contraction. ★ condIndepFun_weak_union_of_prodMk★ condIndepFun_contraction_of_prodMk★ condIndep_valuesProjection_contraction
Conditional Expectations Under Conditional Independence
This file proves conditional-expectation identities implied by conditional independence, including drop-of-conditioning, product factorization, weak union, and contraction. These measure-theoretic facts give a reusable algebra for conditional independence under enlarged conditioning σ-algebras and paired coordinates.
The central exported lemmas are condExp_sup_comap_eq_of_condIndep_comap and
condExp_sup_comap_eq_of_condIndep for removing irrelevant conditioning
variables, condExp_mul_of_condIndep for factoring a product's conditional
expectation, condIndepFun_weak_union_of_prodMk for weak union,
condIndepFun_prodMk_of_measurable_left for adjoining an m-measurable
coordinate, and condIndepFun_contraction_of_prodMk for semigraphoid
contraction.
Weak union for conditional independence. For a sub-σ-algebra m coarser than the ambient σ-algebra and measurable maps W, V, and A, if W is conditionally independent of the pair (V, A) given m, then W is conditionally independent of V given the enlarged σ-algebra m joined with the σ-algebra generated by A.
Formal statement
Proof (Lean source)
Contraction for conditional independence via a product right side. For a sub-σ-algebra m coarser than the ambient σ-algebra and measurable maps X, Y, and W, if X is conditionally independent of Y given the enlarged σ-algebra m joined with the σ-algebra generated by W and X is conditionally independent of W given m, then X is conditionally independent of the pair (Y, W) given m.
Formal statement
Proof (Lean source)
For coordinate sets X, Y, W, Z, and I, a decidable index type, measurable value spaces, inclusions of the four blocks in I, a finite measure μ, the first conditional independence, and the second one, contraction holds for the coordinate projections.
Formal statement
Proof (Lean source)
1 supporting declaration (lemmas, instances)
-
condIndepFun_prodMk_of_measurable_lefttheorem — Extension of CondIndepFun by an m-measurable function.hypothesesΩ α β γ :hm :m ≤ mΩμ :W :Ω → αX :Ω → βZ :Ω → γ_hW :_hZ :_hX_m :Measurable[m] X_hCI :CondIndepFun m hm W Z μconclusionCondIndepFun m hm (fun ω => (W ω, X ω)) Z μProof (Lean source)
theorem condIndepFun_prodMk_of_measurable_left {Ω α β γ : Type*} [MeasurableSpace α] [MeasurableSpace β] [MeasurableSpace γ] {m mΩ : MeasurableSpace Ω} (hm : m ≤ mΩ) [StandardBorelSpace Ω] {μ : Measure Ω} [IsFiniteMeasure μ] {W : Ω → α} {X : Ω → β} {Z : Ω → γ} (_hW : Measurable W) (_hZ : Measurable Z) (_hX_m : Measurable[m] X) (_hCI : CondIndepFun m hm W Z μ) : CondIndepFun m hm (fun ω => (W ω, X ω)) Z μ := by let pair : Ω → α × β := fun ω => (W ω, X ω) let rects : Set (Set (α × β)) := Set.image2 (· ×ˢ ·) {s : Set α | MeasurableSet s} {t : Set β | MeasurableSet t} let zsets : Set (Set γ) := {t : Set γ | MeasurableSet t} let pPair : Set (Set Ω) := {q | ∃ s : Set α, MeasurableSet s ∧ ∃ u : Set β, MeasurableSet u ∧ pair ⁻¹' (s ×ˢ u) = q} let pZ : Set (Set Ω) := {q | ∃ r : Set γ, r ∈ zsets ∧ Z ⁻¹' r = q} have hpair_meas : Measurable pair := _hW.prod (_hX_m.mono hm le_rfl) have hpPair_pi : IsPiSystem pPair := by simpa [pPair] using (isPiSystem_prod (α := α) (β := β)).comap pair have hpZ_pi : IsPiSystem pZ := by simpa [pZ, zsets] using (MeasurableSpace.isPiSystem_measurableSet (α := γ)).comap Z have hpPair_meas : ∀ s ∈ pPair, MeasurableSet s := by rintro _ ⟨s, hs, u, hu, rfl⟩ exact hpair_meas (hs.prod hu) have hpZ_meas : ∀ s ∈ pZ, MeasurableSet s := by rintro _ ⟨r, hr, rfl⟩ exact _hZ (by simpa [zsets] using hr) have hrect : ProbabilityTheory.CondIndepSets m hm pPair pZ μ := by rw [ProbabilityTheory.condIndepSets_iff m hm pPair pZ hpPair_meas hpZ_meas μ] intro t1 t2 ht1 ht2 rcases ht1 with ⟨s, hs_meas, u, hu_meas, rfl⟩ rcases ht2 with ⟨v, hv, rfl⟩ have hv_meas : MeasurableSet v := by simpa [zsets] using hv let A : Set Ω := W ⁻¹' s let B : Set Ω := X ⁻¹' u let C : Set Ω := Z ⁻¹' v have hB_m : MeasurableSet[m] B := _hX_m hu_meas have hB_sm : StronglyMeasurable[m] (B.indicator (fun _ : Ω => (1 : ℝ))) := MeasureTheory.stronglyMeasurable_const.indicator hB_m have hB_bound : ∀ᵐ ω ∂μ, ‖B.indicator (fun _ : Ω => (1 : ℝ)) ω‖ ≤ (1 : ℝ) := by exact MeasureTheory.ae_of_all μ fun ω => by rw [indicator] split_ifs <;> simp have hAC_int : Integrable ((A ∩ C).indicator (fun _ : Ω => (1 : ℝ))) μ := by refine (MeasureTheory.integrable_indicator_iff ?_).2 MeasureTheory.integrableOn_const exact (_hW hs_meas).inter (_hZ hv_meas) have hA_int : Integrable (A.indicator (fun _ : Ω => (1 : ℝ))) μ := by refine (MeasureTheory.integrable_indicator_iff ?_).2 MeasureTheory.integrableOn_const exact _hW hs_meas have hpull_AC : μ[B.indicator (fun _ : Ω => (1 : ℝ)) * (A ∩ C).indicator (fun _ : Ω => (1 : ℝ)) | m] =ᵐ[μ] B.indicator (fun _ : Ω => (1 : ℝ)) * μ[(A ∩ C).indicator (fun _ : Ω => (1 : ℝ)) | m] := MeasureTheory.condExp_stronglyMeasurable_mul_of_bound hm hB_sm hAC_int 1 hB_bound have hpull_A : μ[B.indicator (fun _ : Ω => (1 : ℝ)) * A.indicator (fun _ : Ω => (1 : ℝ)) | m] =ᵐ[μ] B.indicator (fun _ : Ω => (1 : ℝ)) * μ[A.indicator (fun _ : Ω => (1 : ℝ)) | m] := MeasureTheory.condExp_stronglyMeasurable_mul_of_bound hm hB_sm hA_int 1 hB_bound have hCIeq := (ProbabilityTheory.condIndepFun_iff_condExp_inter_preimage_eq_mul _hW _hZ).mp _hCI s v hs_meas hv_meas have hleft : μ⟦((A ∩ B) ∩ C) | m⟧ =ᵐ[μ] μ[B.indicator (fun _ : Ω => (1 : ℝ)) * (A ∩ C).indicator (fun _ : Ω => (1 : ℝ)) | m] := by rw [show ((A ∩ B) ∩ C) = B ∩ (A ∩ C) by ext ω simp [and_left_comm, and_assoc]] rw [show (fun _ : Ω => (1 : ℝ)) = 1 from rfl, Set.inter_indicator_one] have hpair : μ⟦(A ∩ B) | m⟧ =ᵐ[μ] μ[B.indicator (fun _ : Ω => (1 : ℝ)) * A.indicator (fun _ : Ω => (1 : ℝ)) | m] := by rw [show (A ∩ B) = B ∩ A by ext ω simp [and_comm]] rw [show (fun _ : Ω => (1 : ℝ)) = 1 from rfl, Set.inter_indicator_one] calc μ⟦pair ⁻¹' (s ×ˢ u) ∩ Z ⁻¹' v | m⟧ =ᵐ[μ] μ⟦((A ∩ B) ∩ C) | m⟧ := by rfl _ =ᵐ[μ] μ[B.indicator (fun _ : Ω => (1 : ℝ)) * (A ∩ C).indicator (fun _ : Ω => (1 : ℝ)) | m] := hleft _ =ᵐ[μ] B.indicator (fun _ : Ω => (1 : ℝ)) * μ[(A ∩ C).indicator (fun _ : Ω => (1 : ℝ)) | m] := hpull_AC _ =ᵐ[μ] B.indicator (fun _ : Ω => (1 : ℝ)) * (μ⟦A | m⟧ * μ⟦C | m⟧) := by exact hCIeq.mono fun ω hω => by simp [A, C, hω] _ =ᵐ[μ] (B.indicator (fun _ : Ω => (1 : ℝ)) * μ⟦A | m⟧) * μ⟦C | m⟧ := by exact MeasureTheory.ae_of_all μ fun ω => by simp only [Pi.mul_apply] ring _ =ᵐ[μ] μ[B.indicator (fun _ : Ω => (1 : ℝ)) * A.indicator (fun _ : Ω => (1 : ℝ)) | m] * μ⟦C | m⟧ := by exact hpull_A.symm.mul (Filter.EventuallyEq.rfl) _ =ᵐ[μ] μ⟦A ∩ B | m⟧ * μ⟦C | m⟧ := by exact hpair.symm.mul (Filter.EventuallyEq.rfl) _ =ᵐ[μ] μ⟦pair ⁻¹' (s ×ˢ u) | m⟧ * μ⟦Z ⁻¹' v | m⟧ := by rfl rw [ProbabilityTheory.condIndepFun_iff_condIndep] have hpPair_eq : pPair = (fun r : Set (α × β) => pair ⁻¹' r) '' rects := by ext q constructor · rintro ⟨s, hs, u, hu, hq⟩ exact ⟨s ×ˢ u, ⟨s, hs, u, hu, rfl⟩, hq⟩ · rintro ⟨r, ⟨s, hs, u, hu, rfl⟩, hq⟩ exact ⟨s, hs, u, hu, hq⟩ have hgenPair : (inferInstance : MeasurableSpace (α × β)).comap pair = MeasurableSpace.generateFrom pPair := by rw [hpPair_eq, ← generateFrom_prod, MeasurableSpace.comap_generateFrom] have hgenZ : (inferInstance : MeasurableSpace γ).comap Z = MeasurableSpace.generateFrom pZ := by rw [show (inferInstance : MeasurableSpace γ) = MeasurableSpace.generateFrom zsets by exact (MeasurableSpace.generateFrom_measurableSet (α := γ)).symm] rw [MeasurableSpace.comap_generateFrom] rfl rw [hgenPair, hgenZ] exact ProbabilityTheory.CondIndepSets.condIndep' hpPair_meas hpZ_meas hpPair_pi hpZ_pi hrect
FiniteProductResidual 5 core · 13 supporting This module packages the product law of an independent side variable and a finite iid record array. ★ condExp_residual_eq_zero_of_leaveOne
Leave-one residual centering under finite product laws
This module packages the product law of an independent side variable and a finite iid record array. It proves that a one-record residual conditionally centered on its covariate remains centered after adjoining the side variable and every other record, and derives integrable leave-one pullout and distinct-coordinate orthogonality identities.
The side law and record law determine the joint law of an independent side variable and a finite iid record array, given by their product with the finite record product law.
For a selected coordinate and a side-variable-and-record-array realization, the remaining-information map retains the side variable and every record other than the selected one, by projecting that realization.
Definition (Lean source)
A covariate map, selected coordinate, and a side-variable-and-record-array realization determine the leave-one information map, which retains the side variable, the selected covariate, and all other complete records, by projecting that realization.
Definition (Lean source)
A covariate map and a side-variable-and-record-array realization determine the full covariate-information map, which retains the side variable and every record's covariate, by applying the covariate map coordinatewise.
Definition (Lean source)
A measurable covariate map and residual, integrability of the residual under the record law, zero conditional mean of the residual given the covariate under the record law, probability side and record laws on standard Borel spaces, and a selected coordinate imply that, under the joint law of an independent side variable and a finite iid record array, the selected record's residual has zero conditional mean given the selected covariate, the side variable, and all other records.
Formal statement
Proof (Lean source)
13 supporting declarations (lemmas, instances)
-
instIsProbabilityMeasureProductLawinstance — Probability side and record laws make their joint product law a probability law, by the probability-measure instances for products and finite product measures. -
measurable_otherInfotheorem — For a selected coordinate, the remaining-information map is measurable.hypothesesι :sharedType u_1A :sharedType u_2Z :sharedType u_3i :ιconclusionMeasurable (otherInfo (A := A) (Z := Z) i)Proof (Lean source)
@[fun_prop] theorem measurable_otherInfo (i : ι) : Measurable (otherInfo (A := A) (Z := Z) i) := by exact measurable_fst.prodMk (measurable_pi_lambda _ fun (j : {j : ι // j ≠ i}) => (measurable_pi_apply j.1).comp measurable_snd) -
measurable_leaveOneInfotheorem — A measurable covariate map makes the leave-one information at the selected coordinate measurable.hypothesesι :sharedType u_1A :sharedType u_2Z :sharedType u_3C :sharedType u_4Z → ChX :i :ιconclusionMeasurable (leaveOneInfo (A := A) X i)Proof (Lean source)
@[fun_prop] theorem measurable_leaveOneInfo {X : Z → C} (hX : Measurable X) (i : ι) : Measurable (leaveOneInfo (A := A) X i) := by exact measurable_fst.prodMk ((hX.comp ((measurable_pi_apply i).comp measurable_snd)).prodMk (measurable_pi_lambda _ fun (j : {j : ι // j ≠ i}) => (measurable_pi_apply j.1).comp measurable_snd)) -
measurable_covariateInfotheorem — A measurable covariate map makes the full covariate-information map measurable.hypothesesι :sharedType u_1A :sharedType u_2Z :sharedType u_3C :sharedType u_4Z → ChX :conclusionMeasurable (covariateInfo (ι := ι) (A := A) X)Proof (Lean source)
@[fun_prop] theorem measurable_covariateInfo {X : Z → C} (hX : Measurable X) : Measurable (covariateInfo (ι := ι) (A := A) X) := by exact measurable_fst.prodMk (measurable_pi_lambda _ fun (k : ι) => hX.comp ((measurable_pi_apply k).comp measurable_snd)) -
comap_leaveOneInfotheorem — For a covariate map and selected coordinate, the σ-algebra generated by leave-one information is the join of the selected covariate σ-algebra and the remaining-information σ-algebra.hypothesesι :sharedType u_1A :sharedType u_2Z :sharedType u_3C :sharedType u_4X :Z → Ci :ιconclusion= comap (fun az : A × (ι → Z) => X (az.2 i)) inferInstance ⊔ comap (otherInfo (A := A) (Z := Z) i) inferInstanceProof (Lean source)
theorem comap_leaveOneInfo (X : Z → C) (i : ι) : comap (leaveOneInfo (A := A) X i) inferInstance = comap (fun az : A × (ι → Z) => X (az.2 i)) inferInstance ⊔ comap (otherInfo (A := A) (Z := Z) i) inferInstance := by unfold leaveOneInfo otherInfo simp only [inferInstance, instMeasurableSpace, MeasurableSpace.comap_prodMk] exact sup_left_comm _ _ _ -
measurable_otherRecord_comap_leaveOnetheorem — A covariate map, a selected coordinate, and a distinct off-coordinate record make that record measurable from the selected leave-one information.hypothesesι :sharedType u_1A :sharedType u_2Z :sharedType u_3C :sharedType u_4X :Z → Ci j :ιhji :j ≠ iconclusion@Measurable (A × (ι → Z)) Z (comap (leaveOneInfo X i) inferInstance) inferInstance (fun az => az.2 j)Proof (Lean source)
@[fun_prop] theorem measurable_otherRecord_comap_leaveOne (X : Z → C) (i j : ι) (hji : j ≠ i) : @Measurable (A × (ι → Z)) Z (comap (leaveOneInfo X i) inferInstance) inferInstance (fun az => az.2 j) := by have h : @Measurable (A × (ι → Z)) (A × C × ({j : ι // j ≠ i} → Z)) (comap (leaveOneInfo X i) inferInstance) inferInstance (leaveOneInfo X i) := Measurable.of_comap_le le_rfl exact (measurable_pi_apply (⟨j, hji⟩ : {j : ι // j ≠ i})).comp (measurable_snd.comp (measurable_snd.comp h)) -
measurable_covariateInfo_comap_leaveOnetheorem — A measurable covariate map and a selected coordinate make the full covariate-information map measurable from leave-one information.hypothesesι :sharedType u_1A :sharedType u_2Z :sharedType u_3C :sharedType u_4Z → ChX :i :ιconclusion@Measurable (A × (ι → Z)) (A × (ι → C)) (comap (leaveOneInfo X i) inferInstance) inferInstance (covariateInfo X)Proof (Lean source)
@[fun_prop] theorem measurable_covariateInfo_comap_leaveOne {X : Z → C} (hX : Measurable X) (i : ι) : @Measurable (A × (ι → Z)) (A × (ι → C)) (comap (leaveOneInfo X i) inferInstance) inferInstance (covariateInfo X) := by have h : @Measurable (A × (ι → Z)) (A × C × ({j : ι // j ≠ i} → Z)) (comap (leaveOneInfo X i) inferInstance) inferInstance (leaveOneInfo X i) := Measurable.of_comap_le le_rfl classical let : MeasurableSpace (A × (ι → Z)) := comap (leaveOneInfo X i) inferInstance unfold covariateInfo refine (measurable_fst.comp h).prodMk (measurable_pi_lambda _ fun (k : ι) => ?_) by_cases hki : k = i · subst k exact measurable_fst.comp (measurable_snd.comp h) · exact hX.comp (measurable_otherRecord_comap_leaveOne X i k hki) -
measurePreserving_selectedRecordtheorem — Probability side and record laws make projection to a selected record preserve the one-record law.hypothesesι :sharedType u_1A :sharedType u_2Z :sharedType u_3Fintype ιρ :Measure Aμ :Measure Zi :ιconclusionMeasurePreserving (fun az : A × (ι → Z) => az.2 i) (productLaw ρ μ) μProof (Lean source)
theorem measurePreserving_selectedRecord [Fintype ι] (ρ : Measure A) (μ : Measure Z) [IsProbabilityMeasure ρ] [IsProbabilityMeasure μ] (i : ι) : MeasurePreserving (fun az : A × (ι → Z) => az.2 i) (productLaw ρ μ) μ := by exact (measurePreserving_eval (fun _ : ι => μ) i).comp measurePreserving_snd -
indepFun_selectedRecord_otherInfotheorem — Probability side and record laws make the selected record independent of the side variable together with every other record.Proof (Lean source)
theorem indepFun_selectedRecord_otherInfo {ι A Z : Type*} [Fintype ι] [MeasurableSpace A] [MeasurableSpace Z] (ρ : Measure A) (μ : Measure Z) [IsProbabilityMeasure ρ] [IsProbabilityMeasure μ] (i : ι) : IndepFun (fun az : A × (ι → Z) => az.2 i) (otherInfo i) (productLaw ρ μ) := by classical let P : Measure (ι → Z) := Measure.pi (fun _ : ι => μ) let rest : (ι → Z) → ({j : ι // j ≠ i} → Z) := fun x j => x j.1 have hrest : Measurable rest := measurable_pi_lambda _ fun j => measurable_pi_apply j.1 have hcoords : iIndepFun (fun j (x : ι → Z) => x j) P := iIndepFun_pi (X := fun _ (z : Z) => z) (fun _ => aemeasurable_id) have hblocks : IndepFun (fun x : ι → Z => x i) rest P := by have h := hcoords.indepFun_finset {i} (Finset.univ.erase i) (by simp) (fun j => measurable_pi_apply j) exact h.comp (measurable_pi_apply (⟨i, by simp⟩ : {j : ι // j ∈ ({i} : Finset ι)})) (measurable_pi_lambda _ fun (j : {j : ι // j ≠ i}) => measurable_pi_apply (⟨j.1, by simp [j.2]⟩ : {j : ι // j ∈ Finset.univ.erase i})) let ν := P.map rest have : IsProbabilityMeasure ν := Measure.isProbabilityMeasure_map hrest.aemeasurable have hpair : MeasurePreserving (fun x : ι → Z => (x i, rest x)) P (μ.prod ν) := by refine ⟨(measurable_pi_apply i).prodMk hrest, ?_⟩ rw [hblocks.map_prod_eq_prod_map_map (measurable_pi_apply i).aemeasurable hrest.aemeasurable, (measurePreserving_eval (fun _ : ι => μ) i).map_eq] have hside := (MeasurePreserving.id ρ).prod hpair have hunassoc := (measurePreserving_prodAssoc ρ μ ν).symm MeasurableEquiv.prodAssoc have hswap := (Measure.measurePreserving_swap (μ := ρ) (ν := μ)).prod (MeasurePreserving.id ν) have hassoc := measurePreserving_prodAssoc μ ρ ν have hjoint : MeasurePreserving (fun az : A × (ι → Z) => (az.2 i, otherInfo i az)) (productLaw ρ μ) (μ.prod (ρ.prod ν)) := hassoc.comp (hswap.comp (hunassoc.comp hside)) have hselected : MeasurePreserving (fun az : A × (ι → Z) => az.2 i) (productLaw ρ μ) μ := measurePreserving_fst.comp hjoint have hother : MeasurePreserving (otherInfo i) (productLaw ρ μ) (ρ.prod ν) := measurePreserving_snd.comp hjoint apply (indepFun_iff_map_prod_eq_prod_map_map ((measurable_pi_apply i).comp measurable_snd).aemeasurable (measurable_otherInfo i).aemeasurable).2 exact hjoint.map_eq.trans (congrArg₂ Measure.prod hselected.map_eq.symm hother.map_eq.symm) -
condExp_adjoin_independent_eqtheorem — Measurable record and additional-information maps that are independent, together with a measurable covariate map, a measurable residual, and integrability of the pulled-back residual, imply that adjoining the additional information leaves the residual's covariate conditional mean unchanged.hypothesesΩ Z C B :Y :Ω → ZW :Ω → BX :Z → Cr :Z → ℝhY :hW :hYW :IndepFun Y W PhX :hr :hrY :Integrable (fun ω => r (Y ω)) Pconclusion=ᵐ[P] P[fun ω => r (Y ω) | comap (X ∘ Y) inferInstance]Proof (Lean source)
theorem condExp_adjoin_independent_eq {Ω Z C B : Type*} [MeasurableSpace Ω] [StandardBorelSpace Ω] [MeasurableSpace Z] [MeasurableSpace C] [MeasurableSpace B] {P : Measure Ω} [IsProbabilityMeasure P] {Y : Ω → Z} {W : Ω → B} {X : Z → C} {r : Z → ℝ} (hY : Measurable Y) (hW : Measurable W) (hYW : IndepFun Y W P) (hX : Measurable X) (hr : Measurable r) (hrY : Integrable (fun ω => r (Y ω)) P) : P[fun ω => r (Y ω) | comap (X ∘ Y) inferInstance ⊔ comap W inferInstance] =ᵐ[P] P[fun ω => r (Y ω) | comap (X ∘ Y) inferInstance] := by have hrY_meas : Measurable (r ∘ Y) := hr.comp hY have hXY_meas : Measurable (X ∘ Y) := hX.comp hY have hpair : IndepFun (fun ω => (r (Y ω), X (Y ω))) W P := hYW.comp (φ := fun z => (r z, X z)) (ψ := id) (hr.prod hX) measurable_id have hbot := condIndepFun_bot_of_indepFun hW (hrY_meas.prod hXY_meas) hpair.symm have hCI : CondIndepFun (comap (X ∘ Y) inferInstance) hXY_meas.comap_le W (r ∘ Y) P := by simpa only [bot_sup_eq] using (condIndepFun_weak_union_of_prodMk (m := ⊥) bot_le hW hrY_meas hXY_meas hbot) exact condExp_sup_comap_eq_of_condIndep hXY_meas.comap_le hW hrY_meas hCI.symm (h := id) measurable_id hrY -
integral_mul_residual_eq_zero_of_leaveOnetheorem — A measurable covariate map and residual, integrability of the residual, one-record conditional centering, probability side and record laws, a selected coordinate, a leave-one almost-everywhere strongly measurable coefficient, and integrability of its residual product imply that the coefficient-residual integral is zero.hypothesesι :sharedType u_1A :sharedType u_2Z :sharedType u_3C :sharedType u_4X :sharedZ → Cr :sharedZ → ℝhX :hr :hir :Integrable r μhzero :μ[r | comap X inferInstance] =ᵐ[μ] 0i :ιc :A × (ι → Z) → ℝhc :hcr :Integrable (fun az => c az * r (az.2 i)) (productLaw ρ μ)conclusion∫ az, c az * r (az.2 i) ∂productLaw ρ μ = 0Proof (Lean source)
theorem integral_mul_residual_eq_zero_of_leaveOne (hX : Measurable X) (hr : Measurable r) (hir : Integrable r μ) (hzero : μ[r | comap X inferInstance] =ᵐ[μ] 0) (i : ι) (c : A × (ι → Z) → ℝ) (hc : AEStronglyMeasurable[comap (leaveOneInfo X i) inferInstance] c (productLaw ρ μ)) (hcr : Integrable (fun az => c az * r (az.2 i)) (productLaw ρ μ)) : ∫ az, c az * r (az.2 i) ∂productLaw ρ μ = 0 := by have hm := (measurable_leaveOneInfo (A := A) hX i).comap_le have hi : Integrable (fun az : A × (ι → Z) => r (az.2 i)) (productLaw ρ μ) := (measurePreserving_selectedRecord ρ μ i).integrable_comp_of_integrable hir have hp := condExp_mul_of_aestronglyMeasurable_left hc hcr hi have hfun : c * (fun az => r (az.2 i)) = (fun az => c az * r (az.2 i)) := by funext az exact Pi.mul_apply c _ az rw [hfun] at hp have hz := condExp_residual_eq_zero_of_leaveOne ρ μ hX hr hir hzero i have hpz : (productLaw ρ μ)[fun az => c az * r (az.2 i) | comap (leaveOneInfo X i) inferInstance] =ᵐ[productLaw ρ μ] 0 := by filter_upwards [hp, hz] with az hpa hza simpa only [Pi.mul_apply, hza, Pi.zero_apply, mul_zero] using hpa calc ∫ az, c az * r (az.2 i) ∂productLaw ρ μ = ∫ az, ((productLaw ρ μ)[fun az => c az * r (az.2 i) | comap (leaveOneInfo X i) inferInstance]) az ∂productLaw ρ μ := (integral_condExp hm).symm _ = ∫ _, (0 : ℝ) ∂productLaw ρ μ := integral_congr_ae hpz _ = 0 := integral_zero _ _ -
integral_covariate_mul_residual_eq_zerotheorem — A measurable covariate map and residual, integrability of the residual, one-record conditional centering, probability side and record laws, a selected coordinate, a measurable covariate coefficient, and integrability of its residual product imply that the covariate-weighted residual integral is zero.hypothesesι :sharedType u_1A :sharedType u_2Z :sharedType u_3C :sharedType u_4X :sharedZ → Cr :sharedZ → ℝhX :hr :hir :Integrable r μhzero :μ[r | comap X inferInstance] =ᵐ[μ] 0i :ιb :A × (ι → C) → ℝhb :hbr :Integrable (fun az => b (covariateInfo X az) * r (az.2 i)) (productLaw ρ μ)conclusion∫ az, b (covariateInfo X az) * r (az.2 i) ∂productLaw ρ μ = 0Proof (Lean source)
theorem integral_covariate_mul_residual_eq_zero (hX : Measurable X) (hr : Measurable r) (hir : Integrable r μ) (hzero : μ[r | comap X inferInstance] =ᵐ[μ] 0) (i : ι) (b : A × (ι → C) → ℝ) (hb : Measurable b) (hbr : Integrable (fun az => b (covariateInfo X az) * r (az.2 i)) (productLaw ρ μ)) : ∫ az, b (covariateInfo X az) * r (az.2 i) ∂productLaw ρ μ = 0 := by apply integral_mul_residual_eq_zero_of_leaveOne ρ μ hX hr hir hzero i _ _ hbr exact (hb.comp (measurable_covariateInfo_comap_leaveOne hX i)) |>.stronglyMeasurable.aestronglyMeasurable -
integral_covariate_mul_residual_mul_residual_eq_zerotheorem — A measurable covariate map and residual, integrability of the residual, one-record conditional centering, probability side and record laws, distinct coordinates, a measurable covariate coefficient, and integrability of the triple product imply that the covariate-weighted product of the two residuals has zero integral.hypothesesι :sharedType u_1A :sharedType u_2Z :sharedType u_3C :sharedType u_4X :sharedZ → Cr :sharedZ → ℝhX :hr :hir :Integrable r μhzero :μ[r | comap X inferInstance] =ᵐ[μ] 0i j :ιhij :i ≠ jb :A × (ι → C) → ℝhb :hbrr :Integrable (fun az => b (covariateInfo X az) * r (az.2 i) * r (az.2 j)) (productLaw ρ μ)conclusion∫ az, b (covariateInfo X az) * r (az.2 i) * r (az.2 j) ∂productLaw ρ μ = 0Proof (Lean source)
theorem integral_covariate_mul_residual_mul_residual_eq_zero (hX : Measurable X) (hr : Measurable r) (hir : Integrable r μ) (hzero : μ[r | comap X inferInstance] =ᵐ[μ] 0) (i j : ι) (hij : i ≠ j) (b : A × (ι → C) → ℝ) (hb : Measurable b) (hbrr : Integrable (fun az => b (covariateInfo X az) * r (az.2 i) * r (az.2 j)) (productLaw ρ μ)) : ∫ az, b (covariateInfo X az) * r (az.2 i) * r (az.2 j) ∂productLaw ρ μ = 0 := by have hc : AEStronglyMeasurable[comap (leaveOneInfo X i) inferInstance] (fun az => b (covariateInfo X az) * r (az.2 j)) (productLaw ρ μ) := ((hb.comp (measurable_covariateInfo_comap_leaveOne hX i)).mul (hr.comp (measurable_otherRecord_comap_leaveOne X i j (Ne.symm hij)))) |>.stronglyMeasurable.aestronglyMeasurable have hprod : Integrable (fun az => (b (covariateInfo X az) * r (az.2 j)) * r (az.2 i)) (productLaw ρ μ) := by simpa only [mul_right_comm] using hbrr simpa only [mul_right_comm] using integral_mul_residual_eq_zero_of_leaveOne ρ μ hX hr hir hzero i _ hc hprod
Integrability 2 core · 0 supporting This file proves measure-theoretic lemmas that turn conditional positivity and conditional-expectation identities for indicators into positivity and integrability conclusions over sub-σ-algebras. ★ ae_pos_condExp_indicator_of_le★ integrableOn_of_condExp_indicator_mul
Integrability from Conditional-Expectation Indicators
This file proves measure-theoretic lemmas that turn conditional positivity and conditional-expectation identities for indicators into positivity and integrability conclusions over sub-σ-algebras.
The theorem ae_pos_condExp_indicator_of_le derives strict conditional positivity
from overlap on the conditioning σ-algebra. The theorem
integrableOn_of_condExp_indicator_mul turns an m-measurable nonnegative
function satisfying an indicator conditional-expectation product identity into
an integrable-on-stratum conclusion.
σ-projection of indicator-conditional positivity. For a sub-σ-algebra m₁ coarser than the ambient σ-algebra, a measurable event E, and an overlap condition — every m₁-measurable set that meets E only on a null set is itself null, then the conditional probability of E given m₁ is strictly positive almost everywhere.
Formal statement
Proof (Lean source)
Integrability on a stratum from a conditional-expectation indicator identity. For a sub-σ-algebra m coarser than the ambient σ-algebra, measurable events B and C, and an m-measurable real-valued function g that is almost everywhere nonnegative, if the conditional expectation of the indicator of B given m, multiplied pointwise by g, equals almost everywhere the conditional expectation of the indicator of C given m, then g is integrable on B.
Formal statement
Proof (Lean source)
JoinedBlockProduct 2 core · 0 supporting This module factors the conditional expectation of a three-factor product when each factor may depend on a common training block and one disjoint evaluation block. ★ condExp_joinedBlockProduct_of_integrable
Conditional products on joined training and evaluation blocks
This module factors the conditional expectation of a three-factor product when each factor may depend on a common training block and one disjoint evaluation block.
The training block, the three evaluation blocks, and one joined-view score for each factor define the product of the three joined-view scores, by evaluating every score on its training-plus-evaluation coordinates and multiplying the resulting values.
A finite product probability law, a training block and three evaluation blocks with training/evaluation disjointness and pairwise evaluation disjointness, measurable joined-view scores, integrable individual scores, an integrable first two-factor product, and an integrable three-factor product imply that the conditional mean of the joined three-block product given the training block is almost surely the product of the three scores' conditional means given the training block.
Formal statement
Proof (Lean source)
ShiftedBlockCrossMoment 1 core · 0 supporting The cross moment of two held-out scores shifted by training-measurable functions is their unconditional covariance plus the product of their shifted means. ★ condExp_shiftedBlockCross_eq_covariance_add
Conditional cross moment of one training-shifted held-out block
The cross moment of two held-out scores shifted by training-measurable functions is their unconditional covariance plus the product of their shifted means. This is the local calculation used by the three-block factorization.
A finite product probability law, disjoint training and held-out blocks, two held-out scores, two training shifts, measurability, integrability of the scores and shifts, an integrable held-out cross product, and square-integrable shifted scores imply that the conditional mean, given the training block, of the product of the two shifted scores almost surely equals the unconditional covariance of the two held-out scores plus the product of the two held-out means each minus its training shift.
Formal statement
Proof (Lean source)
ShiftedBlockMoments 1 core · 1 supporting A score on a held-out coordinate block has constant conditional mean given a disjoint training block. ★ condExp_shiftedBlock_eq_integral_sub
Conditional moments of a training-shifted held-out block
A score on a held-out coordinate block has constant conditional mean given a disjoint training block. Subtracting a measurable training-block shift subtracts that shift from the conditional mean.
A finite product probability law, a disjoint training and held-out block, a held-out score and training shift with measurability and integrability imply that the conditional mean of their difference given the training block is almost surely the unconditional held-out mean minus the same training shift.
Formal statement
Proof (Lean source)
1 supporting declaration (lemmas, instances)
-
condExp_heldoutBlock_eq_integraltheorem — A finite product probability law, a training block and held-out block with disjointness, a measurable score imply that its conditional mean given the training block is its unconditional mean.hypothesesι :sharedType u_1ι → Type u_2μ :(i : ι) → Measure (Ω i)∀ i, IsProbabilityMeasure (μ i)B0 B1 :Finset ιhdisj :Disjoint B0 B1f :((i : {i // i ∈ B1}) → Ω i.val) → ℝhfmeas :conclusioncondExp (comap (finsetCoordProj (Ω := Ω) B0) inferInstance) (Measure.pi μ) (fun x : ∀ i, Ω i => f (finsetCoordProj B1 x))=ᵐ[Measure.pi μ] (fun _ => ∫ x : (∀ i, Ω i), f (finsetCoordProj B1 x) ∂Measure.pi μ)Proof (Lean source)
theorem condExp_heldoutBlock_eq_integral (μ : (i : ι) → Measure (Ω i)) [∀ i, IsProbabilityMeasure (μ i)] (B0 B1 : Finset ι) (hdisj : Disjoint B0 B1) (f : ((i : {i // i ∈ B1}) → Ω i.val) → ℝ) (hfmeas : Measurable f) : condExp (comap (finsetCoordProj (Ω := Ω) B0) inferInstance) (Measure.pi μ) (fun x : ∀ i, Ω i => f (finsetCoordProj B1 x)) =ᵐ[Measure.pi μ] (fun _ => ∫ x : (∀ i, Ω i), f (finsetCoordProj B1 x) ∂Measure.pi μ) := by have hproj := indepFun_pi_of_disjoint (Ω := Ω) μ hdisj.symm have hF : (ofFinite ι) = (inferInstance : Fintype ι) := Subsingleton.elim _ _ have hpi : @Measure.pi ι Ω (ofFinite ι) _ μ = Measure.pi μ := congrArg (fun fi : Fintype ι => @Measure.pi ι Ω fi _ μ) hF have hindep : IndepFun (finsetCoordProj (Ω := Ω) B1) (finsetCoordProj (Ω := Ω) B0) (Measure.pi μ) := by change IndepFun (fun x : ∀ i, Ω i => fun i : {i // i ∈ B1} => x i.val) (fun x : ∀ i, Ω i => fun i : {i // i ∈ B0} => x i.val) (Measure.pi μ) simpa only [hpi] using hproj have hmeas : Measurable (fun x : ∀ i, Ω i => f (finsetCoordProj B1 x)) := hfmeas.comp (measurable_finsetCoordProj B1) have hle₁ := (measurable_finsetCoordProj (Ω := Ω) B1).comap_le have hle₂ := (measurable_finsetCoordProj (Ω := Ω) B0).comap_le haveI : IsFiniteMeasure (Measure.pi μ) := inferInstance haveI : IsFiniteMeasure ((Measure.pi μ).trim hle₂) := isFiniteMeasure_trim hle₂ have hsm : StronglyMeasurable[comap (finsetCoordProj (Ω := Ω) B1) inferInstance] (fun x : ∀ i, Ω i => f (finsetCoordProj B1 x)) := by have hp : Measurable[comap (finsetCoordProj (Ω := Ω) B1) inferInstance] (finsetCoordProj (Ω := Ω) B1) := measurable_iff_comap_le.mpr le_rfl exact (hfmeas.comp hp).stronglyMeasurable exact condExp_indep_eq hle₁ hle₂ hsm ((IndepFun_iff_Indep _ _ _).mp hindep)
ShiftedJoinedScore 2 core · 1 supporting A shifted held-out score is represented as a measurable score on the union of the training coordinates and its held-out block. ★ measurable_shiftedJoinedScore
Shifted scores on joined training and evaluation blocks
A shifted held-out score is represented as a measurable score on the union of the training coordinates and its held-out block. This representation connects shifted products to joined-view conditional factorization.
The training block, one evaluation block, a held-out score, and a training-block shift define the shifted score on their joined coordinate view, by subtracting the training shift from the held-out score.
Definition (Lean source)
The training block and evaluation block, a held-out score, a training-block shift, and measurability of both functions imply that the joined shifted score is measurable.
Formal statement
Proof (Lean source)
1 supporting declaration (lemmas, instances)
-
shiftedJoinedScore_comp_projtheorem — The training block and evaluation block, a held-out score, a training-block shift, and a full product point imply that evaluating the joined shifted score equals the held-out score minus its training shift.hypothesesι :sharedType u_1ι → Type u_2B0 B1 :Finset ιf :((i : {i // i ∈ B1}) → Ω i.val) → ℝa :((i : {i // i ∈ B0}) → Ω i.val) → ℝx :∀ i, Ω iconclusionshiftedJoinedScore B0 B1 f a (finsetCoordProj (B0 ∪ B1) x)= f (finsetCoordProj B1 x) - a (finsetCoordProj B0 x)Proof (Lean source)
theorem shiftedJoinedScore_comp_proj (B0 B1 : Finset ι) (f : ((i : {i // i ∈ B1}) → Ω i.val) → ℝ) (a : ((i : {i // i ∈ B0}) → Ω i.val) → ℝ) (x : ∀ i, Ω i) : shiftedJoinedScore B0 B1 f a (finsetCoordProj (B0 ∪ B1) x) = f (finsetCoordProj B1 x) - a (finsetCoordProj B0 x) := rfl
ThreeBlockDensity 1 core · 0 supporting This module turns a density whose first two coordinate blocks factor through a third, conditioning block into CondIndepFun for the first two coordinate maps given the third coordinate. ★ condIndepFun_threeBlock_of_density_factors
Conditional independence from a three-block product density
This module turns a density whose first two coordinate blocks factor through a
third, conditioning block into CondIndepFun for the first two coordinate maps
given the third coordinate. It is the reverse direction of the density-factorization
characterization DensityIntersection.condIndepFun_threeBlock_iff_factors, stated in plain
product coordinates.
On a product of three standard Borel spaces, take three σ-finite coordinate reference measures and a measurable joint density with respect to their product whose induced measure is finite. Suppose there are first and second block factors, both measurable, such that almost everywhere the density equals the first factor evaluated at the first and third coordinates times the second factor evaluated at the second and third coordinates. Then, under the finite density measure, the first and second coordinate maps are conditionally independent given the third coordinate.
Formal statement
Proof (Lean source)
ThreeBlockProduct 4 core · 7 supporting This module packages conditional independence, moment bounds, factorization, centering, and covariance identities for products of scores evaluated on three pairwise-disjoint coordinate blocks of a finite product experime ★ condExp_threeBlockCross★ condExp_threeBlockProduct_zero★ condCov_threeBlockProduct
Conditional products on three held-out blocks
This module packages conditional independence, moment bounds, factorization, centering, and covariance identities for products of scores evaluated on three pairwise-disjoint coordinate blocks of a finite product experiment, conditional on a fourth training block. It is built from the library's binary conditional independence and conditional-expectation factorization interfaces.
For three coordinate blocks and one score on each block, the three-block product score is given by evaluating each score on its block and multiplying the three values.
Definition (Lean source)
Under a finite product probability law, a training block and three evaluation blocks with training/evaluation disjointness, pairwise evaluation disjointness, measurable left and right scores, and square-integrability of every block score, the conditional mean given the training block of the product of the two three-block products is almost surely the product, over the three blocks, of the conditional means given the training block of the blockwise left-times-right scores.
Formal statement
Proof (Lean source)
Under a finite product probability law, a training block and three evaluation blocks with training/evaluation disjointness, pairwise evaluation disjointness, measurable square-integrable block scores, and zero conditional mean of every block score given the training block, the conditional mean of their three-block product given the training block is almost surely zero.
Formal statement
Proof (Lean source)
Under a finite product probability law, a training block and three evaluation blocks with training/evaluation disjointness, pairwise evaluation disjointness, measurable square-integrable left and right block scores, and zero conditional mean of every left and right block score given the training block, the conditional covariance of the two three-block products given the training block is almost surely the product, over the three blocks, of the conditional means given the training block of the blockwise left-times-right scores.
Formal statement
Proof (Lean source)
7 supporting declarations (lemmas, instances)
-
condIndepFun_eval_pairtheorem — For a finite product probability law, a training block and three evaluation blocks whose training and evaluation blocks are disjoint and whose evaluation blocks are pairwise disjoint, the views indexed by two distinct evaluation blocks satisfy conditional independence given the training view.hypothesesι :sharedType u_1ι → Type u_2B0 :Finset ιhtrain :∀ t, Disjoint B0 (B t)s t :Fin 3hst :s ≠ tconclusionCondIndepFun (comap (finsetCoordProj (Ω := Ω) B0) inferInstance) (comap_le (measurable_finsetCoordProj (Ω := Ω) B0)) (finsetCoordProj (Ω := Ω) (B s)) (finsetCoordProj (Ω := Ω) (B t)) (Measure.pi μ)Proof (Lean source)
theorem condIndepFun_eval_pair (B0 : Finset ι) (B : Fin 3 → Finset ι) (htrain : ∀ t, Disjoint B0 (B t)) (heval : Pairwise (fun s t : Fin 3 => Disjoint (B s) (B t))) (s t : Fin 3) (hst : s ≠ t) : CondIndepFun (comap (finsetCoordProj (Ω := Ω) B0) inferInstance) (comap_le (measurable_finsetCoordProj (Ω := Ω) B0)) (finsetCoordProj (Ω := Ω) (B s)) (finsetCoordProj (Ω := Ω) (B t)) (Measure.pi μ) := by classical have _htrain := htrain have hinter : B s ∩ B t ⊆ B0 := by rw [Finset.disjoint_iff_inter_eq_empty.mp (heval hst)] exact empty_subset B0 have h := condIndepFun_pi_of_inter_subset (Ω := Ω) μ hinter have hF : (ofFinite ι) = (inferInstance : Fintype ι) := Subsingleton.elim _ _ have hpi : @Measure.pi ι Ω (ofFinite ι) _ μ = Measure.pi μ := congrArg (fun fi : Fintype ι => @Measure.pi ι Ω fi _ μ) hF simpa only [hpi] using h -
condIndepFun_eval_uniontheorem — For a finite product probability law, a training block and three evaluation blocks whose training and evaluation blocks are disjoint and whose evaluation blocks are pairwise disjoint, the combined first two evaluation views are conditionally independent of the third given the training view.hypothesesconclusionCondIndepFun (comap (finsetCoordProj (Ω := Ω) B0) inferInstance) (comap_le (measurable_finsetCoordProj (Ω := Ω) B0)) (finsetCoordProj (Ω := Ω) (B 0 ∪ B 1)) (finsetCoordProj (Ω := Ω) (B 2)) (Measure.pi μ)Proof (Lean source)
theorem condIndepFun_eval_union (B0 : Finset ι) (B : Fin 3 → Finset ι) [DecidableEq ι] (htrain : ∀ t, Disjoint B0 (B t)) (heval : Pairwise (fun s t : Fin 3 => Disjoint (B s) (B t))) : CondIndepFun (comap (finsetCoordProj (Ω := Ω) B0) inferInstance) (comap_le (measurable_finsetCoordProj (Ω := Ω) B0)) (finsetCoordProj (Ω := Ω) (B 0 ∪ B 1)) (finsetCoordProj (Ω := Ω) (B 2)) (Measure.pi μ) := by classical have _htrain := htrain have hdisj : Disjoint (B 0 ∪ B 1) (B 2) := Finset.disjoint_union_left.mpr ⟨heval (by decide : (0 : Fin 3) ≠ 2), heval (by decide : (1 : Fin 3) ≠ 2)⟩ have hinter : (B 0 ∪ B 1) ∩ B 2 ⊆ B0 := by rw [Finset.disjoint_iff_inter_eq_empty.mp hdisj] exact empty_subset B0 have h := condIndepFun_pi_of_inter_subset (Ω := Ω) μ hinter have hF : (ofFinite ι) = (inferInstance : Fintype ι) := Subsingleton.elim _ _ have hpi : @Measure.pi ι Ω (ofFinite ι) _ μ = Measure.pi μ := congrArg (fun fi : Fintype ι => @Measure.pi ι Ω fi _ μ) hF simpa only [hpi] using h -
integrable_twoBlockProducttheorem — Under a finite product probability law, two coordinate blocks with disjointness, two block scores, their measurability, and integrability after pullback to the full experiment, the product of the pulled-back scores is integrable.hypothesesι :sharedType u_1ι → Type u_2S T :Finset ιhST :Disjoint S Tf :((i : {i // i ∈ S}) → Ω i.val) → ℝg :((i : {i // i ∈ T}) → Ω i.val) → ℝhfmeas :hgmeas :hf :Integrable (fun x : ∀ i, Ω i => f (finsetCoordProj S x)) (Measure.pi μ)hg :Integrable (fun x : ∀ i, Ω i => g (finsetCoordProj T x)) (Measure.pi μ)conclusionProof (Lean source)
theorem integrable_twoBlockProduct (S T : Finset ι) (hST : Disjoint S T) (f : ((i : {i // i ∈ S}) → Ω i.val) → ℝ) (g : ((i : {i // i ∈ T}) → Ω i.val) → ℝ) (hfmeas : Measurable f) (hgmeas : Measurable g) (hf : Integrable (fun x : ∀ i, Ω i => f (finsetCoordProj S x)) (Measure.pi μ)) (hg : Integrable (fun x : ∀ i, Ω i => g (finsetCoordProj T x)) (Measure.pi μ)) : Integrable (fun x : ∀ i, Ω i => f (finsetCoordProj S x) * g (finsetCoordProj T x)) (Measure.pi μ) := by have h := (indepFun_pi_of_disjoint (Ω := Ω) μ hST).comp hfmeas hgmeas have hF : (ofFinite ι) = (inferInstance : Fintype ι) := Subsingleton.elim _ _ have hpi : @Measure.pi ι Ω (ofFinite ι) _ μ = Measure.pi μ := congrArg (fun fi : Fintype ι => @Measure.pi ι Ω fi _ μ) hF have hi : IndepFun (fun x : ∀ i, Ω i => f (finsetCoordProj S x)) (fun x : ∀ i, Ω i => g (finsetCoordProj T x)) (Measure.pi μ) := by change IndepFun (fun x : ∀ i, Ω i => f (fun i => x i.val)) (fun x : ∀ i, Ω i => g (fun i => x i.val)) (Measure.pi μ) simpa only [hpi, Function.comp_def] using h exact hi.integrable_mul hf hg -
memLp_threeBlockProducttheorem — Under a finite product probability law, three pairwise-disjoint coordinate blocks, measurable block scores, and square-integrability of their pullbacks, the three-block product is square-integrable.hypothesesι :sharedType u_1ι → Type u_2η :(t : Fin 3) → ((i : {i // i ∈ B t}) → Ω i.val) → ℝhηmeas :∀ t, Measurable (η t)hη :∀ t, MemLp (fun x : ∀ i, Ω i => η t (finsetCoordProj (B t) x)) 2 (Measure.pi μ)conclusionMemLp (threeBlockProduct B η) 2 (Measure.pi μ)Proof (Lean source)
theorem memLp_threeBlockProduct (B : Fin 3 → Finset ι) (heval : Pairwise (fun s t : Fin 3 => Disjoint (B s) (B t))) (η : (t : Fin 3) → ((i : {i // i ∈ B t}) → Ω i.val) → ℝ) (hηmeas : ∀ t, Measurable (η t)) (hη : ∀ t, MemLp (fun x : ∀ i, Ω i => η t (finsetCoordProj (B t) x)) 2 (Measure.pi μ)) : MemLp (threeBlockProduct B η) 2 (Measure.pi μ) := by classical let X (t : Fin 3) : (∀ i, Ω i) → ℝ := fun x => η t (finsetCoordProj (B t) x) have hXmeas (t : Fin 3) : Measurable (X t) := (hηmeas t).comp (measurable_finsetCoordProj (B t)) have hsq (t : Fin 3) : Integrable (fun x => (X t x) ^ 2) (Measure.pi μ) := (hη t).integrable_sq have h01 : Integrable (fun x => (X 0 x) ^ 2 * (X 1 x) ^ 2) (Measure.pi μ) := integrable_twoBlockProduct μ (B 0) (B 1) (heval (by decide : (0 : Fin 3) ≠ 1)) (fun y => (η 0 y) ^ 2) (fun y => (η 1 y) ^ 2) ((hηmeas 0).pow_const 2) ((hηmeas 1).pow_const 2) (hsq 0) (hsq 1) let F : ((i : {i // i ∈ B 0 ∪ B 1}) → Ω i.val) → ℝ := fun y => (η 0 (fun i => y ⟨i.val, Finset.mem_union.mpr (inl i.property)⟩)) ^ 2 * (η 1 (fun i => y ⟨i.val, Finset.mem_union.mpr (inr i.property)⟩)) ^ 2 have hFmeas : Measurable F := by dsimp [F] apply mul · apply Measurable.pow_const exact (hηmeas 0).comp (measurable_pi_lambda _ (fun i => measurable_pi_apply _)) · apply Measurable.pow_const exact (hηmeas 1).comp (measurable_pi_lambda _ (fun i => measurable_pi_apply _)) have hdisj : Disjoint (B 0 ∪ B 1) (B 2) := Finset.disjoint_union_left.mpr ⟨heval (by decide : (0 : Fin 3) ≠ 2), heval (by decide : (1 : Fin 3) ≠ 2)⟩ have hFint : Integrable (fun x => F (finsetCoordProj (B 0 ∪ B 1) x)) (Measure.pi μ) := by convert h01 using 1 ext x rfl have hprod : Integrable (fun x => F (finsetCoordProj (B 0 ∪ B 1) x) * (X 2 x) ^ 2) (Measure.pi μ) := integrable_twoBlockProduct μ (B 0 ∪ B 1) (B 2) hdisj F (fun y => (η 2 y) ^ 2) hFmeas ((hηmeas 2).pow_const 2) hFint (hsq 2) apply (memLp_two_iff_integrable_sq ?_).2 · convert hprod using 1 ext x simp only [threeBlockProduct, Fin.prod_univ_three, mul_pow] change (X 0 x) ^ 2 * (X 1 x) ^ 2 * (X 2 x) ^ 2 = (X 0 x) ^ 2 * (X 1 x) ^ 2 * (X 2 x) ^ 2 rfl · exact (Finset.measurable_prod _ (fun t _ => hXmeas t)).aestronglyMeasurable -
integrable_threeBlockCrosstheorem — Under a finite product probability law, three pairwise-disjoint coordinate blocks, two families of measurable block scores, and square-integrability of every pulled-back score, the product of the two three-block products is integrable.hypothesesι :sharedType u_1ι → Type u_2η ζ :(t : Fin 3) → ((i : {i // i ∈ B t}) → Ω i.val) → ℝhηmeas :∀ t, Measurable (η t)hζmeas :∀ t, Measurable (ζ t)hη :∀ t, MemLp (fun x : ∀ i, Ω i => η t (finsetCoordProj (B t) x)) 2 (Measure.pi μ)hζ :∀ t, MemLp (fun x : ∀ i, Ω i => ζ t (finsetCoordProj (B t) x)) 2 (Measure.pi μ)conclusionProof (Lean source)
theorem integrable_threeBlockCross (B : Fin 3 → Finset ι) (heval : Pairwise (fun s t : Fin 3 => Disjoint (B s) (B t))) (η ζ : (t : Fin 3) → ((i : {i // i ∈ B t}) → Ω i.val) → ℝ) (hηmeas : ∀ t, Measurable (η t)) (hζmeas : ∀ t, Measurable (ζ t)) (hη : ∀ t, MemLp (fun x : ∀ i, Ω i => η t (finsetCoordProj (B t) x)) 2 (Measure.pi μ)) (hζ : ∀ t, MemLp (fun x : ∀ i, Ω i => ζ t (finsetCoordProj (B t) x)) 2 (Measure.pi μ)) : Integrable (fun x : ∀ i, Ω i => threeBlockProduct B η x * threeBlockProduct B ζ x) (Measure.pi μ) := by exact (memLp_threeBlockProduct μ B heval η hηmeas hη).integrable_mul (memLp_threeBlockProduct μ B heval ζ hζmeas hζ) -
condExp_threeBlockProduct_of_integrabletheorem — Under a finite product probability law, a training block and three evaluation blocks with training/evaluation disjointness, pairwise evaluation disjointness, measurable block scores, integrable individual scores, an integrable product over the first two blocks, and an integrable three-block product, the conditional mean of the three-block product is the product of its three blockwise conditional means.hypothesesι :sharedType u_1ι → Type u_2B0 :Finset ιhtrain :∀ t, Disjoint B0 (B t)η :(t : Fin 3) → ((i : {i // i ∈ B t}) → Ω i.val) → ℝhηmeas :∀ t, Measurable (η t)hη :∀ t, Integrable (fun x : ∀ i, Ω i => η t (finsetCoordProj (B t) x)) (Measure.pi μ)hη01 :Integrable (fun x : ∀ i, Ω i => η 0 (finsetCoordProj (B 0) x) * η 1 (finsetCoordProj (B 1) x)) (Measure.pi μ)hηprod :Integrable (threeBlockProduct B η) (Measure.pi μ)conclusion=ᵐ[Measure.pi μ] (fun x => ∏ t : Fin 3, condExp (comap (finsetCoordProj (Ω := Ω) B0) inferInstance) (Measure.pi μ) (fun y : ∀ i, Ω i => η t (finsetCoordProj (B t) y)) x)Proof (Lean source)
theorem condExp_threeBlockProduct_of_integrable (B0 : Finset ι) (B : Fin 3 → Finset ι) (htrain : ∀ t, Disjoint B0 (B t)) (heval : Pairwise (fun s t : Fin 3 => Disjoint (B s) (B t))) (η : (t : Fin 3) → ((i : {i // i ∈ B t}) → Ω i.val) → ℝ) (hηmeas : ∀ t, Measurable (η t)) (hη : ∀ t, Integrable (fun x : ∀ i, Ω i => η t (finsetCoordProj (B t) x)) (Measure.pi μ)) (hη01 : Integrable (fun x : ∀ i, Ω i => η 0 (finsetCoordProj (B 0) x) * η 1 (finsetCoordProj (B 1) x)) (Measure.pi μ)) (hηprod : Integrable (threeBlockProduct B η) (Measure.pi μ)) : condExp (comap (finsetCoordProj (Ω := Ω) B0) inferInstance) (Measure.pi μ) (threeBlockProduct B η) =ᵐ[Measure.pi μ] (fun x => ∏ t : Fin 3, condExp (comap (finsetCoordProj (Ω := Ω) B0) inferInstance) (Measure.pi μ) (fun y : ∀ i, Ω i => η t (finsetCoordProj (B t) y)) x) := by classical have hm : comap (finsetCoordProj (Ω := Ω) B0) inferInstance ≤ (inferInstance : MeasurableSpace (∀ i, Ω i)) := comap_le (measurable_finsetCoordProj (Ω := Ω) B0) have h01 := condExp_mul_of_condIndep (μ := Measure.pi μ) hm (measurable_finsetCoordProj (Ω := Ω) (B 0)) (measurable_finsetCoordProj (Ω := Ω) (B 1)) (condIndepFun_eval_pair μ B0 B htrain heval 0 1 (by decide)) (hηmeas 0) (hηmeas 1) (hη 0) (hη 1) hη01 let F : ((i : {i // i ∈ B 0 ∪ B 1}) → Ω i.val) → ℝ := fun y => η 0 (fun i => y ⟨i.val, Finset.mem_union.mpr (inl i.property)⟩) * η 1 (fun i => y ⟨i.val, Finset.mem_union.mpr (inr i.property)⟩) have hFmeas : Measurable F := by dsimp [F] apply mul · exact (hηmeas 0).comp (measurable_pi_lambda _ (fun i => measurable_pi_apply _)) · exact (hηmeas 1).comp (measurable_pi_lambda _ (fun i => measurable_pi_apply _)) have hFint : Integrable (fun x => F (finsetCoordProj (B 0 ∪ B 1) x)) (Measure.pi μ) := by convert hη01 using 1 ext x rfl have hprod : Integrable (fun x => F (finsetCoordProj (B 0 ∪ B 1) x) * η 2 (finsetCoordProj (B 2) x)) (Measure.pi μ) := by convert hηprod using 1 ext x simp only [threeBlockProduct, Fin.prod_univ_three] rfl have hstep2 := condExp_mul_of_condIndep (μ := Measure.pi μ) hm (measurable_finsetCoordProj (Ω := Ω) (B 0 ∪ B 1)) (measurable_finsetCoordProj (Ω := Ω) (B 2)) (condIndepFun_eval_union μ B0 B htrain heval) hFmeas (hηmeas 2) hFint (hη 2) hprod have hfun : (fun x : ∀ i, Ω i => F (finsetCoordProj (B 0 ∪ B 1) x) * η 2 (finsetCoordProj (B 2) x)) = threeBlockProduct B η := by funext x simp only [threeBlockProduct, Fin.prod_univ_three] rfl have hfun01 : (fun x : ∀ i, Ω i => F (finsetCoordProj (B 0 ∪ B 1) x)) = (fun x => η 0 (finsetCoordProj (B 0) x) * η 1 (finsetCoordProj (B 1) x)) := by funext x rfl rw [hfun, hfun01] at hstep2 have hfinal := hstep2.trans (h01.mul (Filter.EventuallyEq.refl (ae (Measure.pi μ)) _)) filter_upwards [hfinal] with x hx simpa [Fin.prod_univ_three] using hx -
condExp_threeSingletonCrosstheorem — For a four-coordinate product probability law, left and right scores on the three held-out coordinates, their measurability, and square-integrability of their pullbacks, the conditional cross moment of their two three-coordinate products factors by coordinate.hypothesesX :ν :∀ i, IsProbabilityMeasure (ν i)η ζ :(t : Fin 3) → X t.succ → ℝhηmeas :∀ t, Measurable (η t)hζmeas :∀ t, Measurable (ζ t)hη :∀ t, MemLp (fun x : ∀ i, X i => η t (x t.succ)) 2 (Measure.pi ν)hζ :∀ t, MemLp (fun x : ∀ i, X i => ζ t (x t.succ)) 2 (Measure.pi ν)conclusioncondExp (comap (finsetCoordProj (Ω := X) ({0} : Finset (Fin 4))) inferInstance) (Measure.pi ν) (fun x : ∀ i, X i => (∏ t : Fin 3, η t (x t.succ)) * (∏ t : Fin 3, ζ t (x t.succ)))=ᵐ[Measure.pi ν] (fun x => ∏ t : Fin 3, condExp (comap (finsetCoordProj (Ω := X) ({0} : Finset (Fin 4))) inferInstance) (Measure.pi ν) (fun y : ∀ i, X i => η t (y t.succ) * ζ t (y t.succ)) x)Proof (Lean source)
theorem condExp_threeSingletonCross {X : Fin 4 → Type*} [∀ i, MeasurableSpace (X i)] [∀ i, StandardBorelSpace (X i)] (ν : (i : Fin 4) → Measure (X i)) [∀ i, IsProbabilityMeasure (ν i)] (η ζ : (t : Fin 3) → X t.succ → ℝ) (hηmeas : ∀ t, Measurable (η t)) (hζmeas : ∀ t, Measurable (ζ t)) (hη : ∀ t, MemLp (fun x : ∀ i, X i => η t (x t.succ)) 2 (Measure.pi ν)) (hζ : ∀ t, MemLp (fun x : ∀ i, X i => ζ t (x t.succ)) 2 (Measure.pi ν)) : condExp (comap (finsetCoordProj (Ω := X) ({0} : Finset (Fin 4))) inferInstance) (Measure.pi ν) (fun x : ∀ i, X i => (∏ t : Fin 3, η t (x t.succ)) * (∏ t : Fin 3, ζ t (x t.succ))) =ᵐ[Measure.pi ν] (fun x => ∏ t : Fin 3, condExp (comap (finsetCoordProj (Ω := X) ({0} : Finset (Fin 4))) inferInstance) (Measure.pi ν) (fun y : ∀ i, X i => η t (y t.succ) * ζ t (y t.succ)) x) := by classical let B : Fin 3 → Finset (Fin 4) := fun t => {t.succ} have htrain : ∀ t, Disjoint ({0} : Finset (Fin 4)) (B t) := by intro t simpa [B] using (Fin.succ_ne_zero t).symm have heval : Pairwise (fun s t : Fin 3 => Disjoint (B s) (B t)) := by intro s t hst simpa [B] using (Fin.succ_injective 3).ne hst let ξ : (t : Fin 3) → ((i : {i // i ∈ B t}) → X i.val) → ℝ := fun t z => η t (z ⟨t.succ, Finset.mem_singleton_self _⟩) let ψ : (t : Fin 3) → ((i : {i // i ∈ B t}) → X i.val) → ℝ := fun t z => ζ t (z ⟨t.succ, Finset.mem_singleton_self _⟩) have hξmeas (t : Fin 3) : Measurable (ξ t) := (hηmeas t).comp (measurable_pi_apply (⟨t.succ, Finset.mem_singleton_self _⟩ : {i // i ∈ B t})) have hψmeas (t : Fin 3) : Measurable (ψ t) := (hζmeas t).comp (measurable_pi_apply (⟨t.succ, Finset.mem_singleton_self _⟩ : {i // i ∈ B t})) have hξ (t : Fin 3) : MemLp (fun x : ∀ i, X i => ξ t (finsetCoordProj (B t) x)) 2 (Measure.pi ν) := by exact hη t have hψ (t : Fin 3) : MemLp (fun x : ∀ i, X i => ψ t (finsetCoordProj (B t) x)) 2 (Measure.pi ν) := by exact hζ t have h := condExp_threeBlockCross ν ({0} : Finset (Fin 4)) B htrain heval ξ ψ hξmeas hψmeas hξ hψ simpa only [threeBlockProduct, finsetCoordProj, ξ, ψ, B] using h