PO.ID.Exact.Partial­Linear

Partially linear continuous-treatment identification: the potential-outcome setup, homogeneous dose-response restriction, Robinson residualization, and slope-identification theorem.

Setup 13 core · 9 supporting This file provides the potential-outcome substrate for the partially linear model with a real-valued treatment. ★ POPartialLinearSystem★ POPartialLinearModel★ causal_homogeneity

Partially Linear Model Setup

This file provides the potential-outcome substrate for the partially linear model with a real-valued treatment. POPartialLinearSystem records the treatment, outcome, and covariate nodes; packages them as dVar, yVar, and xVar; defines potential outcomes YofD, factual maps, and the sigma-algebras sigmaX and sigmaXD; and proves the measurability and inclusion lemmas used by the identification proof.

POPartialLinearModel adds the homogeneous structural restriction Y(d) = b(X) + theta * d + U, a conditional-mean backdoor assumption, and consistency. Its two exported consequences are factualY_eq, the observed-data regression form, and causal_homogeneity, the constant per-unit causal effect identity.

structure POPartialLinearSystem reviewed
Causalean.PO

Continuous-treatment backdoor subsystem. Inside a potential-outcome system, this bundles a real-valued treatment node D, a real-valued outcome node Y, and a covariate variable X taking values in an arbitrary measurable space, subject to the treatment, outcome, and covariate being pairwise distinct. This mirrors the binary backdoor subsystem but the treatment now ranges over the real line, as required by the partially linear model Y = g(X) + θ·D + noise.

Definition (Lean source)
P :
γ :
The treatment node.
D :
P.V
The outcome node.
Y :
P.V
The covariate variable, valued in the covariate space.
Xvar :
POVar P γ
The treatment node's value space is the real line.
hDreal :
P.X D ≃ᵐ ℝ
The outcome node's value space is the real line.
hYreal :
P.X Y ≃ᵐ ℝ
Treatment and outcome are distinct nodes.
hDY :
D ≠ Y
Treatment and covariate are distinct nodes.
hDX :
D ≠ Xvar.v
Outcome and covariate are distinct nodes.
hYX :
Y ≠ Xvar.v
Causalean.PO.POPartialLinearSystem · Causalean/PO/ID/Exact/PartialLinear/Setup.lean:48 · uses POSystem
def dVar reviewed
Causalean.PO.POPartialLinearSystem

The treatment regarded as a real-valued potential-outcome variable.

Definition (Lean source)
def dVar : POVar P ℝ := ⟨S.D, S.hDreal⟩
def yVar reviewed
Causalean.PO.POPartialLinearSystem

The outcome regarded as a real-valued potential-outcome variable.

Definition (Lean source)
def yVar : POVar P ℝ := ⟨S.Y, S.hYreal⟩
def xVar reviewed
Causalean.PO.POPartialLinearSystem

The covariate regarded as a potential-outcome variable.

Definition (Lean source)
def xVar : POVar P γ := S.Xvar
def YofD reviewed
Causalean.PO.POPartialLinearSystem

The potential outcome under dose d: the value the outcome would take were the treatment set to the real number d.

Definition (Lean source)
noncomputable def YofD (d : ℝ) : P.Ω → ℝ := S.yVar.cfUnder S.dVar d
def factualD reviewed
Causalean.PO.POPartialLinearSystem

The factual (observed) treatment level of each unit.

Definition (Lean source)
noncomputable def factualD : P.Ω → ℝ := S.dVar.factual
def factualY reviewed
Causalean.PO.POPartialLinearSystem

The factual (observed) outcome of each unit.

Definition (Lean source)
noncomputable def factualY : P.Ω → ℝ := S.yVar.factual
def factualX reviewed
Causalean.PO.POPartialLinearSystem

The factual (observed) covariate of each unit.

Definition (Lean source)
noncomputable def factualX : P.Ω → γ := S.xVar.factual
def sigmaX reviewed
Causalean.PO.POPartialLinearSystem

The σ-algebra generated by the observed covariate.

Definition (Lean source)
noncomputable def sigmaX : MeasurableSpace P.Ω := comap S.factualX inferInstance
def factualXD reviewed
Causalean.PO.POPartialLinearSystem

