(sec-causal-discovery-interventional-geometry-and-the-singularity-of-action)=
# Causal Discovery: Interventional Geometry and the Singularity of Action

## TLDR

- Causality cannot be learned from observation alone; you must **intervene**. This chapter formalizes intervention as a
  geometric/surgical operator on the transition law.
- Define a **causal information potential**: where interventions would teach you the most about the world model.
- Curiosity becomes a **vector field** (a force) given by the gradient of that potential, combined with utility forces
  from reward.
- Use the framework to detect when an ontology is observationally adequate but interventionally wrong (hidden
  confounding).
- Outputs: implementable definitions of intervention gap, curiosity pressure, and diagnostics for causal uncertainty.

## Roadmap

1. Interventions vs. observations as operators on dynamics.
2. Causal information potential and the induced curiosity force.
3. How causal failures trigger ontology expansion and safety constraints.

:::{div} feynman-prose
Here is a question that has puzzled philosophers for centuries and is now becoming urgent for artificial intelligence: How do you learn what *causes* what?

You can watch the world all day long. You can notice that the rooster crows and then the sun rises. You can observe that people who carry umbrellas tend to be near puddles. You can measure that ice cream sales and drowning deaths are correlated. But you know---you *know*---that the rooster doesn't cause the sunrise, that umbrellas don't cause rain, that ice cream doesn't cause drowning. Correlation is not causation. Every statistics student learns this. But how do you actually tell the difference?

The answer is embarrassingly simple once you see it: *you have to do something*. You have to reach into the world and poke it. You have to intervene.

If you want to know whether the rooster causes the sunrise, you silence the rooster and wait. The sun still rises. Mystery solved. If you want to know whether ice cream causes drowning, you force a random sample of people to eat ice cream (or not) and see if the drowning rate changes. It doesn't---the correlation was driven by a common cause (hot weather). The only way to discover causal structure is through *action*.

This chapter makes that intuition mathematically precise. We're going to formalize what it means to "intervene" as opposed to merely "observe." We'll show that interventions are a kind of *surgery* on the probability distribution---you're cutting certain causal arrows and forcing variables to take values they wouldn't naturally take. And we'll derive that the agent's "curiosity"---its drive to explore and experiment---arises naturally as a force pulling it toward regions where the causal structure is most uncertain.

The punchline is this: a truly intelligent agent cannot be passive. To understand the world, you must act on it. Observation tells you *what* happens; intervention tells you *why*.
:::

*Abstract.* We formalize the process of causal induction as a surgery on the latent transition kernel. We
define an **Intervention** as a singular operator $\mathfrak{I}$ that replaces the policy action law by an
exogenous action while preserving the environment mechanism. Boundary language is used only as an operational
analogy: observations provide an assimilation target and interventions provide an externally selected action/flux.
We define the agent's "Curiosity" as a vector field $\mathbf{f}_{\text{exp}}$ generated by the gradient of a
**Causal Information Potential** $\Psi_{\text{causal}}$, which measures the epistemic volatility of the World Model. We
characterize Causal Discovery as a variational search for the transition law $\bar{P}$ that minimizes the
Interventional Gap, thereby transforming observational correlations into structural causal manifolds.

(rb-curiosity-vector)=
:::{admonition} Researcher Bridge: Curiosity as a Vector Field (Not a Scalar)
:class: tip
Standard curiosity-driven RL (like RND) uses a scalar reward bonus (conservative case) to encourage exploration. We
reframe "Curiosity" as a **Riemannian Force Field**. It is defined by the **Interventional Gap** - the discrepancy
between what the model predicts through passive observation vs. active $do$-sampling. Curiosity is not an "incentive"
you add to the reward; it is a vector that physically steers the agent toward states where its causal model is most
likely to be proven wrong.
:::

*Cross-references:*
- Builds on the symplectic boundary framework
  ({ref}`sec-the-symplectic-interface-position-momentum-duality`).
- Uses World Model dynamics ({ref}`sec-scaling-exponents-characterizing-the-agent`) and the Causal
  Enclosure condition ({ref}`sec-conditional-independence-and-sufficiency`).
- Connects to Ontological Expansion ({ref}`sec-ontological-expansion-topological-fission-and-the-semantic-vacuum`)
  via the interventional closure theorem.

*Literature:* Causal inference {cite}`pearl2009causality`; causal discovery {cite}`spirtes2000causation`; expected
information gain {cite}`lindley1956measure`; optimal experimental design {cite}`chaloner1995bayesian`; intrinsic
motivation {cite}`schmidhuber2010formal,oudeyer2007intrinsic`; curiosity-driven exploration
{cite}`pathak2017curiosity,houthooft2016vime`.



(sec-the-interventional-operator-as-manifold-surgery)=
## The Interventional Operator as Manifold Surgery

