PO.ID.Exact.QTE

Quantile treatment effects (Firpo 2007): backdoor identification of the marginal QTE at level τ — the τ-quantile of the treated potential outcome Y(1) minus that of the control Y(0). DistributionalBackdoor lifts the mean-level backdoor to the whole potential-outcome law via inverse-probability weighting; QuantileEffect adds the quantile layer, identifying the QTE as the difference of the identified laws quantiles.

Distributional­Backdoor 5 core · 7 supporting This file lifts backdoor identification from conditional means to full potential-outcome laws under the Firpo distributional bundle: consistency, unconfoundedness, and two-sided common support. ★ integral_comp_YofD_eq★ cfUnderLaw_eq_ipwLaw

Distributional Backdoor Identification

This file lifts backdoor identification from conditional means to full potential-outcome laws under the Firpo distributional bundle: consistency, unconfoundedness, and two-sided common support. It defines the observable IPW density ipwDensity, the observable reweighted outcome law ipwLaw, and the weaker causal bundle DistributionalAssumptions; Assumptions.toDistributional projects the ordinary ATE backdoor assumptions to this distributional bundle.

The main technical steps are propScore_pos, integral_mul_indicator_eq_integral_mul_propScore, ipwDensity_integrable, and integral_comp_YofD_eq. The theorem cfUnderLaw_eq_ipwLaw identifies the law of Y(d) with the observable IPW law, providing the distributional input for quantile-treatment-effect identification.

def ipwDensity reviewed
Causalean.PO.POBackdoorSystem

For a potential-outcome backdoor system and a treatment arm, the observable inverse-probability-weighting density assigns to each sample point the indicator that its factual treatment equals that arm divided by the conditional probability of that arm given the covariates.

Definition (Lean source)
P :
shared
γ :
Type u_1
shared
S :
shared
d :
ipwDensity S d :
P.Ω → ℝ
fun ω => S.dVar.indicator d ω / S.propScore d ω
def ipwLaw reviewed
Causalean.PO.POBackdoorSystem

For a potential-outcome backdoor system, a treatment arm, and a measure on the sample space, the observable inverse-probability-weighted outcome law is the distribution of the factual outcome under the measure obtained by weighting each sample point by the nonnegative version of its inverse-probability-weighting density for that arm.

Definition (Lean source)
P :
shared
γ :
Type u_1
shared
S :
shared
d :
μ :
Measure P.Ω
ipwLaw S d μ :
(μ.withDensity (fun ω => ofReal (S.ipwDensity d ω))).map S.factualY
structure DistributionalAssumptions reviewed
Causalean.PO.POBackdoorSystem

Distributional backdoor assumptions. Firpo's distributional identification of the potential-outcome law under arm d uses consistency, conditional ignorability of treatment given covariates, and common support. It does not require the outcome-integrability assumptions bundled in the ATE backdoor theorem, because laws and quantiles are defined without first moments.

Definition (Lean source)
P :
shared
γ :
Type u_1
shared
S :
consistency :
P.Consistency

Consistency links the observed outcome to the potential outcome of the realized treatment arm.

unconfoundedness :
P.CondIndepCF (RegimedVar.ofFactual S.dVar) S.cfBundle (RegimedVar.ofFactual S.xVar) P.μ

Conditional ignorability: treatment is independent of (Y(1), Y(0)) given covariates.

overlap :
∀ᵐ ω ∂P.μ, 0 < S.propScore true ω ∧ S.propScore true ω < 1

Common support: both treatment arms have positive conditional probability almost surely.

Causalean.PO.POBackdoorSystem.DistributionalAssumptions · Causalean/PO/ID/Exact/QTE/DistributionalBackdoor.lean:75 · uses POBackdoorSystem , POSystem
lemma integral_comp_YofD_eq reviewed
Causalean.PO.POBackdoorSystem

Core distributional backdoor identity. Under the distributional backdoor assumption bundle, for every treatment arm d and every measurable real function g that is bounded by a constant C, the mean of g applied to the potential outcome Y(d) equals the mean of g applied to the factual outcome, weighted by the inverse-probability-weighting density ipwDensity d.