The joint observed covariate-and-treatment map ω ↦ (X(ω), D(ω)).

Definition (Lean source)
noncomputable def factualXD : P.Ω → γ × ℝ := fun ω => (S.factualX ω, S.factualD ω)
def sigmaXD reviewed
Causalean.PO.POPartialLinearSystem

The σ-algebra generated by the observed covariate and treatment jointly.

Definition (Lean source)
noncomputable def sigmaXD : MeasurableSpace P.Ω := comap S.factualXD inferInstance
structure POPartialLinearModel reviewed
Causalean.PO

Partially linear model under the backdoor PO framework. On top of the PO substrate, this bundles a measurable covariate function b giving the nonparametric baseline, a homogeneous per-unit treatment effect θ, a measurable structural error term U, the structural restriction that every unit's dose-response is the straight line Y(d) = b(X) + θ·d + U with the same slope for everyone, the standard backdoor (unconfoundedness) assumption that the structural error has zero mean conditional on the observed covariate and treatment, and consistency: the observed outcome is the potential outcome at the realized treatment.

Definition (Lean source)
P :
γ :
extends :
Consistency (SUTVA): the observed outcome equals the potential outcome of the realized treatment.
consistency :
P.Consistency
The covariate part `b(x)` of the structural dose-response (the nonparametric baseline `g(X)`).
b :
γ → ℝ
The covariate part is measurable.
b_meas :
The homogeneous (constant across units) per-unit treatment effect — the causal parameter the model is about.
θ :
The structural error term.
U :
P.Ω → ℝ
The structural error is measurable.
U_meas :
Homogeneous linear dose-response: for almost every unit, the potential outcome is the straight line `b(X) + θ·d + U` in the dose `d`, simultaneously for all doses.
structural :
∀ᵐ ω ∂P.μ,
∀ d : ℝ,
toPOPartialLinearSystem.YofD d ω = b (toPOPartialLinearSystem.factualX ω) + θ * d + U ω
Backdoor unconfoundedness in conditional-mean form: the structural error has zero mean given the observed covariate and treatment. This is the operative content of the standard backdoor assumption `U ⊥ D | σ(X)` together with `E[U | σ(X)] = 0`.
backdoor :
P.μ[U | toPOPartialLinearSystem.sigmaXD] =ᵐ[P.μ] 0
Causalean.PO.POPartialLinearModel · Causalean/PO/ID/Exact/PartialLinear/Setup.lean:139 · uses POSystem
lemma causal_homogeneity reviewed
Causalean.PO.POPartialLinearModel

Causal reading of θ. Almost surely, for every pair of dose levels, the difference of the corresponding potential outcomes equals the slope θ times the difference of the doses, so θ is the constant per-unit causal effect of the treatment.

