SCM.Do.Rule2Kernel
Kernel-level proof of do-calculus Rule 2: conditional kernels under intervention, levelset compatibility, and the rectangle-identity bridge.
Helpers 6 core · 7 supporting This file builds the value-space maps that insert intervention values into a conditioning assignment. ★ fixSetProj_fixSetExtend★ fillZrW_fixSetExtend
Value-Space Helpers for Rule 2
This file builds the value-space maps that insert intervention values into a conditioning assignment. These maps provide the bookkeeping needed to compare conditioning on an observed random copy with conditioning on the corresponding intervention value in Rule 2.
For a set of treatment-variable names and an assignment to their intervention copies, the intervention-to-random value map is the assignment to the corresponding random copies that for a random copy returns the value of its matching intervention copy and has no possible fixed-copy case](step:2).
Definition (Lean source)
For a structural causal model, a set of treatment-variable names, the condition that each corresponding random copy is observed, the condition that none of their fixed copies is already fixed, a set of conditioning nodes, and a fixed-value assignment for the model after fixing those treatments, the Rule 2 filler maps each conditioning assignment to an assignment on the union of the treatment random copies and conditioning nodes, inserting the treatment values from the fixed-value assignment; on any overlap, the treatment values take priority.
Definition (Lean source)
For a set of treatment-variable names and an assignment to their random copies, the random-to-intervention value map is the assignment to the corresponding intervention copies that for an intervention copy returns the value of its matching random copy and has no possible random-copy case](step:2).
Definition (Lean source)
For a structural causal model, a set of treatment-variable names, the condition that each corresponding random copy is observed, the condition that none of their fixed copies is already fixed, an assignment on the model's original fixed nodes, and an assignment to the treatment random copies, the extended fixed-value assignment is the fixed-value assignment for the model after those treatments are fixed, retaining original fixed values and using the matching treatment values for newly fixed copies.
Definition (Lean source)
For the intervention names X, whose random copies are observed in the base model and whose fixed copies are not yet part of the base model's fixed coordinates, projecting the extended post-intervention fixed assignment — built from the base assignment s0 and treatment value t — back onto the original fixed coordinates recovers s0.
Formal statement
Proof (Lean source)
For the intervention names X, whose random copies are observed in the base model and whose fixed copies are not yet part of the base model's fixed coordinates, filling the conditioning assignment z against the extended post-intervention fixed assignment built from the base assignment s0 and treatment value t equals directly combining t and z into one assignment on their union.
Formal statement
Proof (Lean source)
7 supporting declarations (lemmas, instances)
-
measurable_zFixedAsRandomlemma — Reading intervention values as random-copy values is a measurable operation.Proof (Lean source)
@[fun_prop] lemma measurable_zFixedAsRandom {Z : Finset N} : Measurable (zFixedAsRandom (Ω := Ω) (Z := Z)) := by refine measurable_pi_iff.mpr ?_ rintro ⟨v, hv⟩ obtain ⟨D, hD, rfl⟩ := Finset.mem_image.mp hv -- v = SWIGNode.random D; output is `z ⟨.fixed D, _⟩` exact measurable_pi_apply _ -
measurable_fillZrWtheorem — The Rule 2 filler is measurable as a function of the free conditioning assignment.hypothesesN :sharedType u_1N → Type u_2M' :SCM N ΩZ :Finset NhZ_obs :∀ D ∈ Z, SWIGNode.random D ∈ M'.observedhZ_fixed :∀ D ∈ Z, SWIGNode.fixed D ∉ M'.fixeds' :(M'.fixSet Z hZ_obs hZ_fixed).FixedValuesconclusionMeasurable (M'.fillZrW Z hZ_obs hZ_fixed W s')Proof (Lean source)
@[fun_prop] theorem measurable_fillZrW (M' : SCM N Ω) (Z : Finset N) (hZ_obs : ∀ D ∈ Z, SWIGNode.random D ∈ M'.observed) (hZ_fixed : ∀ D ∈ Z, SWIGNode.fixed D ∉ M'.fixed) (W : Finset (SWIGNode N)) (s' : (M'.fixSet Z hZ_obs hZ_fixed).FixedValues) : Measurable (M'.fillZrW Z hZ_obs hZ_fixed W s') := by unfold fillZrW exact measurable_valuesUnionMk_right _ -
measurable_fillZrW_prodtheorem — The Rule 2 filler is jointly measurable in the post-intervention fixed slice and the free conditioning coordinates.hypothesesN :sharedType u_1N → Type u_2M' :SCM N ΩZ :Finset NhZ_obs :∀ D ∈ Z, SWIGNode.random D ∈ M'.observedhZ_fixed :∀ D ∈ Z, SWIGNode.fixed D ∉ M'.fixedconclusionMeasurable (fun p : (M'.fixSet Z hZ_obs hZ_fixed).FixedValues × ValuesOn W (swigΩ Ω) => M'.fillZrW Z hZ_obs hZ_fixed W p.1 p.2)Proof (Lean source)
@[fun_prop] theorem measurable_fillZrW_prod (M' : SCM N Ω) (Z : Finset N) (hZ_obs : ∀ D ∈ Z, SWIGNode.random D ∈ M'.observed) (hZ_fixed : ∀ D ∈ Z, SWIGNode.fixed D ∉ M'.fixed) (W : Finset (SWIGNode N)) : Measurable (fun p : (M'.fixSet Z hZ_obs hZ_fixed).FixedValues × ValuesOn W (swigΩ Ω) => M'.fillZrW Z hZ_obs hZ_fixed W p.1 p.2) := by unfold fillZrW change Measurable ((fun q : ValuesOn (Z.image SWIGNode.random) (swigΩ Ω) × ValuesOn W (swigΩ Ω) => valuesUnionMk q.1 q.2) ∘ (fun p : (M'.fixSet Z hZ_obs hZ_fixed).FixedValues × ValuesOn W (swigΩ Ω) => (zFixedAsRandom (valuesProjection (fixSet_image_fixed_subset M' Z hZ_obs hZ_fixed) p.1), p.2))) refine (measurable_valuesUnionMk (Ω := swigΩ Ω) (A := Z.image SWIGNode.random) (B := W)).comp ?_ refine prodMk ?_ measurable_snd exact measurable_zFixedAsRandom.comp ((measurable_valuesProjection _).comp measurable_fst) -
measurable_xRandomAsFixedlemma — Reading observed treatment values as intervention-coordinate values is measurable.Proof (Lean source)
@[fun_prop] lemma measurable_xRandomAsFixed {X : Finset N} : Measurable (xRandomAsFixed (Ω := Ω) (X := X)) := by refine measurable_pi_iff.mpr ?_ rintro ⟨v, hv⟩ obtain ⟨D, hD, rfl⟩ := Finset.mem_image.mp hv exact measurable_pi_apply _ -
fixSetExtend_apply_new_fixedlemma — A newly fixed coordinate in fixSetExtend reads the matching observed intervention coordinate.hypothesesN :sharedType u_1N → Type u_2M :SCM N ΩX :Finset NhObs :∀ D ∈ X, SWIGNode.random D ∈ M.observedhFix :∀ D ∈ X, SWIGNode.fixed D ∉ M.fixeds0 :M.FixedValuesD :NhD :D ∈ XconclusionM.fixSetExtend X hObs hFix s0 t ⟨SWIGNode.fixed D, SCM.fixed_mem_fixSet M X hObs hFix hD⟩= t ⟨SWIGNode.random D, Finset.mem_image.mpr ⟨D, hD, rfl⟩⟩Proof (Lean source)
@[simp] lemma fixSetExtend_apply_new_fixed (M : SCM N Ω) (X : Finset N) (hObs : ∀ D ∈ X, SWIGNode.random D ∈ M.observed) (hFix : ∀ D ∈ X, SWIGNode.fixed D ∉ M.fixed) (s0 : M.FixedValues) (t : ValuesOn (X.image SWIGNode.random) (swigΩ Ω)) {D : N} (hD : D ∈ X) : M.fixSetExtend X hObs hFix s0 t ⟨SWIGNode.fixed D, SCM.fixed_mem_fixSet M X hObs hFix hD⟩ = t ⟨SWIGNode.random D, Finset.mem_image.mpr ⟨D, hD, rfl⟩⟩ := by simp [fixSetExtend, hFix D hD, xRandomAsFixed] -
measurable_fixSetExtendlemma — Extending a base fixed-value assignment is measurable in the treatment value when the base assignment is held fixed.hypothesesN :sharedType u_1N → Type u_2M :SCM N ΩX :Finset NhObs :∀ D ∈ X, SWIGNode.random D ∈ M.observedhFix :∀ D ∈ X, SWIGNode.fixed D ∉ M.fixeds0 :M.FixedValuesconclusionMeasurable (M.fixSetExtend X hObs hFix s0)Proof (Lean source)
@[fun_prop] lemma measurable_fixSetExtend (M : SCM N Ω) (X : Finset N) (hObs : ∀ D ∈ X, SWIGNode.random D ∈ M.observed) (hFix : ∀ D ∈ X, SWIGNode.fixed D ∉ M.fixed) (s0 : M.FixedValues) : Measurable (M.fixSetExtend X hObs hFix s0) := by refine measurable_pi_iff.mpr ?_ rintro ⟨v, hv⟩ by_cases hM : v ∈ M.fixed · simp only [fixSetExtend, dif_pos hM]; exact measurable_const · have hXf : v ∈ X.image SWIGNode.fixed := (Finset.mem_union.mp (by simpa using hv)).resolve_left hM have : (fun t : ValuesOn (X.image SWIGNode.random) (swigΩ Ω) => M.fixSetExtend X hObs hFix s0 t ⟨v, hv⟩) = fun t => xRandomAsFixed t ⟨v, hXf⟩ := by funext t; simp only [fixSetExtend, dif_neg hM] rw [this] exact (measurable_xRandomAsFixed).eval -
zFixedAsRandom_proj_fixSetExtendlemma — Relabeling the treatment part of the extended fixed assignment back to observed coordinates recovers the treatment assignment.hypothesesN :sharedType u_1N → Type u_2M :SCM N ΩX :Finset NhObs :∀ D ∈ X, SWIGNode.random D ∈ M.observedhFix :∀ D ∈ X, SWIGNode.fixed D ∉ M.fixeds0 :M.FixedValuesconclusionSCM.zFixedAsRandom (valuesProjection (SCM.fixSet_image_fixed_subset M X hObs hFix) (M.fixSetExtend X hObs hFix s0 t))= tProof (Lean source)
lemma zFixedAsRandom_proj_fixSetExtend (M : SCM N Ω) (X : Finset N) (hObs : ∀ D ∈ X, SWIGNode.random D ∈ M.observed) (hFix : ∀ D ∈ X, SWIGNode.fixed D ∉ M.fixed) (s0 : M.FixedValues) (t : ValuesOn (X.image SWIGNode.random) (swigΩ Ω)) : SCM.zFixedAsRandom (valuesProjection (SCM.fixSet_image_fixed_subset M X hObs hFix) (M.fixSetExtend X hObs hFix s0 t)) = t := by funext ⟨v, hv⟩ obtain ⟨D, hD, rfl⟩ := Finset.mem_image.mp hv -- LHS unfolds: zFixedAsRandom at .random D reads the .fixed D coordinate. simp only [SCM.zFixedAsRandom, valuesProjection] -- The .fixed D coordinate of fixSetExtend: .fixed D ∉ M.fixed, so it is -- xRandomAsFixed t ⟨.fixed D, _⟩ = t ⟨.random D, _⟩. have hMf : SWIGNode.fixed D ∉ M.fixed := hFix D hD simp only [SCM.fixSetExtend, dif_neg hMf, SCM.xRandomAsFixed]
DiscreteZHelpers 1 core · 2 supporting This file provides the discrete-treatment measure-theoretic helpers used to state Pearl's action-observation exchange without requiring the post-intervention treatment coordinate to be almost surely pinned. ★ obsKernel_fixSet_W_marginal_eq_M1_marginal
Discrete Treatment Helpers for Rule 2
This file provides the discrete-treatment measure-theoretic helpers used to state
Pearl's action-observation exchange without requiring the post-intervention
treatment coordinate to be almost surely pinned. It proves the W-marginal
equality obsKernel_fixSet_W_marginal_eq_M1_marginal, the filled-assignment
pullback equality mu_C_comap_F_eq_nu_C_comap_F, and the discrete conditional
kernel bridge obsCondKernel_cross_eq_ae_of_discrete. Together these connect
post-intervention adjustment marginals to pre-intervention joint marginals using
overlap, positivity, and the non-descendance condition needed for the Rule 3*
marginal step.
**Rule 3* W-marginal equality for Rule 2.** For the intervention on names Z, whose random copies are observed in the base model and whose fixed copies are not yet part of the base model's fixed coordinates, and a conditioning set W contained in the observed variables, if no fixed copy of a name in Z is an ancestor, in the post-intervention DAG, of any node in W, then the W-marginal of the intervened model's observational kernel at a fixed assignment s equals the W-marginal of the base model's observational kernel at the corresponding projected assignment.
Formal statement
Proof (Lean source)
2 supporting declarations (lemmas, instances)
-
mu_C_comap_F_eq_nu_C_comap_Flemma — Cross-SCM pullback equality along the filled assignment.hypothesesN :sharedType u_1N → Type u_2M' :SCM N ΩZ :Finset NhZ_obs :∀ D ∈ Z, SWIGNode.random D ∈ M'.observedhZ_fixed :∀ D ∈ Z, SWIGNode.fixed D ∉ M'.fixedhZrW :Z.image SWIGNode.random ∪ W ⊆ M'.observedhDisj_ZrW :Disjoint (Z.image SWIGNode.random) Ws :(M'.fixSet Z hZ_obs hZ_fixed).FixedValuesconclusion((M'.obsKernel (M'.fixSetProj Z hZ_obs hZ_fixed s)).map (valuesProjection (Ω := swigΩ Ω) hZrW)).comap (M'.fillZrW Z hZ_obs hZ_fixed W s)= (((M'.fixSet Z hZ_obs hZ_fixed).obsKernel s).map (valuesProjection (Ω := swigΩ Ω) ((fixSet_observed M' Z hZ_obs hZ_fixed).symm ▸ hZrW))).comap (M'.fillZrW Z hZ_obs hZ_fixed W s)Proof (Lean source)
lemma mu_C_comap_F_eq_nu_C_comap_F (M' : SCM N Ω) (Z : Finset N) (hZ_obs : ∀ D ∈ Z, SWIGNode.random D ∈ M'.observed) (hZ_fixed : ∀ D ∈ Z, SWIGNode.fixed D ∉ M'.fixed) (W : Finset (SWIGNode N)) (hZrW : Z.image SWIGNode.random ∪ W ⊆ M'.observed) (hDisj_ZrW : Disjoint (Z.image SWIGNode.random) W) [MeasurableSingletonClass (ValuesOn (Z.image SWIGNode.random ∪ W) (swigΩ Ω))] (s : (M'.fixSet Z hZ_obs hZ_fixed).FixedValues) : ((M'.obsKernel (M'.fixSetProj Z hZ_obs hZ_fixed s)).map (valuesProjection (Ω := swigΩ Ω) hZrW)).comap (M'.fillZrW Z hZ_obs hZ_fixed W s) = (((M'.fixSet Z hZ_obs hZ_fixed).obsKernel s).map (valuesProjection (Ω := swigΩ Ω) ((fixSet_observed M' Z hZ_obs hZ_fixed).symm ▸ hZrW))).comap (M'.fillZrW Z hZ_obs hZ_fixed W s) := by classical let M2 := M'.fixSet Z hZ_obs hZ_fixed let sM1 : M'.FixedValues := M'.fixSetProj Z hZ_obs hZ_fixed s let F := M'.fillZrW Z hZ_obs hZ_fixed W s have hZrW_M2 : Z.image SWIGNode.random ∪ W ⊆ M2.observed := (fixSet_observed M' Z hZ_obs hZ_fixed).symm ▸ hZrW have hF_emb : MeasurableEmbedding F := measurableEmbedding_fillZrW M' Z hZ_obs hZ_fixed W hDisj_ZrW s have hπC_M1 : Measurable (valuesProjection (Ω := swigΩ Ω) hZrW : M'.ObservedValues → _) := measurable_valuesProjection _ have hπC_M2 : Measurable (valuesProjection (Ω := swigΩ Ω) hZrW_M2 : M2.ObservedValues → _) := measurable_valuesProjection _ refine MeasureTheory.Measure.ext (fun A_W hA_W => ?_) rw [hF_emb.comap_apply, hF_emb.comap_apply] have hImg_meas : MeasurableSet (F '' A_W) := hF_emb.measurableSet_image' hA_W rw [MeasureTheory.Measure.map_apply hπC_M1 hImg_meas, MeasureTheory.Measure.map_apply hπC_M2 hImg_meas] have hBridge : M2.obsKernel s (univ ∩ (valuesProjection hZrW_M2)⁻¹' (F '' A_W)) = M'.obsKernel sM1 (univ ∩ (valuesProjection hZrW)⁻¹' (F '' A_W)) := obsKernel_inter_Wset_Zrand_levelset_eq M' Z hZ_obs hZ_fixed W hZrW hDisj_ZrW s MeasurableSet.univ hA_W rw [Set.univ_inter, Set.univ_inter] at hBridge exact hBridge.symm -
obsCondKernel_cross_eq_ae_of_discretelemma — Discrete-treatment cross-SCM conditional-kernel equality. For an intervention target whose random copies are observed and fixed copies are not already fixed, observed outcome and conditioning blocks, and an observed union of the target's random copies with the conditioning block, assume the post-intervention d-separation premise and non-descendancy of the conditioning block. At a post-intervention fixed assignment, if the base conditioning marginal is absolutely continuous with respect to the pullback of the base joint marginal and the outcome event is measurable, then the base and post-intervention conditional kernels agree almost everywhere under the post-intervention conditioning marginal.hypothesesN :sharedType u_1N → Type u_2M' :SCM N ΩZ :Finset NhZ_obs :∀ D ∈ Z, SWIGNode.random D ∈ M'.observedhZ_fixed :∀ D ∈ Z, SWIGNode.fixed D ∉ M'.fixedhY :Y ⊆ M'.observedhW :W ⊆ M'.observedhZrW :Z.image SWIGNode.random ∪ W ⊆ M'.observed∀ n, StandardBorelSpace (swigΩ Ω n)∀ n, Nonempty (swigΩ Ω n)hdSep :(M'.fixSet Z hZ_obs hZ_fixed).dag.dSep Y (Z.image SWIGNode.random) (W ∪ (M'.fixSet Z hZ_obs hZ_fixed).fixed)hWNonDesc :∀ z ∈ Z, ∀ v ∈ W, ¬ (M'.fixSet Z hZ_obs hZ_fixed).dag.isAncestor (SWIGNode.fixed z) vStandardBorelSpace (M'.fixSet Z hZ_obs hZ_fixed).RandomValuesStandardBorelSpace (M'.fixSet Z hZ_obs hZ_fixed).ObservedValues∀ s : M'.FixedValues, IsFiniteMeasure (M'.obsKernel s)∀ s : (M'.fixSet Z hZ_obs hZ_fixed).FixedValues,IsFiniteMeasure ((M'.fixSet Z hZ_obs hZ_fixed).jointKernel s)∀ s : (M'.fixSet Z hZ_obs hZ_fixed).FixedValues,IsFiniteMeasure ((M'.fixSet Z hZ_obs hZ_fixed).obsKernel s)CountableOrCountablyGenerated (M'.fixSet Z hZ_obs hZ_fixed).FixedValues (ValuesOn (Z.image SWIGNode.random ∪ W) (swigΩ Ω))s :(M'.fixSet Z hZ_obs hZ_fixed).FixedValueshPositivity :((M'.obsKernel (M'.fixSetProj Z hZ_obs hZ_fixed s)).map (valuesProjection (Ω := swigΩ Ω) hW)) ≪ (((M'.obsKernel (M'.fixSetProj Z hZ_obs hZ_fixed s)).map (valuesProjection (Ω := swigΩ Ω) hZrW)).comap (M'.fillZrW Z hZ_obs hZ_fixed W s))hB :conclusion∀ᵐ w ∂(((M'.fixSet Z hZ_obs hZ_fixed).obsKernel s).map (valuesProjection ((fixSet_observed M' Z hZ_obs hZ_fixed).symm ▸ hW))), (M'.obsCondKernel Y (Z.image SWIGNode.random ∪ W) hY hZrW (M'.fixSetProj Z hZ_obs hZ_fixed s, M'.fillZrW Z hZ_obs hZ_fixed W s w)) B= ((M'.fixSet Z hZ_obs hZ_fixed).obsCondKernel Y W ((fixSet_observed M' Z hZ_obs hZ_fixed).symm ▸ hY) ((fixSet_observed M' Z hZ_obs hZ_fixed).symm ▸ hW) (s, w)) BProof (Lean source)
lemma obsCondKernel_cross_eq_ae_of_discrete (M' : SCM N Ω) (Z : Finset N) (hZ_obs : ∀ D ∈ Z, SWIGNode.random D ∈ M'.observed) (hZ_fixed : ∀ D ∈ Z, SWIGNode.fixed D ∉ M'.fixed) (Y W : Finset (SWIGNode N)) (hY : Y ⊆ M'.observed) (hW : W ⊆ M'.observed) (hZrW : Z.image SWIGNode.random ∪ W ⊆ M'.observed) [∀ n, StandardBorelSpace (swigΩ Ω n)] [∀ n, Nonempty (swigΩ Ω n)] (hdSep : (M'.fixSet Z hZ_obs hZ_fixed).dag.dSep Y (Z.image SWIGNode.random) (W ∪ (M'.fixSet Z hZ_obs hZ_fixed).fixed)) (hWNonDesc : ∀ z ∈ Z, ∀ v ∈ W, ¬ (M'.fixSet Z hZ_obs hZ_fixed).dag.isAncestor (SWIGNode.fixed z) v) [StandardBorelSpace (M'.fixSet Z hZ_obs hZ_fixed).RandomValues] [StandardBorelSpace (M'.fixSet Z hZ_obs hZ_fixed).ObservedValues] [StandardBorelSpace (ValuesOn Y (swigΩ Ω))] [Nonempty (ValuesOn Y (swigΩ Ω))] [StandardBorelSpace (ValuesOn (Z.image SWIGNode.random) (swigΩ Ω))] [Nonempty (ValuesOn (Z.image SWIGNode.random) (swigΩ Ω))] [∀ s : M'.FixedValues, IsFiniteMeasure (M'.obsKernel s)] [∀ s : (M'.fixSet Z hZ_obs hZ_fixed).FixedValues, IsFiniteMeasure ((M'.fixSet Z hZ_obs hZ_fixed).jointKernel s)] [∀ s : (M'.fixSet Z hZ_obs hZ_fixed).FixedValues, IsFiniteMeasure ((M'.fixSet Z hZ_obs hZ_fixed).obsKernel s)] [CountableOrCountablyGenerated M'.FixedValues (ValuesOn (Z.image SWIGNode.random ∪ W) (swigΩ Ω))] [CountableOrCountablyGenerated (M'.fixSet Z hZ_obs hZ_fixed).FixedValues (ValuesOn (Z.image SWIGNode.random ∪ W) (swigΩ Ω))] [CountableOrCountablyGenerated (M'.fixSet Z hZ_obs hZ_fixed).FixedValues (ValuesOn W (swigΩ Ω))] [MeasurableSingletonClass (ValuesOn (Z.image SWIGNode.random ∪ W) (swigΩ Ω))] (s : (M'.fixSet Z hZ_obs hZ_fixed).FixedValues) (hPositivity : ((M'.obsKernel (M'.fixSetProj Z hZ_obs hZ_fixed s)).map (valuesProjection (Ω := swigΩ Ω) hW)) ≪ (((M'.obsKernel (M'.fixSetProj Z hZ_obs hZ_fixed s)).map (valuesProjection (Ω := swigΩ Ω) hZrW)).comap (M'.fillZrW Z hZ_obs hZ_fixed W s))) {B : Set (ValuesOn Y (swigΩ Ω))} (hB : MeasurableSet B) : ∀ᵐ w ∂(((M'.fixSet Z hZ_obs hZ_fixed).obsKernel s).map (valuesProjection ((fixSet_observed M' Z hZ_obs hZ_fixed).symm ▸ hW))), (M'.obsCondKernel Y (Z.image SWIGNode.random ∪ W) hY hZrW (M'.fixSetProj Z hZ_obs hZ_fixed s, M'.fillZrW Z hZ_obs hZ_fixed W s w)) B = ((M'.fixSet Z hZ_obs hZ_fixed).obsCondKernel Y W ((fixSet_observed M' Z hZ_obs hZ_fixed).symm ▸ hY) ((fixSet_observed M' Z hZ_obs hZ_fixed).symm ▸ hW) (s, w)) B := by classical -- Abbreviations. let M2 := M'.fixSet Z hZ_obs hZ_fixed let sM1 : M'.FixedValues := M'.fixSetProj Z hZ_obs hZ_fixed s let F := M'.fillZrW Z hZ_obs hZ_fixed W s have hDisj_ZrW : Disjoint (Z.image SWIGNode.random) W := Disjoint.mono_right Finset.subset_union_left hdSep.2.2.1 have hY_M2 : Y ⊆ M2.observed := (fixSet_observed M' Z hZ_obs hZ_fixed).symm ▸ hY have hW_M2 : W ⊆ M2.observed := (fixSet_observed M' Z hZ_obs hZ_fixed).symm ▸ hW have hZrW_M2 : Z.image SWIGNode.random ∪ W ⊆ M2.observed := (fixSet_observed M' Z hZ_obs hZ_fixed).symm ▸ hZrW have hF_emb : MeasurableEmbedding F := measurableEmbedding_fillZrW M' Z hZ_obs hZ_fixed W hDisj_ZrW s -- Marginal measures. let μ_C : Measure (ValuesOn (Z.image SWIGNode.random ∪ W) (swigΩ Ω)) := (M'.obsKernel sM1).map (valuesProjection hZrW) let ν_C : Measure (ValuesOn (Z.image SWIGNode.random ∪ W) (swigΩ Ω)) := (M2.obsKernel s).map (valuesProjection hZrW_M2) let μ_W : Measure (ValuesOn W (swigΩ Ω)) := (M'.obsKernel sM1).map (valuesProjection (Ω := swigΩ Ω) hW) let ν_W : Measure (ValuesOn W (swigΩ Ω)) := (M2.obsKernel s).map (valuesProjection (Ω := swigΩ Ω) hW_M2) have hμC_def : μ_C = (M'.obsKernel sM1).map (valuesProjection (Ω := swigΩ Ω) hZrW) := rfl have hνC_def : ν_C = (M2.obsKernel s).map (valuesProjection (Ω := swigΩ Ω) hZrW_M2) := rfl -- (1) Cross-SCM bridge: μ_C.comap F-a.e. w, M1.obsCondKernel(C)(sM1, F w) B -- = M2.obsCondKernel(C)(s, F w) B. have h_L2 := obsCondKernel_cross_SCM_ae_eq_on_fillZrW M' Z hZ_obs hZ_fixed Y W hY hZrW hDisj_ZrW s hB -- (2) D-sep collapse: ν_C-a.e. c, M2.obsCondKernel(C)(s, c) B -- = M2.obsCondKernel(W)(s, π_W^C c) B. have h_L1 := obsCondKernel_dSep_collapse_ae M' Z hZ_obs hZ_fixed Y W hY hW hdSep s (B := B) -- (3) Pullback equality: μ_C.comap F = ν_C.comap F. have hPartA : μ_C.comap F = ν_C.comap F := mu_C_comap_F_eq_nu_C_comap_F M' Z hZ_obs hZ_fixed W hZrW hDisj_ZrW s -- (4) Rule 3* marginal equality: ν_W = μ_W as measures. have hν_W_eq_μ_W : ν_W = μ_W := by change (M2.obsKernel s).map (valuesProjection hW_M2) = (M'.obsKernel sM1).map (valuesProjection hW) exact obsKernel_fixSet_W_marginal_eq_M1_marginal M' Z hZ_obs hZ_fixed W hW hWNonDesc s -- (5) Transport h_L1 from ν_C-a.e. (in `c`) to ν_C.comap F-a.e. (in `w`, -- with `c := F w`). Step (5a): ν_C-a.e. → ν_C.restrict (range F)-a.e. have h_L1_restrict : ∀ᵐ c ∂(ν_C.restrict (range F)), (M2.obsCondKernel Y (Z.image SWIGNode.random ∪ W) hY_M2 hZrW_M2 (s, c)) B = (M2.obsCondKernel Y W hY_M2 hW_M2 (s, valuesProjection (Finset.subset_union_right (s₁ := Z.image SWIGNode.random) (s₂ := W)) c)) B := MeasureTheory.ae_restrict_of_ae h_L1 -- (5b): ν_C.restrict (range F) = (ν_C.comap F).map F (`hF_emb.map_comap`). have h_map_comap_ν : (ν_C.comap F).map F = ν_C.restrict (range F) := hF_emb.map_comap ν_C rw [← h_map_comap_ν] at h_L1_restrict -- (5c): Pull back through F via MeasurableEmbedding.ae_map_iff. have h_L1_pulled : ∀ᵐ w ∂(ν_C.comap F), (M2.obsCondKernel Y (Z.image SWIGNode.random ∪ W) hY_M2 hZrW_M2 (s, F w)) B = (M2.obsCondKernel Y W hY_M2 hW_M2 (s, valuesProjection (Finset.subset_union_right (s₁ := Z.image SWIGNode.random) (s₂ := W)) (F w))) B := (hF_emb.ae_map_iff (μ := ν_C.comap F) (p := fun c => (M2.obsCondKernel Y (Z.image SWIGNode.random ∪ W) hY_M2 hZrW_M2 (s, c)) B = (M2.obsCondKernel Y W hY_M2 hW_M2 (s, valuesProjection (Finset.subset_union_right (s₁ := Z.image SWIGNode.random) (s₂ := W)) c)) B)).mp h_L1_restrict -- (6) `π_W^C (F w) = w`, by construction of F. have h_proj_F : ∀ w : ValuesOn W (swigΩ Ω), valuesProjection (Finset.subset_union_right (s₁ := Z.image SWIGNode.random) (s₂ := W)) (F w) = w := by intro w funext ⟨v, hvW⟩ have hv_in : v ∈ Z.image SWIGNode.random ∪ W := Finset.subset_union_right hvW have hvNotZr : v ∉ Z.image SWIGNode.random := fun hvZr => Finset.disjoint_left.mp hDisj_ZrW hvZr hvW simp only [valuesProjection, F, fillZrW] rw [valuesUnionMk_apply_right _ _ hv_in hvNotZr] -- (7) Simplify h_L1_pulled using h_proj_F. have h_L1_simpl : ∀ᵐ w ∂(ν_C.comap F), (M2.obsCondKernel Y (Z.image SWIGNode.random ∪ W) hY_M2 hZrW_M2 (s, F w)) B = (M2.obsCondKernel Y W hY_M2 hW_M2 (s, w)) B := by refine Filter.Eventually.mono h_L1_pulled (fun w hw => ?_) rw [h_proj_F] at hw exact hw -- (8) Combine h_L2 (μ_C.comap F-a.e.) with h_L1_simpl (ν_C.comap F-a.e.), -- using the pullback equality to identify the two measures. have h_L1_simpl_μ : ∀ᵐ w ∂(μ_C.comap F), (M2.obsCondKernel Y (Z.image SWIGNode.random ∪ W) hY_M2 hZrW_M2 (s, F w)) B = (M2.obsCondKernel Y W hY_M2 hW_M2 (s, w)) B := by rw [hPartA]; exact h_L1_simpl have h_chain_μ : ∀ᵐ w ∂(μ_C.comap F), (M'.obsCondKernel Y (Z.image SWIGNode.random ∪ W) hY hZrW (sM1, F w)) B = (M2.obsCondKernel Y W hY_M2 hW_M2 (s, w)) B := by filter_upwards [h_L2, h_L1_simpl_μ] with w hL2 hL1 exact hL2.trans hL1 -- (9) Transport from μ_C.comap F-a.e. to μ_W-a.e. via hPositivity. have h_chain_μW : ∀ᵐ w ∂μ_W, (M'.obsCondKernel Y (Z.image SWIGNode.random ∪ W) hY hZrW (sM1, F w)) B = (M2.obsCondKernel Y W hY_M2 hW_M2 (s, w)) B := hPositivity.ae_eq h_chain_μ -- (10) Rewrite the goal's measure ν_W to μ_W via the Rule 3* marginal equality. change ∀ᵐ w ∂ν_W, _ rw [hν_W_eq_μ_W] exact h_chain_μW
InterSingleton 1 core · 2 supporting This file proves that, on the event where the treatment and adjustment coordinates take the fixed value inserted by the intervention, the post-intervention observational kernel and the original observational kernel assig ★ obsKernel_inter_Wset_Zrand_levelset_eq
Level-Set Agreement for Rule 2
This file proves that, on the event where the treatment and adjustment coordinates take the fixed value inserted by the intervention, the post-intervention observational kernel and the original observational kernel assign the same mass to every additional measurable observed event. This level-set identity is the cross-model cylinder equality used in the disintegration argument for Rule 2.
For the intervention on names Z, whose random copies are observed in the base model and whose fixed copies are not yet part of the base model's fixed coordinates, with the union of the random copies of Z and a conditioning set W contained in the observed variables and the random copies of Z disjoint from W, fix an intervened fixed assignment s'; for measurable subsets S of the observed-value space and measurable subsets A of the values on W, the intervened model's observational kernel at s', evaluated on S intersected with the preimage under the Z.random ∪ W-projection of the image of A under the filled-assignment map, equals the base model's observational kernel at the projected fixed assignment, evaluated on the analogous set.
Formal statement
Proof (Lean source)
2 supporting declarations (lemmas, instances)
-
obsKernel_inter_singleton_Zrand_eqtheorem — Joint kernel agreement on the Z.random-level-set event. For an intervention whose target random copies are observed and fixed copies are not already fixed, an observed union of the target random copies and conditioning block, a post-intervention fixed assignment, a conditioning-block value, and a measurable observed event, the post-intervention and base observational kernels assign equal mass to the intersection of that event with the corresponding filled target-and-conditioning level set.hypothesesN :sharedType u_1N → Type u_2M' :SCM N ΩZ :Finset NhZ_obs :∀ D ∈ Z, SWIGNode.random D ∈ M'.observedhZ_fixed :∀ D ∈ Z, SWIGNode.fixed D ∉ M'.fixedhZrW :Z.image SWIGNode.random ∪ W ⊆ M'.observeds' :(M'.fixSet Z hZ_obs hZ_fixed).FixedValuesS :Set M'.ObservedValueshS :conclusion(M'.fixSet Z hZ_obs hZ_fixed).obsKernel s' (S ∩ (valuesProjection ((fixSet_observed M' Z hZ_obs hZ_fixed).symm ▸ hZrW))⁻¹' {M'.fillZrW Z hZ_obs hZ_fixed W s' w})= M'.obsKernel (M'.fixSetProj Z hZ_obs hZ_fixed s') (S ∩ (valuesProjection hZrW)⁻¹' {M'.fillZrW Z hZ_obs hZ_fixed W s' w})Proof (Lean source)
theorem obsKernel_inter_singleton_Zrand_eq (M' : SCM N Ω) (Z : Finset N) (hZ_obs : ∀ D ∈ Z, SWIGNode.random D ∈ M'.observed) (hZ_fixed : ∀ D ∈ Z, SWIGNode.fixed D ∉ M'.fixed) (W : Finset (SWIGNode N)) (hZrW : Z.image SWIGNode.random ∪ W ⊆ M'.observed) [MeasurableSingletonClass (ValuesOn (Z.image SWIGNode.random ∪ W) (swigΩ Ω))] (s' : (M'.fixSet Z hZ_obs hZ_fixed).FixedValues) (w : ValuesOn W (swigΩ Ω)) {S : Set M'.ObservedValues} (hS : MeasurableSet S) : (M'.fixSet Z hZ_obs hZ_fixed).obsKernel s' (S ∩ (valuesProjection ((fixSet_observed M' Z hZ_obs hZ_fixed).symm ▸ hZrW))⁻¹' {M'.fillZrW Z hZ_obs hZ_fixed W s' w}) = M'.obsKernel (M'.fixSetProj Z hZ_obs hZ_fixed s') (S ∩ (valuesProjection hZrW)⁻¹' {M'.fillZrW Z hZ_obs hZ_fixed W s' w}) := by classical -- Abbreviations (via `let`; avoid `set` to prevent elaboration surprises). let M1 := M' let M2 := M1.fixSet Z hZ_obs hZ_fixed -- Use the explicit `.symm ▸` cast so the form matches the goal. have hZrW_M2 : Z.image SWIGNode.random ∪ W ⊆ M2.observed := (fixSet_observed M1 Z hZ_obs hZ_fixed).symm ▸ hZrW let s_M1 : M1.FixedValues := M1.fixSetProj Z hZ_obs hZ_fixed s' let c := M'.fillZrW Z hZ_obs hZ_fixed W s' w -- Measurability bookkeeping. have h_sing : MeasurableSet ({c} : Set _) := measurableSet_singleton _ have hπ_M1 : Measurable (valuesProjection hZrW : M1.ObservedValues → _) := by fun_prop have hπ_M2 : Measurable (valuesProjection hZrW_M2 : M2.ObservedValues → _) := by fun_prop have h_pre_M1 : MeasurableSet ((valuesProjection hZrW)⁻¹' {c}) := hπ_M1 h_sing have h_pre_M2 : MeasurableSet ((valuesProjection hZrW_M2)⁻¹' {c}) := hπ_M2 h_sing have hI_M1 : MeasurableSet (S ∩ (valuesProjection hZrW)⁻¹' {c}) := hS.inter h_pre_M1 have hI_M2 : MeasurableSet (S ∩ (valuesProjection hZrW_M2)⁻¹' {c}) := hS.inter h_pre_M2 have hRTO_M2 : Measurable M2.randomToObserved := by fun_prop have hRTO_M1 : Measurable M1.randomToObserved := by fun_prop have hf_M1 : Measurable (fun ℓ : M1.LatentValues => M1.evalMap s_M1 ℓ) := by fun_prop have hf_M2 : Measurable (fun ℓ : M2.LatentValues => M2.evalMap s' ℓ) := by fun_prop have hcast : Measurable (valuesProjection (le_of_eq (fixSet_unobserved M1 Z hZ_obs hZ_fixed).symm) : M2.LatentValues → M1.LatentValues) := by fun_prop -- LHS: unfold obsKernel → jointKernel → latentProduct.map evalMap. unfold obsKernel rw [ProbabilityTheory.Kernel.map_apply _ ((M'.fixSet Z hZ_obs hZ_fixed).measurable_randomToObserved), ProbabilityTheory.Kernel.map_apply _ M'.measurable_randomToObserved] have hI_M2_exp : MeasurableSet (S ∩ (valuesProjection ((fixSet_observed M' Z hZ_obs hZ_fixed).symm ▸ hZrW))⁻¹' {M'.fillZrW Z hZ_obs hZ_fixed W s' w}) := by exact hS.inter ((measurable_valuesProjection _) (measurableSet_singleton _)) have hI_M1_exp : MeasurableSet (S ∩ (valuesProjection hZrW)⁻¹' {M'.fillZrW Z hZ_obs hZ_fixed W s' w}) := by exact hS.inter ((measurable_valuesProjection _) (measurableSet_singleton _)) have hmap_M2 : (map (M'.fixSet Z hZ_obs hZ_fixed).randomToObserved ((M'.fixSet Z hZ_obs hZ_fixed).jointKernel s')) (S ∩ (valuesProjection ((fixSet_observed M' Z hZ_obs hZ_fixed).symm ▸ hZrW))⁻¹' {M'.fillZrW Z hZ_obs hZ_fixed W s' w}) = ((M'.fixSet Z hZ_obs hZ_fixed).jointKernel s') ((M'.fixSet Z hZ_obs hZ_fixed).randomToObserved ⁻¹' (S ∩ (valuesProjection ((fixSet_observed M' Z hZ_obs hZ_fixed).symm ▸ hZrW))⁻¹' {M'.fillZrW Z hZ_obs hZ_fixed W s' w})) := by exact MeasureTheory.Measure.map_apply ((M'.fixSet Z hZ_obs hZ_fixed).measurable_randomToObserved) hI_M2_exp have hmap_M1 : (map M'.randomToObserved (M'.jointKernel (M'.fixSetProj Z hZ_obs hZ_fixed s'))) (S ∩ (valuesProjection hZrW)⁻¹' {M'.fillZrW Z hZ_obs hZ_fixed W s' w}) = (M'.jointKernel (M'.fixSetProj Z hZ_obs hZ_fixed s')) (M'.randomToObserved ⁻¹' (S ∩ (valuesProjection hZrW)⁻¹' {M'.fillZrW Z hZ_obs hZ_fixed W s' w})) := by exact MeasureTheory.Measure.map_apply M'.measurable_randomToObserved hI_M1_exp rw [hmap_M2, hmap_M1, jointKernel_apply_eq (M'.fixSet Z hZ_obs hZ_fixed) s', jointKernel_apply_eq M' (M'.fixSetProj Z hZ_obs hZ_fixed s')] have hf_M2_exp : Measurable (fun ℓ : (M'.fixSet Z hZ_obs hZ_fixed).LatentValues => (M'.fixSet Z hZ_obs hZ_fixed).evalMap s' ℓ) := by fun_prop have hf_M1_exp : Measurable (fun ℓ : M'.LatentValues => M'.evalMap (M'.fixSetProj Z hZ_obs hZ_fixed s') ℓ) := by fun_prop have hpre_M2 : MeasurableSet ((M'.fixSet Z hZ_obs hZ_fixed).randomToObserved ⁻¹' (S ∩ (valuesProjection ((fixSet_observed M' Z hZ_obs hZ_fixed).symm ▸ hZrW))⁻¹' {M'.fillZrW Z hZ_obs hZ_fixed W s' w})) := (M'.fixSet Z hZ_obs hZ_fixed).measurable_randomToObserved hI_M2_exp have hpre_M1 : MeasurableSet (M'.randomToObserved ⁻¹' (S ∩ (valuesProjection hZrW)⁻¹' {M'.fillZrW Z hZ_obs hZ_fixed W s' w})) := M'.measurable_randomToObserved hI_M1_exp have heval_M2 : (map (fun ℓ : (M'.fixSet Z hZ_obs hZ_fixed).LatentValues => (M'.fixSet Z hZ_obs hZ_fixed).evalMap s' ℓ) (M'.fixSet Z hZ_obs hZ_fixed).latentProduct) ((M'.fixSet Z hZ_obs hZ_fixed).randomToObserved ⁻¹' (S ∩ (valuesProjection ((fixSet_observed M' Z hZ_obs hZ_fixed).symm ▸ hZrW))⁻¹' {M'.fillZrW Z hZ_obs hZ_fixed W s' w})) = (M'.fixSet Z hZ_obs hZ_fixed).latentProduct ((fun ℓ : (M'.fixSet Z hZ_obs hZ_fixed).LatentValues => (M'.fixSet Z hZ_obs hZ_fixed).evalMap s' ℓ) ⁻¹' ((M'.fixSet Z hZ_obs hZ_fixed).randomToObserved ⁻¹' (S ∩ (valuesProjection ((fixSet_observed M' Z hZ_obs hZ_fixed).symm ▸ hZrW))⁻¹' {M'.fillZrW Z hZ_obs hZ_fixed W s' w}))) := by exact MeasureTheory.Measure.map_apply hf_M2_exp hpre_M2 have heval_M1 : (map (fun ℓ : M'.LatentValues => M'.evalMap (M'.fixSetProj Z hZ_obs hZ_fixed s') ℓ) M'.latentProduct) (M'.randomToObserved ⁻¹' (S ∩ (valuesProjection hZrW)⁻¹' {M'.fillZrW Z hZ_obs hZ_fixed W s' w})) = M'.latentProduct ((fun ℓ : M'.LatentValues => M'.evalMap (M'.fixSetProj Z hZ_obs hZ_fixed s') ℓ) ⁻¹' (M'.randomToObserved ⁻¹' (S ∩ (valuesProjection hZrW)⁻¹' {M'.fillZrW Z hZ_obs hZ_fixed W s' w}))) := by exact MeasureTheory.Measure.map_apply hf_M1_exp hpre_M1 rw [heval_M2, heval_M1, ← fixSet_latentProduct_compat M' Z hZ_obs hZ_fixed, MeasureTheory.Measure.map_apply (measurable_valuesProjection _) (hf_M1_exp hpre_M1)] -- Goal: M2.latentProduct {ℓ : rando(M2.evalMap s' ℓ) ∈ I} = M2.latentProduct {ℓ : ...}. -- Reduce to set equality on the same M2.latentProduct. congr 1 -- Two preimage sets (in M2.LatentValues): -- L2 := {ℓ : rando(M2.evalMap s' ℓ) ∈ S ∩ π_C⁻¹{c}} -- L1 := {ℓ : cast ℓ ∈ {ℓ_M1 : rando(M1.evalMap s_M1 ℓ_M1) ∈ S ∩ π_C⁻¹{c}}} -- = {ℓ : rando(M1.evalMap s_M1 (cast ℓ)) ∈ S ∩ π_C⁻¹{c}} apply Set.eq_of_subset_of_subset all_goals intro ℓ hℓ simp only [Set.mem_preimage, Set.mem_inter_iff] at hℓ ⊢ -- Both directions use the same core mechanism: on the preimage, one side's -- evalMap is on the Z-level set; bridge via Claim A/B to get pointwise -- agreement of rando(evalMap) at every observed, hence the other side -- inherits membership. · -- ⊆: LHS (M2-side) ⊆ RHS (M1-side via cast). rcases hℓ with ⟨hS_mem, hπ_mem⟩ -- Extract LS_M2 from π_C = c. have hLS_M2 : ∀ D (hD : D ∈ Z), M2.evalMap s' ℓ ⟨SWIGNode.random D, mem_union_left _ (hZ_obs D hD)⟩ = s' ⟨SWIGNode.fixed D, SCM.fixed_mem_fixSet M1 Z hZ_obs hZ_fixed hD⟩ := by intro D hD -- π_C(rando(M2.evalMap s' ℓ)) = c at ⟨.random D, _⟩. have hD_in : SWIGNode.random D ∈ Z.image SWIGNode.random ∪ W := mem_union_left _ (Finset.mem_image.mpr ⟨D, hD, rfl⟩) have hcoord := congrFun hπ_mem ⟨SWIGNode.random D, hD_in⟩ have hc_at : c ⟨SWIGNode.random D, hD_in⟩ = s' ⟨SWIGNode.fixed D, SCM.fixed_mem_fixSet M1 Z hZ_obs hZ_fixed hD⟩ := by show (valuesUnionMk (zFixedAsRandom (valuesProjection (fixSet_image_fixed_subset M' Z hZ_obs hZ_fixed) s')) w) ⟨SWIGNode.random D, hD_in⟩ = s' ⟨SWIGNode.fixed D, SCM.fixed_mem_fixSet M1 Z hZ_obs hZ_fixed hD⟩ rw [valuesUnionMk_apply_left _ _ (Finset.mem_image.mpr ⟨D, hD, rfl⟩)] rfl exact hcoord.trans hc_at -- Apply the M2-direction level-set bridge at each observed v. refine ⟨?_, ?_⟩ · -- S membership: rando(M1.evalMap s_M1 (cast ℓ)) ∈ S. have heq : M1.randomToObserved (M1.evalMap s_M1 (valuesProjection (le_of_eq (fixSet_unobserved M1 Z hZ_obs hZ_fixed).symm) ℓ)) = M2.randomToObserved (M2.evalMap s' ℓ) := by funext v simp only [randomToObserved] exact (fixSet_evalMap_levelset_compat_M2 M' Z hZ_obs hZ_fixed s' ℓ hLS_M2 v.property).symm rw [heq] exact hS_mem · -- π_C membership: preserved under the same pointwise equality. have heq : M1.randomToObserved (M1.evalMap s_M1 (valuesProjection (le_of_eq (fixSet_unobserved M1 Z hZ_obs hZ_fixed).symm) ℓ)) = M2.randomToObserved (M2.evalMap s' ℓ) := by funext v simp only [randomToObserved] exact (fixSet_evalMap_levelset_compat_M2 M' Z hZ_obs hZ_fixed s' ℓ hLS_M2 v.property).symm rw [heq] exact hπ_mem · -- ⊇: RHS (M1-side via cast) ⊆ LHS (M2-side). rcases hℓ with ⟨hS_mem, hπ_mem⟩ -- Extract LS_M1(cast ℓ) from π_C = c. have hLS_M1 : ∀ D (hD : D ∈ Z), M1.evalMap s_M1 (valuesProjection (le_of_eq (fixSet_unobserved M1 Z hZ_obs hZ_fixed).symm) ℓ) ⟨SWIGNode.random D, mem_union_left _ (hZ_obs D hD)⟩ = s' ⟨SWIGNode.fixed D, SCM.fixed_mem_fixSet M1 Z hZ_obs hZ_fixed hD⟩ := by intro D hD have hD_in : SWIGNode.random D ∈ Z.image SWIGNode.random ∪ W := mem_union_left _ (Finset.mem_image.mpr ⟨D, hD, rfl⟩) have hcoord := congrFun hπ_mem ⟨SWIGNode.random D, hD_in⟩ have hc_at : c ⟨SWIGNode.random D, hD_in⟩ = s' ⟨SWIGNode.fixed D, SCM.fixed_mem_fixSet M1 Z hZ_obs hZ_fixed hD⟩ := by show (valuesUnionMk (zFixedAsRandom (valuesProjection (fixSet_image_fixed_subset M' Z hZ_obs hZ_fixed) s')) w) ⟨SWIGNode.random D, hD_in⟩ = s' ⟨SWIGNode.fixed D, SCM.fixed_mem_fixSet M1 Z hZ_obs hZ_fixed hD⟩ rw [valuesUnionMk_apply_left _ _ (Finset.mem_image.mpr ⟨D, hD, rfl⟩)] rfl exact hcoord.trans hc_at -- … truncated; follow the source link for the rest … -
obsKernel_disintegrate_recttheorem — Base-model disintegration over condition coordinates.hypothesesN :sharedType u_1N → Type u_2M :SCM N ΩhY :Y ⊆ M.observedhCC :CC ⊆ M.observeds :M.FixedValueshD :hB :conclusionM.obsKernel s ((valuesProjection hCC)⁻¹' D ∩ (valuesProjection hY)⁻¹' B)= ∫⁻ c in D, M.obsCondKernel Y CC hY hCC (s, c) B ∂((M.obsKernel s).map (valuesProjection hCC))Proof (Lean source)
theorem obsKernel_disintegrate_rect (M : SCM N Ω) (Y CC : Finset (SWIGNode N)) (hY : Y ⊆ M.observed) (hCC : CC ⊆ M.observed) [StandardBorelSpace (ValuesOn Y (swigΩ Ω))] [Nonempty (ValuesOn Y (swigΩ Ω))] [CountableOrCountablyGenerated M.FixedValues (ValuesOn CC (swigΩ Ω))] (s : M.FixedValues) {D : Set (ValuesOn CC (swigΩ Ω))} {B : Set (ValuesOn Y (swigΩ Ω))} (hD : MeasurableSet D) (hB : MeasurableSet B) : M.obsKernel s ((valuesProjection hCC)⁻¹' D ∩ (valuesProjection hY)⁻¹' B) = ∫⁻ c in D, M.obsCondKernel Y CC hY hCC (s, c) B ∂((M.obsKernel s).map (valuesProjection hCC)) := by classical have hπCC : Measurable (valuesProjection (Ω := swigΩ Ω) hCC) := by fun_prop have hπY : Measurable (valuesProjection (Ω := swigΩ Ω) hY) := by fun_prop -- κ := obsCondPairKernel. set κ : Kernel M.FixedValues (ValuesOn CC (swigΩ Ω) × ValuesOn Y (swigΩ Ω)) := M.obsCondPairKernel Y CC hY hCC with hκ_def haveI hMarkov_κ : IsMarkovKernel κ := by rw [hκ_def] unfold obsCondPairKernel exact ProbabilityTheory.Kernel.IsMarkovKernel.map _ (hπCC.prodMk hπY) haveI : IsFiniteKernel κ := inferInstance -- Step 1: κ s (D ×ˢ B) = obsKernel cylinder. have h_pre : (valuesProjection hCC)⁻¹' D ∩ (valuesProjection hY)⁻¹' B = (fun ω => (valuesProjection hCC ω, valuesProjection hY ω))⁻¹' (D ×ˢ B) := by ext ω; simp [Set.mem_inter_iff, Set.mem_preimage, Set.mem_prod] have hKpair : κ s (D ×ˢ B) = M.obsKernel s ((valuesProjection hCC)⁻¹' D ∩ (valuesProjection hY)⁻¹' B) := by rw [hκ_def]; unfold obsCondPairKernel rw [ProbabilityTheory.Kernel.map_apply' _ (hπCC.prodMk hπY) _ (hD.prod hB)] rw [h_pre] -- Step 2: Kernel.fst κ s = (M.obsKernel s).map (valuesProjection hCC). have hfst : ProbabilityTheory.Kernel.fst κ s = (M.obsKernel s).map (valuesProjection hCC) := by rw [hκ_def] unfold obsCondPairKernel rw [ProbabilityTheory.Kernel.fst_map_prod _ hπY, ProbabilityTheory.Kernel.map_apply _ hπCC] -- Step 3: Mathlib disintegration for κ. have hKey : ∫⁻ c in D, ProbabilityTheory.Kernel.condKernel κ (s, c) B ∂(ProbabilityTheory.Kernel.fst κ s) = κ s (D ×ˢ B) := ProbabilityTheory.setLIntegral_condKernel_eq_measure_prod (κ := κ) s hD hB -- Step 4: obsCondKernel = condKernel of κ (definitional, up to instance). -- Assemble (sidestep instance rewriting by going through ENNReal eq). rw [← hKpair, ← hKey, hfst] -- Goal: ∫⁻ c in D, condKernel κ (s,c) B d(map π_CC obsKernel s) -- = ∫⁻ c in D, obsCondKernel Y CC … (s,c) B d(map π_CC obsKernel s) refine MeasureTheory.lintegral_congr_ae ?_ refine Filter.Eventually.of_forall ?_ intro c -- obsCondKernel is defined as condKernel of obsCondPairKernel. change ProbabilityTheory.Kernel.condKernel κ (s, c) B = M.obsCondKernel Y CC hY hCC (s, c) B rfl
LevelsetCompat 2 core · 0 supporting This file proves that the evaluation maps of the single-intervention and double-intervention models agree on the latent level set where the single intervention already realizes the additional treatment values. ★ fixSet_evalMap_levelset_compat★ fixSet_evalMap_levelset_compat_M2
Rule 2 Level-Set Compatibility
This file proves that the evaluation maps of the single-intervention and double-intervention models agree on the latent level set where the single intervention already realizes the additional treatment values. This is the evaluation-map bridge used in the kernel proof of Rule 2 of do-calculus.
Cross-SCM evalMap level-set bridge for Rule 2. For the intervention on names Z, whose random copies are observed in the base model and whose fixed copies are not yet part of the base model's fixed coordinates, fix an intervened fixed assignment s' and a latent draw ℓ. Suppose on the "level set" picked out by ℓ, the base model's evaluation map at the projected fixed assignment already reproduces, at every random copy of a name in Z, the intervention value recorded in s'; then at any observed node v in the intervened model, the intervened model's evaluation map at (s', ℓ) agrees with the base model's evaluation map at the projected fixed assignment and the correspondingly reindexed latent draw.
Formal statement
Proof (Lean source)
M2-direction level-set evalMap bridge for Rule 2. For the intervention on names Z, whose random copies are observed in the base model and whose fixed copies are not yet part of the base model's fixed coordinates, fix an intervened fixed assignment s' and a latent draw ℓ. Suppose the intervened model's own evaluation map at (s', ℓ) already reproduces, at every random copy of a name in Z, the intervention value recorded in s'; then at any observed node v in the intervened model, the intervened model's evaluation map at (s', ℓ) agrees with the base model's evaluation map at the projected fixed assignment and the correspondingly reindexed latent draw.
Formal statement
Proof (Lean source)
RectIdentity 2 core · 0 supporting This file provides two almost-everywhere equalities of conditional kernels — a d-separation collapse and a cross-model image comparison — consumed by the discrete-treatment backdoor Rule-2 derivation. ★ obsCondKernel_dSep_collapse_ae★ obsCondKernel_cross_SCM_ae_eq_on_fillZrW
Rule 2 conditional-kernel a.e. helpers
This file provides two almost-everywhere equalities of conditional kernels — a d-separation collapse and a cross-model image comparison — consumed by the discrete-treatment backdoor Rule-2 derivation.
D-separation collapse for the post-intervention conditional kernel. For the intervention on names Z, whose random copies are observed in the base model and whose fixed copies are not yet part of the base model's fixed coordinates, with outcome set Y and conditioning set W contained in the observed variables, suppose in the post-intervention SWIG DAG, Y is d-separated from the random copies of Z given W together with the post-intervention fixed set. Then, fixing an intervened fixed assignment s and an outcome set B, for almost every conditioning value on Z.random ∪ W, the intervened model's conditional distribution of Y given Z.random ∪ W assigns B the same probability as its conditional distribution of Y given W alone, evaluated at the W-projection of that conditioning value.
Formal statement
Proof (Lean source)
Cross-SCM conditional kernels agree along the fillZrW filled assignment. For the intervention on names Z, whose random copies are observed in the base model and whose fixed copies are not yet part of the base model's fixed coordinates, with outcome set Y contained in the observed variables and conditioning set W, the union of the random copies of Z and W contained in the observed variables with the random copies of Z disjoint from W, fix an intervened fixed assignment s; then for a measurable outcome set B and almost every conditioning value w, taken with respect to the pullback of the base model's law on Z.random ∪ W under the filled-assignment map, the base model's conditional distribution of Y given Z.random ∪ W, evaluated at the filled point built from w, and the intervened model's corresponding conditional distribution, evaluated at the same filled point, assign B the same probability.
Formal statement
Proof (Lean source)
WMarginal 2 core · 4 supporting This file proves the filled-assignment measure identities used in the conditional version of Rule 2. ★ obsKernel_fixSet_W_marginal_pushforward_eq★ obsKernel_fixSet_W_rect_integral_eq
Marginal Identities for Rule 2
This file proves the filled-assignment measure identities used in the
conditional version of Rule 2. The helper lemmas describe the image of a
measurable W-event under fillZrW, prove that fillZrW is injective and a
measurable embedding, and use that embedding in
obsKernel_fixSet_W_marginal_pushforward_eq. The theorem
obsKernel_fixSet_W_rect_integral_eq then gives the rectangle integral identity
under the explicit hypothesis that the intervened random treatment copies equal
their assigned fixed intervention values almost surely. These conditional
identities are later upgraded to the full kernel statement of Rule 2.
W-marginal pushforward identity. Fix a do-set Z of nodes whose random copies are observed in the base model and whose fixed nodes have not already been intervened on and an observation block W such that the union of Z's random copies and W is observed and disjoint from Z's random copies. If, under the intervened model's law of the observed variables given the fixed values s', the post-intervention random copies of Z almost surely equal their assigned intervention values, then for every measurable W-event A, the intervened model's marginal probability of A on W equals the base model's probability of the image of A under the map that fills in the pinned Z-random-copy coordinates alongside W.
Formal statement
Proof (Lean source)
Cross-SCM rectangle bridge for the W-marginal. Fix a do-set Z of nodes whose random copies are observed in the base model and whose fixed nodes have not already been intervened on, together with an outcome block Y and a conditioning block W of observed variables such that the union of Z's random copies and W is observed and disjoint from Z's random copies. At fixed values s, assume that under the intervened model's law, the post-intervention random copies of Z almost surely equal their assigned intervention values. Then for every measurable W-event A and every measurable Y-event B, integrating, over A and with respect to the intervened model's W-marginal, the base model's conditional probability of B given the outcome of filling in Z's pinned random-copy values alongside each w reconstructs the intervened model's probability that both the W-event A and the Y-event B occur.
Formal statement
Proof (Lean source)
4 supporting declarations (lemmas, instances)
-
fillZrW_image_eqlemma — The image of a W-event under the filled-assignment map fillZrW Z hZ_obs hZ_fixed W s is exactly the set of assignments on Z.image .random ∪ W whose W-projection lies in the event and whose Z.image .random projection equals the fixed intervention value zFixedAsRandom (valuesProjection (fixSet_image_fixed_subset ...) s).hypothesesN :sharedType u_1N → Type u_2M' :SCM N ΩZ :Finset NhZ_obs :∀ D ∈ Z, SWIGNode.random D ∈ M'.observedhZ_fixed :∀ D ∈ Z, SWIGNode.fixed D ∉ M'.fixedhDisj_ZrW :Disjoint (Z.image SWIGNode.random) Ws' :(M'.fixSet Z hZ_obs hZ_fixed).FixedValuesconclusion(M'.fillZrW Z hZ_obs hZ_fixed W s') '' A= (fun c : ValuesOn (Z.image SWIGNode.random ∪ W) (swigΩ Ω) => valuesProjection (subset_union_right (s₁ := Z.image SWIGNode.random)) c)⁻¹' A ∩ (fun c => valuesProjection (subset_union_left (s₂ := W)) c)⁻¹' ({zFixedAsRandom (valuesProjection (fixSet_image_fixed_subset M' Z hZ_obs hZ_fixed) s')} : Set (ValuesOn (Z.image SWIGNode.random) (swigΩ Ω)))Proof (Lean source)
lemma fillZrW_image_eq (M' : SCM N Ω) (Z : Finset N) (hZ_obs : ∀ D ∈ Z, SWIGNode.random D ∈ M'.observed) (hZ_fixed : ∀ D ∈ Z, SWIGNode.fixed D ∉ M'.fixed) (W : Finset (SWIGNode N)) (hDisj_ZrW : Disjoint (Z.image SWIGNode.random) W) (s' : (M'.fixSet Z hZ_obs hZ_fixed).FixedValues) (A : Set (ValuesOn W (swigΩ Ω))) : (M'.fillZrW Z hZ_obs hZ_fixed W s') '' A = (fun c : ValuesOn (Z.image SWIGNode.random ∪ W) (swigΩ Ω) => valuesProjection (Finset.subset_union_right (s₁ := Z.image SWIGNode.random)) c)⁻¹' A ∩ (fun c => valuesProjection (subset_union_left (s₂ := W)) c)⁻¹' ({zFixedAsRandom (valuesProjection (fixSet_image_fixed_subset M' Z hZ_obs hZ_fixed) s')} : Set (ValuesOn (Z.image SWIGNode.random) (swigΩ Ω))) := by classical let F := M'.fillZrW Z hZ_obs hZ_fixed W s' let ζ_s : ValuesOn (Z.image SWIGNode.random) (swigΩ Ω) := zFixedAsRandom (valuesProjection (fixSet_image_fixed_subset M' Z hZ_obs hZ_fixed) s') ext c constructor · rintro ⟨w, hwA, rfl⟩ refine ⟨?_, ?_⟩ · simp only [Set.mem_preimage] have : valuesProjection (Finset.subset_union_right : W ⊆ _) (F w) = w := by funext ⟨v, hv⟩ simp only [valuesProjection, F, fillZrW] by_cases hvA : v ∈ Z.image SWIGNode.random · exfalso exact Finset.disjoint_left.mp hDisj_ZrW hvA hv · rw [valuesUnionMk_apply_right _ _ _ hvA] rw [this] exact hwA · simp only [Set.mem_preimage, Set.mem_singleton_iff] funext ⟨v, hv⟩ simp only [valuesProjection, fillZrW] rw [valuesUnionMk_apply_left _ _ hv] · rintro ⟨hW_mem, hZr_mem⟩ simp only [Set.mem_preimage] at hW_mem simp only [Set.mem_preimage, Set.mem_singleton_iff] at hZr_mem refine ⟨valuesProjection (Finset.subset_union_right : W ⊆ _) c, hW_mem, ?_⟩ funext ⟨v, hv⟩ simp only [fillZrW] rcases Finset.mem_union.mp hv with hZrV | hWV · rw [valuesUnionMk_apply_left _ _ hZrV] have := congrFun hZr_mem ⟨v, hZrV⟩ simp only [valuesProjection] at this exact this.symm · by_cases hZrV' : v ∈ Z.image SWIGNode.random · rw [valuesUnionMk_apply_left _ _ hZrV'] have := congrFun hZr_mem ⟨v, hZrV'⟩ simp only [valuesProjection] at this exact this.symm · rw [valuesUnionMk_apply_right _ _ _ hZrV'] simp only [valuesProjection] -
fillZrW_injectivelemma — fillZrW Z _ _ W s' is injective when Z.image .random and W are disjoint.hypothesesN :sharedType u_1N → Type u_2M' :SCM N ΩZ :Finset NhZ_obs :∀ D ∈ Z, SWIGNode.random D ∈ M'.observedhZ_fixed :∀ D ∈ Z, SWIGNode.fixed D ∉ M'.fixedhDisj_ZrW :Disjoint (Z.image SWIGNode.random) Ws' :(M'.fixSet Z hZ_obs hZ_fixed).FixedValuesconclusionInjective (M'.fillZrW Z hZ_obs hZ_fixed W s')Proof (Lean source)
lemma fillZrW_injective (M' : SCM N Ω) (Z : Finset N) (hZ_obs : ∀ D ∈ Z, SWIGNode.random D ∈ M'.observed) (hZ_fixed : ∀ D ∈ Z, SWIGNode.fixed D ∉ M'.fixed) (W : Finset (SWIGNode N)) (hDisj_ZrW : Disjoint (Z.image SWIGNode.random) W) (s' : (M'.fixSet Z hZ_obs hZ_fixed).FixedValues) : Injective (M'.fillZrW Z hZ_obs hZ_fixed W s') := by classical intro w₁ w₂ h funext ⟨v, hv⟩ -- Project both sides of `h` to the W-coordinate v. have h_in : v ∈ Z.image SWIGNode.random ∪ W := Finset.subset_union_right hv have hvNotZr : v ∉ Z.image SWIGNode.random := fun hvZr => Finset.disjoint_left.mp hDisj_ZrW hvZr hv have hcoord := congrFun h ⟨v, h_in⟩ simp only [fillZrW] at hcoord rw [valuesUnionMk_apply_right _ _ h_in hvNotZr, valuesUnionMk_apply_right _ _ h_in hvNotZr] at hcoord exact hcoord -
measurableSet_fillZrW_imagelemma — A measurable W-event has a measurable image under fillZrW.hypothesesN :sharedType u_1N → Type u_2M' :SCM N ΩZ :Finset NhZ_obs :∀ D ∈ Z, SWIGNode.random D ∈ M'.observedhZ_fixed :∀ D ∈ Z, SWIGNode.fixed D ∉ M'.fixedhDisj_ZrW :Disjoint (Z.image SWIGNode.random) Ws' :(M'.fixSet Z hZ_obs hZ_fixed).FixedValueshA :conclusionMeasurableSet ((M'.fillZrW Z hZ_obs hZ_fixed W s') '' A)Proof (Lean source)
lemma measurableSet_fillZrW_image (M' : SCM N Ω) (Z : Finset N) (hZ_obs : ∀ D ∈ Z, SWIGNode.random D ∈ M'.observed) (hZ_fixed : ∀ D ∈ Z, SWIGNode.fixed D ∉ M'.fixed) (W : Finset (SWIGNode N)) (hDisj_ZrW : Disjoint (Z.image SWIGNode.random) W) [MeasurableSingletonClass (ValuesOn (Z.image SWIGNode.random ∪ W) (swigΩ Ω))] (s' : (M'.fixSet Z hZ_obs hZ_fixed).FixedValues) {A : Set (ValuesOn W (swigΩ Ω))} (hA : MeasurableSet A) : MeasurableSet ((M'.fillZrW Z hZ_obs hZ_fixed W s') '' A) := by classical let ζ_s : ValuesOn (Z.image SWIGNode.random) (swigΩ Ω) := zFixedAsRandom (valuesProjection (fixSet_image_fixed_subset M' Z hZ_obs hZ_fixed) s') by_cases hW : Nonempty (ValuesOn W (swigΩ Ω)) · obtain ⟨w₀⟩ := hW -- The Zr-singleton `{ζ_s}` is measurable (pulled back from the -- measurable singleton in `ValuesOn (Zr ∪ W)`). have hSingZr : MeasurableSet ({ζ_s} : Set (ValuesOn (Z.image SWIGNode.random) (swigΩ Ω))) := by have hmeas : Measurable (fun ζ : ValuesOn (Z.image SWIGNode.random) (swigΩ Ω) => valuesUnionMk ζ w₀) := by refine measurable_pi_iff.mpr ?_ rintro ⟨v, hv⟩ by_cases hvZ : v ∈ Z.image SWIGNode.random · have h_eq : (fun ζ : ValuesOn (Z.image SWIGNode.random) (swigΩ Ω) => valuesUnionMk ζ w₀ ⟨v, hv⟩) = (fun ζ => ζ ⟨v, hvZ⟩) := funext fun _ => valuesUnionMk_apply_left _ _ hvZ rw [h_eq] exact measurable_pi_apply _ · have hvW : v ∈ W := (Finset.mem_union.mp hv).resolve_left hvZ have h_eq : (fun ζ : ValuesOn (Z.image SWIGNode.random) (swigΩ Ω) => valuesUnionMk ζ w₀ ⟨v, hv⟩) = (fun _ => w₀ ⟨v, hvW⟩) := funext fun _ => valuesUnionMk_apply_right _ _ hv hvZ rw [h_eq] exact measurable_const have h_pre : ({ζ_s} : Set (ValuesOn (Z.image SWIGNode.random) (swigΩ Ω))) = (fun ζ => valuesUnionMk ζ w₀)⁻¹' ({valuesUnionMk ζ_s w₀} : Set (ValuesOn (Z.image SWIGNode.random ∪ W) (swigΩ Ω))) := by ext ζ simp only [Set.mem_singleton_iff, Set.mem_preimage] refine ⟨fun h => by rw [h], fun h => ?_⟩ funext ⟨v, hv⟩ have hv_union : v ∈ Z.image SWIGNode.random ∪ W := subset_union_left hv have h_coord := congrFun h ⟨v, hv_union⟩ rw [valuesUnionMk_apply_left _ _ hv, valuesUnionMk_apply_left _ _ hv] at h_coord exact h_coord rw [h_pre] exact hmeas (measurableSet_singleton _) rw [fillZrW_image_eq M' Z hZ_obs hZ_fixed W hDisj_ZrW s' A] refine MeasurableSet.inter ?_ ?_ · exact (measurable_valuesProjection _) hA · exact (measurable_valuesProjection _) hSingZr · -- `ValuesOn W` empty: A = ∅, so F '' A = ∅. have hA_empty : A = ∅ := by ext w exact ⟨fun _ => (hW ⟨w⟩).elim, fun h => h.elim⟩ rw [hA_empty, Set.image_empty] exact MeasurableSet.empty -
measurableEmbedding_fillZrWlemma — fillZrW Z _ _ W s' is a MeasurableEmbedding when Z.image .random and W are disjoint.hypothesesN :sharedType u_1N → Type u_2M' :SCM N ΩZ :Finset NhZ_obs :∀ D ∈ Z, SWIGNode.random D ∈ M'.observedhZ_fixed :∀ D ∈ Z, SWIGNode.fixed D ∉ M'.fixedhDisj_ZrW :Disjoint (Z.image SWIGNode.random) Ws' :(M'.fixSet Z hZ_obs hZ_fixed).FixedValuesconclusionMeasurableEmbedding (M'.fillZrW Z hZ_obs hZ_fixed W s')Proof (Lean source)
lemma measurableEmbedding_fillZrW (M' : SCM N Ω) (Z : Finset N) (hZ_obs : ∀ D ∈ Z, SWIGNode.random D ∈ M'.observed) (hZ_fixed : ∀ D ∈ Z, SWIGNode.fixed D ∉ M'.fixed) (W : Finset (SWIGNode N)) (hDisj_ZrW : Disjoint (Z.image SWIGNode.random) W) [MeasurableSingletonClass (ValuesOn (Z.image SWIGNode.random ∪ W) (swigΩ Ω))] (s' : (M'.fixSet Z hZ_obs hZ_fixed).FixedValues) : MeasurableEmbedding (M'.fillZrW Z hZ_obs hZ_fixed W s') := { injective := fillZrW_injective M' Z hZ_obs hZ_fixed W hDisj_ZrW s' measurable := measurable_fillZrW M' Z hZ_obs hZ_fixed W s' measurableSet_image' := fun _ hA => measurableSet_fillZrW_image M' Z hZ_obs hZ_fixed W hDisj_ZrW s' hA }