Formal statement
P :
shared
γ :
Type u_1
shared
S :
shared
hA :
S.DistributionalAssumptions
d :
g :
ℝ → ℝ
hg :
C :
hg_bdd :
∀ y, |g y| ≤ C
∫ ω, g (S.YofD d ω) ∂P.μ = ∫ ω, g (S.factualY ω) * S.ipwDensity d ω ∂P.μ
Proof (Lean source)
lemma integral_comp_YofD_eq [StandardBorelSpace P.Ω] [IsFiniteMeasure P.μ] (hA : S.DistributionalAssumptions) (d : Bool) {g : ℝ → ℝ} (hg : Measurable g) {C : ℝ} (hg_bdd : ∀ y, |g y| ≤ C) : ∫ ω, g (S.YofD d ω) ∂P.μ = ∫ ω, g (S.factualY ω) * S.ipwDensity d ω ∂P.μ := by classical -- Measurability of the composites and the indicator / propensity score. have hgY_meas : Measurable (fun ω => g (S.factualY ω)) := by fun_prop have hgYd_meas : Measurable (fun ω => g (S.YofD d ω)) := by fun_prop have hind_meas : Measurable (S.dVar.indicator d) := by fun_prop have he_sm : StronglyMeasurable[S.sigmaX] (S.propScore d) := by fun_prop have he_pos : ∀ᵐ ω ∂P.μ, 0 < S.propScore d ω := S.propScore_pos hA d have hipw_meas : Measurable (S.ipwDensity d) := by fun_prop have hipw_nn : 0 ≤ᵐ[P.μ] S.ipwDensity d := by filter_upwards [he_pos] with ω hω refine div_nonneg ?_ hω.le rcases S.dVar.indicator_eq_one_or_zero d ω with h | h <;> simp [h] -- Integrability of the pieces (everything bounded by `C`, resp. `C·ipw`). have hgYd_int : Integrable (fun ω => g (S.YofD d ω)) P.μ := (integrable_const C).mono' hgYd_meas.aestronglyMeasurable (Filter.Eventually.of_forall (fun ω => by rw [Real.norm_eq_abs]; exact hg_bdd _)) have prod_int : Integrable (fun ω => S.dVar.indicator d ω * g (S.YofD d ω)) P.μ := (integrable_const C).mono' (hind_meas.mul hgYd_meas).aestronglyMeasurable (Filter.Eventually.of_forall (fun ω => by rw [Real.norm_eq_abs, abs_mul] have h1 : |S.dVar.indicator d ω| ≤ 1 := by rcases S.dVar.indicator_eq_one_or_zero d ω with h | h <;> rw [h] <;> simp calc |S.dVar.indicator d ω| * |g (S.YofD d ω)| ≤ 1 * C := mul_le_mul h1 (hg_bdd _) (abs_nonneg _) zero_le_one _ = C := one_mul _)) have hgYd_ipw_int : Integrable (fun ω => g (S.YofD d ω) * S.ipwDensity d ω) P.μ := by refine ((S.ipwDensity_integrable hA d).const_mul C).mono' (hgYd_meas.mul hipw_meas).aestronglyMeasurable ?_ filter_upwards [hipw_nn] with ω hω rw [Real.norm_eq_abs, abs_mul, abs_of_nonneg hω] exact mul_le_mul_of_nonneg_right (hg_bdd _) hω -- (a) Consistency: `g(Y)·ipw = g(Y(d))·ipw` (agree on `{D=d}`, both `0` off it). have hcons : (fun ω => g (S.factualY ω) * S.ipwDensity d ω) = (fun ω => g (S.YofD d ω) * S.ipwDensity d ω) := by funext ω by_cases hω : ω ∈ S.dVar.event d · have hcf : S.YofD d ω = S.factualY ω := POVar.cf_eq_factual_on_event hA.consistency S.yVar S.dVar d (Ne.symm S.hDY) hω rw [hcf] · have hind0 : S.dVar.indicator d ω = 0 := Set.indicator_of_notMem hω _ simp [POBackdoorSystem.ipwDensity, hind0] rw [hcons] -- (b) Conditional independence `Y(d) ⟂ D | σ(X)`, projected from unconfoundedness. let ψ : (∀ i : Fin S.cfBundle.n, S.cfBundle.type i) → ℝ := fun f => match d with | true => f (0 : Fin 2) | false => f (1 : Fin 2) have hψ_meas : Measurable ψ := by let instCf : ∀ a : Fin 2, MeasurableSpace (S.cfBundle.type a) := fun a => S.cfBundle.inst a cases d with | true => exact measurable_pi_apply (0 : Fin 2) | false => exact measurable_pi_apply (1 : Fin 2) have hYofD_eq : S.YofD d = ψ ∘ S.cfBundle.jointValue := by funext ω; cases d <;> rfl have hCI : CondIndepFun S.sigmaX S.sigmaX_le S.factualD (S.YofD d) P.μ := by have hproj := hA.unconfoundedness.project (ψ := ψ) hψ_meas rw [hYofD_eq]; exact hproj -- The set-indicator packaging `u (factualD ω) = 1_{D=d} ω`. let u : Bool → ℝ := ({d} : Set Bool).indicator (fun _ => (1 : ℝ)) have hu_meas : Measurable u := by fun_prop have hu_eq : (fun ω => u (S.factualD ω)) = S.dVar.indicator d := by funext ω unfold POVar.indicator by_cases h : S.factualD ω = d · have h1 : S.factualD ω ∈ ({d} : Set Bool) := h have h2 : ω ∈ S.dVar.event d := h rw [show u (S.factualD ω) = (1 : ℝ) from Set.indicator_of_mem h1 _, Set.indicator_of_mem h2] · have h1 : S.factualD ω ∉ ({d} : Set Bool) := h have h2 : ω ∉ S.dVar.event d := h rw [show u (S.factualD ω) = (0 : ℝ) from Set.indicator_of_notMem h1 _, Set.indicator_of_notMem h2] -- (★) `E[1_{D=d}·g(Y(d)) | σX] =ᵐ e_d · E[g(Y(d)) | σX]`. have hstar0 := condExp_mul_of_condIndep (μ := P.μ) (m := S.sigmaX) S.sigmaX_le (f := S.factualD) (g := S.YofD d) S.measurable_factualD (S.measurable_YofD d) hCI (u := u) (v := g) hu_meas hg (by rw [hu_eq]; exact S.dVar.integrable_indicator d (measurableSet_singleton d)) hgYd_int (by have e1 : (fun ω => u (S.factualD ω) * g (S.YofD d ω)) = (fun ω => S.dVar.indicator d ω * g (S.YofD d ω)) := by funext ω; rw [congr_fun hu_eq ω] rw [e1]; exact prod_int) have hstar : P.μ[fun ω => S.dVar.indicator d ω * g (S.YofD d ω) | S.sigmaX] =ᵐ[P.μ] P.μ[S.dVar.indicator d | S.sigmaX] * P.μ[fun ω => g (S.YofD d ω) | S.sigmaX] := by have e1 : (fun ω => u (S.factualD ω) * g (S.YofD d ω)) = (fun ω => S.dVar.indicator d ω * g (S.YofD d ω)) := by funext ω; rw [congr_fun hu_eq ω] rw [e1, hu_eq] at hstar0 exact hstar0 -- (c) Pull the `σ(X)`-measurable factor `1/e_d` out and cancel. set k : P.Ω → ℝ := fun ω => 1 / S.propScore d ω with hk_def have hkey : (fun ω => g (S.YofD d ω) * S.ipwDensity d ω) = (fun ω => k ω * (S.dVar.indicator d ω * g (S.YofD d ω))) := by funext ω; simp only [hk_def, POBackdoorSystem.ipwDensity]; ring have kprod_int : Integrable (fun ω => k ω * (S.dVar.indicator d ω * g (S.YofD d ω))) P.μ := by rw [← hkey]; exact hgYd_ipw_int have hk_sm : StronglyMeasurable[S.sigmaX] k := by fun_prop have hfin : P.μ[fun ω => k ω * (S.dVar.indicator d ω * g (S.YofD d ω)) | S.sigmaX] =ᵐ[P.μ] P.μ[fun ω => g (S.YofD d ω) | S.sigmaX] := by have hpull : P.μ[fun ω => k ω * (S.dVar.indicator d ω * g (S.YofD d ω)) | S.sigmaX] =ᵐ[P.μ] (fun ω => k ω * (P.μ[fun ω => S.dVar.indicator d ω * g (S.YofD d ω) | S.sigmaX]) ω) := by have h := MeasureTheory.condExp_mul_of_stronglyMeasurable_left (μ := P.μ) (m := S.sigmaX) (f := k) (g := fun ω => S.dVar.indicator d ω * g (S.YofD d ω)) hk_sm kprod_int prod_int filter_upwards [h] with ω hω; exact hω filter_upwards [hpull, hstar, he_pos] with ω h1 h2 hpos rw [h1] simp only [Pi.mul_apply] at h2 ⊢ rw [h2] have hps : (P.μ[S.dVar.indicator d | S.sigmaX]) ω = S.propScore d ω := rfl rw [hps] simp only [hk_def, one_div] exact inv_mul_cancel_left₀ hpos.ne' _ -- Assemble the integral chain via `∫ φ = ∫ E[φ | σX]`. rw [hkey, ← MeasureTheory.integral_condExp S.sigmaX_le (f := fun ω => g (S.YofD d ω)), ← MeasureTheory.integral_condExp S.sigmaX_le (f := fun ω => k ω * (S.dVar.indicator d ω * g (S.YofD d ω)))] exact MeasureTheory.integral_congr_ae hfin.symm
theorem cfUnderLaw_eq_ipwLaw reviewed
Causalean.PO.POBackdoorSystem