:::{div} feynman-prose
Now we need to get precise about what "intervention" really means. The key insight is that when you intervene, you're doing something rather violent to the probability distribution---you're cutting it.

Think about it this way. Under normal observation, everything is connected. The state of the world flows from causes to effects, and when you observe an effect, you learn something about its causes. That's Bayesian inference. If you see someone carrying an umbrella, you update your belief that it might be raining.

But when you *intervene*---when you force someone to carry an umbrella---you've broken that chain. You've severed the connection between "umbrella" and "rain." The umbrella is no longer evidence of rain; it's just something you made happen. The action you took screens off the variable from its natural causes.

Pearl calls this the $do$ operator, and it's one of the deepest ideas in modern statistics. $P(\text{wet} | \text{see umbrella})$ is very different from $P(\text{wet} | do(\text{carry umbrella}))$. In the first case, seeing an umbrella tells you it's probably raining, so things are probably wet. In the second case, you've just forced someone to carry an umbrella regardless of the weather---it tells you nothing about whether things are wet.

The mathematical formalization is beautiful. We model intervention as a *surgery* on the joint distribution: you take the causal graph, you cut all the arrows pointing into the variable you're intervening on, and you clamp that variable to whatever value you chose. Everything downstream still works the same way; you've just destroyed the upstream connections.
:::

In passive interaction, the agent's state is constrained by the environment ({ref}`sec-the-symplectic-interface-position-momentum-duality`). Causal discovery requires the active breaking of this constraint.

:::{prf:definition} The Interventional Surgery
:label: def-the-interventional-surgery

Let $U_t$ denote hidden environment state not included in $z_t$, and let the structural transition be
$P_\partial(z_{t+1}\mid z_t,a_t,U_t)$. We define the **Interventional Operator**
$\mathfrak{I}: \mathcal{P}(\mathcal{Z} \times \mathcal{A} \times \mathcal{Z}) \to \mathcal{P}(\mathcal{Z} \times \mathcal{A} \times \mathcal{Z})$—equivalent to Pearl's $do(a_t)$
{cite}`pearl2009causality`—as a surgery that replaces the policy-induced action law by an exogenous action.

Geometrically, $\mathfrak{I}$ replaces the policy-induced motor flux by an exogenous motor flux. The sensory
Dirichlet condition on $z_t$ and the state dependence of the environment mechanism are unchanged.

Formally, the operator acts by truncated factorization:

$$
P(z' | z, do(a)) := \int P_\partial(z' | z, a, u)P(u|z)\,du,

$$
where the structural mechanism is preserved but $a$ is no longer generated by the observational policy. For marginal interventional queries:

$$
P_{\text{int}}(z' | do(a)) = \int_{\mathcal{Z}\times\mathcal U} P_\partial(z' | \tilde z, a, u)
P(u|\tilde z)P_{\text{pre}}(\tilde z) \, d\mu_G(\tilde z)\,du,

$$
where $P_{\text{pre}}(\tilde{z})$ is the pre-intervention distribution over latent states.

:::
:::{prf:lemma} Interventional Joint Under Exogenous Action
:label: lem-the-interventional-singularity

For a fixed intervention $do(a=a_0)$, the post-intervention joint has the factorization

