Mathlib.Probability.Independence.Conditional.Density­Intersection

Positive-density graphoid intersection for conditional independence.

Basic 15 core · 13 supporting This module fixes the product ordering and the measurable coordinate maps used by the positive-density intersection theorem. ★ secondThird_subset_fourBlock

Product coordinates and density factorizations

This module fixes the product ordering and the measurable coordinate maps used by the positive-density intersection theorem. It also records the three density-factorization predicates which express the two premises and the desired conclusion. The definitions are measure-theoretic and contain no graph- or paper-specific assumptions.

abbrev FourBlock reviewed
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection

The canonical sample space for four random blocks, ordered as X, Y, V, and Z.

Definition (Lean source)
X :
Type uX
Y :
Type uY
V :
Type uV
Z :
Type uZ
FourBlock X Y V Z :
Type (max uX (max uZ uV) uY)
X × (Y × (V × Z))
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection.FourBlock · Causalean/Mathlib/Probability/Independence/Conditional/DensityIntersection/Basic.lean:27
def xCoord reviewed
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection

The first coordinate of a four-block sample is its X block.

Definition (Lean source)
X :
Type uX
Y :
Type uY
V :
Type uV
Z :
Type uZ
xCoord :
FourBlock X Y V Z → X
fun q => q.1
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection.xCoord · Causalean/Mathlib/Probability/Independence/Conditional/DensityIntersection/Basic.lean:31 · uses FourBlock
def yCoord reviewed
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection

The second coordinate of a four-block sample is its Y block.

Definition (Lean source)
X :
Type uX
Y :
Type uY
V :
Type uV
Z :
Type uZ
yCoord :
FourBlock X Y V Z → Y
fun q => q.2.1
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection.yCoord · Causalean/Mathlib/Probability/Independence/Conditional/DensityIntersection/Basic.lean:35 · uses FourBlock
def vCoord reviewed
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection

The third coordinate of a four-block sample is its V block.

Definition (Lean source)
X :
Type uX
Y :
Type uY
V :
Type uV
Z :
Type uZ
vCoord :
FourBlock X Y V Z → V
fun q => q.2.2.1
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection.vCoord · Causalean/Mathlib/Probability/Independence/Conditional/DensityIntersection/Basic.lean:39 · uses FourBlock
def zCoord reviewed
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection

The fourth coordinate of a four-block sample is its Z block.

Definition (Lean source)
X :
Type uX
Y :
Type uY
V :
Type uV
Z :
Type uZ
zCoord :
FourBlock X Y V Z → Z
fun q => q.2.2.2
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection.zCoord · Causalean/Mathlib/Probability/Independence/Conditional/DensityIntersection/Basic.lean:43 · uses FourBlock
def zvCoord reviewed
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection

A four-block sample determines the conditioning pair (Z,V).

Definition (Lean source)
X :
Type uX
Y :
Type uY
V :
Type uV
Z :
Type uZ
zvCoord :
FourBlock X Y V Z → Z × V
fun q => (q.2.2.2, q.2.2.1)
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection.zvCoord · Causalean/Mathlib/Probability/Independence/Conditional/DensityIntersection/Basic.lean:47 · uses FourBlock
def zyCoord reviewed
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection

A four-block sample determines the conditioning pair (Z,Y).

Definition (Lean source)
X :
Type uX
Y :
Type uY
V :
Type uV
Z :
Type uZ
zyCoord :
FourBlock X Y V Z → Z × Y
fun q => (q.2.2.2, q.2.1)
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection.zyCoord · Causalean/Mathlib/Probability/Independence/Conditional/DensityIntersection/Basic.lean:51 · uses FourBlock
def yvCoord reviewed
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection

A four-block sample determines the combined block (Y,V).

Definition (Lean source)
X :
Type uX
Y :
Type uY
V :
Type uV
Z :
Type uZ
yvCoord :
FourBlock X Y V Z → Y × V
fun q => (q.2.1, q.2.2.1)
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection.yvCoord · Causalean/Mathlib/Probability/Independence/Conditional/DensityIntersection/Basic.lean:55 · uses FourBlock
def fourBlockReference reviewed
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection

Four coordinate reference measures determine their right-associated product reference measure on the canonical four-block sample space.

Definition (Lean source)
X :
Type uX
Y :
Type uY
V :
Type uV
Z :
Type uZ
μX :
μY :
μV :
μZ :
fourBlockReference μX μY μV μZ :
Measure (FourBlock X Y V Z)
μX.prod (μY.prod (μV.prod μZ))
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection.fourBlockReference · Causalean/Mathlib/Probability/Independence/Conditional/DensityIntersection/Basic.lean:97 · uses FourBlock
def FactorsXYGivenZV reviewed
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection

A density factors according to X ⟂ Y | (Z,V) when it equals, almost everywhere with respect to the product of the four reference measures, a product of one measurable nonnegative extended-real factor depending on (X,V,Z) and another depending on (Y,V,Z).

Definition (Lean source)
X :
Type uX
shared
Y :
Type uY
shared
V :
Type uV
shared
Z :
Type uZ
shared
μX :
μY :
μV :
μZ :
d :
FourBlock X Y V Z → ℝ≥0∞
FactorsXYGivenZV μX μY μV μZ d :
Prop
∃ a : X × (V × Z) → ℝ≥0∞, ∃ b : Y × (V × Z) → ℝ≥0∞,
clause 1
clause 2
clause 3
d
=ᵐ[fourBlockReference μX μY μV μZ] (fun q => a (xCoord q, (vCoord q, zCoord q)) * b (yCoord q, (vCoord q, zCoord q)))
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection.FactorsXYGivenZV · Causalean/Mathlib/Probability/Independence/Conditional/DensityIntersection/Basic.lean:109 · uses FourBlock
def FactorsXVGivenZY reviewed
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection

A density factors according to X ⟂ V | (Z,Y) when it equals, almost everywhere with respect to the product of the four reference measures, a product of one measurable nonnegative extended-real factor depending on (X,Y,Z) and another depending on (V,Y,Z).

Definition (Lean source)
X :
Type uX
shared
Y :
Type uY
shared
V :
Type uV
shared
Z :
Type uZ
shared
μX :
μY :
μV :
μZ :
d :
FourBlock X Y V Z → ℝ≥0∞
FactorsXVGivenZY μX μY μV μZ d :
Prop
∃ a : X × (Y × Z) → ℝ≥0∞, ∃ b : V × (Y × Z) → ℝ≥0∞,
clause 1
clause 2
clause 3
d
=ᵐ[fourBlockReference μX μY μV μZ] (fun q => a (xCoord q, (yCoord q, zCoord q)) * b (vCoord q, (yCoord q, zCoord q)))
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection.FactorsXVGivenZY · Causalean/Mathlib/Probability/Independence/Conditional/DensityIntersection/Basic.lean:120 · uses FourBlock
def FactorsXYVGivenZ reviewed
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection

A density factors according to X ⟂ (Y,V) | Z when it equals, almost everywhere with respect to the product of the four reference measures, a product of one measurable nonnegative extended-real factor depending on (X,Z) and another depending on (Y,V,Z).

Definition (Lean source)
X :
Type uX
shared
Y :
Type uY
shared
V :
Type uV
shared
Z :
Type uZ
shared
μX :
μY :
μV :
μZ :
d :
FourBlock X Y V Z → ℝ≥0∞
FactorsXYVGivenZ μX μY μV μZ d :
Prop
∃ a : X × Z → ℝ≥0∞, ∃ b : (Y × V) × Z → ℝ≥0∞,
clause 1
clause 2
clause 3
d
=ᵐ[fourBlockReference μX μY μV μZ] (fun q => a (xCoord q, zCoord q) * b ((yCoord q, vCoord q), zCoord q))
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection.FactorsXYVGivenZ · Causalean/Mathlib/Probability/Independence/Conditional/DensityIntersection/Basic.lean:131 · uses FourBlock
def fourBlockIndices reviewed
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection

The union of four finite index blocks, which is the ambient index set on which the finite-coordinate specialization is stated.

Definition (Lean source)
M :
Type uM
I J K L :
fourBlockIndices I J K L :
I ∪ J ∪ K ∪ L
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection.fourBlockIndices · Causalean/Mathlib/Probability/Independence/Conditional/DensityIntersection/Basic.lean:143
theorem secondThird_subset_fourBlock reviewed
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection

For four finite coordinate blocks, the union of the second and third blocks is contained in the union of all four.

Formal statement
M :
Type uM
shared
I :
shared
J :
shared
K :
shared
L :
shared
J ∪ K ⊆ fourBlockIndices I J K L
Proof (Lean source)
theorem secondThird_subset_fourBlock : J ∪ K ⊆ fourBlockIndices I J K L := by intro i hi simp only [fourBlockIndices, mem_union] at hi ⊢ aesop
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection.secondThird_subset_fourBlock · Causalean/Mathlib/Probability/Independence/Conditional/DensityIntersection/Basic.lean:172 · uses fourBlockIndices
def finiteBlockReference reviewed
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection

Coordinate reference measures determine the product reference measure on assignments to the union of four finite coordinate blocks.

Definition (Lean source)
M :
Type uM
M → Type uΩ
∀ i, MeasurableSpace (Ω i)
I J K L :
μ :
∀ i, Measure (Ω i)
finiteBlockReference I J K L μ :
Measure.pi fun i => μ i
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection.finiteBlockReference · Causalean/Mathlib/Probability/Independence/Conditional/DensityIntersection/Basic.lean:193 · uses ValuesOn , fourBlockIndices
13 supporting declarations (lemmas, instances)
Three­Block­Marginals 11 core · 6 supporting This module fixes the canonical three-block coordinates and isolates the Tonelli calculations identifying every marginal law used by the conditional-independence bridge. ★ map_thirdThreeCoord_withDensity