Distributional backdoor identification. Under the distributional backdoor assumption bundle — consistency, unconfoundedness, and common support, for each treatment arm d, the law of the potential outcome Y(d) equals the observable inverse-probability-weighted outcome law ipwLaw d.

Formal statement
P :
shared
γ :
Type u_1
shared
S :
shared
hA :
S.DistributionalAssumptions
d :
S.yVar.cfUnderLaw S.dVar d P.μ = S.ipwLaw d P.μ
Proof (Lean source)
theorem cfUnderLaw_eq_ipwLaw [StandardBorelSpace P.Ω] [IsFiniteMeasure P.μ] (hA : S.DistributionalAssumptions) (d : Bool) : S.yVar.cfUnderLaw S.dVar d P.μ = S.ipwLaw d P.μ := by have hipw_int : Integrable (S.ipwDensity d) P.μ := by fun_prop have hipw_nn : 0 ≤ᵐ[P.μ] S.ipwDensity d := by filter_upwards [S.propScore_pos hA d] with ω hω refine div_nonneg ?_ hω.le rcases S.dVar.indicator_eq_one_or_zero d ω with h | h <;> simp [h] -- Compare the two measures on every measurable set, via the `g = 1_s` transform. refine MeasureTheory.Measure.ext fun s hs => ?_ have hT_meas : MeasurableSet ((S.YofD d) ⁻¹' s) := S.measurable_YofD d hs have hU_meas : MeasurableSet (S.factualY ⁻¹' s) := S.measurable_factualY hs -- Bounded measurable test function `g = 1_s`. set g : ℝ → ℝ := s.indicator (fun _ => (1 : ℝ)) with hg_def have hg_meas : Measurable g := by fun_prop have hg_bdd : ∀ y, |g y| ≤ 1 := by intro y by_cases hy : y ∈ s · simp [hg_def, Set.indicator_of_mem hy] · simp [hg_def, Set.indicator_of_notMem hy] -- `g ∘ Y(d)` and `g ∘ Y · ipw` rewritten as set indicators. have hcompYd : (fun ω => g (S.YofD d ω)) = ((S.YofD d) ⁻¹' s).indicator (fun _ => (1 : ℝ)) := by funext ω rw [hg_def] by_cases hω : S.YofD d ω ∈ s · rw [Set.indicator_of_mem hω, Set.indicator_of_mem (show ω ∈ (S.YofD d) ⁻¹' s from hω)] · rw [Set.indicator_of_notMem hω, Set.indicator_of_notMem (show ω ∉ (S.YofD d) ⁻¹' s from hω)] have hcompY : (fun ω => g (S.factualY ω) * S.ipwDensity d ω) = (S.factualY ⁻¹' s).indicator (S.ipwDensity d) := by funext ω by_cases hω : S.factualY ω ∈ s <;> simp [hg_def, hω] -- Express both sides as a preimage measure / set lintegral. have hLHS : S.yVar.cfUnderLaw S.dVar d P.μ s = P.μ ((S.YofD d) ⁻¹' s) := by change (P.μ.map (S.YofD d)) s = _ exact MeasureTheory.Measure.map_apply (S.measurable_YofD d) hs have hRHS : S.ipwLaw d P.μ s = ∫⁻ ω in (S.factualY ⁻¹' s), ofReal (S.ipwDensity d ω) ∂P.μ := by change ((P.μ.withDensity (fun ω => ofReal (S.ipwDensity d ω))).map S.factualY) s = _ rw [MeasureTheory.Measure.map_apply S.measurable_factualY hs, MeasureTheory.withDensity_apply _ hU_meas] -- Bochner-level identities. have key := S.integral_comp_YofD_eq hA d hg_meas hg_bdd have e_ind_Y : ∫ ω, g (S.factualY ω) * S.ipwDensity d ω ∂P.μ = ∫ ω in (S.factualY ⁻¹' s), S.ipwDensity d ω ∂P.μ := by rw [hcompY]; exact MeasureTheory.integral_indicator hU_meas have e_ind_Yd : ∫ ω, g (S.YofD d ω) ∂P.μ = (P.μ ((S.YofD d) ⁻¹' s)).toReal := by rw [hcompYd, MeasureTheory.integral_indicator hT_meas, MeasureTheory.integral_const, smul_eq_mul, mul_one, MeasureTheory.measureReal_restrict_apply_univ] rfl -- Glue everything through `ofReal`. have hchain : ∫⁻ ω in (S.factualY ⁻¹' s), ofReal (S.ipwDensity d ω) ∂P.μ = P.μ ((S.YofD d) ⁻¹' s) := by rw [← MeasureTheory.ofReal_integral_eq_lintegral_ofReal (hipw_int.restrict) (ae_restrict_of_ae hipw_nn), ← e_ind_Y, ← key, e_ind_Yd, ENNReal.ofReal_toReal (measure_ne_top P.μ _)] rw [hLHS, hRHS] exact hchain.symm
7 supporting declarations (lemmas, instances)
  • toDistributional lemma — The ATE backdoor bundle projects to the weaker distributional bundle.
    P :
    shared
    γ :
    Type u_1
    shared
    S :
    shared
    hA :
    S.Assumptions
    S.DistributionalAssumptions where consistency
    Proof (Lean source)
    lemma Assumptions.toDistributional [StandardBorelSpace P.Ω] [IsFiniteMeasure P.μ] (hA : S.Assumptions) : S.DistributionalAssumptions where consistency := hA.consistency unconfoundedness := hA.unconfoundedness overlap := hA.overlap
    Causalean.PO.POBackdoorSystem.Assumptions.toDistributional · Causalean/PO/ID/Exact/QTE/DistributionalBackdoor.lean:95
  • stronglyMeasurable_propScore lemma — propScore d is σ(X)-strongly-measurable (it is a conditional expectation).
    P :
    shared
    γ :
    Type u_1
    shared
    S :
    shared
    d :
    StronglyMeasurable[S.sigmaX] (S.propScore d)
    Proof (Lean source)
    @[fun_prop] lemma stronglyMeasurable_propScore [StandardBorelSpace P.Ω] [IsFiniteMeasure P.μ] (d : Bool) : StronglyMeasurable[S.sigmaX] (S.propScore d) := S.xVar.stronglyMeasurable_condExpGiven_comap (S.dVar.indicator d)
    Causalean.PO.POBackdoorSystem.stronglyMeasurable_propScore · Causalean/PO/ID/Exact/QTE/DistributionalBackdoor.lean:102
  • measurable_ipwDensity lemma — The observable inverse-probability weight for a treatment arm is a measurable function of the unit.
    P :
    shared
    γ :
    Type u_1
    shared
    S :
    shared
    d :
    Measurable (S.ipwDensity d)
    Proof (Lean source)
    @[fun_prop] lemma measurable_ipwDensity (d : Bool) : Measurable (S.ipwDensity d) := by unfold POBackdoorSystem.ipwDensity fun_prop
    Causalean.PO.POBackdoorSystem.measurable_ipwDensity · Causalean/PO/ID/Exact/QTE/DistributionalBackdoor.lean:109
  • propScore_nonneg lemma — propScore d ≥ 0 a.e. (conditional expectation of a nonnegative function).
    P :
    shared
    γ :
    Type u_1
    shared
    S :
    shared
    d :
    0 ≤ᵐ[P.μ] S.propScore d
    Proof (Lean source)
    lemma propScore_nonneg [StandardBorelSpace P.Ω] [IsFiniteMeasure P.μ] (d : Bool) : 0 ≤ᵐ[P.μ] S.propScore d := condExp_nonneg (Filter.Eventually.of_forall (fun ω => by rcases S.dVar.indicator_eq_one_or_zero d ω with h | h <;> simp [h]))
    Causalean.PO.POBackdoorSystem.propScore_nonneg · Causalean/PO/ID/Exact/QTE/DistributionalBackdoor.lean:116
  • propScore_pos lemma — Under bare overlap, both arms have a.e.-positive propensity score.
    P :
    shared
    γ :
    Type u_1
    shared
    S :
    shared
    hA :
    S.DistributionalAssumptions
    d :
    ∀ᵐ ω ∂P.μ, 0 < S.propScore d ω
    Proof (Lean source)
    lemma propScore_pos [StandardBorelSpace P.Ω] [IsFiniteMeasure P.μ] (hA : S.DistributionalAssumptions) (d : Bool) : ∀ᵐ ω ∂P.μ, 0 < S.propScore d ω := by match d with | true => filter_upwards [hA.overlap] with ω hω; exact hω.1 | false => have hindD : ∀ e : Bool, Integrable (S.dVar.indicator e) P.μ := fun e => S.dVar.integrable_indicator e (measurableSet_singleton e) have hsum_pt : (fun ω => S.dVar.indicator true ω + S.dVar.indicator false ω) = (fun _ : P.Ω => (1:ℝ)) := by funext ω; exact S.dVar.indicator_add_indicator_not ω have hsum : P.μ[fun ω => S.dVar.indicator true ω + S.dVar.indicator false ω | S.sigmaX] =ᵐ[P.μ] (fun _ => (1:ℝ)) := by rw [hsum_pt] condexp_linearity have hadd : P.μ[fun ω => S.dVar.indicator true ω + S.dVar.indicator false ω | S.sigmaX] =ᵐ[P.μ] P.μ[S.dVar.indicator true | S.sigmaX] + P.μ[S.dVar.indicator false | S.sigmaX] := by condexp_linearity [hindD true, hindD false] filter_upwards [hsum, hadd, hA.overlap] with ω h1 h2 hT have heq : S.propScore true ω + S.propScore false ω = 1 := by have hh : P.μ[S.dVar.indicator true | S.sigmaX] ω + P.μ[S.dVar.indicator false | S.sigmaX] ω = 1 := by rw [← Pi.add_apply, ← h2, h1] unfold POBackdoorSystem.propScore; exact hh linarith [hT.2]
    Causalean.PO.POBackdoorSystem.propScore_pos · Causalean/PO/ID/Exact/QTE/DistributionalBackdoor.lean:122
  • integral_mul_indicator_eq_integral_mul_propScore lemma — Conditional-expectation pull-out. For a σ(X)-strongly-measurable h, ∫ h·1_{D=d} dμ = ∫ h·e_d dμ.
    P :
    shared
    γ :
    Type u_1
    shared
    S :
    shared
    d :
    h :
    P.Ω → ℝ
    hh_sm :
    StronglyMeasurable[S.sigmaX] h
    hh_ind_int :
    Integrable (fun ω => h ω * S.dVar.indicator d ω) P.μ
    ∫ ω, h ω * S.dVar.indicator d ω ∂P.μ = ∫ ω, h ω * S.propScore d ω ∂P.μ
    Proof (Lean source)
    lemma integral_mul_indicator_eq_integral_mul_propScore [StandardBorelSpace P.Ω] [IsFiniteMeasure P.μ] (d : Bool) {h : P.Ω → ℝ} (hh_sm : StronglyMeasurable[S.sigmaX] h) (hh_ind_int : Integrable (fun ω => h ω * S.dVar.indicator d ω) P.μ) : ∫ ω, h ω * S.dVar.indicator d ω ∂P.μ = ∫ ω, h ω * S.propScore d ω ∂P.μ := by have hsm' : StronglyMeasurable[comap S.xVar.factual inferInstance] h := by fun_prop -- `μ[h·1_{D=d} | σX] =ᵐ h · μ[1_{D=d} | σX] = h · e_d` (pull out the σX-meas factor `h`). have key : (fun ω => S.xVar.condExpGiven (fun ω => h ω * S.dVar.indicator d ω) P.μ ω) =ᵐ[P.μ] (fun ω => h ω * S.propScore d ω) := S.xVar.condExpGiven_mul_of_stronglyMeasurable_left (f := h) (g := S.dVar.indicator d) hsm' hh_ind_int (S.dVar.integrable_indicator d (measurableSet_singleton d)) -- `∫ h·1_{D=d} = ∫ μ[h·1_{D=d}|σX]` then rewrite by `key`. have hint : ∫ ω, h ω * S.dVar.indicator d ω ∂P.μ = ∫ ω, S.xVar.condExpGiven (fun ω => h ω * S.dVar.indicator d ω) P.μ ω ∂P.μ := by unfold POVar.condExpGiven exact (MeasureTheory.integral_condExp S.xVar.comap_factual_le).symm rw [hint] exact MeasureTheory.integral_congr_ae key
    Causalean.PO.POBackdoorSystem.integral_mul_indicator_eq_integral_mul_propScore · Causalean/PO/ID/Exact/QTE/DistributionalBackdoor.lean:150
  • ipwDensity_integrable lemma — Integrability of the IPW weight under bare common support.
    P :
    shared
    γ :
    Type u_1
    shared
    S :
    shared
    hA :
    S.DistributionalAssumptions
    d :
    Integrable (S.ipwDensity d) P.μ
    Proof (Lean source)
    @[fun_prop] lemma ipwDensity_integrable [StandardBorelSpace P.Ω] [IsFiniteMeasure P.μ] (hA : S.DistributionalAssumptions) (d : Bool) : Integrable (S.ipwDensity d) P.μ := by have hmeas : Measurable (S.ipwDensity d) := by fun_prop have he_sm : StronglyMeasurable[S.sigmaX] (S.propScore d) := by fun_prop have he_meas : Measurable (S.propScore d) := by fun_prop have he_pos : ∀ᵐ ω ∂P.μ, 0 < S.propScore d ω := S.propScore_pos hA d -- the truncations set f : ℕ → P.Ω → ℝ := S.ipwTrunc d with hf -- `min n (1/e_d)` is σX-strongly-measurable. have hmin_sm : ∀ n : ℕ, StronglyMeasurable[S.sigmaX] (fun ω => min (n : ℝ) (1 / S.propScore d ω)) := by intro n fun_prop -- measurability of each `f n`. have hf_meas : ∀ n, Measurable (f n) := by intro n rw [hf] exact (S.dVar.measurable_indicator d (measurableSet_singleton d)).mul (measurable_const.min (measurable_const.div he_meas)) -- each `f n` is bounded by `n` a.e., hence integrable. have hf_int : ∀ n, Integrable (f n) P.μ := by intro n refine (integrable_const (n : ℝ)).mono' (hf_meas n).aestronglyMeasurable ?_ filter_upwards [he_pos] with ω hω rw [hf] change ‖S.dVar.indicator d ω * min (n : ℝ) (1 / S.propScore d ω)‖ ≤ (n : ℝ) rw [Real.norm_eq_abs, abs_mul] have h1 : |S.dVar.indicator d ω| ≤ 1 := by rcases S.dVar.indicator_eq_one_or_zero d ω with h | h <;> rw [h] <;> simp have hmn : 0 ≤ min (n : ℝ) (1 / S.propScore d ω) := le_min (Nat.cast_nonneg n) (le_of_lt (one_div_pos.mpr hω)) have h2 : |min (n : ℝ) (1 / S.propScore d ω)| ≤ (n : ℝ) := by rw [abs_of_nonneg hmn]; exact min_le_left _ _ calc |S.dVar.indicator d ω| * |min (n : ℝ) (1 / S.propScore d ω)| ≤ 1 * (n : ℝ) := mul_le_mul h1 h2 (abs_nonneg _) zero_le_one _ = (n : ℝ) := one_mul _ -- monotone in `n`. have hf_mono : ∀ᵐ ω ∂P.μ, Monotone fun n => f n ω := by filter_upwards with ω intro a b hab simp only [hf, POBackdoorSystem.ipwTrunc] rcases S.dVar.indicator_eq_one_or_zero d ω with h | h · rw [h] exact mul_le_mul_of_nonneg_left (min_le_min (Nat.cast_le.mpr hab) le_rfl) zero_le_one · rw [h]; simp -- a.e. convergence `f n ω → ipwDensity d ω`. have hf_tend : ∀ᵐ ω ∂P.μ, Tendsto (fun n => f n ω) atTop (nhds (S.ipwDensity d ω)) := by filter_upwards [he_pos] with ω hω have hfω : (fun n => f n ω) = (fun n : ℕ => S.dVar.indicator d ω * min (n : ℝ) (1 / S.propScore d ω)) := rfl have hd : S.ipwDensity d ω = S.dVar.indicator d ω * (1 / S.propScore d ω) := by rw [POBackdoorSystem.ipwDensity, div_eq_mul_one_div] rw [hfω, hd] have hev : (fun n : ℕ => min (n : ℝ) (1 / S.propScore d ω)) =ᶠ[atTop] (fun _ => 1 / S.propScore d ω) := by filter_upwards [(tendsto_natCast_atTop_atTop (R := ℝ)).eventually_ge_atTop (1 / S.propScore d ω)] with n hn exact min_eq_right hn exact (((Filter.tendsto_congr' hev).mpr tendsto_const_nhds).const_mul (S.dVar.indicator d ω)) -- nonnegativity of `f n` and of `ipwDensity d`. have hf_nn : ∀ n, 0 ≤ᵐ[P.μ] f n := by intro n; filter_upwards [he_pos] with ω hω rw [hf] refine mul_nonneg ?_ (le_min (Nat.cast_nonneg n) (le_of_lt (one_div_pos.mpr hω))) rcases S.dVar.indicator_eq_one_or_zero d ω with h | h <;> rw [h]; norm_num have hnn : 0 ≤ᵐ[P.μ] S.ipwDensity d := by filter_upwards [he_pos] with ω hω refine div_nonneg ?_ (le_of_lt hω) rcases S.dVar.indicator_eq_one_or_zero d ω with h | h <;> rw [h]; norm_num -- per-`n` integral bound `∫ f n ≤ 1`, via pull-out and `g n = min n (1/e_d)·e_d ≤ 1`. have hf_bd : ∀ n, ∫ ω, f n ω ∂P.μ ≤ 1 := by intro n have hcomm : (fun ω => f n ω) = (fun ω => min (n : ℝ) (1 / S.propScore d ω) * S.dVar.indicator d ω) := by funext ω; simp only [hf, POBackdoorSystem.ipwTrunc]; ring have hpull := S.integral_mul_indicator_eq_integral_mul_propScore d (hmin_sm n) (by rw [← hcomm]; exact hf_int n) have hg_int : Integrable (fun ω => min (n : ℝ) (1 / S.propScore d ω) * S.propScore d ω) P.μ := by refine (integrable_const (1 : ℝ)).mono' ((measurable_const.min (measurable_const.div he_meas)).mul he_meas).aestronglyMeasurable ?_ filter_upwards [he_pos] with ω hω have h0 : 0 ≤ min (n : ℝ) (1 / S.propScore d ω) * S.propScore d ω := mul_nonneg (le_min (Nat.cast_nonneg n) (le_of_lt (one_div_pos.mpr hω))) (le_of_lt hω) rw [Real.norm_eq_abs, abs_of_nonneg h0] calc min (n : ℝ) (1 / S.propScore d ω) * S.propScore d ω ≤ (1 / S.propScore d ω) * S.propScore d ω := mul_le_mul_of_nonneg_right (min_le_right _ _) (le_of_lt hω) _ = 1 := by field_simp calc ∫ ω, f n ω ∂P.μ = ∫ ω, min (n : ℝ) (1 / S.propScore d ω) * S.dVar.indicator d ω ∂P.μ := by rw [hcomm] _ = ∫ ω, min (n : ℝ) (1 / S.propScore d ω) * S.propScore d ω ∂P.μ := hpull _ ≤ ∫ _ω, (1 : ℝ) ∂P.μ := by refine integral_mono_ae hg_int (integrable_const 1) ?_ filter_upwards [he_pos] with ω hω calc min (n : ℝ) (1 / S.propScore d ω) * S.propScore d ω ≤ (1 / S.propScore d ω) * S.propScore d ω := mul_le_mul_of_nonneg_right (min_le_right _ _) (le_of_lt hω) _ = 1 := by field_simp _ = 1 := by simp -- `HasFiniteIntegral` via the ENNReal lintegral bound `∫⁻ ofReal (ipwDensity) ≤ 1 < ∞`. refine ⟨hmeas.aestronglyMeasurable, ?_⟩ rw [hasFiniteIntegral_iff_ofReal hnn] -- monotone convergence `∫⁻ ofReal (f n) → ∫⁻ ofReal (ipwDensity d)`. have htends : Tendsto (fun n => ∫⁻ ω, ofReal (f n ω) ∂P.μ) atTop (nhds (∫⁻ ω, ofReal (S.ipwDensity d ω) ∂P.μ)) := by refine lintegral_tendsto_of_tendsto_of_monotone (fun n => (ENNReal.measurable_ofReal.comp (hf_meas n)).aemeasurable) ?_ ?_ · filter_upwards [hf_mono] with ω hmono a b hab exact ENNReal.ofReal_le_ofReal (hmono hab) · filter_upwards [hf_tend] with ω htend exact (ENNReal.continuous_ofReal.tendsto _).comp htend -- each `∫⁻ ofReal (f n) = ofReal (∫ f n) ≤ 1`. have hbound : ∀ n, ∫⁻ ω, ofReal (f n ω) ∂P.μ ≤ 1 := by intro n rw [← ofReal_integral_eq_lintegral_ofReal (hf_int n) (hf_nn n)] exact ENNReal.ofReal_le_one.mpr (hf_bd n) exact lt_of_le_of_lt (le_of_tendsto' htends hbound) ENNReal.one_lt_top
    Causalean.PO.POBackdoorSystem.ipwDensity_integrable · Causalean/PO/ID/Exact/QTE/DistributionalBackdoor.lean:178
