Mathlib.Probability.Independence

Independence — Mathlib-shaped helpers: Basic, Conditional, Integral.

Conditional 60 core · 67 supporting · 14 submodules Tools for working with conditional independence of random variables and σ-algebras.
Basic 5 core · 10 supporting This file develops generic independence and conditional-independence facts for finite coordinate projections under product measures. ★ condIndepFun_pi_cond_residual_of_disjoint★ condIndepFun_pi_of_inter_subset

Independence Helpers for Product Coordinates

This file develops generic independence and conditional-independence facts for finite coordinate projections under product measures. The results are Mathlib-adjacent and do not depend on any model-specific definitions.

Main coordinate maps: * finsetCoordProj S projects a dependent product to the coordinates indexed by a finite set S. * finsetCoordProjFromCondResidual S U reassembles the coordinates on S from the conditioning block U and the residual block S \ U. * finsetCoordProjPairFromUnion A B extracts the A and B sub-blocks from their union.

Main results: * indepFun_pi_of_disjoint proves independence of disjoint coordinate blocks under a finite product measure. * condIndepFun_bot_of_indepFun lifts ordinary independence to conditional independence given the trivial σ-algebra. * condIndepFun_pi_cond_residual_of_disjoint gives conditional independence of two residual coordinate blocks after conditioning on a common block. * condIndepFun_pi_of_inter_subset is the public finite-product criterion: coordinate blocks on S and T are conditionally independent given U when S ∩ T ⊆ U. * comap_eq_bot_of_subsingleton, indepFun_of_map, and condIndepFun_of_indepFun_indep provide small σ-algebra and pushforward bridges used around the product-coordinate statements.

def finsetCoordProj reviewed
Causalean.Mathlib.Probability.Independence

Given an index collection, a family of coordinate value spaces, and a finite coordinate block, the coordinate-block projection maps a full coordinate assignment to the assignment obtained by retaining exactly the coordinates in that block.