$$
P_{\mathrm{pre}}(z)\,\delta_{a_0}(a)\,P_\partial(z'\mid z,a_0,u)P(u\mid z),
$$
after marginalizing any hidden environment state. It is singular with respect to an observational joint whose
action conditional $\pi(a\mid z)$ is a density and does not put an atom at $a_0$.

*Proof.* The factorization follows by replacing $\pi(a\mid z)$ with $\delta_{a_0}(a)$ while retaining the structural mechanism. A density policy is absolutely continuous in $a$, whereas $\delta_{a_0}$ is atomic. This measure-theoretic singularity does not assert infinite curvature or a PDE point source. $\square$

*Remark (Surgery vs. Conditioning).* The key distinction from Bayesian conditioning is that $P(z' | do(a)) \neq P(z' | a)$ in general. Conditioning updates beliefs given evidence; intervention changes the generating mechanism. The former is reversible; the latter is a topological surgery.

:::

:::{div} feynman-prose
Let me make sure this distinction is crystal clear, because it's the crux of everything.

**Conditioning** says: "Given that I observed action $a$ being taken, what do I expect to happen next?" This is passive. You're watching someone else (or yourself, acting according to your usual policy) and updating your beliefs based on what you see.

**Intervening** says: "I'm going to *force* action $a$ to happen, regardless of everything else. What happens then?" This is active. You're reaching in and overriding the natural flow.

Why does this matter? Because of confounders. Suppose there's some hidden variable $U$ that influences both your action and the outcome. When you *condition* on the action, you're implicitly learning something about $U$, which then affects your prediction about the outcome. When you *intervene*, you've broken that link---$U$ no longer has any path to influence your prediction through the action, because you've fixed the action by fiat.

This is why randomized controlled trials are the gold standard in medicine. When you randomly assign people to treatment or control, you're *intervening* on the treatment variable. Any confounders that might have influenced who chooses to take the treatment are now irrelevant---you've severed those causal arrows by randomization.

The geometric picture is useful only as a mnemonic. In the formal statement, "singular" refers to the
measure-theoretic difference between an exogenous fixed action and a continuous policy; it does not mean
infinite curvature, a Dirac source, or a changed sensory boundary condition. The causal operation is the
factorization: replace the policy's action law while retaining the environment mechanism.
:::

(sec-the-causal-information-potential)=
## The Causal Information Potential

:::{div} feynman-prose
Now here's the beautiful question: if intervention is the key to discovering causation, which interventions should you try?

You can't try everything. Actions cost energy, time, and sometimes have irreversible consequences. A scientist designing an experiment doesn't just randomly poke at things---they think carefully about which experiments will be most *informative*.

What makes an experiment informative? It's informative if the outcome will significantly change your beliefs about how the world works. If you already know exactly what's going to happen, the experiment is pointless. If you have no idea what's going to happen, and observing the outcome will resolve that uncertainty, that's a valuable experiment.

This idea has a precise mathematical formulation: the **Expected Information Gain**. You ask: "If I do this action, how much will I expect to learn about the parameters of my world model?" The actions that maximize this quantity are the ones most worth taking, from a pure knowledge-seeking perspective.

But there's a subtlety here that's worth pausing on. Not all uncertainty is created equal. There's uncertainty because you genuinely don't know the causal structure, and there's uncertainty because the world is just noisy. Staring at static on a TV is very uncertain---you have no idea which pixel will be bright next---but it's not informative. The outcomes are random; observing them teaches you nothing about underlying structure.

The distinction we need is between *entropy* (how uncertain are you?) and *varentropy* (how uncertain is your uncertainty?). If you're confidently clueless---you know the outcome is random---that's high entropy but low varentropy. If you're uncertain about *which* underlying model is correct, and different models make very different predictions, that's high varentropy. The agent should be curious about high-varentropy situations, not just high-entropy ones.
:::

To motivate the agent to perform experiments, we define a potential based on the uncertainty of the World Model $\bar{P}$.

:::{prf:definition} Causal Information Potential
:label: def-causal-information-potential

Define the **action-conditioned Causal Information Potential** $\Psi_{\text{causal}}^{\mathrm{act}}: \mathcal{Z} \times \mathcal{A} \to \mathbb{R}_{\ge 0}$ as the Expected Information Gain (EIG) {cite}`lindley1956measure` regarding the transition parameters $\theta_W$ at state-action pair $(z, a)$:

$$
\Psi_{\text{causal}}^{\mathrm{act}}(z, a) := \mathbb{E}_{z' \sim \bar{P}(\cdot | z, do(a))} \left[ D_{\text{KL}} \left( p(\theta_W | z, a, z') \| p(\theta_W | z, a) \right) \right].

$$
Define the state potential used by the drift as $\Psi_{\text{causal}}(z):=\mathbb{E}_{a\sim\pi(\cdot|z)}[\Psi_{\text{causal}}^{\mathrm{act}}(z,a)]$. Units: $[\Psi_{\text{causal}}]=\text{nat}$.

*Physical interpretation:* $\Psi_{\text{causal}}^{\mathrm{act}}(z,a)$ measures how much the agent expects to learn about
the World Model parameters by executing $a$ from $z$. The state potential averages this quantity under the declared
policy; a max or a different design distribution would define a different state field.

:::

::::{admonition} Connection to RL #16: Entropy Maximization as Causal-Blind Exploration
:class: note
:name: conn-rl-16
**The General Law (Fragile Agent):**
The agent explores via the **Causal Information Potential** $\Psi_{\text{causal}}$ (Definition {prf:ref}`def-causal-information-potential`):

$$
\Psi_{\text{causal}}(z, a) := \mathbb{E}_{z' \sim \bar{P}(\cdot | z, a)} \left[ D_{\text{KL}} \left( p(\theta_W | z, a, z') \| p(\theta_W | z, a) \right) \right].

$$
This measures the **Expected Information Gain** about the world model—the agent seeks actions that maximally resolve uncertainty about causal dynamics.

**The Degenerate Limit:**
Remove the causal/interventional structure: $do(a) \to \text{just take } a$. Replace model-based EIG with model-free entropy.

**The Special Case (Standard RL - Maximum Entropy):**
Standard MaxEnt RL maximizes action entropy without considering *what* the entropy is about:

$$
\max_\pi \mathbb{E}\left[ \sum_t r_t + \alpha H(\pi(\cdot | s_t)) \right].