Formal statement
∀ᵐ ω ∂P.μ, ∀ d d' : ℝ, M.YofD d ω - M.YofD d' ω = M.θ * (d - d')
Proof (Lean source)
lemma causal_homogeneity : ∀ᵐ ω ∂P.μ, ∀ d d' : ℝ, M.YofD d ω - M.YofD d' ω = M.θ * (d - d') := by filter_upwards [M.structural] with ω hω intro d d' rw [hω d, hω d'] ring
Causalean.PO.POPartialLinearModel.causal_homogeneity · Causalean/PO/ID/Exact/PartialLinear/Setup.lean:198 · uses POPartialLinearModel , YofD , POSystem
9 supporting declarations (lemmas, instances)
  • measurable_YofD lemma — The potential outcome under a fixed dose is measurable.
    d :
    Measurable (S.YofD d)
    Proof (Lean source)
    lemma measurable_YofD (d : ℝ) : Measurable (S.YofD d) := S.yVar.measurable_cfUnder S.dVar d
    Causalean.PO.POPartialLinearSystem.measurable_YofD · Causalean/PO/ID/Exact/PartialLinear/Setup.lean:94
  • measurable_factualD lemma — The factual treatment level is measurable.
    Measurable S.factualD
    Proof (Lean source)
    lemma measurable_factualD : Measurable S.factualD := S.dVar.measurable_factual
    Causalean.PO.POPartialLinearSystem.measurable_factualD · Causalean/PO/ID/Exact/PartialLinear/Setup.lean:97
  • measurable_factualY lemma — The factual outcome is measurable.
    Measurable S.factualY
    Proof (Lean source)
    lemma measurable_factualY : Measurable S.factualY := S.yVar.measurable_factual
    Causalean.PO.POPartialLinearSystem.measurable_factualY · Causalean/PO/ID/Exact/PartialLinear/Setup.lean:99
  • measurable_factualX lemma — The factual covariate is measurable.
    Measurable S.factualX
    Proof (Lean source)
    lemma measurable_factualX : Measurable S.factualX := S.xVar.measurable_factual
    Causalean.PO.POPartialLinearSystem.measurable_factualX · Causalean/PO/ID/Exact/PartialLinear/Setup.lean:101
  • sigmaX_le lemma — The covariate-generated sigma-algebra is a sub-sigma-algebra of the ambient space.
    S.sigmaX ≤ (inferInstance : MeasurableSpace P.Ω)
    Proof (Lean source)
    lemma sigmaX_le : S.sigmaX ≤ (inferInstance : MeasurableSpace P.Ω) := S.measurable_factualX.comap_le
    Causalean.PO.POPartialLinearSystem.sigmaX_le · Causalean/PO/ID/Exact/PartialLinear/Setup.lean:108
  • measurable_factualXD lemma — The joint observed covariate-and-treatment map is measurable.
    Measurable S.factualXD
    Proof (Lean source)
    lemma measurable_factualXD : Measurable S.factualXD := S.measurable_factualX.prodMk S.measurable_factualD
    Causalean.PO.POPartialLinearSystem.measurable_factualXD · Causalean/PO/ID/Exact/PartialLinear/Setup.lean:116
  • sigmaXD_le lemma — The joint covariate-treatment sigma-algebra is a sub-sigma-algebra of the ambient space.
    S.sigmaXD ≤ (inferInstance : MeasurableSpace P.Ω)
    Proof (Lean source)
    lemma sigmaXD_le : S.sigmaXD ≤ (inferInstance : MeasurableSpace P.Ω) := S.measurable_factualXD.comap_le
    Causalean.PO.POPartialLinearSystem.sigmaXD_le · Causalean/PO/ID/Exact/PartialLinear/Setup.lean:124
  • sigmaX_le_sigmaXD lemma — The covariate σ-algebra is contained in the joint covariate-treatment σ-algebra.
    S.sigmaX ≤ S.sigmaXD
    Proof (Lean source)
    lemma sigmaX_le_sigmaXD : S.sigmaX ≤ S.sigmaXD := by have h : S.factualX = fst ∘ S.factualXD := rfl unfold sigmaX sigmaXD rw [h, ← MeasurableSpace.comap_comp] exact MeasurableSpace.comap_mono measurable_fst.comap_le
    Causalean.PO.POPartialLinearSystem.sigmaX_le_sigmaXD · Causalean/PO/ID/Exact/PartialLinear/Setup.lean:129
  • factualY_eq lemma — The observed-data form of the structural model: almost surely Y = b(X) + θ·D + U. Obtained from the homogeneous dose-response evaluated at the realized treatment, using consistency Y = Y(D).
    M.factualY =ᵐ[P.μ] fun ω => M.b (M.factualX ω) + M.θ * M.factualD ω + M.U ω
    Proof (Lean source)
    lemma factualY_eq : M.factualY =ᵐ[P.μ] fun ω => M.b (M.factualX ω) + M.θ * M.factualD ω + M.U ω := by filter_upwards [M.structural] with ω hω have hcons : M.yVar.factual ω = M.yVar.cfUnder M.dVar (M.dVar.factual ω) ω := POVar.factual_eq_cfUnder_self_selected M.consistency M.yVar M.dVar (Ne.symm M.hDY) ω have hstr := hω (M.factualD ω) simpa [POPartialLinearSystem.factualY, POPartialLinearSystem.YofD, POPartialLinearSystem.factualD, POPartialLinearSystem.factualX] using hcons.trans hstr
    Causalean.PO.POPartialLinearModel.factualY_eq · Causalean/PO/ID/Exact/PartialLinear/Setup.lean:182
Identification 4 core · 6 supporting This file proves the population partialling-out bridge for the partially linear potential-outcome model. ★ robinson_estimand_eq_theta

Partialling-out identification

This file proves the population partialling-out bridge for the partially linear potential-outcome model. It defines the covariate regressions mReg and lReg, the treatment residual resid, and then proves the conditional mean-zero and orthogonality identities that drive Robinson's identification argument.

The important lemmas are condExp_U_sigmaX, condExp_resid_sigmaX, integral_U_resid, lReg_eq, factualY_sub_lReg, and integral_partialled. The main theorem robinson_estimand_eq_theta states that the population Robinson ratio E[(Y - lReg(X)) * (D - mReg(X))] / E[(D - mReg(X))^2] equals the structural slope theta when the residual second moment is nonzero.

def mReg reviewed
Causalean.PO.POPartialLinearModel

The treatment regression m₀(X) = E[D | σ(X)] (the conditional mean of the treatment given the covariate).

Definition (Lean source)
noncomputable def mReg : P.Ω → ℝ := P.μ[M.factualD | M.sigmaX]
def lReg reviewed
Causalean.PO.POPartialLinearModel

The outcome regression ℓ₀(X) = E[Y | σ(X)] (the conditional mean of the outcome given the covariate).

Definition (Lean source)
noncomputable def lReg : P.Ω → ℝ := P.μ[M.factualY | M.sigmaX]
def resid reviewed
Causalean.PO.POPartialLinearModel

The treatment residual V = D − m₀(X) (treatment with its covariate prediction partialled out).

Definition (Lean source)
noncomputable def resid : P.Ω → ℝ := fun ω => M.factualD ω - M.mReg ω
theorem robinson_estimand_eq_theta reviewed
Causalean.PO.POPartialLinearModel

The causal bridge. Given that the factual treatment is integrable, the outcome regression on covariates is integrable, the structural error U is integrable, the squared treatment residual is integrable, and the product of the structural error and the treatment residual is integrable, provided also that the treatment has residual variation, i.e. E[(D − m₀(X))²] ≠ 0, the Robinson partialling-out estimand equals the structural treatment effect θ. This is what makes the partially linear DML estimator target the causal parameter.

Formal statement
hD :
Integrable M.factualD P.μ
hbX :
Integrable (fun ω => M.b (M.factualX ω)) P.μ
hU :
Integrable M.U P.μ
hVsq :
Integrable (fun ω => M.resid ω ^ 2) P.μ
hUV :
Integrable (fun ω => M.U ω * M.resid ω) P.μ
hV :
∫ ω, M.resid ω ^ 2 ∂P.μ ≠ 0
(∫ ω, (M.factualY ω - M.lReg ω) * M.resid ω ∂P.μ) / (∫ ω, M.resid ω ^ 2 ∂P.μ) = M.θ
Proof (Lean source)
theorem robinson_estimand_eq_theta (hD : Integrable M.factualD P.μ) (hbX : Integrable (fun ω => M.b (M.factualX ω)) P.μ) (hU : Integrable M.U P.μ) (hVsq : Integrable (fun ω => M.resid ω ^ 2) P.μ) (hUV : Integrable (fun ω => M.U ω * M.resid ω) P.μ) (hV : ∫ ω, M.resid ω ^ 2 ∂P.μ ≠ 0) : (∫ ω, (M.factualY ω - M.lReg ω) * M.resid ω ∂P.μ) / (∫ ω, M.resid ω ^ 2 ∂P.μ) = M.θ := by rw [M.integral_partialled hD hbX hU hVsq hUV, mul_div_assoc, div_self hV, mul_one]
6 supporting declarations (lemmas, instances)
  • condExp_U_sigmaX lemma — The structural error has zero conditional mean given the covariate. Follows from the backdoor assumption E[U | σ(X,D)] = 0 by the tower property, since σ(X) ⊆ σ(X,D).
    P.μ[M.U | M.sigmaX] =ᵐ[P.μ] 0
    Proof (Lean source)
    lemma condExp_U_sigmaX : P.μ[M.U | M.sigmaX] =ᵐ[P.μ] 0 := by have htower : P.μ[P.μ[M.U | M.sigmaXD] | M.sigmaX] =ᵐ[P.μ] P.μ[M.U | M.sigmaX] := MeasureTheory.condExp_condExp_of_le M.sigmaX_le_sigmaXD M.sigmaXD_le have hinner : P.μ[P.μ[M.U | M.sigmaXD] | M.sigmaX] =ᵐ[P.μ] P.μ[(0 : P.Ω → ℝ) | M.sigmaX] := MeasureTheory.condExp_congr_ae M.backdoor refine htower.symm.trans (hinner.trans ?_) simp [MeasureTheory.condExp_zero]
    Causalean.PO.POPartialLinearModel.condExp_U_sigmaX · Causalean/PO/ID/Exact/PartialLinear/Identification.lean:69
  • condExp_resid_sigmaX lemma — The treatment residual is conditionally mean-zero given the covariate: E[D − m₀(X) | σ(X)] = 0. Immediate from condExp_sub and idempotence of the conditional expectation.
    hD :
    Integrable M.factualD P.μ
    P.μ[M.resid | M.sigmaX] =ᵐ[P.μ] 0
    Proof (Lean source)
    lemma condExp_resid_sigmaX (hD : Integrable M.factualD P.μ) : P.μ[M.resid | M.sigmaX] =ᵐ[P.μ] 0 := by have hresid_eq : M.resid = M.factualD - M.mReg := rfl rw [hresid_eq] have hsub : P.μ[M.factualD - M.mReg | M.sigmaX] =ᵐ[P.μ] P.μ[M.factualD | M.sigmaX] - P.μ[M.mReg | M.sigmaX] := MeasureTheory.condExp_sub hD MeasureTheory.integrable_condExp M.sigmaX have hidem : P.μ[M.mReg | M.sigmaX] =ᵐ[P.μ] M.mReg := by unfold mReg exact MeasureTheory.condExp_condExp_of_le le_rfl M.sigmaX_le refine hsub.trans ?_ have : P.μ[M.factualD | M.sigmaX] = M.mReg := rfl rw [this] filter_upwards [hidem] with ω hω simp [Pi.sub_apply, hω]
    Causalean.PO.POPartialLinearModel.condExp_resid_sigmaX · Causalean/PO/ID/Exact/PartialLinear/Identification.lean:82
  • integral_U_resid lemma — Orthogonality of the structural error to the covariate-treatment residual: E[U·(D − m₀(X))] = 0. Since the residual is σ(X,D)-measurable and E[U | σ(X,D)] = 0, the product integrates to zero (pull the residual out of the conditional expectation, then integrate).
    hU :
    Integrable M.U P.μ
    hUV :
    Integrable (fun ω => M.U ω * M.resid ω) P.μ
    ∫ ω, M.U ω * M.resid ω ∂P.μ = 0
    Proof (Lean source)
    lemma integral_U_resid (hU : Integrable M.U P.μ) (hUV : Integrable (fun ω => M.U ω * M.resid ω) P.μ) : ∫ ω, M.U ω * M.resid ω ∂P.μ = 0 := by -- `resid = D − mReg` is `σ(X,D)`-strongly-measurable. have hD_sm : StronglyMeasurable[M.sigmaXD] M.factualD := by have heq : M.factualD = snd ∘ M.factualXD := rfl rw [heq] exact (measurable_snd.comp (comap_measurable M.factualXD)).stronglyMeasurable have hmReg_sm : StronglyMeasurable[M.sigmaXD] M.mReg := by refine MeasureTheory.stronglyMeasurable_condExp.mono M.sigmaX_le_sigmaXD have hresid_sm : StronglyMeasurable[M.sigmaXD] M.resid := by have : M.resid = fun ω => M.factualD ω - M.mReg ω := rfl rw [this] exact hD_sm.sub hmReg_sm -- Rewrite `U·resid` as `resid·U` (integrable up to commutativity). have hVU_int : Integrable (fun ω => M.resid ω * M.U ω) P.μ := by simpa [mul_comm] using hUV -- `∫ U·resid = ∫ resid·U = ∫ μ[resid·U | σ(X,D)] = ∫ resid·μ[U|σ(X,D)] = ∫ resid·0 = 0`. have hpull : P.μ[fun ω => M.resid ω * M.U ω | M.sigmaXD] =ᵐ[P.μ] M.resid * P.μ[M.U | M.sigmaXD] := MeasureTheory.condExp_mul_of_stronglyMeasurable_left (μ := P.μ) (m := M.sigmaXD) hresid_sm hVU_int hU have hce_zero : P.μ[fun ω => M.resid ω * M.U ω | M.sigmaXD] =ᵐ[P.μ] (fun _ => (0 : ℝ)) := by refine hpull.trans ?_ filter_upwards [M.backdoor] with ω hω rw [Pi.mul_apply, hω, Pi.zero_apply, mul_zero] calc ∫ ω, M.U ω * M.resid ω ∂P.μ = ∫ ω, M.resid ω * M.U ω ∂P.μ := by simp_rw [mul_comm] _ = ∫ ω, P.μ[fun ω => M.resid ω * M.U ω | M.sigmaXD] ω ∂P.μ := by rw [MeasureTheory.integral_condExp M.sigmaXD_le] _ = ∫ _, (0 : ℝ) ∂P.μ := MeasureTheory.integral_congr_ae hce_zero _ = 0 := MeasureTheory.integral_zero _ _
    Causalean.PO.POPartialLinearModel.integral_U_resid · Causalean/PO/ID/Exact/PartialLinear/Identification.lean:103
  • lReg_eq lemma — The outcome regression decomposes as ℓ₀(X) = b(X) + θ·m₀(X). Apply the conditional expectation given σ(X) to the observed-data form Y = b(X) + θ·D + U: the covariate term is σ(X)-measurable, the treatment term contributes θ·m₀(X), and the error term vanishes by condExp_U_sigmaX.
    hD :
    Integrable M.factualD P.μ
    hbX :
    Integrable (fun ω => M.b (M.factualX ω)) P.μ
    hU :
    Integrable M.U P.μ
    M.lReg =ᵐ[P.μ] fun ω => M.b (M.factualX ω) + M.θ * M.mReg ω
    Proof (Lean source)
    lemma lReg_eq (hD : Integrable M.factualD P.μ) (hbX : Integrable (fun ω => M.b (M.factualX ω)) P.μ) (hU : Integrable M.U P.μ) : M.lReg =ᵐ[P.μ] fun ω => M.b (M.factualX ω) + M.θ * M.mReg ω := by have hbX_int : Integrable (fun ω => M.b (M.factualX ω)) P.μ := hbX have hθD_int : Integrable (fun ω => M.θ * M.factualD ω) P.μ := hD.const_mul M.θ -- σ(X)-strong-measurability of the covariate term. have hbX_sm : StronglyMeasurable[M.sigmaX] (fun ω => M.b (M.factualX ω)) := by change StronglyMeasurable[comap M.factualX inferInstance] (fun ω => M.b (M.factualX ω)) exact (M.b_meas.comp (comap_measurable M.factualX)).stronglyMeasurable -- Rewrite Y by the observed-data form, then split the conditional expectation. have hY : M.lReg =ᵐ[P.μ] P.μ[fun ω => (M.b (M.factualX ω) + M.θ * M.factualD ω) + M.U ω | M.sigmaX] := by unfold lReg refine MeasureTheory.condExp_congr_ae ?_ filter_upwards [M.factualY_eq] with ω hω simpa using hω have hsplit1 : P.μ[fun ω => (M.b (M.factualX ω) + M.θ * M.factualD ω) + M.U ω | M.sigmaX] =ᵐ[P.μ] P.μ[fun ω => M.b (M.factualX ω) + M.θ * M.factualD ω | M.sigmaX] + P.μ[M.U | M.sigmaX] := MeasureTheory.condExp_add (hbX_int.add hθD_int) hU M.sigmaX have hsplit2 : P.μ[fun ω => M.b (M.factualX ω) + M.θ * M.factualD ω | M.sigmaX] =ᵐ[P.μ] P.μ[fun ω => M.b (M.factualX ω) | M.sigmaX] + P.μ[fun ω => M.θ * M.factualD ω | M.sigmaX] := MeasureTheory.condExp_add hbX_int hθD_int M.sigmaX have hbXce : P.μ[fun ω => M.b (M.factualX ω) | M.sigmaX] = fun ω => M.b (M.factualX ω) := MeasureTheory.condExp_of_stronglyMeasurable M.sigmaX_le hbX_sm hbX_int have hθDce : P.μ[fun ω => M.θ * M.factualD ω | M.sigmaX] =ᵐ[P.μ] fun ω => M.θ * M.mReg ω := by have hsmul : P.μ[fun ω => M.θ • M.factualD ω | M.sigmaX] =ᵐ[P.μ] M.θ • P.μ[M.factualD | M.sigmaX] := MeasureTheory.condExp_smul M.θ M.factualD M.sigmaX refine hsmul.trans ?_ filter_upwards with ω simp [Pi.smul_apply, mReg, smul_eq_mul] rw [hbXce] at hsplit2 refine hY.trans (hsplit1.trans ?_) filter_upwards [hsplit2, hθDce, M.condExp_U_sigmaX] with ω h2 hθd hu rw [Pi.add_apply, h2, Pi.add_apply, hθd, hu] simp
    Causalean.PO.POPartialLinearModel.lReg_eq · Causalean/PO/ID/Exact/PartialLinear/Identification.lean:142
  • factualY_sub_lReg lemma — Partialling-out identity (observed data): Y − ℓ₀(X) = θ·(D − m₀(X)) + U. Algebraic consequence of factualY_eq and lReg_eq.
    hD :
    Integrable M.factualD P.μ
    hbX :
    Integrable (fun ω => M.b (M.factualX ω)) P.μ
    hU :
    Integrable M.U P.μ
    (fun ω => M.factualY ω - M.lReg ω) =ᵐ[P.μ] fun ω => M.θ * M.resid ω + M.U ω
    Proof (Lean source)
    lemma factualY_sub_lReg (hD : Integrable M.factualD P.μ) (hbX : Integrable (fun ω => M.b (M.factualX ω)) P.μ) (hU : Integrable M.U P.μ) : (fun ω => M.factualY ω - M.lReg ω) =ᵐ[P.μ] fun ω => M.θ * M.resid ω + M.U ω := by filter_upwards [M.factualY_eq, M.lReg_eq hD hbX hU] with ω hY hl rw [hY, hl] simp only [resid] ring
    Causalean.PO.POPartialLinearModel.factualY_sub_lReg · Causalean/PO/ID/Exact/PartialLinear/Identification.lean:196
  • integral_partialled lemma — The Robinson numerator equals θ times the residual second moment: E[(Y − ℓ₀(X))·(D − m₀(X))] = θ·E[(D − m₀(X))²]. Expand Y − ℓ₀ = θ·V + U and use E[U·V] = 0.
    hD :
    Integrable M.factualD P.μ
    hbX :
    Integrable (fun ω => M.b (M.factualX ω)) P.μ
    hU :
    Integrable M.U P.μ
    hVsq :
    Integrable (fun ω => M.resid ω ^ 2) P.μ
    hUV :
    Integrable (fun ω => M.U ω * M.resid ω) P.μ
    ∫ ω, (M.factualY ω - M.lReg ω) * M.resid ω ∂P.μ = M.θ * ∫ ω, M.resid ω ^ 2 ∂P.μ
    Proof (Lean source)
    lemma integral_partialled (hD : Integrable M.factualD P.μ) (hbX : Integrable (fun ω => M.b (M.factualX ω)) P.μ) (hU : Integrable M.U P.μ) (hVsq : Integrable (fun ω => M.resid ω ^ 2) P.μ) (hUV : Integrable (fun ω => M.U ω * M.resid ω) P.μ) : ∫ ω, (M.factualY ω - M.lReg ω) * M.resid ω ∂P.μ = M.θ * ∫ ω, M.resid ω ^ 2 ∂P.μ := by rw [integral_congr_ae (g := fun ω => M.θ * M.resid ω ^ 2 + M.U ω * M.resid ω) ?_] · rw [integral_add (hVsq.const_mul M.θ) hUV, integral_const_mul, M.integral_U_resid hU hUV, add_zero] · filter_upwards [M.factualY_sub_lReg hD hbX hU] with ω h rw [h]; ring
    Causalean.PO.POPartialLinearModel.integral_partialled · Causalean/PO/ID/Exact/PartialLinear/Identification.lean:209