Innovations
DeepCausality is built on a single axiomatic foundation introduced earlier in this section and addresses the problem classes discussed on the previous page. This page covers seventeen distinct innovations that, taken together, form a coherent substrate for dynamic causality.
The innovations are grouped into seven sections in logical order: foundation, mathematical substrate, causal discovery from data, causal modeling, causal inference, action, and production deployment. Each entry is brief by design; the Concepts section elaborates every primitive in full.
I. Foundation: the axiom
Section titled “I. Foundation: the axiom”Causality has to be defined before it can be computed. DeepCausality picks one definition, low enough in the stack that the classical methods drop out as special cases.
1. A spacetime-agnostic causal axiom. Causality is generalized as a monadic functional dependency, captured by m₂ = m₁ >>= f. Pearl SCMs, dynamic Bayesian networks, Granger causality, the Rubin causal model, and conditional average treatment effects all drop out as parametric specializations of that same axiom; the classical causality examples implement each one directly. See Axiom for the working definition.
II. The mathematical substrate
Section titled “II. The mathematical substrate”Once the axiom is set, it needs a numerical floor that the rest of the library stands on. Four innovations cover that floor end to end.
2. A uniform mathematical surface. Tensors, multivectors, manifolds, sparse matrices, and propagating effects all implement the same Functor, Monad, and CoMonad surface. fmap, bind, extend, and extract mean the same thing on every container, which is how cross-domain pipelines stay readable and how bridge code disappears. See Uniform Math.
3. An explicit algebraic trait hierarchy. Magma → Semigroup → Monoid → Group → AbelianGroup; then Ring → CommutativeRing → Field → RealField → ComplexField<R>; plus Module<R>, Algebra<R>, AssociativeAlgebra<R>, DivisionAlgebra<R>, and EuclideanDomain. Marker traits move algebraic laws into the type system, so an algorithm that requires associativity cannot accept a type that violates it. See Uniform Math.
4. Higher-Kinded Types via the witness pattern. Rust does not have native HKTs. deep_causality_haft fills the gap with zero-sized witness structs that stand in for type constructors, so the Causal Monad’s bind is written once generically and specialized per concrete instantiation through monomorphization. No boxed type erasure, no virtual calls. See Higher-Kinded Types.
5. Precision as a parameter. Because every math container stands on the generic algebraic floor, numerical precision becomes one type alias for the whole pipeline. pub type FloatType = Float106; flows through every tensor contraction, multivector rotation, manifold extension, and monadic step. The Multi-physics and multi-regime simulation section on the Problem page walks through what this earns in practice. See Uniform Math.
III. Discovery: from raw data to a model
Section titled “III. Discovery: from raw data to a model”A project rarely starts with a finished causal model. It starts with data, and the first job is to find the structure worth running inference against. Two innovations cover the path from observations to an executable model.
6. The Causal Discovery Language. CDL is a typestate-builder DSL that hosts two discovery algorithms as compile-time-isolated pipelines, driven by one explicit config. The typestate enforces stage order and algorithm isolation at compile time. SURD, MRMR, and BRCD ship as discovery primitives: SURD reports which variables are uniquely or synergistically causal (and flags redundant ones), while BRCD ranks the root cause of a regime shift across a normal and an anomalous dataset. See Causal Discovery Language.
7. Uncertainty as a first-order type. Uncertain<T> wraps a value with the distribution that produced it and uses the Sequential Probability Ratio Test for confidence-bounded decisions. MaybeUncertain<T> separates presence from distribution, so missing readings propagate explicitly rather than silently. See Uncertainty.
IV. Modeling: the primitives that hold causal structure
Section titled “IV. Modeling: the primitives that hold causal structure”With data on hand, four primitives carry the model. The first two share one premise: cause and effect are folded into one entity. They emit the same propagating effect and compose freely with each other.
8. The Causaloid as an isomorphic-recursive unit. A Singleton, a Collection, and a Hypergraph all implement the same Causable and MonadicCausable trait surface, so they nest into each other to arbitrary depth. Pick the structure the problem demands at every level and freely compose. See Causaloid.
9. A state-threading monad with first-class intervention. The carrier effect implements the CausalMonad trait: pure, bind, and intervene. bind threads Markovian state through the chain; intervene implements Pearl’s do() operator mid-chain, putting counterfactual reasoning in the same engine that runs factual reasoning. The three monad laws (left identity, right identity, associativity) are test-covered. See Causal Monad.
10. The explicit Context as a typed hypergraph. A typed weighted hypergraph of Contextoids mutated in place across a run, carrying data, space, time, spacetime, and symbolic payloads. Counterfactual analysis comes through parallel extra_contexts evaluated against the same Causaloid without disturbing the primary one. See Context.
11. The Adjustable trait. update replaces the stored value outright with a default that rejects the type’s zero sentinel; adjust applies a correction relative to the stored value with a default that rejects negative results. Both are const-generic over grid dimensions, so the same trait covers scalar, 2D frame, 3D volumetric, and 4D spacetime corrections. See Context.
V. Inference: the carrier and how it grows
Section titled “V. Inference: the carrier and how it grows”Three innovations cover how data actually flows through the model, and how you write the pipelines that drive it.
12. The Propagating Effect as a unified carrier. CausalEffectPropagationProcess<Value, State, Context, Error, Log> is the load-bearing five-field record, and it implements the Causal Monad trait directly. Every other primitive in the library (Causaloid, Context, CSM, Effect Ethos) exchanges work through this one type, and the audit log accumulates automatically across every step. See Effect Propagation Process.
13. Non-Markovian and Markovian under one type. PropagatingEffect<T> fixes state and context to (). PropagatingProcess<T, S, C> keeps them generic. Both are aliases of the same struct, so lifting from one form into the other is a single constructor call. Start non-Markovian and upgrade the carrier the moment state becomes necessary. See Effect Propagation Process.
14. The Causal Flow DSL. CausalFlow is a fluent facade over the Causal Monad that reads a pipeline as a sequence of verbs: value and process to seed, map and try_step and next to step, branch to route, iterate_n / iterate_until / iterate_to_fixpoint to loop, and intervene for a mid-pipeline do(). Every verb lowers to pure or bind, so the DSL adds reading clarity rather than new semantics, and the monad laws still hold. It hides the EffectValue wrapping and the manual error short-circuit, and it is the surface the library’s own examples are written on. See Causal Flow.
VI. From inference to safe action
Section titled “VI. From inference to safe action”A causal verdict on its own does nothing. Two innovations bridge inference to the outside world while keeping the system safe to deploy.
15. The Causal State Machine. A thread-safe registry of (CausalState, CausalAction) pairs where the active state space is inferred at runtime from the propagating effect rather than enumerated at design time. See Causal State Machine.
16. The Effect Ethos. Every action the CSM proposes is intercepted and evaluated against a graph of Teloids under DDIC (Defeasible Deontic Inheritance Calculus from Olson, Salas-Damian, and Forbus). Conflict resolves through Lex Posterior, Lex Specialis, Lex Superior. Reasoning is free to be emergent; actions are not. See Effect Ethos.
VII. Production deployment
Section titled “VII. Production deployment”Once the model is approved for production, it has to serve traffic.
17. Native async serving on Tokio. DeepCausality is a Rust library. The CSM is thread-safe by construction (Arc<RwLock<...>>) so it embeds natively inside any async runtime. A production deployment with Tokio comes down to embedding the causal model into a regular request handler.
Where to go from here
Section titled “Where to go from here”The Concepts section elaborates each primitive in detail. For a worked example of how the seventeen innovations compose in one pipeline, the Why DeepCausality page walks through the avionics flight envelope monitor end to end. For physics, see the Multi-physics section on the Problem page, which walks through the GRMHD example as a five-step bind chain.