Quantile­Effect 4 core · 1 supporting This file identifies the totalized generalized-quantile version of the marginal quantile treatment effect. ★ qte_eq_of_law_eq★ qte_backdoor

Quantile Treatment Effect

This file identifies the totalized generalized-quantile version of the marginal quantile treatment effect. It defines qtdQuantile, the arm-specific quantile of Y(d), and qte, the difference between the treatment and control quantiles for any real level τ.

The theorem qte_eq_of_law_eq is the assumption-free functional step: if the two potential-outcome laws are identified by measures ν₁ and ν₀, then QTE is the difference of their quantiles. The theorem qte_backdoor supplies the causal backdoor corollary by using cfUnderLaw_eq_ipwLaw from DistributionalBackdoor to identify those two laws with observable IPW laws.

def qtdQuantile reviewed
Causalean.PO.POBackdoorSystem

For a potential-outcomes backdoor system, a treatment arm, a measure on its sample space, and a real quantile level, the arm-specific potential-outcome quantile is the generalized τ\tau-quantile of the potential outcome under that treatment arm, evaluated under that measure.

Definition (Lean source)
P :
shared
γ :
Type u_1
shared
S :
shared
d :
μ :
Measure P.Ω
τ :
qtdQuantile S d μ τ :
S.yVar.cfUnderQuantile S.dVar d μ τ
Causalean.PO.POBackdoorSystem.qtdQuantile · Causalean/PO/ID/Exact/QTE/QuantileEffect.lean:72 · uses POBackdoorSystem , POSystem
def qte reviewed
Causalean.PO.POBackdoorSystem