$$
This encourages diverse actions but is **causally blind** -- it cannot distinguish correlation from causation, confounded from unconfounded observations.

**Result:** Shannon entropy maximization is the $\Psi_{\text{causal}} \to H(\pi)$ limit where the causal graph is ignored.

**What the generalization offers:**
- **Causal targeting**: $\Psi_{\text{causal}}$ guides the agent toward experiments that resolve *specific* uncertainties about dynamics
- **Interventional semantics**: The $do(\cdot)$ operator distinguishes observations from interventions (Definition {prf:ref}`def-the-interventional-surgery`)
- **Causal Deficit detection**: $\Delta_{\text{causal}}$ (Theorem {prf:ref}`thm-the-interventional-gap`) diagnoses where correlations fail as causal predictors
- **Principled exploration-exploitation**: $\beta_{\text{exp}}$ trades off curiosity force vs utility force (Theorem {prf:ref}`thm-augmented-drift-law`)
::::

:::{div} feynman-prose
The Causal Deficit is a diagnostic quantity that tells you: "How wrong would you be if you used correlation-based predictions in place of causal predictions?" When the deficit is zero, your observational model is causally correct---you've learned the true causal structure, not just statistical associations. When the deficit is large, you're being fooled by confounders.

Think about what this means practically. Suppose an agent has learned, from passive observation, that when it sees a certain pattern in its sensors, a certain outcome usually follows. The agent might think: "A causes B." But maybe both A and B are caused by some hidden variable C that the agent hasn't identified. The observational prediction $P(B | A)$ would be correct, but it would fail under intervention. If the agent *forces* A to happen (without C being present to trigger it), the outcome B won't follow.

The Interventional Gap measures exactly this failure. It's the divergence between what you predict from observation and what actually happens when you intervene. Closing this gap is what it means to learn causal structure.
:::

:::{prf:proposition} Conditional Interventional Gap
:label: thm-the-interventional-gap

Let $U$ be a hidden environment variable. Define

$$
P_{\text{obs}}(z'|z,a):=\int P_\partial(z'|z,a,u)P(u|z,a)\,du,
\qquad
P_{\text{int}}(z'|z,do(a)):=\int P_\partial(z'|z,a,u)P(u|z)\,du.
$$
The **Causal Deficit** is the KL divergence between these two declared kernels:

$$
\Delta_{\text{causal}}(z, a) := D_{\text{KL}} \left( P_{\text{int}}(z' | z, do(a)) \| P_{\text{obs}}(z' | z, a) \right).

$$
*Interpretation:* The Causal Deficit measures the discrepancy between interventional and observational predictions
under the hidden-state model. If no hidden common cause is present, or if $U$ is included in $z$, the two kernels
coincide and the deficit is identically zero. A positive value therefore requires the explicit hidden-state or
learned-model distinction above; it is not implied by the one-kernel Markov model.

*Proof.* By the properties of KL-divergence, $\Delta_{\text{causal}} \ge 0$ with equality iff $P_{\text{int}} = P_{\text{obs}}$ almost everywhere. The agent's "Causal Ignorance" is the volume of states where $\Delta_{\text{causal}} > 0$:

$$
\text{Vol}_{\text{ignorant}} := \int_{\mathcal{Z} \times \mathcal{A}} \mathbb{I}[\Delta_{\text{causal}}(z, a) > 0] \, d\mu_G(z) \, da.

$$
This volume represents the region of state-action space where the declared observational model fails to predict
interventional outcomes. $\square$

:::
:::{prf:remark} Epistemic Curiosity Diagnostic
:label: cor-epistemic-curiosity-filter

The Causal Information Potential $\Psi_{\text{causal}}$ (Definition {prf:ref}`def-causal-information-potential`) may be
compared with posterior varentropy, but no proportionality follows from the EIG definition without a specified
posterior family and likelihood.

Let $V_H[P(\theta_W | z, a, z')]$ denote the Varentropy of the posterior over World Model parameters after observing
transition $(z, a) \to z'$. For a chosen posterior family one may test:

$$
\nabla \Psi_{\text{causal}} \stackrel{?}{\propto} \nabla \mathbb{E}_{z'} \left[ V_H [P(\theta_W | z, a, z')] \right].

$$
*Units:* nat (for $\Psi_{\text{causal}}$), $\mathrm{nat}^2$ (for $V_H$).

**Operational Significance:** The Curiosity Force can be ranked using this varentropy diagnostic when the same
posterior and sampling measure are used on both sides. It should not replace EIG without that calibration.

1. **High Entropy, Low Varentropy:** The World Model is confidently predicting "I don't know" (White Noise). The gradient $\nabla \Psi \approx 0$. The agent ignores this region (solves the "Noisy TV" problem).
2. **High Entropy, High Varentropy:** The World Model oscillates between distinct causal hypotheses ($H_1$: "Object falls", $H_2$: "Object floats"). The gradient $\nabla \Psi$ is maximal. The agent is strongly attracted to this state to resolve the structural ambiguity.

