Estimation.ATT
AIPW/DML estimation of the average treatment effect on the treated (Hahn-form moment), mirroring the ATE development; the top-level theorem files are pending repair against the current Mathlib pin.
Setup 9 core · 7 supporting Defines the treated-estimation system for ATT estimation under back-door assumptions. ★ θ₀_eq_ATT
Defines the treated-estimation system for ATT estimation under back-door assumptions. The structure bundles value-space representatives for the control outcome regression, propensity score, treatment probability, and compatibility fields needed by ATT AIPW moments.
The file introduces TreatedEstimationSystem, derives the control-arm
counterfactual compatibility lemma μ₀_compat, defines the one-sided overlap
predicate OneSidedOverlap, the covariate and data laws P_X and P_Z, the
value-space target θ₀, and proves θ₀_eq_ATT. It also constructs a
TreatedEstimationSystem from a POBackdoorSystem with overlap and an
integrable observed outcome via POBackdoorSystem.toTreatedEstimationSystem.
A treated estimation system extends a potential-outcome back-door system with the value-space nuisance representatives needed for ATT AIPW estimation: the control-arm outcome regression μ₀(x) and a propensity score e(x) that is bounded away from 1, together with the control regression's agreement, almost everywhere, with the σ(X)-measurable observable control regression adjustedCE false, composed with the factual covariate and the analogous agreement of the propensity score with the observable propensity propScore.
Definition (Lean source)
For a potential-outcome system with a measurable covariate space, a treated estimation system, and a real margin, the one-sided overlap condition holds exactly when and the conditional probability of treatment given the covariates is at most almost surely under the population measure.
Definition (Lean source)
For a potential-outcome system with a measurable covariate space and a treated estimation system, the covariate distribution is the image of the population measure under the factual covariate.
Definition (Lean source)
For a potential-outcome system with a measurable covariate space and a treated estimation system, the factual data-recording map sends every population unit to its observed covariate, observed treatment, and observed outcome.
Definition (Lean source)
For a potential-outcome system with a measurable covariate space and a treated estimation system, the joint observable-data distribution is the image of the population measure under the factual map recording covariate, treatment, and outcome.
Definition (Lean source)
For a potential-outcome system with a measurable covariate space and a treated estimation system, the marginal treatment probability is the population probability that the factual treatment equals one.
Definition (Lean source)
For a potential-outcome system with a measurable covariate space and a treated estimation system, the value-space average treatment effect on the treated is the system's adjusted control-regression functional.
Definition (Lean source)
Value-space estimand equals the potential-outcome ATT. Under the one-sided back-door ATT assumptions, the value-space ATT estimand θ₀ (the adjusted control-regression functional) coincides with the average treatment effect on the treated defined on potential outcomes.
Formal statement
Proof (Lean source)
Given a potential-outcome system with a measurable covariate space, a potential-outcome back-door system, the condition that its conditional probability of treatment lies strictly between zero and one almost surely, and an integrable factual outcome, the constructed treated estimation system extends that back-door system with a control-arm outcome regression and a propensity-score representative bounded strictly below one.
Definition (Lean source)
7 supporting declarations (lemmas, instances)
-
control_cate_backdoorlemma — Control-arm backdoor CATE under ATT assumptions. The conditional mean of the untreated potential outcome given the covariates equals the observable control regression when consistency, conditional ignorability, integrability, and one-sided control overlap hold. No treated-arm overlap is used.hypothesesγ :sharedType u_1S :hA :S.toPOBackdoorSystem.ATTAssumptionsProof (Lean source)
lemma control_cate_backdoor (S : TreatedEstimationSystem P γ) (hA : S.toPOBackdoorSystem.ATTAssumptions) : S.toPOBackdoorSystem.CATE false =ᵐ[P.μ] S.toPOBackdoorSystem.adjustedCE false := S.toPOBackdoorSystem.cate_backdoor_of_propScore_ne hA.consistency hA.unconfoundedness hA.integrable_Y1 hA.integrable_Y0 false hA.propScore_false_ne -
propScore_true_nonneg_aelemma — Treated propensity nonnegativity. The conditional treatment probability P[D=1 | X] is nonnegative almost surely because it is the conditional expectation of a nonnegative treatment indicator.hypothesesconclusion∀ᵐ ω ∂P.μ, 0 ≤ S.toPOBackdoorSystem.propScore true ωProof (Lean source)
lemma propScore_true_nonneg_ae (S : TreatedEstimationSystem P γ) : ∀ᵐ ω ∂P.μ, 0 ≤ S.toPOBackdoorSystem.propScore true ω := MeasureTheory.condExp_nonneg (Filter.Eventually.of_forall (fun ω => by rcases S.toPOBackdoorSystem.dVar.indicator_eq_one_or_zero true ω with h | h <;> simp [h])) -
μ₀_compatlemma — Counterfactual compatibility (derived, under ATT identification). The control-arm outcome-regression representative equals the conditional mean of the untreated potential outcome given the covariates, almost surely.hypothesesγ :sharedType u_1S :hA :S.toPOBackdoorSystem.ATTAssumptionsconclusionP.μ[S.toPOBackdoorSystem.YofD false | S.toPOBackdoorSystem.sigmaX]=ᵐ[P.μ] (fun ω => S.μ₀_val (S.toPOBackdoorSystem.factualX ω))Proof (Lean source)
lemma μ₀_compat (S : TreatedEstimationSystem P γ) (hA : S.toPOBackdoorSystem.ATTAssumptions) : P.μ[S.toPOBackdoorSystem.YofD false | S.toPOBackdoorSystem.sigmaX] =ᵐ[P.μ] (fun ω => S.μ₀_val (S.toPOBackdoorSystem.factualX ω)) := (S.control_cate_backdoor hA).trans S.μ₀_reg_compat.symm -
P_X_eqlemma — The covariate marginal is the image of the population measure under the factual covariate map.hypothesesconclusionS.P_X = P.μ.map S.toPOBackdoorSystem.factualXProof (Lean source)
@[causal_defs_simps] lemma P_X_eq (S : TreatedEstimationSystem P γ) : S.P_X = P.μ.map S.toPOBackdoorSystem.factualX := rfl -
measurable_factualZlemma — Measurability of the data triple.hypothesesconclusionMeasurable S.factualZProof (Lean source)
@[fun_prop] lemma measurable_factualZ (S : TreatedEstimationSystem P γ) : Measurable S.factualZ := (S.toPOBackdoorSystem.measurable_factualX).prodMk ((S.toPOBackdoorSystem.measurable_factualD).prodMk S.toPOBackdoorSystem.measurable_factualY) -
P_Z_eqlemma — The joint data law is the image of the population measure under the map recording the observed covariate, treatment, and outcome.hypothesesconclusionS.P_Z = P.μ.map S.factualZProof (Lean source)
@[causal_defs_simps] lemma P_Z_eq (S : TreatedEstimationSystem P γ) : S.P_Z = P.μ.map S.factualZ := rfl -
P_Z_map_projX_eq_P_Xlemma — The covariate marginal P_X is the pushforward of P_Z along the projection (x, a, y) ↦ x. Used to bridge integrals/eLpNorm between P_X (covariates only) and P_Z (full data triple).hypothesesconclusionS.P_Z.map (fun z : γ × Bool × ℝ => z.1) = S.P_XProof (Lean source)
lemma P_Z_map_projX_eq_P_X (S : TreatedEstimationSystem P γ) : S.P_Z.map (fun z : γ × Bool × ℝ => z.1) = S.P_X := by unfold TreatedEstimationSystem.P_Z TreatedEstimationSystem.P_X rw [Measure.map_map (by fun_prop : Measurable (fun z : γ × Bool × ℝ => z.1)) S.measurable_factualZ] rfl
ATTInstance 2 core · 2 supporting Instantiates the abstract orthogonal-moment DML theorem for the average treatment effect on the treated. ★ att_dml_isAsymLinear
Instantiates the abstract orthogonal-moment DML theorem for the average treatment effect on the treated. It connects the ATT AIPW score, remainder identity, score-continuity bounds, and sample-splitting assumptions to asymptotic linearity.
The main declarations are attGeneralMoment, the MeanZero bridge
att_meanZero, the bilinear remainder bridge att_bilinearRem, and the
headline abstract asymptotic-linearity theorem att_dml_isAsymLinear. This
file is the ATT specialization of the general orthogonal-moment interface; the
user-facing estimator wrapper is in Estimation/ATT/DML.lean.
For a potential-outcomes system with a standard Borel sample space and finite probability measure, a measurable covariate space, a treated estimation system, a real overlap radius, the condition that the system's true nuisance vector belongs to its overlap-bounded candidate set at that radius, and the condition that its marginal treatment probability is strictly positive, the ATT augmented inverse-probability-weighted general moment is the general moment whose score is the ATT AIPW score, whose target nuisance vector and target parameter are the system's true nuisance vector and ATT, whose candidate set is that overlap-bounded set, whose two seminorms are the distances between control-outcome regressions and between propensity scores, and whose Jacobian is the negative marginal treatment probability.
Definition (Lean source)
Headline ATT AIPW DML asymptotic-linearity theorem, derived from the abstract dml_chernozhukov_asymptoticLinear in Estimation/OrthogonalMoments/DMLChernozhukov.lean. Fix an estimated-nuisance sequence η_hat, an i.i.d. sample of the data triple, and a one-shot cross-fitting split of that sample. Under membership of the truth nuisance in the overlap-bounded realization set H_ε, nonnegativity of the true propensity, one-sided overlap ε on the true propensity, the one-sided back-door ATT assumptions, a strictly positive marginal treatment probability, square-integrability of the factual outcome and of the untreated potential outcome Y(0), integrability of the truth-side control-arm IPW correction, and a limiting fold-size fraction c strictly between 0 and 1 with the treated-fold cardinality fraction converging to c: if every candidate draw η_hat n ω lies in the overlap-bounded realization set H_ε, every candidate propensity is nonnegative, each candidate control-regression and propensity error admits an L²(P_X) witness, each candidate IPW correction is integrable, the AIPW moment functional is measurable jointly in the probability-space and data arguments, and on each cross-fitting fold, both singly and jointly, the moment at every candidate nuisance is integrable and square-integrable against the observed data law, the control-regression and propensity error rates are individually o_p(1) in L²(P_X), and their product is o_p(n^{-1/2}), then the Chernozhukov one-step DML estimator built from the ATT AIPW moment, the sample, the split, and the candidate nuisance sequence is asymptotically linear at the true ATT θ₀, with influence function ψ(z) = (1/π_T) · aipwMomentATTFunctional η₀ z θ₀.
Formal statement
Proof (Lean source)
2 supporting declarations (lemmas, instances)
-
att_meanZerotheorem — ATT AIPW satisfies MeanZero. Direct repackaging of aipw_mean_zero_ATT from Estimation/ATT/Score/MeanZero.lean.hypothesesγ :sharedType u_1S :ε :ℝhη₀_mem :S.η₀ ∈ H_ε S ε_h_overlap :S.OneSidedOverlap εhA :S.toPOBackdoorSystem.ATTAssumptionshπ_pos :0 < S.π_val_h_y2 :Integrable (fun ω => (S.toPOBackdoorSystem.factualY ω) ^ 2) P.μ_h_y0_2 :Integrable (fun ω => (S.toPOBackdoorSystem.YofD false ω) ^ 2) P.μhIPW :Integrable (fun ω => (1 - S.toPOBackdoorSystem.dVar.indicator true ω) * (S.toPOBackdoorSystem.propScore true ω / (1 - S.toPOBackdoorSystem.propScore true ω)) * (S.toPOBackdoorSystem.factualY ω - S.toPOBackdoorSystem.adjustedCE false ω)) P.μconclusionMeanZero (attGeneralMoment S hη₀_mem hπ_pos)Proof (Lean source)
theorem att_meanZero (S : TreatedEstimationSystem P γ) {ε : ℝ} (hη₀_mem : S.η₀ ∈ H_ε S ε) (_h_overlap : S.OneSidedOverlap ε) (hA : S.toPOBackdoorSystem.ATTAssumptions) (hπ_pos : 0 < S.π_val) (_h_y2 : Integrable (fun ω => (S.toPOBackdoorSystem.factualY ω) ^ 2) P.μ) (_h_y0_2 : Integrable (fun ω => (S.toPOBackdoorSystem.YofD false ω) ^ 2) P.μ) (hIPW : Integrable (fun ω => (1 - S.toPOBackdoorSystem.dVar.indicator true ω) * (S.toPOBackdoorSystem.propScore true ω / (1 - S.toPOBackdoorSystem.propScore true ω)) * (S.toPOBackdoorSystem.factualY ω - S.toPOBackdoorSystem.adjustedCE false ω)) P.μ) : MeanZero (attGeneralMoment S hη₀_mem hπ_pos) := by unfold MeanZero attGeneralMoment exact aipw_mean_zero_ATT S hA hπ_pos hIPW -
att_bilinearRemtheorem — ATT AIPW satisfies BilinearRemainder with constant aipw_rem_const_ATT ε.hypothesesγ :sharedType u_1S :ε :ℝhη₀_mem :S.η₀ ∈ H_ε S εh_overlap :S.OneSidedOverlap εhA :S.toPOBackdoorSystem.ATTAssumptionshπ_pos :0 < S.π_valh_y2 :Integrable (fun ω => (S.toPOBackdoorSystem.factualY ω) ^ 2) P.μh_y0_2 :Integrable (fun ω => (S.toPOBackdoorSystem.YofD false ω) ^ 2) P.μh_L2 :conclusion∃ C, BilinearRemainder (attGeneralMoment S hη₀_mem hπ_pos) CProof (Lean source)
theorem att_bilinearRem (S : TreatedEstimationSystem P γ) {ε : ℝ} (hη₀_mem : S.η₀ ∈ H_ε S ε) (h_overlap : S.OneSidedOverlap ε) (hA : S.toPOBackdoorSystem.ATTAssumptions) (hπ_pos : 0 < S.π_val) (h_y2 : Integrable (fun ω => (S.toPOBackdoorSystem.factualY ω) ^ 2) P.μ) (h_y0_2 : Integrable (fun ω => (S.toPOBackdoorSystem.YofD false ω) ^ 2) P.μ) (h_L2 : ∀ η ∈ H_ε S ε, MemLp (fun x => η.μ₀_fn x - S.μ₀_val x) 2 S.P_X ∧ MemLp (fun x => η.e_fn x - S.e_val x) 2 S.P_X) (h_IPW : ∀ η ∈ H_ε S ε, Integrable (fun z => (1 - indA z) * (η.e_fn (projX z) / (1 - η.e_fn (projX z))) * (projY z - η.μ₀_fn (projX z))) S.P_Z) : ∃ C, BilinearRemainder (attGeneralMoment S hη₀_mem hπ_pos) C := by refine ⟨aipw_rem_const_ATT ε, ?_⟩ intro η hη obtain ⟨hΔμ₀, hΔe⟩ := h_L2 η hη have h := aipw_remainder_bound_ATT S h_overlap hA hπ_pos h_y2 h_y0_2 η hη hΔμ₀ hΔe (h_IPW η hη) change |∫ z, aipwMomentATTFunctional η z S.θ₀ ∂(S.P_Z)| ≤ aipw_rem_const_ATT ε * (eLpNorm (fun x => η.μ₀_fn x - S.μ₀_val x) 2 S.P_X).toReal * (eLpNorm (fun x => η.e_fn x - S.e_val x) 2 S.P_X).toReal exact h
DML 2 core · 2 supporting This file defines the one-shot sample-split augmented inverse-probability weighted estimator for the back-door average treatment effect on the treated and states its asymptotic linearity theorem. ★ dml_ATT_isAsymLinear
Double Machine Learning for ATT
This file defines the one-shot sample-split augmented inverse-probability
weighted estimator for the back-door average treatment effect on the treated
and states its asymptotic linearity theorem. The theorem connects the estimator
to the ATT AIPW influence function under the one-sided ATT back-door assumption
bundle, an additional one-sided upper-overlap bound, second-moment,
sample-split, and nuisance-rate conditions. Parallel to
Estimation/ATE/DML.lean.
The main declarations are dmlEstimator_ATT, the derived influence-function
facts ψ_ATT_integral_zero and ψ_ATT_finite_var, and the production wrapper
dml_ATT_isAsymLinear, which transports the abstract
att_dml_isAsymLinear result to the population-π ATT estimator.
For a potential-outcomes system with a standard Borel sample space and finite probability measure, a measurable covariate space, a treated estimation system, an independent and identically distributed sample of observed covariate, treatment, and outcome triples from that system's observed-data distribution, a one-shot split of that sample, a sequence of control-arm outcome-regression estimators, a sequence of propensity-score estimators, and a sample-size index, the one-shot double-machine-learning estimator of the back-door average treatment effect on the treated is the marginal-treatment-probability-normalized mean, over the split's evaluation fold at that index, of the ATT AIPW score evaluated at zero using the supplied nuisance functions at that index.
Definition (Lean source)
Asymptotic linearity of the one-shot DML ATT — thm:est-dml-att-al. Fix candidate control-regression and propensity estimator sequences μ₀_hat and e_hat, an i.i.d. sample of the data triple, and a one-shot cross-fitting split of that sample. Under the true propensity bounded above by 1 − ε almost everywhere, nonnegativity of the true propensity, one-sided overlap ε on the treated-arm propensity, the one-sided back-door ATT assumptions, a strictly positive marginal treatment probability, square-integrability of the factual outcome and of the untreated potential outcome Y(0), and a limiting fold-size fraction c strictly between 0 and 1 with the treated-fold cardinality fraction converging to c: if the candidate propensity is bounded above by 1 − ε almost everywhere, for every n, ω, the candidate propensity is nonnegative everywhere, the candidate regressions are jointly measurable in the probability-space and covariate arguments, each candidate regression, at every n, ω, is square-integrable against the covariate law, each candidate regression depends only on its own cross-fitting fold, singly and jointly with the covariate, the ATT AIPW moment at every candidate regression pair is integrable and square-integrable against the observed data law, the control-regression and propensity error rates are individually o_p(1) in L²(P_X), and their product is o_p(n^{-1/2}), then the population-π one-shot DML/AIPW ATT estimator is asymptotically linear at the true ATT θ₀, with influence function ψ_ATT, along the sample and the cross-fitting folds.
Formal statement
Proof (Lean source)
2 supporting declarations (lemmas, instances)
-
ψ_ATT_integral_zerotheorem — Mean zero of the centered population-π ATT influence function ψ_ATT.hypothesesγ :sharedType u_1S :ε :ℝh_overlap :S.OneSidedOverlap εhA :S.toPOBackdoorSystem.ATTAssumptionshπ_pos :0 < S.π_valh_y2 :Integrable (fun ω => (S.toPOBackdoorSystem.factualY ω) ^ 2) P.μh_y0_2 :Integrable (fun ω => (S.toPOBackdoorSystem.YofD false ω) ^ 2) P.μhIPW :Integrable (fun ω => (1 - S.toPOBackdoorSystem.dVar.indicator true ω) * (S.toPOBackdoorSystem.propScore true ω / (1 - S.toPOBackdoorSystem.propScore true ω)) * (S.toPOBackdoorSystem.factualY ω - S.toPOBackdoorSystem.adjustedCE false ω)) P.μconclusion∫ z, S.ψ_ATT z ∂(S.P_Z) = 0Proof (Lean source)
theorem ψ_ATT_integral_zero (S : TreatedEstimationSystem P γ) {ε : ℝ} (h_overlap : S.OneSidedOverlap ε) (hA : S.toPOBackdoorSystem.ATTAssumptions) (hπ_pos : 0 < S.π_val) (h_y2 : Integrable (fun ω => (S.toPOBackdoorSystem.factualY ω) ^ 2) P.μ) (h_y0_2 : Integrable (fun ω => (S.toPOBackdoorSystem.YofD false ω) ^ 2) P.μ) (hIPW : Integrable (fun ω => (1 - S.toPOBackdoorSystem.dVar.indicator true ω) * (S.toPOBackdoorSystem.propScore true ω / (1 - S.toPOBackdoorSystem.propScore true ω)) * (S.toPOBackdoorSystem.factualY ω - S.toPOBackdoorSystem.adjustedCE false ω)) P.μ) : ∫ z, S.ψ_ATT z ∂(S.P_Z) = 0 := by haveI : IsProbabilityMeasure S.P_Z := by unfold TreatedEstimationSystem.P_Z exact Measure.isProbabilityMeasure_map S.measurable_factualZ.aemeasurable have hπ_ne : S.π_val ≠ 0 := ne_of_gt hπ_pos have hmz : ∫ z, aipwMomentATT z S.μ₀_val S.e_val S.θ₀ ∂S.P_Z = 0 := aipw_mean_zero_ATT S hA hπ_pos hIPW have hm_meas : Measurable (fun z => aipwMomentATT z S.μ₀_val S.e_val S.θ₀) := measurable_aipwMomentATT_at_θ₀ S have hm_int : Integrable (fun z => aipwMomentATT z S.μ₀_val S.e_val S.θ₀) S.P_Z := ((memLp_two_iff_integrable_sq hm_meas.aestronglyMeasurable).2 (aipw_finite_var_ATT S h_overlap hA h_y2 h_y0_2)).integrable (by norm_num) have hindA_meas : Measurable (fun z : γ × Bool × ℝ => indA z) := by unfold indA projA refine Measurable.ite ?_ measurable_const measurable_const exact measurable_snd.fst (MeasurableSet.singleton true) have hindA_memLp : MemLp (fun z : γ × Bool × ℝ => indA z) 2 S.P_Z := by refine MemLp.of_bound hindA_meas.aestronglyMeasurable (1 : ℝ) ?_ filter_upwards with z rcases hb : z.2.1 with _ | _ <;> simp [indA, projA, hb] have hindA_int : Integrable (fun z : γ × Bool × ℝ => indA z) S.P_Z := hindA_memLp.integrable (by norm_num) have hindA_integral : ∫ z, indA z ∂S.P_Z = S.π_val := by rw [TreatedEstimationSystem.P_Z, integral_map S.measurable_factualZ.aemeasurable hindA_meas.aestronglyMeasurable] have hpt : (fun ω => indA (S.factualZ ω)) = (fun ω => S.toPOBackdoorSystem.dVar.indicator true ω) := by funext ω by_cases hD : S.toPOBackdoorSystem.factualD ω = true · have hInd : S.toPOBackdoorSystem.dVar.indicator true ω = 1 := S.toPOBackdoorSystem.dVar.indicator_apply_eq_one hD simp [TreatedEstimationSystem.factualZ, indA, projA, hD, hInd] · have hInd : S.toPOBackdoorSystem.dVar.indicator true ω = 0 := S.toPOBackdoorSystem.dVar.indicator_apply_eq_zero (x := true) hD simp [TreatedEstimationSystem.factualZ, indA, projA, hD, hInd] rw [hpt] rfl have hsplit : ∀ z, aipwMomentATT z S.μ₀_val S.e_val 0 = aipwMomentATT z S.μ₀_val S.e_val S.θ₀ + indA z * S.θ₀ := by intro z; unfold aipwMomentATT; ring have hm0_int : Integrable (fun z => aipwMomentATT z S.μ₀_val S.e_val 0) S.P_Z := by refine (hm_int.add (hindA_int.mul_const S.θ₀)).congr ?_ filter_upwards with z simp only [Pi.add_apply] rw [hsplit z] have hm0_integral : ∫ z, aipwMomentATT z S.μ₀_val S.e_val 0 ∂S.P_Z = S.θ₀ * S.π_val := by rw [integral_congr_ae (Filter.Eventually.of_forall hsplit)] integral_linearity rw [hmz, zero_add, hindA_integral] ring have hconst : ∫ _z : γ × Bool × ℝ, S.θ₀ ∂S.P_Z = S.θ₀ := by rw [integral_const]; simp unfold TreatedEstimationSystem.ψ_ATT integral_linearity rw [hm0_integral, hconst, one_div, mul_comm S.θ₀ S.π_val, inv_mul_cancel_left₀ hπ_ne, sub_self] -
ψ_ATT_finite_vartheorem — Finite variance of the centered population-π ATT influence function. Integrable ψ_ATT² against P_Z. Derived (not assumed) from aipw_finite_var_ATT (square-integrability of the moment at θ₀) and boundedness of the treatment indicator, via ψ_ATT = (1/π_T)·(m(η₀,·,θ₀) + θ₀·A) − θ₀ ∈ L²(P_Z).hypothesesγ :sharedType u_1S :ε :ℝh_overlap :S.OneSidedOverlap εhA :S.toPOBackdoorSystem.ATTAssumptionsh_y2 :Integrable (fun ω => (S.toPOBackdoorSystem.factualY ω) ^ 2) P.μh_y0_2 :Integrable (fun ω => (S.toPOBackdoorSystem.YofD false ω) ^ 2) P.μconclusionIntegrable (fun z => (S.ψ_ATT z) ^ 2) S.P_ZProof (Lean source)
theorem ψ_ATT_finite_var (S : TreatedEstimationSystem P γ) {ε : ℝ} (h_overlap : S.OneSidedOverlap ε) (hA : S.toPOBackdoorSystem.ATTAssumptions) (h_y2 : Integrable (fun ω => (S.toPOBackdoorSystem.factualY ω) ^ 2) P.μ) (h_y0_2 : Integrable (fun ω => (S.toPOBackdoorSystem.YofD false ω) ^ 2) P.μ) : Integrable (fun z => (S.ψ_ATT z) ^ 2) S.P_Z := by haveI : IsProbabilityMeasure S.P_Z := by unfold TreatedEstimationSystem.P_Z exact Measure.isProbabilityMeasure_map S.measurable_factualZ.aemeasurable have hm_meas : Measurable (fun z => aipwMomentATT z S.μ₀_val S.e_val S.θ₀) := measurable_aipwMomentATT_at_θ₀ S have hm_L2 : MemLp (fun z => aipwMomentATT z S.μ₀_val S.e_val S.θ₀) 2 S.P_Z := (memLp_two_iff_integrable_sq hm_meas.aestronglyMeasurable).2 (aipw_finite_var_ATT S h_overlap hA h_y2 h_y0_2) have hindA_meas : Measurable (fun z : γ × Bool × ℝ => indA z) := by unfold indA projA refine Measurable.ite ?_ measurable_const measurable_const exact measurable_snd.fst (MeasurableSet.singleton true) have hindA_L2 : MemLp (fun z : γ × Bool × ℝ => indA z) 2 S.P_Z := by refine MemLp.of_bound hindA_meas.aestronglyMeasurable (1 : ℝ) ?_ filter_upwards with z rcases hb : z.2.1 with _ | _ <;> simp [indA, projA, hb] have hm0_L2 : MemLp (fun z => aipwMomentATT z S.μ₀_val S.e_val 0) 2 S.P_Z := (hm_L2.add (hindA_L2.const_smul S.θ₀)).ae_eq (Filter.Eventually.of_forall fun z => by simp only [Pi.add_apply, Pi.smul_apply, smul_eq_mul] unfold aipwMomentATT; ring) have hψeq : (fun z => S.ψ_ATT z) = (fun z => (1 / S.π_val) • aipwMomentATT z S.μ₀_val S.e_val 0 - S.θ₀) := by funext z; unfold TreatedEstimationSystem.ψ_ATT; simp only [smul_eq_mul] have hψ_L2 : MemLp (fun z => S.ψ_ATT z) 2 S.P_Z := by rw [hψeq] exact (hm0_L2.const_smul (1 / S.π_val)).sub (memLp_const S.θ₀) exact hψ_L2.integrable_sq