Marginal laws of a three-block product density

This module fixes the canonical three-block coordinates and isolates the Tonelli calculations identifying every marginal law used by the conditional-independence bridge. In particular, it records the laws of the conditioning block, each random block paired with the conditioning block, and the fully reordered triple.

abbrev ThreeBlock reviewed
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection

The canonical sample space for two random blocks and one conditioning block.

Definition (Lean source)
A :
Type uA
B :
Type uB
C :
Type uC
ThreeBlock A B C :
Type (max uA uC uB)
A × (B × C)
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection.ThreeBlock · Causalean/Mathlib/Probability/Independence/Conditional/DensityIntersection/ThreeBlockMarginals.lean:24
def firstThreeCoord reviewed
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection

The first random coordinate of a canonical three-block sample.

Definition (Lean source)
A :
Type uA
B :
Type uB
C :
Type uC
firstThreeCoord :
ThreeBlock A B C → A
fun q ↦ q.1
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection.firstThreeCoord · Causalean/Mathlib/Probability/Independence/Conditional/DensityIntersection/ThreeBlockMarginals.lean:27 · uses ThreeBlock
def secondThreeCoord reviewed
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection

The second random coordinate of a canonical three-block sample.

Definition (Lean source)
A :
Type uA
B :
Type uB
C :
Type uC
secondThreeCoord :
ThreeBlock A B C → B
fun q ↦ q.2.1
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection.secondThreeCoord · Causalean/Mathlib/Probability/Independence/Conditional/DensityIntersection/ThreeBlockMarginals.lean:31 · uses ThreeBlock
def thirdThreeCoord reviewed
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection

The conditioning coordinate of a canonical three-block sample.

Definition (Lean source)
A :
Type uA
B :
Type uB
C :
Type uC
thirdThreeCoord :
ThreeBlock A B C → C
fun q ↦ q.2.2
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection.thirdThreeCoord · Causalean/Mathlib/Probability/Independence/Conditional/DensityIntersection/ThreeBlockMarginals.lean:35 · uses ThreeBlock
def threeBlockReference reviewed
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection

Three coordinate reference measures determine the right-associated product reference measure on the canonical three-block sample space.

Definition (Lean source)
A :
Type uA
B :
Type uB
C :
Type uC
muA :
muB :
muC :
threeBlockReference muA muB muC :
muA.prod (muB.prod muC)
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection.threeBlockReference · Causalean/Mathlib/Probability/Independence/Conditional/DensityIntersection/ThreeBlockMarginals.lean:58 · uses ThreeBlock
def densityFirstConditioning reviewed
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection

Integrating a three-block density over the second random block gives its first-and-conditioning marginal density.

Definition (Lean source)
A :
Type uA
shared
B :
Type uB
shared
C :
Type uC
shared
muB :
d :
ThreeBlock A B C → ℝ≥0∞
densityFirstConditioning muB d :
A × C → ℝ≥0∞
fun ac ↦ ∫⁻ b, d (ac.1, (b, ac.2)) ∂muB
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection.densityFirstConditioning · Causalean/Mathlib/Probability/Independence/Conditional/DensityIntersection/ThreeBlockMarginals.lean:70 · uses ThreeBlock
def densitySecondConditioning reviewed
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection

Integrating a three-block density over the first random block gives its second-and-conditioning marginal density.

Definition (Lean source)
A :
Type uA
shared
B :
Type uB
shared
C :
Type uC
shared
muA :
d :
ThreeBlock A B C → ℝ≥0∞
densitySecondConditioning muA d :
B × C → ℝ≥0∞
fun bc ↦ ∫⁻ a, d (a, (bc.1, bc.2)) ∂muA
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection.densitySecondConditioning · Causalean/Mathlib/Probability/Independence/Conditional/DensityIntersection/ThreeBlockMarginals.lean:75 · uses ThreeBlock
def densityConditioning reviewed
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection

Integrating a three-block density over both random blocks gives its conditioning marginal density.

Definition (Lean source)
A :
Type uA
shared
B :
Type uB
shared
C :
Type uC
shared
muA :
muB :
d :
ThreeBlock A B C → ℝ≥0∞
densityConditioning muA muB d :
C → ℝ≥0∞
fun c ↦ ∫⁻ a, ∫⁻ b, d (a, (b, c)) ∂muB ∂muA
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection.densityConditioning · Causalean/Mathlib/Probability/Independence/Conditional/DensityIntersection/ThreeBlockMarginals.lean:80 · uses ThreeBlock
def ThreeBlockFactors reviewed
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection

A three-block density factors given its third block when it equals, almost everywhere with respect to the product of the three reference measures, the product of two measurable nonnegative extended-real terms, one depending on (A,C) and the other on (B,C).

Definition (Lean source)
A :
Type uA
shared
B :
Type uB
shared
C :
Type uC
shared
muA :
muB :
muC :
d :
ThreeBlock A B C → ℝ≥0∞
ThreeBlockFactors muA muB muC d :
Prop
∃ a : A × C → ℝ≥0∞, ∃ b : B × C → ℝ≥0∞,
clause 1
clause 2
clause 3
d =ᵐ[threeBlockReference muA muB muC] (fun q ↦ a (q.1, q.2.2) * b (q.2.1, q.2.2))
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection.ThreeBlockFactors · Causalean/Mathlib/Probability/Independence/Conditional/DensityIntersection/ThreeBlockMarginals.lean:86 · uses ThreeBlock
def ThreeBlockDensityIdentity reviewed
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection

The conditional-density identity says that the joint density times the conditioning marginal density equals the product of the two random-block-with-conditioning marginal densities, almost everywhere with respect to the product of the three reference measures.

Definition (Lean source)
A :
Type uA
shared
B :
Type uB
shared
C :
Type uC
shared
muA :
muB :
muC :
d :
ThreeBlock A B C → ℝ≥0∞
ThreeBlockDensityIdentity muA muB muC d :
Prop
∀ᵐ q ∂threeBlockReference muA muB muC, d q * densityConditioning muA muB d q.2.2
= densityFirstConditioning muB d (q.1, q.2.2) * densitySecondConditioning muA d (q.2.1, q.2.2)
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection.ThreeBlockDensityIdentity · Causalean/Mathlib/Probability/Independence/Conditional/DensityIntersection/ThreeBlockMarginals.lean:96 · uses ThreeBlock
theorem map_thirdThreeCoord_withDensity reviewed
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection

For three σ-finite reference measures and a measurable three-block density, pushing the density-weighted product measure forward to the conditioning coordinate gives the conditioning reference measure weighted by the conditioning marginal density.

Formal statement
A :
Type uA
shared
B :
Type uB
shared
C :
Type uC
shared
muA :
shared
muB :
shared
muC :
shared
d :
shared
hd :
((threeBlockReference muA muB muC).withDensity d).map (@thirdThreeCoord A B C)
= muC.withDensity (densityConditioning muA muB d)
Proof (Lean source)
theorem map_thirdThreeCoord_withDensity (hd : Measurable d) : ((threeBlockReference muA muB muC).withDensity d).map (@thirdThreeCoord A B C) = muC.withDensity (densityConditioning muA muB d) := by /- Prove equality on measurable sets, expand `map` and `withDensity`, then commute the `C` integral past the `A` and `B` integrals by Tonelli. -/ have hdc : Measurable (densityConditioning muA muB d) := by unfold densityConditioning fun_prop refine Measure.ext_of_lintegral _ fun f hf ↦ ?_ rw [lintegral_map hf measurable_thirdThreeCoord, lintegral_withDensity_eq_lintegral_mul _ hd (by fun_prop), lintegral_withDensity_eq_lintegral_mul _ hdc hf] change (∫⁻ q : A × (B × C), d q * f q.2.2 ∂muA.prod (muB.prod muC)) = ∫⁻ c, (∫⁻ a, ∫⁻ b, d (a, (b, c)) ∂muB ∂muA) * f c ∂muC rw [lintegral_prod _ (by fun_prop)] have hBC (a : A) : (∫⁻ b, ∫⁻ c, d (a, (b, c)) * f c ∂muC ∂muB) = ∫⁻ c, ∫⁻ b, d (a, (b, c)) * f c ∂muB ∂muC := by exact lintegral_lintegral_swap (by fun_prop) calc _ = ∫⁻ a, ∫⁻ b, ∫⁻ c, d (a, (b, c)) * f c ∂muC ∂muB ∂muA := by apply lintegral_congr intro a rw [lintegral_prod _ (by fun_prop)] _ = ∫⁻ a, ∫⁻ c, ∫⁻ b, d (a, (b, c)) * f c ∂muB ∂muC ∂muA := by apply lintegral_congr exact hBC _ = ∫⁻ c, ∫⁻ a, ∫⁻ b, d (a, (b, c)) * f c ∂muB ∂muA ∂muC := by exact lintegral_lintegral_swap (by fun_prop) _ = _ := by apply lintegral_congr intro c calc _ = ∫⁻ a, (∫⁻ b, d (a, (b, c)) ∂muB) * f c ∂muA := by apply lintegral_congr intro a rw [lintegral_mul_const (f c) (by fun_prop)] _ = _ := lintegral_mul_const (f c) (by fun_prop)
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection.map_thirdThreeCoord_withDensity · Causalean/Mathlib/Probability/Independence/Conditional/DensityIntersection/ThreeBlockMarginals.lean:116 · uses ThreeBlock , densityConditioning , thirdThreeCoord , threeBlockReference
6 supporting declarations (lemmas, instances)
Factorization 1 core · 2 supporting This module gives the three product-density factorization characterizations needed by the intersection proof. ★ condIndepFun_xyv_given_z_iff_factors

