Estimation.DTR
DML estimation for dynamic treatment regimes: the two-period AIPW moment, remainder identities and bounds, and the asymptotic-linearity theorem.
Setup 9 core · 7 supporting This file defines the data layer for two-stage dynamic treatment regime estimation: the estimation-system structure, observable regression targets, stagewise overlap, history marginals, the observed data law, and the val ★ θ₀_eq_dtrEffect
Two-Stage DTR Estimation Setup
This file defines the data layer for two-stage dynamic treatment regime estimation: the estimation-system structure, observable regression targets, stagewise overlap, history marginals, the observed data law, and the value-space target estimand. The target is the fixed-regime mean, and the observable compatibility fields are the value-space representatives used by the sequential AIPW score.
This module is specialized to horizon two, with a discrete treatment space so that target-regime equality indicators are measurable.
This structure extends a two-stage potential-outcome dynamic-treatment-regime system with, at a fixed target regime, measurable value-space representatives of the stage-0 and stage-1 outcome regressions and of the propensities at both stages, bounded away from zero and one, each required to agree almost surely with the corresponding observable conditional regression or propensity built from the factual treatment and covariate history.
Definition (Lean source)
This is the observable stage-1 regression of the outcome within the target final treatment arm.
Definition (Lean source)
This predicate requires both stagewise target-regime propensities to stay uniformly away from zero and one.
Definition (Lean source)
This is the marginal law of the stage-0 history.
Definition (Lean source)
This is the marginal law of the stage-1 history in the DTR history ordering.
Definition (Lean source)
This map collects the full observed two-stage data tuple from the underlying outcome system.
Definition (Lean source)
This is the joint law of the full observed two-stage data tuple.
Definition (Lean source)
This is the fixed-regime mean outcome targeted by the two-stage DTR estimation system.
Definition (Lean source)
For a two-stage dynamic treatment regime estimation system, its value-space DTR estimand θ₀ equals the potential-outcome DTR effect evaluated at the chosen regime dbar.
Formal statement
Proof (Lean source)
7 supporting declarations (lemmas, instances)
-
μ₀_compatlemma — The stage-0 value-space regression equals the counterfactual stage-0 regression under identification.hypothesesS :DTREstimationSystem P δ γhA :S.toPODTRSystem.Assumptionsconclusion(S.toPODTRSystem.historyBundle 0 (by decide)).condExpGiven (S.toPODTRSystem.Y_of S.dbar) P.μ=ᵐ[P.μ] (fun ω => S.μ₀_val (S.toPODTRSystem.factualS ⟨0, by decide⟩ ω))Proof (Lean source)
lemma μ₀_compat (S : DTREstimationSystem P δ γ) (hA : S.toPODTRSystem.Assumptions) : (S.toPODTRSystem.historyBundle 0 (by decide)).condExpGiven (S.toPODTRSystem.Y_of S.dbar) P.μ =ᵐ[P.μ] (fun ω => S.μ₀_val (S.toPODTRSystem.factualS ⟨0, by decide⟩ ω)) := (S.toPODTRSystem.cdtr_backdoor hA S.dbar (by decide)).trans S.μ₀_reg_compat.symm -
μ₁_val_comp_eq_stageOneReglemma — The stage-1 value-space regression agrees almost everywhere with the observable stage-1 regression.hypothesesS :DTREstimationSystem P δ γconclusion(fun ω => S.μ₁_val (S.toPODTRSystem.factualS ⟨1, by decide⟩ ω, S.toPODTRSystem.factualD ⟨0, by decide⟩ ω, S.toPODTRSystem.factualS ⟨0, by decide⟩ ω))=ᵐ[P.μ] S.stageOneRegProof (Lean source)
lemma μ₁_val_comp_eq_stageOneReg (S : DTREstimationSystem P δ γ) : (fun ω => S.μ₁_val (S.toPODTRSystem.factualS ⟨1, by decide⟩ ω, S.toPODTRSystem.factualD ⟨0, by decide⟩ ω, S.toPODTRSystem.factualS ⟨0, by decide⟩ ω)) =ᵐ[P.μ] S.stageOneReg := S.μ₁_reg_compat -
stageOneReg_indD_eqlemma — On the regime-consistent path, the observable stage-1 regression agrees with the counterfactual stage-1 regression.hypothesesS :DTREstimationSystem P δ γhA :S.toPODTRSystem.Assumptionsconclusion(fun ω => S.stageOneReg ω * S.toPODTRSystem.indD S.dbar 1 ω)=ᵐ[P.μ] (fun ω => S.toPODTRSystem.indD S.dbar 1 ω * (S.toPODTRSystem.historyBundle 1 (by decide)).condExpGiven (S.toPODTRSystem.Y_of S.dbar) P.μ ω)Proof (Lean source)
lemma stageOneReg_indD_eq (S : DTREstimationSystem P δ γ) (hA : S.toPODTRSystem.Assumptions) : (fun ω => S.stageOneReg ω * S.toPODTRSystem.indD S.dbar 1 ω) =ᵐ[P.μ] (fun ω => S.toPODTRSystem.indD S.dbar 1 ω * (S.toPODTRSystem.historyBundle 1 (by decide)).condExpGiven (S.toPODTRSystem.Y_of S.dbar) P.μ ω) := by let T := S.toPODTRSystem let kLast : Fin 2 := ⟨1, by decide⟩ let I1 : P.Ω → ℝ := (T.dVar kLast).indicator (S.dbar kLast) let B := T.historyBundle 1 (by decide) have hFactor : T.indD S.dbar 2 = fun ω => T.indD S.dbar 1 ω * I1 ω := by simpa [T, I1, kLast] using T.indD_factor_split S.dbar 1 (by decide) have hYI_int : Integrable (fun ω => T.factualY ω * I1 ω) P.μ := by simpa [T, I1, kLast] using (T.dVar kLast).integrable_mul_indicator (S.dbar kLast) (measurableSet_singleton (S.dbar kLast)) hA.integrable_factualY have hYindD2_int : Integrable (fun ω => T.factualY ω * T.indD S.dbar 2 ω) P.μ := by refine hA.integrable_factualY.mono (T.measurable_factualY.mul (T.measurable_indD S.dbar 2)).aestronglyMeasurable ?_ refine Filter.Eventually.of_forall (fun ω => ?_) rcases T.indD_eq_zero_or_one S.dbar 2 ω with h0 | h1 · simp [T, h0] · simp [T, h1] have hprodY_int : Integrable (T.indD S.dbar 1 * fun ω => T.factualY ω * I1 ω) P.μ := by have hfun : (T.indD S.dbar 1 * fun ω => T.factualY ω * I1 ω) = fun ω => T.factualY ω * T.indD S.dbar 2 ω := by funext ω change T.indD S.dbar 1 ω * (T.factualY ω * I1 ω) = T.factualY ω * T.indD S.dbar 2 ω rw [hFactor] ring rw [hfun] exact hYindD2_int have hI1_int : Integrable I1 P.μ := by simpa [T, I1, kLast] using (T.dVar kLast).integrable_indicator (S.dbar kLast) have hindD2_int : Integrable (T.indD S.dbar 2) P.μ := T.indD_integrable S.dbar 2 have hprodI_int : Integrable (T.indD S.dbar 1 * I1) P.μ := by have hfun : (T.indD S.dbar 1 * I1) = T.indD S.dbar 2 := by funext ω change T.indD S.dbar 1 ω * I1 ω = T.indD S.dbar 2 ω rw [hFactor] rw [hfun] exact hindD2_int have hindD1_sm : StronglyMeasurable[B.sigma] (T.indD S.dbar 1) := by simpa [T, B] using T.stronglyMeasurable_indD_sigma_history 1 (by decide) S.dbar 1 (le_refl 1) have hNum_pull : B.condExpGiven (fun ω => T.factualY ω * T.indD S.dbar 2 ω) P.μ =ᵐ[P.μ] (fun ω => T.indD S.dbar 1 ω * B.condExpGiven (fun ω => T.factualY ω * I1 ω) P.μ ω) := by have hpull := B.condExpGiven_mul_of_stronglyMeasurable_left (f := T.indD S.dbar 1) (g := fun ω => T.factualY ω * I1 ω) hindD1_sm hprodY_int hYI_int have harg : (fun ω => T.factualY ω * T.indD S.dbar 2 ω) = fun ω => T.indD S.dbar 1 ω * (T.factualY ω * I1 ω) := by funext ω rw [hFactor] ring rw [harg] filter_upwards [hpull] with ω hω exact hω have hDen_pull : B.condExpGiven (T.indD S.dbar 2) P.μ =ᵐ[P.μ] (fun ω => T.indD S.dbar 1 ω * B.condExpGiven I1 P.μ ω) := by have hpull := B.condExpGiven_mul_of_stronglyMeasurable_left (f := T.indD S.dbar 1) (g := I1) hindD1_sm hprodI_int hI1_int have harg : T.indD S.dbar 2 = T.indD S.dbar 1 * I1 := by funext ω rw [hFactor] rfl rw [harg] filter_upwards [hpull] with ω hω simpa [Pi.mul_apply] using hω have hbridge : (fun ω => S.stageOneReg ω * T.indD S.dbar 1 ω) =ᵐ[P.μ] (fun ω => T.innerReg S.dbar 0 ω * T.indD S.dbar 1 ω) := by have hover := hA.overlap S.dbar kLast filter_upwards [hNum_pull, hDen_pull, hover] with ω hN hD hov have hstage : S.stageOneReg ω = B.condExpGiven (fun ω => T.factualY ω * I1 ω) P.μ ω / B.condExpGiven I1 P.μ ω := by rfl have hinner : T.innerReg S.dbar 0 ω = B.condExpGiven (fun ω => T.factualY ω * T.indD S.dbar 2 ω) P.μ ω / B.condExpGiven (T.indD S.dbar 2) P.μ ω := by unfold PODTRSystem.innerReg simp only [Nat.ofNat_pos, ↓reduceDIte] rfl rw [hstage, hinner, hN, hD] rcases T.indD_eq_zero_or_one S.dbar 1 ω with h0 | h1 · simp [h0] · have hne : B.condExpGiven I1 P.μ ω ≠ 0 := by intro hzero rw [hzero] at hov linarith rw [h1] field_simp [hne] have hbase := T.cdtr_base hA S.dbar (by decide : 0 < 2) exact hbridge.trans (by simpa [T, B] using hbase) -
μ₁_val_comp_mul_indD_eqlemma — Composed observable μ₁_val, multiplied by the partial regime indicator indD dbar 1, agrees with the corresponding counterfactual conditional expectation. This is the consumer-facing form of stageOneReg_indD_eq.hypothesesS :DTREstimationSystem P δ γhA :S.toPODTRSystem.Assumptionsconclusion(fun ω => S.μ₁_val (S.toPODTRSystem.factualS ⟨1, by decide⟩ ω, S.toPODTRSystem.factualD ⟨0, by decide⟩ ω, S.toPODTRSystem.factualS ⟨0, by decide⟩ ω) * S.toPODTRSystem.indD S.dbar 1 ω)=ᵐ[P.μ] (fun ω => S.toPODTRSystem.indD S.dbar 1 ω * (S.toPODTRSystem.historyBundle 1 (by decide)).condExpGiven (S.toPODTRSystem.Y_of S.dbar) P.μ ω)Proof (Lean source)
lemma μ₁_val_comp_mul_indD_eq (S : DTREstimationSystem P δ γ) (hA : S.toPODTRSystem.Assumptions) : (fun ω => S.μ₁_val (S.toPODTRSystem.factualS ⟨1, by decide⟩ ω, S.toPODTRSystem.factualD ⟨0, by decide⟩ ω, S.toPODTRSystem.factualS ⟨0, by decide⟩ ω) * S.toPODTRSystem.indD S.dbar 1 ω) =ᵐ[P.μ] (fun ω => S.toPODTRSystem.indD S.dbar 1 ω * (S.toPODTRSystem.historyBundle 1 (by decide)).condExpGiven (S.toPODTRSystem.Y_of S.dbar) P.μ ω) := by filter_upwards [S.μ₁_val_comp_eq_stageOneReg, S.stageOneReg_indD_eq hA] with ω hμ hstage rw [hμ] exact hstage -
indD_mul_μ₁_val_comp_eqlemma — Same as μ₁_val_comp_mul_indD_eq, with the partial regime indicator written on the left.hypothesesS :DTREstimationSystem P δ γhA :S.toPODTRSystem.Assumptionsconclusion(fun ω => S.toPODTRSystem.indD S.dbar 1 ω * S.μ₁_val (S.toPODTRSystem.factualS ⟨1, by decide⟩ ω, S.toPODTRSystem.factualD ⟨0, by decide⟩ ω, S.toPODTRSystem.factualS ⟨0, by decide⟩ ω))=ᵐ[P.μ] (fun ω => S.toPODTRSystem.indD S.dbar 1 ω * (S.toPODTRSystem.historyBundle 1 (by decide)).condExpGiven (S.toPODTRSystem.Y_of S.dbar) P.μ ω)Proof (Lean source)
lemma indD_mul_μ₁_val_comp_eq (S : DTREstimationSystem P δ γ) (hA : S.toPODTRSystem.Assumptions) : (fun ω => S.toPODTRSystem.indD S.dbar 1 ω * S.μ₁_val (S.toPODTRSystem.factualS ⟨1, by decide⟩ ω, S.toPODTRSystem.factualD ⟨0, by decide⟩ ω, S.toPODTRSystem.factualS ⟨0, by decide⟩ ω)) =ᵐ[P.μ] (fun ω => S.toPODTRSystem.indD S.dbar 1 ω * (S.toPODTRSystem.historyBundle 1 (by decide)).condExpGiven (S.toPODTRSystem.Y_of S.dbar) P.μ ω) := by filter_upwards [S.μ₁_val_comp_mul_indD_eq hA] with ω hω simpa [mul_comm] using hω -
stageOneReg_memLplemma — The observable stage-1 regression is square-integrable under strict overlap and a factual second moment.hypothesesS :DTREstimationSystem P δ γε :ℝhov :S.StrictOverlap εh_y2 :Integrable (fun ω => (S.toPODTRSystem.factualY ω) ^ 2) P.μconclusionMemLp S.stageOneReg 2 P.μProof (Lean source)
lemma stageOneReg_memLp (S : DTREstimationSystem P δ γ) {ε : ℝ} (hov : S.StrictOverlap ε) (h_y2 : Integrable (fun ω => (S.toPODTRSystem.factualY ω) ^ 2) P.μ) : MemLp S.stageOneReg 2 P.μ := by let T := S.toPODTRSystem let kLast : Fin 2 := ⟨1, by decide⟩ let I1 : P.Ω → ℝ := (T.dVar kLast).indicator (S.dbar kLast) let B := T.historyBundle 1 (by decide) have hε_pos : 0 < ε := hov.1 have hY_L2 : MemLp T.factualY 2 P.μ := (memLp_two_iff_integrable_sq T.measurable_factualY.aestronglyMeasurable).2 h_y2 have hI1_meas : Measurable I1 := by simpa [T, I1, kLast] using (T.dVar kLast).measurable_indicator (S.dbar kLast) have hYI_L2 : MemLp (fun ω => T.factualY ω * I1 ω) 2 P.μ := by refine hY_L2.norm.mono' ((T.measurable_factualY.mul hI1_meas).aestronglyMeasurable) ?_ refine Filter.Eventually.of_forall (fun ω => ?_) rcases (T.dVar kLast).indicator_eq_one_or_zero (S.dbar kLast) ω with h0 | h1 · simp [I1, h0] · simp [I1, h1] have hNum_L2 : MemLp (B.condExpGiven (fun ω => T.factualY ω * I1 ω) P.μ) 2 P.μ := by simpa [POCFBundle.condExpGiven] using hYI_L2.condExp have hbound : ∀ᵐ ω ∂P.μ, ‖S.stageOneReg ω‖ ≤ ε⁻¹ * ‖B.condExpGiven (fun ω => T.factualY ω * I1 ω) P.μ ω‖ := by filter_upwards [hov.2.2] with ω hover have hden_ge : ε ≤ B.condExpGiven I1 P.μ ω := by simpa [T, B, I1, kLast] using hover.2.1 have hden_pos : 0 < B.condExpGiven I1 P.μ ω := lt_of_lt_of_le hε_pos hden_ge have hinv : (B.condExpGiven I1 P.μ ω)⁻¹ ≤ ε⁻¹ := by rw [inv_le_inv₀ hden_pos hε_pos] exact hden_ge unfold stageOneReg POCFBundle.condExpRatio simp only [T, B, I1, kLast] rw [Real.norm_eq_abs, abs_div, abs_of_pos hden_pos] calc |B.condExpGiven (fun ω => T.factualY ω * I1 ω) P.μ ω| / B.condExpGiven I1 P.μ ω = (B.condExpGiven I1 P.μ ω)⁻¹ * |B.condExpGiven (fun ω => T.factualY ω * I1 ω) P.μ ω| := by ring _ ≤ ε⁻¹ * |B.condExpGiven (fun ω => T.factualY ω * I1 ω) P.μ ω| := by exact mul_le_mul_of_nonneg_right hinv (abs_nonneg _) _ = ε⁻¹ * ‖B.condExpGiven (fun ω => T.factualY ω * I1 ω) P.μ ω‖ := by rw [Real.norm_eq_abs] refine (hNum_L2.norm.const_mul ε⁻¹).mono' (B.stronglyMeasurable_condExpRatio (fun ω => T.factualY ω * I1 ω) I1).aestronglyMeasurable ?_ simpa [DTREstimationSystem.stageOneReg, T, B, I1, kLast] using hbound -
measurable_factualZlemma — The full observed two-stage data tuple is measurable.Proof (Lean source)
lemma measurable_factualZ (S : DTREstimationSystem P δ γ) : Measurable S.factualZ := by refine (S.toPODTRSystem.measurable_factualS ⟨0, by decide⟩).prodMk ?_ refine (S.toPODTRSystem.measurable_factualD ⟨0, by decide⟩).prodMk ?_ refine (S.toPODTRSystem.measurable_factualS ⟨1, by decide⟩).prodMk ?_ exact (S.toPODTRSystem.measurable_factualD ⟨1, by decide⟩).prodMk S.toPODTRSystem.measurable_factualY
SeqDRMoment 16 core · 12 supporting This file defines the explicit two-stage sequential AIPW moment for dynamic treatment regimes, its truth-level influence function, and the overlap-bounded nuisance space used by the abstract DML layer. ★ P_Z_map_projS₀_eq_P_H₀★ P_Z_map_histH₁_eq_P_H₁
Sequential DR Moment for Two-Stage Regimes
This file defines the explicit two-stage sequential AIPW moment for dynamic treatment regimes, its truth-level influence function, and the overlap-bounded nuisance space used by the abstract DML layer. The target is the fixed-regime mean for a two-period regime, and the score uses stagewise inverse-propensity weights centered by the target estimand.
The development is intentionally specialized to horizon two; the treatment space is discrete enough to support equality indicators. The stage-1 history is stored in cons order as the current state, previous treatment, and previous state.
This projection returns the initial state from the observed two-stage data tuple.
Definition (Lean source)
This projection returns the first treatment from the observed two-stage data tuple.
Definition (Lean source)
This projection returns the second state from the observed two-stage data tuple.
Definition (Lean source)
This projection returns the second treatment from the observed two-stage data tuple.
Definition (Lean source)
This projection returns the outcome from the observed two-stage data tuple.
Definition (Lean source)
This projection returns the stage-1 history in the order used by the DTR history bundle.
This function is the real-valued indicator that two discrete treatments are equal.
A stagewise nuisance vector for two-period dynamic-treatment-regime estimation: the baseline outcome regression and treatment propensity at the first stage, the second-stage outcome regression and treatment propensity given the second-period history, together with the measurability of all four nuisance functions.
Definition (Lean source)
This is the explicit two-stage sequential doubly robust moment for a fixed treatment regime.
Definition (Lean source)
This is the true nuisance vector extracted from a two-stage DTR estimation system.
Definition (Lean source)
This is the sequential doubly robust moment specialized to the system's target regime.
Definition (Lean source)
This is the sequential doubly robust influence function evaluated at the true nuisances and target.
Definition (Lean source)
This set contains nuisance candidates whose two propensity components are uniformly overlap-bounded.
Definition (Lean source)
This is the sequential doubly robust moment packaged as a functional of nuisance, data, and target value.
Definition (Lean source)
For a dynamic-treatment-regime estimation system, pushing the full observed-data law forward through the initial-state projection yields exactly the stage-0 history marginal law.
Formal statement
Proof (Lean source)
For a dynamic-treatment-regime estimation system, pushing the full observed-data law forward through the stage-1 history projection yields exactly the stage-1 history marginal law.
Formal statement
Proof (Lean source)
12 supporting declarations (lemmas, instances)
-
instZeroinstance — The zero nuisance vector sets every stagewise regression and propensity component to zero.instance : Zero (DTRNuisanceVec₂ δ γ) where zero := ⟨fun _ => 0, fun _ => 0, fun _ => 0, fun _ => 0, measurable_const, measurable_const, measurable_const, measurable_const⟩ -
instAddinstance — Addition of nuisance vectors is performed component by component.instance : Add (DTRNuisanceVec₂ δ γ) where add η η' := ⟨fun s => η.μ₀_fn s + η'.μ₀_fn s, fun s => η.e₀_fn s + η'.e₀_fn s, fun h => η.μ₁_fn h + η'.μ₁_fn h, fun h => η.e₁_fn h + η'.e₁_fn h, η.μ₀_meas.add η'.μ₀_meas, η.e₀_meas.add η'.e₀_meas, η.μ₁_meas.add η'.μ₁_meas, η.e₁_meas.add η'.e₁_meas⟩ -
instNeginstance — Negation of a nuisance vector is performed component by component.instance : Neg (DTRNuisanceVec₂ δ γ) where neg η := ⟨fun s => -η.μ₀_fn s, fun s => -η.e₀_fn s, fun h => -η.μ₁_fn h, fun h => -η.e₁_fn h, η.μ₀_meas.neg, η.e₀_meas.neg, η.μ₁_meas.neg, η.e₁_meas.neg⟩ -
instSubinstance — Subtraction of nuisance vectors is performed component by component.instance : Sub (DTRNuisanceVec₂ δ γ) where sub η η' := ⟨fun s => η.μ₀_fn s - η'.μ₀_fn s, fun s => η.e₀_fn s - η'.e₀_fn s, fun h => η.μ₁_fn h - η'.μ₁_fn h, fun h => η.e₁_fn h - η'.e₁_fn h, η.μ₀_meas.sub η'.μ₀_meas, η.e₀_meas.sub η'.e₀_meas, η.μ₁_meas.sub η'.μ₁_meas, η.e₁_meas.sub η'.e₁_meas⟩ -
instSMulRealinstance — Real scalar multiplication of a nuisance vector is performed component by component.instance : SMul ℝ (DTRNuisanceVec₂ δ γ) where smul t η := ⟨fun s => t * η.μ₀_fn s, fun s => t * η.e₀_fn s, fun h => t * η.μ₁_fn h, fun h => t * η.e₁_fn h, measurable_const.mul η.μ₀_meas, measurable_const.mul η.e₀_meas, measurable_const.mul η.μ₁_meas, measurable_const.mul η.e₁_meas⟩ -
exttheorem — Two nuisance vectors are equal when all four stagewise components agree pointwise.hypothesesη η' :DTRNuisanceVec₂ δ γh0μ :∀ s, η.μ₀_fn s = η'.μ₀_fn sh0e :∀ s, η.e₀_fn s = η'.e₀_fn sh1μ :∀ h, η.μ₁_fn h = η'.μ₁_fn hh1e :∀ h, η.e₁_fn h = η'.e₁_fn hconclusionη = η'Proof (Lean source)
@[ext] theorem ext {η η' : DTRNuisanceVec₂ δ γ} (h0μ : ∀ s, η.μ₀_fn s = η'.μ₀_fn s) (h0e : ∀ s, η.e₀_fn s = η'.e₀_fn s) (h1μ : ∀ h, η.μ₁_fn h = η'.μ₁_fn h) (h1e : ∀ h, η.e₁_fn h = η'.e₁_fn h) : η = η' := by cases η cases η' simp only at h0μ h0e h1μ h1e congr · funext s; exact h0μ s · funext s; exact h0e s · funext h; exact h1μ h · funext h; exact h1e h -
ext_ifftheorem∀ {δ : Type} [inst : MeasurableSpace δ] [inst_1 : MeasurableSingletonClass δ] {γ : Fin 2 → Type} [inst_2 : (k : Fin 2) → MeasurableSpace (γ k)] {η η' : DTRNuisanceVec₂ δ γ}, η = η' ↔ (∀ (s : γ 0), η.μ₀_fn s = η'.μ₀_fn s) ∧ (∀ (s : γ 0), η.e₀_fn s = η'.e₀_fn s) ∧ (∀ (h : γ 1 × δ × γ 0), η.μ₁_fn h = η'.μ₁_fn h) ∧ ∀ (h : γ 1 × δ × γ 0), η.e₁_fn h = η'.e₁_fn hProof (Lean source)
@[ext] -
instAddCommGroupinstance — The nuisance vectors form an additive commutative group under componentwise operations.instance : AddCommGroup (DTRNuisanceVec₂ δ γ) where zero := 0 add := (· + ·) neg := neg sub := Sub.sub nsmul := nsmulRec zsmul := zsmulRec nsmul_zero η := by rfl nsmul_succ n η := by rfl zsmul_zero' η := by rfl zsmul_succ' n η := by rfl zsmul_neg' n η := by rfl sub_eq_add_neg η η' := by apply ext · intro s; exact sub_eq_add_neg (η.μ₀_fn s) (η'.μ₀_fn s) · intro s; exact sub_eq_add_neg (η.e₀_fn s) (η'.e₀_fn s) · intro h; exact sub_eq_add_neg (η.μ₁_fn h) (η'.μ₁_fn h) · intro h; exact sub_eq_add_neg (η.e₁_fn h) (η'.e₁_fn h) add_assoc η η' η'' := by apply ext · intro s; exact add_assoc (η.μ₀_fn s) (η'.μ₀_fn s) (η''.μ₀_fn s) · intro s; exact add_assoc (η.e₀_fn s) (η'.e₀_fn s) (η''.e₀_fn s) · intro h; exact add_assoc (η.μ₁_fn h) (η'.μ₁_fn h) (η''.μ₁_fn h) · intro h; exact add_assoc (η.e₁_fn h) (η'.e₁_fn h) (η''.e₁_fn h) zero_add η := by apply ext · intro s; exact zero_add (η.μ₀_fn s) · intro s; exact zero_add (η.e₀_fn s) · intro h; exact zero_add (η.μ₁_fn h) · intro h; exact zero_add (η.e₁_fn h) add_zero η := by apply ext · intro s; exact add_zero (η.μ₀_fn s) · intro s; exact add_zero (η.e₀_fn s) · intro h; exact add_zero (η.μ₁_fn h) · intro h; exact add_zero (η.e₁_fn h) neg_add_cancel η := by apply ext · intro s; exact neg_add_cancel (η.μ₀_fn s) · intro s; exact neg_add_cancel (η.e₀_fn s) · intro h; exact neg_add_cancel (η.μ₁_fn h) · intro h; exact neg_add_cancel (η.e₁_fn h) add_comm η η' := by apply ext · intro s; exact add_comm (η.μ₀_fn s) (η'.μ₀_fn s) · intro s; exact add_comm (η.e₀_fn s) (η'.e₀_fn s) · intro h; exact add_comm (η.μ₁_fn h) (η'.μ₁_fn h) · intro h; exact add_comm (η.e₁_fn h) (η'.e₁_fn h) -
instModuleRealinstance — The nuisance vectors form a real module under componentwise scalar multiplication.instance : Module ℝ (DTRNuisanceVec₂ δ γ) where smul := (· • ·) one_smul η := by apply ext · intro s; change (1 : ℝ) * η.μ₀_fn s = η.μ₀_fn s; exact one_mul _ · intro s; change (1 : ℝ) * η.e₀_fn s = η.e₀_fn s; exact one_mul _ · intro h; change (1 : ℝ) * η.μ₁_fn h = η.μ₁_fn h; exact one_mul _ · intro h; change (1 : ℝ) * η.e₁_fn h = η.e₁_fn h; exact one_mul _ mul_smul t u η := by apply ext · intro s; change (t * u) * η.μ₀_fn s = t * (u * η.μ₀_fn s); ring · intro s; change (t * u) * η.e₀_fn s = t * (u * η.e₀_fn s); ring · intro h; change (t * u) * η.μ₁_fn h = t * (u * η.μ₁_fn h); ring · intro h; change (t * u) * η.e₁_fn h = t * (u * η.e₁_fn h); ring smul_zero t := by apply ext · intro s; change t * (0 : ℝ) = 0; exact mul_zero t · intro s; change t * (0 : ℝ) = 0; exact mul_zero t · intro h; change t * (0 : ℝ) = 0; exact mul_zero t · intro h; change t * (0 : ℝ) = 0; exact mul_zero t smul_add t η η' := by apply ext · intro s change t * (η.μ₀_fn s + η'.μ₀_fn s) = t * η.μ₀_fn s + t * η'.μ₀_fn s ring · intro s change t * (η.e₀_fn s + η'.e₀_fn s) = t * η.e₀_fn s + t * η'.e₀_fn s ring · intro h change t * (η.μ₁_fn h + η'.μ₁_fn h) = t * η.μ₁_fn h + t * η'.μ₁_fn h ring · intro h change t * (η.e₁_fn h + η'.e₁_fn h) = t * η.e₁_fn h + t * η'.e₁_fn h ring add_smul t u η := by apply ext · intro s change (t + u) * η.μ₀_fn s = t * η.μ₀_fn s + u * η.μ₀_fn s ring · intro s change (t + u) * η.e₀_fn s = t * η.e₀_fn s + u * η.e₀_fn s ring · intro h change (t + u) * η.μ₁_fn h = t * η.μ₁_fn h + u * η.μ₁_fn h ring · intro h change (t + u) * η.e₁_fn h = t * η.e₁_fn h + u * η.e₁_fn h ring zero_smul η := by apply ext · intro s; change (0 : ℝ) * η.μ₀_fn s = 0; exact zero_mul _ · intro s; change (0 : ℝ) * η.e₀_fn s = 0; exact zero_mul _ · intro h; change (0 : ℝ) * η.μ₁_fn h = 0; exact zero_mul _ · intro h; change (0 : ℝ) * η.e₁_fn h = 0; exact zero_mul _ -
measurable_seqDRMomentFunctionallemma — The sequential doubly robust moment functional is measurable as a function of the observed data tuple.hypothesesconclusionMeasurable (fun z : γ 0 × δ × γ 1 × δ × ℝ => S.seqDRMomentFunctional η z θ)Proof (Lean source)
lemma measurable_seqDRMomentFunctional (S : DTREstimationSystem P δ γ) (η : DTRNuisanceVec₂ δ γ) (θ : ℝ) : Measurable (fun z : γ 0 × δ × γ 1 × δ × ℝ => S.seqDRMomentFunctional η z θ) := by unfold DTREstimationSystem.seqDRMomentFunctional unfold Causalean.Estimation.DTR.seqDRMoment have hs0 : Measurable (fun z : γ 0 × δ × γ 1 × δ × ℝ => projS₀ z) := by unfold projS₀ exact measurable_fst have hd0 : Measurable (fun z : γ 0 × δ × γ 1 × δ × ℝ => projD₀ z) := by unfold projD₀ measurability have hd1 : Measurable (fun z : γ 0 × δ × γ 1 × δ × ℝ => projD₁ z) := by unfold projD₁ measurability have hy : Measurable (fun z : γ 0 × δ × γ 1 × δ × ℝ => projY z) := by unfold projY measurability have hh1 : Measurable (fun z : γ 0 × δ × γ 1 × δ × ℝ => histH₁ z) := by unfold histH₁ projS₁ projD₀ projS₀ measurability have hμ0 : Measurable (fun z : γ 0 × δ × γ 1 × δ × ℝ => η.μ₀_fn (projS₀ z)) := η.μ₀_meas.comp hs0 have he0 : Measurable (fun z : γ 0 × δ × γ 1 × δ × ℝ => η.e₀_fn (projS₀ z)) := η.e₀_meas.comp hs0 have hμ1 : Measurable (fun z : γ 0 × δ × γ 1 × δ × ℝ => η.μ₁_fn (histH₁ z)) := η.μ₁_meas.comp hh1 have he1 : Measurable (fun z : γ 0 × δ × γ 1 × δ × ℝ => η.e₁_fn (histH₁ z)) := η.e₁_meas.comp hh1 have hind0 : Measurable (fun z : γ 0 × δ × γ 1 × δ × ℝ => indEq (projD₀ z) (S.dbar 0)) := by have hset : MeasurableSet {z : γ 0 × δ × γ 1 × δ × ℝ | projD₀ z = S.dbar 0} := (MeasurableSet.singleton (S.dbar 0)).preimage hd0 have hfun : (fun z : γ 0 × δ × γ 1 × δ × ℝ => indEq (projD₀ z) (S.dbar 0)) = indicator {z : γ 0 × δ × γ 1 × δ × ℝ | projD₀ z = S.dbar 0} (fun _ => (1 : ℝ)) := by funext z by_cases hz : projD₀ z = S.dbar 0 <;> simp [indEq, hz] rw [hfun] exact measurable_const.indicator hset have hind1 : Measurable (fun z : γ 0 × δ × γ 1 × δ × ℝ => indEq (projD₁ z) (S.dbar 1)) := by have hset : MeasurableSet {z : γ 0 × δ × γ 1 × δ × ℝ | projD₁ z = S.dbar 1} := (MeasurableSet.singleton (S.dbar 1)).preimage hd1 have hfun : (fun z : γ 0 × δ × γ 1 × δ × ℝ => indEq (projD₁ z) (S.dbar 1)) = indicator {z : γ 0 × δ × γ 1 × δ × ℝ | projD₁ z = S.dbar 1} (fun _ => (1 : ℝ)) := by funext z by_cases hz : projD₁ z = S.dbar 1 <;> simp [indEq, hz] rw [hfun] exact measurable_const.indicator hset exact ((hμ0.add ((hind0.div he0).mul (hμ1.sub hμ0))).add (((hind0.mul hind1).div (he0.mul he1)).mul (hy.sub hμ1))).sub measurable_const -
measurable_projS₀lemma — The initial-state projection is measurable.conclusionMeasurable (fun z : γ 0 × δ × γ 1 × δ × ℝ => projS₀ z)Proof (Lean source)
lemma measurable_projS₀ : Measurable (fun z : γ 0 × δ × γ 1 × δ × ℝ => projS₀ z) := by unfold projS₀; exact measurable_fst -
measurable_histH₁lemma — The cons-ordered stage-1 history projection is measurable.conclusionMeasurable (fun z : γ 0 × δ × γ 1 × δ × ℝ => histH₁ z)
Constructor 3 core · 0 supporting Constructs value-space lifts for explicit two-stage dynamic-treatment-regime histories. ★ exists_stage0_lift★ exists_stage1_lift
Constructs value-space lifts for explicit two-stage dynamic-treatment-regime histories. The module turns stagewise histories, actions, and outcome regressions into the representatives consumed by sequential doubly robust scores.
Doob–Dynkin factorization through the stage-0 state. Consider a two-stage dynamic-treatment-regime potential-outcome system and a real-valued function g on the sample space. If g is measurable with respect to the σ-algebra generated by the stage-0 history — here just the initial state S₀, then g factors through the stage-0 state: there is a measurable function f on the stage-0 state space such that g equals f composed with the stage-0 state map.
Formal statement
Proof (Lean source)
Doob–Dynkin factorization through the stage-1 history. Consider a two-stage dynamic-treatment-regime potential-outcome system and a real-valued function g on the sample space. If g is measurable with respect to the σ-algebra generated by the stage-1 history — the current state, the previous treatment, and the previous state, then g factors through that history tuple: there is a measurable function f on the stage-1 history space such that g equals f composed with the map recording the current state, the previous treatment, and the previous state.
Formal statement
Proof (Lean source)
The DTR estimation-system fields are free given two-stage overlap. From a bare PODTRSystem P 2 δ γ, a fixed target regime dbar, and a.e. overlap at stages 0 and 1, construct a DTREstimationSystem. The regression fields are Doob--Dynkin lifts of the observable nested regressions, and the propensity fields are the corresponding lifts clamped into (0, 1) off support.
Definition (Lean source)
DML 2 core · 0 supporting This file defines the one-shot double machine learning estimator for the two-period dynamic-treatment-regime effect. ★ dml_DTR_isAsymLinear
Dynamic-Treatment-Regime DML Estimator
This file defines the one-shot double machine learning estimator for the
two-period dynamic-treatment-regime effect. The main declarations are
dml_DTR_estimator, the fold-B empirical mean of the sequential doubly robust
pseudo-outcome, and dml_DTR_isAsymLinear, which proves asymptotic linearity
from stagewise nuisance overlap, measurability, L2 integrability, individual
o_p(1) rates, and the four cross-product o_p(n^{-1/2}) rates.
One-shot DML / sequential DR estimator of the DTR effect (def:est-dml-dtr).
Definition (Lean source)
Asymptotic linearity of the one-shot DML DTR (n = 2) estimator — thm:est-dml-dtr-al. Assuming the DTR backdoor identification conditions hold, the theorem shows that the one-shot double/debiased-machine-learning estimator of the two-period dynamic-treatment-regime effect is asymptotically linear, with influence function ψ_seqDR, around the true effect θ₀. The population-truth propensities obey strict overlap — some ε ∈ (0, 1/2] sandwiches them a.s. at both stages, restated pointwise on the value-space propensity functions e₀_val, e₁_val; the factual outcome and every counterfactual outcome under a fixed regime are square-integrable; and the one-shot sample split's auxiliary-fold fraction |B(n)|/n converges to some c ∈ (0, 1). For every horizon n, the stage-0 nuisance learners μ̂₀, ê₀ and the stage-1 learners μ̂₁, ê₁ are each jointly measurable in the sample outcome and the covariate history at stage 0 and likewise at stage 1; the fitted propensities satisfy the same strict-overlap bound ε pointwise at both stages; each learner lies in L² of the covariate-history distribution at stage 0 and likewise at stage 1; and, viewed as a function of the sample outcome alone, each learner is measurable with respect to the auxiliary training fold's σ-algebra at stage 0 and likewise at stage 1, and jointly with the covariate in uncurried form at stage 0 and at stage 1. Finally, each stagewise estimation error converges to zero in L² at rate o_p(1), and every cross-stage product of an outcome-regression error with a propensity error vanishes at the doubly-robust rate o_p(n^{-1/2}).
Formal statement
Proof (Lean source)
DTRInstance 2 core · 2 supporting This file instantiates the abstract orthogonal-moment framework with the two-period sequential doubly robust moment for a dynamic treatment regime. ★ seqDR_dml_isAsymLinear
Sequential Doubly Robust Moment Instance
This file instantiates the abstract orthogonal-moment framework with the two-period sequential doubly robust moment for a dynamic treatment regime. It records the mean-zero, bilinear-remainder, and asymptotic-linearity ingredients needed to reuse the general DML theorem.
Sequential DR (DTR, n = 2) instance of the abstract GeneralMoment.
Definition (Lean source)
Headline sequential DR (DTR) DML asymptotic-linearity theorem, derived from the abstract dml_chernozhukov_asymptoticLinear in Estimation/OrthogonalMoments/DMLChernozhukov.lean. Fix a dynamic-treatment-regime estimation system with strict two-stage propensity overlap and satisfying the DTR identification assumptions, and suppose the factual outcome and every counterfactual outcome under a fixed treatment history have finite second moment. Given an i.i.d. sample together with a one-shot cross-fitting split whose estimation-fold share converges to some constant strictly between and , and a sequence of nuisance estimators η_hat that remain in the -overlap ball, with stagewise outcome-regression and propensity errors that are square-integrable, such that the resulting moment function is measurable against the sample and each cross-fitting fold, and is both integrable and square-integrable, and such that the individual L² nuisance-error rates vanish while their product is , then the resulting Chernozhukov one-step DML estimator is asymptotically linear at the true sequential-DR parameter, with influence function the sequential doubly-robust score evaluated at the truth.
Formal statement
Proof (Lean source)
2 supporting declarations (lemmas, instances)
-
seqDR_meanZerotheorem — Sequential DR (DTR) satisfies MeanZero.hypothesesS :DTREstimationSystem P δ γε :ℝh_e_pointwise :(∀ s₀, ε ≤ S.e₀_val s₀ ∧ S.e₀_val s₀ ≤ 1 - ε) ∧ (∀ h, ε ≤ S.e₁_val h ∧ S.e₁_val h ≤ 1 - ε)h_overlap :S.StrictOverlap εhA :S.toPODTRSystem.Assumptionsh_y2 :Integrable (fun ω => (S.toPODTRSystem.factualY ω) ^ 2) P.μconclusionMeanZero (seqDRGeneralMoment S h_e_pointwise)Proof (Lean source)
theorem seqDR_meanZero (S : DTREstimationSystem P δ γ) {ε : ℝ} (h_e_pointwise : (∀ s₀, ε ≤ S.e₀_val s₀ ∧ S.e₀_val s₀ ≤ 1 - ε) ∧ (∀ h, ε ≤ S.e₁_val h ∧ S.e₁_val h ≤ 1 - ε)) (h_overlap : S.StrictOverlap ε) (hA : S.toPODTRSystem.Assumptions) (h_y2 : Integrable (fun ω => (S.toPODTRSystem.factualY ω) ^ 2) P.μ) : MeanZero (seqDRGeneralMoment S h_e_pointwise) := by unfold MeanZero seqDRGeneralMoment exact seqDR_mean_zero S h_overlap hA h_y2 -
seqDR_bilinearRemtheorem — Sequential DR (DTR) satisfies BilinearRemainder with constant seqDR_rem_const ε.hypothesesS :DTREstimationSystem P δ γε :ℝh_e_pointwise :(∀ s₀, ε ≤ S.e₀_val s₀ ∧ S.e₀_val s₀ ≤ 1 - ε) ∧ (∀ h, ε ≤ S.e₁_val h ∧ S.e₁_val h ≤ 1 - ε)h_overlap :S.StrictOverlap εhA :S.toPODTRSystem.Assumptionsh_y2 :Integrable (fun ω => (S.toPODTRSystem.factualY ω) ^ 2) P.μh_yd2 :∀ dbar : Fin 2 → δ, Integrable (fun ω => (S.toPODTRSystem.Y_of dbar ω) ^ 2) P.μconclusion∃ C, BilinearRemainder (seqDRGeneralMoment S h_e_pointwise) CProof (Lean source)
theorem seqDR_bilinearRem (S : DTREstimationSystem P δ γ) {ε : ℝ} (h_e_pointwise : (∀ s₀, ε ≤ S.e₀_val s₀ ∧ S.e₀_val s₀ ≤ 1 - ε) ∧ (∀ h, ε ≤ S.e₁_val h ∧ S.e₁_val h ≤ 1 - ε)) (h_overlap : S.StrictOverlap ε) (hA : S.toPODTRSystem.Assumptions) (h_y2 : Integrable (fun ω => (S.toPODTRSystem.factualY ω) ^ 2) P.μ) (h_yd2 : ∀ dbar : Fin 2 → δ, Integrable (fun ω => (S.toPODTRSystem.Y_of dbar ω) ^ 2) P.μ) (h_L2 : ∀ η ∈ DTREstimationSystem.H_ε (δ := δ) (γ := γ) ε, MemLp (fun s₀ => η.μ₀_fn s₀ - S.μ₀_val s₀) 2 S.P_H₀ ∧ MemLp (fun h => η.μ₁_fn h - S.μ₁_val h) 2 S.P_H₁ ∧ MemLp (fun s₀ => η.e₀_fn s₀ - S.e₀_val s₀) 2 S.P_H₀ ∧ MemLp (fun h => η.e₁_fn h - S.e₁_val h) 2 S.P_H₁) : ∃ C, BilinearRemainder (seqDRGeneralMoment S h_e_pointwise) C := by refine ⟨seqDR_rem_const ε, ?_⟩ intro η hη obtain ⟨hΔμ₀, hΔμ₁, hΔe₀, hΔe₁⟩ := h_L2 η hη have h := seqDR_remainder_bound S h_overlap hA h_y2 h_yd2 η hη hΔμ₀ hΔμ₁ hΔe₀ hΔe₁ change |∫ z, S.seqDRMomentFunctional η z S.θ₀ ∂(S.P_Z)| ≤ seqDR_rem_const ε * ((eLpNorm (fun s₀ => η.μ₀_fn s₀ - S.μ₀_val s₀) 2 S.P_H₀).toReal + (eLpNorm (fun h => η.μ₁_fn h - S.μ₁_val h) 2 S.P_H₁).toReal) * ((eLpNorm (fun s₀ => η.e₀_fn s₀ - S.e₀_val s₀) 2 S.P_H₀).toReal + (eLpNorm (fun h => η.e₁_fn h - S.e₁_val h) 2 S.P_H₁).toReal) exact h
FiniteVar 1 core · 1 supporting This file proves square integrability of the sequential doubly robust influence function for a two-stage dynamic treatment regime. ★ seqDR_finite_var
Finite Variance for Sequential DR
This file proves square integrability of the sequential doubly robust influence function for a two-stage dynamic treatment regime. The proof extends the average-treatment-effect finite-variance argument to stagewise histories, propensity weights, and counterfactual outcome regressions under strict overlap.
Finite variance of the sequential doubly robust score — sequential DR (DTR) analogue of aipw_finite_var. Under the two-stage DTR backdoor assumptions — sequential exchangeability, consistency, stagewise positivity, and integrability of every counterfactual outcome, uniform two-stage strict overlap: the target-regime propensity at each stage lies almost surely in [ε, 1-ε] for some ε in (0, 1/2], a finite second moment for the observed factual outcome, and a finite second moment for every counterfactual outcome under a treatment sequence, the sequential doubly robust influence function ψ_seqDR is square-integrable against the joint law of the observed two-stage data tuple.
Formal statement
Proof (Lean source)
1 supporting declaration (lemmas, instances)
-
measurable_ψ_seqDR_squaredlemma — Measurability helper: the squared sequential DR influence function on the data tuple is measurable. Used in the L² bookkeeping for seqDR_finite_var.hypothesesS :DTREstimationSystem P δ γconclusionMeasurable (fun z : γ 0 × δ × γ 1 × δ × ℝ => (S.ψ_seqDR z) ^ 2)Proof (Lean source)
lemma measurable_ψ_seqDR_squared (S : DTREstimationSystem P δ γ) : Measurable (fun z : γ 0 × δ × γ 1 × δ × ℝ => (S.ψ_seqDR z) ^ 2) := by exact (S.measurable_seqDRMomentFunctional S.η₀ S.θ₀).pow_const 2
MeanZero 1 core · 6 supporting Proves mean-zero properties for the sequential doubly robust score. ★ seqDR_mean_zero
Proves mean-zero properties for the sequential doubly robust score. The module handles measurability, conditioning, and stagewise cancellation needed for the DTR influence-function argument.
Mean zero of the sequential doubly robust score. Under the two-stage DTR backdoor assumptions — sequential exchangeability, consistency, stagewise positivity, and integrability of every counterfactual outcome, uniform two-stage strict overlap: the target-regime propensity at each stage lies almost surely in [ε, 1-ε] for some ε in (0, 1/2], and a finite second moment for the observed factual outcome, then the sequential doubly robust influence function ψ_seqDR has expectation zero under the observed two-stage data law.
Formal statement
Proof (Lean source)
6 supporting declarations (lemmas, instances)
-
measurable_ψ_seqDRlemma — Measurability of the sequential DR influence function on the data tuple (s₀, d₀, s₁, d₁, y) : γ 0 × δ × γ 1 × δ × ℝ. Decomposes into Measurable.add/Measurable.mul/Measurable.div chained against the projections, the indicator functions indEq, and the value-space nuisance functions stored in S.η₀.Proof (Lean source)
lemma measurable_ψ_seqDR (S : DTREstimationSystem P δ γ) : Measurable S.ψ_seqDR := by exact S.measurable_seqDRMomentFunctional S.η₀ S.θ₀ -
propScore_ne_zero_stage0lemma — Stage-0 propensity is a.e. nonzero under the DTR backdoor assumptions. The conditional indicator μ[1{D₀ = dbar 0} | σ(historyBundle 0)] is identified via e₀_compat with e₀_val ∘ factualS 0, and e₀_val > 0 pointwise on γ 0.hypothesesS :DTREstimationSystem P δ γhA :S.toPODTRSystem.AssumptionsProof (Lean source)
lemma propScore_ne_zero_stage0 (S : DTREstimationSystem P δ γ) (hA : S.toPODTRSystem.Assumptions) : ∀ᵐ ω ∂P.μ, (S.toPODTRSystem.historyBundle 0 (by decide)).condExpGiven ((S.toPODTRSystem.dVar ⟨0, by decide⟩).indicator (S.dbar ⟨0, by decide⟩)) P.μ ω ≠ 0 := by filter_upwards [hA.overlap S.dbar ⟨0, by decide⟩] with ω hω exact ne_of_gt hω -
propScore_ne_zero_stage1lemma — Stage-1 propensity is a.e. nonzero under the DTR backdoor assumptions. Analogous to propScore_ne_zero_stage0 via e₁_compat and e₁_pos.hypothesesS :DTREstimationSystem P δ γhA :S.toPODTRSystem.AssumptionsProof (Lean source)
lemma propScore_ne_zero_stage1 (S : DTREstimationSystem P δ γ) (hA : S.toPODTRSystem.Assumptions) : ∀ᵐ ω ∂P.μ, (S.toPODTRSystem.historyBundle 1 (by decide)).condExpGiven ((S.toPODTRSystem.dVar ⟨1, by decide⟩).indicator (S.dbar ⟨1, by decide⟩)) P.μ ω ≠ 0 := by filter_upwards [hA.overlap S.dbar ⟨1, by decide⟩] with ω hω exact ne_of_gt hω -
cond_exp_residual_zero_stage0lemma — Stage-0 residual conditional expectation is zero a.s.: under DTR assumptions, μ[1{D₀=dbar 0}·(μ₁_val(history₁) − μ₀_val(S₀)) | σ(historyBundle 0)] =ᵐ 0.hypothesesS :DTREstimationSystem P δ γε :ℝh_overlap :S.StrictOverlap εhA :S.toPODTRSystem.Assumptionsh_y2 :Integrable (fun ω => (S.toPODTRSystem.factualY ω) ^ 2) P.μconclusion(S.toPODTRSystem.historyBundle 0 (by decide)).condExpGiven (fun ω => (S.toPODTRSystem.dVar ⟨0, by decide⟩).indicator (S.dbar ⟨0, by decide⟩) ω * (S.μ₁_val (S.toPODTRSystem.factualS ⟨1, by decide⟩ ω, S.toPODTRSystem.factualD ⟨0, by decide⟩ ω, S.toPODTRSystem.factualS ⟨0, by decide⟩ ω) - S.μ₀_val (S.toPODTRSystem.factualS ⟨0, by decide⟩ ω))) P.μ=ᵐ[P.μ] (fun _ => (0 : ℝ))Proof (Lean source)
lemma cond_exp_residual_zero_stage0 (S : DTREstimationSystem P δ γ) {ε : ℝ} (h_overlap : S.StrictOverlap ε) (hA : S.toPODTRSystem.Assumptions) (h_y2 : Integrable (fun ω => (S.toPODTRSystem.factualY ω) ^ 2) P.μ) : (S.toPODTRSystem.historyBundle 0 (by decide)).condExpGiven (fun ω => (S.toPODTRSystem.dVar ⟨0, by decide⟩).indicator (S.dbar ⟨0, by decide⟩) ω * (S.μ₁_val (S.toPODTRSystem.factualS ⟨1, by decide⟩ ω, S.toPODTRSystem.factualD ⟨0, by decide⟩ ω, S.toPODTRSystem.factualS ⟨0, by decide⟩ ω) - S.μ₀_val (S.toPODTRSystem.factualS ⟨0, by decide⟩ ω))) P.μ =ᵐ[P.μ] (fun _ => (0 : ℝ)) := by let B0 := S.toPODTRSystem.historyBundle 0 (by decide) let B1 := S.toPODTRSystem.historyBundle 1 (by decide) let I0 : P.Ω → ℝ := (S.toPODTRSystem.dVar ⟨0, by decide⟩).indicator (S.dbar ⟨0, by decide⟩) let Y : P.Ω → ℝ := S.toPODTRSystem.Y_of S.dbar let M0 : P.Ω → ℝ := fun ω => S.μ₀_val (S.toPODTRSystem.factualS ⟨0, by decide⟩ ω) let M1 : P.Ω → ℝ := fun ω => S.μ₁_val (S.toPODTRSystem.factualS ⟨1, by decide⟩ ω, S.toPODTRSystem.factualD ⟨0, by decide⟩ ω, S.toPODTRSystem.factualS ⟨0, by decide⟩ ω) have hY_int : Integrable Y P.μ := by simpa [Y] using hA.integrable_Y S.dbar have hI0_int : Integrable I0 P.μ := by simpa [I0] using (S.toPODTRSystem.dVar ⟨0, by decide⟩).integrable_indicator (S.dbar ⟨0, by decide⟩) have hI0Y_int : Integrable (fun ω => I0 ω * Y ω) P.μ := by have h := (S.toPODTRSystem.dVar ⟨0, by decide⟩).integrable_mul_indicator (S.dbar ⟨0, by decide⟩) (MeasurableSet.singleton _) hY_int exact h.congr (Filter.Eventually.of_forall (fun ω => by simp [I0, Y, mul_comm])) have hM0_int : Integrable M0 P.μ := by exact (B0.integrable_condExpGiven (S.toPODTRSystem.Y_of S.dbar)).congr (by simpa [B0, M0] using S.μ₀_compat hA) have hM1_int : Integrable M1 P.μ := by have hM1_L2 : MemLp M1 2 P.μ := by simpa [M1] using (S.stageOneReg_memLp h_overlap h_y2).ae_eq (S.μ₁_val_comp_eq_stageOneReg).symm exact hM1_L2.integrable (by norm_num) have hM0_meas : Measurable M0 := by exact S.μ₀_meas.comp (S.toPODTRSystem.measurable_factualS ⟨0, by decide⟩) have hM1_meas : Measurable M1 := by have hs1 := S.toPODTRSystem.measurable_factualS ⟨1, by decide⟩ have hd0 := S.toPODTRSystem.measurable_factualD ⟨0, by decide⟩ have hs0 := S.toPODTRSystem.measurable_factualS ⟨0, by decide⟩ exact S.μ₁_meas.comp (hs1.prod (hd0.prod hs0)) have hI0M0_int : Integrable (fun ω => I0 ω * M0 ω) P.μ := by have h := (S.toPODTRSystem.dVar ⟨0, by decide⟩).integrable_mul_indicator (S.dbar ⟨0, by decide⟩) (MeasurableSet.singleton _) hM0_int exact h.congr (Filter.Eventually.of_forall (fun ω => by simp [I0, M0, mul_comm])) have hI0M1_int : Integrable (fun ω => I0 ω * M1 ω) P.μ := by have h := (S.toPODTRSystem.dVar ⟨0, by decide⟩).integrable_mul_indicator (S.dbar ⟨0, by decide⟩) (MeasurableSet.singleton _) hM1_int exact h.congr (Filter.Eventually.of_forall (fun ω => by simp [I0, M1, mul_comm])) have hres_eq : (fun ω => I0 ω * (M1 ω - M0 ω)) = (fun ω => I0 ω * M1 ω - I0 ω * M0 ω) := by funext ω ring have hsub : B0.condExpGiven (fun ω => I0 ω * M1 ω - I0 ω * M0 ω) P.μ =ᵐ[P.μ] B0.condExpGiven (fun ω => I0 ω * M1 ω) P.μ - B0.condExpGiven (fun ω => I0 ω * M0 ω) P.μ := by simp only [POCFBundle.condExpGiven] exact MeasureTheory.condExp_sub hI0M1_int hI0M0_int B0.sigma have hI0_sm_B1 : StronglyMeasurable[B1.sigma] I0 := by simpa [B1, I0] using S.toPODTRSystem.stronglyMeasurable_indicator_dVar_sigma_history 1 (by decide) ⟨0, by decide⟩ (by decide) (S.dbar ⟨0, by decide⟩) have hrev_B1 : (fun ω => I0 ω * M1 ω) =ᵐ[P.μ] B1.condExpGiven (fun ω => I0 ω * Y ω) P.μ := by have hI0_eq_indD : I0 = S.toPODTRSystem.indD S.dbar 1 := by funext ω have hsplit := congr_fun (S.toPODTRSystem.indD_factor_split S.dbar 0 (by decide)) ω simp [I0, PODTRSystem.indD] at hsplit ⊢ have hpull := B1.condExpGiven_mul_of_stronglyMeasurable_left (f := I0) (g := Y) hI0_sm_B1 hI0Y_int hY_int filter_upwards [hpull, S.indD_mul_μ₁_val_comp_eq hA] with ω hp hμ1 have hp' : B1.condExpGiven (fun ω => I0 ω * Y ω) P.μ ω = I0 ω * B1.condExpGiven Y P.μ ω := by exact hp have hμ1_local : I0 ω * M1 ω = I0 ω * B1.condExpGiven Y P.μ ω := by have hμ1' : S.toPODTRSystem.indD S.dbar 1 ω * M1 ω = S.toPODTRSystem.indD S.dbar 1 ω * B1.condExpGiven Y P.μ ω := hμ1 rw [hI0_eq_indD] exact hμ1' rw [hp'] exact hμ1_local haveI : IsFiniteMeasure (P.μ.trim B1.sigma_le) := isFiniteMeasure_trim _ have hB0_le_B1 : B0.sigma ≤ B1.sigma := by simpa [B0, B1] using S.toPODTRSystem.historyBundle_sigma_mono 0 1 (by decide) (by decide) have htower : B0.condExpGiven (B1.condExpGiven (fun ω => I0 ω * Y ω) P.μ) P.μ =ᵐ[P.μ] B0.condExpGiven (fun ω => I0 ω * Y ω) P.μ := by have h := B1.condExpGiven_tower_of_le (g := fun ω => I0 ω * Y ω) (μ := P.μ) (m := B0.sigma) hB0_le_B1 simpa [POCFBundle.condExpGiven] using h have hCE_I0M1_to_Y : B0.condExpGiven (fun ω => I0 ω * M1 ω) P.μ =ᵐ[P.μ] B0.condExpGiven (fun ω => I0 ω * Y ω) P.μ := by exact (B0.condExpGiven_congr_ae hrev_B1).trans htower have hcfY_n : (S.toPODTRSystem.cfYBundle S.dbar).n = 1 := rfl let i0 : Fin (S.toPODTRSystem.cfYBundle S.dbar).n := ⟨0, by rw [hcfY_n]; exact Nat.one_pos⟩ let ψ : (∀ i : Fin (S.toPODTRSystem.cfYBundle S.dbar).n, (S.toPODTRSystem.cfYBundle S.dbar).type i) → ℝ := fun f => (f i0 : ℝ) have hψ_meas : Measurable ψ := by change Measurable (fun f : (∀ i, (S.toPODTRSystem.cfYBundle S.dbar).type i) => (f i0 : ℝ)) exact measurable_pi_apply i0 have hYof_eq_proj : S.toPODTRSystem.Y_of S.dbar = ψ ∘ (S.toPODTRSystem.cfYBundle S.dbar).jointValue := by funext ω rfl have hCI : CondIndepFun B0.sigma B0.sigma_le (S.toPODTRSystem.factualD ⟨0, by decide⟩) Y P.μ := by have hproj := (hA.exch S.dbar ⟨0, by decide⟩).project (ψ := ψ) hψ_meas change CondIndepFun B0.sigma B0.sigma_le (S.toPODTRSystem.factualD ⟨0, by decide⟩) (S.toPODTRSystem.Y_of S.dbar) P.μ rw [hYof_eq_proj] exact hproj let u : δ → ℝ := ({S.dbar ⟨0, by decide⟩} : Set δ).indicator (fun _ => (1 : ℝ)) have hu_meas : Measurable u := measurable_const.indicator (MeasurableSet.singleton _) have hu_eq : (fun ω => u (S.toPODTRSystem.factualD ⟨0, by decide⟩ ω)) = I0 := by funext ω by_cases h : S.toPODTRSystem.factualD ⟨0, by decide⟩ ω = S.dbar ⟨0, by decide⟩ · have h1 : S.toPODTRSystem.factualD ⟨0, by decide⟩ ω ∈ ({S.dbar ⟨0, by decide⟩} : Set δ) := h have h2 : ω ∈ (S.toPODTRSystem.dVar ⟨0, by decide⟩).event (S.dbar ⟨0, by decide⟩) := h rw [show u (S.toPODTRSystem.factualD ⟨0, by decide⟩ ω) = (1 : ℝ) from Set.indicator_of_mem h1 _, show I0 ω = (1 : ℝ) from by simpa [I0] using (S.toPODTRSystem.dVar ⟨0, by decide⟩).indicator_apply_eq_one h2] · have h1 : S.toPODTRSystem.factualD ⟨0, by decide⟩ ω ∉ ({S.dbar ⟨0, by decide⟩} : Set δ) := h have h2 : ω ∉ (S.toPODTRSystem.dVar ⟨0, by decide⟩).event (S.dbar ⟨0, by decide⟩) := h rw [show u (S.toPODTRSystem.factualD ⟨0, by decide⟩ ω) = (0 : ℝ) from Set.indicator_of_notMem h1 _, show I0 ω = (0 : ℝ) from by simpa [I0] using (S.toPODTRSystem.dVar ⟨0, by decide⟩).indicator_apply_eq_zero h2] have hfact : P.μ[fun ω => u (S.toPODTRSystem.factualD ⟨0, by decide⟩ ω) * Y ω | B0.sigma] =ᵐ[P.μ] P.μ[fun ω => u (S.toPODTRSystem.factualD ⟨0, by decide⟩ ω) | B0.sigma] * P.μ[Y | B0.sigma] := condExp_mul_of_condIndep (μ := P.μ) (m := B0.sigma) B0.sigma_le (f := S.toPODTRSystem.factualD ⟨0, by decide⟩) (g := Y) (S.toPODTRSystem.measurable_factualD ⟨0, by decide⟩) (by simpa [Y] using S.toPODTRSystem.measurable_Y_of S.dbar) hCI (u := u) (v := id) hu_meas measurable_id (by rw [hu_eq]; exact hI0_int) hY_int (by change Integrable (fun ω => u (S.toPODTRSystem.factualD ⟨0, by decide⟩ ω) * Y ω) P.μ have heq : (fun ω => u (S.toPODTRSystem.factualD ⟨0, by decide⟩ ω) * Y ω) = (fun ω => I0 ω * Y ω) := by funext ω rw [congr_fun hu_eq ω] rw [heq] exact hI0Y_int) have hExch : B0.condExpGiven (fun ω => I0 ω * Y ω) P.μ =ᵐ[P.μ] (fun ω => B0.condExpGiven I0 P.μ ω * B0.condExpGiven Y P.μ ω) := by unfold POCFBundle.condExpGiven have hprod_rw : (fun ω => u (S.toPODTRSystem.factualD ⟨0, by decide⟩ ω) * Y ω) = (fun ω => I0 ω * Y ω) := by funext ω rw [congr_fun hu_eq ω] rw [hprod_rw, hu_eq] at hfact filter_upwards [hfact] with ω hω simpa [Pi.mul_apply] using hω have hCE_I0M1 : B0.condExpGiven (fun ω => I0 ω * M1 ω) P.μ =ᵐ[P.μ] (fun ω => S.e₀_val (S.toPODTRSystem.factualS ⟨0, by decide⟩ ω) * S.μ₀_val (S.toPODTRSystem.factualS ⟨0, by decide⟩ ω)) := by refine hCE_I0M1_to_Y.trans ?_ filter_upwards [hExch, S.e₀_compat, S.μ₀_compat hA] with ω hE he hμ rw [hE, he, hμ] have hM0_sm_B0 : StronglyMeasurable[B0.sigma] M0 := by have hs0 : Measurable[B0.sigma] (S.toPODTRSystem.factualS ⟨0, by decide⟩) := S.toPODTRSystem.measurable_factualS_sigma_history 0 (by decide) ⟨0, by decide⟩ (by decide) exact (S.μ₀_meas.comp hs0).stronglyMeasurable have hpull_M0 := B0.condExpGiven_mul_of_stronglyMeasurable_right (f := I0) (g := M0) hM0_sm_B0 hI0M0_int hI0_int have hCE_I0M0 : B0.condExpGiven (fun ω => I0 ω * M0 ω) P.μ =ᵐ[P.μ] (fun ω => S.e₀_val (S.toPODTRSystem.factualS ⟨0, by decide⟩ ω) * S.μ₀_val (S.toPODTRSystem.factualS ⟨0, by decide⟩ ω)) := by filter_upwards [hpull_M0, S.e₀_compat] with ω hp he have hp' : B0.condExpGiven (fun ω => I0 ω * M0 ω) P.μ ω = B0.condExpGiven I0 P.μ ω * M0 ω := by exact hp rw [hp', he] rw [show (fun ω => (S.toPODTRSystem.dVar ⟨0, by decide⟩).indicator (S.dbar ⟨0, by decide⟩) ω * (S.μ₁_val (S.toPODTRSystem.factualS ⟨1, by decide⟩ ω, S.toPODTRSystem.factualD ⟨0, by decide⟩ ω, S.toPODTRSystem.factualS ⟨0, by decide⟩ ω) - S.μ₀_val (S.toPODTRSystem.factualS ⟨0, by decide⟩ ω))) = (fun ω => I0 ω * (M1 ω - M0 ω)) by rfl] rw [hres_eq] refine hsub.trans ?_ filter_upwards [hCE_I0M1, hCE_I0M0] with ω h1 h0 -- … truncated; follow the source link for the rest … -
cond_exp_residual_zero_stage1lemma — Stage-1 residual conditional expectation is zero a.s.: under DTR assumptions, the σ(historyBundle 1)-conditional expectation of 1{D₀ = dbar 0} · 1{D₁ = dbar 1} · (factualY − μ₁_val(S₁,D₀,S₀)) is zero a.s.hypothesesS :DTREstimationSystem P δ γε :ℝh_overlap :S.StrictOverlap εhA :S.toPODTRSystem.Assumptionsh_y2 :Integrable (fun ω => (S.toPODTRSystem.factualY ω) ^ 2) P.μconclusion(S.toPODTRSystem.historyBundle 1 (by decide)).condExpGiven (fun ω => (S.toPODTRSystem.dVar ⟨0, by decide⟩).indicator (S.dbar ⟨0, by decide⟩) ω * ((S.toPODTRSystem.dVar ⟨1, by decide⟩).indicator (S.dbar ⟨1, by decide⟩) ω * (S.toPODTRSystem.factualY ω - S.μ₁_val (S.toPODTRSystem.factualS ⟨1, by decide⟩ ω, S.toPODTRSystem.factualD ⟨0, by decide⟩ ω, S.toPODTRSystem.factualS ⟨0, by decide⟩ ω)))) P.μ=ᵐ[P.μ] (fun _ => (0 : ℝ))Proof (Lean source)
lemma cond_exp_residual_zero_stage1 (S : DTREstimationSystem P δ γ) {ε : ℝ} (h_overlap : S.StrictOverlap ε) (hA : S.toPODTRSystem.Assumptions) (h_y2 : Integrable (fun ω => (S.toPODTRSystem.factualY ω) ^ 2) P.μ) : (S.toPODTRSystem.historyBundle 1 (by decide)).condExpGiven (fun ω => (S.toPODTRSystem.dVar ⟨0, by decide⟩).indicator (S.dbar ⟨0, by decide⟩) ω * ((S.toPODTRSystem.dVar ⟨1, by decide⟩).indicator (S.dbar ⟨1, by decide⟩) ω * (S.toPODTRSystem.factualY ω - S.μ₁_val (S.toPODTRSystem.factualS ⟨1, by decide⟩ ω, S.toPODTRSystem.factualD ⟨0, by decide⟩ ω, S.toPODTRSystem.factualS ⟨0, by decide⟩ ω)))) P.μ =ᵐ[P.μ] (fun _ => (0 : ℝ)) := by let B1 := S.toPODTRSystem.historyBundle 1 (by decide) let I0 : P.Ω → ℝ := (S.toPODTRSystem.dVar ⟨0, by decide⟩).indicator (S.dbar ⟨0, by decide⟩) let I1 : P.Ω → ℝ := (S.toPODTRSystem.dVar ⟨1, by decide⟩).indicator (S.dbar ⟨1, by decide⟩) let Y : P.Ω → ℝ := S.toPODTRSystem.Y_of S.dbar let Yf : P.Ω → ℝ := S.toPODTRSystem.factualY let M1 : P.Ω → ℝ := fun ω => S.μ₁_val (S.toPODTRSystem.factualS ⟨1, by decide⟩ ω, S.toPODTRSystem.factualD ⟨0, by decide⟩ ω, S.toPODTRSystem.factualS ⟨0, by decide⟩ ω) have hY_int : Integrable Y P.μ := by simpa [Y] using hA.integrable_Y S.dbar have hYf_int : Integrable Yf P.μ := by simpa [Yf] using hA.integrable_factualY have hI0_int : Integrable I0 P.μ := by simpa [I0] using (S.toPODTRSystem.dVar ⟨0, by decide⟩).integrable_indicator (S.dbar ⟨0, by decide⟩) have hI1_int : Integrable I1 P.μ := by simpa [I1] using (S.toPODTRSystem.dVar ⟨1, by decide⟩).integrable_indicator (S.dbar ⟨1, by decide⟩) have hM1_int : Integrable M1 P.μ := by have hM1_L2 : MemLp M1 2 P.μ := by simpa [M1] using (S.stageOneReg_memLp h_overlap h_y2).ae_eq (S.μ₁_val_comp_eq_stageOneReg).symm exact hM1_L2.integrable (by norm_num) have hM1_meas : Measurable M1 := by have hs1 := S.toPODTRSystem.measurable_factualS ⟨1, by decide⟩ have hd0 := S.toPODTRSystem.measurable_factualD ⟨0, by decide⟩ have hs0 := S.toPODTRSystem.measurable_factualS ⟨0, by decide⟩ exact S.μ₁_meas.comp (hs1.prod (hd0.prod hs0)) have hI1Y_int : Integrable (fun ω => I1 ω * Y ω) P.μ := by have h := (S.toPODTRSystem.dVar ⟨1, by decide⟩).integrable_mul_indicator (S.dbar ⟨1, by decide⟩) (MeasurableSet.singleton _) hY_int exact h.congr (Filter.Eventually.of_forall (fun ω => by simp [I1, Y, mul_comm])) have hI1Yf_int : Integrable (fun ω => I1 ω * Yf ω) P.μ := by have h := (S.toPODTRSystem.dVar ⟨1, by decide⟩).integrable_mul_indicator (S.dbar ⟨1, by decide⟩) (MeasurableSet.singleton _) hYf_int exact h.congr (Filter.Eventually.of_forall (fun ω => by simp [I1, Yf, mul_comm])) have hI1M1_int : Integrable (fun ω => I1 ω * M1 ω) P.μ := by have h := (S.toPODTRSystem.dVar ⟨1, by decide⟩).integrable_mul_indicator (S.dbar ⟨1, by decide⟩) (MeasurableSet.singleton _) hM1_int exact h.congr (Filter.Eventually.of_forall (fun ω => by simp [I1, M1, mul_comm])) have hI0I1Y_int : Integrable (fun ω => I0 ω * (I1 ω * Y ω)) P.μ := by have hmeas : Measurable (fun ω => I1 ω * Y ω) := ((S.toPODTRSystem.dVar ⟨1, by decide⟩).measurable_indicator (S.dbar ⟨1, by decide⟩) (MeasurableSet.singleton _)).mul (by simpa [Y] using S.toPODTRSystem.measurable_Y_of S.dbar) have h := (S.toPODTRSystem.dVar ⟨0, by decide⟩).integrable_mul_indicator (S.dbar ⟨0, by decide⟩) (MeasurableSet.singleton _) hI1Y_int exact h.congr (Filter.Eventually.of_forall (fun ω => by simp [I0, I1, Y, mul_comm, mul_left_comm])) have hI0I1Yf_int : Integrable (fun ω => I0 ω * (I1 ω * Yf ω)) P.μ := by have hmeas : Measurable (fun ω => I1 ω * Yf ω) := ((S.toPODTRSystem.dVar ⟨1, by decide⟩).measurable_indicator (S.dbar ⟨1, by decide⟩) (MeasurableSet.singleton _)).mul (by simpa [Yf] using S.toPODTRSystem.measurable_factualY) have h := (S.toPODTRSystem.dVar ⟨0, by decide⟩).integrable_mul_indicator (S.dbar ⟨0, by decide⟩) (MeasurableSet.singleton _) hI1Yf_int exact h.congr (Filter.Eventually.of_forall (fun ω => by simp [I0, I1, Yf, mul_comm, mul_left_comm])) have hI0I1M1_int : Integrable (fun ω => I0 ω * (I1 ω * M1 ω)) P.μ := by have hmeas : Measurable (fun ω => I1 ω * M1 ω) := ((S.toPODTRSystem.dVar ⟨1, by decide⟩).measurable_indicator (S.dbar ⟨1, by decide⟩) (MeasurableSet.singleton _)).mul hM1_meas have h := (S.toPODTRSystem.dVar ⟨0, by decide⟩).integrable_mul_indicator (S.dbar ⟨0, by decide⟩) (MeasurableSet.singleton _) hI1M1_int exact h.congr (Filter.Eventually.of_forall (fun ω => by simp [I0, I1, M1, mul_comm])) have hres_eq : (fun ω => I0 ω * (I1 ω * (Yf ω - M1 ω))) = (fun ω => I0 ω * (I1 ω * Yf ω) - I0 ω * (I1 ω * M1 ω)) := by funext ω ring have hsub : B1.condExpGiven (fun ω => I0 ω * (I1 ω * Yf ω) - I0 ω * (I1 ω * M1 ω)) P.μ =ᵐ[P.μ] B1.condExpGiven (fun ω => I0 ω * (I1 ω * Yf ω)) P.μ - B1.condExpGiven (fun ω => I0 ω * (I1 ω * M1 ω)) P.μ := by simp only [POCFBundle.condExpGiven] exact MeasureTheory.condExp_sub hI0I1Yf_int hI0I1M1_int B1.sigma have hConsistency : (fun ω => Yf ω * S.toPODTRSystem.indD S.dbar 2 ω) = (fun ω => Y ω * S.toPODTRSystem.indD S.dbar 2 ω) := by have h := POVar.factual_mul_indicator_eq_cf_mul_indicator hA.consistency S.toPODTRSystem.yVar (S.toPODTRSystem.regime S.dbar) (S.toPODTRSystem.yVar_notMem_regime S.dbar) {ω | ∀ i : Fin 2, S.toPODTRSystem.factualD i ω = S.dbar i} (S.toPODTRSystem.factualAgrees_regime S.dbar) have hrewrite : S.toPODTRSystem.indD S.dbar 2 = ({ω | ∀ i : Fin 2, S.toPODTRSystem.factualD i ω = S.dbar i}).indicator (fun _ => (1 : ℝ)) := by have h0 := S.toPODTRSystem.indD_eq_indicator_event S.dbar 2 (le_refl 2) have h_set_eq : ({ω | ∀ i : Fin 2, i.val < 2 → S.toPODTRSystem.factualD i ω = S.dbar i}) = {ω | ∀ i : Fin 2, S.toPODTRSystem.factualD i ω = S.dbar i} := by ext ω refine ⟨fun hω i => hω i i.isLt, fun hω i _ => hω i⟩ rw [h0, h_set_eq] change (fun ω => S.toPODTRSystem.factualY ω * S.toPODTRSystem.indD S.dbar 2 ω) = (fun ω => S.toPODTRSystem.Y_of S.dbar ω * S.toPODTRSystem.indD S.dbar 2 ω) rw [hrewrite] exact h have hIndD2_factor : S.toPODTRSystem.indD S.dbar 2 = fun ω => I0 ω * I1 ω := by funext ω have hsplit1 := congr_fun (S.toPODTRSystem.indD_factor_split S.dbar 1 (by decide)) ω have hsplit0 := congr_fun (S.toPODTRSystem.indD_factor_split S.dbar 0 (by decide)) ω rw [hsplit1, hsplit0] have hzero : S.toPODTRSystem.indD S.dbar 0 ω = 1 := rfl rw [hzero] ring have hFact_to_cf : (fun ω => I0 ω * (I1 ω * Yf ω)) =ᵐ[P.μ] (fun ω => I0 ω * (I1 ω * Y ω)) := by exact Filter.Eventually.of_forall (fun ω => by have hc := congr_fun hConsistency ω rw [hIndD2_factor] at hc change Yf ω * (I0 ω * I1 ω) = Y ω * (I0 ω * I1 ω) at hc nlinarith [hc]) have hCE_fact_to_cf : B1.condExpGiven (fun ω => I0 ω * (I1 ω * Yf ω)) P.μ =ᵐ[P.μ] B1.condExpGiven (fun ω => I0 ω * (I1 ω * Y ω)) P.μ := B1.condExpGiven_congr_ae hFact_to_cf have hI0_sm_B1 : StronglyMeasurable[B1.sigma] I0 := by simpa [B1, I0] using S.toPODTRSystem.stronglyMeasurable_indicator_dVar_sigma_history 1 (by decide) ⟨0, by decide⟩ (by decide) (S.dbar ⟨0, by decide⟩) have hM1_sm_B1 : StronglyMeasurable[B1.sigma] M1 := by have hs1 : Measurable[B1.sigma] (S.toPODTRSystem.factualS ⟨1, by decide⟩) := S.toPODTRSystem.measurable_factualS_sigma_history 1 (by decide) ⟨1, by decide⟩ (by decide) have hd0 : Measurable[B1.sigma] (S.toPODTRSystem.factualD ⟨0, by decide⟩) := S.toPODTRSystem.measurable_factualD_sigma_history 1 (by decide) ⟨0, by decide⟩ (by decide) have hs0 : Measurable[B1.sigma] (S.toPODTRSystem.factualS ⟨0, by decide⟩) := S.toPODTRSystem.measurable_factualS_sigma_history 1 (by decide) ⟨0, by decide⟩ (by decide) exact (S.μ₁_meas.comp (hs1.prod (hd0.prod hs0))).stronglyMeasurable have hI0M1_sm_B1 : StronglyMeasurable[B1.sigma] (fun ω => I0 ω * M1 ω) := hI0_sm_B1.mul hM1_sm_B1 have hcfY_n : (S.toPODTRSystem.cfYBundle S.dbar).n = 1 := rfl let i0 : Fin (S.toPODTRSystem.cfYBundle S.dbar).n := ⟨0, by rw [hcfY_n]; exact Nat.one_pos⟩ let ψ : (∀ i : Fin (S.toPODTRSystem.cfYBundle S.dbar).n, (S.toPODTRSystem.cfYBundle S.dbar).type i) → ℝ := fun f => (f i0 : ℝ) have hψ_meas : Measurable ψ := by change Measurable (fun f : (∀ i, (S.toPODTRSystem.cfYBundle S.dbar).type i) => (f i0 : ℝ)) exact measurable_pi_apply i0 have hYof_eq_proj : S.toPODTRSystem.Y_of S.dbar = ψ ∘ (S.toPODTRSystem.cfYBundle S.dbar).jointValue := by funext ω rfl have hCI : CondIndepFun B1.sigma B1.sigma_le (S.toPODTRSystem.factualD ⟨1, by decide⟩) Y P.μ := by have hproj := (hA.exch S.dbar ⟨1, by decide⟩).project (ψ := ψ) hψ_meas change CondIndepFun B1.sigma B1.sigma_le (S.toPODTRSystem.factualD ⟨1, by decide⟩) (S.toPODTRSystem.Y_of S.dbar) P.μ rw [hYof_eq_proj] exact hproj let u : δ → ℝ := ({S.dbar ⟨1, by decide⟩} : Set δ).indicator (fun _ => (1 : ℝ)) have hu_meas : Measurable u := measurable_const.indicator (MeasurableSet.singleton _) have hu_eq : (fun ω => u (S.toPODTRSystem.factualD ⟨1, by decide⟩ ω)) = I1 := by funext ω by_cases h : S.toPODTRSystem.factualD ⟨1, by decide⟩ ω = S.dbar ⟨1, by decide⟩ · have h1 : S.toPODTRSystem.factualD ⟨1, by decide⟩ ω ∈ ({S.dbar ⟨1, by decide⟩} : Set δ) := h have h2 : ω ∈ (S.toPODTRSystem.dVar ⟨1, by decide⟩).event (S.dbar ⟨1, by decide⟩) := h rw [show u (S.toPODTRSystem.factualD ⟨1, by decide⟩ ω) = (1 : ℝ) from Set.indicator_of_mem h1 _, show I1 ω = (1 : ℝ) from by simpa [I1] using (S.toPODTRSystem.dVar ⟨1, by decide⟩).indicator_apply_eq_one h2] · have h1 : S.toPODTRSystem.factualD ⟨1, by decide⟩ ω ∉ ({S.dbar ⟨1, by decide⟩} : Set δ) := h have h2 : ω ∉ (S.toPODTRSystem.dVar ⟨1, by decide⟩).event (S.dbar ⟨1, by decide⟩) := h rw [show u (S.toPODTRSystem.factualD ⟨1, by decide⟩ ω) = (0 : ℝ) from Set.indicator_of_notMem h1 _, show I1 ω = (0 : ℝ) from by simpa [I1] using (S.toPODTRSystem.dVar ⟨1, by decide⟩).indicator_apply_eq_zero h2] have hfact : P.μ[fun ω => u (S.toPODTRSystem.factualD ⟨1, by decide⟩ ω) * Y ω | B1.sigma] =ᵐ[P.μ] P.μ[fun ω => u (S.toPODTRSystem.factualD ⟨1, by decide⟩ ω) | B1.sigma] * P.μ[Y | B1.sigma] := condExp_mul_of_condIndep (μ := P.μ) (m := B1.sigma) B1.sigma_le (f := S.toPODTRSystem.factualD ⟨1, by decide⟩) (g := Y) (S.toPODTRSystem.measurable_factualD ⟨1, by decide⟩) (by simpa [Y] using S.toPODTRSystem.measurable_Y_of S.dbar) hCI (u := u) (v := id) hu_meas measurable_id (by rw [hu_eq]; exact hI1_int) hY_int (by have heq : (fun ω => u (S.toPODTRSystem.factualD ⟨1, by decide⟩ ω) * Y ω) = (fun ω => I1 ω * Y ω) := by funext ω rw [congr_fun hu_eq ω] change Integrable -- … truncated; follow the source link for the rest … -
theta_zero_factualS₀_integrallemma — The DTR estimand θ₀ = E[Y(dbar)] lifts to an integral against P.μ: under DTR backdoor assumptions, θ₀ = ∫ ω, μ₀_val(factualS 0 ω) ∂P.μ, since μ₀_val ∘ factualS 0 is the σ(historyBundle 0)-conditional expectation of Y_of dbar and P.μ is a probability measure.hypothesesS :DTREstimationSystem P δ γhA :S.toPODTRSystem.AssumptionsconclusionS.θ₀ = ∫ ω, S.μ₀_val (S.toPODTRSystem.factualS ⟨0, by decide⟩ ω) ∂P.μProof (Lean source)
lemma theta_zero_factualS₀_integral (S : DTREstimationSystem P δ γ) (hA : S.toPODTRSystem.Assumptions) : S.θ₀ = ∫ ω, S.μ₀_val (S.toPODTRSystem.factualS ⟨0, by decide⟩ ω) ∂P.μ := by unfold DTREstimationSystem.θ₀ dtrEffect calc ∫ ω, S.toPODTRSystem.Y_of S.dbar ω ∂P.μ = ∫ ω, (S.toPODTRSystem.historyBundle 0 (by decide)).condExpGiven (S.toPODTRSystem.Y_of S.dbar) P.μ ω ∂P.μ := by exact (MeasureTheory.integral_condExp (S.toPODTRSystem.historyBundle 0 (by decide)).sigma_le).symm _ = ∫ ω, S.μ₀_val (S.toPODTRSystem.factualS ⟨0, by decide⟩ ω) ∂P.μ := MeasureTheory.integral_congr_ae (S.μ₀_compat hA)
RemainderBound 3 core · 0 supporting Bounds the sequential doubly robust second-order remainder for a two-stage dynamic-treatment-regime problem. ★ seqDR_remainder_bound★ seqDR_remainder_op
Bounds the sequential doubly robust second-order remainder for a two-stage
dynamic-treatment-regime problem. The constants track overlap and stagewise
nuisance errors in the DTR product-rate condition. The main declarations are
seqDR_rem_const, seqDR_remainder_bound, and the random-nuisance
stochastic-order corollary seqDR_remainder_op.
Sequential DR (DTR, n = 2) remainder constant for strict overlap ε.
Definition (Lean source)
Sequential DR (DTR, n = 2) remainder bound. Consider a two-stage dynamic treatment-regime estimation system satisfying the sequential causal assumptions, for which the stage-0 and stage-1 propensity scores are bounded within a margin ε of 0 and 1 (strict overlap), and where the factual outcome and the potential outcome under every fixed treatment regime each have finite second moment. For any candidate nuisance vector η whose propensities likewise lie in this strict-overlap band, and whose stage-0 outcome-regression error, stage-1 outcome-regression error, stage-0 propensity error, and stage-1 propensity error are each square-integrable against the corresponding stage's history law, the absolute value of the population sequential doubly robust moment at η and the true target θ₀ is at most an explicit O(ε⁻²) constant times the sum of the two stagewise outcome-regression L² errors, times the sum of the two stagewise propensity L² errors.
Formal statement
Proof (Lean source)
Sequential DR remainder is o_p(n^{-1/2}) under the two-stage product rate. Consider a two-stage dynamic treatment-regime estimation system satisfying the sequential causal assumptions, for which the stage-0 and stage-1 propensity scores are bounded within a margin ε of 0 and 1 (strict overlap), and where the factual outcome and the potential outcome under every fixed treatment regime each have finite second moment. Let η̂ₙ be a sequence of sample-size-indexed, possibly random, candidate nuisance vectors that always land in the strict-overlap band, for every sample size and every outcome of the underlying randomness, with stage-0 outcome-regression error, stage-1 outcome-regression error, stage-0 propensity error, and stage-1 propensity error each square-integrable against the corresponding stage's history law at every sample size and outcome. If the four stagewise L² products of outcome-regression and propensity error — own-stage at stage 0, own-stage at stage 1, stage-0 outcome-regression with stage-1 propensity, and stage-1 outcome-regression with stage-0 propensity — are each o_p(n^{-1/2}), then the population sequential doubly robust moment evaluated at the random nuisance η̂ₙ is itself o_p(n^{-1/2}).
Formal statement
Proof (Lean source)
ScorePullout 4 core · 0 supporting This module proves the conditioning identities that collapse the weighted residual and treatment-indicator terms in the sequential doubly robust DTR score. ★ weighted_residual_integral_zero_stage0★ indicator_to_propScore_integral_stage0★ weighted_residual_integral_zero_stage1★ indicator_to_propScore_integral_stage1
Score pull-out identities for two-stage DTR scores
This module proves the conditioning identities that collapse the weighted
residual and treatment-indicator terms in the sequential doubly robust DTR
score. The stage-0 results
DTREstimationSystem.weighted_residual_integral_zero_stage0 and
DTREstimationSystem.indicator_to_propScore_integral_stage0 condition on the
initial history S₀; the stage-1 results
DTREstimationSystem.weighted_residual_integral_zero_stage1 and
DTREstimationSystem.indicator_to_propScore_integral_stage1 condition on the
history (S₁, D₀, S₀).
These lemmas move treatment indicators, history sigma-algebras, and regression residuals into forms suitable for the DTR mean-zero and remainder proofs.
Stage-0 weighted-residual integral vanishes. Let S be a two-stage dynamic-treatment-regime estimation system with strict overlap at level ε, satisfying the system's core identification assumptions (consistency, sequential exchangeability, positivity), and in which the observed outcome has finite second moment. For any weight function g on the stage-0 history that is measurable and for which the product g(S₀) · 1{D₀ = dbar 0} · (μ₁_val(S₁,D₀,S₀) − μ₀_val(S₀)) is integrable, then its expectation under P.μ is zero: the stage-0-weighted, treatment-indicator-gated gap between the stage-1 and stage-0 regression functions has zero mean.
Formal statement
Proof (Lean source)
Stage-0 indicator-to-propensity rewrite. Let S be a two-stage dynamic-treatment-regime estimation system and let f be a real-valued function of the stage-0 history that is measurable and for which the product f(S₀) · 1{D₀ = dbar 0} is integrable. Then the expectation of f(S₀) times the indicator of following the target stage-0 treatment dbar 0 equals the expectation of f(S₀) times the true stage-0 propensity score e₀_val(S₀).
Formal statement
Proof (Lean source)
Stage-1 weighted-residual integral vanishes. Let S be a two-stage dynamic-treatment-regime estimation system with strict overlap at level ε, satisfying the system's core identification assumptions (consistency, sequential exchangeability, positivity), and in which the observed outcome has finite second moment. For any weight function g on the stage-1 history (S₁,D₀,S₀) that is measurable and for which the product g(S₁,D₀,S₀) · 1{D₀ = dbar 0} · 1{D₁ = dbar 1} · (Y − μ₁_val(S₁,D₀,S₀)) is integrable, then its expectation under P.μ is zero: the doubly indicator-gated stage-1 outcome residual, weighted by g, has zero mean.
Formal statement
Proof (Lean source)
Stage-1 indicator-to-propensity rewrite. Let S be a two-stage dynamic-treatment-regime estimation system and let f be a real-valued function of the stage-1 history (S₁,D₀,S₀) that is measurable and for which the product f(S₁,D₀,S₀) · 1{D₁ = dbar 1} is integrable. Then the expectation of f(S₁,D₀,S₀) times the indicator of following the target stage-1 treatment dbar 1 equals the expectation of f(S₁,D₀,S₀) times the true stage-1 propensity score e₁_val(S₁,D₀,S₀).