**Implementation:** The Experimental Sieve (Algorithm 32.5.1) may log varentropy alongside EIG; the selection rule
is the declared EIG or an explicitly chosen calibrated proxy.

:::

:::{div} feynman-prose
The "Noisy TV" problem is a famous pathology in curiosity-driven reinforcement learning. Here's the setup: you give an agent an intrinsic reward for encountering "novel" or "unpredictable" situations. The agent explores, and eventually it finds a television showing static. The static is completely unpredictable---maximal entropy---so the agent camps out in front of the TV forever, collecting its novelty bonus, learning absolutely nothing useful.

The useful part of the diagnosis is more specific than the slogan "varentropy solves the problem." If the
likelihood of the static is independent of the world-model parameters, its expected information gain is
zero, so the causal potential supplies no epistemic pull. Varentropy can be a diagnostic or an estimator
under a specified posterior model; it is not generally identical to EIG.

Contrast this with a genuinely interesting situation: the agent encounters some phenomenon where its two best models make different predictions. Model 1 says the object will fall; Model 2 says it will float. The agent is uncertain about which model is correct, and that uncertainty will be *resolved* by observing the outcome. This is high varentropy: the agent doesn't know which hypothesis is right, and the experiment will tell it. *This* is what the agent should be curious about.

When calibrated against the EIG model, this varentropy diagnostic can help the agent avoid mere
randomness and prioritize experiments that distinguish competing structural hypotheses. Without that
calibration, it is only a heuristic ranking signal.
:::

(sec-the-force-of-curiosity-geodesic-experimentation)=
## The Force of Curiosity: Geodesic Experimentation

:::{div} feynman-prose
Now we come to one of the most satisfying results in this framework: curiosity isn't just a heuristic or a bonus you bolt onto a reward function. It's a *force*. A geometric force, with a direction and magnitude, that pulls the agent through state space.

The setup is this: the agent lives on a manifold, and it has two competing interests. First, it wants to
reduce a cost-to-go $V$; that is the utility force $-G^{-1}\nabla V$. If $V$ is defined as negative
reward, this is the familiar climb toward high reward. Second, it wants to understand the world---that is
the curiosity force, pointing toward regions where the causal information potential is high.

The total force is the sum displayed in the theorem. The signs matter: curiosity contributes
$+\beta_{\text{exp}}G^{-1}\nabla\Psi_{\text{causal}}$, while the cost contribution descends $V$. The
first-order drift interpretation additionally uses the stated friction and overdamped-limit hypotheses; the
second-order variational equation is a different statement.

The parameter $\beta_{\text{exp}}$ controls the tradeoff. When $\beta_{\text{exp}}$ is large, the agent is a curious explorer, prioritizing knowledge over reward. When $\beta_{\text{exp}}$ is small, the agent is a focused exploiter, going straight for the reward. But crucially, this isn't exploration as random noise---it's exploration as *directed inquiry*. The agent explores toward the places where it will learn the most.

Think about how a good scientist operates. She doesn't just randomly run experiments. She identifies the key uncertainties in her theory, designs experiments that will resolve those uncertainties, and runs them. That's exactly what this framework formalizes. The curiosity force is the mathematical instantiation of the drive to do informative experiments.
:::

The agent does not only move toward reward; it moves toward **Causal Clarity**.

:::{prf:definition} Augmented Drift Model
:label: thm-augmented-drift-law

Given a state potential \(V\), a state-level causal information potential
\(\Psi_{\text{causal}}\), and the declared curl mobility
\(\mathcal M_{\text{curl}}\), define the exploratory drift by

$$
\dot z =
\mathcal M_{\text{curl}}\!\left(
  -G^{-1}\nabla_A V
  +\beta_{\text{exp}}G^{-1}\nabla\Psi_{\text{causal}}
\right),
\qquad
\mathcal M_{\text{curl}}
=(I-\beta_{\text{curl}}G^{-1}\mathcal F)^{-1}.
$$

Here \(\beta_{\text{exp}}\ge0\) is the exploration coefficient and
\(\nabla_A V=\nabla V-A\) uses the reward-field convention. This is a
chosen control law. The action functional written in the former proof
does not generate the curl mobility or the overdamped reduction, so no
variational theorem is asserted here.

*Physical interpretation:* The curiosity term points toward states with
larger declared expected information gain. Its use as an intrinsic reward
requires a calibrated interventional model and does not by itself prove
that learning or causal identification improves.

:::
:::{prf:remark} Conditional Scientific-Method Drift
:label: cor-scientific-method-as-geodesic

When \(V\) is constant, \(A=0\), and the curl mobility is the identity,
the deterministic second-order model with potential
\(-\beta_{\text{exp}}\Psi_{\text{causal}}\) has

