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 · 13 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

For a potential-outcome system, a measurable covariate space, and a partially linear potential-outcome system based on them, the treatment variable is its treatment represented as a real-valued potential-outcome variable.

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

For a potential-outcome system, a measurable covariate space, and a partially linear potential-outcome system based on them, the outcome variable is its outcome represented as a real-valued potential-outcome variable.

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

For a potential-outcome system, a measurable covariate space, and a partially linear potential-outcome system based on them, the covariate variable is its covariate represented as a potential-outcome variable.

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

For a potential-outcome system, a measurable covariate space, a partially linear potential-outcome system based on them, and a real-valued treatment dose, the potential outcome at that dose assigns each unit the outcome it would have if treatment were set to that dose.

Definition (Lean source)
P :
shared
γ :
Type u_1
shared
S :
shared
d :
YofD S d :
P.Ω → ℝ
S.yVar.cfUnder S.dVar d
def factualD reviewed
Causalean.PO.POPartialLinearSystem

For a potential-outcome system, a measurable covariate space, and a partially linear potential-outcome system based on them, the observed treatment level assigns each unit its realized real-valued treatment.

Definition (Lean source)
P :
shared
γ :
Type u_1
shared
S :
shared
factualD S :
P.Ω → ℝ
S.dVar.factual
def factualY reviewed
Causalean.PO.POPartialLinearSystem

For a potential-outcome system, a measurable covariate space, and a partially linear potential-outcome system based on them, the observed outcome assigns each unit its realized outcome.

Definition (Lean source)
P :
shared
γ :
Type u_1
shared
S :
shared
factualY S :
P.Ω → ℝ
S.yVar.factual
def factualX reviewed
Causalean.PO.POPartialLinearSystem

For a potential-outcome system, a measurable covariate space, and a partially linear potential-outcome system based on them, the observed covariate assigns each unit its realized covariate value.

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

For a potential-outcome system, a measurable covariate space, and a partially linear potential-outcome system based on them, the covariate σ-algebra is the σ-algebra on the sample space generated by the observed covariate.

Definition (Lean source)
P :
shared
γ :
Type u_1
shared
S :
shared
sigmaX S :
comap S.factualX inferInstance
def factualXD reviewed
Causalean.PO.POPartialLinearSystem

For a potential-outcome system, a measurable covariate space, and a partially linear potential-outcome system based on them, the joint observed covariate-and-treatment map assigns each unit the pair consisting of its observed covariate and observed treatment level.

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

For a potential-outcome system, a measurable covariate space, and a partially linear potential-outcome system based on them, the joint covariate-treatment σ-algebra is the σ-algebra on the sample space generated jointly by the observed covariate and treatment.