For a potential-outcomes backdoor system, a measure on its sample space, and a real quantile level, the totalized quantile treatment effect is the generalized τ\tau-quantile of the treated potential outcome minus that of the control potential outcome. It is defined for every real τ\tau.

Definition (Lean source)
P :
shared
γ :
Type u_1
shared
S :
shared
μ :
Measure P.Ω
τ :
qte S μ τ :
S.qtdQuantile true μ τ - S.qtdQuantile false μ τ
theorem qte_eq_of_law_eq reviewed
Causalean.PO.POBackdoorSystem

QTE as a functional of the identified potential-outcome laws. If the law of the potential outcome Y(1) equals a given observable measure ν₁ and the law of the potential outcome Y(0) equals a given observable measure ν₀, then for every real quantile level τ, the totalized quantile treatment effect equals the difference of the τ-quantiles of ν₁ and ν₀. This is the payoff of the quantile layer: identification of the QTE reduces to distributional identification of the two potential-outcome laws.

Formal statement
P :
shared
γ :
Type u_1
shared
S :
shared
μ :
Measure P.Ω
τ :
ν₁ ν₀ :
h₁ :
S.yVar.cfUnderLaw S.dVar true μ = ν₁
h₀ :
S.yVar.cfUnderLaw S.dVar false μ = ν₀
S.qte μ τ = quantile ν₁ τ - quantile ν₀ τ
Proof (Lean source)
theorem qte_eq_of_law_eq (μ : Measure P.Ω) (τ : ℝ) {ν₁ ν₀ : Measure ℝ} (h₁ : S.yVar.cfUnderLaw S.dVar true μ = ν₁) (h₀ : S.yVar.cfUnderLaw S.dVar false μ = ν₀) : S.qte μ τ = quantile ν₁ τ - quantile ν₀ τ := by unfold qte rw [S.qtdQuantile_eq_quantile_cfUnderLaw true μ τ, S.qtdQuantile_eq_quantile_cfUnderLaw false μ τ, h₁, h₀]
theorem qte_backdoor reviewed
Causalean.PO.POBackdoorSystem

Backdoor QTE identification. Under the ATE backdoor identifying assumption bundle, the totalized generalized-quantile treatment effect at any real level τ equals the difference of the quantiles of the two observable inverse-probability-weighted outcome laws:

Formal statement
P :
shared
γ :
Type u_1
shared
S :
shared
hA :
S.Assumptions
τ :
S.qte P.μ τ
= quantile (S.ipwLaw true P.μ) τ
- quantile (S.ipwLaw false P.μ) τ
Proof (Lean source)
theorem qte_backdoor [StandardBorelSpace P.Ω] [IsFiniteMeasure P.μ] (hA : S.Assumptions) (τ : ℝ) : S.qte P.μ τ = quantile (S.ipwLaw true P.μ) τ - quantile (S.ipwLaw false P.μ) τ := S.qte_eq_of_law_eq P.μ τ (S.cfUnderLaw_eq_ipwLaw hA.toDistributional true) (S.cfUnderLaw_eq_ipwLaw hA.toDistributional false)
1 supporting declaration (lemmas, instances)