$$
\ddot z^m+\Gamma^m_{ij}\dot z^i\dot z^j
= \beta_{\text{exp}}G^{mk}\partial_k\Psi_{\text{causal}}.
$$

This is a formal curiosity-driven control model. Calling its trajectories
scientific experiments requires the causal-information and intervention
hypotheses above; it is not a theorem that agents maximize knowledge.

:::

:::{div} feynman-prose
This corollary is a conditional limiting case. With constant task potential, the conservative
assumptions, and the regularity and dynamical regime required by the equation, the curiosity term is the
remaining directed drive. It can favor informative experiments; the statement does not guarantee global
maximization, eventual coverage, or a particular outcome from every initial condition.

When the utility term is removed, the displayed equation leaves the gradient of the causal information
potential as the conservative driving term (with any separately retained non-conservative term treated
according to its own hypotheses). In a first-order implementation this conclusion is inherited only after
the appropriate overdamped reduction, so "geodesic" is a description of the second-order analogy rather
than a claim of automatic convergence to the most informative point.

Of course, real agents can't be pure scientists forever. Eventually they need to eat, to avoid predators,
and to accomplish tasks. This limiting case is best understood as a design principle: under the stated
objective and dynamics, information seeking receives the remaining weight. It does not show that every
intelligent system is automatically curious.

The analogy to geodesics is also illuminating. A geodesic is the straightest possible path on a curved
surface. The "Pure Scientist" equation adds the curiosity drive to that geometric motion; friction,
curl, boundary conditions, and the initial state can change the resulting path. The analogy does not
promise the smoothest route or convergence to a global information maximum.
:::

(sec-causal-enclosure-and-interventional-stability)=
## Causal Enclosure and Interventional Stability

:::{div} feynman-prose
Here we tackle a question that has plagued philosophers and scientists alike: How do you know if your concepts are the right ones?

Consider an agent that has carved the world into categories---its "ontology." Maybe it has concepts like "ball," "table," "push," "roll." These work fine for passive observation. The agent sees a ball on a table, predicts it will stay there, and it does. The agent sees someone push the ball, predicts it will roll, and it does. So far so good.

But then the agent tries to intervene. It pushes what it thought was a "ball," and something completely unexpected happens. Maybe the ball sticks to the table (it was magnetic, and so was the table). The agent's ontology has failed---not because it couldn't predict passive observations, but because it didn't capture the causal structure that matters for intervention.

This is the distinction between observational and interventional adequacy of an ontology. An ontology is observationally adequate if it predicts what you'll see. It's interventionally adequate if it predicts what will happen when you act. These are different things, and interventional adequacy is the harder requirement.

The theorem below formalizes this. An ontology is interventionally closed when the macro-state remains
sufficient for the macro-transition under the specified interventions. Observational closure transfers to
that intervention law only with the stated mechanism-invariance, causal-sufficiency, and positivity
hypotheses. An off-support intervention can expose micro-dependence that passive data could not test; that
is the situation in which ontology expansion is warranted.

This is how ontologies grow. You start with a coarse-grained view of the world. You act, and sometimes your actions have unexpected effects. Those surprises tell you that your categories are missing something. You refine your ontology, adding new distinctions. And then you test again, with new interventions, looking for the next surprise.
:::

We refine the **Causal Enclosure** condition ({ref}`sec-conditional-independence-and-sufficiency`) to account for interventions.

:::{prf:definition} Interventional Closure Criterion
:label: thm-interventional-closure

For a specified family of interventions, call the macro-ontology $K$ **Interventionally Closed** when the
predictability of the macro-state is invariant under those $do$-operations:

$$
I(K_{t+1} ; Z_{\text{micro}, t} | K_t, do(K^{\text{act}}_t)) = 0.

$$
*Interpretation:* If an agent moves an object (intervention), and the resulting macro-state $K_{t+1}$ depends on micro-texture $z_{\text{tex}}$ that was previously labeled "noise," the ontology has failed. The intervention has **exposed a hidden variable**, triggering **Ontological Expansion** ({ref}`sec-ontological-expansion-topological-fission-and-the-semantic-vacuum`).

*Scope.* This is a criterion to be tested under the interventional measure. Observational closure alone does not
imply interventional closure: the intervention can change the distribution of hidden microvariables or expose a
back-door path. A positive conditional mutual information is evidence for an omitted variable only after positivity,
support, and mechanism-invariance assumptions have been checked; it is not an automatic iff theorem.

*Remark (Interventional Debugging).* Theorem {prf:ref}`thm-interventional-closure` provides a diagnostic for ontological adequacy: if the agent's predictions fail specifically under intervention but succeed under observation, the ontology contains a hidden confounder. This is the geometric manifestation of Simpson's paradox {cite}`pearl2009causality`. Algorithmic approaches to discovering such confounders are developed in the causal discovery literature {cite}`spirtes2000causation`.