Definition (Lean source)
ι :
Type*
ι → Type*
S :
finsetCoordProj S :
(∀ i, Ω i) → ((i : {i // i ∈ S}) → Ω i.val)
fun x i => x i.val
Causalean.Mathlib.Probability.Independence.finsetCoordProj · Causalean/Mathlib/Probability/Independence/Basic.lean:89
def finsetCoordProjFromCondResidual reviewed
Causalean.Mathlib.Probability.Independence

Given an index collection whose equality is decidable, a family of coordinate value spaces, a target coordinate block, and a conditioning block, the residual-reassembly map reconstructs an assignment on the target block from an assignment on the conditioning block and an assignment on those target coordinates outside that block.

Definition (Lean source)
ι :
Type*
ι → Type*
S U :
finsetCoordProjFromCondResidual S U :
(((i : {i // i ∈ U}) → Ω i.val) × ((i : {i // i ∈ S \ U}) → Ω i.val)) → ((i : {i // i ∈ S}) → Ω i.val)
fun x i
=> if hiU : i.val ∈ U then x.1 ⟨i.val, hiU⟩ else x.2 ⟨i.val, Finset.mem_sdiff.mpr ⟨i.property, hiU⟩⟩
Causalean.Mathlib.Probability.Independence.finsetCoordProjFromCondResidual · Causalean/Mathlib/Probability/Independence/Basic.lean:108
def finsetCoordProjPairFromUnion reviewed
Causalean.Mathlib.Probability.Independence

Given an index collection whose equality is decidable, a family of coordinate value spaces, a first finite coordinate block, and a second finite coordinate block, the union-sub-block extraction map maps an assignment on their union to the pair of its restrictions to the first and second blocks.

Definition (Lean source)
ι :
Type*
ι → Type*
A B :
finsetCoordProjPairFromUnion A B :
(((i : {i // i ∈ A ∪ B}) → Ω i.val) → ((i : {i // i ∈ A}) → Ω i.val) × ((i : {i // i ∈ B}) → Ω i.val))
fun x
=> (fun i => x ⟨i.val, Finset.mem_union.mpr (inl i.property)⟩, fun i => x ⟨i.val, Finset.mem_union.mpr (inr i.property)⟩)
Causalean.Mathlib.Probability.Independence.finsetCoordProjPairFromUnion · Causalean/Mathlib/Probability/Independence/Basic.lean:151
theorem condIndepFun_pi_cond_residual_of_disjoint reviewed
Causalean.Mathlib.Probability.Independence

For a finite index set, a family of standard Borel probability spaces indexed by it, and finite subsets S0, T0, U of the index set, if S0 and T0 are disjoint from each other and S0 is disjoint from U, then under the product probability measure, the pair consisting of the U-coordinates and the S0-coordinates is conditionally independent of the pair consisting of the U-coordinates and the T0-coordinates, given the σ-algebra generated by the U-coordinates.

Formal statement
ι :
Type*
Finite ι
ι → Type*
∀ i, MeasurableSpace (Ω i)
∀ i, StandardBorelSpace (Ω i)
μ :
(i : ι) → Measure (Ω i)
∀ i, IsProbabilityMeasure (μ i)
S0 T0 U :
hS0T0 :
Disjoint S0 T0
hS0U :
letI : Fintype ι
Proof (Lean source)
theorem condIndepFun_pi_cond_residual_of_disjoint {ι : Type*} [Finite ι] {Ω : ι → Type*} [∀ i, MeasurableSpace (Ω i)] [∀ i, StandardBorelSpace (Ω i)] (μ : (i : ι) → Measure (Ω i)) [∀ i, IsProbabilityMeasure (μ i)] {S0 T0 U : Finset ι} (hS0T0 : Disjoint S0 T0) (hS0U : Disjoint S0 U) : letI : Fintype ι := Fintype.ofFinite ι CondIndepFun (comap (finsetCoordProj (Ω := Ω) U) inferInstance) (comap_le (measurable_finsetCoordProj (Ω := Ω) U)) (fun x => (finsetCoordProj (Ω := Ω) U x, finsetCoordProj (Ω := Ω) S0 x)) (fun x => (finsetCoordProj (Ω := Ω) U x, finsetCoordProj (Ω := Ω) T0 x)) (Measure.pi μ) := by classical letI : Fintype ι := Fintype.ofFinite ι have hS0T0U : Disjoint S0 (T0 ∪ U) := by rw [Finset.disjoint_left] intro i hiS0 hiT0U rcases Finset.mem_union.mp hiT0U with hiT0 | hiU · exact (Finset.disjoint_left.mp hS0T0) hiS0 hiT0 · exact (Finset.disjoint_left.mp hS0U) hiS0 hiU have hindep : IndepFun (finsetCoordProj (Ω := Ω) S0) (finsetCoordProj (Ω := Ω) (T0 ∪ U)) (Measure.pi μ) := indepFun_pi_of_disjoint (Ω := Ω) μ hS0T0U have hindep_pair : IndepFun (finsetCoordProj (Ω := Ω) S0) (fun x => (finsetCoordProj (Ω := Ω) T0 x, finsetCoordProj (Ω := Ω) U x)) (Measure.pi μ) := by simpa [finsetCoordProjPairFromUnion_comp] using hindep.comp measurable_id (measurable_finsetCoordProjPairFromUnion (Ω := Ω) T0 U) have hbot : CondIndepFun ⊥ bot_le (finsetCoordProj (Ω := Ω) S0) (fun x => (finsetCoordProj (Ω := Ω) T0 x, finsetCoordProj (Ω := Ω) U x)) (Measure.pi μ) := condIndepFun_bot_of_indepFun (measurable_finsetCoordProj (Ω := Ω) S0) ((measurable_finsetCoordProj (Ω := Ω) T0).prod (measurable_finsetCoordProj (Ω := Ω) U)) hindep_pair have hbase : CondIndepFun (comap (finsetCoordProj (Ω := Ω) U) inferInstance) (comap_le (measurable_finsetCoordProj (Ω := Ω) U)) (finsetCoordProj (Ω := Ω) S0) (finsetCoordProj (Ω := Ω) T0) (Measure.pi μ) := by simpa [sup_bot_eq] using (condIndepFun_weak_union_of_prodMk (Ω := (i : ι) → Ω i) (m := ⊥) (mΩ := inferInstance) (μ := Measure.pi μ) bot_le (W := finsetCoordProj (Ω := Ω) S0) (V := finsetCoordProj (Ω := Ω) T0) (A := finsetCoordProj (Ω := Ω) U) (measurable_finsetCoordProj (Ω := Ω) S0) (measurable_finsetCoordProj (Ω := Ω) T0) (measurable_finsetCoordProj (Ω := Ω) U) hbot) have hleft : CondIndepFun (comap (finsetCoordProj (Ω := Ω) U) inferInstance) (comap_le (measurable_finsetCoordProj (Ω := Ω) U)) (fun x => (finsetCoordProj (Ω := Ω) S0 x, finsetCoordProj (Ω := Ω) U x)) (finsetCoordProj (Ω := Ω) T0) (Measure.pi μ) := condIndepFun_prodMk_of_measurable_left (m := comap (finsetCoordProj (Ω := Ω) U) inferInstance) (mΩ := inferInstance) (μ := Measure.pi μ) (comap_le (measurable_finsetCoordProj (Ω := Ω) U)) (measurable_finsetCoordProj (Ω := Ω) S0) (measurable_finsetCoordProj (Ω := Ω) T0) (comap_measurable (finsetCoordProj (Ω := Ω) U)) hbase have hright : CondIndepFun (comap (finsetCoordProj (Ω := Ω) U) inferInstance) (comap_le (measurable_finsetCoordProj (Ω := Ω) U)) (fun x => (finsetCoordProj (Ω := Ω) T0 x, finsetCoordProj (Ω := Ω) U x)) (fun x => (finsetCoordProj (Ω := Ω) S0 x, finsetCoordProj (Ω := Ω) U x)) (Measure.pi μ) := condIndepFun_prodMk_of_measurable_left (m := comap (finsetCoordProj (Ω := Ω) U) inferInstance) (mΩ := inferInstance) (μ := Measure.pi μ) (comap_le (measurable_finsetCoordProj (Ω := Ω) U)) (measurable_finsetCoordProj (Ω := Ω) T0) ((measurable_finsetCoordProj (Ω := Ω) S0).prod (measurable_finsetCoordProj (Ω := Ω) U)) (comap_measurable (finsetCoordProj (Ω := Ω) U)) hleft.symm have hswapS : Measurable (fun p : (((i : {i // i ∈ S0}) → Ω i.val) × ((i : {i // i ∈ U}) → Ω i.val)) => (p.2, p.1)) := measurable_snd.prod measurable_fst have hswapT : Measurable (fun p : (((i : {i // i ∈ T0}) → Ω i.val) × ((i : {i // i ∈ U}) → Ω i.val)) => (p.2, p.1)) := measurable_snd.prod measurable_fst exact hright.symm.comp hswapS hswapT
Causalean.Mathlib.Probability.Independence.condIndepFun_pi_cond_residual_of_disjoint · Causalean/Mathlib/Probability/Independence/Basic.lean:225 · uses finsetCoordProj , measurable_finsetCoordProj
theorem condIndepFun_pi_of_inter_subset reviewed
Causalean.Mathlib.Probability.Independence

Under a finite product probability measure, if the overlap S ∩ T is contained in the conditioning block U, then the coordinate tuple on S is conditionally independent of the coordinate tuple on T, given the coordinate tuple on U.

Formal statement
ι :
Type*
Finite ι
ι → Type*
∀ i, MeasurableSpace (Ω i)
∀ i, StandardBorelSpace (Ω i)
μ :
(i : ι) → Measure (Ω i)
∀ i, IsProbabilityMeasure (μ i)
S T U :
hSTU :
S ∩ T ⊆ U
letI : Fintype ι
Proof (Lean source)
theorem condIndepFun_pi_of_inter_subset {ι : Type*} [DecidableEq ι] [Finite ι] {Ω : ι → Type*} [∀ i, MeasurableSpace (Ω i)] [∀ i, StandardBorelSpace (Ω i)] (μ : (i : ι) → Measure (Ω i)) [∀ i, IsProbabilityMeasure (μ i)] {S T U : Finset ι} (hSTU : S ∩ T ⊆ U) : letI : Fintype ι := Fintype.ofFinite ι CondIndepFun (comap (finsetCoordProj (Ω := Ω) U) inferInstance) (comap_le (measurable_finsetCoordProj (Ω := Ω) U)) (finsetCoordProj (Ω := Ω) S) (finsetCoordProj (Ω := Ω) T) (Measure.pi μ) := by classical letI : Fintype ι := Fintype.ofFinite ι let S0 : Finset ι := S \ U let T0 : Finset ι := T \ U have hS0T0 : Disjoint S0 T0 := by rw [Finset.disjoint_left] intro i hiS0 hiT0 change i ∈ S \ U at hiS0 change i ∈ T \ U at hiT0 rw [mem_sdiff] at hiS0 rw [mem_sdiff] at hiT0 exact hiT0.2 (hSTU (Finset.mem_inter.mpr ⟨hiS0.1, hiT0.1⟩)) have hS0U : Disjoint S0 U := by rw [Finset.disjoint_left] intro i hiS0 hiU change i ∈ S \ U at hiS0 rw [mem_sdiff] at hiS0 exact hiS0.2 hiU have hT0U : Disjoint T0 U := by rw [Finset.disjoint_left] intro i hiT0 hiU change i ∈ T \ U at hiT0 rw [mem_sdiff] at hiT0 exact hiT0.2 hiU have hbase : CondIndepFun (comap (finsetCoordProj (Ω := Ω) U) inferInstance) (comap_le (measurable_finsetCoordProj (Ω := Ω) U)) (fun x => (finsetCoordProj (Ω := Ω) U x, finsetCoordProj (Ω := Ω) S0 x)) (fun x => (finsetCoordProj (Ω := Ω) U x, finsetCoordProj (Ω := Ω) T0 x)) (Measure.pi μ) := condIndepFun_pi_cond_residual_of_disjoint (Ω := Ω) μ hS0T0 hS0U have h := hbase.comp (measurable_finsetCoordProjFromCondResidual (Ω := Ω) S U) (measurable_finsetCoordProjFromCondResidual (Ω := Ω) T U) simpa [S0, T0, finsetCoordProjFromCondResidual_comp] using h
Causalean.Mathlib.Probability.Independence.condIndepFun_pi_of_inter_subset · Causalean/Mathlib/Probability/Independence/Basic.lean:351 · uses finsetCoordProj , measurable_finsetCoordProj
10 supporting declarations (lemmas, instances)
Integral 1 core · 0 supporting This file proves a drop-of-conditioning identity for independent random variables: integrating a function of one variable over an event determined by an independent variable factors into the event's measure times the ful ★ integral_restrict_preimage_eq_mul

Integrals Under Independent Variables

This file proves a drop-of-conditioning identity for independent random variables: integrating a function of one variable over an event determined by an independent variable factors into the event's measure times the full integral.

theorem integral_restrict_preimage_eq_mul reviewed
ProbabilityTheory.IndepFun

Drop of conditioning. For random elements f and g that are independent, with f almost-everywhere measurable and g almost-everywhere measurable, given a measurable set E whose preimage f ⁻¹' E is measurable, and a function h that is almost-everywhere strongly measurable with respect to the pushforward measure of g, then restricting the integral of h ∘ g to the event f ⁻¹' E equals the measure of that event times the unrestricted integral of h ∘ g.

Formal statement
Ω α β :
Type*
Ω → α
Ω → β
hfg :
IndepFun f g μ
hf_ae :
hg :
E :
Set α
hE :
hpre :
MeasurableSet (f ⁻¹' E)
h :
β → ℝ
hh :
∫ ω in f ⁻¹' E, h (g ω) ∂μ = (μ (f ⁻¹' E)).toReal * ∫ ω, h (g ω) ∂μ
Proof (Lean source)
theorem IndepFun.integral_restrict_preimage_eq_mul {Ω α β : Type*} [MeasurableSpace Ω] [MeasurableSpace α] [MeasurableSpace β] {μ : Measure Ω} {f : Ω → α} {g : Ω → β} (hfg : IndepFun f g μ) (hf_ae : AEMeasurable f μ) (hg : AEMeasurable g μ) {E : Set α} (hE : MeasurableSet E) (hpre : MeasurableSet (f ⁻¹' E)) {h : β → ℝ} (hh : AEStronglyMeasurable h (μ.map g)) : ∫ ω in f ⁻¹' E, h (g ω) ∂μ = (μ (f ⁻¹' E)).toReal * ∫ ω, h (g ω) ∂μ := by classical -- `φ : α → ℝ` is the indicator of `E` as a plain function. set φ : α → ℝ := fun a => if a ∈ E then (1 : ℝ) else 0 with hφ_def have hφ_meas : Measurable φ := Measurable.ite hE measurable_const measurable_const -- Pointwise: `φ (f ω) = (f ⁻¹' E).indicator 1 ω`. have hφ_indicator : ∀ ω, φ (f ω) = (f ⁻¹' E).indicator (fun _ => (1 : ℝ)) ω := by intro ω by_cases hω : ω ∈ f ⁻¹' E · have hfE : f ω ∈ E := hω simp [hφ_def, hfE] · have hfE : f ω ∉ E := hω simp [hφ_def, hfE] -- Rewrite `∫ in f ⁻¹' E, ...` as `∫ φ(f) * h(g) dμ`. have heq_int : ∫ ω in f ⁻¹' E, h (g ω) ∂μ = ∫ ω, φ (f ω) * h (g ω) ∂μ := by rw [← MeasureTheory.integral_indicator hpre] refine MeasureTheory.integral_congr_ae (Filter.Eventually.of_forall ?_) intro ω by_cases hω : ω ∈ f ⁻¹' E · have hfE : f ω ∈ E := hω simp [hφ_def, hfE] · have hfE : f ω ∉ E := hω simp [hφ_def, hfE] -- Apply independence to factor the product integral. have hfAE : AEMeasurable f μ := hf_ae have hgAE : AEMeasurable g μ := hg have hφAEStr : AEStronglyMeasurable φ (μ.map f) := hφ_meas.aestronglyMeasurable have hmul : ∫ ω, φ (f ω) * h (g ω) ∂μ = (∫ ω, φ (f ω) ∂μ) * ∫ ω, h (g ω) ∂μ := hfg.integral_fun_comp_mul_comp hfAE hgAE hφAEStr hh -- `∫ φ(f) dμ = μ(f ⁻¹' E).toReal`. have hφint : ∫ ω, φ (f ω) ∂μ = (μ (f ⁻¹' E)).toReal := by rw [MeasureTheory.integral_congr_ae (Filter.Eventually.of_forall hφ_indicator)] rw [MeasureTheory.integral_indicator_const (1 : ℝ) hpre] simp [MeasureTheory.measureReal_def] rw [heq_int, hmul, hφint]
ProbabilityTheory.IndepFun.integral_restrict_preimage_eq_mul · Causalean/Mathlib/Probability/Independence/Integral.lean:25
Pair 1 core · 1 supporting This module transports indexed independence across a product probability space: two independent families on separate samples become independent after their corresponding coordinates are paired. ★ iIndepFun_pair_prod

Paired independent families

This module transports indexed independence across a product probability space: two independent families on separate samples become independent after their corresponding coordinates are paired.

theorem iIndepFun_pair_prod reviewed
Causalean.Mathlib.Probability.Independence

Given two probability spaces, a measurable indexed family of observations on the first, a measurable family with the same index set on the second, mutual independence of the first family under its probability law, and mutual independence of the second family under its probability law, the index-by-index pairs of observations form a mutually independent family under the product of the two probability laws.

Formal statement
J :
Type u_1
shared
Ω :
Type u_2
shared
Ω' :
Type u_3
shared
A :
Type u_4
shared
B :
Type u_5
shared
μ :
shared
ν :
shared
X :
J → Ω → A
shared
Y :
J → Ω' → B
shared
mX :
∀ j, Measurable (X j)
mY :
∀ j, Measurable (Y j)
hX :
iIndepFun X μ
hY :
iIndepFun Y ν
iIndepFun (fun j p => (X j p.1, Y j p.2)) (μ.prod ν)
Proof (Lean source)
theorem iIndepFun_pair_prod (mX : ∀ j, Measurable (X j)) (mY : ∀ j, Measurable (Y j)) (hX : iIndepFun X μ) (hY : iIndepFun Y ν) : iIndepFun (fun j p => (X j p.1, Y j p.2)) (μ.prod ν) := by let FX : Ω → J → A := fun ω j => X j ω let FY : Ω' → J → B := fun ω j => Y j ω have mFX : Measurable FX := measurable_pi_iff.mpr mX have mFY : Measurable FY := measurable_pi_iff.mpr mY have mPair : ∀ j, Measurable (fun p : Ω × Ω' => (X j p.1, Y j p.2)) := by intro j exact (mX j).comp measurable_fst |>.prodMk ((mY j).comp measurable_snd) have hXm : μ.map FX = infinitePi (fun j => μ.map (X j)) := (iIndepFun_iff_map_fun_eq_infinitePi_map mX).mp hX have hYm : ν.map FY = infinitePi (fun j => ν.map (Y j)) := (iIndepFun_iff_map_fun_eq_infinitePi_map mY).mp hY have hcoord (j : J) : (μ.prod ν).map (fun p : Ω × Ω' => (X j p.1, Y j p.2)) = (μ.map (X j)).prod (ν.map (Y j)) := by calc _ = (μ.prod ν).map (map (X j) (Y j)) := by congr 1 _ = _ := (Measure.map_prod_map μ ν (mX j) (mY j)).symm letI : ∀ j, IsProbabilityMeasure (μ.map (X j)) := fun j => Measure.isProbabilityMeasure_map (mX j).aemeasurable letI : ∀ j, IsProbabilityMeasure (ν.map (Y j)) := fun j => Measure.isProbabilityMeasure_map (mY j).aemeasurable apply (iIndepFun_iff_map_fun_eq_infinitePi_map mPair).mpr calc (μ.prod ν).map (fun p : Ω × Ω' => fun j => (X j p.1, Y j p.2)) = Measure.map (fun q : (J → A) × (J → B) => fun j => (q.1 j, q.2 j)) ((μ.map FX).prod (ν.map FY)) := by rw [Measure.map_prod_map μ ν mFX mFY, Measure.map_map (by fun_prop) (by fun_prop)] rfl _ = Measure.map (fun q : (J → A) × (J → B) => fun j => (q.1 j, q.2 j)) ((infinitePi (fun j => μ.map (X j))).prod (infinitePi (fun j => ν.map (Y j)))) := by rw [hXm, hYm] _ = infinitePi (fun j => (μ.map (X j)).prod (ν.map (Y j))) := map_pair_infinitePi_prod _ _ _ = infinitePi (fun j => (μ.prod ν).map (fun p : Ω × Ω' => (X j p.1, Y j p.2))) := by simp_rw [hcoord]
Causalean.Mathlib.Probability.Independence.iIndepFun_pair_prod · Causalean/Mathlib/Probability/Independence/Pair.lean:76
1 supporting declaration (lemmas, instances)
  • map_pair_infinitePi_prod theorem — Given an indexed collection of probability laws on the first value space and an indexed collection of probability laws on the second value space, pairing the corresponding coordinates sends the product of their array laws to the array law with coordinatewise product factors.
    J :
    Type u_1
    shared
    A :
    Type u_4
    shared
    B :
    Type u_5
    shared
    μj :
    J → Measure A
    νj :
    J → Measure B
    ∀ j, IsProbabilityMeasure (μj j)
    ∀ j, IsProbabilityMeasure (νj j)
    Measure.map (fun p : (J → A) × (J → B) => fun j => (p.1 j, p.2 j)) ((infinitePi μj).prod (infinitePi νj))
    = infinitePi (fun j => (μj j).prod (νj j))
    Proof (Lean source)
    theorem map_pair_infinitePi_prod (μj : J → Measure A) (νj : J → Measure B) [∀ j, IsProbabilityMeasure (μj j)] [∀ j, IsProbabilityMeasure (νj j)] : Measure.map (fun p : (J → A) × (J → B) => fun j => (p.1 j, p.2 j)) ((infinitePi μj).prod (infinitePi νj)) = infinitePi (fun j => (μj j).prod (νj j)) := by classical apply eq_infinitePi intro s t ht have hfinite : Measure.map (fun p : (J → A) × (J → B) => fun j : s => (p.1 j, p.2 j)) ((infinitePi μj).prod (infinitePi νj)) = Measure.pi (fun j : s => (μj j).prod (νj j)) := by have hprod := Measure.map_prod_map (infinitePi μj) (infinitePi νj) (Finset.measurable_restrict s) (Finset.measurable_restrict s) rw [infinitePi_map_restrict, infinitePi_map_restrict] at hprod have hpair := (measurePreserving_arrowProdEquivProdArrow A B s (fun j : s => μj j) (fun j : s => νj j)).symm.map_eq calc _ = Measure.map (fun q : (s → A) × (s → B) => fun j => (q.1 j, q.2 j)) (Measure.map (map (s.restrict : (J → A) → (s → A)) (s.restrict : (J → B) → (s → B))) ((infinitePi μj).prod (infinitePi νj))) := by rw [map_map (by fun_prop) (by fun_prop)] rfl _ = Measure.map (fun q : (s → A) × (s → B) => fun j => (q.1 j, q.2 j)) ((Measure.pi (fun j : s => μj j)).prod (Measure.pi (fun j : s => νj j))) := by rw [← hprod] _ = _ := by simpa [MeasurableEquiv.arrowProdEquivProdArrow, Equiv.arrowProdEquivProdArrow] using hpair calc _ = (Measure.pi (fun j : s => (μj j).prod (νj j))) (Set.univ.pi (fun j : s => t j)) := by rw [← hfinite] rw [map_apply (by fun_prop) (.pi s.countable_toSet fun _ _ => ht _)] rw [map_apply (by fun_prop) (.pi Set.countable_univ fun _ _ => ht _)] congr 1 ext p simp [Set.mem_pi] _ = ∏ j : s, ((μj j).prod (νj j)) (t j) := by rw [Measure.pi_pi] _ = ∏ j ∈ s, ((μj j).prod (νj j)) (t j) := by simpa using (Finset.prod_attach s (fun j => ((μj j).prod (νj j)) (t j)))
    Causalean.Mathlib.Probability.Independence.map_pair_infinitePi_prod · Causalean/Mathlib/Probability/Independence/Pair.lean:28