PO.Bridge
Bridges into the potential-outcome framework: the PO system induced by a structural causal model and by finite-coordinate restriction.
FiniteCellGFormula 7 core · 14 supporting This module turns a binary observed table specified through setwise kernel identities into conditional means of binary potential outcomes. ★ condExp_treated_sub_control_of_pair
Finite-cell g-formula bridge
This module turns a binary observed table specified through setwise kernel identities into conditional means of binary potential outcomes. It provides the real-integral conversion, arm and outcome-product conditional expectations, and the conditional treated-minus-control contrast without requiring a full potential-outcome system.
The Boolean value is represented by its zero-or-one real-valued outcome, using one for true and zero for false.
Definition (Lean source)
The selected treatment arm and realized treatment arm determine the real-valued arm indicator, which is one exactly when the arms agree.
Definition (Lean source)
The realized treatment, control potential outcome, treated potential outcome, and sample-space unit determine the observed Boolean outcome, by selecting the potential outcome for the realized arm.
A sample space, covariate space, and population measure determine a binary observed table with covariate-indexed arm probabilities and outcome means. Its fields record the covariate, the binary treatment, and the two binary potential outcomes; measurable arm-probability and outcome-mean functions of the covariate with values between zero and one; integrability; the observed law as the joint law of covariate, treatment, and realized outcome; and the setwise cell identities expressing the probability of each treatment-outcome cell over a covariate set through those functions.
Definition (Lean source)
The binary observed table determines the covariate σ-algebra, by pulling the covariate-space σ-algebra back along its covariate map.
Definition (Lean source)
The binary observed table and intervention arm determine the selected Boolean potential outcome, by choosing the treated potential outcome for the true arm and the control potential outcome otherwise.
Definition (Lean source)
The binary observed table, joint conditional independence of the potential-outcome pair and treatment, and almost-everywhere nonzero probabilities for both arms imply that the conditional treated-minus-control potential-outcome contrast equals the difference of the observed-table mean kernels, by projecting joint independence to each arm.
Formal statement
Proof (Lean source)
14 supporting declarations (lemmas, instances)
-
integrable_armIndicatortheorem — The binary observed table and treatment arm imply integrability of that arm's indicator, because the indicator is measurable and bounded by one under the finite population measure.hypothesesΩ :sharedType u_1γ :sharedType u_2d :conclusionIntegrable (fun ω => armIndicator d (D.A ω)) μProof (Lean source)
theorem FiniteCellData.integrable_armIndicator (d : Bool) : Integrable (fun ω => armIndicator d (D.A ω)) μ := by refine Integrable.of_bound ?_ 1 ?_ · exact (Measurable.ite (measurableSet_eq_fun D.measurable_A measurable_const) measurable_const measurable_const).aestronglyMeasurable · filter_upwards [] with ω simp only [armIndicator] split_ifs <;> simp -
integrable_observedProducttheorem — The binary observed table and treatment arm imply integrability of the arm indicator times the observed binary outcome, because this product is measurable and bounded by one under the finite population measure.hypothesesΩ :sharedType u_1γ :sharedType u_2d :conclusionProof (Lean source)
theorem FiniteCellData.integrable_observedProduct (d : Bool) : Integrable (fun ω => armIndicator d (D.A ω) * boolReal (observedY D.A D.Y0 D.Y1 ω)) μ := by refine Integrable.of_bound ?_ 1 ?_ · have hY : Measurable (observedY D.A D.Y0 D.Y1) := Measurable.ite (measurableSet_eq_fun D.measurable_A measurable_const) D.measurable_Y1 D.measurable_Y0 exact ((Measurable.ite (measurableSet_eq_fun D.measurable_A measurable_const) measurable_const measurable_const).mul (Measurable.ite (measurableSet_eq_fun hY measurable_const) measurable_const measurable_const)).aestronglyMeasurable · filter_upwards [] with ω simp only [armIndicator, boolReal] split_ifs <;> simp -
measure_cell_pullbacktheorem — The binary observed table, treatment arm, outcome value, covariate set, and measurability of that set imply that the corresponding observed-law cell is the matching event in the original sample space.hypothesesconclusionD.observedLaw {z | z.1 ∈ s ∧ z.2.1 = d ∧ z.2.2 = y}= μ {ω | D.X ω ∈ s ∧ D.A ω = d ∧ observedY D.A D.Y0 D.Y1 ω = y}Proof (Lean source)
theorem FiniteCellData.measure_cell_pullback (d y : Bool) (s : Set γ) (hs : MeasurableSet s) : D.observedLaw {z | z.1 ∈ s ∧ z.2.1 = d ∧ z.2.2 = y} = μ {ω | D.X ω ∈ s ∧ D.A ω = d ∧ observedY D.A D.Y0 D.Y1 ω = y} := by rw [D.observedLaw_eq_map] have hY : Measurable (observedY D.A D.Y0 D.Y1) := Measurable.ite (measurableSet_eq_fun D.measurable_A measurable_const) D.measurable_Y1 D.measurable_Y0 have hmap : Measurable (fun ω => (D.X ω, D.A ω, observedY D.A D.Y0 D.Y1 ω)) := D.measurable_X.prodMk (D.measurable_A.prodMk hY) rw [Measure.map_apply hmap] · rfl · simpa only [Set.ofPred_and, preimage, Function.comp_apply, Set.inter_assoc] using ((hs.preimage measurable_fst).inter (measurableSet_eq_fun (measurable_fst.comp measurable_snd) (measurable_const : Measurable (fun _ : γ × Bool × Bool => d)))).inter (measurableSet_eq_fun (measurable_snd.comp measurable_snd) (measurable_const : Measurable (fun _ : γ × Bool × Bool => y))) -
setIntegral_celltheorem — The binary observed table, treatment arm, outcome value, covariate set, and measurability of that set imply the real set-integral identity for the corresponding observed cell.hypothesesconclusion∫ ω in D.X ⁻¹' s, armIndicator d (D.A ω) * armIndicator y (observedY D.A D.Y0 D.Y1 ω) ∂μ= ∫ x in s, D.armProb d x * (if y then D.mean d x else 1 - D.mean d x) ∂(μ.map D.X)Proof (Lean source)
theorem FiniteCellData.setIntegral_cell (d y : Bool) (s : Set γ) (hs : MeasurableSet s) : ∫ ω in D.X ⁻¹' s, armIndicator d (D.A ω) * armIndicator y (observedY D.A D.Y0 D.Y1 ω) ∂μ = ∫ x in s, D.armProb d x * (if y then D.mean d x else 1 - D.mean d x) ∂(μ.map D.X) := by let t : Set Ω := {ω | D.A ω = d ∧ observedY D.A D.Y0 D.Y1 ω = y} have hY : Measurable (observedY D.A D.Y0 D.Y1) := Measurable.ite (measurableSet_eq_fun D.measurable_A measurable_const) D.measurable_Y1 D.measurable_Y0 have ht : MeasurableSet t := (measurableSet_eq_fun D.measurable_A measurable_const).inter (measurableSet_eq_fun hY measurable_const) have hleft : (∫ ω in D.X ⁻¹' s, armIndicator d (D.A ω) * armIndicator y (observedY D.A D.Y0 D.Y1 ω) ∂μ) = μ.real {ω | D.X ω ∈ s ∧ D.A ω = d ∧ observedY D.A D.Y0 D.Y1 ω = y} := by have hfun : ∀ ω, armIndicator d (D.A ω) * armIndicator y (observedY D.A D.Y0 D.Y1 ω) = t.indicator (fun _ => (1 : ℝ)) ω := by intro ω simp only [armIndicator, t, indicator, Set.mem_ofPred_eq] split_ifs <;> simp_all simp_rw [hfun] rw [setIntegral_indicator ht, setIntegral_one_eq_measureReal] congr 1 have hfm : Measurable (fun x => D.armProb d x * (if y then D.mean d x else 1 - D.mean d x)) := by cases y · exact (D.measurable_armProb d).mul (measurable_const.sub (D.measurable_mean d)) · exact (D.measurable_armProb d).mul (D.measurable_mean d) have hnn : ∀ x, 0 ≤ D.armProb d x * (if y then D.mean d x else 1 - D.mean d x) := by intro x apply mul_nonneg (D.armProb_mem_Icc d x).1 rcases D.mean_mem_Icc d x with ⟨h0, h1⟩ cases y <;> simp <;> linarith calc _ = μ.real {ω | D.X ω ∈ s ∧ D.A ω = d ∧ observedY D.A D.Y0 D.Y1 ω = y} := hleft _ = (D.observedLaw {z | z.1 ∈ s ∧ z.2.1 = d ∧ z.2.2 = y}).toReal := by rw [measureReal_def, D.measure_cell_pullback d y s hs] _ = (∫⁻ x in s, ofReal (D.armProb d x * (if y then D.mean d x else 1 - D.mean d x)) ∂(μ.map D.X)).toReal := by rw [D.cell_kernel s hs d y] _ = _ := by rw [integral_eq_lintegral_of_nonneg_ae (μ := (μ.map D.X).restrict s) (ae_of_all _ hnn) hfm.aestronglyMeasurable] -
setIntegral_armtheorem — The binary observed table, treatment arm, covariate set, and measurability of that set imply the set-integral identity for the arm indicator, by summing the two outcome cells.hypothesesconclusion∫ ω in D.X ⁻¹' s, armIndicator d (D.A ω) ∂μ = ∫ x in s, D.armProb d x ∂(μ.map D.X)Proof (Lean source)
theorem FiniteCellData.setIntegral_arm (d : Bool) (s : Set γ) (hs : MeasurableSet s) : ∫ ω in D.X ⁻¹' s, armIndicator d (D.A ω) ∂μ = ∫ x in s, D.armProb d x ∂(μ.map D.X) := by have hY : Measurable (observedY D.A D.Y0 D.Y1) := Measurable.ite (measurableSet_eq_fun D.measurable_A measurable_const) D.measurable_Y1 D.measurable_Y0 have hintL (y : Bool) : Integrable (fun ω => armIndicator d (D.A ω) * armIndicator y (observedY D.A D.Y0 D.Y1 ω)) μ := by refine Integrable.of_bound ?_ 1 ?_ · exact ((Measurable.ite (measurableSet_eq_fun D.measurable_A measurable_const) measurable_const measurable_const).mul (Measurable.ite (measurableSet_eq_fun hY measurable_const) measurable_const measurable_const)).aestronglyMeasurable · filter_upwards [] with ω simp only [armIndicator] split_ifs <;> simp have hmeas (y : Bool) : Measurable (fun x => D.armProb d x * (if y then D.mean d x else 1 - D.mean d x)) := by cases y · exact (D.measurable_armProb d).mul (measurable_const.sub (D.measurable_mean d)) · exact (D.measurable_armProb d).mul (D.measurable_mean d) have hintR (y : Bool) : Integrable (fun x => D.armProb d x * (if y then D.mean d x else 1 - D.mean d x)) (μ.map D.X) := by apply (integrable_map_measure (hmeas y).aestronglyMeasurable D.measurable_X.aemeasurable).2 cases y · convert (D.integrable_armProb d).sub (D.integrable_product d) using 1 funext ω simp [mul_sub] · simpa [Function.comp_def] using D.integrable_product d have hL : (∫ ω in D.X ⁻¹' s, armIndicator d (D.A ω) ∂μ) = (∫ ω in D.X ⁻¹' s, armIndicator d (D.A ω) * armIndicator true (observedY D.A D.Y0 D.Y1 ω) ∂μ) + (∫ ω in D.X ⁻¹' s, armIndicator d (D.A ω) * armIndicator false (observedY D.A D.Y0 D.Y1 ω) ∂μ) := by rw [← integral_add (hintL true).restrict (hintL false).restrict] apply integral_congr_ae filter_upwards [] with ω cases observedY D.A D.Y0 D.Y1 ω <;> simp [armIndicator] have hR : (∫ x in s, D.armProb d x * D.mean d x ∂(μ.map D.X)) + (∫ x in s, D.armProb d x * (1 - D.mean d x) ∂(μ.map D.X)) = ∫ x in s, D.armProb d x ∂(μ.map D.X) := by simpa using (integral_add (hintR true).restrict (hintR false).restrict).symm.trans (by apply integral_congr_ae filter_upwards [] with x simp ring) calc _ = _ := hL _ = (∫ x in s, D.armProb d x * D.mean d x ∂(μ.map D.X)) + (∫ x in s, D.armProb d x * (1 - D.mean d x) ∂(μ.map D.X)) := by rw [D.setIntegral_cell d true s hs, D.setIntegral_cell d false s hs] simp _ = _ := hR -
setIntegral_observedProducttheorem — The binary observed table, treatment arm, covariate set, and measurability of that set imply the set-integral identity for the observed outcome times the arm indicator, because a true Boolean outcome is its real indicator.hypothesesconclusion∫ ω in D.X ⁻¹' s, armIndicator d (D.A ω) * boolReal (observedY D.A D.Y0 D.Y1 ω) ∂μ= ∫ x in s, D.armProb d x * D.mean d x ∂(μ.map D.X)Proof (Lean source)
theorem FiniteCellData.setIntegral_observedProduct (d : Bool) (s : Set γ) (hs : MeasurableSet s) : ∫ ω in D.X ⁻¹' s, armIndicator d (D.A ω) * boolReal (observedY D.A D.Y0 D.Y1 ω) ∂μ = ∫ x in s, D.armProb d x * D.mean d x ∂(μ.map D.X) := by simpa [boolReal, armIndicator] using D.setIntegral_cell d true s hs -
sigmaX_letheorem — The binary observed table has a covariate σ-algebra contained in the ambient σ-algebra, because its covariate map is measurable.hypothesesconclusionD.sigmaX ≤ (inferInstance : MeasurableSpace Ω)Proof (Lean source)
theorem FiniteCellData.sigmaX_le : D.sigmaX ≤ (inferInstance : MeasurableSpace Ω) := D.measurable_X.comap_le -
condIndep_potential_of_pairtheorem — The binary observed table, conditional independence of the potential-outcome pair and treatment, and selected arm imply conditional independence of treatment and that arm's potential outcome, by measurable projection of the potential-outcome pair.hypothesesΩ :sharedType u_1γ :sharedType u_2hCI :CondIndepFun D.sigmaX D.sigmaX_le (fun ω => (D.Y0 ω, D.Y1 ω)) D.A μd :conclusionCondIndepFun D.sigmaX D.sigmaX_le D.A (D.potential d) μProof (Lean source)
theorem FiniteCellData.condIndep_potential_of_pair (hCI : CondIndepFun D.sigmaX D.sigmaX_le (fun ω => (D.Y0 ω, D.Y1 ω)) D.A μ) (d : Bool) : CondIndepFun D.sigmaX D.sigmaX_le D.A (D.potential d) μ := by cases d · have h := hCI.symm.comp measurable_id (measurable_fst : Measurable (fun p : Bool × Bool => p.1)) simpa [FiniteCellData.potential, Function.comp_def] using h · have h := hCI.symm.comp measurable_id (measurable_snd : Measurable (fun p : Bool × Bool => p.2)) simpa [FiniteCellData.potential, Function.comp_def] using h -
condExp_armtheorem — The binary observed table and treatment arm imply that the conditional expectation of the arm indicator is the covariate-indexed arm-probability kernel, by conditional-expectation uniqueness from the setwise arm identity.hypothesesΩ :sharedType u_1γ :sharedType u_2d :conclusionμ[fun ω => armIndicator d (D.A ω) | D.sigmaX] =ᵐ[μ] fun ω => D.armProb d (D.X ω)Proof (Lean source)
theorem FiniteCellData.condExp_arm (d : Bool) : μ[fun ω => armIndicator d (D.A ω) | D.sigmaX] =ᵐ[μ] fun ω => D.armProb d (D.X ω) := by have hmeas : Measurable[D.sigmaX] (fun ω => D.armProb d (D.X ω)) := (D.measurable_armProb d).comp (comap_measurable D.X) have h := ae_eq_condExp_of_forall_setIntegral_eq D.sigmaX_le (D.integrable_armIndicator d) (fun _ _ _ => (D.integrable_armProb d).integrableOn) (fun s hs _ => by change MeasurableSet[comap D.X inferInstance] s at hs rcases MeasurableSpace.measurableSet_comap.mp hs with ⟨t, ht, rfl⟩ exact (setIntegral_map ht (D.measurable_armProb d).aestronglyMeasurable D.measurable_X.aemeasurable).symm.trans (D.setIntegral_arm d t ht).symm) hmeas.aestronglyMeasurable exact h.symm -
condExp_observedProducttheorem — The binary observed table and treatment arm imply that the conditional expectation of observed outcome times the arm indicator is the arm-probability kernel times the arm-specific mean kernel, by conditional-expectation uniqueness from the positive-outcome cell.hypothesesΩ :sharedType u_1γ :sharedType u_2d :conclusionμ[fun ω => armIndicator d (D.A ω) * boolReal (observedY D.A D.Y0 D.Y1 ω) | D.sigmaX]=ᵐ[μ] fun ω => D.armProb d (D.X ω) * D.mean d (D.X ω)Proof (Lean source)
theorem FiniteCellData.condExp_observedProduct (d : Bool) : μ[fun ω => armIndicator d (D.A ω) * boolReal (observedY D.A D.Y0 D.Y1 ω) | D.sigmaX] =ᵐ[μ] fun ω => D.armProb d (D.X ω) * D.mean d (D.X ω) := by have hkernel : Measurable (fun x => D.armProb d x * D.mean d x) := (D.measurable_armProb d).mul (D.measurable_mean d) have hmeas : Measurable[D.sigmaX] (fun ω => D.armProb d (D.X ω) * D.mean d (D.X ω)) := hkernel.comp (comap_measurable D.X) have h := ae_eq_condExp_of_forall_setIntegral_eq D.sigmaX_le (D.integrable_observedProduct d) (fun _ _ _ => (D.integrable_product d).integrableOn) (fun s hs _ => by change MeasurableSet[comap D.X inferInstance] s at hs rcases MeasurableSpace.measurableSet_comap.mp hs with ⟨t, ht, rfl⟩ exact (setIntegral_map ht hkernel.aestronglyMeasurable D.measurable_X.aemeasurable).symm.trans (D.setIntegral_observedProduct d t ht).symm) hmeas.aestronglyMeasurable exact h.symm -
observedProduct_eq_potentialProducttheorem — The binary observed table, treatment arm, and sample-space unit imply that the observed arm-outcome product equals the product using the selected potential outcome, because the observed outcome selects that arm's potential outcome whenever its indicator is nonzero.hypothesesΩ :sharedType u_1γ :sharedType u_2d :ω :ΩconclusionarmIndicator d (D.A ω) * boolReal (observedY D.A D.Y0 D.Y1 ω)= armIndicator d (D.A ω) * boolReal (D.potential d ω)Proof (Lean source)
theorem FiniteCellData.observedProduct_eq_potentialProduct (d : Bool) (ω : Ω) : armIndicator d (D.A ω) * boolReal (observedY D.A D.Y0 D.Y1 ω) = armIndicator d (D.A ω) * boolReal (D.potential d ω) := by cases d <;> cases hA : D.A ω <;> simp [armIndicator, observedY, FiniteCellData.potential, hA] -
condExp_product_factortheorem — The binary observed table, treatment arm, and conditional independence of treatment and the selected potential outcome given covariates imply the conditional-expectation product factorization for the observed arm-outcome product, by consistency of the observed selection and conditional independence.hypothesesΩ :sharedType u_1γ :sharedType u_2d :hCI :CondIndepFun D.sigmaX D.sigmaX_le D.A (D.potential d) μconclusionμ[fun ω => armIndicator d (D.A ω) * boolReal (observedY D.A D.Y0 D.Y1 ω) | D.sigmaX]=ᵐ[μ] (μ[fun ω => armIndicator d (D.A ω) | D.sigmaX]) * (μ[fun ω => boolReal (D.potential d ω) | D.sigmaX])Proof (Lean source)
theorem FiniteCellData.condExp_product_factor (d : Bool) (hCI : CondIndepFun D.sigmaX D.sigmaX_le D.A (D.potential d) μ) : μ[fun ω => armIndicator d (D.A ω) * boolReal (observedY D.A D.Y0 D.Y1 ω) | D.sigmaX] =ᵐ[μ] (μ[fun ω => armIndicator d (D.A ω) | D.sigmaX]) * (μ[fun ω => boolReal (D.potential d ω) | D.sigmaX]) := by have hproduct : Integrable (fun ω => armIndicator d (D.A ω) * boolReal (D.potential d ω)) μ := by convert D.integrable_observedProduct d using 1 funext ω exact (D.observedProduct_eq_potentialProduct d ω).symm have hpotential : Measurable (D.potential d) := by cases d <;> simp [FiniteCellData.potential, D.measurable_Y0, D.measurable_Y1] have hcongr : μ[fun ω => armIndicator d (D.A ω) * boolReal (observedY D.A D.Y0 D.Y1 ω) | D.sigmaX] =ᵐ[μ] μ[fun ω => armIndicator d (D.A ω) * boolReal (D.potential d ω) | D.sigmaX] := condExp_congr_ae (Filter.Eventually.of_forall (fun ω => D.observedProduct_eq_potentialProduct d ω)) exact hcongr.trans <| condExp_mul_of_condIndep (μ := μ) (m := D.sigmaX) D.sigmaX_le (f := D.A) (g := D.potential d) D.measurable_A hpotential hCI (u := armIndicator d) (v := boolReal) (by fun_prop) (by fun_prop) (D.integrable_armIndicator d) (by cases d with | false => simpa [FiniteCellData.potential] using D.integrable_potential false | true => simpa [FiniteCellData.potential] using D.integrable_potential true) hproduct -
condExp_potentialtheorem — The binary observed table, treatment arm, conditional independence of treatment and the selected potential outcome given covariates, and almost-everywhere nonzero arm probability imply that the selected potential outcome's conditional mean is the observed-table mean kernel, by cancelling the arm-probability factor.hypothesesΩ :sharedType u_1γ :sharedType u_2d :hCI :CondIndepFun D.sigmaX D.sigmaX_le D.A (D.potential d) μhpos :∀ᵐ ω ∂μ, D.armProb d (D.X ω) ≠ 0conclusionμ[fun ω => boolReal (D.potential d ω) | D.sigmaX] =ᵐ[μ] fun ω => D.mean d (D.X ω)Proof (Lean source)
theorem FiniteCellData.condExp_potential (d : Bool) (hCI : CondIndepFun D.sigmaX D.sigmaX_le D.A (D.potential d) μ) (hpos : ∀ᵐ ω ∂μ, D.armProb d (D.X ω) ≠ 0) : μ[fun ω => boolReal (D.potential d ω) | D.sigmaX] =ᵐ[μ] fun ω => D.mean d (D.X ω) := by filter_upwards [D.condExp_observedProduct d, D.condExp_product_factor d hCI, D.condExp_arm d, hpos] with ω hobs hfact harm hnonzero simp only [Pi.mul_apply] at hfact rw [harm] at hfact exact mul_left_cancel₀ hnonzero (hfact.symm.trans hobs) -
condExp_treated_sub_controltheorem — The binary observed table, arm-by-arm conditional independence, and almost-everywhere nonzero probabilities for both arms imply that the conditional treated-minus-control potential-outcome contrast equals the difference of the observed-table mean kernels, by conditional-expectation linearity and the two arm-specific identities.hypothesesΩ :sharedType u_1γ :sharedType u_2hCI :∀ d, CondIndepFun D.sigmaX D.sigmaX_le D.A (D.potential d) μhpos :∀ d, ∀ᵐ ω ∂μ, D.armProb d (D.X ω) ≠ 0Proof (Lean source)
theorem FiniteCellData.condExp_treated_sub_control (hCI : ∀ d, CondIndepFun D.sigmaX D.sigmaX_le D.A (D.potential d) μ) (hpos : ∀ d, ∀ᵐ ω ∂μ, D.armProb d (D.X ω) ≠ 0) : μ[fun ω => boolReal (D.Y1 ω) - boolReal (D.Y0 ω) | D.sigmaX] =ᵐ[μ] fun ω => D.mean true (D.X ω) - D.mean false (D.X ω) := by have h1 : Integrable (fun ω => boolReal (D.Y1 ω)) μ := by simpa [FiniteCellData.potential] using D.integrable_potential true have h0 : Integrable (fun ω => boolReal (D.Y0 ω)) μ := by simpa [FiniteCellData.potential] using D.integrable_potential false have hsub := condExp_sub h1 h0 D.sigmaX have hinput : ((fun ω => boolReal (D.Y1 ω)) - (fun ω => boolReal (D.Y0 ω))) = (fun ω => boolReal (D.Y1 ω) - boolReal (D.Y0 ω)) := by funext ω rfl have houtput : ((fun ω => D.mean true (D.X ω)) - (fun ω => D.mean false (D.X ω))) = (fun ω => D.mean true (D.X ω) - D.mean false (D.X ω)) := by funext ω rfl simpa only [hinput, houtput, FiniteCellData.potential] using hsub.trans ((D.condExp_potential true (hCI true) (hpos true)).sub (D.condExp_potential false (hCI false) (hpos false)))
FromSCM 9 core · 18 supporting This file constructs the potential-outcome system induced by a generalized structural causal model and a background assignment of fixed variables. ★ ofSCM_consistency
Potential Outcome Systems from Structural Models
This file constructs the potential-outcome system induced by a generalized structural causal model and a background assignment of fixed variables. The construction keeps one potential-outcome variable for every observed random node, translates structurally eligible regime targets into interventions, evaluates the intervened model at latent draws, and projects back to the observed variables.
The construction is organized around ObsIdx, regimeTargetN,
combinedFixed, inducedEval, and POSystem.ofSCM. The theorems
POSystem.ofSCM_consistency and POSystem.ofSCM_compositionConsistency prove
separately that the induced potential-outcome system satisfies factual
consistency and composition consistency, reducing them to the corresponding
SCM counterfactual consistency lemmas.
Given a structural causal model, the observed-node index set consists of all random observed nodes of that model.
Given a structural causal model, a node name, and evidence that its random node is observed, the corresponding observed-node index is that observed random node viewed as an index of the induced potential-outcome system.
Given a structural causal model and an observed-node index, the associated observed value space is the structural-model value space attached to that node.
Given a structural causal model and a potential-outcome regime, the structural intervention target set is the finite set of underlying names targeted by that regime whose fixed counterparts are not already fixed in the structural model.
Definition (Lean source)
The N-name extracted from an ObsIdx M element via observed_is_random.
Given a structural causal model, a background assignment of its fixed variables, and a potential-outcome regime, the combined fixed-variable assignment assigns each fixed coordinate of the intervened model either its background value or, for a newly targeted coordinate, the regime's intervention value.
Definition (Lean source)
Given a structural causal model, a background assignment of its fixed variables, a potential-outcome regime, and a latent-variable assignment, the induced joint evaluation assigns each observed random node its value in the intervened structural model.
Definition (Lean source)
Given a structural causal model and a background assignment of its fixed variables, the induced potential-outcome system is the potential-outcome system whose units are latent-variable assignments and whose variables are all observed random nodes of the model.
Definition (Lean source)
For a structural causal model M and an assignment of values to its fixed background variables s, the potential-outcome system induced by M and s satisfies the consistency assumption.
Formal statement
Proof (Lean source)
18 supporting declarations (lemmas, instances)
-
instFintypeObsIdxinstance — For a finite collection of node names with decidable equality, measurable value spaces indexed by those names, and a structural causal model, the collection of observed-node indices in its induced potential-outcome system is finite. Its finiteness follows from the model's finite node collection. -
instDecidableEqObsIdxinstance — For a finite collection of node names with decidable equality, measurable value spaces indexed by those names, and a structural causal model, equality between observed-node indices in its induced potential-outcome system can be decided. The decision follows from equality of the underlying nodes. -
instMeasurableObsValueinstance — For a finite collection of node names with decidable equality, measurable value spaces indexed by those names, a structural causal model, and one of its observed-node indices, the value space associated with that index carries the σ-algebra of the corresponding structural-model variable. That σ-algebra is inherited from the corresponding variable. -
regimeTargetN_obslemma — fixSet-obligation for regimeTargetN: every target D has .random D ∈ M.observed.hypothesesconclusionSWIGNode.random D ∈ M.observedProof (Lean source)
lemma regimeTargetN_obs (M : SCM N Ω) (r : Regime (ObsIdx M) (obsValue M)) : ∀ D ∈ regimeTargetN M r, SWIGNode.random D ∈ M.observed := by intro D hD simp only [regimeTargetN, mem_image] at hD rcases hD with ⟨v, _, rfl⟩ have hspec := Classical.choose_spec (M.observed_is_random v.val v.property) rw [← hspec] exact v.property -
regimeTargetN_notFixedlemma — fixSet-obligation: .fixed D ∉ M.fixed for every structurally eligible regime target D. The target-name translation filters out observed variables whose fixed counterpart is already in M.fixed.hypothesesconclusionSWIGNode.fixed D ∉ M.fixedProof (Lean source)
lemma regimeTargetN_notFixed (M : SCM N Ω) (r : Regime (ObsIdx M) (obsValue M)) : ∀ D ∈ regimeTargetN M r, SWIGNode.fixed D ∉ M.fixed := by intro D hD simp only [regimeTargetN, mem_image] at hD rcases hD with ⟨v, hv, rfl⟩ exact (Finset.mem_filter.mp hv).2 -
combinedFixed_existslemma — Existence helper for combinedFixed: when v.val ∉ M.fixed, there is a v' ∈ r.target with .fixed (obsName M v') = v.val.hypothesesN :sharedType uNN → Type uΩM :SCM N Ωv :{x // x ∈ M.fixed ∪ (regimeTargetN M r).image SWIGNode.fixed}hMfix :v.val ∉ M.fixedProof (Lean source)
lemma combinedFixed_exists (M : SCM N Ω) (r : Regime (ObsIdx M) (obsValue M)) (v : {x // x ∈ M.fixed ∪ (regimeTargetN M r).image SWIGNode.fixed}) (hMfix : v.val ∉ M.fixed) : ∃ v' : ObsIdx M, v' ∈ r.target ∧ SWIGNode.fixed (obsName M v') = v.val := by have hImg : v.val ∈ (regimeTargetN M r).image SWIGNode.fixed := (Finset.mem_union.mp v.property).resolve_left hMfix rcases Finset.mem_image.mp hImg with ⟨D, hD, hfixEq⟩ rcases Finset.mem_image.mp hD with ⟨v', hv'tgt, hobsEq⟩ exact ⟨v', (Finset.mem_filter.mp hv'tgt).1, by simp [obsName, hobsEq, hfixEq]⟩ -
inducedEval_measurablelemma — The induced joint evaluation map of a structural model is measurable in the latent draw.hypothesesconclusionMeasurable (inducedEval M s r)Proof (Lean source)
@[fun_prop] lemma inducedEval_measurable (M : SCM N Ω) (s : SCM.FixedValues M) (r : Regime (ObsIdx M) (obsValue M)) : Measurable (inducedEval M s r) := by let M' := M.fixSet (regimeTargetN M r) (regimeTargetN_obs M r) (regimeTargetN_notFixed M r) refine measurable_pi_lambda _ (fun v => ?_) have h : Measurable (fun ℓ : SCM.LatentValues M => M'.evalMap (combinedFixed M s r) ℓ) := by have hmeas := M'.evalMap_measurable have : Measurable (fun ℓ : SCM.LatentValues M => uncurry M'.evalMap (combinedFixed M s r, ℓ)) := hmeas.comp (Measurable.prod measurable_const measurable_id') simpa [uncurry] using this exact (measurable_pi_apply ⟨v.val, by change v.val ∈ M.observed ∪ M.unobserved exact mem_union_left _ v.property⟩).comp h -
combinedFixed_oldlemma — On original fixed coordinates, combinedFixed agrees with s.hypothesesconclusioncombinedFixed M s r ⟨v, mem_union_left _ hv⟩ = s ⟨v, hv⟩Proof (Lean source)
lemma combinedFixed_old (M : SCM N Ω) (s : SCM.FixedValues M) (r : Regime (ObsIdx M) (obsValue M)) (v : SWIGNode N) (hv : v ∈ M.fixed) : combinedFixed M s r ⟨v, mem_union_left _ hv⟩ = s ⟨v, hv⟩ := by simp only [combinedFixed, dif_pos hv] -
regimeTargetN_eq_image_obsNamelemma — regimeTargetN M r is the image of the structurally eligible regime targets under obsName M.hypothesesconclusionregimeTargetN M rProof (Lean source)
lemma regimeTargetN_eq_image_obsName (M : SCM N Ω) (r : Regime (ObsIdx M) (obsValue M)) : regimeTargetN M r = (r.target.filter (fun v => SWIGNode.fixed (obsName M v) ∉ M.fixed)).image (obsName M) := rfl -
regimeTargetN_mem_vallemma — Every structural variable name targeted by a translated regime comes from an observed-node index whose observed node is the corresponding random node.hypothesesProof (Lean source)
lemma regimeTargetN_mem_val (M : SCM N Ω) (r : Regime (ObsIdx M) (obsValue M)) (D : N) (hD : D ∈ regimeTargetN M r) : ∃ v' : ObsIdx M, v' ∈ r.target ∧ v'.val = SWIGNode.random D := by simp only [regimeTargetN, mem_image] at hD rcases hD with ⟨v', hv'tgt, hDeq⟩ exact ⟨v', (Finset.mem_filter.mp hv'tgt).1, hDeq ▸ obsName_spec M v'⟩ -
obsIdx_val_injectivelemma — Two elements of ObsIdx M with the same .val are equal (injectivity of the coercion).Proof (Lean source)
lemma obsIdx_val_injective {M : SCM N Ω} {v w : ObsIdx M} (h : v.val = w.val) : v = w := Subtype.ext h -
obsName_injectivelemma — obsName M is injective: obsName v = obsName w → v = w.Proof (Lean source)
lemma obsName_injective (M : SCM N Ω) : Injective (obsName M) := fun v w hvw => obsIdx_val_injective (by rw [obsName_spec M v, obsName_spec M w, hvw]) -
sqcup_assign_leftlemma — Regime.sqcup agrees with r₁ on r₁.target.hypothesesconclusion(r₁.sqcup r₂ h).assign v (mem_union_left _ hv) = r₁.assign v hvProof (Lean source)
lemma sqcup_assign_left {V : Type*} [DecidableEq V] {X : V → Type*} [∀ v, MeasurableSpace (X v)] (r₁ r₂ : Regime V X) (h : r₁.Disjoint r₂) (v : V) (hv : v ∈ r₁.target) : (r₁.sqcup r₂ h).assign v (mem_union_left _ hv) = r₁.assign v hv := by simp [Regime.sqcup, Regime.leftBiasedUnion, hv] -
sqcup_assign_rightlemma — Regime.sqcup agrees with r₂ on r₂.target.hypothesesconclusion(r₁.sqcup r₂ h).assign v (mem_union_right _ hv) = r₂.assign v hvProof (Lean source)
lemma sqcup_assign_right {V : Type*} [DecidableEq V] {X : V → Type*} [∀ v, MeasurableSpace (X v)] (r₁ r₂ : Regime V X) (h : r₁.Disjoint r₂) (v : V) (hv : v ∈ r₂.target) : (r₁.sqcup r₂ h).assign v (mem_union_right _ hv) = r₂.assign v hv := by have h1 : v ∉ r₁.target := fun hv₁ => Finset.disjoint_left.mp h hv₁ hv simp [Regime.sqcup, Regime.leftBiasedUnion, h1] -
combinedFixed_newlemma — On new intervention coordinates, combinedFixed at ⟨.fixed D, _⟩ equals r.assign v' hv'tgt, both at type Ω D. The internal Classical.choose witness is identified with v' by uniqueness (both have .val = .random D); the cast chain collapses via cast_heq + proof_irrel_heq.hypothesesN :sharedType uNN → Type uΩM :SCM N Ωs :SCM.FixedValues Mv' :ObsIdx Mhv'tgt :v' ∈ r.targetD :NhD :D ∈ regimeTargetN M rhDval :v'.val = SWIGNode.random Dconclusion(combinedFixed M s r ⟨SWIGNode.fixed D, mem_union_right _ (Finset.mem_image.mpr ⟨D, hD, rfl⟩)⟩ : Ω D)Proof (Lean source)
lemma combinedFixed_new (M : SCM N Ω) (s : SCM.FixedValues M) (r : Regime (ObsIdx M) (obsValue M)) (v' : ObsIdx M) (hv'tgt : v' ∈ r.target) (D : N) (hD : D ∈ regimeTargetN M r) (hDval : v'.val = SWIGNode.random D) : (combinedFixed M s r ⟨SWIGNode.fixed D, mem_union_right _ (Finset.mem_image.mpr ⟨D, hD, rfl⟩)⟩ : Ω D) = cast (congrArg (swigΩ Ω) hDval) (r.assign v' hv'tgt) := by have hFD_notFix : SWIGNode.fixed D ∉ M.fixed := regimeTargetN_notFixed M r D hD unfold combinedFixed rw [dif_neg hFD_notFix] set hExist := combinedFixed_exists M r ⟨SWIGNode.fixed D, _⟩ hFD_notFix with hE_def have hChosen : choose hExist = v' := by have hspec := Classical.choose_spec hExist apply obsIdx_val_injective have h_obsname : obsName M (choose hExist) = D := by have := hspec.2; injection this rw [obsName_spec M (choose hExist), h_obsname, hDval] apply eq_of_heq refine HEq.trans (cast_heq _ _) ?_ refine HEq.trans ?_ (cast_heq _ _).symm congr 1 exact proof_irrel_heq _ _ -
regimeTargetN_emptylemma — regimeTargetN M Regime.empty = ∅.Proof (Lean source)
@[simp] lemma regimeTargetN_empty (M : SCM N Ω) : regimeTargetN M (Regime.empty (V := ObsIdx M) (X := obsValue M)) = ∅ := by simp [regimeTargetN, Regime.empty] -
inducedEval_empty_eq_evalMaplemma — inducedEval at Regime.empty equals M.evalMap s at the same latent.hypothesesconclusioninducedEval M s Regime.empty ℓ v= M.evalMap s ℓ ⟨v.val, mem_union_left _ v.property⟩Proof (Lean source)
lemma inducedEval_empty_eq_evalMap (M : SCM N Ω) (s : SCM.FixedValues M) (ℓ : SCM.LatentValues M) (v : ObsIdx M) : inducedEval M s Regime.empty ℓ v = M.evalMap s ℓ ⟨v.val, mem_union_left _ v.property⟩ := by -- `inducedEval M s Regime.empty ℓ v = (M.fixSet ∅ ...).evalMap -- (combinedFixed M s Regime.empty) ℓ ⟨v.val, _⟩` -- Use `evalMap_eq_of_equiv (fixSet_empty_equiv M ...)`. unfold inducedEval -- RHS of inducedEval: `(M.fixSet ∅ ...).evalMap (combinedFixed M s Regime.empty) ℓ ⟨v.val, _⟩` let hObs : ∀ D ∈ (∅ : Finset N), SWIGNode.random D ∈ M.observed := by simp let hFix : ∀ D ∈ (∅ : Finset N), SWIGNode.fixed D ∉ M.fixed := by simp let hEq := SCM.fixSet_empty_equiv M apply SCM.evalMap_eq_of_equiv hEq.1 hEq.2.2.1 · -- Fixed coords agree: combinedFixed at M.fixed = s intro d hd₁ hd₂ -- `(M.fixSet ∅).fixed = M.fixed ∪ ∅ = M.fixed` (by rfl since ∅.image = ∅) simp only [SCM.fixSet_fixed, Finset.image_empty, union_empty] at hd₁ exact combinedFixed_old M s Regime.empty d hd₁ · -- Latent coords: `(M.fixSet ∅).unobserved = M.unobserved` (by rfl) intro u hu₁ hu₂ rfl -
ofSCM_compositionConsistencytheorem — For a structural causal model M and an assignment of values to its fixed background variables s, the potential-outcome system induced by M and s satisfies composition consistency.hypothesesconclusion(POSystem.ofSCM M s).CompositionConsistency where compositionProof (Lean source)
theorem POSystem.ofSCM_compositionConsistency (M : SCM N Ω) (s : SCM.FixedValues M) : (POSystem.ofSCM M s).CompositionConsistency where -- --------------------------------------------------------------- -- Composition consistency -- --------------------------------------------------------------- composition := by intro r₁ r₂ h Y hY_disj ℓ hIntermediate funext v simp only [POSystem.poVariable, POSystem.ofSCM] unfold inducedEval -- Sets and proof obligations for the union fixSet set X₁ := regimeTargetN M r₁ with hX₁_def set X₂ := regimeTargetN M r₂ with hX₂_def have hUnion : regimeTargetN M (r₁.sqcup r₂ h) = X₁ ∪ X₂ := by simp only [hX₁_def, hX₂_def] exact regimeTargetN_sqcup M r₁ r₂ h have hObsU : ∀ D ∈ X₁ ∪ X₂, SWIGNode.random D ∈ M.observed := fun D hD => regimeTargetN_obs M (r₁.sqcup r₂ h) D (hUnion ▸ hD) have hFixU : ∀ D ∈ X₁ ∪ X₂, SWIGNode.fixed D ∉ M.fixed := fun D hD => regimeTargetN_notFixed M (r₁.sqcup r₂ h) D (hUnion ▸ hD) -- sxU: combinedFixed M s (r₁.sqcup r₂ h) re-typed to live on M.fixSet (X₁ ∪ X₂) set sxU : SCM.FixedValues (M.fixSet (X₁ ∪ X₂) hObsU hFixU) := fun w => combinedFixed M s (r₁.sqcup r₂ h) ⟨w.val, by have := w.property simp only [SCM.fixSet_fixed] at this ⊢ rw [hUnion]; exact this⟩ -- Transport LHS to use M.fixSet (X₁ ∪ X₂) change (M.fixSet (regimeTargetN M (r₁.sqcup r₂ h)) _ _).evalMap (combinedFixed M s (r₁.sqcup r₂ h)) ℓ ⟨v.val.val, _⟩ = (M.fixSet X₁ _ _).evalMap (combinedFixed M s r₁) ℓ ⟨v.val.val, _⟩ refine Eq.trans (evalMap_fixSet_transport M hUnion _ _ hObsU hFixU (combinedFixed M s (r₁.sqcup r₂ h)) sxU (fun _ _ _ => rfl) ℓ v.val.val ?_ ?_) ?_ · change v.val.val ∈ M.observed ∪ M.unobserved exact Finset.mem_union_left _ v.val.property · change v.val.val ∈ M.observed ∪ M.unobserved exact Finset.mem_union_left _ v.val.property -- Disjointness of X₁ and X₂ in N have hDisjN : Disjoint X₁ X₂ := by simp only [hX₁_def, hX₂_def, regimeTargetN] exact Finset.disjoint_image (obsName_injective M) |>.mpr (by rw [Finset.disjoint_left] intro v hv₁ hv₂ exact Finset.disjoint_left.mp h (Finset.mem_filter.mp hv₁).1 (Finset.mem_filter.mp hv₂).1) -- Apply evalMap_fixSet_union_eq refine SCM.evalMap_fixSet_union_eq M X₁ X₂ (regimeTargetN_obs M r₁) (regimeTargetN_notFixed M r₁) hObsU hFixU ℓ (combinedFixed M s r₁) sxU ?_ ?_ ?_ ⟨v.val.val, v.val.property⟩ · -- hCompat_old: sxU and combinedFixed M s r₁ both equal s on M.fixed intro w hw change combinedFixed M s (r₁.sqcup r₂ h) ⟨w, Finset.mem_union_left _ hw⟩ = combinedFixed M s r₁ ⟨w, Finset.mem_union_left _ hw⟩ rw [combinedFixed_old M s (r₁.sqcup r₂ h) w hw, combinedFixed_old M s r₁ w hw] · -- hCompat_x₁: sxU ⟨.fixed D, _⟩ = (combinedFixed M s r₁) ⟨.fixed D, _⟩ for D ∈ X₁ intro D hD -- Pick v' ∈ r₁.target with v'.val = .random D obtain ⟨v', hv'tgt₁, hDval⟩ := regimeTargetN_mem_val M r₁ D hD have hv'tgtU : v' ∈ (r₁.sqcup r₂ h).target := Finset.mem_union_left _ hv'tgt₁ have hD_U : D ∈ regimeTargetN M (r₁.sqcup r₂ h) := hUnion ▸ Finset.mem_union_left _ hD change combinedFixed M s (r₁.sqcup r₂ h) ⟨SWIGNode.fixed D, _⟩ = combinedFixed M s r₁ ⟨SWIGNode.fixed D, _⟩ rw [combinedFixed_new M s (r₁.sqcup r₂ h) v' hv'tgtU D hD_U hDval, combinedFixed_new M s r₁ v' hv'tgt₁ D hD hDval, sqcup_assign_left r₁ r₂ h v' hv'tgt₁] · -- hIntermediate: (M.fixSet X₁).evalMap (combinedFixed M s r₁) ℓ ⟨.random D, _⟩ -- = sxU ⟨.fixed D, _⟩ for D ∈ X₂ intro D hD obtain ⟨v', hv'tgt₂, hDval⟩ := regimeTargetN_mem_val M r₂ D hD -- v' ∉ r₁.target by disjointness have hv'_not₁ : v' ∉ r₁.target := fun hv₁ => Finset.disjoint_left.mp h hv₁ hv'tgt₂ have hv'tgtU : v' ∈ (r₁.sqcup r₂ h).target := Finset.mem_union_right _ hv'tgt₂ have hD_U : D ∈ regimeTargetN M (r₁.sqcup r₂ h) := hUnion ▸ Finset.mem_union_right _ hD -- Use hIntermediate from PO consistency: inducedEval M s r₁ ℓ v' = r₂.assign v' hv'tgt₂ have hIA := hIntermediate v' hv'tgt₂ simp only [POSystem.ofSCM] at hIA unfold inducedEval at hIA -- hIA : (M.fixSet (regimeTargetN M r₁)).evalMap (combinedFixed M s r₁) ℓ ⟨v'.val, _⟩ -- = r₂.assign v' hv'tgt₂ (at type swigΩ Ω v'.val = Ω D) change (M.fixSet X₁ _ _).evalMap (combinedFixed M s r₁) ℓ ⟨SWIGNode.random D, _⟩ = combinedFixed M s (r₁.sqcup r₂ h) ⟨SWIGNode.fixed D, _⟩ rw [combinedFixed_new M s (r₁.sqcup r₂ h) v' hv'tgtU D hD_U hDval] -- (r₁.sqcup r₂).assign v' hv'tgtU = r₂.assign v' hv'tgt₂ rw [show (r₁.sqcup r₂ h).assign v' hv'tgtU = r₂.assign v' hv'tgt₂ from sqcup_assign_right r₁ r₂ h v' hv'tgt₂] -- Now LHS at type Ω D, RHS = cast (...) (r₂.assign v' hv'tgt₂) -- Use hIA and adjust via cast have hThis : (M.fixSet X₁ _ _).evalMap (combinedFixed M s r₁) ℓ ⟨v'.val, Finset.mem_union_left _ v'.property⟩ = r₂.assign v' hv'tgt₂ := hIA -- transport via hDval : v'.val = .random D obtain ⟨v'val, v'prop⟩ := v' cases hDval exact hThis
FiniteCellOneDraw 1 core · 7 supporting The cell identities defining FiniteCellData yield population moments for treatment indicators and observed arm outcomes. ★ integral_observedLaw_weighted_centered
One-draw moments of a finite-cell observed table
The cell identities defining FiniteCellData yield population moments for treatment
indicators and observed arm outcomes. Covariate-measurable integrable weights retain
the same identities. These are the one-coordinate inputs to pair-kernel transport.
A finite-cell observed table, treatment arm d, covariate weight w and center c, their measurability, integrability of the weight under the covariate law, and integrability of the weight times the center give that the observed-law expectation of w(X)·1{A = d}·(Y − c(X)) equals the covariate-law integral of w(x)·p_d(x)·(m_d(x) − c(x)), where p_d and m_d are the table's arm-d probability and arm-d outcome mean. The center may be unbounded.
Formal statement
Proof (Lean source)
7 supporting declarations (lemmas, instances)
-
integral_weighted_armtheorem — A finite-cell observed table, treatment arm, covariate weight, measurability of that weight, and its integrability under the covariate law give the weighted treatment-arm indicator mean through the finite-cell arm probability.hypothesesconclusion∫ ω, w (D.X ω) * armIndicator d (D.A ω) ∂μ = ∫ x, w x * D.armProb d x ∂(μ.map D.X)Proof (Lean source)
theorem integral_weighted_arm (d : Bool) (w : γ → ℝ) (hm : Measurable w) (hw : Integrable w (μ.map D.X)) : ∫ ω, w (D.X ω) * armIndicator d (D.A ω) ∂μ = ∫ x, w x * D.armProb d x ∂(μ.map D.X) := by apply integral_weighted_condExp D w (D.armProb d) (fun ω => armIndicator d (D.A ω)) hm (D.measurable_armProb d) hw (D.integrable_armIndicator d) ?_ (D.condExp_arm d) intro ω simp only [armIndicator] split_ifs <;> simp -
integral_weighted_observedProducttheorem — A finite-cell observed table, treatment arm, covariate weight, measurability of that weight, and its integrability under the covariate law give the weighted observed arm-outcome mean through the finite-cell arm regression.hypothesesconclusion∫ ω, w (D.X ω) * armIndicator d (D.A ω) * boolReal (observedY D.A D.Y0 D.Y1 ω) ∂μ= ∫ x, w x * D.armProb d x * D.mean d x ∂(μ.map D.X)Proof (Lean source)
theorem integral_weighted_observedProduct (d : Bool) (w : γ → ℝ) (hm : Measurable w) (hw : Integrable w (μ.map D.X)) : ∫ ω, w (D.X ω) * armIndicator d (D.A ω) * boolReal (observedY D.A D.Y0 D.Y1 ω) ∂μ = ∫ x, w x * D.armProb d x * D.mean d x ∂(μ.map D.X) := by have h := integral_weighted_condExp D w (fun x => D.armProb d x * D.mean d x) (fun ω => armIndicator d (D.A ω) * boolReal (observedY D.A D.Y0 D.Y1 ω)) hm ((D.measurable_armProb d).mul (D.measurable_mean d)) hw (D.integrable_observedProduct d) (by intro ω simp only [armIndicator, boolReal] split_ifs <;> simp) (D.condExp_observedProduct d) simpa only [mul_assoc] using h -
integral_weighted_potentialtheorem — A finite-cell observed table, selected treatment arm, covariate weight, measurability of that weight, its integrability under the covariate law, conditional independence of treatment and the selected potential outcome given covariates, and almost-surely positive probability of that arm give the weighted potential-outcome mean through the observed arm regression.hypothesesΩ :sharedType u_1γ :sharedType u_2d :w :γ → ℝhm :hw :Integrable w (μ.map D.X)hCI :CondIndepFun D.sigmaX D.sigmaX_le D.A (D.potential d) μhpos :∀ᵐ ω ∂μ, D.armProb d (D.X ω) ≠ 0conclusion∫ ω, w (D.X ω) * boolReal (D.potential d ω) ∂μ = ∫ x, w x * D.mean d x ∂(μ.map D.X)Proof (Lean source)
theorem integral_weighted_potential (d : Bool) (w : γ → ℝ) (hm : Measurable w) (hw : Integrable w (μ.map D.X)) (hCI : CondIndepFun D.sigmaX D.sigmaX_le D.A (D.potential d) μ) (hpos : ∀ᵐ ω ∂μ, D.armProb d (D.X ω) ≠ 0) : ∫ ω, w (D.X ω) * boolReal (D.potential d ω) ∂μ = ∫ x, w x * D.mean d x ∂(μ.map D.X) := by apply integral_weighted_condExp D w (D.mean d) (fun ω => boolReal (D.potential d ω)) hm (D.measurable_mean d) hw (by convert D.integrable_potential d using 1 funext ω cases d <;> rfl) ?_ (D.condExp_potential d hCI hpos) intro ω simp only [boolReal] split_ifs <;> simp -
integral_weighted_treated_sub_controltheorem — A finite-cell observed table, covariate weight, measurability of that weight, its integrability under the covariate law, armwise conditional independence, and almost-surely positive probabilities for both arms give the weighted treated-minus-control potential contrast through the two arm regressions.hypothesesΩ :sharedType u_1γ :sharedType u_2w :γ → ℝhm :hw :Integrable w (μ.map D.X)hCI :∀ d, CondIndepFun D.sigmaX D.sigmaX_le D.A (D.potential d) μhpos :∀ d, ∀ᵐ ω ∂μ, D.armProb d (D.X ω) ≠ 0Proof (Lean source)
theorem integral_weighted_treated_sub_control (w : γ → ℝ) (hm : Measurable w) (hw : Integrable w (μ.map D.X)) (hCI : ∀ d, CondIndepFun D.sigmaX D.sigmaX_le D.A (D.potential d) μ) (hpos : ∀ d, ∀ᵐ ω ∂μ, D.armProb d (D.X ω) ≠ 0) : ∫ ω, w (D.X ω) * (boolReal (D.Y1 ω) - boolReal (D.Y0 ω)) ∂μ = ∫ x, w x * (D.mean true x - D.mean false x) ∂(μ.map D.X) := by have h1 : Integrable (fun ω => boolReal (D.Y1 ω)) μ := by simpa [FiniteCellData.potential] using D.integrable_potential true have h0 : Integrable (fun ω => boolReal (D.Y0 ω)) μ := by simpa [FiniteCellData.potential] using D.integrable_potential false apply integral_weighted_condExp D w (fun x => D.mean true x - D.mean false x) (fun ω => boolReal (D.Y1 ω) - boolReal (D.Y0 ω)) hm ((D.measurable_mean true).sub (D.measurable_mean false)) hw (h1.sub h0) ?_ (D.condExp_treated_sub_control hCI hpos) intro ω cases D.Y1 ω <;> cases D.Y0 ω <;> simp [boolReal] -
observedLaw_isProbabilitytheorem — A finite-cell observed table under the ambient probability law induces a probability law on observed covariate, treatment, and outcome triplets.hypothesesconclusionIsProbabilityMeasure D.observedLawProof (Lean source)
theorem observedLaw_isProbability : IsProbabilityMeasure D.observedLaw := by rw [D.observedLaw_eq_map] apply Measure.isProbabilityMeasure_map have hY : Measurable (observedY D.A D.Y0 D.Y1) := by exact Measurable.ite (measurableSet_eq_fun D.measurable_A measurable_const) D.measurable_Y1 D.measurable_Y0 exact (D.measurable_X.prodMk (D.measurable_A.prodMk hY)).aemeasurable -
integral_observedLaw_weighted_armtheorem — A finite-cell observed table, treatment arm, covariate weight, measurability of that weight, and its integrability under the covariate law give the observed-law treatment indicator mean through the arm probability.hypothesesconclusion= ∫ x, w x * D.armProb d x ∂(μ.map D.X)Proof (Lean source)
theorem integral_observedLaw_weighted_arm (d : Bool) (w : γ → ℝ) (hm : Measurable w) (hw : Integrable w (μ.map D.X)) : ∫ z : γ × Bool × Bool, w z.1 * armIndicator d z.2.1 ∂D.observedLaw = ∫ x, w x * D.armProb d x ∂(μ.map D.X) := by have hY : Measurable (observedY D.A D.Y0 D.Y1) := by exact Measurable.ite (measurableSet_eq_fun D.measurable_A measurable_const) D.measurable_Y1 D.measurable_Y0 have hmap : Measurable (fun ω => (D.X ω, D.A ω, observedY D.A D.Y0 D.Y1 ω)) := D.measurable_X.prodMk (D.measurable_A.prodMk hY) have hArm : Measurable (fun z : γ × Bool × Bool => armIndicator d z.2.1) := by unfold armIndicator exact Measurable.ite (measurableSet_eq_fun (measurable_fst.comp measurable_snd) measurable_const) measurable_const measurable_const have hintegrand : Measurable (fun z : γ × Bool × Bool => w z.1 * armIndicator d z.2.1) := (hm.comp measurable_fst).mul hArm rw [D.observedLaw_eq_map, integral_map hmap.aemeasurable hintegrand.aestronglyMeasurable] exact integral_weighted_arm D d w hm hw -
integral_observedLaw_weighted_observedProducttheorem — A finite-cell observed table, treatment arm, covariate weight, measurability of that weight, and its integrability under the covariate law give the observed-law weighted arm-outcome mean through the arm probability and regression.hypothesesconclusion= ∫ x, w x * D.armProb d x * D.mean d x ∂(μ.map D.X)Proof (Lean source)
theorem integral_observedLaw_weighted_observedProduct (d : Bool) (w : γ → ℝ) (hm : Measurable w) (hw : Integrable w (μ.map D.X)) : ∫ z : γ × Bool × Bool, w z.1 * armIndicator d z.2.1 * boolReal z.2.2 ∂D.observedLaw = ∫ x, w x * D.armProb d x * D.mean d x ∂(μ.map D.X) := by have hY : Measurable (observedY D.A D.Y0 D.Y1) := by exact Measurable.ite (measurableSet_eq_fun D.measurable_A measurable_const) D.measurable_Y1 D.measurable_Y0 have hmap : Measurable (fun ω => (D.X ω, D.A ω, observedY D.A D.Y0 D.Y1 ω)) := D.measurable_X.prodMk (D.measurable_A.prodMk hY) have hArm : Measurable (fun z : γ × Bool × Bool => armIndicator d z.2.1) := by unfold armIndicator exact Measurable.ite (measurableSet_eq_fun (measurable_fst.comp measurable_snd) measurable_const) measurable_const measurable_const have hBool : Measurable (fun z : γ × Bool × Bool => boolReal z.2.2) := by unfold boolReal exact Measurable.ite (measurableSet_eq_fun (measurable_snd.comp measurable_snd) measurable_const) measurable_const measurable_const have hintegrand : Measurable (fun z : γ × Bool × Bool => w z.1 * armIndicator d z.2.1 * boolReal z.2.2) := ((hm.comp measurable_fst).mul hArm).mul hBool rw [D.observedLaw_eq_map, integral_map hmap.aemeasurable hintegrand.aestronglyMeasurable] exact integral_weighted_observedProduct D d w hm hw
FiniteCellTwoDraw 1 core · 3 supporting Independent observations from the induced observed law admit pair-kernel expectation formulas in terms of the covariate law, arm probabilities, and arm regressions. ★ integral_pair_centered
Two-draw finite-cell pair moments
Independent observations from the induced observed law admit pair-kernel expectation formulas in terms of the covariate law, arm probabilities, and arm regressions. A measurable integrable covariate-pair weight can localize either formula. Centering functions may be unbounded when the displayed envelope is integrable.
A finite-cell observed table, two treatment arms, covariate-pair weight, two centering functions, measurability of the weight, measurability of both centers, and integrability of the envelope |W(x, x′)|·(1 + |c(x)|)·(1 + |k(x′)|) under the independent covariate-pair law give that for two independent draws from the observed law, the expectation of W(X, X′)·1{A = d}·(Y − c(X))·1{A′ = e}·(Y′ − k(X′)) equals the integral over independent covariate pairs of W(x, x′)·p_d(x)·(m_d(x) − c(x))·p_e(x′)·(m_e(x′) − k(x′)), where p and m are the table's arm probabilities and arm outcome means. The integrable envelope permits unbounded centering functions.
Formal statement
Proof (Lean source)
3 supporting declarations (lemmas, instances)
-
pair_covariate_maptheorem — A finite-cell observed table sends the covariates of two independent observed-law draws to two independent draws from the covariate law.hypothesesProof (Lean source)
theorem pair_covariate_map : (D.observedLaw.prod D.observedLaw).map (fun z : (γ × Bool × Bool) × (γ × Bool × Bool) => (z.1.1, z.2.1)) = (μ.map D.X).prod (μ.map D.X) := by letI : IsProbabilityMeasure D.observedLaw := observedLaw_isProbability D have hY : Measurable (observedY D.A D.Y0 D.Y1) := Measurable.ite (measurableSet_eq_fun D.measurable_A measurable_const) D.measurable_Y1 D.measurable_Y0 have hobs : Measurable (fun ω => (D.X ω, D.A ω, observedY D.A D.Y0 D.Y1 ω)) := D.measurable_X.prodMk (D.measurable_A.prodMk hY) have hmarg : D.observedLaw.map fst = μ.map D.X := by rw [D.observedLaw_eq_map, Measure.map_map measurable_fst hobs] rfl calc _ = (D.observedLaw.map fst).prod (D.observedLaw.map fst) := by have hfun : (fun z : (γ × Bool × Bool) × (γ × Bool × Bool) => (z.1.1, z.2.1)) = map fst fst := by funext z rfl rw [hfun] exact (Measure.map_prod_map D.observedLaw D.observedLaw measurable_fst measurable_fst).symm _ = _ := by rw [hmarg] -
integral_pair_armtheorem — A finite-cell observed table, two treatment arms, covariate-pair weight, measurability of that weight, and its integrability under the independent covariate-pair law give the independent two-draw treatment-arm kernel expectation through the two arm probabilities.hypothesesΩ :sharedType u_1γ :sharedType u_2d e :W :γ → γ → ℝhW :Measurable fun p : γ × γ => W p.1 p.2hInt :Integrable (fun p : γ × γ => W p.1 p.2) ((μ.map D.X).prod (μ.map D.X))conclusion∫ z : (γ × Bool × Bool) × (γ × Bool × Bool), W z.1.1 z.2.1 * armIndicator d z.1.2.1 * armIndicator e z.2.2.1 ∂(D.observedLaw.prod D.observedLaw)= ∫ p : γ × γ, W p.1 p.2 * D.armProb d p.1 * D.armProb e p.2 ∂((μ.map D.X).prod (μ.map D.X))Proof (Lean source)
theorem integral_pair_arm (d e : Bool) (W : γ → γ → ℝ) (hW : Measurable fun p : γ × γ => W p.1 p.2) (hInt : Integrable (fun p : γ × γ => W p.1 p.2) ((μ.map D.X).prod (μ.map D.X))) : ∫ z : (γ × Bool × Bool) × (γ × Bool × Bool), W z.1.1 z.2.1 * armIndicator d z.1.2.1 * armIndicator e z.2.2.1 ∂(D.observedLaw.prod D.observedLaw) = ∫ p : γ × γ, W p.1 p.2 * D.armProb d p.1 * D.armProb e p.2 ∂((μ.map D.X).prod (μ.map D.X)) := by letI : IsProbabilityMeasure D.observedLaw := observedLaw_isProbability D let ν : Measure γ := μ.map D.X let ρ : Measure (γ × Bool × Bool) := D.observedLaw let F : γ × γ → ℝ := fun p => W p.1 p.2 have hν : IsProbabilityMeasure ν := by dsimp [ν] exact Measure.isProbabilityMeasure_map D.measurable_X.aemeasurable letI : IsProbabilityMeasure ν := hν have hF : Integrable F (ν.prod ν) := hInt have hA (a : Bool) : Measurable (fun z : γ × Bool × Bool => armIndicator a z.2.1) := by unfold armIndicator exact Measurable.ite (measurableSet_eq_fun (measurable_fst.comp measurable_snd) measurable_const) measurable_const measurable_const have hAb (a : Bool) (z : γ × Bool × Bool) : ‖armIndicator a z.2.1‖ ≤ 1 := by simp only [armIndicator] split_ifs <;> simp have hPb (a : Bool) (x : γ) : ‖D.armProb a x‖ ≤ 1 := by have hx := D.armProb_mem_Icc a x simpa [Real.norm_eq_abs, abs_of_nonneg hx.1] using hx.2 have hρF : Integrable (fun z : (γ × Bool × Bool) × (γ × Bool × Bool) => W z.1.1 z.2.1) (ρ.prod ρ) := by rw [← pair_covariate_map D] at hF exact (integrable_map_measure hW.aestronglyMeasurable (measurable_fst.comp measurable_fst |>.prodMk (measurable_fst.comp measurable_snd)).aemeasurable).1 hF have hρFF : Integrable (fun z : (γ × Bool × Bool) × (γ × Bool × Bool) => W z.1.1 z.2.1 * armIndicator d z.1.2.1 * armIndicator e z.2.2.1) (ρ.prod ρ) := by have h₁ := hρF.mul_bdd ((hA d).comp measurable_fst).aestronglyMeasurable (ae_of_all _ fun z => hAb d z.1) exact h₁.mul_bdd ((hA e).comp measurable_snd).aestronglyMeasurable (ae_of_all _ fun z => hAb e z.2) have hFP : Integrable (fun p : γ × γ => W p.1 p.2 * D.armProb e p.2) (ν.prod ν) := hF.mul_bdd ((D.measurable_armProb e).comp measurable_snd).aestronglyMeasurable (ae_of_all _ fun p => hPb e p.2) have hFPP : Integrable (fun p : γ × γ => W p.1 p.2 * D.armProb d p.1 * D.armProb e p.2) (ν.prod ν) := by convert (hFP.mul_bdd ((D.measurable_armProb d).comp measurable_fst).aestronglyMeasurable (ae_of_all _ fun p => hPb d p.1)) using 1 <;> funext p <;> dsimp <;> ring let g : γ → ℝ := fun x => ∫ y, W x y * D.armProb e y ∂ν have hg : Integrable g ν := hFP.integral_prod_left have hgm : Measurable g := by exact ((hW.mul ((D.measurable_armProb e).comp measurable_snd)).stronglyMeasurable |>.integral_prod_right').measurable have hslice : ∀ᵐ z ∂ρ, Integrable (fun y => W z.1 y) ν := by have hY : Measurable (observedY D.A D.Y0 D.Y1) := Measurable.ite (measurableSet_eq_fun D.measurable_A measurable_const) D.measurable_Y1 D.measurable_Y0 have hobs : Measurable (fun ω => (D.X ω, D.A ω, observedY D.A D.Y0 D.Y1 ω)) := D.measurable_X.prodMk (D.measurable_A.prodMk hY) have hmarg : ρ.map fst = ν := by dsimp [ρ, ν] rw [D.observedLaw_eq_map, Measure.map_map measurable_fst hobs] rfl have h := hF.prod_right_ae change ∀ᵐ x ∂ν, Integrable (fun y => W x y) ν at h have h' : ∀ᵐ x ∂ρ.map fst, Integrable (fun y => W x y) ν := by rw [hmarg] exact h exact ae_of_ae_map measurable_fst.aemeasurable h' calc _ = ∫ z : γ × Bool × Bool, (∫ t : γ × Bool × Bool, W z.1 t.1 * armIndicator d z.2.1 * armIndicator e t.2.1 ∂ρ) ∂ρ := integral_prod _ hρFF _ = ∫ z : γ × Bool × Bool, g z.1 * armIndicator d z.2.1 ∂ρ := by apply integral_congr_ae filter_upwards [hslice] with z hz calc _ = (∫ t : γ × Bool × Bool, W z.1 t.1 * armIndicator e t.2.1 ∂ρ) * armIndicator d z.2.1 := by rw [← integral_mul_const] congr 1 funext t ring _ = g z.1 * armIndicator d z.2.1 := by rw [integral_observedLaw_weighted_arm D e (W z.1) (hW.comp (measurable_const.prodMk measurable_id)) hz] _ = ∫ x, g x * D.armProb d x ∂ν := integral_observedLaw_weighted_arm D d g hgm hg _ = ∫ p : γ × γ, W p.1 p.2 * D.armProb d p.1 * D.armProb e p.2 ∂(ν.prod ν) := by rw [integral_prod _ hFPP] apply integral_congr_ae filter_upwards with x rw [← integral_mul_const] congr 1 funext y ring -
integral_pair_regressionResidualtheorem — A finite-cell observed table, two treatment arms, pair-eligibility weight, measurability of that weight, and its integrability under the independent covariate-pair law give an arm-regression-centered outcome product with zero two-draw mean.hypothesesΩ :sharedType u_1γ :sharedType u_2d e :W :γ → γ → ℝhW :Measurable fun p : γ × γ => W p.1 p.2hInt :Integrable (fun p : γ × γ => W p.1 p.2) ((μ.map D.X).prod (μ.map D.X))conclusion∫ z : (γ × Bool × Bool) × (γ × Bool × Bool), W z.1.1 z.2.1 * (armIndicator d z.1.2.1 * (boolReal z.1.2.2 - D.mean d z.1.1)) * (armIndicator e z.2.2.1 * (boolReal z.2.2.2 - D.mean e z.2.1)) ∂(D.observedLaw.prod D.observedLaw)= 0Proof (Lean source)
theorem integral_pair_regressionResidual (d e : Bool) (W : γ → γ → ℝ) (hW : Measurable fun p : γ × γ => W p.1 p.2) (hInt : Integrable (fun p : γ × γ => W p.1 p.2) ((μ.map D.X).prod (μ.map D.X))) : ∫ z : (γ × Bool × Bool) × (γ × Bool × Bool), W z.1.1 z.2.1 * (armIndicator d z.1.2.1 * (boolReal z.1.2.2 - D.mean d z.1.1)) * (armIndicator e z.2.2.1 * (boolReal z.2.2.2 - D.mean e z.2.1)) ∂(D.observedLaw.prod D.observedLaw) = 0 := by -- The means lie in [0,1], so the envelope in `integral_pair_centered` -- is bounded by four times |W|. First derive integrability of that envelope -- from `hInt` using `Integrable.mono'`, `D.mean_mem_Icc`, and measurability -- of both regressions. Apply `integral_pair_centered` with -- `c = D.mean d`, `k = D.mean e`; the right integrand vanishes pointwise. have hEnv : Integrable (fun p : γ × γ => |W p.1 p.2| * (1 + |D.mean d p.1|) * (1 + |D.mean e p.2|)) ((μ.map D.X).prod (μ.map D.X)) := by apply Integrable.mono' (hInt.norm.const_mul 4) · exact ((hW.norm.mul (measurable_const.add ((D.measurable_mean d).comp measurable_fst).norm)).mul (measurable_const.add ((D.measurable_mean e).comp measurable_snd).norm)).aestronglyMeasurable · filter_upwards with p rw [Real.norm_eq_abs] have hd : |D.mean d p.1| ≤ (1 : ℝ) := by rw [abs_of_nonneg (D.mean_mem_Icc d p.1).1] exact (D.mean_mem_Icc d p.1).2 have he : |D.mean e p.2| ≤ (1 : ℝ) := by rw [abs_of_nonneg (D.mean_mem_Icc e p.2).1] exact (D.mean_mem_Icc e p.2).2 have hnonneg : 0 ≤ |W p.1 p.2| * (1 + |D.mean d p.1|) * (1 + |D.mean e p.2|) := by positivity rw [abs_of_nonneg hnonneg] have hprod : (1 + |D.mean d p.1|) * (1 + |D.mean e p.2|) ≤ (4 : ℝ) := by nlinarith [abs_nonneg (D.mean d p.1), abs_nonneg (D.mean e p.2)] calc _ ≤ |W p.1 p.2| * 4 := by simpa only [Pi.mul_apply, Real.norm_eq_abs, mul_assoc] using (mul_le_mul_of_nonneg_left hprod (abs_nonneg (W p.1 p.2))) _ = 4 * |W p.1 p.2| := by ring rw [integral_pair_centered D d e W (D.mean d) (D.mean e) hW (D.measurable_mean d) (D.measurable_mean e) hEnv] simp
FiniteCellUStatistic 1 core · 0 supporting For a measurable integrable symmetric pair kernel, each distinct finite-product coordinate pair has the independent two-draw expectation. ★ integral_uStatistic_arm
Mean of an unordered order-two U-statistic
For a measurable integrable symmetric pair kernel, each distinct finite-product coordinate pair has the independent two-draw expectation. Averaging over unordered pairs preserves that mean. The observed finite-cell law can be used as the common marginal, including for localized arm kernels.
A finite-cell observed table, sample size with at least two observations, treatment arm, and symmetric measurable integrable covariate-pair weight W give that the expectation, over n independent draws from the observed law, of the order-two U-statistic with kernel W(X, X′)·1{A = d}·1{A′ = d} equals the integral over independent covariate pairs of W(x, x′)·p_d(x)·p_d(x′), where p_d is the table's arm-d probability.
Formal statement
Proof (Lean source)
FromSCMCondIndep 1 core · 0 supporting This file connects graphical conditional independence in an SCM to counterfactual conditional independence in the potential-outcome system induced by that SCM. ★ ofSCM_condIndepCF_of_dSep
Conditional-Independence Bridge from SCMs to Induced PO Systems
This file connects graphical conditional independence in an SCM to
counterfactual conditional independence in the potential-outcome system induced
by that SCM. The bridge is stated with explicit value-correspondence
hypotheses: consumers identify the PO regimed values with measurable functions
of the SWIG coordinate projections whose d-separation they can prove. The main
theorem, POSystem.ofSCM_condIndepCF_of_dSep, pulls a global-Markov
CondIndepFun statement through the induced-system evaluation map and optional
measurable post-processing of the X- and Y-side values.
SCM-to-PO conditional-independence bridge under d-separation. Fix a structural causal model M with a fixed-value assignment s, and SWIG node sets that are each contained in the model's random variables. Suppose the first node set is d-separated from the second by the third in the model's DAG. Suppose further that there is a measurable value-space map aMap for the first node set and a measurable value-space map BMap for the second node set such that, under the latent draw, the potential-outcome value of a regimed variable a equals aMap applied to the projection of the evaluated model state onto the first node set, the joint value of a counterfactual bundle B equals BMap applied to the projection onto the second node set, and the conditioning value of a regimed variable c equals the projection onto the third node set. Then, in the potential-outcome system induced by M at s, a and B are conditionally independent given c.
Formal statement
Proof (Lean source)
Induce 3 core · 13 supporting This file builds the potential-outcome system induced by restricting attention to a finite set of variables. ★ restrict_consistency
Restricted Potential-Outcome Systems
This file builds the potential-outcome system induced by restricting attention
to a finite set of variables. POSystem.liftRegime embeds regimes on the
restricted variable set back into the ambient system, POSystem.restrict builds
the sub-system itself, and the lift lemmas show that targets, assignments,
empty regimes, disjointness, and Regime.sqcup are preserved. The theorems
POSystem.restrict_consistency and
POSystem.restrict_compositionConsistency show that factual consistency and
composition consistency transfer separately to the restricted system.
For a potential-outcome system, a finite collection of its variables, and an intervention regime on that collection, the lifted intervention regime is the regime on the original variable collection that targets the same variables and assigns each its restricted-regime value.
Definition (Lean source)
For a potential-outcome system and a finite collection of its variables, the restricted potential-outcome system has precisely that collection as its variables, retains the original sample space and probability measure, and evaluates every restricted intervention by lifting it to the original system first.
Definition (Lean source)
Restriction preserves consistency. For a potential-outcome system P and a finite collection R of its variables, if the ambient system is factually consistent, then the system restricted to R is factually consistent as well.
Formal statement
Proof (Lean source)
13 supporting declarations (lemmas, instances)
-
liftRegime_targetlemma — The target of a lifted restricted regime is the image of the restricted target in the original variable set.hypothesesconclusion(P.liftRegime R r').target = r'.target.map ⟨Subtype.val, Subtype.val_injective⟩Proof (Lean source)
@[simp] lemma liftRegime_target (r' : Regime (↥R) (fun v : ↥R => P.X v.val)) : (P.liftRegime R r').target = r'.target.map ⟨Subtype.val, Subtype.val_injective⟩ := rfl -
liftRegime_assignlemma — Reading the lifted assignment at a known sub-regime member returns the original sub-assignment. Membership proofs are propositional, so the ambient hv is irrelevant.hypothesesr' :Regime (↥R) (fun v : ↥R => P.X v.val)w :↥Rhw :w ∈ r'.targethv :(w.val : P.V) ∈ (P.liftRegime R r').targetconclusion(P.liftRegime R r').assign w.val hv = r'.assign w hwProof (Lean source)
lemma liftRegime_assign (r' : Regime (↥R) (fun v : ↥R => P.X v.val)) (w : ↥R) (hw : w ∈ r'.target) (hv : (w.val : P.V) ∈ (P.liftRegime R r').target) : (P.liftRegime R r').assign w.val hv = r'.assign w hw := by change r'.assign ⟨w.val, w.property⟩ _ = r'.assign w hw congr 1 -
liftRegime_emptylemma — Lifting the empty restricted regime gives the empty regime on the original system.hypothesesProof (Lean source)
@[simp] lemma liftRegime_empty : P.liftRegime R (Regime.empty : Regime (↥R) (fun v : ↥R => P.X v.val)) = (Regime.empty : Regime P.V P.X) := by apply Regime.ext · simp [liftRegime_target, Regime.empty] · intro v hv _ simp [liftRegime_target, Regime.empty] at hv -
restrict_Xlemma — The value space in the restricted system is the original value space at the underlying variable.hypothesesconclusion(P.restrict R).X v = P.X v.valProof (Lean source)
@[simp] lemma restrict_X (v : ↥R) : (P.restrict R).X v = P.X v.val := rfl -
restrict_evallemma — Evaluation in the restricted system is evaluation in the original system after lifting the restricted regime.hypothesesconclusion(P.restrict R).eval r' ω v = P.eval (P.liftRegime R r') ω v.valProof (Lean source)
@[simp] lemma restrict_eval (r' : Regime (↥R) (fun v : ↥R => P.X v.val)) (ω : P.Ω) (v : ↥R) : (P.restrict R).eval r' ω v = P.eval (P.liftRegime R r') ω v.val := rfl -
restrict_componentlemma — A coordinate potential outcome in the restricted system agrees with the original coordinate after lifting the regime.hypothesesconclusion(P.restrict R).component r' v = P.component (P.liftRegime R r') v.valProof (Lean source)
@[simp] lemma restrict_component (r' : Regime (↥R) (fun v : ↥R => P.X v.val)) (v : ↥R) : (P.restrict R).component r' v = P.component (P.liftRegime R r') v.val := rfl -
liftRegime_disjointlemma — Disjoint restricted regimes remain disjoint after lifting them to the original system.hypothesesr₁' r₂' :Regime (↥R) (fun v : ↥R => P.X v.val)h :r₁'.Disjoint r₂'conclusion(P.liftRegime R r₁').Disjoint (P.liftRegime R r₂')Proof (Lean source)
lemma liftRegime_disjoint {r₁' r₂' : Regime (↥R) (fun v : ↥R => P.X v.val)} (h : r₁'.Disjoint r₂') : (P.liftRegime R r₁').Disjoint (P.liftRegime R r₂') := by rw [Regime.Disjoint, liftRegime_target, liftRegime_target, Finset.disjoint_left] intro v hv₁ hv₂ rcases Finset.mem_map.mp hv₁ with ⟨w₁, hw₁, rfl⟩ rcases Finset.mem_map.mp hv₂ with ⟨w₂, hw₂, hw₂eq⟩ have : w₁ = w₂ := val_injective hw₂eq.symm subst this exact (Finset.disjoint_left.mp h hw₁) hw₂ -
liftRegime_sqcup_targetlemma — The lift commutes with Regime.sqcup (target equality).hypothesesr₁' r₂' :Regime (↥R) (fun v : ↥R => P.X v.val)h :r₁'.Disjoint r₂'Proof (Lean source)
lemma liftRegime_sqcup_target {r₁' r₂' : Regime (↥R) (fun v : ↥R => P.X v.val)} (h : r₁'.Disjoint r₂') : (P.liftRegime R (r₁'.sqcup r₂' h)).target = (P.liftRegime R r₁').target ∪ (P.liftRegime R r₂').target := by simp [liftRegime_target, Finset.map_union] -
liftRegime_sqcuplemma — The lift commutes with Regime.sqcup (full equality).hypothesesr₁' r₂' :Regime (↥R) (fun v : ↥R => P.X v.val)h :r₁'.Disjoint r₂'conclusionP.liftRegime R (r₁'.sqcup r₂' h)= (P.liftRegime R r₁').sqcup (P.liftRegime R r₂') (P.liftRegime_disjoint R h)Proof (Lean source)
lemma liftRegime_sqcup {r₁' r₂' : Regime (↥R) (fun v : ↥R => P.X v.val)} (h : r₁'.Disjoint r₂') : P.liftRegime R (r₁'.sqcup r₂' h) = (P.liftRegime R r₁').sqcup (P.liftRegime R r₂') (P.liftRegime_disjoint R h) := by apply Regime.ext (P.liftRegime_sqcup_target R h) intro v hv hv2 -- v lies in the lifted union, so v = w.val for some w in r₁' ∪ r₂'. rw [liftRegime_target] at hv rcases Finset.mem_map.mp hv with ⟨w, hwU, rfl⟩ -- Normalize both membership proofs to talk about w.val instead of the -- raw embedding application. have hv1' : (w.val : P.V) ∈ (P.liftRegime R (r₁'.sqcup r₂' h)).target := by rw [liftRegime_target]; exact Finset.mem_map.mpr ⟨w, hwU, rfl⟩ have hv2' : (w.val : P.V) ∈ ((P.liftRegime R r₁').sqcup (P.liftRegime R r₂') (P.liftRegime_disjoint R h)).target := by rw [Regime.sqcup_target] rcases Finset.mem_union.mp hwU with hw | hw · exact mem_union_left _ (Finset.mem_map.mpr ⟨w, hw, rfl⟩) · exact mem_union_right _ (Finset.mem_map.mpr ⟨w, hw, rfl⟩) change (P.liftRegime R (r₁'.sqcup r₂' h)).assign w.val hv1' = ((P.liftRegime R r₁').sqcup (P.liftRegime R r₂') (P.liftRegime_disjoint R h)).assign w.val hv2' rw [P.liftRegime_assign R (r₁'.sqcup r₂' h) w hwU] -- Now goal: (r₁'.sqcup r₂' h).assign w hwU = (sqcup of lifts).assign w.val hv2' by_cases hw1 : w ∈ r₁'.target · have hv_in_lift1 : (w.val : P.V) ∈ (P.liftRegime R r₁').target := Finset.mem_map.mpr ⟨w, hw1, rfl⟩ rw [Regime.sqcup_assign_pos _ _ _ _ hw1, Regime.sqcup_assign_pos _ _ _ _ hv_in_lift1, P.liftRegime_assign R r₁' w hw1] · have hw2 : w ∈ r₂'.target := by rcases Finset.mem_union.mp hwU with hw | hw · exact (hw1 hw).elim · exact hw have hv_not_in_lift1 : (w.val : P.V) ∉ (P.liftRegime R r₁').target := by rw [liftRegime_target] intro hv1 rcases Finset.mem_map.mp hv1 with ⟨w', hw', heq⟩ have : w = w' := Subtype.val_injective heq.symm subst this exact hw1 hw' have hv_in_lift2 : (w.val : P.V) ∈ (P.liftRegime R r₂').target := Finset.mem_map.mpr ⟨w, hw2, rfl⟩ rw [Regime.sqcup_assign_neg _ _ _ _ hw1 hw2, Regime.sqcup_assign_neg _ _ _ _ hv_not_in_lift1 hv_in_lift2, P.liftRegime_assign R r₂' w hw2] -
restrict_compositionConsistencytheorem — Restriction preserves composition consistency. For a potential-outcome system P and a finite collection R of its variables, if the ambient system satisfies composition consistency, then the system restricted to R satisfies composition consistency as well.hypothesesconclusion(P.restrict R).CompositionConsistency where compositionProof (Lean source)
theorem restrict_compositionConsistency (hP : P.CompositionConsistency) : (P.restrict R).CompositionConsistency where composition := by intro r₁' r₂' hd Y hYr ω hag -- Build ambient IntermediateAgrees. have hagP : P.IntermediateAgrees (P.liftRegime R r₁') (P.liftRegime R r₂') ω := by intro v hv rcases Finset.mem_map.mp hv with ⟨w, hw, rfl⟩ have hv' : (w.val : P.V) ∈ (P.liftRegime R r₂').target := hv change P.eval (P.liftRegime R r₁') ω w.val = (P.liftRegime R r₂').assign w.val hv' rw [P.liftRegime_assign R r₂' w hw] exact hag w hw -- Lift Y. set Yamb : Finset P.V := Y.map ⟨Subtype.val, Subtype.val_injective⟩ with hYamb_def have hd_amb : (P.liftRegime R r₁').Disjoint (P.liftRegime R r₂') := P.liftRegime_disjoint R hd have hYr_amb : _root_.Disjoint Yamb ((P.liftRegime R r₁').target ∪ (P.liftRegime R r₂').target) := by rw [hYamb_def, Finset.disjoint_left] intro v hvY hvU rcases Finset.mem_map.mp hvY with ⟨y, hy, rfl⟩ rcases Finset.mem_union.mp hvU with hv | hv · rcases Finset.mem_map.mp hv with ⟨w, hw, hwy⟩ have : y = w := val_injective hwy.symm subst this exact (Finset.disjoint_left.mp hYr hy) (mem_union_left _ hw) · rcases Finset.mem_map.mp hv with ⟨w, hw, hwy⟩ have : y = w := val_injective hwy.symm subst this exact (Finset.disjoint_left.mp hYr hy) (mem_union_right _ hw) have hpv := hP.composition (P.liftRegime R r₁') (P.liftRegime R r₂') hd_amb Yamb hYr_amb ω hagP funext y have hyamb : (y.val.val : P.V) ∈ Yamb := by rw [hYamb_def]; exact Finset.mem_map.mpr ⟨y.val, y.property, rfl⟩ have heq := congrArg (fun f => f ⟨y.val.val, hyamb⟩) hpv change P.eval (P.liftRegime R (r₁'.sqcup r₂' hd)) ω y.val.val = P.eval (P.liftRegime R r₁') ω y.val.val have hsq : P.liftRegime R (r₁'.sqcup r₂' hd) = (P.liftRegime R r₁').sqcup (P.liftRegime R r₂') (P.liftRegime_disjoint R hd) := by exact P.liftRegime_sqcup R hd rw [hsq] exact heq