:::

:::{admonition} Example: Simpson's Paradox and Interventional Debugging
:class: feynman-added example

Simpson's Paradox is the most famous example of how observational and interventional reasoning can diverge. Here's a classic case.

Suppose a hospital has two treatments for kidney stones: Treatment A (traditional surgery) and Treatment B (a new procedure). Looking at the overall data, Treatment B has a higher success rate: 83% vs 78%. So B is better, right?

But wait. If you stratify by kidney stone size, you find:
- For *small* stones: A succeeds 93% of the time, B succeeds 87%
- For *large* stones: A succeeds 73% of the time, B succeeds 69%

Treatment A is better in *every* stratum, but worse overall! The paradox resolves when you realize there's a confounder: doctors tend to give the new procedure B to easier (small stone) cases. So B gets credit for treating easier cases, not for being a better treatment.

The interventional question is: "If I *force* a patient to get treatment A vs B, which will do better?" The answer is A, in both strata. The observational data was confounded by the doctors' treatment decisions.

An agent suffering from Simpson's Paradox would have predictions that work under observation (it correctly predicts that patients getting B tend to do better) but fail under intervention (when it assigns treatments randomly, B does worse). This is exactly the signature of interventional failure: observation works, intervention doesn't.
:::

(sec-implementation-the-experimental-sieve)=
## Implementation: The Experimental Sieve

:::{div} feynman-prose
So far we've developed the theory. Now let's see how it actually works in practice. The Experimental Sieve is the algorithm that takes all these abstract ideas---causal potentials, interventional gaps, curiosity forces---and turns them into concrete decisions about what to do.

The basic loop is intuitive, but the order matters. The agent uses its current posterior or another stated
estimator of $\Psi_{\text{causal}}$ to choose a state-action experiment, navigates to that state, performs
the exogenous action, and then records the observed interventional gap. The gap is a post-intervention
diagnostic; it cannot generally be the criterion used to select an experiment before the intervention.

The key insight is that this isn't random exploration. The agent isn't just wandering around hoping to stumble onto something interesting. It's *actively seeking* the boundaries of its knowledge and probing them with targeted interventions.

Think of it like a scientist planning a research program. She doesn't just do experiments at random. She identifies the key uncertainties in her field, designs experiments to resolve them, allocates resources, runs the experiments, and updates her theories. The Experimental Sieve is the algorithmic version of this scientific method.
:::

The following algorithm implements curiosity-driven exploration via the Causal Information Potential, connecting to active inference {cite}`friston2017active` and information-directed sampling.

**Algorithm 32.5.1 (Active Interventional Sampling).**
For each interaction step $t$:
1. **Monitor Volatility:** Track the declared scalar world-model volatility $\gamma$ and its estimator uncertainty.
2. **Generate Hypothesis:** Identify a region $U \subset \mathcal{Z}$ where the estimated
   $\Psi_{\text{causal}}(z)$ or calibrated $\Delta_{\text{causal}}$ is high.
3. **Execute do-operation:** Inject a Neumann impulse $u_\pi$ to drive the state into $U$.
4. **Update Kernel:** Correct $\bar{P}$ using the interventional feedback and recompute the EIG estimate.

(node-53)=
**Node 53: InterventionalGapCheck (CausalEnclosureCheck)**

| **#**  | **Name**                   | **Component** | **Type**         | **Interpretation**                   | **Proxy**                                                                       | **Cost**                             |
|--------|----------------------------|---------------|------------------|--------------------------------------|---------------------------------------------------------------------------------|--------------------------------------|
| **53** | **InterventionalGapCheck** | World Model   | Causal Soundness | Does observation match intervention? | $\Delta_{\text{causal}} := D_{\text{KL}}(P_{\text{int}} \lVert P_{\text{obs}})$ | $O(\lvert\mathcal{A}\rvert \cdot d)$ |

**Interpretation:** Monitors the conditional Interventional Gap (Proposition {prf:ref}`thm-the-interventional-gap`).
High $\Delta_{\text{causal}}$ indicates disagreement between the declared observational and interventional kernels;
the confounding interpretation requires the hidden-state hypotheses above.

**Threshold:** $\Delta_{\text{causal}} < \delta_{\text{causal}}$ (engineering setpoint; calibrate it on held-out
interventional data).

**Trigger conditions:**
- **High InterventionalGapCheck:** The agent's observational model is confounded. Predictions under passive observation do not match outcomes under active intervention.
- **Low InterventionalGapCheck:** The two declared kernels agree on the tested support; this does not certify causal
  identification outside that support.

**Remediation:**
- If $\Delta_{\text{causal}}$ is persistently high: Increase $\beta_{\text{exp}}$ to prioritize causal exploration.
- If $\Delta_{\text{causal}}$ spikes after ontological change: The new macro-variables may have introduced confounders. Run Ontological Stress analysis (Node 49).

