SCM.ID
Identification on structural causal models: graphical criteria and theorems (back-door, c-component factorization) stated in SCM terms.
Identifiable 7 core · 1 supporting This file defines the query-level interface used by SCM identification theorems. ★ Identifiable★ nonIdentifiable_iff★ identifiableUnder_mono
Identifiability
This file defines the query-level interface used by SCM identification theorems.
CausalQuery is a functional of an SCM, obsEquiv compares observational
kernels with heterogeneous equality, Identifiable and NonIdentifiable express
whether a query is a functional of the observational law on a fixed SWIG graph,
and IdentifiableUnder adds functional and structural assumption predicates.
The helper theorems expose witness-based non-identifiability and monotonicity
under stronger assumptions.
For a finite set of node labels, measurable value spaces assigned to those nodes, and a result space, a causal query maps each structural causal model on those nodes to one value in the result space.
Definition (Lean source)
For a finite node-label set, measurable node-value spaces, and two structural causal models on them, observational equivalence means that their derived observational probability kernels are equal.
Definition (Lean source)
For a finite node-label set, measurable node-value spaces, a SWIG graph, and a causal query, identifiability means that every pair of structural causal models whose SWIG graphs both equal the given graph and whose observational probability kernels are equal has the same query value.
Definition (Lean source)
For a finite node-label set, measurable node-value spaces, a SWIG graph, and a causal query, non-identifiability means that the query is not identifiable from the observational distribution: it is not the case that every two models with that graph and equal observational probability kernels have equal query values.
Definition (Lean source)
For a SWIG graph G and a causal query Φ, the causal query is non-identifiable from the observational distribution if and only if there exist two causal models with SWIG graph G and the same observational law that disagree on the value of Φ.
Formal statement
Proof (Lean source)
For a finite node-label set, measurable node-value spaces, a SWIG graph, a functional-assumption predicate, a structural-assumption predicate, and a causal query, identifiability under the two assumptions means that every pair of models whose SWIG graphs equal the given graph, which both satisfy each predicate, and which have equal observational probability kernels, has the same query value.
Definition (Lean source)
Monotonicity of identifiability under assumptions. Fix functional-assumption predicates Af₁, Af₂ and structural-assumption predicates As₁, As₂ on causal models sharing a graph G, together with a causal query Φ. If every model satisfying Af₂ also satisfies Af₁, every model satisfying As₂ also satisfies As₁, and Φ is identifiable under the assumption pair (Af₁, As₁), then Φ is identifiable under (Af₂, As₂): passing to the more restrictive assumption predicates Af₂, As₂ cannot destroy identifiability.
Formal statement
Proof (Lean source)
1 supporting declaration (lemmas, instances)
-
identifiable_eq_identifiableUnder_truetheorem — Identifiability without additional assumptions is the special case where both Af and As are trivially satisfied.hypothesesconclusionProof (Lean source)
theorem identifiable_eq_identifiableUnder_true {Ω : N → Type*} [∀ n, MeasurableSpace (Ω n)] {α : Type*} (G : SWIGGraph N) (Φ : CausalQuery N Ω α) : Identifiable G Φ ↔ IdentifiableUnder G (fun _ => True) (fun _ => True) Φ := by simp [Identifiable, IdentifiableUnder]
BackdoorCriterion 2 core · 0 supporting This file defines the SWIG backdoor criterion used by SCM backdoor identification and proves the Rule 3 marginal-invariance step for the adjustment set. ★ backdoor_rule3_Z_marginal
Backdoor criterion and Rule 3 marginal leg
This file defines the SWIG backdoor criterion used by SCM backdoor
identification and proves the Rule 3 marginal-invariance step for the adjustment
set. The full backdoor completeness and identifiability theorems live in
Causalean/SCM/ID/Backdoor.lean; this module supplies their reusable graphical
criterion and the Z-marginal equality needed in the do-calculus assembly.
Given a SWIG graph, a finite treatment-variable set , the condition that the random copy of every treatment variable is observed, the condition that the fixed copy of no treatment variable is already fixed, a finite outcome-vertex set , and a finite candidate adjustment-vertex set , the backdoor criterion holds precisely when every vertex in is observed, is disjoint from , is disjoint from the random copies of the treatment variables, no vertex in is a descendant of a random treatment copy, and in the graph obtained by splitting the treatment variables, is d-separated from their random copies after conditioning on and their fixed copies.
Definition (Lean source)
Backdoor Rule-3 leg. Fix a causal model M and a treatment set X whose random copy is observed and whose fixed copy is not already held fixed in M, and a set Z that is observed in M such that no node of Z is a descendant of any treatment random node — the non-descendant clause of the backdoor criterion. Then, at any post-intervention configuration s_post, the Z-marginal of the post-intervention observational law at s_post equals the Z-marginal of the original observational law at the pre-intervention configuration underlying s_post.
Formal statement
Proof (Lean source)
Backdoor 6 core · 5 supporting The kernel equality proved by backdoor_completeness_ae is almost everywhere in the treatment value. ★ backdoor_completeness_ae★ backdoor_identifiable_ae
Backdoor identification, a.e. in the treatment value
The kernel equality proved by backdoor_completeness_ae is almost everywhere in the treatment
value. For non-atomic (continuous) treatment, a pointwise version would read the conditional
obsCondKernel on the measure-zero {X = t} slice, where Mathlib's disintegration representative
is not pinned by the observational law, so such a pointwise form would be too strong.
This file states the honest, regime-uniform version: the identity holds for νX-almost-every
treatment value t, where νX is the observational treatment marginal, under a standard
positivity / overlap assumption P_X × P_Z ≪ P_{X,Z}. Discrete/atomic treatment is the special
case where νX is atomic, so "a.e. t" is "every positive-mass treatment value".
The proof vehicle is the joint identity νX ⊗ₘ Kdo = νX ⊗ₘ Kbd, from which the
a.e. statement follows by ProbabilityTheory.Kernel.ae_eq_of_compProd_eq.
Main declarations
* SCM.treatmentMarginal — observational treatment marginal νX.
* SCM.BackdoorPositivityAE — product-overlap condition P_X × P_Z ≪ P_{X,Z}.
* SCM.doKernelY and SCM.adjustmentKernelY — treatment-indexed do and
backdoor-adjustment kernels for the outcome block.
* SCM.doKernelY_disintegrate and SCM.doKernelY_marginal_const — chain-rule
and Rule-3 reductions used in the proof.
* SCM.backdoor_completeness_ae_compProd — primary joint-kernel completeness.
* SCM.backdoor_completeness_ae — almost-every treatment-value completeness.
* SCM.backdoor_identifiable_ae — cross-SCM almost-every identifiability.
For a finite node population with measurable value spaces, a structural causal model, a finite treatment set, the condition that its random treatment copies are observed, and fixed-node values, the observational treatment marginal is the observational law of the random treatment coordinates at those fixed-node values.
For a finite node population with measurable value spaces, a structural causal model, a finite treatment set, a finite adjustment-node set, the condition that every adjustment node is observed, the condition that every random treatment copy and adjustment node is observed, and fixed-node values, the backdoor product-positivity condition states that the product of the observational treatment marginal and observational adjustment marginal is absolutely continuous with respect to the observational joint law of treatment and adjustment coordinates.
Definition (Lean source)
For a finite node population with measurable value spaces, a structural causal model, a finite treatment set, the condition that every random treatment copy is observed, the condition that no fixed treatment copy is already fixed, a finite observed outcome-node set, and fixed-node values, the treatment-indexed post-intervention outcome kernel maps each treatment value to the post-intervention observational law of the outcome coordinates.
Definition (Lean source)
For a finite node population with measurable value spaces, a structural causal model, a finite treatment set, the condition that every random treatment copy is observed, the condition that no fixed treatment copy is already fixed, a finite observed outcome-node set, a finite observed adjustment-node set, and fixed-node values, the treatment-indexed backdoor-adjustment outcome kernel maps each treatment value to the backdoor-adjustment law of the outcome coordinates.
Definition (Lean source)
Backdoor completeness, a.e. in the treatment value. For a finite node population with measurable, standard-Borel, nonempty value spaces, fix a causal model and a treatment set whose random copy is observed and whose fixed copy is not already held fixed in M, and let outcome and adjustment sets be observed, satisfying the backdoor criterion relative to (X,Y). Given a base configuration, and the product of the observational treatment and adjustment-set marginals is absolutely continuous with respect to their joint observational law, then for almost every treatment value t under the observational treatment marginal, the post-intervention outcome distribution at t equals the backdoor-adjustment functional evaluated at t.
Formal statement
Proof (Lean source)
Backdoor identifiability, a.e. in the treatment value (cross-SCM corollary). For a finite node population with measurable, standard-Borel, nonempty value spaces, fix two causal models that share the same SWIG graph and the same observational kernel, with base configurations that agree under this shared identification. Fix a treatment set valid in both models and outcome/adjustment sets that are observed in both models, such that Z satisfies the backdoor criterion for (X,Y) in each model separately, at base configurations, with product positivity of the observational treatment and adjustment-set marginals holding in each model. Then for almost every treatment value t under the shared observational treatment marginal, the post-intervention outcome distribution computed in M₁ at t equals the one computed in M₂ at t, since each model individually satisfies backdoor completeness and the two share the same graph and observational kernel.
Formal statement
Proof (Lean source)
5 supporting declarations (lemmas, instances)
-
instIsFiniteKernelDoKernelYinstance — For a finite, distinguishable node population with measurable node-value spaces and a structural causal model, a finite treatment set, the requirement that every corresponding random treatment node is observed, the requirement that no corresponding fixed treatment node is already fixed, a finite observed outcome-node set, and a fixed-node assignment, the treatment-indexed post-intervention outcome kernel is finite.parametersN :sharedType u_1N → Type u_2M :SCM N ΩX :Finset NhObs :∀ D ∈ X, SWIGNode.random D ∈ M.observedhFix :∀ D ∈ X, SWIGNode.fixed D ∉ M.fixedhY :Y ⊆ M.observeds0 :M.FixedValuesinstanceinstIsFiniteKernelDoKernelY M X hObs hFix Y hY s0 :IsFiniteKernel (M.doKernelY X hObs hFix Y hY s0)given byby rw [SCM.doKernelY]; infer_instance -
instIsFiniteKernelAdjustmentKernelYinstance — For a finite, distinguishable node population with measurable, standard-Borel, nonempty node-value spaces and a structural causal model, a finite treatment set, the requirement that every corresponding random treatment node is observed, the requirement that no corresponding fixed treatment node is already fixed, finite observed outcome and adjustment-node sets, and a fixed-node assignment, the treatment-indexed backdoor-adjustment outcome kernel is finite.parametersN :sharedType u_1N → Type u_2M :SCM N ΩX :Finset NhObs :∀ D ∈ X, SWIGNode.random D ∈ M.observedhFix :∀ D ∈ X, SWIGNode.fixed D ∉ M.fixedhY :Y ⊆ M.observedhZ :Z ⊆ M.observeds0 :M.FixedValuesinstanceinstIsFiniteKernelAdjustmentKernelY M X hObs hFix Y Z hY hZ s0 :IsFiniteKernel (M.adjustmentKernelY X hObs hFix Y Z hY hZ s0)given byby rw [SCM.adjustmentKernelY]; infer_instance -
doKernelY_disintegratetheorem — Treatment-indexed chain rule. At treatment value t, the post-do(X) Y-marginal kernel disintegrates through Z: it is the conditional Y ∣ Z (under do(X)) composed with the post-do(X) Z-marginal kernel. The doKernelY-level form of obsKernel_map_eq_obsCondKernel_comp.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.fixedhY :Y ⊆ M.observedhZ :Z ⊆ M.observeds0 :M.FixedValuesconclusionM.doKernelY X hObs hFix Y hY s0 t= ((M.fixSet X hObs hFix).obsCondKernel Y Z ((SCM.fixSet_observed M X hObs hFix).symm ▸ hY) ((SCM.fixSet_observed M X hObs hFix).symm ▸ hZ)).sectR (M.fixSetExtend X hObs hFix s0 t) ∘ₘ M.doKernelY X hObs hFix Z hZ s0 tProof (Lean source)
theorem doKernelY_disintegrate (M : SCM N Ω) (X : Finset N) (hObs : ∀ D ∈ X, SWIGNode.random D ∈ M.observed) (hFix : ∀ D ∈ X, SWIGNode.fixed D ∉ M.fixed) (Y Z : Finset (SWIGNode N)) (hY : Y ⊆ M.observed) (hZ : Z ⊆ M.observed) (s0 : M.FixedValues) (t : ValuesOn (X.image SWIGNode.random) (swigΩ Ω)) : M.doKernelY X hObs hFix Y hY s0 t = ((M.fixSet X hObs hFix).obsCondKernel Y Z ((SCM.fixSet_observed M X hObs hFix).symm ▸ hY) ((SCM.fixSet_observed M X hObs hFix).symm ▸ hZ)).sectR (M.fixSetExtend X hObs hFix s0 t) ∘ₘ M.doKernelY X hObs hFix Z hZ s0 t := by have hY' : M.doKernelY X hObs hFix Y hY s0 t = ((M.fixSet X hObs hFix).obsKernel (M.fixSetExtend X hObs hFix s0 t)).map (valuesProjection ((SCM.fixSet_observed M X hObs hFix).symm ▸ hY)) := by rw [SCM.doKernelY, ProbabilityTheory.Kernel.map_apply _ (measurable_valuesProjection _), ProbabilityTheory.Kernel.comap_apply] have hZ' : M.doKernelY X hObs hFix Z hZ s0 t = ((M.fixSet X hObs hFix).obsKernel (M.fixSetExtend X hObs hFix s0 t)).map (valuesProjection ((SCM.fixSet_observed M X hObs hFix).symm ▸ hZ)) := by rw [SCM.doKernelY, ProbabilityTheory.Kernel.map_apply _ (measurable_valuesProjection _), ProbabilityTheory.Kernel.comap_apply] rw [hY', hZ'] exact SCM.obsKernel_map_eq_obsCondKernel_comp (M.fixSet X hObs hFix) Y Z _ _ _ -
doKernelY_marginal_consttheorem — Treatment-indexed Rule 3 (marginal invariance). If no X-copy is an ancestor of any Z-node, the post-do(X) Z-marginal kernel is constant in the treatment value and equals the observational Z-marginal at base s₀. The doKernelY-level form of backdoor_rule3_Z_marginal.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.fixedhZ :Z ⊆ M.observedh_noanc :∀ z ∈ Z, ∀ D ∈ X, ¬ M.toSWIGGraph.dag.isAncestor (SWIGNode.random D) zs0 :M.FixedValuesconclusionM.doKernelY X hObs hFix Z hZ s0 t = (M.obsKernel s0).map (valuesProjection hZ)Proof (Lean source)
theorem doKernelY_marginal_const (M : SCM N Ω) (X : Finset N) (hObs : ∀ D ∈ X, SWIGNode.random D ∈ M.observed) (hFix : ∀ D ∈ X, SWIGNode.fixed D ∉ M.fixed) (Z : Finset (SWIGNode N)) (hZ : Z ⊆ M.observed) (h_noanc : ∀ z ∈ Z, ∀ D ∈ X, ¬ M.toSWIGGraph.dag.isAncestor (SWIGNode.random D) z) (s0 : M.FixedValues) (t : ValuesOn (X.image SWIGNode.random) (swigΩ Ω)) : M.doKernelY X hObs hFix Z hZ s0 t = (M.obsKernel s0).map (valuesProjection hZ) := by have hZ' : M.doKernelY X hObs hFix Z hZ s0 t = ((M.fixSet X hObs hFix).obsKernel (M.fixSetExtend X hObs hFix s0 t)).map (valuesProjection ((SCM.fixSet_observed M X hObs hFix).symm ▸ hZ)) := by rw [SCM.doKernelY, ProbabilityTheory.Kernel.map_apply _ (measurable_valuesProjection _), ProbabilityTheory.Kernel.comap_apply] rw [hZ'] have hR3 := SCM.backdoor_rule3_Z_marginal M X hObs hFix Z hZ h_noanc (M.fixSetExtend X hObs hFix s0 t) rw [SCM.fixSetProj_fixSetExtend] at hR3 exact hR3 -
backdoor_completeness_ae_compProdtheorem — For a finite node population with measurable, standard-Borel, nonempty value spaces, a structural causal model, a treatment set whose random copies are observed and whose fixed copies are not already fixed, observed outcome and adjustment sets, a backdoor criterion, including its disjointness conditions, a fixed-node assignment, and product positivity, the treatment-marginal joint laws of the interventional and adjustment kernels are equal. Joint (compProd) completeness — primary form. νX ⊗ₘ doKernelY = νX ⊗ₘ adjustmentKernelY at base s₀. This is the object that is well-posed for continuous treatment: it never reads obsCondKernel on a μXZ-null treatment slice.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.fixedhY :Y ⊆ M.observedhZ :Z ⊆ M.observedh_bd :backdoorCriterion M.toSWIGGraph X hObs hFix Y Zs0 :M.FixedValues_hPositivity :M.BackdoorPositivityAE X Z hZ (union_subset (Finset.image_subset_iff.mpr hObs) hZ) s0conclusion(M.treatmentMarginal X (Finset.subset_union_left.trans (union_subset (Finset.image_subset_iff.mpr hObs) hZ)) s0) ⊗ₘ (M.doKernelY X hObs hFix Y hY s0)= (M.treatmentMarginal X (Finset.subset_union_left.trans (union_subset (Finset.image_subset_iff.mpr hObs) hZ)) s0) ⊗ₘ (M.adjustmentKernelY X hObs hFix Y Z hY hZ s0)Proof (Lean source)
theorem backdoor_completeness_ae_compProd (M : SCM N Ω) (X : Finset N) (hObs : ∀ D ∈ X, SWIGNode.random D ∈ M.observed) (hFix : ∀ D ∈ X, SWIGNode.fixed D ∉ M.fixed) (Y Z : Finset (SWIGNode N)) (hY : Y ⊆ M.observed) (hZ : Z ⊆ M.observed) (h_bd : backdoorCriterion M.toSWIGGraph X hObs hFix Y Z) (s0 : M.FixedValues) (_hPositivity : M.BackdoorPositivityAE X Z hZ (union_subset (Finset.image_subset_iff.mpr hObs) hZ) s0) : (M.treatmentMarginal X (Finset.subset_union_left.trans (union_subset (Finset.image_subset_iff.mpr hObs) hZ)) s0) ⊗ₘ (M.doKernelY X hObs hFix Y hY s0) = (M.treatmentMarginal X (Finset.subset_union_left.trans (union_subset (Finset.image_subset_iff.mpr hObs) hZ)) s0) ⊗ₘ (M.adjustmentKernelY X hObs hFix Y Z hY hZ s0) := by have hXrZ : X.image SWIGNode.random ∪ Z ⊆ M.observed := union_subset (Finset.image_subset_iff.mpr hObs) hZ have hXr : X.image SWIGNode.random ⊆ M.observed := Finset.subset_union_left.trans hXrZ -- Abbreviations. set sT := fun t => M.fixSetExtend X hObs hFix s0 t with hsT set hZ_post : Z ⊆ (M.fixSet X hObs hFix).observed := (SCM.fixSet_observed M X hObs hFix).symm ▸ hZ with hZpost_def set hY_post : Y ⊆ (M.fixSet X hObs hFix).observed := (SCM.fixSet_observed M X hObs hFix).symm ▸ hY with hYpost_def -- μZ = (M.obsKernel s0).map projZ, the observational Z-marginal at base s0. set μZ := (M.obsKernel s0).map (valuesProjection hZ) with hμZ -- ============================================================ -- Reduction 1 (chain rule + Rule 3): the do-side Y-marginal kernel at t. -- doKernelY t = (sectR (fixSet X).obsCondKernel (sT t)) ∘ₘ μZ -- ============================================================ -- Reduction 1 (chain rule + Rule 3) is now packaged in the treatment-indexed -- do-calculus lemmas `doKernelY_disintegrate` and `doKernelY_marginal_const`. have hLHS : ∀ t, M.doKernelY X hObs hFix Y hY s0 t = ((M.fixSet X hObs hFix).obsCondKernel Y Z hY_post hZ_post).sectR (sT t) ∘ₘ μZ := by intro t rw [doKernelY_disintegrate M X hObs hFix Y Z hY hZ s0 t, doKernelY_marginal_const M X hObs hFix Z hZ h_bd.2.2.2.1 s0 t] -- ============================================================ -- Reduction 2 (unfold backdoorAdjustment): the adjustment-side kernel at t. -- adjustmentKernelY t = (sectR condPost (sT t)) ∘ₘ μZ -- where condPost z = M.obsCondKernel Y (Xr∪Z) (s0, fillZrW (sT t) z). -- ============================================================ -- The `condPost` kernel appearing in `backdoorAdjustment`. set hXZ : X.image SWIGNode.random ∪ Z ⊆ M.observed := hXrZ with hXZ_def set condPost : Kernel ((M.fixSet X hObs hFix).FixedValues × ValuesOn Z (swigΩ Ω)) (ValuesOn Y (swigΩ Ω)) := (M.obsCondKernel Y (X.image SWIGNode.random ∪ Z) hY hXZ).comap (fun p : (M.fixSet X hObs hFix).FixedValues × ValuesOn Z (swigΩ Ω) => (M.fixSetProj X hObs hFix p.1, M.fillZrW X hObs hFix Z p.1 p.2)) (prodMk ((M.measurable_fixSetProj X hObs hFix).comp measurable_fst) (M.measurable_fillZrW_prod X hObs hFix Z)) with hcondPost_def haveI : IsMarkovKernel (M.obsCondKernel Y (X.image SWIGNode.random ∪ Z) hY hXZ) := by unfold SCM.obsCondKernel; infer_instance haveI : IsMarkovKernel condPost := by rw [hcondPost_def]; infer_instance have hRHS : ∀ t, M.adjustmentKernelY X hObs hFix Y Z hY hZ s0 t = condPost.sectR (sT t) ∘ₘ μZ := by intro t -- adjustmentKernelY t = backdoorAdjustment (sT t). have hadj : M.adjustmentKernelY X hObs hFix Y Z hY hZ s0 t = M.backdoorAdjustment X hObs hFix Y Z hY hZ (sT t) := by rw [SCM.adjustmentKernelY, ProbabilityTheory.Kernel.comap_apply] rw [hadj] -- Unfold backdoorAdjustment body to ((zMarginalPost ⊗ₖ condPost).map snd) (sT t). change ((((M.obsKernel.map (valuesProjection hZ)).comap (M.fixSetProj X hObs hFix) (M.measurable_fixSetProj X hObs hFix)) ⊗ₖ condPost).map snd) (sT t) = condPost.sectR (sT t) ∘ₘ μZ rw [compProd_map_snd_apply, ProbabilityTheory.Kernel.comap_apply, ProbabilityTheory.Kernel.map_apply _ (measurable_valuesProjection _), SCM.fixSetProj_fixSetExtend, ← hμZ] -- ============================================================ -- a.e. Rule 2 on the product νX ⊗ₘ const μZ. -- ============================================================ -- νX = treatmentMarginal = (M.obsKernel s0).map projXr. set νX := M.treatmentMarginal X hXr s0 with hνX have hνX_eq : νX = (M.obsKernel s0).map (valuesProjection hXr) := by rw [hνX, SCM.treatmentMarginal] -- The product measure λ = νX ⊗ₘ const μZ. set lam := νX ⊗ₘ const _ μZ with hlam -- Finiteness instances. haveI : IsFiniteMeasure νX := by rw [hνX_eq]; exact (M.obsKernel s0).isFiniteMeasure_map _ haveI : IsFiniteMeasure μZ := by rw [hμZ]; exact (M.obsKernel s0).isFiniteMeasure_map _ -- Apply the a.e. Rule 2 with Z := X, W := Z. have hPos_ae : (((M.obsKernel s0).map (valuesProjection hXr) ⊗ₘ const _ ((M.obsKernel s0).map (valuesProjection hZ))).map (fun p => valuesUnionMk p.1 p.2)) ≪ ((M.obsKernel s0).map (valuesProjection hXrZ)) := _hPositivity -- Rule 2 straight from the backdoor criterion: the applicator derives the -- d-separation + non-descendance premises internally. have hR2 := SCM.do_rule2_kernel_of_nondescendant_product_ae M X hObs hFix Y Z hY hZ hXr hXrZ (backdoorCriterion_dSep_fixSet M X hObs hFix Y Z hY hXr h_bd) (backdoorCriterion_W_nonDesc M X hObs hFix Y Z h_bd) (backdoorCriterion_W_nonDescM1 M X hObs hFix Y Z h_bd) s0 hPos_ae haveI hdoKfin : IsFiniteKernel (M.doKernelY X hObs hFix Y hY s0) := by rw [SCM.doKernelY]; infer_instance haveI hadjSF : IsSFiniteKernel (M.adjustmentKernelY X hObs hFix Y Z hY hZ s0) := by rw [SCM.adjustmentKernelY, SCM.backdoorAdjustment]; infer_instance set liftTZ : ValuesOn (X.image SWIGNode.random) (swigΩ Ω) × ValuesOn Z (swigΩ Ω) → (M.fixSet X hObs hFix).FixedValues × ValuesOn Z (swigΩ Ω) := fun p => (sT p.1, p.2) with hliftTZ_def have hliftTZ_meas : Measurable liftTZ := by rw [hliftTZ_def, hsT] exact prodMk ((M.measurable_fixSetExtend X hObs hFix s0).comp measurable_fst) measurable_snd set fL : Kernel (ValuesOn (X.image SWIGNode.random) (swigΩ Ω) × ValuesOn Z (swigΩ Ω)) (ValuesOn Y (swigΩ Ω)) := ((M.fixSet X hObs hFix).obsCondKernel Y Z hY_post hZ_post).comap liftTZ hliftTZ_meas with hfL_def set fR : Kernel (ValuesOn (X.image SWIGNode.random) (swigΩ Ω) × ValuesOn Z (swigΩ Ω)) (ValuesOn Y (swigΩ Ω)) := condPost.comap liftTZ hliftTZ_meas with hfR_def have hL : ∀ t, M.doKernelY X hObs hFix Y hY s0 t = (fL.sectR t) ∘ₘ μZ := by intro t exact hLHS t have hR : ∀ t, M.adjustmentKernelY X hObs hFix Y Z hY hZ s0 t = (fR.sectR t) ∘ₘ μZ := by intro t exact hRHS t have hae : ∀ᵐ p ∂(νX ⊗ₘ const (ValuesOn (X.image SWIGNode.random) (swigΩ Ω)) μZ), fL p = fR p := by rw [hνX_eq, hμZ] filter_upwards [hR2] with p hp simpa [hfL_def, hfR_def, hliftTZ_def, hcondPost_def, hsT, ProbabilityTheory.Kernel.comap_apply, SCM.fixSetProj_fixSetExtend, SCM.fillZrW_fixSetExtend] using hp exact compProd_eq_of_inner_ae νX μZ (M.doKernelY X hObs hFix Y hY s0) (M.adjustmentKernelY X hObs hFix Y Z hY hZ s0) fL fR hL hR hae
Query 8 core · 1 supporting This file contains the lightweight query-level API shared by ID soundness theorems. ★ interventionalQuery_eq_doKernelY_of_valid★ interventionalQueryValid_iff_of_toSWIGGraph_eq
Total interventional query API
This file contains the lightweight query-level API shared by ID soundness
theorems. It deliberately avoids importing the Tian/c-factor ID skeleton, so
modules can state and prove base cases for interventionalQuery without
depending on the full density recovery stack.
For a population of variables with nonempty value spaces and a SWIG node, a witness that that node's value space is nonempty is provided.
For a population of variables with nonempty value spaces and a finite SWIG-node set, a witness that the corresponding joint value space is nonempty is provided.
For a population of variables with nonempty measurable value spaces, an intervention set, and an outcome-node set, the default interventional kernel is the constant kernel concentrated at an arbitrary outcome assignment.
Definition (Lean source)
For a finite population of variables with measurable value spaces, a structural causal model that is standard, the canonical fixed-value assignment is the unique assignment on its empty fixed-node set.
Definition (Lean source)
For a finite population of variables with measurable value spaces, an intervention set, an outcome-node set, and a structural causal model, interventional-query validity holds exactly when all intervention random nodes are observed, their fixed nodes are absent, all outcomes are observed, and the model is standard.
Definition (Lean source)
For a finite population of variables with nonempty measurable value spaces, an intervention set, and an outcome-node set, the interventional query maps each structural causal model to its post-intervention outcome kernel at a chosen default assignment of the model's fixed values when the query is valid, and otherwise to the default constant kernel.
Definition (Lean source)
For treatment nodes X and outcome nodes Y satisfying the well-formedness conditions for a valid interventional query in a model M, the total interventional query evaluated at M equals the post-intervention outcome-marginal kernel doKernelY at the chosen default fixed-value assignment.
Formal statement
Proof (Lean source)
Well-formedness invariance under matching SWIG graphs. For an intervention target set X and outcome set Y, if two structural causal models M₁, M₂ have the same SWIG graph, then they agree on whether the total interventional query for X, Y is well formed.
Formal statement
Proof (Lean source)
1 supporting declaration (lemmas, instances)
-
interventionalQuery_eq_default_of_not_validlemma — Outside the well-formed branch, the total interventional query is the fixed fallback kernel.hypothesesN :sharedType u_1N → Type u_2∀ n, Nonempty (Ω n)X :Finset NM :SCM N Ωh :¬ interventionalQueryValid X Y MconclusioninterventionalQuery (Ω := Ω) X Y M = defaultInterventionalKernel (Ω := Ω) X YProof (Lean source)
lemma interventionalQuery_eq_default_of_not_valid [∀ n, Nonempty (Ω n)] (X : Finset N) (Y : Finset (SWIGNode N)) (M : SCM N Ω) (h : ¬ interventionalQueryValid X Y M) : interventionalQuery (Ω := Ω) X Y M = defaultInterventionalKernel (Ω := Ω) X Y := by classical rw [interventionalQuery] exact dif_neg (by simpa [interventionalQueryValid] using h)
DoLawTransport 2 core · 0 supporting The post-intervention Y-marginal kernel doKernelY is built from the do-observational law (M.fixSet X).obsKernel by a comap (extend the fixed slice by the treatment value) followed by a map (project to the outcomes Y): do ★ doKernelY_eq_of_doObsKernel_heq
Structural transport of the do-observational law to doKernelY
The post-intervention Y-marginal kernel doKernelY is built from the
do-observational law (M.fixSet X).obsKernel by a comap (extend the fixed
slice by the treatment value) followed by a map (project to the outcomes Y):
doKernelY M X … Y … s₀ = ((M.fixSet X).obsKernel.comap (fixSetExtend s₀)).map π_Y.
The comap/map data (fixSetExtend, the Y-projection) and the
intermediate value-space types depend on M only through its SWIG graph
(observed, fixed, which fixSet preserves/enlarges structurally) and the base
slice s₀. Therefore two models sharing a SWIG graph whose do-observational laws
agree produce the same doKernelY.
This isolates the genuine identification content — that the do-observational laws
agree — from the purely structural transport performed here. The identification
content is discharged elsewhere (the Tian g-formula in
GraphicalThms/DoGFormula and its recursive/discrete soundness layers); this file
is graph/measure bookkeeping only and makes no appeal to idSucceeds or any
reference measure.
For a finite population of variables with measurable value spaces, a structural causal model, an intervention set whose random nodes are observed and whose fixed nodes are not already fixed, an outcome-node set contained in the observed nodes, the do-observational outcome marginal kernel maps fixed intervention values to the induced distribution of those outcomes.
Definition (Lean source)
Structural transport. Fix two causal models that share the same underlying SWIG graph, together with a treatment set X that is a valid intervention in the first model — every node of X is observed and not already fixed there and likewise valid in the second model, and an outcome set Y that is observed in the first model and observed in the second. If the two models' base fixed-value slices coincide and their Y-marginals of the do-observational law agree, up to the type-level identification the shared graph provides, then the resulting post-intervention Y-marginal kernels doKernelY agree at that shared base slice.
Formal statement
Proof (Lean source)
Adjustment 4 core · 3 supporting This file defines graph-level adjustment functionals for backdoor and frontdoor identification. ★ backdoorAdjustment_invariant★ frontdoorAdjustment_invariant
Adjustment Functionals
This file defines graph-level adjustment functionals for backdoor and frontdoor identification. These functionals express post-intervention outcome distributions in terms of observational kernels, enabling single-model completeness arguments to be combined with cross-model invariance statements. It also proves finite-kernel instances and cross-SCM invariance for both adjustment functionals.
For a finite node set with measurable node-value spaces in which every random or fixed node value space is standard Borel and nonempty, a structural causal model, a treatment node set whose random copies are observed, whose fixed copies are not already fixed in the model, and outcome and adjustment SWIG-node sets, each contained in the observed-node set, the backdoor adjustment functional is the kernel from post-intervention fixed-node assignments to distributions of the outcome-node assignment. It first forms the observational marginal distribution of the adjustment nodes, then that marginal indexed by the post-intervention fixed-node assignment, and then the conditional outcome distribution given the treatment and adjustment-node assignments.
Definition (Lean source)
For a finite node set with measurable node-value spaces in which every random or fixed node value space is standard Borel and nonempty, a structural causal model, a treatment node set whose random copies are observed, whose fixed copies are not already fixed in the model, and outcome and mediator SWIG-node sets, each contained in the observed-node set, the frontdoor adjustment functional is the kernel from post-intervention fixed-node assignments to distributions of the outcome-node assignment. It first forms the intervention treatment assignment, the mediator law conditional on that assignment, the observational treatment marginal, the conditional outcome law given observational treatment and mediator assignments, and the outcome law obtained by averaging over observational treatment.
Definition (Lean source)
Cross-SCM invariance of backdoorAdjustment. Fix two causal models M₁ and M₂ that share the same SWIG graph and the same observational kernel, and a treatment set X, an outcome set Y, and an adjustment set Z that are valid intervention data and observed variables in both models. Then the backdoor-adjustment kernel for Y given Z after intervening on X, computed within M₁, is the same as the one computed within M₂.
Formal statement
Proof (Lean source)
Cross-SCM invariance of frontdoorAdjustment. Fix two causal models M₁ and M₂ that share the same SWIG graph and the same observational kernel, and a treatment set X, an outcome set Y, and a mediator set Z that are valid intervention data and observed variables in both models. Then the frontdoor-adjustment kernel for Y through mediator Z after intervening on X, computed within M₁, is the same as the one computed within M₂.
Formal statement
Proof (Lean source)
3 supporting declarations (lemmas, instances)
-
instIsMarkovKernelObsCondKernelinstance — For a finite, distinguishable node population with measurable, standard-Borel, nonempty node-value spaces and a structural causal model, a finite observed outcome-node set, and a finite observed conditioning-node set, the observational conditional kernel from the conditioning values to the outcome values is a Markov kernel: each of its values is a probability measure.parametersinstancegiven byby unfold SCM.obsCondKernel; infer_instance -
instIsFiniteKernelBackdoorAdjustmentinstance — For a finite, distinguishable node population with measurable, standard-Borel, nonempty node-value spaces and a structural causal model, a finite treatment set, the requirement that every corresponding random treatment node is observed, the requirement that no corresponding fixed treatment node is already fixed, and finite observed outcome and adjustment-node sets, the backdoor-adjustment functional is a finite kernel.parametersN :sharedType u_1N → Type u_2M :SCM N ΩX :Finset NhX_obs :∀ D ∈ X, SWIGNode.random D ∈ M.observedhX_fixed :∀ D ∈ X, SWIGNode.fixed D ∉ M.fixedhY :Y ⊆ M.observedhZ :Z ⊆ M.observedinstanceinstIsFiniteKernelBackdoorAdjustment M X hX_obs hX_fixed Y Z hY hZ :IsFiniteKernel (M.backdoorAdjustment X hX_obs hX_fixed Y Z hY hZ)given byby rw [SCM.backdoorAdjustment]; infer_instance -
instIsFiniteKernelFrontdoorAdjustmentinstance — For a finite, distinguishable node population with measurable, standard-Borel, nonempty node-value spaces and a structural causal model, a finite treatment set, the requirement that every corresponding random treatment node is observed, the requirement that no corresponding fixed treatment node is already fixed, and finite observed outcome and mediator-node sets, the frontdoor-adjustment functional is a finite kernel.parametersN :sharedType u_1N → Type u_2M :SCM N ΩX :Finset NhX_obs :∀ D ∈ X, SWIGNode.random D ∈ M.observedhX_fixed :∀ D ∈ X, SWIGNode.fixed D ∉ M.fixedhY :Y ⊆ M.observedhZ :Z ⊆ M.observedinstanceinstIsFiniteKernelFrontdoorAdjustment M X hX_obs hX_fixed Y Z hY hZ :IsFiniteKernel (M.frontdoorAdjustment X hX_obs hX_fixed Y Z hY hZ)given byby rw [SCM.frontdoorAdjustment]; infer_instance