Discovery.Invariant­Prediction.Linear­Gaussian

Exact recovery of the direct causes of a target in a linear structural equation model with centered Gaussian noise observed under do-interventions: a specialization of Theorem 2(i) of Peters, Bühlmann & Meinshausen (JRSS

Helpers 5 core · 3 supporting · 3 submodules Linear-Gaussian invariant-prediction helpers: intervention invariance, centered-noise moments, and residual algebra for soundness and completeness proofs.
Model 8 core · 2 supporting Setup for a specialization of the linear-Gaussian identifiability theorem of Peters, Bühlmann & Meinshausen, *Causal inference using invariant prediction* (JRSS-B 2016, arXiv:1501.01332), Theorem 2(i) (the do-interventio ★ ObsSEM★ mem_paY★ EnvFamily

Invariant Causal Prediction — linear-Gaussian model layer

Setup for a specialization of the linear-Gaussian identifiability theorem of Peters, Bühlmann & Meinshausen, Causal inference using invariant prediction (JRSS-B 2016, arXiv:1501.01332), Theorem 2(i) (the do-intervention version). Unlike the paper's recursive-SEM formulation, this encoding separately assumes the target-exogeneity facts used by soundness.

This is a self-contained linear-Gaussian framework, deliberately separate from the nonparametric SWIG/kernel EnvFamily development in the parent directory. Variables are real functions on a probability space, with ∫/E[·] for moments and IdentDistrib for equality in distribution.

Encoding choices

* Index convention. The paper uses variables X₁,…,X_{p+1} with target Y = X₁ and predictors X₂,…,X_{p+1}. We index nodes by Fin (p+1) and put the target at index 0, predictors at 1,…,p. So target = 0 and the predictor index set is {1,…,p} = {k : k ≠ 0} (Finset.univ.erase 0). This is a pure 0-based relabelling of the paper's 1,…,p+1; PA(Y) is then a subset of {k : k ≠ 0}.

* One coefficient matrix, one DAG. The observational SEM e = 1 (eq:semmmmm) carries the coefficients β : Matrix (Fin (p+1)) (Fin (p+1)) ℝ with Xⱼ = Σ_{k≠j} βⱼₖ Xₖ + εⱼ. Acyclicity is witnessed by a DAG whose edge k → j holds exactly when βⱼₖ ≠ 0 (hEdge); reusing Causalean.Graph.DAG gives parents / descendants / topological order / the "youngest node" notion for free. PA(Y) = {k : β 0 k ≠ 0} is then literally dag.parents 0.

* Gaussian noise, random-variable form. The observational SEM has its own probability space with observed coordinates, and do-intervention environments live on that same probability space with the same structural noises. Independence of the noises and their Gaussian marginals are stated on the observational environment only (that is where the graph/β/Gaussianity live).

* Do-interventions (sec:idfirst). In environment e an intervention set A e ⊆ {1,…,p} and values a e : Fin (p+1) → ℝ replace the structural equation of each j ∈ A e by the constant a e j (zeroing its row of β and replacing εⱼ by a e j). Per the paper, 0 ∉ A e (never intervene on the target) and A 1 = ∅ (observational).

The do-version's proof in Completeness.lean is a mean-shift argument (R^{e₀} = α_{k₀} a_{k₀} + … vs. R^1 = α_{k₀} X_{k₀}^1 + …, eq:help1/help2), so the model exposes residual means / laws cleanly via IdentDistrib and ∫.

abbrev target reviewed
Causalean.Discovery.InvariantPrediction.LinearGaussian

The target node is reserved as coordinate zero, leaving exactly the other p coordinates available as predictors.

Definition (Lean source)
p :
ℕ
target p :
Fin (p + 1)
0
Causalean.Discovery.InvariantPrediction.LinearGaussian.target · Causalean/Discovery/InvariantPrediction/LinearGaussian/Model.lean:72
def predictors reviewed
Causalean.Discovery.InvariantPrediction.LinearGaussian

The predictor index set contains exactly the numbered predictor coordinates, excluding the target stored at coordinate zero.

Definition (Lean source)
p :
ℕ
predictors p :
Finset (Fin (p + 1))
Finset.univ.erase 0
Causalean.Discovery.InvariantPrediction.LinearGaussian.predictors · Causalean/Discovery/InvariantPrediction/LinearGaussian/Model.lean:76
structure ObsSEM reviewed
Causalean.Discovery.InvariantPrediction.LinearGaussian

The observational linear-Gaussian structural equation model (eq:semmmmm, the e = 1 block): it bundles a sample space with its σ-algebra carrying a probability measure that is a genuine probability measure, together with structural coefficients β obeying Xⱼ = Σ_{k≠j} βⱼₖ Xₖ + εⱼ for measurable observed coordinates X, an acyclic graph whose edge k → j holds exactly when βⱼₖ ≠ 0, and the absence of self-loops in β. The noises ε are declared to be the structural residuals εⱼ = Xⱼ − Σ_{k≠j} βⱼₖ Xₖ, jointly independent, and each centered Gaussian with a positive variance σⱼ², and the target's noise is independent of every parent coordinate of the target.

Definition (Lean source)
p :
ℕ
Sample space of the observational environment.
Ω :
Type*
Measurable structure on `Ω`.
mΩ :
The observational probability measure `P¹`.
P :
`P¹` is a probability measure.
The structural coefficients `βⱼₖ` (row `j`, column `k`).
β :
Matrix (Fin (p + 1)) (Fin (p + 1)) ℝ
The noise standard deviations `σⱼ` (`εⱼ ~ N(0, σⱼ²)`).
σ :
Fin (p + 1) → ℝ
The noises are nondegenerate (`σⱼ > 0`), as in a genuine Gaussian SEM.
hσpos :
∀ j, 0 < σ j
The acyclic graph of the SEM; its edges are the nonzero coefficients.
dag :
DAG (Fin (p + 1))
The graph edge `k → j` holds exactly when the coefficient `βⱼₖ` is nonzero.
hEdge :
∀ j k, dag.edge k j ↔ β j k ≠ 0
No self-loops: a variable does not enter its own structural equation.
hNoSelf :
∀ j, β j j = 0
The observed coordinates `X : Ω → (Fin (p+1) → ℝ)`.
X :
Ω → Fin (p + 1) → ℝ
Each coordinate is measurable.
hXmeas :
∀ j, Measurable fun ω => X ω j
The structural noises `εⱼ = Xⱼ − Σ_{k≠j} βⱼₖ Xₖ`.
ε :
Ω → Fin (p + 1) → ℝ
The noises are the structural residuals (definitional, stated a.e.).
hε :
∀ᵐ ω ∂P, ∀ j, ε ω j = X ω j - ∑ k ∈ Finset.univ.erase j, β j k * X ω k
The noises are jointly independent.
hindep :
iIndepFun (fun j ω => ε ω j) P
Each noise is centered Gaussian with variance `σⱼ²`: the law of `εⱼ` under `P` is `N(0, σⱼ²)`.
hGauss :
∀ j, P.map (fun ω => ε ω j) = gaussianReal 0 ⟨(σ j) ^ 2, by positivity⟩
**Target exogeneity (the paper's Assumption 1, `ε ⊥ X_{S*}`).** The target noise `ε₀` is independent of each *parent* coordinate `Xₖ` (`k ∈ PA(Y)`, i.e. `dag.edge k 0`). In a recursive SEM this is a *consequence* of the joint noise independence (`hindep`) plus acyclicity — the parents of `Y` are non-descendants of `Y`, so they are functions of noises other than `ε₀` — but the random-variable encoding here does not expose the `ε → X` solve `X = (I−B)⁻¹ε`, so we carry it as a field. It is stated **only for parents** of the target: it is *false* for descendants of `Y`.
hYexo :
∀ k
if
dag.edge k (target p)
then
IndepFun (fun ω => ε ω (target p)) (fun ω => X ω k) P
Causalean.Discovery.InvariantPrediction.LinearGaussian.ObsSEM · Causalean/Discovery/InvariantPrediction/LinearGaussian/Model.lean:84
def paY reviewed
Causalean.Discovery.InvariantPrediction.LinearGaussian.ObsSEM

The target's parent set collects the direct causes whose coefficients enter the target equation of an observational linear-Gaussian SEM with predictor dimension p.

Definition (Lean source)
p :
ℕ
shared
M :
shared
paY M :
Finset (Fin (p + 1))
M.dag.parents (target p)
Causalean.Discovery.InvariantPrediction.LinearGaussian.ObsSEM.paY · Causalean/Discovery/InvariantPrediction/LinearGaussian/Model.lean:151 · uses ObsSEM
theorem mem_paY reviewed
Causalean.Discovery.InvariantPrediction.LinearGaussian.ObsSEM

A coordinate is a direct cause of the target exactly when its target-equation coefficient is nonzero, for SEM M with predictor dimension p and coordinate k.

Formal statement
p :
ℕ
shared
M :
shared
k :
Fin (p + 1)
k ∈ M.paY ↔ M.β (target p) k ≠ 0
Proof (Lean source)
theorem mem_paY {k : Fin (p + 1)} : k ∈ M.paY ↔ M.β (target p) k ≠ 0 := by rw [paY, M.dag.mem_parents, M.hEdge]
Causalean.Discovery.InvariantPrediction.LinearGaussian.ObsSEM.mem_paY · Causalean/Discovery/InvariantPrediction/LinearGaussian/Model.lean:165 · uses ObsSEM , paY , target
structure Env reviewed
Causalean.Discovery.InvariantPrediction.LinearGaussian

A single do-intervention environment for the observational SEM M (sec:idfirst) bundles an intervention set that never includes the target node, the constant values assigned to each intervened coordinate, and measurable post-intervention coordinates that equal their assigned constant, almost surely, on the intervened set, satisfy the same structural equation as M — with M's coefficients and noises — on every coordinate left un-intervened, and for which the target's noise remains independent of each parent coordinate of the target.

Definition (Lean source)
p :
ℕ
shared
M :
The do-intervention target set `Aᵉ` (never the target `0`).
A :
Finset (Fin (p + 1))
The intervention never acts on the target.
hAtarget :
target p ∉ A
The assigned values `aᵉⱼ` for `j ∈ Aᵉ`.
a :
Fin (p + 1) → ℝ
The post-intervention coordinates, on `M`'s probability space.
X :
M.Ω → Fin (p + 1) → ℝ
Each coordinate is measurable.
hXmeas :
∀ j, Measurable fun ω => X ω j
do-pin: each intervened coordinate equals its assigned constant a.e.
hDoPin :
∀ j ∈ A, ∀ᵐ ω ∂M.P, X ω j = a j
Modularity: each un-intervened coordinate keeps the observational structural equation, with the **same** coefficients `β` and noises `ε` as `M`.
hDoStruct :
∀ j
if
j ∉ A
then
∀ᵐ ω ∂M.P, X ω j = M.ε ω j + ∑ k ∈ Finset.univ.erase j, M.β j k * X ω k
**Target exogeneity in this environment (the paper's Assumption 1).** The target keeps its structural equation (`0 ∉ A`), so its noise `M.ε₀` is still independent of each *parent* coordinate `Xₖ` (`k ∈ PA(Y)`) — now of the post-intervention `X`. As with `ObsSEM.hYexo` this is a consequence of recursive noise-independence + acyclicity that the random-variable encoding does not expose, so it is carried as a field; stated **only for parents** of the target.
hExo :
∀ k
if
M.dag.edge k (target p)
then
IndepFun (fun ω => M.ε ω (target p)) (fun ω => X ω k) M.P
Causalean.Discovery.InvariantPrediction.LinearGaussian.Env · Causalean/Discovery/InvariantPrediction/LinearGaussian/Model.lean:173 · uses ObsSEM
structure EnvFamily reviewed
Causalean.Discovery.InvariantPrediction.LinearGaussian

An environment family for the linear-Gaussian ICP problem bundles an observational linear-Gaussian structural equation model together with a finite index set of interventional environments over that model.

Definition (Lean source)
p :
ℕ
The observational linear-Gaussian SEM (`e = 1`).
obs :
Index type of the interventional environments.
ι :
Type*
Finitely many environments.
hι :
The interventional environments.
env :
ι → Env obs
Causalean.Discovery.InvariantPrediction.LinearGaussian.EnvFamily · Causalean/Discovery/InvariantPrediction/LinearGaussian/Model.lean:219
abbrev paY reviewed
Causalean.Discovery.InvariantPrediction.LinearGaussian.EnvFamily

The family's causal target-parent set is anchored to the observational SEM shared by the intervention family with predictor dimension p.

Definition (Lean source)
p :
ℕ
shared
F :
shared
paY F :
Finset (Fin (p + 1))
F.obs.paY
Causalean.Discovery.InvariantPrediction.LinearGaussian.EnvFamily.paY · Causalean/Discovery/InvariantPrediction/LinearGaussian/Model.lean:243 · uses EnvFamily
2 supporting declarations (lemmas, instances)
Regression 7 core · 2 supporting The observable layer of the linear-Gaussian ICP problem: the regression predictor in each environment, the regression-invariance null H_{0,S}, and the identified set S(E) (Peters–Bühlmann–Meinshausen 2016, eq:betapred, e ★ InvarianceNull★ identifiedSet★ mem_identifiedSet

Invariant Causal Prediction — regression-invariance null and identified set

The observable layer of the linear-Gaussian ICP problem: the regression predictor in each environment, the regression-invariance null H_{0,S}, and the identified set S(E) (Peters–Bühlmann–Meinshausen 2016, eq:betapred, eq:H0Sregr, eq:ident).

Encoding choices (fidelity notes)

* Residual. residual γ env ω := Yᵉ(ω) − Σ_k γ k · Xₖᵉ(ω) with the sum over all coordinates (γ is supported on S, so k ∉ S contributes nothing). This is R^e(S) of the paper (R^e = Y^e − X^e β).

* Support on S. "γ supported on S" is ∀ k, γ k ≠ 0 → k ∈ S (SupportedOn). This is the paper's constraint β_k = 0 if k ∉ S.

* Regression-invariance null H_{0,S}. This file uses a pairwise-coordinate version of the regression null: there exist a coefficient vector γ supported on S and a fixed residual law Fε such that for every environment e, the residual R^e = Y^e − Σ γ_k X_k^e is (i) independent of each predictor coordinate in S and (ii) has law Fε (the same law across environments). In this jointly Gaussian linear-Gaussian setting, coordinatewise independence of the residual from each X_k, k ∈ S, is equivalent to joint independence from the vector X_S, so this matches the Peters-Buhlmann-Meinshausen regression null despite the weaker-looking form. The paper also requires γ = β^{pred,e}(S) (the population-OLS coefficient); under independence of R^e from X_S^e that is automatic (the residual is orthogonal to X_S, i.e. the normal equations hold), so we fold it into the independence clause and do not carry β^{pred} as a separate object. The observational environment obs is included as one of the environments (it is e = 1), so invariance is genuinely across the whole family.

* Residual law as a measure on ℝ. Fε : Measure ℝ; "R^e ∼ Fε" is Pᵉ.map (residual γ (env e)) = Fε. Equivalently IdentDistrib across environments; we phrase it via a single shared measure so the "same law" is one object. The mean-shift proof only needs that the two laws differ, which a shared-measure formulation exposes directly (hLawObs, hLawEnv).

* Identified set S(E) (eq:ident). S(E) := ⋂ {S : H_{0,S} holds}. We encode the intersection over the (finite) powerset of predictors that satisfy the null.

def SupportedOn reviewed
Causalean.Discovery.InvariantPrediction.LinearGaussian

A coefficient vector is supported on a predictor set precisely when every nonzero entry of the vector belongs to that set, in a model with predictor dimension p.

Definition (Lean source)
p :
ℕ
shared
γ :
Fin (p + 1) → ℝ
S :
Finset (Fin (p + 1))
k :
γ k ≠ 0
SupportedOn γ S :
Prop
k ∈ S
Causalean.Discovery.InvariantPrediction.LinearGaussian.SupportedOn · Causalean/Discovery/InvariantPrediction/LinearGaussian/Regression.lean:64
def obsResidual reviewed
Causalean.Discovery.InvariantPrediction.LinearGaussian

The observational regression residual measures unexplained target variation after subtracting the linear prediction defined by coefficients γ from SEM M at realization ω, in predictor dimension p.

Definition (Lean source)
p :
ℕ
shared
M :
γ :
Fin (p + 1) → ℝ
ω :
M.Ω
obsResidual M γ ω :
ℝ
M.X ω (target p) - ∑ k, γ k * M.X ω k
Causalean.Discovery.InvariantPrediction.LinearGaussian.obsResidual · Causalean/Discovery/InvariantPrediction/LinearGaussian/Regression.lean:73 · uses ObsSEM
def envResidual reviewed
Causalean.Discovery.InvariantPrediction.LinearGaussian

The interventional regression residual applies the same coefficient vector to the post-intervention coordinates from environment e based on observational SEM M, at realization ω in predictor dimension p; it is the quantity whose law ICP compares across environments.

Definition (Lean source)
p :
ℕ
shared
e :
Env M
γ :
Fin (p + 1) → ℝ
ω :
M.Ω
envResidual e γ ω :
ℝ
e.X ω (target p) - ∑ k, γ k * e.X ω k
Causalean.Discovery.InvariantPrediction.LinearGaussian.envResidual · Causalean/Discovery/InvariantPrediction/LinearGaussian/Regression.lean:82 · uses Env , ObsSEM
def InvarianceNull reviewed
Causalean.Discovery.InvariantPrediction.LinearGaussian.EnvFamily

The regression-invariance null holds for a predictor set in a family of intervention environments with finite predictor dimension when one coefficient vector supported on the selected predictors produces a residual that is independent of every selected predictor and has one common law in both the observational and every interventional environment.

Definition (Lean source)
p :
ℕ
shared
F :
shared
S :
Finset (Fin (p + 1))
InvarianceNull F S :
Prop
∃ (γ : Fin (p + 1) → ℝ) (Fε : Measure ℝ),
clause 1
k ∈ S :
IndepFun (obsResidual F.obs γ) (fun ω => F.obs.X ω k) F.obs.P
clause 2
F.obs.P.map (obsResidual F.obs γ) = Fε
clause 3
i :
k ∈ S :
IndepFun (envResidual (F.env i) γ) (fun ω => (F.env i).X ω k) F.obs.P
clause 4
i :
F.obs.P.map (envResidual (F.env i) γ) = Fε
Causalean.Discovery.InvariantPrediction.LinearGaussian.EnvFamily.InvarianceNull · Causalean/Discovery/InvariantPrediction/LinearGaussian/Regression.lean:96 · uses EnvFamily
def invariantSets reviewed
Causalean.Discovery.InvariantPrediction.LinearGaussian.EnvFamily

The invariant predictor collection is the finite search space of subsets whose residual law survives every environment in family F with predictor dimension p.

Definition (Lean source)
p :
ℕ
shared
F :
shared
invariantSets F :
Finset (Finset (Fin (p + 1)))
(predictors p).powerset.filter (fun S => F.InvarianceNull S)
Causalean.Discovery.InvariantPrediction.LinearGaussian.EnvFamily.invariantSets · Causalean/Discovery/InvariantPrediction/LinearGaussian/Regression.lean:137 · uses EnvFamily
def identifiedSet reviewed
Causalean.Discovery.InvariantPrediction.LinearGaussian.EnvFamily

The ICP identified set keeps the predictors present in every invariant subset for environment family F with predictor dimension p.

Definition (Lean source)
p :
ℕ
shared
F :
shared
identifiedSet F :
Finset (Fin (p + 1))
(F.invariantSets).inf id
Causalean.Discovery.InvariantPrediction.LinearGaussian.EnvFamily.identifiedSet · Causalean/Discovery/InvariantPrediction/LinearGaussian/Regression.lean:145 · uses EnvFamily
theorem mem_identifiedSet reviewed
Causalean.Discovery.InvariantPrediction.LinearGaussian.EnvFamily

A predictor lies in the ICP identified set exactly when every invariant model includes it, for environment family F with predictor dimension p and candidate coordinate k.

Formal statement
p :
ℕ
shared
F :
shared
k :
Fin (p + 1)
k ∈ F.identifiedSet ↔ ∀ S ∈ F.invariantSets, k ∈ S
Proof (Lean source)
theorem mem_identifiedSet {k : Fin (p + 1)} : k ∈ F.identifiedSet ↔ ∀ S ∈ F.invariantSets, k ∈ S := by classical simp only [identifiedSet, Finset.mem_inf, id_eq]
Causalean.Discovery.InvariantPrediction.LinearGaussian.EnvFamily.mem_identifiedSet · Causalean/Discovery/InvariantPrediction/LinearGaussian/Regression.lean:157 · uses EnvFamily , identifiedSet , invariantSets
2 supporting declarations (lemmas, instances)
  • instDecidablePredFinsetFinHAddNatOfNatInvarianceNull instance — Classical decidability of the regression-invariance null lets the finite search filter candidate predictor sets in environment family F with predictor dimension p; the decision rule uses classical reasoning.
    p :
    ℕ
    shared
    F :
    shared
    instDecidablePredFinsetFinHAddNatOfNatInvarianceNull F :
    DecidablePred (F.InvarianceNull)
    fun _ => Classical.dec _
    Causalean.Discovery.InvariantPrediction.LinearGaussian.EnvFamily.instDecidablePredFinsetFinHAddNatOfNatInvarianceNull · Causalean/Discovery/InvariantPrediction/LinearGaussian/Regression.lean:128
  • mem_invariantSets theorem — A predictor set belongs to the invariant collection exactly when it uses only predictor coordinates and satisfies the regression-invariance null, for environment family F with predictor dimension p and candidate set S.
    p :
    ℕ
    shared
    F :
    shared
    S :
    Finset (Fin (p + 1))
    S ∈ F.invariantSets ↔ S ⊆ predictors p ∧ F.InvarianceNull S
    Proof (Lean source)
    theorem mem_invariantSets {S : Finset (Fin (p + 1))} : S ∈ F.invariantSets ↔ S ⊆ predictors p ∧ F.InvarianceNull S := by classical simp [invariantSets, mem_filter, Finset.mem_powerset]
    Causalean.Discovery.InvariantPrediction.LinearGaussian.EnvFamily.mem_invariantSets · Causalean/Discovery/InvariantPrediction/LinearGaussian/Regression.lean:165
Completeness 6 core · 1 supporting A specialization of Peters–Bühlmann–Meinshausen 2016, Theorem 2(i): for a linear-Gaussian SEM whose interventions are *do-interventions* with shifted values (a^e_j ≠ E[X¹_j]) and at least one single-node intervention on ★ icp_sound_linearGaussian_of_exogeneity★ residual_mean_shift_of_doIntervention★ icp_complete_linearGaussian_of_exogeneity

Invariant Causal Prediction — conditional completeness for do-interventions

A specialization of Peters–Bühlmann–Meinshausen 2016, Theorem 2(i): for a linear-Gaussian SEM whose interventions are do-interventions with shifted values (a^e_j ≠ E[X¹_j]) and at least one single-node intervention on every predictor, the identified set equals the parents of the target: S(E) = PA(Y). The formal model additionally assumes, through ObsSEM.hYexo and Env.hExo, the target-exogeneity consequences that the paper derives from its recursive SEM.

The intermediate lemmas mirror the paper's proof of Theorem 2(i):

1. Soundness icp_sound_linearGaussian_of_exogeneity (S(E) ⊆ PA(Y)) — H_{0,PA(Y)} holds with γ = γ* = β₀,· and residual ε₁, so PA(Y) is one of the intersected sets (propos:sem). 2. Youngest-node selection exists_youngest_nonzero — among the indices k with α_k ≠ 0 (α = γ* − β^{pred}(S)) there is one, k₀, with no directed path to any other such index (a sink in the induced subgraph). 3. Mean-shift residual_mean_shift_of_doIntervention — under the single do(X_{k₀} = a) intervention with a ≠ E[X¹_{k₀}] and α_{k₀} ≠ 0, the residual law in that environment differs from the observational one (their means differ by α_{k₀}·(a − E[X¹_{k₀}]) ≠ 0), contradicting invariance. 4. Completeness icp_complete_linearGaussian_of_exogeneity — combines 1–3: any null-satisfying S must contain PA(Y), so S(E) ⊇ PA(Y), and with soundness S(E) = PA(Y).

Encoding choices (fidelity notes)

* Single-intervention hypothesis (Theorem 2(i)). HasShiftedSingleInterventions: for each predictor j, some environment i has A i = {j} (single intervention on j) and a i j ≠ E[X¹_j] (the shift condition, with the mean taken under the observational law). This is exactly the paper's "`a^e_j ≠ E(X¹_j) and for each j ∈ {2,…,p+1} there is e with A^e = {j}`".

* E[X¹_j] is the observational mean ∫ ω, M.X ω j ∂P. Finiteness / integrability of the observational coordinates is bundled as hIntegrable (the Gaussian SEM has all moments; the theorem keeps this fact as an explicit integrability hypothesis rather than rebuilding Gaussian moment theory here).

* α and β^{pred}. The proof works with α k = γ*_k − γ_k for the null's coefficient γ (which, being orthogonal to X_S, is β^{pred}(S)). We do not introduce a separate β^{pred} object; α is defined inline in the lemmas.

* Exogeneity (the paper's Assumption 1). Soundness needs ε₀ ⊥ X_k for each parent k ∈ PA(Y). In a recursive Gaussian SEM this follows from joint noise independence + acyclicity, but the random-variable encoding here does not expose the ε → X solve, so it is carried as the structure fields ObsSEM.hYexo and Env.hExo (stated only for parents — it is false for descendants of Y).

* hyoung at the call site. residual_mean_shift_of_doIntervention takes a hyoung hypothesis — every other support index k ≠ k₀ with α_k ≠ 0 is not a descendant of k₀. In the completeness proof this is supplied exactly by the youngest-node selection (exists_youngest_nonzero over the support of α).

def obsMean reviewed
Causalean.Discovery.InvariantPrediction.LinearGaussian.EnvFamily

The observational mean of coordinate j supplies the no-intervention baseline against which shifted interventions are detected in a linear-Gaussian environment family with predictor dimension p and selected coordinate j.

Definition (Lean source)
p :
ℕ
shared
F :
shared
j :
Fin (p + 1)
obsMean F j :
ℝ
∫ ω, F.obs.X ω j ∂F.obs.P
Causalean.Discovery.InvariantPrediction.LinearGaussian.EnvFamily.obsMean · Causalean/Discovery/InvariantPrediction/LinearGaussian/Completeness.lean:83 · uses EnvFamily
def HasShiftedSingleInterventions reviewed
Causalean.Discovery.InvariantPrediction.LinearGaussian.EnvFamily

The shifted single-intervention condition ensures that every predictor is experimentally distinguishable in a linear-Gaussian environment family with predictor dimension p: (1) some environment intervenes on that coordinate alone, and (2) the assigned value differs from its observational mean.

Definition (Lean source)
p :
ℕ
shared
F :
shared
j ∈ predictors p :
HasShiftedSingleInterventions F :
Prop
∃ i : F.ι,
clause 1
(F.env i).A = {j}
clause 2
(F.env i).a j ≠ F.obsMean j
Causalean.Discovery.InvariantPrediction.LinearGaussian.EnvFamily.HasShiftedSingleInterventions · Causalean/Discovery/InvariantPrediction/LinearGaussian/Completeness.lean:88 · uses EnvFamily
def ObsIntegrable reviewed
Causalean.Discovery.InvariantPrediction.LinearGaussian.EnvFamily

Observational integrability guarantees that every coordinate mean used to detect an intervention shift is finite for a linear-Gaussian environment family with predictor dimension p.

Definition (Lean source)
p :
ℕ
shared
F :
shared
j :
ObsIntegrable F :
Prop
Integrable (fun ω => F.obs.X ω j) F.obs.P
Causalean.Discovery.InvariantPrediction.LinearGaussian.EnvFamily.ObsIntegrable · Causalean/Discovery/InvariantPrediction/LinearGaussian/Completeness.lean:101 · uses EnvFamily
theorem icp_sound_linearGaussian_of_exogeneity reviewed
Causalean.Discovery.InvariantPrediction.LinearGaussian.EnvFamily

Soundness under separately certified exogeneity (propos:sem). For a linear-Gaussian environment family whose observational and interventional models carry the target-exogeneity fields ObsSEM.hYexo and Env.hExo, the identified set is contained in the target's parents, S(E) ⊆ PA(Y).

Formal statement
p :
ℕ
shared
F :
shared
F.identifiedSet ⊆ F.paY
Proof (Lean source)
theorem icp_sound_linearGaussian_of_exogeneity : F.identifiedSet ⊆ F.paY := by -- It suffices that `PA(Y)` itself satisfies the invariance null, since the -- identified set is contained in every invariant set. intro k hk rw [mem_identifiedSet] at hk refine hk F.paY ?_ rw [mem_invariantSets] refine ⟨F.obs.paY_subset_predictors, ?_⟩ -- Witness: causal coefficient `γ* = β₀,·` and residual law `N(0, σ₀²)`. refine ⟨causalCoeff F.obs, gaussianReal 0 ⟨(F.obs.σ (target p)) ^ 2, by positivity⟩, ?_, ?_, ?_, ?_, ?_⟩ · -- `SupportedOn γ* PA(Y)`: `β₀ₖ ≠ 0 ↔ k ∈ PA(Y)`. intro k hk0 exact F.obs.mem_paY.mpr hk0 · -- Observational independence clause: residual `=ᵐ ε₀`, then `hYexo`. intro k hkPaY have hedge : F.obs.dag.edge k (target p) := F.obs.dag.mem_parents.mp hkPaY exact (F.obs.hYexo k hedge).congr (Filter.EventuallyEq.symm (obsResidual_eq_eps F.obs)) (Filter.EventuallyEq.refl _ _) · -- Observational law clause: `P.map residual = P.map ε₀ = N(0, σ₀²)`. rw [Measure.map_congr (obsResidual_eq_eps F.obs), F.obs.hGauss (target p)] · -- Interventional independence clause: residual `=ᵐ ε₀`, then `(env i).hExo`. intro i k hkPaY have hedge : F.obs.dag.edge k (target p) := F.obs.dag.mem_parents.mp hkPaY exact ((F.env i).hExo k hedge).congr (Filter.EventuallyEq.symm (envResidual_eq_eps F.obs (F.env i))) (Filter.EventuallyEq.refl _ _) · -- Interventional law clause: same as observational via `=ᵐ ε₀`. intro i rw [Measure.map_congr (envResidual_eq_eps F.obs (F.env i)), F.obs.hGauss (target p)]
Causalean.Discovery.InvariantPrediction.LinearGaussian.EnvFamily.icp_sound_linearGaussian_of_exogeneity · Causalean/Discovery/InvariantPrediction/LinearGaussian/Completeness.lean:110 · uses EnvFamily , identifiedSet , paY
theorem residual_mean_shift_of_doIntervention reviewed
Causalean.Discovery.InvariantPrediction.LinearGaussian.EnvFamily

Residual mean-shift (eq:help1/eq:help2). Fix an observational SEM with integrable regressors, a candidate coefficient vector γ, and an index k₀ such that the gap α_{k₀} = β₀,k₀ − γ_{k₀} between the causal coefficient and γ at k₀ is nonzero. Suppose k₀ is a youngest such index: every other index with a nonzero coefficient gap is not a descendant of k₀ in the observational DAG, and let i be an environment consisting of a single do-intervention pinning coordinate k₀ to a value different from its observational mean. Then the residual R^i = Y^i − Σ γ_k X_k^i computed in environment i and the observational residual R¹ computed the same way do not have the same distribution, since they have different means.

Formal statement
p :
ℕ
shared
F :
shared
hInt :
F.ObsIntegrable
γ :
Fin (p + 1) → ℝ
k₀ :
Fin (p + 1)
hk₀ :
(F.obs.β (target p) k₀ - γ k₀) ≠ 0
hyoung :
∀ k
if
k ≠ k₀
and
(F.obs.β (target p) k - γ k) ≠ 0
then
¬ F.obs.dag.isAncestor k₀ k
i :
F.ι
hAi :
(F.env i).A = {k₀}
hai :
(F.env i).a k₀ ≠ F.obsMean k₀
¬ IdentDistrib (envResidual (F.env i) γ) (obsResidual F.obs γ) F.obs.P F.obs.P
Proof (Lean source)
theorem residual_mean_shift_of_doIntervention (hInt : F.ObsIntegrable) (γ : Fin (p + 1) → ℝ) (k₀ : Fin (p + 1)) (hk₀ : (F.obs.β (target p) k₀ - γ k₀) ≠ 0) (hyoung : ∀ k, k ≠ k₀ → (F.obs.β (target p) k - γ k) ≠ 0 → ¬ F.obs.dag.isAncestor k₀ k) (i : F.ι) (hAi : (F.env i).A = {k₀}) (hai : (F.env i).a k₀ ≠ F.obsMean k₀) : ¬ IdentDistrib (envResidual (F.env i) γ) (obsResidual F.obs γ) F.obs.P F.obs.P := by classical set M := F.obs with hM set e := F.env i with he -- `α k = β₀ₖ − γ k`. set α : Fin (p + 1) → ℝ := fun k => M.β (target p) k - γ k with hα -- `k₀ ≠ 0`: the intervention never targets `Y`, and `A = {k₀}`. have hk₀ne : k₀ ≠ target p := by intro h; subst h; exact e.hAtarget (by rw [hAi]; exact mem_singleton_self _) -- ---- Residual rewrites: `R = ε₀ + Σ_k α_k X_k` (both worlds). ---- -- `Σ α_k x_k = Σ β₀ₖ x_k − Σ γ_k x_k`. have hαsum : ∀ x : Fin (p + 1) → ℝ, ∑ k, α k * x k = (∑ k, M.β (target p) k * x k) - ∑ k, γ k * x k := by intro x rw [← Finset.sum_sub_distrib] apply Finset.sum_congr rfl; intro k _; simp only [hα]; ring have hobsR : ∀ᵐ ω ∂M.P, obsResidual M γ ω = M.ε ω (target p) + ∑ k, α k * M.X ω k := by filter_upwards [M.hε] with ω hω have hX0 : M.X ω (target p) = M.ε ω (target p) + ∑ k, M.β (target p) k * M.X ω k := by rw [sum_causalCoeff_eq M (M.X ω)]; rw [hω (target p)]; ring simp only [obsResidual, hX0, hαsum (M.X ω)]; ring have henvR : ∀ᵐ ω ∂M.P, envResidual e γ ω = M.ε ω (target p) + ∑ k, α k * e.X ω k := by filter_upwards [e.hDoStruct (target p) e.hAtarget] with ω hω have hX0 : e.X ω (target p) = M.ε ω (target p) + ∑ k, M.β (target p) k * e.X ω k := by rw [sum_causalCoeff_eq M (e.X ω), hω] simp only [envResidual, hX0, hαsum (e.X ω)]; ring -- ---- Integrability of each summand. ---- -- obs: `α k * X_k` is integrable. have hobsTermInt : ∀ k, Integrable (fun ω => α k * M.X ω k) M.P := fun k => (hInt k).const_mul _ -- env: `α k * X_kᵉ` is integrable: either `α k = 0` (zero function) or `X_kᵉ` -- agrees a.e. with an integrable function (`a` const if `k = k₀`, `X_k` else). have hAk₀ : ∀ᵐ ω ∂M.P, e.X ω k₀ = e.a k₀ := e.hDoPin k₀ (by rw [hAi]; exact mem_singleton_self _) have henvEqObs : ∀ k, k ≠ k₀ → ¬ M.dag.isAncestor k₀ k → ∀ᵐ ω ∂M.P, e.X ω k = M.X ω k := by intro k hk hanc filter_upwards [nonDescendant_invariance M e k₀ hAi] with ω hω using hω k hk hanc have henvTermInt : ∀ k, Integrable (fun ω => α k * e.X ω k) M.P := by intro k by_cases hαk : α k = 0 · simp [hαk] · by_cases hkk₀ : k = k₀ · -- `k = k₀`: `e.X · k =ᵐ e.a k₀` (do-pin), so `α k * e.X · k =ᵐ α k * e.a k₀`. subst hkk₀ refine (integrable_const (α k * e.a k)).congr ?_ filter_upwards [hAk₀] with ω hω using by rw [hω] · -- `k ≠ k₀` and `α k ≠ 0`, so `k` is a non-descendant of `k₀`. have hanc : ¬ M.dag.isAncestor k₀ k := hyoung k hkk₀ hαk refine ((hInt k).const_mul (α k)).congr ?_ filter_upwards [henvEqObs k hkk₀ hanc] with ω hω using by rw [hω] -- ---- Compute the two means. ---- have hεInt : Integrable (fun ω => M.ε ω (target p)) M.P := eps_integrable M (target p) have hobsMean : ∫ ω, obsResidual M γ ω ∂M.P = ∑ k, α k * (∫ ω, M.X ω k ∂M.P) := by rw [integral_congr_ae hobsR] rw [integral_add hεInt (integrable_finset_sum _ (fun k _ => hobsTermInt k))] rw [eps_integral_zero M (target p), zero_add, integral_finset_sum _ (fun k _ => hobsTermInt k)] apply Finset.sum_congr rfl; intro k _; rw [integral_const_mul] have henvMean : ∫ ω, envResidual e γ ω ∂M.P = ∑ k, α k * (∫ ω, e.X ω k ∂M.P) := by rw [integral_congr_ae henvR] rw [integral_add hεInt (integrable_finset_sum _ (fun k _ => henvTermInt k))] rw [eps_integral_zero M (target p), zero_add, integral_finset_sum _ (fun k _ => henvTermInt k)] apply Finset.sum_congr rfl; intro k _; rw [integral_const_mul] -- ---- The mean gap is the single `k₀` term. ---- have hgap : ∫ ω, envResidual e γ ω ∂M.P - ∫ ω, obsResidual M γ ω ∂M.P = α k₀ * (e.a k₀ - F.obsMean k₀) := by rw [henvMean, hobsMean, ← Finset.sum_sub_distrib] -- Each term: `α k * (E[X_kᵉ] − E[X_k])`. Only `k = k₀` survives. have hterm : ∀ k ∈ univ, k ≠ k₀ → α k * (∫ ω, e.X ω k ∂M.P) - α k * (∫ ω, M.X ω k ∂M.P) = 0 := by intro k _ hkk₀ by_cases hαk : α k = 0 · simp [hαk] · have hanc : ¬ M.dag.isAncestor k₀ k := hyoung k hkk₀ hαk have : (∫ ω, e.X ω k ∂M.P) = (∫ ω, M.X ω k ∂M.P) := integral_congr_ae (henvEqObs k hkk₀ hanc) rw [this]; ring rw [Finset.sum_eq_single k₀ hterm (by simp)] -- `E[X_{k₀}ᵉ] = a k₀` (do-pin); `E[X_{k₀}] = obsMean k₀`. have hEnvk₀ : (∫ ω, e.X ω k₀ ∂M.P) = e.a k₀ := by rw [integral_congr_ae hAk₀, integral_const]; simp rw [hEnvk₀] simp only [EnvFamily.obsMean]; ring -- ---- Different means ⟹ not IdentDistrib. ---- intro hid have heq : ∫ ω, envResidual e γ ω ∂M.P = ∫ ω, obsResidual M γ ω ∂M.P := hid.integral_eq rw [heq, sub_self] at hgap exact (mul_ne_zero hk₀ (sub_ne_zero.mpr hai)) hgap.symm
Causalean.Discovery.InvariantPrediction.LinearGaussian.EnvFamily.residual_mean_shift_of_doIntervention · Causalean/Discovery/InvariantPrediction/LinearGaussian/Completeness.lean:168 · uses EnvFamily , ObsIntegrable , obsMean , envResidual , obsResidual , target , isAncestor
theorem icp_complete_linearGaussian_of_exogeneity reviewed
Causalean.Discovery.InvariantPrediction.LinearGaussian.EnvFamily

Conditional completeness for do-interventions (Theorem 2(i) specialization). For a linear-Gaussian environment family whose models separately certify target exogeneity, with integrable observational regressors, such that every predictor jj receives at least one environment with a single do-intervention Ae={j}A^e = \{j\} whose shifted value ajea^e_j differs from its observational mean E[Xj1]E[X^1_j], the ICP identified set — the intersection of all invariant predictor sets — equals exactly the parent set of the target node, S(E)=PA(Y)S(E) = PA(Y).

Formal statement
p :
ℕ
shared
F :
shared
hInt :
F.ObsIntegrable
hInterv :
F.HasShiftedSingleInterventions
F.identifiedSet = F.paY
Proof (Lean source)
theorem icp_complete_linearGaussian_of_exogeneity (hInt : F.ObsIntegrable) (hInterv : F.HasShiftedSingleInterventions) : F.identifiedSet = F.paY := by classical apply le_antisymm (icp_sound_linearGaussian_of_exogeneity F) -- `PA(Y) ⊆ S(E)`: every parent lies in every invariant set. intro pp hpp rw [mem_identifiedSet] intro S hS rw [mem_invariantSets] at hS obtain ⟨hSpred, γ, Fε, hSupp, _, hObsLaw, _, hEnvLaw⟩ := hS -- It suffices to show `PA(Y) ⊆ S`. by_contra hppS -- `α k = β₀ₖ − γ k`. Its support `T` is nonempty (contains `pp`). set α : Fin (p + 1) → ℝ := fun k => F.obs.β (target p) k - γ k with hα -- `α pp ≠ 0`: `pp ∈ paY` gives `β₀,pp ≠ 0`, and `pp ∉ S` gives `γ pp = 0`. have hγpp : γ pp = 0 := by by_contra h; exact hppS (hSupp pp h) have hαpp : α pp ≠ 0 := by simp only [hα, hγpp, sub_zero] exact F.obs.mem_paY.mp hpp set T : Finset (Fin (p + 1)) := Finset.univ.filter (fun k => α k ≠ 0) with hT have hppT : pp ∈ T := by rw [hT]; simp [hαpp] have hTne : T.Nonempty := ⟨pp, hppT⟩ -- Youngest index of the support. obtain ⟨k₀, hk₀T, hk₀young⟩ := F.exists_youngest_nonzero T hTne have hαk₀ : α k₀ ≠ 0 := by rw [hT] at hk₀T; simpa using hk₀T -- `hyoung` for the mean-shift lemma: every other support index is a non-ancestor. have hyoung : ∀ k, k ≠ k₀ → (F.obs.β (target p) k - γ k) ≠ 0 → ¬ F.obs.dag.isAncestor k₀ k := by intro k hk hαk exact hk₀young k (by rw [hT]; simp [α, hαk]) hk -- `k₀` is a predictor (`k₀ ≠ 0`): either `γ k₀ ≠ 0` (so `k₀ ∈ S ⊆ predictors`) or -- `β₀,k₀ ≠ 0` (so `k₀ ∈ paY ⊆ predictors`). have hk₀pred : k₀ ∈ predictors p := by by_cases hγk₀ : γ k₀ = 0 · -- `β₀,k₀ = α k₀ ≠ 0`, so `k₀ ∈ paY`. have : F.obs.β (target p) k₀ ≠ 0 := by have : α k₀ = F.obs.β (target p) k₀ := by simp [hα, hγk₀] rwa [this] at hαk₀ exact F.obs.paY_subset_predictors (F.obs.mem_paY.mpr this) · exact hSpred (hSupp k₀ hγk₀) -- A single shifted do-intervention on `k₀`. obtain ⟨i, hAi, hai⟩ := hInterv k₀ hk₀pred -- The mean-shift lemma: residuals are NOT identically distributed. have hni := F.residual_mean_shift_of_doIntervention hInt γ k₀ hαk₀ hyoung i hAi hai -- But the invariance null says they share the law `Fε`, hence ARE identically -- distributed — contradiction. apply hni have hmeasObs : Measurable (obsResidual F.obs γ) := (F.obs.hXmeas (target p)).sub (Finset.measurable_sum _ (fun k _ => (F.obs.hXmeas k).const_mul _)) have hmeasEnv : Measurable (envResidual (F.env i) γ) := ((F.env i).hXmeas (target p)).sub (Finset.measurable_sum _ (fun k _ => ((F.env i).hXmeas k).const_mul _)) refine ⟨hmeasEnv.aemeasurable, hmeasObs.aemeasurable, ?_⟩ rw [hEnvLaw i, hObsLaw]
Causalean.Discovery.InvariantPrediction.LinearGaussian.EnvFamily.icp_complete_linearGaussian_of_exogeneity · Causalean/Discovery/InvariantPrediction/LinearGaussian/Completeness.lean:293 · uses EnvFamily , HasShiftedSingleInterventions , ObsIntegrable , identifiedSet , paY
1 supporting declaration (lemmas, instances)
  • exists_youngest_nonzero theorem — Youngest-node selection (the "youngest node X_{k₀}" step). Given a nonempty set of coordinate indices $T$, there is an index $k_0 \in T$ such that no other element of $T$ is a descendant of $k_0$ along the observational DAG's directed edges — i.e. $k_0$ is a sink of the subgraph induced by $T$. This is the "youngest" node with non-zero α of the paper's proof.
    p :
    ℕ
    shared
    F :
    shared
    T :
    Finset (Fin (p + 1))
    hT :
    T.Nonempty
    ∃ k₀ ∈ T, ∀ k ∈ T, k ≠ k₀ → ¬ F.obs.dag.isAncestor k₀ k
    Proof (Lean source)
    theorem exists_youngest_nonzero (T : Finset (Fin (p + 1))) (hT : T.Nonempty) : ∃ k₀ ∈ T, ∀ k ∈ T, k ≠ k₀ → ¬ F.obs.dag.isAncestor k₀ k := by -- Pick the index of `T` with the largest topological order: it cannot be a -- proper ancestor of any other element, since ancestors strictly increase the -- topological order. obtain ⟨k₀, hk₀T, hmax⟩ := Finset.exists_max_image T (fun k => F.obs.dag.topoOrder k) hT refine ⟨k₀, hk₀T, ?_⟩ intro k hkT _ hanc have hlt : F.obs.dag.topoOrder k₀ < F.obs.dag.topoOrder k := F.obs.dag.isAncestor_topoOrder_lt hanc exact absurd (hmax k hkT) (Nat.not_le.mpr hlt)
    Causalean.Discovery.InvariantPrediction.LinearGaussian.EnvFamily.exists_youngest_nonzero · Causalean/Discovery/InvariantPrediction/LinearGaussian/Completeness.lean:150