Conditional independence as density factorization

This module gives the three product-density factorization characterizations needed by the intersection proof. They deliberately use the same canonical four-block product measure, so the subsequent splicing argument does not have to transport almost-everywhere statements across ad hoc reorderings.

theorem condIndepFun_xyv_given_z_iff_factors reviewed
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection

For four σ-finite reference measures on standard Borel spaces and a measurable density whose weighting of the product reference measure has finite total mass, the first block is conditionally independent of the combined second and third blocks given the fourth, under the density-weighted measure, exactly when the density is almost everywhere a product of a measurable factor of the first and fourth blocks and a measurable factor of the other three blocks.

Formal statement
X :
Type uX
shared
Y :
Type uY
shared
V :
Type uV
shared
Z :
Type uZ
shared
μX :
shared
μY :
shared
μV :
shared
μZ :
shared
d :
FourBlock X Y V Z → ENNReal
shared
hd :
CondIndepFun (comap (@zCoord X Y V Z) inferInstance) measurable_zCoord.comap_le (@xCoord X Y V Z) (@yvCoord X Y V Z) ((fourBlockReference μX μY μV μZ).withDensity d)
↔ FactorsXYVGivenZ μX μY μV μZ d
Proof (Lean source)
theorem condIndepFun_xyv_given_z_iff_factors (hd : Measurable d) : CondIndepFun (comap (@zCoord X Y V Z) inferInstance) measurable_zCoord.comap_le (@xCoord X Y V Z) (@yvCoord X Y V Z) ((fourBlockReference μX μY μV μZ).withDensity d) ↔ FactorsXYVGivenZ μX μY μV μZ d := by let e : (X × ((Y × V) × Z)) ≃ᵐ FourBlock X Y V Z := assocYV let d' : X × ((Y × V) × Z) → ℝ≥0∞ := d ∘ e have he : MeasurePreserving e (threeBlockReference μX (μY.prod μV) μZ) (fourBlockReference μX μY μV μZ) := by simpa [e, threeBlockReference, fourBlockReference] using measurePreserving_assocYV μX μY μV μZ have hd' : Measurable d' := hd.comp e.measurable have hlaw : ((threeBlockReference μX (μY.prod μV) μZ).withDensity d').map e = (fourBlockReference μX μY μV μZ).withDensity d := by simpa [d'] using Causalean.Mathlib.MeasureTheory.map_withDensity_comp_measurableEquiv e he d have hlaw' : ((fourBlockReference μX μY μV μZ).withDensity d).map e.symm = (threeBlockReference μX (μY.prod μV) μZ).withDensity d' := by rw [← hlaw, Measure.map_map e.symm.measurable e.measurable] simpa using congrArg (fun f ↦ Measure.map f ((threeBlockReference μX (μY.prod μV) μZ).withDensity d')) e.symm_comp_self letI : IsFiniteMeasure ((threeBlockReference μX (μY.prod μV) μZ).withDensity d') := by rw [← hlaw'] infer_instance have htransport : CondIndepFun (comap (@thirdThreeCoord X (Y × V) Z) inferInstance) measurable_thirdThreeCoord.comap_le (@firstThreeCoord X (Y × V) Z) (@secondThreeCoord X (Y × V) Z) ((threeBlockReference μX (μY.prod μV) μZ).withDensity d') ↔ CondIndepFun (comap (@zCoord X Y V Z) inferInstance) measurable_zCoord.comap_le (@xCoord X Y V Z) (@yvCoord X Y V Z) ((fourBlockReference μX μY μV μZ).withDensity d) := by change CondIndepFun (comap (fun q : X × ((Y × V) × Z) ↦ q.2.2) inferInstance) _ (fun q : X × ((Y × V) × Z) ↦ q.1) (fun q ↦ q.2.1) ((threeBlockReference μX (μY.prod μV) μZ).withDensity d') ↔ _ simpa [e, assocYV, xCoord, yCoord, vCoord, zCoord, yvCoord, Function.comp_def] using (condIndepFun_measurableEquiv_iff e hlaw measurable_xCoord measurable_yvCoord measurable_zCoord) have hfactors : ThreeBlockFactors μX (μY.prod μV) μZ d' ↔ FactorsXYVGivenZ μX μY μV μZ d := by constructor · rintro ⟨a, b, ha, hb, hab⟩ refine ⟨a, b, ha, hb, ?_⟩ change ∀ᵐ q ∂fourBlockReference μX μY μV μZ, d q = a (xCoord q, zCoord q) * b ((yCoord q, vCoord q), zCoord q) rw [← he.map_eq, e.measurableEmbedding.ae_map_iff] change ∀ᵐ q ∂threeBlockReference μX (μY.prod μV) μZ, d' q = a (q.1, q.2.2) * b (q.2.1, q.2.2) at hab simpa [d', e, assocYV, xCoord, yCoord, vCoord, zCoord, Function.comp_def] using hab · rintro ⟨a, b, ha, hb, hab⟩ refine ⟨a, b, ha, hb, ?_⟩ change ∀ᵐ q ∂threeBlockReference μX (μY.prod μV) μZ, d' q = a (q.1, q.2.2) * b (q.2.1, q.2.2) change ∀ᵐ q ∂fourBlockReference μX μY μV μZ, d q = a (xCoord q, zCoord q) * b ((yCoord q, vCoord q), zCoord q) at hab rw [← he.map_eq, e.measurableEmbedding.ae_map_iff] at hab simpa [d', e, assocYV, xCoord, yCoord, vCoord, zCoord, Function.comp_def] using hab calc _ ↔ CondIndepFun (comap (@thirdThreeCoord X (Y × V) Z) inferInstance) _ (@firstThreeCoord X (Y × V) Z) (@secondThreeCoord X (Y × V) Z) ((threeBlockReference μX (μY.prod μV) μZ).withDensity d') := htransport.symm _ ↔ ThreeBlockFactors μX (μY.prod μV) μZ d' := condIndepFun_threeBlock_iff_factors μX (μY.prod μV) μZ hd' _ ↔ FactorsXYVGivenZ μX μY μV μZ d := hfactors
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection.condIndepFun_xyv_given_z_iff_factors · Causalean/Mathlib/Probability/Independence/Conditional/DensityIntersection/Factorization.lean:329 · uses FactorsXYVGivenZ , FourBlock , fourBlockReference , measurable_zCoord , xCoord , yvCoord , zCoord
2 supporting declarations (lemmas, instances)
Finite­Coordinates 1 core · 1 supporting This module specializes graphoid intersection to coordinate projections on the union of four finite index blocks. ★ condIndep_valuesProjection_intersection_of_positiveDensity

Positive-density intersection for finite coordinate blocks

This module specializes graphoid intersection to coordinate projections on the union of four finite index blocks. All six pairwise-disjointness facts are explicit hypotheses; in particular, the API cannot be applied to overlap degeneracies in which a conditioned coordinate is repeated inside another block.

theorem condIndep_valuesProjection_intersection_of_positiveDensity reviewed
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection

For four finite coordinate blocks that are pairwise disjoint, σ-finite coordinate reference measures on standard Borel coordinate spaces, a measurable density on assignments to the union of the blocks whose weighting of the product reference measure has finite total mass, strict positivity of that density almost everywhere for the product reference measure, and, under the density-weighted measure, conditional independence of the first and second blocks given the fourth and third together, and of the first and third blocks given the fourth and second together, the coordinates in the first block are conditionally independent of those in the union of the second and third blocks given the fourth.

Formal statement
M :
Type uM
M → Type uΩ
∀ i, MeasurableSpace (Ω i)
∀ i, StandardBorelSpace (Ω i)
I J K L :
hIJ :
hIK :
hIL :
hJK :
hJL :
hKL :
μ :
∀ i, Measure (Ω i)
∀ i, SigmaFinite (μ i)
d :
ValuesOn (fourBlockIndices I J K L) Ω → ℝ≥0∞
hd :
IsFiniteMeasure ((finiteBlockReference I J K L μ).withDensity d)
hpos :
∀ᵐ q ∂finiteBlockReference I J K L μ, 0 < d q
Proof (Lean source)
theorem condIndep_valuesProjection_intersection_of_positiveDensity {M : Type uM} [DecidableEq M] {Ω : M → Type uΩ} [∀ i, MeasurableSpace (Ω i)] [∀ i, StandardBorelSpace (Ω i)] (I J K L : Finset M) (hIJ : Disjoint I J) (hIK : Disjoint I K) (hIL : Disjoint I L) (hJK : Disjoint J K) (hJL : Disjoint J L) (hKL : Disjoint K L) (μ : ∀ i, Measure (Ω i)) [∀ i, SigmaFinite (μ i)] {d : ValuesOn (fourBlockIndices I J K L) Ω → ℝ≥0∞} (hd : Measurable d) [IsFiniteMeasure ((finiteBlockReference I J K L μ).withDensity d)] (hpos : ∀ᵐ q ∂finiteBlockReference I J K L μ, 0 < d q) (hIJ_given_LK : CondIndepFun (comap (valuesProjection (fourthThird_subset_fourBlock I J K L)) inferInstance) (comap_valuesProjection_le (fourthThird_subset_fourBlock I J K L)) (valuesProjection (first_subset_fourBlock I J K L)) (valuesProjection (second_subset_fourBlock I J K L)) ((finiteBlockReference I J K L μ).withDensity d)) (hIK_given_LJ : CondIndepFun (comap (valuesProjection (fourthSecond_subset_fourBlock I J K L)) inferInstance) (comap_valuesProjection_le (fourthSecond_subset_fourBlock I J K L)) (valuesProjection (first_subset_fourBlock I J K L)) (valuesProjection (third_subset_fourBlock I J K L)) ((finiteBlockReference I J K L μ).withDensity d)) : CondIndepFun (comap (valuesProjection (fourth_subset_fourBlock I J K L)) inferInstance) (comap_valuesProjection_le (fourth_subset_fourBlock I J K L)) (valuesProjection (first_subset_fourBlock I J K L)) (valuesProjection (secondThird_subset_fourBlock I J K L)) ((finiteBlockReference I J K L μ).withDensity d) := by let μI : Measure (ValuesOn I Ω) := Measure.pi fun i : I ↦ μ i let μJ : Measure (ValuesOn J Ω) := Measure.pi fun i : J ↦ μ i let μK : Measure (ValuesOn K Ω) := Measure.pi fun i : K ↦ μ i let μL : Measure (ValuesOn L Ω) := Measure.pi fun i : L ↦ μ i let e : FourBlock (ValuesOn I Ω) (ValuesOn J Ω) (ValuesOn K Ω) (ValuesOn L Ω) ≃ᵐ ValuesOn (fourBlockIndices I J K L) Ω := fourBlockValuesEquiv I J K L hKL (Finset.disjoint_union_right.mpr ⟨hJK, hJL⟩) (Finset.disjoint_union_right.mpr ⟨hIJ, Finset.disjoint_union_right.mpr ⟨hIK, hIL⟩⟩) let ν := fourBlockReference μI μJ μK μL let d' : FourBlock (ValuesOn I Ω) (ValuesOn J Ω) (ValuesOn K Ω) (ValuesOn L Ω) → ℝ≥0∞ := d ∘ e have he : MeasurePreserving e ν (finiteBlockReference I J K L μ) := by simpa only [e, ν, μI, μJ, μK, μL] using measurePreserving_fourBlockValuesEquiv I J K L hIJ hIK hIL hJK hJL hKL μ have hd' : Measurable d' := hd.comp e.measurable have hlaw : (ν.withDensity d').map e = (finiteBlockReference I J K L μ).withDensity d := by simpa only [d'] using Causalean.Mathlib.MeasureTheory.map_withDensity_comp_measurableEquiv e he d have hlaw' : ((finiteBlockReference I J K L μ).withDensity d).map e.symm = ν.withDensity d' := by rw [← hlaw, Measure.map_map e.symm.measurable e.measurable] simpa using congrArg (fun f ↦ Measure.map f (ν.withDensity d')) e.symm_comp_self letI : IsFiniteMeasure (ν.withDensity d') := by rw [← hlaw'] infer_instance have hpos' : ∀ᵐ q ∂ν, 0 < d' q := by rw [← he.map_eq, e.measurableEmbedding.ae_map_iff] at hpos simpa only [d', Function.comp_apply] using hpos have hJ_KL : Disjoint J (K ∪ L) := Finset.disjoint_union_right.mpr ⟨hJK, hJL⟩ have hI_JKL : Disjoint I (J ∪ (K ∪ L)) := Finset.disjoint_union_right.mpr ⟨hIJ, Finset.disjoint_union_right.mpr ⟨hIK, hIL⟩⟩ have hx : valuesProjection (first_subset_fourBlock I J K L) ∘ e = (@xCoord (ValuesOn I Ω) (ValuesOn J Ω) (ValuesOn K Ω) (ValuesOn L Ω)) := by funext q ext i change valuesProjection (first_subset_fourBlock I J K L) (fourBlockValuesEquiv I J K L hKL hJ_KL hI_JKL q) i = q.1 i unfold fourBlockValuesEquiv simp only [MeasurableEquiv.trans_apply, MeasurableEquiv.prodCongr, valuesProjection] rw [valuesEquivOfEq_apply] change (Equiv.piFinsetUnion Ω hI_JKL) (q.1, (Equiv.piFinsetUnion Ω hJ_KL) (q.2.1, (Equiv.piFinsetUnion Ω hKL) (q.2.2.1, q.2.2.2))) ⟨i.val, mem_union_left _ i.property⟩ = q.1 i exact Equiv.piFinsetUnion_left Ω hI_JKL i.property _ have hy : valuesProjection (second_subset_fourBlock I J K L) ∘ e = (@yCoord (ValuesOn I Ω) (ValuesOn J Ω) (ValuesOn K Ω) (ValuesOn L Ω)) := by funext q ext i change valuesProjection (second_subset_fourBlock I J K L) (fourBlockValuesEquiv I J K L hKL hJ_KL hI_JKL q) i = q.2.1 i unfold fourBlockValuesEquiv simp only [MeasurableEquiv.trans_apply, MeasurableEquiv.prodCongr, valuesProjection] rw [valuesEquivOfEq_apply] change (Equiv.piFinsetUnion Ω hI_JKL) (q.1, (Equiv.piFinsetUnion Ω hJ_KL) (q.2.1, (Equiv.piFinsetUnion Ω hKL) (q.2.2.1, q.2.2.2))) ⟨i.val, mem_union_right I (mem_union_left _ i.property)⟩ = q.2.1 i calc _ = (Equiv.piFinsetUnion Ω hJ_KL) (q.2.1, (Equiv.piFinsetUnion Ω hKL) (q.2.2.1, q.2.2.2)) ⟨i.val, mem_union_left _ i.property⟩ := Equiv.piFinsetUnion_right Ω hI_JKL (mem_union_left _ i.property) _ _ = q.2.1 i := Equiv.piFinsetUnion_left Ω hJ_KL i.property _ have hv : valuesProjection (third_subset_fourBlock I J K L) ∘ e = (@vCoord (ValuesOn I Ω) (ValuesOn J Ω) (ValuesOn K Ω) (ValuesOn L Ω)) := by funext q ext i change valuesProjection (third_subset_fourBlock I J K L) (fourBlockValuesEquiv I J K L hKL hJ_KL hI_JKL q) i = q.2.2.1 i unfold fourBlockValuesEquiv simp only [MeasurableEquiv.trans_apply, MeasurableEquiv.prodCongr, valuesProjection] rw [valuesEquivOfEq_apply] change (Equiv.piFinsetUnion Ω hI_JKL) (q.1, (Equiv.piFinsetUnion Ω hJ_KL) (q.2.1, (Equiv.piFinsetUnion Ω hKL) (q.2.2.1, q.2.2.2))) ⟨i.val, mem_union_right I (mem_union_right J (mem_union_left L i.property))⟩ = q.2.2.1 i calc _ = (Equiv.piFinsetUnion Ω hJ_KL) (q.2.1, (Equiv.piFinsetUnion Ω hKL) (q.2.2.1, q.2.2.2)) ⟨i.val, mem_union_right J (mem_union_left L i.property)⟩ := Equiv.piFinsetUnion_right Ω hI_JKL (mem_union_right J (mem_union_left L i.property)) _ _ = (Equiv.piFinsetUnion Ω hKL) (q.2.2.1, q.2.2.2) ⟨i.val, mem_union_left L i.property⟩ := Equiv.piFinsetUnion_right Ω hJ_KL (mem_union_left L i.property) _ _ = q.2.2.1 i := Equiv.piFinsetUnion_left Ω hKL i.property _ have hz : valuesProjection (fourth_subset_fourBlock I J K L) ∘ e = (@zCoord (ValuesOn I Ω) (ValuesOn J Ω) (ValuesOn K Ω) (ValuesOn L Ω)) := by funext q ext i change valuesProjection (fourth_subset_fourBlock I J K L) (fourBlockValuesEquiv I J K L hKL hJ_KL hI_JKL q) i = q.2.2.2 i unfold fourBlockValuesEquiv simp only [MeasurableEquiv.trans_apply, MeasurableEquiv.prodCongr, valuesProjection] rw [valuesEquivOfEq_apply] change (Equiv.piFinsetUnion Ω hI_JKL) (q.1, (Equiv.piFinsetUnion Ω hJ_KL) (q.2.1, (Equiv.piFinsetUnion Ω hKL) (q.2.2.1, q.2.2.2))) ⟨i.val, mem_union_right I (mem_union_right J (mem_union_right K i.property))⟩ = q.2.2.2 i calc _ = (Equiv.piFinsetUnion Ω hJ_KL) (q.2.1, (Equiv.piFinsetUnion Ω hKL) (q.2.2.1, q.2.2.2)) ⟨i.val, mem_union_right J (mem_union_right K i.property)⟩ := Equiv.piFinsetUnion_right Ω hI_JKL (mem_union_right J (mem_union_right K i.property)) _ _ = (Equiv.piFinsetUnion Ω hKL) (q.2.2.1, q.2.2.2) ⟨i.val, mem_union_right K i.property⟩ := Equiv.piFinsetUnion_right Ω hJ_KL (mem_union_right K i.property) _ _ = q.2.2.2 i := Equiv.piFinsetUnion_right Ω hKL i.property _ let eLK : (ValuesOn L Ω × ValuesOn K Ω) ≃ᵐ ValuesOn (L ∪ K) Ω := MeasurableEquiv.piFinsetUnion Ω hKL.symm let eLJ : (ValuesOn L Ω × ValuesOn J Ω) ≃ᵐ ValuesOn (L ∪ J) Ω := MeasurableEquiv.piFinsetUnion Ω hJL.symm let eJK : (ValuesOn J Ω × ValuesOn K Ω) ≃ᵐ ValuesOn (J ∪ K) Ω := MeasurableEquiv.piFinsetUnion Ω hJK have hLK : valuesProjection (fourthThird_subset_fourBlock I J K L) ∘ e = eLK ∘ (@zvCoord (ValuesOn I Ω) (ValuesOn J Ω) (ValuesOn K Ω) (ValuesOn L Ω)) := by funext q ext i simp only [Function.comp_apply, zvCoord] by_cases hi : i.val ∈ L · have hr : eLK (q.2.2.2, q.2.2.1) i = q.2.2.2 ⟨i.val, hi⟩ := by change (Equiv.piFinsetUnion Ω hKL.symm) (q.2.2.2, q.2.2.1) i = _ apply Equiv.piFinsetUnion_left Ω hKL.symm hi rw [hr] simpa only [valuesProjection, Function.comp_apply, zCoord] using congrFun (congrFun hz q) ⟨i.val, hi⟩ · have hiK : i.val ∈ K := (Finset.mem_union.mp i.property).resolve_left hi have hr : eLK (q.2.2.2, q.2.2.1) i = q.2.2.1 ⟨i.val, hiK⟩ := by change (Equiv.piFinsetUnion Ω hKL.symm) (q.2.2.2, q.2.2.1) i = _ apply Equiv.piFinsetUnion_right Ω hKL.symm hiK rw [hr] simpa only [valuesProjection, Function.comp_apply, vCoord] using congrFun (congrFun hv q) ⟨i.val, hiK⟩ have hLJ : valuesProjection (fourthSecond_subset_fourBlock I J K L) ∘ e = eLJ ∘ (@zyCoord (ValuesOn I Ω) (ValuesOn J Ω) (ValuesOn K Ω) (ValuesOn L Ω)) := by funext q ext i simp only [Function.comp_apply, zyCoord] by_cases hi : i.val ∈ L · have hr : eLJ (q.2.2.2, q.2.1) i = q.2.2.2 ⟨i.val, hi⟩ := by change (Equiv.piFinsetUnion Ω hJL.symm) (q.2.2.2, q.2.1) i = _ apply Equiv.piFinsetUnion_left Ω hJL.symm hi rw [hr] simpa only [valuesProjection, Function.comp_apply, zCoord] using congrFun (congrFun hz q) ⟨i.val, hi⟩ · have hiJ : i.val ∈ J := (Finset.mem_union.mp i.property).resolve_left hi have hr : eLJ (q.2.2.2, q.2.1) i = q.2.1 ⟨i.val, hiJ⟩ := by change (Equiv.piFinsetUnion Ω hJL.symm) (q.2.2.2, q.2.1) i = _ apply Equiv.piFinsetUnion_right Ω hJL.symm hiJ rw [hr] simpa only [valuesProjection, Function.comp_apply, yCoord] using congrFun (congrFun hy q) ⟨i.val, hiJ⟩ have hJK' : valuesProjection (secondThird_subset_fourBlock I J K L) ∘ e = eJK ∘ (@yvCoord (ValuesOn I Ω) (ValuesOn J Ω) (ValuesOn K Ω) (ValuesOn L Ω)) := by funext q ext i simp only [Function.comp_apply, yvCoord] by_cases hi : i.val ∈ J · have hr : eJK (q.2.1, q.2.2.1) i = q.2.1 ⟨i.val, hi⟩ := by change (Equiv.piFinsetUnion Ω hJK) (q.2.1, q.2.2.1) i = _ apply Equiv.piFinsetUnion_left Ω hJK hi rw [hr] simpa only [valuesProjection, Function.comp_apply, yCoord] using congrFun (congrFun hy q) ⟨i.val, hi⟩ · have hiK : i.val ∈ K := (Finset.mem_union.mp i.property).resolve_left hi have hr : eJK (q.2.1, q.2.2.1) i = q.2.2.1 ⟨i.val, hiK⟩ := by change (Equiv.piFinsetUnion Ω hJK) (q.2.1, q.2.2.1) i = _ apply Equiv.piFinsetUnion_right Ω hJK hiK rw [hr] simpa only [valuesProjection, Function.comp_apply, vCoord] using congrFun (congrFun hv q) ⟨i.val, hiK⟩ have hXY : CondIndepFun (comap (@zvCoord (ValuesOn I Ω) (ValuesOn J Ω) (ValuesOn K Ω) (ValuesOn L Ω)) inferInstance) measurable_zvCoord.comap_le (@xCoord (ValuesOn I Ω) (ValuesOn J Ω) (ValuesOn K Ω) (ValuesOn L Ω)) (@yCoord (ValuesOn I Ω) (ValuesOn J Ω) (ValuesOn K Ω) (ValuesOn L Ω)) (ν.withDensity d') := by have h := (condIndepFun_measurableEquiv_iff e hlaw (measurable_valuesProjection (first_subset_fourBlock I J K L)) (measurable_valuesProjection (second_subset_fourBlock I J K L)) (measurable_valuesProjection (fourthThird_subset_fourBlock I J K L))).2 hIJ_given_LK simpa only [hx, hy, hLK, comap_measurableEquiv_comp] using h have hXV : CondIndepFun (comap (@zyCoord (ValuesOn I Ω) (ValuesOn J Ω) (ValuesOn K Ω) (ValuesOn L Ω)) inferInstance) measurable_zyCoord.comap_le (@xCoord (ValuesOn I Ω) (ValuesOn J Ω) (ValuesOn K Ω) (ValuesOn L Ω)) (@vCoord (ValuesOn I Ω) (ValuesOn J Ω) (ValuesOn K Ω) (ValuesOn L Ω)) (ν.withDensity d') := by have h := (condIndepFun_measurableEquiv_iff e hlaw (measurable_valuesProjection (first_subset_fourBlock I J K L)) (measurable_valuesProjection (third_subset_fourBlock I J K L)) -- … truncated; follow the source link for the rest …
1 supporting declaration (lemmas, instances)
Main 1 core · 3 supporting This module proves the measure-level intersection axiom for the four canonical coordinate maps. ★ condIndepFun_intersection_of_positiveDensity

Graphoid intersection under a positive density

This module proves the measure-level intersection axiom for the four canonical coordinate maps. It also exports the decomposition corollary which drops the V component from the combined right-hand block.

theorem condIndepFun_intersection_of_positiveDensity reviewed
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection

For four σ-finite reference measures on standard Borel spaces, a measurable joint density whose weighting of the product reference measure has finite total mass, strict positivity of that density almost everywhere for the product reference measure, and, under the density-weighted measure, conditional independence of the first and second blocks given the fourth and third together, and of the first and third blocks given the fourth and second together, the first block is conditionally independent of the combined second and third blocks given the fourth.

Formal statement
X :
Type uX
Y :
Type uY
V :
Type uV
Z :
Type uZ
μX :
μY :
μV :
μZ :
d :
FourBlock X Y V Z → ℝ≥0∞
hd :
IsFiniteMeasure ((fourBlockReference μX μY μV μZ).withDensity d)
hpos :
∀ᵐ q ∂fourBlockReference μX μY μV μZ, 0 < d q
hXY :
CondIndepFun (comap (@zvCoord X Y V Z) inferInstance) measurable_zvCoord.comap_le (@xCoord X Y V Z) (@yCoord X Y V Z) ((fourBlockReference μX μY μV μZ).withDensity d)
hXV :
CondIndepFun (comap (@zyCoord X Y V Z) inferInstance) measurable_zyCoord.comap_le (@xCoord X Y V Z) (@vCoord X Y V Z) ((fourBlockReference μX μY μV μZ).withDensity d)
CondIndepFun (comap (@zCoord X Y V Z) inferInstance) measurable_zCoord.comap_le (@xCoord X Y V Z) (@yvCoord X Y V Z) ((fourBlockReference μX μY μV μZ).withDensity d)
Proof (Lean source)
theorem condIndepFun_intersection_of_positiveDensity {X : Type uX} {Y : Type uY} {V : Type uV} {Z : Type uZ} [MeasurableSpace X] [MeasurableSpace Y] [MeasurableSpace V] [MeasurableSpace Z] [StandardBorelSpace X] [StandardBorelSpace Y] [StandardBorelSpace V] [StandardBorelSpace Z] (μX : Measure X) (μY : Measure Y) (μV : Measure V) (μZ : Measure Z) [SigmaFinite μX] [SigmaFinite μY] [SigmaFinite μV] [SigmaFinite μZ] {d : FourBlock X Y V Z → ℝ≥0∞} (hd : Measurable d) [IsFiniteMeasure ((fourBlockReference μX μY μV μZ).withDensity d)] (hpos : ∀ᵐ q ∂fourBlockReference μX μY μV μZ, 0 < d q) (hXY : CondIndepFun (comap (@zvCoord X Y V Z) inferInstance) measurable_zvCoord.comap_le (@xCoord X Y V Z) (@yCoord X Y V Z) ((fourBlockReference μX μY μV μZ).withDensity d)) (hXV : CondIndepFun (comap (@zyCoord X Y V Z) inferInstance) measurable_zyCoord.comap_le (@xCoord X Y V Z) (@vCoord X Y V Z) ((fourBlockReference μX μY μV μZ).withDensity d)) : CondIndepFun (comap (@zCoord X Y V Z) inferInstance) measurable_zCoord.comap_le (@xCoord X Y V Z) (@yvCoord X Y V Z) ((fourBlockReference μX μY μV μZ).withDensity d) := by apply (condIndepFun_xyv_given_z_iff_factors μX μY μV μZ hd).2 exact positiveDensity_factorization_splice μX μY μV μZ hd hpos ((condIndepFun_xy_given_zv_iff_factors μX μY μV μZ hd).1 hXY) ((condIndepFun_xv_given_zy_iff_factors μX μY μV μZ hd).1 hXV)
3 supporting declarations (lemmas, instances)
Splice 1 core · 0 supporting This module isolates the analytic heart of graphoid intersection. ★ positiveDensity_factorization_splice

Splicing positive density factorizations

This module isolates the analytic heart of graphoid intersection. Strict positivity on a product support lets two factorizations with different conditioning blocks be compared along product fibres and spliced into the factorization for the union block.

theorem positiveDensity_factorization_splice reviewed
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection

For four σ-finite reference measures, a measurable density whose weighting of the product reference measure has finite total mass, strict positivity of the density almost everywhere for the product reference measure, and almost-everywhere factorizations of the density both as a factor of the first, third and fourth blocks times a factor of the second, third and fourth blocks, and as a factor of the first, second and fourth blocks times a factor of the third, second and fourth blocks, the density is almost everywhere a measurable factor of the first and fourth blocks times a measurable factor of the second, third and fourth blocks.

Formal statement
X :
Type uX
Y :
Type uY
V :
Type uV
Z :
Type uZ
μX :
μY :
μV :
μZ :
d :
FourBlock X Y V Z → ℝ≥0∞
hd :
IsFiniteMeasure ((fourBlockReference μX μY μV μZ).withDensity d)
hpos :
∀ᵐ q ∂fourBlockReference μX μY μV μZ, 0 < d q
hXY :
FactorsXYGivenZV μX μY μV μZ d
hXV :
FactorsXVGivenZY μX μY μV μZ d
FactorsXYVGivenZ μX μY μV μZ d
Proof (Lean source)
theorem positiveDensity_factorization_splice {X : Type uX} {Y : Type uY} {V : Type uV} {Z : Type uZ} [MeasurableSpace X] [MeasurableSpace Y] [MeasurableSpace V] [MeasurableSpace Z] (μX : Measure X) (μY : Measure Y) (μV : Measure V) (μZ : Measure Z) [SigmaFinite μX] [SigmaFinite μY] [SigmaFinite μV] [SigmaFinite μZ] {d : FourBlock X Y V Z → ℝ≥0∞} (hd : Measurable d) [IsFiniteMeasure ((fourBlockReference μX μY μV μZ).withDensity d)] (hpos : ∀ᵐ q ∂fourBlockReference μX μY μV μZ, 0 < d q) (hXY : FactorsXYGivenZV μX μY μV μZ d) (hXV : FactorsXVGivenZY μX μY μV μZ d) : FactorsXYVGivenZ μX μY μV μZ d := by /- Proof plan: finiteness of `withDensity d` and `ae_lt_top` make `d` finite a.e.; positivity makes the premise factors nonzero on almost every product fibre. Use Tonelli/Fubini to obtain simultaneous fibrewise versions of both factorizations, cancel along the `Y` and `V` fibres, and construct measurable `(X,Z)` and `(Y,V,Z)` factors from fibre integrals. -/ by_cases hX : μX = 0 · refine ⟨0, 0, measurable_const, measurable_const, ?_⟩ rw [show fourBlockReference μX μY μV μZ = 0 by simp [fourBlockReference, hX]] rw [ae_zero] exact Filter.eventually_bot by_cases hY : μY = 0 · refine ⟨0, 0, measurable_const, measurable_const, ?_⟩ rw [show fourBlockReference μX μY μV μZ = 0 by simp [fourBlockReference, hY]] rw [ae_zero] exact Filter.eventually_bot by_cases hV : μV = 0 · refine ⟨0, 0, measurable_const, measurable_const, ?_⟩ rw [show fourBlockReference μX μY μV μZ = 0 by simp [fourBlockReference, hV]] rw [ae_zero] exact Filter.eventually_bot by_cases hZ : μZ = 0 · refine ⟨0, 0, measurable_const, measurable_const, ?_⟩ rw [show fourBlockReference μX μY μV μZ = 0 by simp [fourBlockReference, hZ]] rw [ae_zero] exact Filter.eventually_bot let _ : NeZero μX := ⟨hX⟩ rcases hXY with ⟨a, b, ha, hb, hab⟩ rcases hXV with ⟨c, e, hc, he, hce⟩ let ν := μY.prod (μV.prod μZ) let D : Y × (V × Z) → ℝ≥0∞ := fun w ↦ ∫⁻ x, d (x, w) ∂μX let A : V × Z → ℝ≥0∞ := fun vz ↦ ∫⁻ x, a (x, vz) ∂μX let C : Y × Z → ℝ≥0∞ := fun yz ↦ ∫⁻ x, c (x, yz) ∂μX have hD : Measurable D := hd.lintegral_prod_left' have hA : Measurable A := ha.lintegral_prod_left' have hC : Measurable C := hc.lintegral_prod_left' have hdInt : ∫⁻ w, d w ∂fourBlockReference μX μY μV μZ ≠ ∞ := by have h := measure_ne_top ((fourBlockReference μX μY μV μZ).withDensity d) univ simpa [withDensity_apply] using h have hdFinite : ∀ᵐ w ∂fourBlockReference μX μY μV μZ, d w < ∞ := ae_lt_top hd hdInt have hDInt : ∫⁻ w, D w ∂ν ≠ ∞ := by rw [← lintegral_prod_symm d hd.aemeasurable] exact hdInt have hDFinite : ∀ᵐ w ∂ν, D w < ∞ := ae_lt_top hD hDInt have hgood : ∀ᵐ w ∂fourBlockReference μX μY μV μZ, 0 < d w ∧ d w < ∞ ∧ d w = a (w.1, (w.2.2.1, w.2.2.2)) * b (w.2.1, (w.2.2.1, w.2.2.2)) ∧ d w = c (w.1, (w.2.1, w.2.2.2)) * e (w.2.2.1, (w.2.1, w.2.2.2)) := by filter_upwards [hpos, hdFinite, hab, hce] with w hp hf habw hcew exact ⟨hp, hf, habw, hcew⟩ have hgoodSwap : ∀ᵐ w ∂ν, ∀ᵐ x ∂μX, 0 < d (x, w) ∧ d (x, w) < ∞ ∧ d (x, w) = a (x, (w.2.1, w.2.2)) * b (w.1, (w.2.1, w.2.2)) ∧ d (x, w) = c (x, (w.1, w.2.2)) * e (w.2.1, (w.1, w.2.2)) := by apply (Measure.ae_ae_comm (by measurability)).1 exact Measure.ae_ae_of_ae_prod hgood have hrest : ∀ᵐ w ∂ν, A (w.2.1, w.2.2) * b (w.1, (w.2.1, w.2.2)) = C (w.1, w.2.2) * e (w.2.1, (w.1, w.2.2)) ∧ 0 < A (w.2.1, w.2.2) ∧ A (w.2.1, w.2.2) < ∞ ∧ 0 < C (w.1, w.2.2) ∧ C (w.1, w.2.2) < ∞ := by filter_upwards [hDFinite, hgoodSwap] with w hDf hw have haSec : Measurable (fun x ↦ a (x, (w.2.1, w.2.2))) := by fun_prop have hcSec : Measurable (fun x ↦ c (x, (w.1, w.2.2))) := by fun_prop have hDab : D w = A (w.2.1, w.2.2) * b (w.1, (w.2.1, w.2.2)) := by change (∫⁻ x, d (x, w) ∂μX) = _ rw [lintegral_congr_ae (hw.mono fun x hx ↦ hx.2.2.1), lintegral_mul_const] exact haSec have hDce : D w = C (w.1, w.2.2) * e (w.2.1, (w.1, w.2.2)) := by change (∫⁻ x, d (x, w) ∂μX) = _ rw [lintegral_congr_ae (hw.mono fun x hx ↦ hx.2.2.2), lintegral_mul_const] exact hcSec have hapos : ∀ᵐ x ∂μX, 0 < a (x, (w.2.1, w.2.2)) := hw.mono fun x hx ↦ (factors_pos_lt_top hx.2.2.1 hx.1 hx.2.1).1 have hcpos : ∀ᵐ x ∂μX, 0 < c (x, (w.1, w.2.2)) := hw.mono fun x hx ↦ (factors_pos_lt_top hx.2.2.2 hx.1 hx.2.1).1 have hApos : 0 < A (w.2.1, w.2.2) := by change 0 < ∫⁻ x, a (x, (w.2.1, w.2.2)) ∂μX simpa using lintegral_strict_mono hX haSec.aemeasurable (by simp) hapos have hCpos : 0 < C (w.1, w.2.2) := by change 0 < ∫⁻ x, c (x, (w.1, w.2.2)) ∂μX simpa using lintegral_strict_mono hX hcSec.aemeasurable (by simp) hcpos obtain ⟨x0, hx0⟩ := hw.exists have hbf := factors_pos_lt_top hx0.2.2.1 hx0.1 hx0.2.1 have hef := factors_pos_lt_top hx0.2.2.2 hx0.1 hx0.2.1 have hbpos : 0 < b (w.1, (w.2.1, w.2.2)) := hbf.2.2.1 have hepos : 0 < e (w.2.1, (w.1, w.2.2)) := hef.2.2.1 have hAfin : A (w.2.1, w.2.2) < ∞ := by have hmul : A (w.2.1, w.2.2) * b (w.1, (w.2.1, w.2.2)) < ∞ := by rwa [← hDab] rcases ENNReal.mul_lt_top_iff.mp hmul with h | h | h · exact h.1 · exact (hApos.ne' h).elim · exact (hbpos.ne' h).elim have hCfin : C (w.1, w.2.2) < ∞ := by have hmul : C (w.1, w.2.2) * e (w.2.1, (w.1, w.2.2)) < ∞ := by rwa [← hDce] rcases ENNReal.mul_lt_top_iff.mp hmul with h | h | h · exact h.1 · exact (hCpos.ne' h).elim · exact (hepos.ne' h).elim exact ⟨hDab.symm.trans hDce, hApos, hAfin, hCpos, hCfin⟩ let p : X × (V × Z) → ℝ≥0∞ := fun xvz ↦ a xvz / A xvz.2 let q : X × (Y × Z) → ℝ≥0∞ := fun xyz ↦ c xyz / C xyz.2 have hp : Measurable p := ha.div (hA.comp measurable_snd) have hq : Measurable q := hc.div (hC.comp measurable_snd) have hpqRest : ∀ᵐ w ∂ν, ∀ᵐ x ∂μX, p (x, (w.2.1, w.2.2)) = q (x, (w.1, w.2.2)) := by filter_upwards [hrest, hgoodSwap] with w hr hw filter_upwards [hw] with x hx have hef := factors_pos_lt_top hx.2.2.2 hx.1 hx.2.1 exact div_eq_div_of_mul_eq_mul (hx.2.2.1.symm.trans hx.2.2.2) hr.1 hr.2.1.ne' hr.2.2.1.ne hr.2.2.2.1.ne' hr.2.2.2.2.ne hef.2.2.1.ne' hef.2.2.2.ne have hpqNested : ∀ᵐ x ∂μX, ∀ᵐ w ∂ν, p (x, (w.2.1, w.2.2)) = q (x, (w.1, w.2.2)) := by apply (Measure.ae_ae_comm (by measurability)).2 exact hpqRest have hpq : ∀ᵐ w ∂μX.prod (μY.prod (μV.prod μZ)), p (w.1, (w.2.2.1, w.2.2.2)) = q (w.1, (w.2.1, w.2.2.2)) := by apply (Measure.ae_prod_iff_ae_ae (by measurability)).2 exact hpqNested obtain ⟨r, hr, hpr⟩ := commonFactor_of_ae_eq μX μY μV μZ hV hp hq hpq let s : (Y × V) × Z → ℝ≥0∞ := fun yvz ↦ A (yvz.1.2, yvz.2) * b (yvz.1.1, (yvz.1.2, yvz.2)) have hs : Measurable s := by fun_prop refine ⟨r, s, hr, hs, ?_⟩ have hrestNested : ∀ᵐ x ∂μX, ∀ᵐ w ∂ν, 0 < A (w.2.1, w.2.2) ∧ A (w.2.1, w.2.2) < ∞ := ae_of_all μX fun _ ↦ hrest.mono fun w hw ↦ ⟨hw.2.1, hw.2.2.1⟩ have hrestFull : ∀ᵐ w ∂fourBlockReference μX μY μV μZ, 0 < A (w.2.2.1, w.2.2.2) ∧ A (w.2.2.1, w.2.2.2) < ∞ := by apply (Measure.ae_prod_iff_ae_ae (by measurability)).2 exact hrestNested filter_upwards [hab, hpr, hrestFull] with w hdab hpa hAf change d w = r (w.1, w.2.2.2) * (A (w.2.2.1, w.2.2.2) * b (w.2.1, (w.2.2.1, w.2.2.2))) rw [hdab] change a (w.1, (w.2.2.1, w.2.2.2)) * b (w.2.1, (w.2.2.1, w.2.2.2)) = _ rw [← hpa] change _ = (a (w.1, (w.2.2.1, w.2.2.2)) / A (w.2.2.1, w.2.2.2)) * (A (w.2.2.1, w.2.2.2) * b (w.2.1, (w.2.2.1, w.2.2.2))) rw [← mul_assoc, ENNReal.div_mul_cancel hAf.1.ne' hAf.2.ne]
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection.positiveDensity_factorization_splice · Causalean/Mathlib/Probability/Independence/Conditional/DensityIntersection/Splice.lean:97 · uses FactorsXVGivenZY , FactorsXYGivenZV , FactorsXYVGivenZ , FourBlock , fourBlockReference
Three­Block­Density­Identity 1 core · 2 supporting For a measurable finite density on a three-block product, a measurable factorization through the conditioning block is equivalent to the cross-multiplied identity between the joint density, its conditioning marginal, and ★ threeBlockFactors_iff_densityIdentity

Three-block density factorization versus the marginal-density identity

For a measurable finite density on a three-block product, a measurable factorization through the conditioning block is equivalent to the cross-multiplied identity between the joint density, its conditioning marginal, and its two block-with-conditioning marginals. This is the purely density-theoretic half of the three-block conditional-independence criterion.

theorem threeBlockFactors_iff_densityIdentity reviewed
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection

For a measurable three-block density against a product of three σ-finite reference measures, with finite total mass, almost-everywhere factorization into a measurable term of the first and conditioning blocks times a measurable term of the second and conditioning blocks is equivalent to the almost-everywhere identity that the joint density times its conditioning marginal equals the product of its two block-with-conditioning marginals.

Formal statement
A :
Type uA
shared
B :
Type uB
shared
C :
Type uC
shared
muA :
shared
muB :
shared
muC :
shared
d :
shared
hd :
ThreeBlockFactors muA muB muC d ↔ ThreeBlockDensityIdentity muA muB muC d
Proof (Lean source)
theorem threeBlockFactors_iff_densityIdentity (hd : Measurable d) : ThreeBlockFactors muA muB muC d ↔ ThreeBlockDensityIdentity muA muB muC d := ⟨threeBlockDensityIdentity_of_factors muA muB muC hd, threeBlockFactors_of_densityIdentity muA muB muC hd⟩
2 supporting declarations (lemmas, instances)
  • threeBlockDensityIdentity_of_factors theorem — A measurable conditional product factorization of a finite three-block density implies the cross-multiplied conditional-density identity.
    A :
    Type uA
    shared
    B :
    Type uB
    shared
    C :
    Type uC
    shared
    muA :
    shared
    muB :
    shared
    muC :
    shared
    d :
    shared
    hd :
    hfac :
    ThreeBlockFactors muA muB muC d
    Proof (Lean source)
    theorem threeBlockDensityIdentity_of_factors (hd : Measurable d) (hfac : ThreeBlockFactors muA muB muC d) : ThreeBlockDensityIdentity muA muB muC d := by /- Expand all three marginal densities and use Tonelli to integrate the product factorization. Finiteness rules out the `0 * ∞` exceptional cases almost everywhere, after which the target is commutativity and associativity of multiplication in `ℝ≥0∞`. -/ rcases hfac with ⟨a, b, ha, hb, hab⟩ have hfirstMeas : Measurable (densityFirstConditioning muB d) := by apply Measurable.lintegral_prod_right change Measurable (fun q : (A × C) × B ↦ d (q.1.1, (q.2, q.1.2))) fun_prop have hsecondMeas : Measurable (densitySecondConditioning muA d) := by apply Measurable.lintegral_prod_right change Measurable (fun q : (B × C) × A ↦ d (q.2, (q.1.1, q.1.2))) fun_prop have hcondMeas : Measurable (densityConditioning muA muB d) := by apply Measurable.lintegral_prod_right change Measurable (fun q : C × A ↦ ∫⁻ b, d (q.2, (b, q.1)) ∂muB) apply Measurable.lintegral_prod_right change Measurable (fun q : (C × A) × B ↦ d (q.1.2, (q.2, q.1.1))) fun_prop have habABC : ∀ᵐ x ∂muA, ∀ᵐ y ∂muB, ∀ᵐ z ∂muC, d (x, (y, z)) = a (x, z) * b (y, z) := by filter_upwards [Measure.ae_ae_of_ae_prod hab] with x hx exact Measure.ae_ae_of_ae_prod hx have habACB : ∀ᵐ x ∂muA, ∀ᵐ z ∂muC, ∀ᵐ y ∂muB, d (x, (y, z)) = a (x, z) * b (y, z) := by filter_upwards [habABC] with x hx exact (Measure.ae_ae_comm (by measurability)).1 hx have habBCA : ∀ᵐ y ∂muB, ∀ᵐ z ∂muC, ∀ᵐ x ∂muA, d (x, (y, z)) = a (x, z) * b (y, z) := by have hswap : ∀ᵐ yz ∂muB.prod muC, ∀ᵐ x ∂muA, d (x, yz) = a (x, yz.2) * b yz := by apply (Measure.ae_ae_comm (by measurability)).1 exact Measure.ae_ae_of_ae_prod hab exact Measure.ae_ae_of_ae_prod hswap have hfirst : ∀ᵐ x ∂muA, ∀ᵐ z ∂muC, densityFirstConditioning muB d (x, z) = a (x, z) * ∫⁻ y, b (y, z) ∂muB := by filter_upwards [habACB] with x hx filter_upwards [hx] with z hz change (∫⁻ y, d (x, (y, z)) ∂muB) = _ rw [lintegral_congr_ae hz, lintegral_const_mul] fun_prop have hsecond : ∀ᵐ y ∂muB, ∀ᵐ z ∂muC, densitySecondConditioning muA d (y, z) = (∫⁻ x, a (x, z) ∂muA) * b (y, z) := by filter_upwards [habBCA] with y hy filter_upwards [hy] with z hz change (∫⁻ x, d (x, (y, z)) ∂muA) = _ rw [lintegral_congr_ae hz, lintegral_mul_const] fun_prop have hfirstCA : ∀ᵐ z ∂muC, ∀ᵐ x ∂muA, densityFirstConditioning muB d (x, z) = a (x, z) * ∫⁻ y, b (y, z) ∂muB := by apply (Measure.ae_ae_comm (by measurability)).1 exact hfirst have hcond : ∀ᵐ z ∂muC, densityConditioning muA muB d z = (∫⁻ x, a (x, z) ∂muA) * (∫⁻ y, b (y, z) ∂muB) := by filter_upwards [hfirstCA] with z hz have hz' : (fun x ↦ ∫⁻ y, d (x, (y, z)) ∂muB) =ᵐ[muA] (fun x ↦ a (x, z) * ∫⁻ y, b (y, z) ∂muB) := by filter_upwards [hz] with x hx exact hx change (∫⁻ x, ∫⁻ y, d (x, (y, z)) ∂muB ∂muA) = _ rw [lintegral_congr_ae hz', lintegral_mul_const] fun_prop apply (Measure.ae_prod_iff_ae_ae (by measurability)).2 filter_upwards [habABC, hfirst] with x hxy hxfirst apply (Measure.ae_prod_iff_ae_ae (by measurability)).2 filter_upwards [hxy, hsecond] with y hyz hysecond filter_upwards [hyz, hxfirst, hysecond, hcond] with z hdab hfirstz hsecondz hcondz rw [hdab, hfirstz, hsecondz, hcondz] ac_rfl
    Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection.threeBlockDensityIdentity_of_factors · Causalean/Mathlib/Probability/Independence/Conditional/DensityIntersection/ThreeBlockDensityIdentity.lean:33
  • threeBlockFactors_of_densityIdentity theorem — For a measurable finite three-block density, the cross-multiplied conditional-density identity yields a measurable product factorization given the third block.
    A :
    Type uA
    shared
    B :
    Type uB
    shared
    C :
    Type uC
    shared
    muA :
    shared
    muB :
    shared
    muC :
    shared
    d :
    shared
    hd :
    hid :
    ThreeBlockFactors muA muB muC d
    Proof (Lean source)
    theorem threeBlockFactors_of_densityIdentity (hd : Measurable d) (hid : ThreeBlockDensityIdentity muA muB muC d) : ThreeBlockFactors muA muB muC d := by /- Use `densityFirstConditioning muB d` as the first factor and the ratio of `densitySecondConditioning muA d` to `densityConditioning muA muB d` as the second. On fibres where the conditioning marginal vanishes, Tonelli implies that `d` vanishes almost everywhere; on the remaining fibres, finiteness permits cancellation in the density identity. -/ let dAC := densityFirstConditioning muB d let dBC := densitySecondConditioning muA d let dC := densityConditioning muA muB d have hdAC : Measurable dAC := by apply Measurable.lintegral_prod_right change Measurable (fun q : (A × C) × B ↦ d (q.1.1, (q.2, q.1.2))) fun_prop have hdBC : Measurable dBC := by apply Measurable.lintegral_prod_right change Measurable (fun q : (B × C) × A ↦ d (q.2, (q.1.1, q.1.2))) fun_prop have hdC : Measurable dC := by apply Measurable.lintegral_prod_right change Measurable (fun q : C × A ↦ ∫⁻ b, d (q.2, (b, q.1)) ∂muB) apply Measurable.lintegral_prod_right change Measurable (fun q : (C × A) × B ↦ d (q.1.2, (q.2, q.1.1))) fun_prop have hdInt : ∫⁻ q, d q ∂threeBlockReference muA muB muC ≠ ∞ := by have h := measure_ne_top ((threeBlockReference muA muB muC).withDensity d) univ simpa [withDensity_apply] using h have htotal : (∫⁻ c, dC c ∂muC) = ∫⁻ q, d q ∂threeBlockReference muA muB muC := by change (∫⁻ c, ∫⁻ a, ∫⁻ b, d (a, (b, c)) ∂muB ∂muA ∂muC) = _ rw [← lintegral_prod (fun q : C × A ↦ ∫⁻ b, d (q.2, (b, q.1)) ∂muB) (by fun_prop)] rw [lintegral_prod_symm (fun q : C × A ↦ ∫⁻ b, d (q.2, (b, q.1)) ∂muB) (by fun_prop)] change _ = ∫⁻ q, d q ∂muA.prod (muB.prod muC) rw [lintegral_prod d hd.aemeasurable] apply lintegral_congr intro a rw [← lintegral_prod (fun q : C × B ↦ d (a, (q.2, q.1))) (by fun_prop)] rw [lintegral_prod_symm (fun q : C × B ↦ d (a, (q.2, q.1))) (by fun_prop)] rw [← lintegral_prod (fun q : B × C ↦ d (a, q)) (by fun_prop)] have hdCInt : ∫⁻ c, dC c ∂muC ≠ ∞ := by rwa [htotal] have hdCFinite : ∀ᵐ c ∂muC, dC c < ∞ := ae_lt_top hdC hdCInt have hzeroC : ∀ᵐ c ∂muC, ∀ᵐ a ∂muA, ∀ᵐ b ∂muB, dC c = 0 → dAC (a, c) = 0 ∧ d (a, (b, c)) = 0 := by refine ae_of_all muC fun c ↦ ?_ by_cases hc : dC c = 0 · have hACzero : (fun a ↦ dAC (a, c)) =ᵐ[muA] 0 := by apply (lintegral_eq_zero_iff (by fun_prop)).1 simpa only [dC, dAC, densityConditioning, densityFirstConditioning] using hc filter_upwards [hACzero] with a ha0 change dAC (a, c) = 0 at ha0 have hdzero : (fun b ↦ d (a, (b, c))) =ᵐ[muB] 0 := by apply (lintegral_eq_zero_iff (by fun_prop)).1 simpa only [dAC, densityFirstConditioning] using ha0 filter_upwards [hdzero] with b hb0 exact fun _ ↦ ⟨ha0, hb0⟩ · exact ae_of_all muA fun _ ↦ ae_of_all muB fun _ h ↦ (hc h).elim have hzeroFlat : ∀ᵐ q ∂muC.prod (muA.prod muB), dC q.1 = 0 → dAC (q.2.1, q.1) = 0 ∧ d (q.2.1, (q.2.2, q.1)) = 0 := by apply (Measure.ae_prod_iff_ae_ae (by measurability)).2 filter_upwards [hzeroC] with c hc exact (Measure.ae_prod_iff_ae_ae (by measurability)).2 hc have hzeroSwap : ∀ᵐ ab ∂muA.prod muB, ∀ᵐ c ∂muC, dC c = 0 → dAC (ab.1, c) = 0 ∧ d (ab.1, (ab.2, c)) = 0 := by apply (Measure.ae_ae_comm (by measurability)).1 exact Measure.ae_ae_of_ae_prod hzeroFlat have hzeroABC : ∀ᵐ a ∂muA, ∀ᵐ b ∂muB, ∀ᵐ c ∂muC, dC c = 0 → dAC (a, c) = 0 ∧ d (a, (b, c)) = 0 := by exact Measure.ae_ae_of_ae_prod hzeroSwap have hidABC : ∀ᵐ a ∂muA, ∀ᵐ b ∂muB, ∀ᵐ c ∂muC, d (a, (b, c)) * dC c = dAC (a, c) * dBC (b, c) := by filter_upwards [Measure.ae_ae_of_ae_prod hid] with a ha exact Measure.ae_ae_of_ae_prod ha refine ⟨dAC, fun bc ↦ dBC bc / dC bc.2, hdAC, hdBC.div (hdC.comp measurable_snd), ?_⟩ apply (Measure.ae_prod_iff_ae_ae (by measurability)).2 filter_upwards [hidABC, hzeroABC] with a ha hza apply (Measure.ae_prod_iff_ae_ae (by measurability)).2 filter_upwards [ha, hza] with b hb hzb filter_upwards [hb, hzb, hdCFinite] with c hidc hzc hfin by_cases hc0 : dC c = 0 · rw [(hzc hc0).2, (hzc hc0).1] simp · symm calc dAC (a, c) * (dBC (b, c) / dC c) = (dAC (a, c) * dBC (b, c)) / dC c := by simp only [div_eq_mul_inv] ac_rfl _ = (d (a, (b, c)) * dC c) / dC c := by rw [hidc] _ = d (a, (b, c)) := ENNReal.mul_div_cancel_right hc0 hfin.ne
    Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection.threeBlockFactors_of_densityIdentity · Causalean/Mathlib/Probability/Independence/Conditional/DensityIntersection/ThreeBlockDensityIdentity.lean:112
Three­Block­Factorization 1 core · 3 supporting This module proves the three-block criterion used by the four-block intersection theorem: for a measurable finite density on a product of standard Borel spaces, the first two blocks are conditionally independent given th ★ condIndepFun_threeBlock_iff_factors

Three-block conditional-density factorization

This module proves the three-block criterion used by the four-block intersection theorem: for a measurable finite density on a product of standard Borel spaces, the first two blocks are conditionally independent given the third exactly when the density satisfies the marginal-density identity, equivalently when it factors through the conditioning block. The density-theoretic equivalence of those two conditions lives in ThreeBlockDensityIdentity.

theorem condIndepFun_threeBlock_iff_factors reviewed
Causalean.Mathlib.Probability.Independence.Conditional.DensityIntersection

For three σ-finite reference measures on standard Borel spaces and a measurable three-block density of finite total mass, conditional independence of the first two blocks given the third under the density-weighted measure is equivalent to the density being almost everywhere a product of a measurable term of the first and third blocks and a measurable term of the second and third blocks.

Formal statement
A :
Type uA
shared
B :
Type uB
shared
C :
Type uC
shared
muA :
shared
muB :
shared
muC :
shared
d :
shared
hd :
CondIndepFun (comap (@thirdThreeCoord A B C) inferInstance) measurable_thirdThreeCoord.comap_le (@firstThreeCoord A B C) (@secondThreeCoord A B C) ((threeBlockReference muA muB muC).withDensity d)
↔ ThreeBlockFactors muA muB muC d
Proof (Lean source)
theorem condIndepFun_threeBlock_iff_factors (hd : Measurable d) : CondIndepFun (comap (@thirdThreeCoord A B C) inferInstance) measurable_thirdThreeCoord.comap_le (@firstThreeCoord A B C) (@secondThreeCoord A B C) ((threeBlockReference muA muB muC).withDensity d) ↔ ThreeBlockFactors muA muB muC d := by rw [condIndepFun_threeBlock_iff_densityIdentity muA muB muC hd, threeBlockFactors_iff_densityIdentity muA muB muC hd]
3 supporting declarations (lemmas, instances)