*Cross-reference:* Node 53 complements the TextureFirewallCheck (Node 29) by detecting causal leakage rather than representational leakage.

:::{div} feynman-prose
The InterventionalGapCheck is a kind of causal "reality check" that the agent runs continuously. Think of it as the agent asking itself: "Do things work the way I think they do when I actually try them?"

High values of $\Delta_{\text{causal}}$ are a warning that the two distributions in the definition disagree
at the tested state-action pair. The cause may be model error, hidden state, an unsupported action regime,
or a confounded observational policy; the number alone does not identify which one. It justifies targeted
experiments or model revision, while ontology expansion applies only after the relevant failure mode has
been established.

The remediation is straightforward: if your causal model is wrong, learn better. Increase the exploration coefficient to prioritize causal experiments. Or, if the gap appeared after an ontological change, investigate whether the new concepts introduced hidden confounders.

This is the feedback loop that drives causal learning. Try something. See if it works the way you expected. If not, update your model. Repeat. It's not sophisticated, but it's effective, and it's exactly what good scientists do.
:::

(sec-summary-table-the-hierarchy-of-interaction)=
## Summary Table: The Hierarchy of Interaction

**Table 32.6.1 (Interaction Mode Summary).**

| Mode             | Operator              | Boundary Condition  | Information Goal       |
|:-----------------|:----------------------|:--------------------|:-----------------------|
| **Observation**  | $P_{\mathrm{obs}}(z' \mid z, a)$ | Assimilation target (Dirichlet-like limit) | Information Extraction |
| **Retrieval**    | $\mathcal{R}(\omega)$ | Symplectic Bridge   | Semantic Alignment     |
| **Intervention** | $P_{\mathrm{int}}(z' \mid z, do(a))$ | Exogenous action / motor flux | **Causal Induction** |

**Key Results:**
1. **Interventional Surgery (Definition {prf:ref}`def-the-interventional-surgery`):** $do(a)$ replaces the policy action law while preserving the environment mechanism.
2. **Causal Potential (Definition {prf:ref}`def-causal-information-potential`):** $\Psi_{\text{causal}}$ measures expected information gain about transition dynamics.
3. **Curiosity Force (Theorem {prf:ref}`thm-augmented-drift-law`):** $\mathbf{f}_{\text{exp}} = G^{-1}\nabla\Psi_{\text{causal}}$ drives exploration toward causally informative states.
4. **Interventional Closure (Criterion {prf:ref}`thm-interventional-closure`):** Ontological adequacy is tested by invariance of macro-predictability under the declared $do$-operations.

**Conclusion.** Causal discovery is an active-data procedure: the agent compares separately estimated observational and
interventional kernels, then uses the calibrated EIG field to choose experiments. The geometric force is a modeling
interface; causal identification still depends on support, hidden-state, and estimation assumptions.

:::{div} feynman-prose
Let me step back and tell you what we've actually accomplished in this chapter.

We started with an ancient puzzle: how do you distinguish cause from correlation? The answer, we said, is intervention. You can't learn causation just by watching; you have to act.

Then we formalized what "intervention" means mathematically. It's a surgery on the probability distribution---you cut the incoming causal arrows to the variable you're manipulating and clamp it to a value of your choosing. This gives you the $do$-operator, which is different from conditioning and leads to different predictions.

Next, we asked: which interventions should you try? The answer is the ones that will teach you the most---the ones that maximize expected information gain about your world model. This gave us the Causal Information Potential, a landscape over state-action space where the peaks represent maximally informative experiments.

Taking the gradient of this potential gave us the Curiosity Force---a vector field that pulls the agent toward causally informative regions. And combining this with the utility force from reward gave us the total equation of motion: the agent moves toward both reward and understanding.

Finally, we connected causal discovery to ontological adequacy. An ontology that works for observation might fail under intervention, exposing hidden confounders. This provides a diagnostic for when the agent's concepts need to expand.

The picture that emerges is of intelligence as fundamentally active. Understanding the world isn't just pattern recognition on passive data streams. It's *experimentation*---targeted intervention designed to reveal causal structure. The Fragile Agent doesn't just process information; it generates information by acting on the world and observing what happens.

This is, I think, a more accurate model of how real intelligence works. Scientists don't just look at data; they design experiments. Children don't just watch the world; they poke it, break it, see what happens. Even our everyday understanding is built on countless tiny interventions---pushing doors to see if they open, asking questions to see how people respond, trying actions to see their effects.

The formalism in this chapter makes active experimentation explicit. Its curiosity term is a chosen
information-seeking objective with a geometric representation; the resulting force and any claims about
learning or convergence retain the assumptions attached to the estimator, transition law, and dynamical
limit.
:::