Definition (Lean source)
P :
shared
γ :
Type u_1
shared
S :
shared
sigmaXD S :
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:193 · 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 :
shared
γ :
Type u_1
shared
M :
shared
∀ᵐ ω ∂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:252 · uses POPartialLinearModel , YofD , POSystem
13 supporting declarations (lemmas, instances)
  • measurable_YofD lemma — The potential outcome under a fixed dose is measurable.
    P :
    shared
    γ :
    Type u_1
    shared
    S :
    shared
    d :
    Measurable (S.YofD d)
    Proof (Lean source)
    @[fun_prop] 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:110
  • measurable_factualD lemma — The factual treatment level is measurable.
    P :
    shared
    γ :
    Type u_1
    shared
    S :
    shared
    Measurable S.factualD
    Proof (Lean source)
    @[fun_prop] lemma measurable_factualD : Measurable S.factualD := S.dVar.measurable_factual
    Causalean.PO.POPartialLinearSystem.measurable_factualD · Causalean/PO/ID/Exact/PartialLinear/Setup.lean:114
  • measurable_factualY lemma — The factual outcome is measurable.
    P :
    shared
    γ :
    Type u_1
    shared
    S :
    shared
    Measurable S.factualY
    Proof (Lean source)
    @[fun_prop] lemma measurable_factualY : Measurable S.factualY := S.yVar.measurable_factual
    Causalean.PO.POPartialLinearSystem.measurable_factualY · Causalean/PO/ID/Exact/PartialLinear/Setup.lean:117
  • measurable_factualX lemma — The factual covariate is measurable.
    P :
    shared
    γ :
    Type u_1
    shared
    S :
    shared
    Measurable S.factualX
    Proof (Lean source)
    @[fun_prop] lemma measurable_factualX : Measurable S.factualX := S.xVar.measurable_factual
    Causalean.PO.POPartialLinearSystem.measurable_factualX · Causalean/PO/ID/Exact/PartialLinear/Setup.lean:120
  • sigmaX_le lemma — The covariate-generated sigma-algebra is a sub-sigma-algebra of the ambient space.
    P :
    shared
    γ :
    Type u_1
    shared
    S :
    shared
    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:131
  • measurable_factualX_sigmaX lemma — The observed covariate is measurable for the covariate sigma-algebra it generates.
    P :
    shared
    γ :
    Type u_1
    shared
    S :
    shared
    Measurable[S.sigmaX] S.factualX
    Proof (Lean source)
    @[fun_prop] lemma measurable_factualX_sigmaX : Measurable[S.sigmaX] S.factualX := comap_measurable S.factualX
    Causalean.PO.POPartialLinearSystem.measurable_factualX_sigmaX · Causalean/PO/ID/Exact/PartialLinear/Setup.lean:135
  • measurable_factualXD lemma — The joint observed covariate-and-treatment map is measurable.
    P :
    shared
    γ :
    Type u_1
    shared
    S :
    shared
    Measurable S.factualXD
    Proof (Lean source)
    @[fun_prop] 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:148
  • sigmaXD_le lemma — The joint covariate-treatment sigma-algebra is a sub-sigma-algebra of the ambient space.
    P :
    shared
    γ :
    Type u_1
    shared
    S :
    shared
    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:160
  • measurable_factualXD_sigmaXD lemma — The observed covariate-treatment pair is measurable for the joint sigma-algebra it generates.
    P :
    shared
    γ :
    Type u_1
    shared
    S :
    shared
    Measurable[S.sigmaXD] S.factualXD
    Proof (Lean source)
    @[fun_prop] lemma measurable_factualXD_sigmaXD : Measurable[S.sigmaXD] S.factualXD := comap_measurable S.factualXD
    Causalean.PO.POPartialLinearSystem.measurable_factualXD_sigmaXD · Causalean/PO/ID/Exact/PartialLinear/Setup.lean:165
  • measurable_factualX_sigmaXD lemma — The observed covariate is measurable for the joint covariate-treatment sigma-algebra.
    P :
    shared
    γ :
    Type u_1
    shared
    S :
    shared
    Measurable[S.sigmaXD] S.factualX
    Proof (Lean source)
    @[fun_prop] lemma measurable_factualX_sigmaXD : Measurable[S.sigmaXD] S.factualX := measurable_fst.comp (comap_measurable S.factualXD)
    Causalean.PO.POPartialLinearSystem.measurable_factualX_sigmaXD · Causalean/PO/ID/Exact/PartialLinear/Setup.lean:171
  • measurable_factualD_sigmaXD lemma — The observed treatment is measurable for the joint covariate-treatment sigma-algebra.
    P :
    shared
    γ :
    Type u_1
    shared
    S :
    shared
    Measurable[S.sigmaXD] S.factualD
    Proof (Lean source)
    @[fun_prop] lemma measurable_factualD_sigmaXD : Measurable[S.sigmaXD] S.factualD := measurable_snd.comp (comap_measurable S.factualXD)
    Causalean.PO.POPartialLinearSystem.measurable_factualD_sigmaXD · Causalean/PO/ID/Exact/PartialLinear/Setup.lean:177
  • sigmaX_le_sigmaXD lemma — The covariate σ-algebra is contained in the joint covariate-treatment σ-algebra.
    P :
    shared
    γ :
    Type u_1
    shared
    S :
    shared
    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 comap_mono measurable_fst.comap_le
    Causalean.PO.POPartialLinearSystem.sigmaX_le_sigmaXD · Causalean/PO/ID/Exact/PartialLinear/Setup.lean:183
  • 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).
    P :
    shared
    γ :
    Type u_1
    shared
    M :
    shared
    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:236
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

For a potential-outcome system, a measurable covariate space, and a partially linear potential-outcome model based on them, the treatment regression assigns each unit the conditional mean of its observed treatment given the σ-algebra generated by the observed covariate.

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

For a potential-outcome system, a measurable covariate space, and a partially linear potential-outcome model based on them, the outcome regression assigns each unit the conditional mean of its observed outcome given the σ-algebra generated by the observed covariate.

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

For a potential-outcome system, a measurable covariate space, and a partially linear potential-outcome model based on them, the treatment residual assigns each unit its observed treatment minus its treatment regression given the observed covariate.

Definition (Lean source)
P :
shared
γ :
Type u_1
shared
M :
shared
resid M :
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
P :
shared
γ :
Type u_1
shared
M :
shared
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 :
    shared
    γ :
    Type u_1
    shared
    M :
    shared
    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:86
  • 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.
    P :
    shared
    γ :
    Type u_1
    shared
    M :
    shared
    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] := by condexp_linearity [MeasureTheory.integrable_condExp (μ := P.μ) (m := M.sigmaX) (f := M.factualD)] 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:99
  • 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).
    P :
    shared
    γ :
    Type u_1
    shared
    M :
    shared
    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 fun_prop 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:121
  • 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.
    P :
    shared
    γ :
    Type u_1
    shared
    M :
    shared
    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] := by condexp_linearity 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] := by condexp_linearity 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] := by condexp_linearity 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:158
  • factualY_sub_lReg lemma — Partialling-out identity (observed data): Y − ℓ₀(X) = θ·(D − m₀(X)) + U. Algebraic consequence of factualY_eq and lReg_eq.
    P :
    shared
    γ :
    Type u_1
    shared
    M :
    shared
    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:212
  • 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.
    P :
    shared
    γ :
    Type u_1
    shared
    M :
    shared
    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 ω) ?_] · integral_linearity rw [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:225