Discovery.InvariantPrediction.LinearGaussian
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
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 ∫.
The target node is reserved as coordinate zero, leaving exactly the other p coordinates available as predictors.
Definition (Lean source)
The predictor index set contains exactly the numbered predictor coordinates, excluding the target stored at coordinate zero.
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)
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.
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
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)
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.
The family's causal target-parent set is anchored to the observational SEM shared by the intervention family with predictor dimension p.
2 supporting declarations (lemmas, instances)
-
mem_predictorstheorem — A node is a predictor exactly when it is not the target node.Proof (Lean source)
-
paY_subset_predictorstheorem — PA(Y) consists of predictors only (0 ∉ PA(Y)): the target is acyclic, so it is not its own parent.Proof (Lean source)
theorem paY_subset_predictors : M.paY ⊆ predictors p := by intro k hk rw [mem_predictors] rintro rfl exact M.dag.irrefl (target p) (M.dag.mem_parents.mp hk)
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.
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.
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.
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.
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)
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)
The ICP identified set keeps the predictors present in every invariant subset for environment family F with predictor dimension p.
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
Proof (Lean source)
2 supporting declarations (lemmas, instances)
-
instDecidablePredFinsetFinHAddNatOfNatInvarianceNullinstance — 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.parametersp :sharedℕinstancegiven byfun _ => Classical.dec _ -
mem_invariantSetstheorem — 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.hypothesesconclusionS ∈ F.invariantSets ↔ S ⊆ predictors p ∧ F.InvarianceNull SProof (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]
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 α).
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.
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)
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)
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
Proof (Lean source)
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
Proof (Lean source)
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 receives at least one environment with a single do-intervention whose shifted value differs from its observational mean , the ICP identified set — the intersection of all invariant predictor sets — equals exactly the parent set of the target node, .
Formal statement
Proof (Lean source)
1 supporting declaration (lemmas, instances)
-
exists_youngest_nonzerotheorem — 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.hypothesesconclusion∃ k₀ ∈ T, ∀ k ∈ T, k ≠ k₀ → ¬ F.obs.dag.isAncestor k₀ kProof (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)